generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 177
/
Copy pathbase.js
4 lines (3 loc) · 6.18 KB
/
base.js
1
2
3
4
/* eslint-disable */
/* Generated by Milo */
var L=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var E=(s,t)=>{for(var i in t)L(s,i,{get:t[i],enumerable:!0})},b=(s,t,i,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of I(t))!w.call(s,r)&&r!==i&&L(s,r,{get:()=>t[r],enumerable:!(e=O(t,r))||e.enumerable});return s},a=(s,t,i)=>(b(s,t,"default"),i&&b(i,t,"default"));var h={};E(h,{ElementSizes:()=>y,SizedMixin:()=>S,SpectrumElement:()=>c,SpectrumMixin:()=>g,conditionAttributeWithId:()=>P,conditionAttributeWithoutId:()=>A,defineElement:()=>M,streamingListener:()=>T,version:()=>v});function _(s){if(s=Math.trunc(s)||0,s<0&&(s+=this.length),!(s<0||s>=this.length))return this[s]}var C=Reflect.getPrototypeOf(Int8Array);for(let s of[Array,String,C])Object.defineProperty(s.prototype,"at",{value:_,writable:!0,enumerable:!1,configurable:!0});function A(s,t,i){let e=s.getAttribute(t),r=e?e.split(/\s+/):[];r=r.filter(d=>!i.find(n=>d===n)),r.length?s.setAttribute(t,r.join(" ")):s.removeAttribute(t)}function P(s,t,i){let e=Array.isArray(i)?i:[i],r=s.getAttribute(t),d=r?r.split(/\s+/):[];return e.every(n=>d.indexOf(n)>-1)?()=>{}:(d.push(...e),s.setAttribute(t,d.join(" ")),()=>A(s,t,e))}function M(s,t){window.__swc,customElements.define(s,t)}import{property as j}from"../../../deps/lit-all.min.js";var D=Object.defineProperty,R=Object.getOwnPropertyDescriptor,N=(s,t,i,e)=>{for(var r=e>1?void 0:e?R(t,i):t,d=s.length-1,n;d>=0;d--)(n=s[d])&&(r=(e?n(t,i,r):n(r))||r);return e&&r&&D(t,i,r),r},y={xxs:"xxs",xs:"xs",s:"s",m:"m",l:"l",xl:"xl",xxl:"xxl"};function S(s,{validSizes:t=["s","m","l","xl"],noDefaultSize:i,defaultSize:e="m"}={}){class r extends s{constructor(){super(...arguments),this._size=e}get size(){return this._size||e}set size(n){let u=i?null:e,l=n&&n.toLocaleLowerCase(),f=t.includes(l)?l:u;if(f&&this.setAttribute("size",f),this._size===f)return;let z=this._size;this._size=f,this.requestUpdate("size",z)}update(n){!this.hasAttribute("size")&&!i&&this.setAttribute("size",this.size),super.update(n)}}return N([j({type:String})],r.prototype,"size",1),r}import{nothing as H}from"../../../deps/lit-all.min.js";import{AsyncDirective as k,directive as F}from"../../../deps/lit-all.min.js";var m=["",()=>{}],p=class extends k{constructor(){super(...arguments),this.start=m,this.streamInside=m,this.end=m,this.streamOutside=m,this.state="off",this.handleStart=t=>{this.clearStream(),this.callHandler(this.start[1],t),!t.defaultPrevented&&(this.removeListeners(),this.addListeners("on"))},this.handleInside=t=>{this.handleStream(this.streamInside[1],t)},this.handleEnd=t=>{this.clearStream(),this.callHandler(this.end[1],t),this.removeListeners(),this.addListeners("off")},this.handleOutside=t=>{this.handleStream(this.streamOutside[1],t)}}render(t){return H}update(t,[{start:i,end:e,streamInside:r=m,streamOutside:d=m}]){var n;this.element!==t.element&&(this.element=t.element,this.removeListeners()),this.host=((n=t.options)==null?void 0:n.host)||this.element,this.start=i,this.end=e,this.streamInside=r,this.streamOutside=d,this.addListeners()}addListeners(t){this.state=t||this.state,this.state==="off"?(this.addListener(this.streamOutside[0],this.handleOutside),this.addListener(this.start[0],this.handleStart)):this.state==="on"&&(this.addListener(this.streamInside[0],this.handleInside),this.addListener(this.end[0],this.handleEnd))}callHandler(t,i){typeof t=="function"?t.call(this.host,i):t.handleEvent(i)}handleStream(t,i){this.stream||(this.callHandler(t,i),this.stream=requestAnimationFrame(()=>{this.stream=void 0}))}clearStream(){this.stream!=null&&(cancelAnimationFrame(this.stream),this.stream=void 0)}addListener(t,i){Array.isArray(t)?t.map(e=>{this.element.addEventListener(e,i)}):this.element.addEventListener(t,i)}removeListener(t,i){Array.isArray(t)?t.map(e=>{this.element.removeEventListener(e,i)}):this.element.removeEventListener(t,i)}removeListeners(){this.removeListener(this.start[0],this.handleStart),this.removeListener(this.streamInside[0],this.handleInside),this.removeListener(this.end[0],this.handleEnd),this.removeListener(this.streamOutside[0],this.handleOutside)}disconnected(){this.removeListeners()}reconnected(){this.addListeners()}},T=F(p);var v="0.47.2";var o={};E(o,{ElementSizes:()=>y,SizedMixin:()=>S,SpectrumElement:()=>c,SpectrumMixin:()=>g});import{LitElement as q}from"../../../deps/lit-all.min.js";var x=new Set,V=()=>{let s=document.documentElement.dir==="rtl"?document.documentElement.dir:"ltr";x.forEach(t=>{t.setAttribute("dir",s)})},W=new MutationObserver(V);W.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});var U=s=>typeof s.startManagingContentDirection<"u"||s.tagName==="SP-THEME";function g(s){class t extends s{get isLTR(){return this.dir==="ltr"}hasVisibleFocusInTree(){let e=((r=document)=>{var d;let n=r.activeElement;for(;n!=null&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;let u=n?[n]:[];for(;n;){let l=n.assignedSlot||n.parentElement||((d=n.getRootNode())==null?void 0:d.host);l&&u.push(l),n=l}return u})(this.getRootNode())[0];if(!e)return!1;try{return e.matches(":focus-visible")||e.matches(".focus-visible")}catch{return e.matches(".focus-visible")}}connectedCallback(){if(!this.hasAttribute("dir")){let e=this.assignedSlot||this.parentNode;for(;e!==document.documentElement&&!U(e);)e=e.assignedSlot||e.parentNode||e.host;if(this.dir=e.dir==="rtl"?e.dir:this.dir||"ltr",e===document.documentElement)x.add(this);else{let{localName:r}=e;r.search("-")>-1&&!customElements.get(r)?customElements.whenDefined(r).then(()=>{e.startManagingContentDirection(this)}):e.startManagingContentDirection(this)}this._dirParent=e}super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._dirParent&&(this._dirParent===document.documentElement?x.delete(this):this._dirParent.stopManagingContentDirection(this),this.removeAttribute("dir"))}}return t}var c=class extends g(q){};c.VERSION=v;a(o,nt);import*as nt from"../../../deps/lit-all.min.js";a(h,o);export*from"../../../deps/lit-all.min.js";export{y as ElementSizes,S as SizedMixin,c as SpectrumElement,g as SpectrumMixin,P as conditionAttributeWithId,A as conditionAttributeWithoutId,M as defineElement,T as streamingListener,v as version};