UNPKG

@appmate/wishlist

Version:

Wishlist King SDK

34 lines 60.7 kB
var ji=Object.defineProperty;var Be=s=>{throw TypeError(s)};var Ki=(s,t)=>{for(var e in t)ji(s,e,{get:t[e],enumerable:!0})};var ze=(s,t,e)=>t.has(s)||Be("Cannot "+e);var vt=(s,t,e)=>(ze(s,t,"read from private field"),e?e.call(s):t.get(s)),xt=(s,t,e)=>t.has(s)?Be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),$t=(s,t,e,i)=>(ze(s,t,"write to private field"),i?i.call(s,e):t.set(s,e),e);var Ot={};Ki(Ot,{CSSResult:()=>lt,LitElement:()=>D,ReactiveElement:()=>L,_$LE:()=>ns,_$LH:()=>Ee,adoptStyles:()=>Nt,css:()=>Ke,defaultConverter:()=>Bt,getCompatibleStyle:()=>At,html:()=>es,isServer:()=>Us,mathml:()=>ss,noChange:()=>_,notEqual:()=>be,nothing:()=>x,render:()=>_e,supportsAdoptingStyleSheets:()=>St,svg:()=>is,unsafeCSS:()=>we});var Vt=globalThis,St=Vt.ShadowRoot&&(Vt.ShadyCSS===void 0||Vt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ge=Symbol(),je=new WeakMap,lt=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==ge)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(St&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=je.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&je.set(e,t))}return t}toString(){return this.cssText}},we=s=>new lt(typeof s=="string"?s:s+"",void 0,ge),Ke=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((i,n,r)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+s[r+1],s[0]);return new lt(e,s,ge)},Nt=(s,t)=>{if(St)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let i=document.createElement("style"),n=Vt.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=e.cssText,s.appendChild(i)}},At=St?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return we(e)})(s):s;var{is:qi,defineProperty:Yi,getOwnPropertyDescriptor:Xi,getOwnPropertyNames:Zi,getOwnPropertySymbols:Ji,getPrototypeOf:Gi}=Object,z=globalThis,qe=z.trustedTypes,Qi=qe?qe.emptyScript:"",ye=z.reactiveElementPolyfillSupport,Ct=(s,t)=>s,Bt={toAttribute(s,t){switch(t){case Boolean:s=s?Qi:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch(i){e=null}}return e}},be=(s,t)=>!qi(s,t),Ye={attribute:!0,type:String,converter:Bt,reflect:!1,hasChanged:be},Xe,Ze;(Xe=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(Ze=z.litPropertyMetadata)!=null||(z.litPropertyMetadata=new WeakMap);var L=class extends HTMLElement{static addInitializer(t){var e;this._$Ei(),((e=this.l)!=null?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Ye){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(t,i,e);n!==void 0&&Yi(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){var o;let{get:n,set:r}=(o=Xi(this.prototype,t))!=null?o:{get(){return this[e]},set(a){this[e]=a}};return{get(){return n==null?void 0:n.call(this)},set(a){let l=n==null?void 0:n.call(this);r.call(this,a),this.requestUpdate(t,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:Ye}static _$Ei(){if(this.hasOwnProperty(Ct("elementProperties")))return;let t=Gi(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Ct("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ct("properties"))){let e=this.properties,i=[...Zi(e),...Ji(e)];for(let n of i)this.createProperty(n,e[n])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[i,n]of e)this.elementProperties.set(i,n)}this._$Eh=new Map;for(let[e,i]of this.elementProperties){let n=this._$Eu(e,i);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let n of i)e.unshift(At(n))}else t!==void 0&&e.push(At(t));return e}static _$Eu(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e,i;((e=this._$EO)!=null?e:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)==null||i.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return Nt(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(i=>{var n;return(n=i.hostConnected)==null?void 0:n.call(i)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var r;let i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(n!==void 0&&i.reflect===!0){let o=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:Bt).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){var r;let i=this.constructor,n=i._$Eh.get(t);if(n!==void 0&&this._$Em!==n){let o=i.getPropertyOptions(n),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:Bt;this._$Em=n,this[n]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i){var n;if(t!==void 0){if(i!=null||(i=this.constructor.getPropertyOptions(t)),!((n=i.hasChanged)!=null?n:be)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){var n;this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&((n=this._$Ej)!=null?n:this._$Ej=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i,n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((i=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[o,a]of r)a.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],a)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(n=this._$EO)==null||n.forEach(r=>{var o;return(o=r.hostUpdate)==null?void 0:o.call(r)}),this.update(e)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}},Je;L.elementStyles=[],L.shadowRootOptions={mode:"open"},L[Ct("elementProperties")]=new Map,L[Ct("finalized")]=new Map,ye==null||ye({ReactiveElement:L}),((Je=z.reactiveElementVersions)!=null?Je:z.reactiveElementVersions=[]).push("2.0.4");var _t=globalThis,zt=_t.trustedTypes,Ge=zt?zt.createPolicy("lit-html",{createHTML:s=>s}):void 0,$e="$lit$",H=`lit$${Math.random().toFixed(9).slice(2)}$`,Se="?"+H,ts=`<${Se}>`,G=document,Pt=()=>G.createComment(""),Tt=s=>s===null||typeof s!="object"&&typeof s!="function",Ae=Array.isArray,oi=s=>Ae(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",ve=`[ \f\r]`,Et=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Qe=/-->/g,ti=/>/g,Z=RegExp(`>|${ve}(?:([^\\s"'>=/]+)(${ve}*=${ve}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ei=/'/g,ii=/"/g,ri=/^(?:script|style|textarea|title)$/i,Ce=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),es=Ce(1),is=Ce(2),ss=Ce(3),_=Symbol.for("lit-noChange"),x=Symbol.for("lit-nothing"),si=new WeakMap,J=G.createTreeWalker(G,129);function ai(s,t){if(!Ae(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ge!==void 0?Ge.createHTML(t):t}var li=(s,t)=>{let e=s.length-1,i=[],n,r=t===2?"<svg>":t===3?"<math>":"",o=Et;for(let a=0;a<e;a++){let l=s[a],c,d,h=-1,f=0;for(;f<l.length&&(o.lastIndex=f,d=o.exec(l),d!==null);)f=o.lastIndex,o===Et?d[1]==="!--"?o=Qe:d[1]!==void 0?o=ti:d[2]!==void 0?(ri.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Z):d[3]!==void 0&&(o=Z):o===Z?d[0]===">"?(o=n!=null?n:Et,h=-1):d[1]===void 0?h=-2:(h=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Z:d[3]==='"'?ii:ei):o===ii||o===ei?o=Z:o===Qe||o===ti?o=Et:(o=Z,n=void 0);let u=o===Z&&s[a+1].startsWith("/>")?" ":"";r+=o===Et?l+ts:h>=0?(i.push(c),l.slice(0,h)+$e+l.slice(h)+H+u):l+H+(h===-2?a:u)}return[ai(s,r+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},kt=class s{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,o=0,a=t.length-1,l=this.parts,[c,d]=li(t,e);if(this.el=s.createElement(c,i),J.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=J.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let h of n.getAttributeNames())if(h.endsWith($e)){let f=d[o++],u=n.getAttribute(h).split(H),p=/([.?@])?(.*)/.exec(f);l.push({type:1,index:r,name:p[2],strings:u,ctor:p[1]==="."?Kt:p[1]==="?"?qt:p[1]==="@"?Yt:tt}),n.removeAttribute(h)}else h.startsWith(H)&&(l.push({type:6,index:r}),n.removeAttribute(h));if(ri.test(n.tagName)){let h=n.textContent.split(H),f=h.length-1;if(f>0){n.textContent=zt?zt.emptyScript:"";for(let u=0;u<f;u++)n.append(h[u],Pt()),J.nextNode(),l.push({type:2,index:++r});n.append(h[f],Pt())}}}else if(n.nodeType===8)if(n.data===Se)l.push({type:2,index:r});else{let h=-1;for(;(h=n.data.indexOf(H,h+1))!==-1;)l.push({type:7,index:r}),h+=H.length-1}r++}}static createElement(t,e){let i=G.createElement("template");return i.innerHTML=t,i}};function Q(s,t,e=s,i){var o,a,l;if(t===_)return t;let n=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl,r=Tt(t)?void 0:t._$litDirective$;return(n==null?void 0:n.constructor)!==r&&((a=n==null?void 0:n._$AO)==null||a.call(n,!1),r===void 0?n=void 0:(n=new r(s),n._$AT(s,e,i)),i!==void 0?((l=e._$Co)!=null?l:e._$Co=[])[i]=n:e._$Cl=n),n!==void 0&&(t=Q(s,n._$AS(s,t.values),n,i)),t}var jt=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var c;let{el:{content:e},parts:i}=this._$AD,n=((c=t==null?void 0:t.creationScope)!=null?c:G).importNode(e,!0);J.currentNode=n;let r=J.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let d;l.type===2?d=new ct(r,r.nextSibling,this,t):l.type===1?d=new l.ctor(r,l.name,l.strings,this,t):l.type===6&&(d=new Xt(r,this,t)),this._$AV.push(d),l=i[++a]}o!==(l==null?void 0:l.index)&&(r=J.nextNode(),o++)}return J.currentNode=G,n}p(t){let e=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},ct=class s{get _$AU(){var t,e;return(e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this._$Cv}constructor(t,e,i,n){var r;this.type=2,this._$AH=x,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cv=(r=n==null?void 0:n.isConnected)!=null?r:!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Q(this,t,e),Tt(t)?t===x||t==null||t===""?(this._$AH!==x&&this._$AR(),this._$AH=x):t!==this._$AH&&t!==_&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):oi(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==x&&Tt(this._$AH)?this._$AA.nextSibling.data=t:this.T(G.createTextNode(t)),this._$AH=t}$(t){var r;let{values:e,_$litType$:i}=t,n=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=kt.createElement(ai(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===n)this._$AH.p(e);else{let o=new jt(n,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=si.get(t.strings);return e===void 0&&si.set(t.strings,e=new kt(t)),e}k(t){Ae(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,n=0;for(let r of t)n===e.length?e.push(i=new s(this.O(Pt()),this.O(Pt()),this,this.options)):i=e[n],i._$AI(r),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){let n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},tt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,n,r){this.type=1,this._$AH=x,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=x}_$AI(t,e=this,i,n){let r=this.strings,o=!1;if(r===void 0)t=Q(this,t,e,0),o=!Tt(t)||t!==this._$AH&&t!==_,o&&(this._$AH=t);else{let a=t,l,c;for(t=r[0],l=0;l<r.length-1;l++)c=Q(this,a[i+l],e,l),c===_&&(c=this._$AH[l]),o||(o=!Tt(c)||c!==this._$AH[l]),c===x?t=x:t!==x&&(t+=(c!=null?c:"")+r[l+1]),this._$AH[l]=c}o&&!n&&this.j(t)}j(t){t===x?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},Kt=class extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===x?void 0:t}},qt=class extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==x)}},Yt=class extends tt{constructor(t,e,i,n,r){super(t,e,i,n,r),this.type=5}_$AI(t,e=this){var o;if((t=(o=Q(this,t,e,0))!=null?o:x)===_)return;let i=this._$AH,n=t===x&&i!==x||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==x&&(i===x||n);n&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;typeof this._$AH=="function"?this._$AH.call((i=(e=this.options)==null?void 0:e.host)!=null?i:this.element,t):this._$AH.handleEvent(t)}},Xt=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Q(this,t)}},Ee={M:$e,P:H,A:Se,C:1,L:li,R:jt,D:oi,V:Q,I:ct,H:tt,N:qt,U:Yt,B:Kt,F:Xt},xe=_t.litHtmlPolyfillSupport,ni;xe==null||xe(kt,ct),((ni=_t.litHtmlVersions)!=null?ni:_t.litHtmlVersions=[]).push("3.2.1");var _e=(s,t,e)=>{var r,o;let i=(r=e==null?void 0:e.renderBefore)!=null?r:t,n=i._$litPart$;if(n===void 0){let a=(o=e==null?void 0:e.renderBefore)!=null?o:null;i._$litPart$=n=new ct(t.insertBefore(Pt(),a),a,void 0,e!=null?e:{})}return n._$AI(s),n};var D=class extends L{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,i;let t=super.createRenderRoot();return(i=(e=this.renderOptions).renderBefore)!=null||(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=_e(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return _}},ci;D._$litElement$=!0,D.finalized=!0,(ci=globalThis.litElementHydrateSupport)==null||ci.call(globalThis,{LitElement:D});var Pe=globalThis.litElementPolyfillSupport;Pe==null||Pe({LitElement:D});var ns={_$AK:(s,t,e)=>{s._$AK(t,e)},_$AL:s=>s._$AL},hi;((hi=globalThis.litElementVersions)!=null?hi:globalThis.litElementVersions=[]).push("4.1.1");var Us=!1;var Zt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Jt=s=>(...t)=>({_$litDirective$:s,values:t}),ht=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var{I:os}=Ee;var ui=()=>document.createComment(""),ut=(s,t,e)=>{var r;let i=s._$AA.parentNode,n=t===void 0?s._$AB:t._$AA;if(e===void 0){let o=i.insertBefore(ui(),n),a=i.insertBefore(ui(),n);e=new os(o,a,s,s.options)}else{let o=e._$AB.nextSibling,a=e._$AM,l=a!==s;if(l){let c;(r=e._$AQ)==null||r.call(e,s),e._$AM=s,e._$AP!==void 0&&(c=s._$AU)!==a._$AU&&e._$AP(c)}if(o!==n||l){let c=e._$AA;for(;c!==o;){let d=c.nextSibling;i.insertBefore(c,n),c=d}}}return e},j=(s,t,e=s)=>(s._$AI(t,e),s),rs={},di=(s,t=rs)=>s._$AH=t,fi=s=>s._$AH,Gt=s=>{var i;(i=s._$AP)==null||i.call(s,!1,!0);let t=s._$AA,e=s._$AB.nextSibling;for(;t!==e;){let n=t.nextSibling;t.remove(),t=n}};var pi=(s,t,e)=>{let i=new Map;for(let n=t;n<=e;n++)i.set(s[n],n);return i},Qt=Jt(class extends ht{constructor(s){if(super(s),s.type!==Zt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);let n=[],r=[],o=0;for(let a of s)n[o]=i?i(a,o):o,r[o]=e(a,o),o++;return{values:r,keys:n}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){var g;let n=fi(s),{values:r,keys:o}=this.dt(t,e,i);if(!Array.isArray(n))return this.ut=o,r;let a=(g=this.ut)!=null?g:this.ut=[],l=[],c,d,h=0,f=n.length-1,u=0,p=r.length-1;for(;h<=f&&u<=p;)if(n[h]===null)h++;else if(n[f]===null)f--;else if(a[h]===o[u])l[u]=j(n[h],r[u]),h++,u++;else if(a[f]===o[p])l[p]=j(n[f],r[p]),f--,p--;else if(a[h]===o[p])l[p]=j(n[h],r[p]),ut(s,l[p+1],n[h]),h++,p--;else if(a[f]===o[u])l[u]=j(n[f],r[u]),ut(s,n[h],n[f]),f--,u++;else if(c===void 0&&(c=pi(o,u,p),d=pi(a,h,f)),c.has(a[h]))if(c.has(a[f])){let m=d.get(o[u]),w=m!==void 0?n[m]:null;if(w===null){let y=ut(s,n[h]);j(y,r[u]),l[u]=y}else l[u]=j(w,r[u]),ut(s,n[h],w),n[m]=null;u++}else Gt(n[f]),f--;else Gt(n[h]),h++;for(;u<=p;){let m=ut(s,l[p+1]);j(m,r[u]),l[u++]=m}for(;h<=f;){let m=n[h++];m!==null&&Gt(m)}return this.ut=o,di(s,l),_}});var K=Math.min,W=Math.max,It=Math.round,Mt=Math.floor,O=s=>({x:s,y:s}),as={left:"right",right:"left",bottom:"top",top:"bottom"},ls={start:"end",end:"start"};function ee(s,t,e){return W(s,K(t,e))}function dt(s,t){return typeof s=="function"?s(t):s}function q(s){return s.split("-")[0]}function ft(s){return s.split("-")[1]}function Te(s){return s==="x"?"y":"x"}function ie(s){return s==="y"?"height":"width"}function et(s){return["top","bottom"].includes(q(s))?"y":"x"}function se(s){return Te(et(s))}function mi(s,t,e){e===void 0&&(e=!1);let i=ft(s),n=se(s),r=ie(n),o=n==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(o=Rt(o)),[o,Rt(o)]}function gi(s){let t=Rt(s);return[te(s),t,te(t)]}function te(s){return s.replace(/start|end/g,t=>ls[t])}function cs(s,t,e){let i=["left","right"],n=["right","left"],r=["top","bottom"],o=["bottom","top"];switch(s){case"top":case"bottom":return e?t?n:i:t?i:n;case"left":case"right":return t?r:o;default:return[]}}function wi(s,t,e,i){let n=ft(s),r=cs(q(s),e==="start",i);return n&&(r=r.map(o=>o+"-"+n),t&&(r=r.concat(r.map(te)))),r}function Rt(s){return s.replace(/left|right|bottom|top/g,t=>as[t])}function hs(s){return{top:0,right:0,bottom:0,left:0,...s}}function ke(s){return typeof s!="number"?hs(s):{top:s,right:s,bottom:s,left:s}}function it(s){let{x:t,y:e,width:i,height:n}=s;return{width:i,height:n,top:e,left:t,right:t+i,bottom:e+n,x:t,y:e}}function yi(s,t,e){let{reference:i,floating:n}=s,r=et(t),o=se(t),a=ie(o),l=q(t),c=r==="y",d=i.x+i.width/2-n.width/2,h=i.y+i.height/2-n.height/2,f=i[a]/2-n[a]/2,u;switch(l){case"top":u={x:d,y:i.y-n.height};break;case"bottom":u={x:d,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:h};break;case"left":u={x:i.x-n.width,y:h};break;default:u={x:i.x,y:i.y}}switch(ft(t)){case"start":u[o]-=f*(e&&c?-1:1);break;case"end":u[o]+=f*(e&&c?-1:1);break}return u}var bi=async(s,t,e)=>{let{placement:i="bottom",strategy:n="absolute",middleware:r=[],platform:o}=e,a=r.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t)),c=await o.getElementRects({reference:s,floating:t,strategy:n}),{x:d,y:h}=yi(c,i,l),f=i,u={},p=0;for(let g=0;g<a.length;g++){let{name:m,fn:w}=a[g],{x:y,y:b,data:$,reset:v}=await w({x:d,y:h,initialPlacement:i,placement:f,strategy:n,middlewareData:u,rects:c,platform:o,elements:{reference:s,floating:t}});d=y!=null?y:d,h=b!=null?b:h,u={...u,[m]:{...u[m],...$}},v&&p<=50&&(p++,typeof v=="object"&&(v.placement&&(f=v.placement),v.rects&&(c=v.rects===!0?await o.getElementRects({reference:s,floating:t,strategy:n}):v.rects),{x:d,y:h}=yi(c,f,l)),g=-1)}return{x:d,y:h,placement:f,strategy:n,middlewareData:u}};async function Oe(s,t){var e;t===void 0&&(t={});let{x:i,y:n,platform:r,rects:o,elements:a,strategy:l}=s,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:u=0}=dt(t,s),p=ke(u),m=a[f?h==="floating"?"reference":"floating":h],w=it(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(m)))==null||e?m:m.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),y=h==="floating"?{x:i,y:n,width:o.floating.width,height:o.floating.height}:o.reference,b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),$=await(r.isElement==null?void 0:r.isElement(b))?await(r.getScale==null?void 0:r.getScale(b))||{x:1,y:1}:{x:1,y:1},v=it(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:b,strategy:l}):y);return{top:(w.top-v.top+p.top)/$.y,bottom:(v.bottom-w.bottom+p.bottom)/$.y,left:(w.left-v.left+p.left)/$.x,right:(v.right-w.right+p.right)/$.x}}var vi=s=>({name:"arrow",options:s,async fn(t){let{x:e,y:i,placement:n,rects:r,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=dt(s,t)||{};if(c==null)return{};let h=ke(d),f={x:e,y:i},u=se(n),p=ie(u),g=await o.getDimensions(c),m=u==="y",w=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",$=r.reference[p]+r.reference[u]-f[u]-r.floating[p],v=f[u]-r.reference[u],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c)),k=E?E[b]:0;(!k||!await(o.isElement==null?void 0:o.isElement(E)))&&(k=a.floating[b]||r.floating[p]);let wt=$/2-v/2,Y=k/2-g[p]/2-1,V=K(h[w],Y),yt=K(h[y],Y),X=V,bt=k-g[p]-yt,A=k/2-g[p]/2+wt,at=ee(X,A,bt),F=!l.arrow&&ft(n)!=null&&A!==at&&r.reference[p]/2-(A<X?V:yt)-g[p]/2<0,M=F?A<X?A-X:A-bt:0;return{[u]:f[u]+M,data:{[u]:at,centerOffset:A-at-M,...F&&{alignmentOffset:M}},reset:F}}});var xi=function(s){return s===void 0&&(s={}),{name:"flip",options:s,async fn(t){var e,i;let{placement:n,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...m}=dt(s,t);if((e=r.arrow)!=null&&e.alignmentOffset)return{};let w=q(n),y=et(a),b=q(a)===a,$=await(l.isRTL==null?void 0:l.isRTL(c.floating)),v=f||(b||!g?[Rt(a)]:gi(a)),E=p!=="none";!f&&E&&v.push(...wi(a,g,p,$));let k=[a,...v],wt=await Oe(t,m),Y=[],V=((i=r.flip)==null?void 0:i.overflows)||[];if(d&&Y.push(wt[w]),h){let A=mi(n,o,$);Y.push(wt[A[0]],wt[A[1]])}if(V=[...V,{placement:n,overflows:Y}],!Y.every(A=>A<=0)){var yt,X;let A=(((yt=r.flip)==null?void 0:yt.index)||0)+1,at=k[A];if(at)return{data:{index:A,overflows:V},reset:{placement:at}};let F=(X=V.filter(M=>M.overflows[0]<=0).sort((M,N)=>M.overflows[1]-N.overflows[1])[0])==null?void 0:X.placement;if(!F)switch(u){case"bestFit":{var bt;let M=(bt=V.filter(N=>{if(E){let B=et(N.placement);return B===y||B==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(B=>B>0).reduce((B,zi)=>B+zi,0)]).sort((N,B)=>N[1]-B[1])[0])==null?void 0:bt[0];M&&(F=M);break}case"initialPlacement":F=a;break}if(n!==F)return{reset:{placement:F}}}return{}}}};async function us(s,t){let{placement:e,platform:i,elements:n}=s,r=await(i.isRTL==null?void 0:i.isRTL(n.floating)),o=q(e),a=ft(e),l=et(e)==="y",c=["left","top"].includes(o)?-1:1,d=r&&l?-1:1,h=dt(t,s),{mainAxis:f,crossAxis:u,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof p=="number"&&(u=a==="end"?p*-1:p),l?{x:u*d,y:f*c}:{x:f*c,y:u*d}}var $i=function(s){return s===void 0&&(s=0),{name:"offset",options:s,async fn(t){var e,i;let{x:n,y:r,placement:o,middlewareData:a}=t,l=await us(t,s);return o===((e=a.offset)==null?void 0:e.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:n+l.x,y:r+l.y,data:{...l,placement:o}}}}},Si=function(s){return s===void 0&&(s={}),{name:"shift",options:s,async fn(t){let{x:e,y:i,placement:n}=t,{mainAxis:r=!0,crossAxis:o=!1,limiter:a={fn:m=>{let{x:w,y}=m;return{x:w,y}}},...l}=dt(s,t),c={x:e,y:i},d=await Oe(t,l),h=et(q(n)),f=Te(h),u=c[f],p=c[h];if(r){let m=f==="y"?"top":"left",w=f==="y"?"bottom":"right",y=u+d[m],b=u-d[w];u=ee(y,u,b)}if(o){let m=h==="y"?"top":"left",w=h==="y"?"bottom":"right",y=p+d[m],b=p-d[w];p=ee(y,p,b)}let g=a.fn({...t,[f]:u,[h]:p});return{...g,data:{x:g.x-e,y:g.y-i,enabled:{[f]:r,[h]:o}}}}}};function ne(){return typeof window!="undefined"}function st(s){return Ci(s)?(s.nodeName||"").toLowerCase():"#document"}function C(s){var t;return(s==null||(t=s.ownerDocument)==null?void 0:t.defaultView)||window}function R(s){var t;return(t=(Ci(s)?s.ownerDocument:s.document)||window.document)==null?void 0:t.documentElement}function Ci(s){return ne()?s instanceof Node||s instanceof C(s).Node:!1}function P(s){return ne()?s instanceof Element||s instanceof C(s).Element:!1}function I(s){return ne()?s instanceof HTMLElement||s instanceof C(s).HTMLElement:!1}function Ai(s){return!ne()||typeof ShadowRoot=="undefined"?!1:s instanceof ShadowRoot||s instanceof C(s).ShadowRoot}function mt(s){let{overflow:t,overflowX:e,overflowY:i,display:n}=T(s);return/auto|scroll|overlay|hidden|clip/.test(t+i+e)&&!["inline","contents"].includes(n)}function Ei(s){return["table","td","th"].includes(st(s))}function Lt(s){return[":popover-open",":modal"].some(t=>{try{return s.matches(t)}catch(e){return!1}})}function oe(s){let t=re(),e=P(s)?T(s):s;return e.transform!=="none"||e.perspective!=="none"||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(e.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(e.contain||"").includes(i))}function _i(s){let t=U(s);for(;I(t)&&!nt(t);){if(oe(t))return t;if(Lt(t))return null;t=U(t)}return null}function re(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function nt(s){return["html","body","#document"].includes(st(s))}function T(s){return C(s).getComputedStyle(s)}function Ft(s){return P(s)?{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}:{scrollLeft:s.scrollX,scrollTop:s.scrollY}}function U(s){if(st(s)==="html")return s;let t=s.assignedSlot||s.parentNode||Ai(s)&&s.host||R(s);return Ai(t)?t.host:t}function Pi(s){let t=U(s);return nt(t)?s.ownerDocument?s.ownerDocument.body:s.body:I(t)&&mt(t)?t:Pi(t)}function pt(s,t,e){var i;t===void 0&&(t=[]),e===void 0&&(e=!0);let n=Pi(s),r=n===((i=s.ownerDocument)==null?void 0:i.body),o=C(n);if(r){let a=ae(o);return t.concat(o,o.visualViewport||[],mt(n)?n:[],a&&e?pt(a):[])}return t.concat(n,pt(n,[],e))}function ae(s){return s.parent&&Object.getPrototypeOf(s.parent)?s.frameElement:null}function Oi(s){let t=T(s),e=parseFloat(t.width)||0,i=parseFloat(t.height)||0,n=I(s),r=n?s.offsetWidth:e,o=n?s.offsetHeight:i,a=It(e)!==r||It(i)!==o;return a&&(e=r,i=o),{width:e,height:i,$:a}}function Ie(s){return P(s)?s:s.contextElement}function gt(s){let t=Ie(s);if(!I(t))return O(1);let e=t.getBoundingClientRect(),{width:i,height:n,$:r}=Oi(t),o=(r?It(e.width):e.width)/i,a=(r?It(e.height):e.height)/n;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var ds=O(0);function Ri(s){let t=C(s);return!re()||!t.visualViewport?ds:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fs(s,t,e){return t===void 0&&(t=!1),!e||t&&e!==C(s)?!1:t}function ot(s,t,e,i){t===void 0&&(t=!1),e===void 0&&(e=!1);let n=s.getBoundingClientRect(),r=Ie(s),o=O(1);t&&(i?P(i)&&(o=gt(i)):o=gt(s));let a=fs(r,e,i)?Ri(r):O(0),l=(n.left+a.x)/o.x,c=(n.top+a.y)/o.y,d=n.width/o.x,h=n.height/o.y;if(r){let f=C(r),u=i&&P(i)?C(i):i,p=f,g=ae(p);for(;g&&i&&u!==p;){let m=gt(g),w=g.getBoundingClientRect(),y=T(g),b=w.left+(g.clientLeft+parseFloat(y.paddingLeft))*m.x,$=w.top+(g.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,d*=m.x,h*=m.y,l+=b,c+=$,p=C(g),g=ae(p)}}return it({width:d,height:h,x:l,y:c})}function Me(s,t){let e=Ft(s).scrollLeft;return t?t.left+e:ot(R(s)).left+e}function Ii(s,t,e){e===void 0&&(e=!1);let i=s.getBoundingClientRect(),n=i.left+t.scrollLeft-(e?0:Me(s,i)),r=i.top+t.scrollTop;return{x:n,y:r}}function ps(s){let{elements:t,rect:e,offsetParent:i,strategy:n}=s,r=n==="fixed",o=R(i),a=t?Lt(t.floating):!1;if(i===o||a&&r)return e;let l={scrollLeft:0,scrollTop:0},c=O(1),d=O(0),h=I(i);if((h||!h&&!r)&&((st(i)!=="body"||mt(o))&&(l=Ft(i)),I(i))){let u=ot(i);c=gt(i),d.x=u.x+i.clientLeft,d.y=u.y+i.clientTop}let f=o&&!h&&!r?Ii(o,l,!0):O(0);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:e.y*c.y-l.scrollTop*c.y+d.y+f.y}}function ms(s){return Array.from(s.getClientRects())}function gs(s){let t=R(s),e=Ft(s),i=s.ownerDocument.body,n=W(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=W(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight),o=-e.scrollLeft+Me(s),a=-e.scrollTop;return T(i).direction==="rtl"&&(o+=W(t.clientWidth,i.clientWidth)-n),{width:n,height:r,x:o,y:a}}function ws(s,t){let e=C(s),i=R(s),n=e.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(n){r=n.width,o=n.height;let c=re();(!c||c&&t==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:r,height:o,x:a,y:l}}function ys(s,t){let e=ot(s,!0,t==="fixed"),i=e.top+s.clientTop,n=e.left+s.clientLeft,r=I(s)?gt(s):O(1),o=s.clientWidth*r.x,a=s.clientHeight*r.y,l=n*r.x,c=i*r.y;return{width:o,height:a,x:l,y:c}}function Ti(s,t,e){let i;if(t==="viewport")i=ws(s,e);else if(t==="document")i=gs(R(s));else if(P(t))i=ys(t,e);else{let n=Ri(s);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return it(i)}function Mi(s,t){let e=U(s);return e===t||!P(e)||nt(e)?!1:T(e).position==="fixed"||Mi(e,t)}function bs(s,t){let e=t.get(s);if(e)return e;let i=pt(s,[],!1).filter(a=>P(a)&&st(a)!=="body"),n=null,r=T(s).position==="fixed",o=r?U(s):s;for(;P(o)&&!nt(o);){let a=T(o),l=oe(o);!l&&a.position==="fixed"&&(n=null),(r?!l&&!n:!l&&a.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||mt(o)&&!l&&Mi(s,o))?i=i.filter(d=>d!==o):n=a,o=U(o)}return t.set(s,i),i}function vs(s){let{element:t,boundary:e,rootBoundary:i,strategy:n}=s,o=[...e==="clippingAncestors"?Lt(t)?[]:bs(t,this._c):[].concat(e),i],a=o[0],l=o.reduce((c,d)=>{let h=Ti(t,d,n);return c.top=W(h.top,c.top),c.right=K(h.right,c.right),c.bottom=K(h.bottom,c.bottom),c.left=W(h.left,c.left),c},Ti(t,a,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function xs(s){let{width:t,height:e}=Oi(s);return{width:t,height:e}}function $s(s,t,e){let i=I(t),n=R(t),r=e==="fixed",o=ot(s,!0,r,t),a={scrollLeft:0,scrollTop:0},l=O(0);if(i||!i&&!r)if((st(t)!=="body"||mt(n))&&(a=Ft(t)),i){let f=ot(t,!0,r,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else n&&(l.x=Me(n));let c=n&&!i&&!r?Ii(n,a):O(0),d=o.left+a.scrollLeft-l.x-c.x,h=o.top+a.scrollTop-l.y-c.y;return{x:d,y:h,width:o.width,height:o.height}}function Re(s){return T(s).position==="static"}function ki(s,t){if(!I(s)||T(s).position==="fixed")return null;if(t)return t(s);let e=s.offsetParent;return R(s)===e&&(e=e.ownerDocument.body),e}function Li(s,t){let e=C(s);if(Lt(s))return e;if(!I(s)){let n=U(s);for(;n&&!nt(n);){if(P(n)&&!Re(n))return n;n=U(n)}return e}let i=ki(s,t);for(;i&&Ei(i)&&Re(i);)i=ki(i,t);return i&&nt(i)&&Re(i)&&!oe(i)?e:i||_i(s)||e}var Ss=async function(s){let t=this.getOffsetParent||Li,e=this.getDimensions,i=await e(s.floating);return{reference:$s(s.reference,await t(s.floating),s.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function As(s){return T(s).direction==="rtl"}var Cs={convertOffsetParentRelativeRectToViewportRelativeRect:ps,getDocumentElement:R,getClippingRect:vs,getOffsetParent:Li,getElementRects:Ss,getClientRects:ms,getDimensions:xs,getScale:gt,isElement:P,isRTL:As};function Es(s,t){let e=null,i,n=R(s);function r(){var a;clearTimeout(i),(a=e)==null||a.disconnect(),e=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),r();let{left:c,top:d,width:h,height:f}=s.getBoundingClientRect();if(a||t(),!h||!f)return;let u=Mt(d),p=Mt(n.clientWidth-(c+h)),g=Mt(n.clientHeight-(d+f)),m=Mt(c),y={rootMargin:-u+"px "+-p+"px "+-g+"px "+-m+"px",threshold:W(0,K(1,l))||1},b=!0;function $(v){let E=v[0].intersectionRatio;if(E!==l){if(!b)return o();E?o(!1,E):i=setTimeout(()=>{o(!1,1e-7)},1e3)}b=!1}try{e=new IntersectionObserver($,{...y,root:n.ownerDocument})}catch(v){e=new IntersectionObserver($,y)}e.observe(s)}return o(!0),r}function Fi(s,t,e,i){i===void 0&&(i={});let{ancestorScroll:n=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=Ie(s),d=n||r?[...c?pt(c):[],...pt(t)]:[];d.forEach(w=>{n&&w.addEventListener("scroll",e,{passive:!0}),r&&w.addEventListener("resize",e)});let h=c&&a?Es(c,e):null,f=-1,u=null;o&&(u=new ResizeObserver(w=>{let[y]=w;y&&y.target===c&&u&&(u.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=u)==null||b.observe(t)})),e()}),c&&!l&&u.observe(c),u.observe(t));let p,g=l?ot(s):null;l&&m();function m(){let w=ot(s);g&&(w.x!==g.x||w.y!==g.y||w.width!==g.width||w.height!==g.height)&&e(),g=w,p=requestAnimationFrame(m)}return e(),()=>{var w;d.forEach(y=>{n&&y.removeEventListener("scroll",e),r&&y.removeEventListener("resize",e)}),h==null||h(),(w=u)==null||w.disconnect(),u=null,l&&cancelAnimationFrame(p)}}var Le=$i;var Hi=Si,Di=xi;var Wi=vi;var Ui=(s,t,e)=>{let i=new Map,n={platform:Cs,...e},r={...n.platform,_c:i};return bi(s,t,{...n,platform:r})};var rt=class{constructor(t){this._middleware=[];this._floating=!1;(this.host=t).addController(this)}hostConnected(){this.host.floating&&this.float(this.host.floating)}hostDisconnected(){this.destroy()}hostUpdated(){this.host.floating&&!this._floating&&this.float(this.host.floating),this._floating&&this.updatePosition()}hostResized(){this._floating&&this.updatePosition()}float(t){var l;if(this._floating)return;if(this._floating=!0,this._settings=t,this._reference=this.getReference(),this._resizeObserver=new ResizeObserver(()=>this.hostResized()),!this._settings)throw new Error("Floating settings are required");if(!this._reference)throw new Error("Floating reference is required");this.host.classList.add("wk-floating");let{position:e,arrow:i=!1,flip:n=!1,shift:r=!1,animationFrame:o=!1}=this._settings,a=this.getOffsetSetting();Object.assign(this.host.style,{position:(l=e.strategy)!=null?l:"absolute",top:"0",left:"0",transition:"none",transform:"translate3d(0,0,0)"}),e.inset&&!i?this._middleware.push(Le(({rects:c,placement:d})=>{var h,f,u,p,g,m;return d.includes("top")||d.includes("bottom")?{mainAxis:-c.floating.height-((h=a==null?void 0:a.mainAxis)!=null?h:0),crossAxis:(f=a==null?void 0:a.crossAxis)!=null?f:0,alignmentAxis:(u=a==null?void 0:a.alignmentAxis)!=null?u:0}:{mainAxis:-c.floating.width-((p=a==null?void 0:a.mainAxis)!=null?p:0),crossAxis:(g=a==null?void 0:a.crossAxis)!=null?g:0,alignmentAxis:(m=a==null?void 0:a.alignmentAxis)!=null?m:0}})):a&&this._middleware.push(Le(a)),n&&this._middleware.push(Di()),r&&this._middleware.push(Hi()),i&&(this.arrowEl=document.createElement("div"),this.arrowEl.classList.add("wk-arrow"),this._middleware.push(Wi({element:this.arrowEl}))),this.cleanupAutoUpdate=Fi(this._reference,this.host,()=>{this.updatePosition()},{animationFrame:o}),this._resizeObserver.observe(this.host)}getOffsetSetting(){var e,i;let t=(e=this._settings)==null?void 0:e.offset;if(!(!t||typeof t=="boolean"))return typeof t=="number"?{mainAxis:t,alignmentAxis:(i=this._settings)!=null&&i.position.inset?t:null}:t}destroy(){var t,e,i,n;this._floating&&(Object.assign(this.host.style,{position:"",top:"",left:"",transition:"",transform:""}),(e=(t=this.arrowEl)==null?void 0:t.parentElement)==null||e.removeChild(this.arrowEl),this.arrowEl=void 0,this._middleware=[],this.host.classList.remove("wk-floating"),(i=this.cleanupAutoUpdate)==null||i.call(this),(n=this._resizeObserver)==null||n.disconnect(),this._floating=!1)}updatePosition(){var i;if(!this._reference||!this._settings)return;let{strategy:t="absolute",placement:e="top"}=(i=this._settings.position)!=null?i:{};Ui(this._reference,this.host,{middleware:this._middleware,strategy:t,placement:e}).then(({x:n,y:r,placement:o,middlewareData:a})=>{if(a.arrow&&this.arrowEl){let{x:l,y:c}=a.arrow,d={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]],h={bottom:"0deg",left:"90deg",top:"180deg",right:"270deg"}[o.split("-")[0]];Object.assign(this.arrowEl.style,{left:l!=null?`${l}px`:"",top:c!=null?`${c}px`:"",right:"",bottom:"",[d]:"-5px",transform:`rotate(${h})`})}Object.assign(this.host.style,{transform:`translate3d(${Math.round(n)}px,${Math.round(r)}px,0)`})})}getReference(){if(!this._settings)return;let t=this._settings.reference;if(typeof t=="string"){if(t==="viewport")return this.createViewportReference();let e=document.querySelector(t);if(!e)throw new Error(`Floating reference element (${t}) not found`);return e}return t.hasOwnProperty("element")?t.element:t}createViewportReference(){return{getBoundingClientRect(){var t,e,i,n;return{x:0,y:0,top:0,left:0,bottom:0,right:0,width:(e=(t=window.visualViewport)==null?void 0:t.width)!=null?e:0,height:(n=(i=window.visualViewport)==null?void 0:i.height)!=null?n:0}}}}};var Fe=class{constructor(t){this.product=null;this.selectedVariant=null;this.selectedOptions={};this.hasSelection=!1;this.optionsWithValues=[];this.hasOnlyDefaultVariant=!1;(this.host=t).addController(this)}set submitting(t){var e;(e=this.host.querySelector("form"))==null||e.classList.toggle("wk-submitting",t)}get submitting(){var t,e;return(e=(t=this.host.querySelector("form"))==null?void 0:t.classList.contains("wk-submitting"))!=null?e:!1}setProduct({product:t,selectedVariantId:e,autoSelect:i=!1}){t!=null&&t.variants.length&&(this.product=t,this.initFormState({selectedVariantId:e,autoSelect:i}))}initFormState({selectedVariantId:t,autoSelect:e}){if(!this.product)throw new Error("Product not set");let i=this.initializedVariantId!==t?this.product.variants.find(r=>r.id===t):this.selectedVariant;this.initializedVariantId=t;let n=this.host.app.utils.product.getVariantOptions({variant:i});this.updateFormState({options:n,autoSelect:e})}updateFormState({options:t,change:e,autoSelect:i=!1}){if(!this.product)throw new Error("Product not set");let{hasSelection:n,optionsWithValues:r,selectedOptions:o,selectedVariant:a,hasOnlyDefaultVariant:l}=this.host.app.utils.product.getFormState({product:this.product,options:t,change:e,autoSelect:i});this.hasSelection=n,this.optionsWithValues=r,this.selectedOptions=o,this.selectedVariant=a,this.hasOnlyDefaultVariant=l,this.host.requestUpdate()}changeOption({input:t,autoSelect:e=!1}){if(!this.product)throw new Error("Product not set");let i=this.getInputOption(t);if(!i)throw new Error("Cannot parse options from input");this.updateFormState({options:this.selectedOptions,change:i,autoSelect:e})}addToCart({wishlistId:t,wishlistItemId:e,quantity:i,sectionsToRender:n,sectionsUrl:r="/"}){if(!this.selectedVariant)throw new Error("No variant selected");let o=this.host.querySelector("form");if(!o)throw new Error("Form not found");return this.submitting=!0,this.host.app.addToCart({wishlistId:t,wishlistItemId:e,variantId:this.selectedVariant.id,quantity:i!=null?i:this.host.app.utils.product.getFormQuantity({form:o}),properties:this.host.app.utils.product.getFormProperties({form:o}),sectionsToRender:n,sectionsUrl:r}).finally(()=>{this.submitting=!1})}getInputOption(t){if(!this.product)throw new Error("Product not set");return this.host.app.utils.product.getInputOption({input:t,product:this.product})}hostConnected(){}hostDisconnected(){}hostUpdate(){}hostUpdated(){}};var He,Vi=s=>(!!localStorage.getItem("debug")&&(He=import("https://cdn.jsdelivr.net/npm/debug@4.3.7/+esm")),(e,...i)=>{He&&He.then(({default:n})=>{n(s)(e,...i)})});var De=1,_s={shopify:`wk-shopify-v${De}`,storefront:`wk-storefront-v${De}`,wishlist:`wk-wishlist-v${De}`};var Ps=()=>{let s=Vi("wk:cache"),t=Object.values(_s);caches.keys().then(e=>Promise.all(e.map(i=>{if(!t.includes(i))return s("Delete old cache",{cacheName:i}),caches.delete(i)})))};Ps();var Ht,le=class{constructor(t){xt(this,Ht);$t(this,Ht,t)}subscribe(t){let e=vt(this,Ht).call(this,new We(t));return new Ue(()=>{e==null||e()})}};Ht=new WeakMap;var Dt,We=class{constructor(t){xt(this,Dt);$t(this,Dt,t)}next(t){vt(this,Dt).call(this,t)}};Dt=new WeakMap;var Wt,Ue=class{constructor(t){xt(this,Wt);$t(this,Wt,t)}unsubscribe(){var t;(t=vt(this,Wt))==null||t.call(this)}};Wt=new WeakMap;var ce=class{constructor(t){this.stateConfig={loading:"eager"};this.state={};(this.host=t).addController(this)}get app(){if(!window.WishlistKing)throw new Error("Wishlist King SDK not initialized");return window.WishlistKing}get hostDataset(){return this.host.dataset?this.host.dataset:this.host.host?this.host.host.dataset:{}}hostConnected(){}hostDisconnected(){}parseStateConfig(t){var e;return{loading:(e=t.loading)!=null?e:"eager",wishlist:this.parseWishlistStateConfig(t),wishlistItem:this.parseWishlistItemStateConfig(t),productInfo:this.parseProductInfoStateConfig(t),cart:t.cart}}parseWishlistStateConfig({wishlist:t}){var i;let e=(i=this.hostDataset.wishlistId)!=null?i:"mine";if(t)return{params:{wishlistId:e}}}parseWishlistItemStateConfig({wishlistItem:t}){let{wishlistId:e="mine",wishlistItemId:i}=this.hostDataset;if(!(!t||!i))return{params:{wishlistId:e,wishlistItemId:i}}}parseProductInfoStateConfig({productInfo:t}){if(!t)return;let{wishlistId:e="mine",productHandle:i="",productId:n,variantId:r}=this.hostDataset;return{params:{wishlistId:e,productHandle:i,variantId:r?parseInt(r):void 0}}}observe(){return this.stateConfig=this.parseStateConfig(this.host.getStateConfig()),new le(t=>{let e=i=>{this.state={...this.state,...i},t.next(this.state)};if(this.stateConfig.wishlist){let{wishlistId:i="mine"}=this.stateConfig.wishlist.params;this.app.state.observeWishlist({wishlistId:i}).subscribe(n=>e({wishlist:n}))}if(this.stateConfig.productInfo){let{productHandle:i,variantId:n}=this.stateConfig.productInfo.params;if(!i)throw new Error("Product handle is required");this.app.state.observeProductInfo({productHandle:i,variantId:n}).subscribe(r=>e({productInfo:r}))}if(this.stateConfig.wishlistItem){let{wishlistId:i,wishlistItemId:n}=this.stateConfig.wishlistItem.params;if(!i)throw new Error("Wishlist id is required");if(!n)throw new Error("Wishlist item id is required");this.app.state.observeWishlist({wishlistId:i}).subscribe(r=>e({wishlistItem:r.items.find(o=>o.id===n)}))}this.stateConfig.cart&&this.app.state.observeShopifyCart({cacheStrategy:"public, max-age=1, stale-while-revalidate=10"}).subscribe(i=>e({cart:i}))})}getFallback(){this.stateConfig=this.parseStateConfig(this.host.getStateConfig());let t={};if(this.stateConfig.wishlist){let{wishlistId:e="mine"}=this.stateConfig.wishlist.params;t.wishlist={id:e,isMine:e==="mine",numItems:0,items:[]}}if(this.stateConfig.productInfo){let{variantId:e=0,productHandle:i}=this.stateConfig.productInfo.params;t.productInfo={productId:0,variantId:e,productHandle:i,inWishlist:!1}}if(this.stateConfig.wishlistItem){let{wishlistId:e,wishlistItemId:i}=this.stateConfig.wishlistItem.params;if(!e)throw new Error("Wishlist id is required");if(!i)throw new Error("Wishlist item id is required");t.wishlistItem={id:i,product:{id:0,handle:"",variants:[]}}}return t}};var Ut=class extends ht{constructor(t){if(super(t),this.it=x,t.type!==Zt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===x||t==null)return this._t=void 0,this.it=t;if(t===_)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};Ut.directiveName="unsafeHTML",Ut.resultType=1;var Ni=Jt(Ut);var S=class extends D{constructor(){super(...arguments);this.lit=Ot;this.unsafeHTML=Ni;this.repeat=Qt}};var he=class extends S{constructor(){super(...arguments);this.text="";this.hint="";this.selected=!1;this.disabled=!1;this.showIcon=!1;this.showText=!1;this.iconUnstyled=!1;this.fullWidth=!1;this.alignSelf="center";this.alignContent="center";this.floatingUi=new rt(this);this.getCounterFloating=()=>{var i,n,r,o;if(!((i=this.counter)!=null&&i.floating))return;let e=((r=(n=this.counter)==null?void 0:n.floating)==null?void 0:r.reference)==="icon"?(o=this.iconElement)!=null?o:this:this;return{...this.counter.floating,reference:e}}}get iconElement(){return this.querySelector(".wk-icon")}render(){var r,o,a,l;let e=(r=this.alignSelf)!=null?r:"center",i=(o=this.alignContent)!=null?o:"center",n=["wk-button",`wk-align-${e}`,`wk-align-content-${i}`,this.selected&&"wk-selected",this.fullWidth&&"wk-full-width"].filter(c=>!!c).join(" ");return this.href?this.lit.html` <a href=${this.href} aria-label=${(a=this.text)!=null?a:this.hint} class=${n} rel="noopener noreferrer nofollow" > ${this.renderIcon()}${this.renderText()}${this.renderCounter()} </a> `:this.lit.html` <button type="button" aria-label=${(l=this.text)!=null?l:this.hint} class=${n} ?disabled=${this.disabled} > ${this.renderIcon()}${this.renderText()}${this.renderCounter()} </button> `}renderIcon(){if(!(!this.showIcon||!this.icon))return this.lit.html` <wk-icon class="wk-icon" icon=${this.icon} ?unstyled=${this.iconUnstyled} ></wk-icon> `}renderText(){if(this.showText)return this.lit.html`<span class="wk-text">${this.text}</span>`}renderCounter(){var e;if(this.counter&&!(this.counter.hideWhenZero&&!this.counter.value))return this.lit.html` <wk-counter .value=${(e=this.counter)==null?void 0:e.value} .floating=${this.counterFloating} .showNumber=${this.counter.showNumber} .showBrackets=${this.counter.showBrackets} ></wk-counter> `}firstUpdated(e){super.firstUpdated(e),this.counterFloating=this.getCounterFloating()}createRenderRoot(){return this}};he.properties={href:{type:String},text:{type:String},hint:{type:String},selected:{type:Boolean},disabled:{type:Boolean},showIcon:{type:Boolean,attribute:"show-icon"},showText:{type:Boolean,attribute:"show-text"},icon:{type:String},iconUnstyled:{type:Boolean,attribute:"icon-unstyled"},fullWidth:{type:Boolean,attribute:"full-width"},alignSelf:{type:String,attribute:"align-self"},alignContent:{type:String,attribute:"align-content"},floating:{type:Object},counter:{type:Object},counterFloating:{state:!0}};customElements.get("wk-button")||customElements.define("wk-button",he);var ue=class extends S{constructor(){super(...arguments);this.value=0;this.showNumber=!1;this.showBrackets=!1;this.floatingUi=new rt(this)}render(){let e=this.showNumber?this.value:"",i=["wk-counter",this.showBrackets&&"wk-brackets",this.floating&&"wk-bubble",this.floating&&!this.showNumber&&"wk-dot"].filter(n=>!!n).join(" ");return this.lit.html`<span class=${i}>${e}</span>`}createRenderRoot(){return this}};ue.properties={value:{type:Number},floating:{type:Object},showNumber:{type:Boolean,attribute:"show-number"},showBrackets:{type:Boolean,attribute:"show-brackets"}};customElements.get("wk-counter")||customElements.define("wk-counter",ue);var Bi="wk-icon-update",de=class extends S{constructor(){super();this.icon="";this.unstyled=!1;this.classList.add("wk-icon"),this.handleIconUpdate=this.handleIconUpdate.bind(this)}get icons(){var e,i;return(i=(e=window.WishlistKing)==null?void 0:e.settings.icons)!=null?i:{}}connectedCallback(){super.connectedCallback(),document.addEventListener(Bi,this.handleIconUpdate)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(Bi,this.handleIconUpdate)}handleIconUpdate(){this.scheduleUpdate()}render(){if(!this.icon)return"";let e=this.icons[this.icon];return e?this.unsafeHTML(e):(console.warn(`Icon "${this.icon}" not found`,{icons:this.icons}),"")}updated(e){super.updated(e),e.has("unstyled")&