@molin.ai/shop-ai 0.9.3 → 0.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in e?Cc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var g=(e,t,r)=>$c(e,typeof t!="symbol"?t+"":t,r),ss=(e,t,r)=>t.has(e)||Qo("Cannot "+r);var a=(e,t,r)=>(ss(e,t,"read from private field"),r?r.call(e):t.get(e)),f=(e,t,r)=>t.has(e)?Qo("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),m=(e,t,r,n)=>(ss(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),y=(e,t,r)=>(ss(e,t,"access private method"),r);var ea=(e,t,r,n)=>({set _(i){m(e,t,i,r)},get _(){return a(e,t,n)}});var In=globalThis,On=In.ShadowRoot&&(In.ShadyCSS===void 0||In.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,os=Symbol(),ta=new WeakMap,br=class{constructor(t,r,n){if(this._$cssResult$=!0,n!==os)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r}get styleSheet(){let t=this.o,r=this.t;if(On&&t===void 0){let n=r!==void 0&&r.length===1;n&&(t=ta.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&ta.set(r,t))}return t}toString(){return this.cssText}},ra=e=>new br(typeof e=="string"?e:e+"",void 0,os),ie=(e,...t)=>{let r=e.length===1?e[0]:t.reduce(((n,i,s)=>n+(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.")})(i)+e[s+1]),e[0]);return new br(r,e,os)},na=(e,t)=>{if(On)e.adoptedStyleSheets=t.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(let r of t){let n=document.createElement("style"),i=In.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,e.appendChild(n)}},as=On?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let n of t.cssRules)r+=n.cssText;return ra(r)})(e):e;var{is:Sc,defineProperty:Ec,getOwnPropertyDescriptor:_c,getOwnPropertyNames:Mc,getOwnPropertySymbols:Ac,getPrototypeOf:Ic}=Object,jn=globalThis,ia=jn.trustedTypes,Oc=ia?ia.emptyScript:"",jc=jn.reactiveElementPolyfillSupport,kr=(e,t)=>e,ls={toAttribute(e,t){switch(t){case Boolean:e=e?Oc:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},oa=(e,t)=>!Sc(e,t),sa={attribute:!0,type:String,converter:ls,reflect:!1,useDefault:!1,hasChanged:oa};Symbol.metadata??=Symbol("metadata"),jn.litPropertyMetadata??=new WeakMap;var je=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,r=sa){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(t,r),!r.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(t,n,r);i!==void 0&&Ec(this.prototype,t,i)}}static getPropertyDescriptor(t,r,n){let{get:i,set:s}=_c(this.prototype,t)??{get(){return this[r]},set(o){this[r]=o}};return{get:i,set(o){let u=i?.call(this);s?.call(this,o),this.requestUpdate(t,u,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??sa}static _$Ei(){if(this.hasOwnProperty(kr("elementProperties")))return;let t=Ic(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(kr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(kr("properties"))){let r=this.properties,n=[...Mc(r),...Ac(r)];for(let i of n)this.createProperty(i,r[i])}let t=this[Symbol.metadata];if(t!==null){let r=litPropertyMetadata.get(t);if(r!==void 0)for(let[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(let[r,n]of this.elementProperties){let i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let r=[];if(Array.isArray(t)){let n=new Set(t.flat(1/0).reverse());for(let i of n)r.unshift(as(i))}else t!==void 0&&r.push(as(t));return r}static _$Eu(t,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n: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(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,r=this.constructor.elementProperties;for(let n of r.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return na(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,r,n){this._$AK(t,n)}_$ET(t,r){let n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(i!==void 0&&n.reflect===!0){let s=(n.converter?.toAttribute!==void 0?n.converter:ls).toAttribute(r,n.type);this._$Em=t,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(t,r){let n=this.constructor,i=n._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let s=n.getPropertyOptions(i),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:ls;this._$Em=i;let u=o.fromAttribute(r,s.type);this[i]=u??this._$Ej?.get(i)??u,this._$Em=null}}requestUpdate(t,r,n){if(t!==void 0){let i=this.constructor,s=this[t];if(n??=i.getPropertyOptions(t),!((n.hasChanged??oa)(s,r)||n.useDefault&&n.reflect&&s===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,n))))return;this.C(t,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,r,{useDefault:n,reflect:i,wrapped:s},o){n&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??r??this[t]),s!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||n||(r=void 0),this._$AL.set(t,r)),i===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[i,s]of n){let{wrapped:o}=s,u=this[i];o!==!0||this._$AL.has(i)||u===void 0||this.C(i,void 0,s,u)}}let t=!1,r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),this._$EO?.forEach((n=>n.hostUpdate?.())),this.update(r)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(r)}willUpdate(t){}_$AE(t){this._$EO?.forEach((r=>r.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((r=>this._$ET(r,this[r]))),this._$EM()}updated(t){}firstUpdated(t){}};je.elementStyles=[],je.shadowRootOptions={mode:"open"},je[kr("elementProperties")]=new Map,je[kr("finalized")]=new Map,jc?.({ReactiveElement:je}),(jn.reactiveElementVersions??=[]).push("2.1.1");var cs=globalThis,Ln=cs.trustedTypes,aa=Ln?Ln.createPolicy("lit-html",{createHTML:e=>e}):void 0,ps="$lit$",Le=`lit$${Math.random().toFixed(9).slice(2)}$`,hs="?"+Le,Lc=`<${hs}>`,nt=document,$r=()=>nt.createComment(""),Sr=e=>e===null||typeof e!="object"&&typeof e!="function",ds=Array.isArray,da=e=>ds(e)||typeof e?.[Symbol.iterator]=="function",us=`[
2
- \f\r]`,Cr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,la=/-->/g,ua=/>/g,tt=RegExp(`>|${us}(?:([^\\s"'>=/]+)(${us}*=${us}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),ca=/'/g,pa=/"/g,fa=/^(?:script|style|textarea|title)$/i,fs=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),d=fs(1),J1=fs(2),K1=fs(3),xe=Symbol.for("lit-noChange"),H=Symbol.for("lit-nothing"),ha=new WeakMap,rt=nt.createTreeWalker(nt,129);function ma(e,t){if(!ds(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return aa!==void 0?aa.createHTML(t):t}var ga=(e,t)=>{let r=e.length-1,n=[],i,s=t===2?"<svg>":t===3?"<math>":"",o=Cr;for(let u=0;u<r;u++){let l=e[u],c,p,h=-1,v=0;for(;v<l.length&&(o.lastIndex=v,p=o.exec(l),p!==null);)v=o.lastIndex,o===Cr?p[1]==="!--"?o=la:p[1]!==void 0?o=ua:p[2]!==void 0?(fa.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=tt):p[3]!==void 0&&(o=tt):o===tt?p[0]===">"?(o=i??Cr,h=-1):p[1]===void 0?h=-2:(h=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?tt:p[3]==='"'?pa:ca):o===pa||o===ca?o=tt:o===la||o===ua?o=Cr:(o=tt,i=void 0);let b=o===tt&&e[u+1].startsWith("/>")?" ":"";s+=o===Cr?l+Lc:h>=0?(n.push(c),l.slice(0,h)+ps+l.slice(h)+Le+b):l+Le+(h===-2?u:b)}return[ma(e,s+(e[r]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),n]},Er=class e{constructor({strings:t,_$litType$:r},n){let i;this.parts=[];let s=0,o=0,u=t.length-1,l=this.parts,[c,p]=ga(t,r);if(this.el=e.createElement(c,n),rt.currentNode=this.el.content,r===2||r===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=rt.nextNode())!==null&&l.length<u;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith(ps)){let v=p[o++],b=i.getAttribute(h).split(Le),$=/([.?@])?(.*)/.exec(v);l.push({type:1,index:s,name:$[2],strings:b,ctor:$[1]==="."?Dn:$[1]==="?"?Pn:$[1]==="@"?Rn:st}),i.removeAttribute(h)}else h.startsWith(Le)&&(l.push({type:6,index:s}),i.removeAttribute(h));if(fa.test(i.tagName)){let h=i.textContent.split(Le),v=h.length-1;if(v>0){i.textContent=Ln?Ln.emptyScript:"";for(let b=0;b<v;b++)i.append(h[b],$r()),rt.nextNode(),l.push({type:2,index:++s});i.append(h[v],$r())}}}else if(i.nodeType===8)if(i.data===hs)l.push({type:2,index:s});else{let h=-1;for(;(h=i.data.indexOf(Le,h+1))!==-1;)l.push({type:7,index:s}),h+=Le.length-1}s++}}static createElement(t,r){let n=nt.createElement("template");return n.innerHTML=t,n}};function it(e,t,r=e,n){if(t===xe)return t;let i=n!==void 0?r._$Co?.[n]:r._$Cl,s=Sr(t)?void 0:t._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(e),i._$AT(e,r,n)),n!==void 0?(r._$Co??=[])[n]=i:r._$Cl=i),i!==void 0&&(t=it(e,i._$AS(e,t.values),i,n)),t}var Tn=class{constructor(t,r){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:r},parts:n}=this._$AD,i=(t?.creationScope??nt).importNode(r,!0);rt.currentNode=i;let s=rt.nextNode(),o=0,u=0,l=n[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new It(s,s.nextSibling,this,t):l.type===1?c=new l.ctor(s,l.name,l.strings,this,t):l.type===6&&(c=new Un(s,this,t)),this._$AV.push(c),l=n[++u]}o!==l?.index&&(s=rt.nextNode(),o++)}return rt.currentNode=nt,i}p(t){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,r),r+=n.strings.length-2):n._$AI(t[r])),r++}},It=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,r,n,i){this.type=2,this._$AH=H,this._$AN=void 0,this._$AA=t,this._$AB=r,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,r=this._$AM;return r!==void 0&&t?.nodeType===11&&(t=r.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,r=this){t=it(this,t,r),Sr(t)?t===H||t==null||t===""?(this._$AH!==H&&this._$AR(),this._$AH=H):t!==this._$AH&&t!==xe&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):da(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!==H&&Sr(this._$AH)?this._$AA.nextSibling.data=t:this.T(nt.createTextNode(t)),this._$AH=t}$(t){let{values:r,_$litType$:n}=t,i=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=Er.createElement(ma(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(r);else{let s=new Tn(i,this),o=s.u(this.options);s.p(r),this.T(o),this._$AH=s}}_$AC(t){let r=ha.get(t.strings);return r===void 0&&ha.set(t.strings,r=new Er(t)),r}k(t){ds(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let s of t)i===r.length?r.push(n=new e(this.O($r()),this.O($r()),this,this.options)):n=r[i],n._$AI(s),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(t=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);t!==this._$AB;){let n=t.nextSibling;t.remove(),t=n}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},st=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,r,n,i,s){this.type=1,this._$AH=H,this._$AN=void 0,this.element=t,this.name=r,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=H}_$AI(t,r=this,n,i){let s=this.strings,o=!1;if(s===void 0)t=it(this,t,r,0),o=!Sr(t)||t!==this._$AH&&t!==xe,o&&(this._$AH=t);else{let u=t,l,c;for(t=s[0],l=0;l<s.length-1;l++)c=it(this,u[n+l],r,l),c===xe&&(c=this._$AH[l]),o||=!Sr(c)||c!==this._$AH[l],c===H?t=H:t!==H&&(t+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!i&&this.j(t)}j(t){t===H?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Dn=class extends st{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===H?void 0:t}},Pn=class extends st{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==H)}},Rn=class extends st{constructor(t,r,n,i,s){super(t,r,n,i,s),this.type=5}_$AI(t,r=this){if((t=it(this,t,r,0)??H)===xe)return;let n=this._$AH,i=t===H&&n!==H||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==H&&(n===H||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},Un=class{constructor(t,r,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){it(this,t)}},ya={M:ps,P:Le,A:hs,C:1,L:ga,R:Tn,D:da,V:it,I:It,H:st,N:Pn,U:Rn,B:Dn,F:Un},Tc=cs.litHtmlPolyfillSupport;Tc?.(Er,It),(cs.litHtmlVersions??=[]).push("3.3.1");var wa=(e,t,r)=>{let n=r?.renderBefore??t,i=n._$litPart$;if(i===void 0){let s=r?.renderBefore??null;n._$litPart$=i=new It(t.insertBefore($r(),s),s,void 0,r??{})}return i._$AI(e),i};var ms=globalThis,_=class extends je{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=wa(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return xe}};_._$litElement$=!0,_.finalized=!0,ms.litElementHydrateSupport?.({LitElement:_});var Dc=ms.litElementPolyfillSupport;Dc?.({LitElement:_});(ms.litElementVersions??=[]).push("4.2.1");var _r=class _r extends HTMLElement{constructor(){super();g(this,"name","");this.attachShadow({mode:"open"})}attributeChangedCallback(r,n,i){if(n!==i&&_r.observedAttributes.includes(r)){switch(r){case"name":this.name=i||"";break}this.render()}}resolveIcon(r){throw new Error("Not implemented")}render(){let r=document.createElement("style");for(r.textContent=`
1
+ var Rp=Object.create;var Fs=Object.defineProperty;var Bp=Object.getOwnPropertyDescriptor;var Vp=Object.getOwnPropertyNames;var Np=Object.getPrototypeOf,Fp=Object.prototype.hasOwnProperty;var Za=t=>{throw TypeError(t)};var Hp=(t,e,r)=>e in t?Fs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Hr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var zp=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Vp(e))!Fp.call(t,i)&&i!==r&&Fs(t,i,{get:()=>e[i],enumerable:!(n=Bp(e,i))||n.enumerable});return t};var qp=(t,e,r)=>(r=t!=null?Rp(Np(t)):{},zp(e||!t||!t.__esModule?Fs(r,"default",{value:t,enumerable:!0}):r,t));var w=(t,e,r)=>Hp(t,typeof e!="symbol"?e+"":e,r),Hs=(t,e,r)=>e.has(t)||Za("Cannot "+r);var a=(t,e,r)=>(Hs(t,e,"read from private field"),r?r.call(t):e.get(t)),d=(t,e,r)=>e.has(t)?Za("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),g=(t,e,r,n)=>(Hs(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),m=(t,e,r)=>(Hs(t,e,"access private method"),r);var Ka=(t,e,r,n)=>({set _(i){g(t,e,i,r)},get _(){return a(t,e,n)}});var Kc=Hr($t=>{"use strict";var md=$t&&$t.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function u(p){try{c(n.next(p))}catch(h){o(h)}}function l(p){try{c(n.throw(p))}catch(h){o(h)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},gd=$t&&$t.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty($t,"__esModule",{value:!0});$t.base64ToBlob=wd;function wd(t){return md(this,void 0,void 0,function(){var e,r,n;return gd(this,function(i){switch(i.label){case 0:return[4,fetch(t)];case 1:return e=i.sent(),[4,e.blob()];case 2:return r=i.sent(),n=vd(t),n&&(r=r.slice(0,r.size,n)),[2,r]}})})}var yd=/^data:(.+);base64,/;function vd(t){var e;return(e=t.match(yd))===null||e===void 0?void 0:e.slice(1,2).pop()}});var Jc=Hr(_t=>{"use strict";var bd=_t&&_t.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function u(p){try{c(n.next(p))}catch(h){o(h)}}function l(p){try{c(n.throw(p))}catch(h){o(h)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},xd=_t&&_t.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(_t,"__esModule",{value:!0});_t.base64ToFile=kd;function kd(t,e,r){return bd(this,void 0,void 0,function(){var n,i;return xd(this,function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:return n=s.sent(),[4,n.blob()];case 2:return i=s.sent(),[2,new File([i],e,r)]}})})}});var Qo=Hr(At=>{"use strict";var Xo=At&&At.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function u(p){try{c(n.next(p))}catch(h){o(h)}}function l(p){try{c(n.throw(p))}catch(h){o(h)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},Yo=At&&At.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(At,"__esModule",{value:!0});At.blobToBase64=Cd;function Cd(t){return Xo(this,void 0,void 0,function(){return Yo(this,function(e){return[2,typeof FileReader=="function"?Sd(t):$d(t)]})})}var pr;(function(t){t.error="error",t.loadend="loadend"})(pr||(pr={}));function Sd(t){return Xo(this,void 0,void 0,function(){return Yo(this,function(e){return[2,new Promise(function(r,n){try{var i=new FileReader,s=function(){r(i.result),i.removeEventListener(pr.loadend,s)};i.addEventListener(pr.loadend,s);var o=function(){n(i.error),i.removeEventListener(pr.error,o)};i.addEventListener(pr.error,o),i.readAsDataURL(t)}catch(u){n(u)}})]})})}var Ed="application/octet-stream";function $d(t){return Xo(this,void 0,void 0,function(){var e,r,n,i;return Yo(this,function(s){switch(s.label){case 0:return n=(r=Buffer).from,[4,t.text()];case 1:return e=n.apply(r,[s.sent()]),i=t.type||Ed,[2,"data:".concat(i,";base64,").concat(e.toString("base64"))]}})})}});var Xc=Hr(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.fileToBase64=void 0;var _d=Qo();Object.defineProperty(ji,"fileToBase64",{enumerable:!0,get:function(){return _d.blobToBase64}})});var Yc=Hr(je=>{"use strict";var Ad=je&&je.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Di=je&&je.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ad(e,t,r)};Object.defineProperty(je,"__esModule",{value:!0});Di(Kc(),je);Di(Jc(),je);Di(Qo(),je);Di(Xc(),je)});var ti=globalThis,ri=ti.ShadowRoot&&(ti.ShadyCSS===void 0||ti.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,zs=Symbol(),Ja=new WeakMap,zr=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==zs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(ri&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=Ja.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ja.set(r,e))}return e}toString(){return this.cssText}},Xa=t=>new zr(typeof t=="string"?t:t+"",void 0,zs),ae=(t,...e)=>{let r=t.length===1?t[0]:e.reduce(((n,i,s)=>n+(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.")})(i)+t[s+1]),t[0]);return new zr(r,t,zs)},Ya=(t,e)=>{if(ri)t.adoptedStyleSheets=e.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(let r of e){let n=document.createElement("style"),i=ti.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}},qs=ri?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return Xa(r)})(t):t;var{is:Wp,defineProperty:Gp,getOwnPropertyDescriptor:Zp,getOwnPropertyNames:Kp,getOwnPropertySymbols:Jp,getPrototypeOf:Xp}=Object,ni=globalThis,Qa=ni.trustedTypes,Yp=Qa?Qa.emptyScript:"",Qp=ni.reactiveElementPolyfillSupport,qr=(t,e)=>t,Ws={toAttribute(t,e){switch(e){case Boolean:t=t?Yp:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},tl=(t,e)=>!Wp(t,e),el={attribute:!0,type:String,converter:Ws,reflect:!1,useDefault:!1,hasChanged:tl};Symbol.metadata??=Symbol("metadata"),ni.litPropertyMetadata??=new WeakMap;var Be=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=el){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Gp(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){let{get:i,set:s}=Zp(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get:i,set(o){let u=i?.call(this);s?.call(this,o),this.requestUpdate(e,u,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??el}static _$Ei(){if(this.hasOwnProperty(qr("elementProperties")))return;let e=Xp(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(qr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(qr("properties"))){let r=this.properties,n=[...Kp(r),...Jp(r)];for(let i of n)this.createProperty(i,r[i])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(let[r,n]of this.elementProperties){let i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(qs(i))}else e!==void 0&&r.push(qs(e));return r}static _$Eu(e,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,r=this.constructor.elementProperties;for(let n of r.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ya(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$ET(e,r){let n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){let s=(n.converter?.toAttribute!==void 0?n.converter:Ws).toAttribute(r,n.type);this._$Em=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,r){let n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let s=n.getPropertyOptions(i),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Ws;this._$Em=i;let u=o.fromAttribute(r,s.type);this[i]=u??this._$Ej?.get(i)??u,this._$Em=null}}requestUpdate(e,r,n){if(e!==void 0){let i=this.constructor,s=this[e];if(n??=i.getPropertyOptions(e),!((n.hasChanged??tl)(s,r)||n.useDefault&&n.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,n))))return;this.C(e,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:n,reflect:i,wrapped:s},o){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??r??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(r=void 0),this._$AL.set(e,r)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[i,s]of n){let{wrapped:o}=s,u=this[i];o!==!0||this._$AL.has(i)||u===void 0||this.C(i,void 0,s,u)}}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach((n=>n.hostUpdate?.())),this.update(r)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$EO?.forEach((r=>r.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((r=>this._$ET(r,this[r]))),this._$EM()}updated(e){}firstUpdated(e){}};Be.elementStyles=[],Be.shadowRootOptions={mode:"open"},Be[qr("elementProperties")]=new Map,Be[qr("finalized")]=new Map,Qp?.({ReactiveElement:Be}),(ni.reactiveElementVersions??=[]).push("2.1.1");var Zs=globalThis,ii=Zs.trustedTypes,rl=ii?ii.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ks="$lit$",Ve=`lit$${Math.random().toFixed(9).slice(2)}$`,Js="?"+Ve,eh=`<${Js}>`,mt=document,Gr=()=>mt.createComment(""),Zr=t=>t===null||typeof t!="object"&&typeof t!="function",Xs=Array.isArray,ll=t=>Xs(t)||typeof t?.[Symbol.iterator]=="function",Gs=`[
2
+ \f\r]`,Wr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nl=/-->/g,il=/>/g,dt=RegExp(`>|${Gs}(?:([^\\s"'>=/]+)(${Gs}*=${Gs}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),sl=/'/g,ol=/"/g,cl=/^(?:script|style|textarea|title)$/i,Ys=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),f=Ys(1),T1=Ys(2),O1=Ys(3),$e=Symbol.for("lit-noChange"),z=Symbol.for("lit-nothing"),al=new WeakMap,ft=mt.createTreeWalker(mt,129);function ul(t,e){if(!Xs(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return rl!==void 0?rl.createHTML(e):e}var pl=(t,e)=>{let r=t.length-1,n=[],i,s=e===2?"<svg>":e===3?"<math>":"",o=Wr;for(let u=0;u<r;u++){let l=t[u],c,p,h=-1,y=0;for(;y<l.length&&(o.lastIndex=y,p=o.exec(l),p!==null);)y=o.lastIndex,o===Wr?p[1]==="!--"?o=nl:p[1]!==void 0?o=il:p[2]!==void 0?(cl.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=dt):p[3]!==void 0&&(o=dt):o===dt?p[0]===">"?(o=i??Wr,h=-1):p[1]===void 0?h=-2:(h=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?dt:p[3]==='"'?ol:sl):o===ol||o===sl?o=dt:o===nl||o===il?o=Wr:(o=dt,i=void 0);let x=o===dt&&t[u+1].startsWith("/>")?" ":"";s+=o===Wr?l+eh:h>=0?(n.push(c),l.slice(0,h)+Ks+l.slice(h)+Ve+x):l+Ve+(h===-2?u:x)}return[ul(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},Kr=class t{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let s=0,o=0,u=e.length-1,l=this.parts,[c,p]=pl(e,r);if(this.el=t.createElement(c,n),ft.currentNode=this.el.content,r===2||r===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=ft.nextNode())!==null&&l.length<u;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith(Ks)){let y=p[o++],x=i.getAttribute(h).split(Ve),S=/([.?@])?(.*)/.exec(y);l.push({type:1,index:s,name:S[2],strings:x,ctor:S[1]==="."?oi:S[1]==="?"?ai:S[1]==="@"?li:wt}),i.removeAttribute(h)}else h.startsWith(Ve)&&(l.push({type:6,index:s}),i.removeAttribute(h));if(cl.test(i.tagName)){let h=i.textContent.split(Ve),y=h.length-1;if(y>0){i.textContent=ii?ii.emptyScript:"";for(let x=0;x<y;x++)i.append(h[x],Gr()),ft.nextNode(),l.push({type:2,index:++s});i.append(h[y],Gr())}}}else if(i.nodeType===8)if(i.data===Js)l.push({type:2,index:s});else{let h=-1;for(;(h=i.data.indexOf(Ve,h+1))!==-1;)l.push({type:7,index:s}),h+=Ve.length-1}s++}}static createElement(e,r){let n=mt.createElement("template");return n.innerHTML=e,n}};function gt(t,e,r=t,n){if(e===$e)return e;let i=n!==void 0?r._$Co?.[n]:r._$Cl,s=Zr(e)?void 0:e._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(t),i._$AT(t,r,n)),n!==void 0?(r._$Co??=[])[n]=i:r._$Cl=i),i!==void 0&&(e=gt(t,i._$AS(t,e.values),i,n)),e}var si=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:r},parts:n}=this._$AD,i=(e?.creationScope??mt).importNode(r,!0);ft.currentNode=i;let s=ft.nextNode(),o=0,u=0,l=n[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Ht(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new ci(s,this,e)),this._$AV.push(c),l=n[++u]}o!==l?.index&&(s=ft.nextNode(),o++)}return ft.currentNode=mt,i}p(e){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},Ht=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,n,i){this.type=2,this._$AH=z,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=gt(this,e,r),Zr(e)?e===z||e==null||e===""?(this._$AH!==z&&this._$AR(),this._$AH=z):e!==this._$AH&&e!==$e&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ll(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==z&&Zr(this._$AH)?this._$AA.nextSibling.data=e:this.T(mt.createTextNode(e)),this._$AH=e}$(e){let{values:r,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Kr.createElement(ul(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(r);else{let s=new si(i,this),o=s.u(this.options);s.p(r),this.T(o),this._$AH=s}}_$AC(e){let r=al.get(e.strings);return r===void 0&&al.set(e.strings,r=new Kr(e)),r}k(e){Xs(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let s of e)i===r.length?r.push(n=new t(this.O(Gr()),this.O(Gr()),this,this.options)):n=r[i],n._$AI(s),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},wt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,n,i,s){this.type=1,this._$AH=z,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=z}_$AI(e,r=this,n,i){let s=this.strings,o=!1;if(s===void 0)e=gt(this,e,r,0),o=!Zr(e)||e!==this._$AH&&e!==$e,o&&(this._$AH=e);else{let u=e,l,c;for(e=s[0],l=0;l<s.length-1;l++)c=gt(this,u[n+l],r,l),c===$e&&(c=this._$AH[l]),o||=!Zr(c)||c!==this._$AH[l],c===z?e=z:e!==z&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!i&&this.j(e)}j(e){e===z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},oi=class extends wt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===z?void 0:e}},ai=class extends wt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==z)}},li=class extends wt{constructor(e,r,n,i,s){super(e,r,n,i,s),this.type=5}_$AI(e,r=this){if((e=gt(this,e,r,0)??z)===$e)return;let n=this._$AH,i=e===z&&n!==z||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==z&&(n===z||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ci=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){gt(this,e)}},hl={M:Ks,P:Ve,A:Js,C:1,L:pl,R:si,D:ll,V:gt,I:Ht,H:wt,N:ai,U:li,B:oi,F:ci},th=Zs.litHtmlPolyfillSupport;th?.(Kr,Ht),(Zs.litHtmlVersions??=[]).push("3.3.1");var dl=(t,e,r)=>{let n=r?.renderBefore??e,i=n._$litPart$;if(i===void 0){let s=r?.renderBefore??null;n._$litPart$=i=new Ht(e.insertBefore(Gr(),s),s,void 0,r??{})}return i._$AI(t),i};var Qs=globalThis,E=class extends Be{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=dl(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return $e}};E._$litElement$=!0,E.finalized=!0,Qs.litElementHydrateSupport?.({LitElement:E});var rh=Qs.litElementPolyfillSupport;rh?.({LitElement:E});(Qs.litElementVersions??=[]).push("4.2.1");var Jr=class Jr extends HTMLElement{constructor(){super();w(this,"name","");this.attachShadow({mode:"open"})}attributeChangedCallback(r,n,i){if(n!==i&&Jr.observedAttributes.includes(r)){switch(r){case"name":this.name=i||"";break}this.render()}}resolveIcon(r){throw new Error("Not implemented")}render(){let r=document.createElement("style");for(r.textContent=`
4
4
  :host {
5
5
  display: inline-block;
6
6
  line-height: 0;
7
7
  }
8
- `;this.shadowRoot?.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild),this.shadowRoot.appendChild(r);if(!this.name)return;let n=this.resolveIcon(this.name);if(!n){console.warn(`'${this.name}' not found, please add it to ${_r.name}`);return}let o=new DOMParser().parseFromString(n,"image/svg+xml").documentElement;o.setAttribute("fill","currentColor"),o.style.width="100%",o.style.height="100%",this.shadowRoot?.appendChild(o)}};g(_r,"observedAttributes",["name"]);var Vn=_r;var va={clock:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
8
+ `;this.shadowRoot?.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild),this.shadowRoot.appendChild(r);if(!this.name)return;let n=this.resolveIcon(this.name);if(!n){console.warn(`'${this.name}' not found, please add it to ${Jr.name}`);return}let o=new DOMParser().parseFromString(n,"image/svg+xml").documentElement;o.setAttribute("fill","currentColor"),o.style.width="100%",o.style.height="100%",this.shadowRoot?.appendChild(o)}};w(Jr,"observedAttributes",["name"]);var ui=Jr;var fl={clock:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
9
9
  <path d="M12 6V12H16.5M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
10
10
  </svg>`,"arrow-path":`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
11
11
  <path d="M16.0228 9.34841H21.0154V9.34663M2.98413 19.6444V14.6517M2.98413 14.6517L7.97677 14.6517M2.98413 14.6517L6.16502 17.8347C7.15555 18.8271 8.41261 19.58 9.86436 19.969C14.2654 21.1483 18.7892 18.5364 19.9685 14.1353M4.03073 9.86484C5.21 5.46374 9.73377 2.85194 14.1349 4.03121C15.5866 4.4202 16.8437 5.17312 17.8342 6.1655L21.0154 9.34663M21.0154 4.3558V9.34663" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -121,19 +121,19 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
121
121
  <path d="M3.75 6.75H20.25M3.75 12H20.25M3.75 17.25H20.25" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
122
122
  </svg>`,phone:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
123
123
  <path d="M2.25 6.75C2.25 15.0343 8.96573 21.75 17.25 21.75H19.5C20.7426 21.75 21.75 20.7426 21.75 19.5V18.1284C21.75 17.6121 21.3987 17.1622 20.8979 17.037L16.4747 15.9312C16.0355 15.8214 15.5734 15.9855 15.3018 16.3476L14.3316 17.6412C14.05 18.0166 13.563 18.1827 13.1223 18.0212C9.81539 16.8098 7.19015 14.1846 5.97876 10.8777C5.81734 10.437 5.98336 9.94998 6.3588 9.6684L7.65242 8.69818C8.01453 8.4266 8.17861 7.96445 8.06883 7.52533L6.96304 3.10215C6.83783 2.60133 6.38785 2.25 5.87163 2.25H4.5C3.25736 2.25 2.25 3.25736 2.25 4.5V6.75Z" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
124
- </svg>`};var Pc=va,gs=class extends Vn{resolveIcon(t){let r=Pc[t];if(!r)throw console.warn("hi-outline: icon not found",t),new Error(`Icon ${t} not found`);return r}render(){super.render();let t=this.shadowRoot?.querySelector("svg");if(!t)throw new Error("svgEl not found "+this.name);t.setAttribute("fill","none"),t.querySelectorAll("[stroke]").forEach(r=>{r.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",gs);var Mr,ae,be,Ar,ys,Bn=class{constructor(t,r){f(this,Ar);f(this,Mr);f(this,ae);f(this,be);if(!t)throw new Error("host is required");if(!r)throw new Error("config is required");m(this,Mr,t),a(this,Mr).addController(this),m(this,ae,r)}connect(t){m(this,ae,t),m(this,be,y(this,Ar,ys).call(this))}hostConnected(){setTimeout(()=>{m(this,be,y(this,Ar,ys).call(this))},0)}hostDisconnected(){a(this,be)?.close(1e3,"lit_host_disconnected"),m(this,be,void 0)}send(t){a(this,be)?.send(t)}close(t,r){a(this,be)?.close(t,r)}get isConnected(){return a(this,be)?.readyState===WebSocket.OPEN}get isConnecting(){return a(this,be)?.readyState===WebSocket.CONNECTING}};Mr=new WeakMap,ae=new WeakMap,be=new WeakMap,Ar=new WeakSet,ys=function(){let t=new WebSocket(a(this,ae).url());return a(this,ae).onClose&&(t.onclose=a(this,ae).onClose),a(this,ae).onOpen&&(t.onopen=a(this,ae).onOpen),a(this,ae).onError&&(t.onerror=a(this,ae).onError),a(this,ae).onMessage&&(t.onmessage=a(this,ae).onMessage),t};var xa=Array.isArray;var ws=e=>!!(e&&e.constructor&&e.call&&e.apply);var ba=e=>!(!e||!e.then||!ws(e.then));function*ka(e,t,r=i=>i,n=1){let i=ws(r)?r:()=>r,s=t?e:0,o=t??e;for(let u=s;u<=o&&(yield i(u),!(u+n>o));u+=n);}var xs=async(e,t)=>{let r=e?.times??3,n=e?.delay,i=e?.backoff??null;for(let s of ka(1,r)){let[o,u]=await bs(t)(l=>{throw{_exited:l}});if(!o)return u;if(o._exited)throw o._exited;if(s===r)throw o;n&&await vs(n),i&&await vs(i(s))}},vs=e=>new Promise(t=>setTimeout(t,e)),bs=e=>(...t)=>{try{let r=e(...t);return ba(r)?r.then(n=>[void 0,n]).catch(n=>[n,void 0]):[void 0,r]}catch(r){return[r,void 0]}};var Z,X,q,Ot,jt,me,G,_e,Ca,$a,Sa,Ea,Nn=class{constructor(t,r){f(this,G);f(this,Z);f(this,X);f(this,q,null);g(this,"isStreaming",!1);g(this,"typingIndicator");g(this,"ranOutOfCredits",!1);g(this,"messages",[]);g(this,"conversationId","");f(this,Ot,0);f(this,jt);g(this,"isLiveMode",!1);f(this,me,[]);m(this,Z,t),m(this,X,r),a(this,X).autoConnect!==!1&&m(this,q,this.initWS()),t.addController(this)}get hasQueuedMessages(){return a(this,me).length>0}async enqueueMessage(t,{expectStreaming:r=!1}={}){if(a(this,me).length>0){let n=a(this,me)[a(this,me).length-1];if(t.type==="USER_INPUT"&&n.message.type==="USER_INPUT"&&t.value===n.message.value)return!0}return a(this,q)||this.connect(),a(this,q)?.isConnected?y(this,G,_e).call(this,t,{expectStreaming:r}):(a(this,me).push({message:t,options:{expectStreaming:r}}),a(this,Z).requestUpdate(),a(this,q)&&!a(this,q).isConnecting&&!a(this,q).isConnected&&this.retry(),await xs({times:5,delay:2e3},async()=>{if(a(this,q)?.isConnected){let n=[...a(this,me)];m(this,me,[]),a(this,Z).requestUpdate();let i=!1;for(let{message:s,options:o}of n){let u=y(this,G,_e).call(this,s,o);s===t&&(i=u)}return i}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",t),m(this,me,[]),a(this,Z).requestUpdate(),!1)))}sendUserInput(t,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1}={}){return y(this,G,_e).call(this,{type:"USER_INPUT",value:t,role:i,xUserData:r,xCustomInstructions:n},{expectStreaming:s})}async enqueueUserInput(t,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:t,role:i,xUserData:r,xCustomInstructions:n},{expectStreaming:s})}sendUserCancel(){return y(this,G,_e).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return y(this,G,_e).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return y(this,G,_e).call(this,{type:"USER_TYPING_STOP"})}sendUserMeta(t){return y(this,G,_e).call(this,{type:"USER_META",metadata:t})}reloadConfig(){y(this,G,_e).call(this,{type:"RELOAD_CONFIG"})}close(){a(this,q)?.close(1e3,"closed by user")}retry(){clearTimeout(a(this,jt)),m(this,jt,setTimeout(()=>{a(this,X).onReconnect?.(),m(this,q,this.initWS())},1e3*a(this,Ot))),ea(this,Ot)._++}initWS(){return new Bn(a(this,Z),{url:()=>a(this,X).url(this.conversationId,{}),onOpen:t=>y(this,G,Ca).call(this,t),onMessage:t=>y(this,G,$a).call(this,JSON.parse(t.data)),onError:t=>y(this,G,Sa).call(this,t),onClose:t=>y(this,G,Ea).call(this,t)})}hostConnected(){this.conversationId=a(this,X).restoreConversationState?.()?.conversationId||"",this.messages=a(this,X).restoreConversationState?.()?.messages||[]}reset(){y(this,G,_e).call(this,{type:"NEW_CHAT"}),a(this,X).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,m(this,me,[]),a(this,Z).requestUpdate()}hostDisconnected(){clearTimeout(a(this,jt))}connect(){a(this,q)||m(this,q,this.initWS())}reconnectSocket(){a(this,q)?.close(1e3,"destroy"),m(this,q,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};Z=new WeakMap,X=new WeakMap,q=new WeakMap,Ot=new WeakMap,jt=new WeakMap,me=new WeakMap,G=new WeakSet,_e=function(t,{expectStreaming:r=!1}={}){return this.ranOutOfCredits?!1:a(this,q)?a(this,q).isConnecting?(console.warn("WebSocket is connecting, message not sent",t),!1):a(this,q).isConnected?(r&&!this.isLiveMode&&(this.isStreaming=!0,a(this,Z).requestUpdate()),a(this,q).send(JSON.stringify(t)),!0):(console.warn("WebSocket is not connected, message not sent",t),this.retry(),!1):(console.warn("WebSocket not initialized, message not sent",t),this.connect(),!1)},Ca=function(t){m(this,Ot,0)},$a=function(t){switch(t.type){case"NEW_MESSAGE":{this.messages=[...this.messages,{...t.message,streaming:!0}].filter((r,n,i)=>n===i.findIndex(s=>s.id===r.id)),this.typingIndicator=void 0,a(this,Z).requestUpdate(),a(this,X).onNewMessage?.(t.message);break}case"APPEND_MESSAGE":{let r=this.messages.find(n=>n.id===t.message.id);if(r){switch(t.message.content_type){case"text":{let{part:n,delta:i,position:s}=t.message;r.content=r.content.slice(0,s)+i,r.parts||=[],r.parts[n]={text:r.parts[n]&&"text"in r.parts[n]?(r.parts[n].text||"").slice(0,s)+i:i};break}case"html":{let{part:n,delta:i,position:s}=t.message;r.parts||=[],r.parts[n]={html:r.parts[n]&&"html"in r.parts[n]?(r.parts[n].html||"").slice(0,s)+i:i};break}case"data":{let{part:n}=t.message;r.parts||=[],r.parts[n]={tag:t.message.tag,data:r.parts[n]&&"data"in r.parts[n]?Object.assign(r.parts[n].data||{},t.message.data):t.message.data};break}}t.metadata&&(r.metadata=t.metadata),a(this,X).onMessageAppend?.(t),a(this,Z).requestUpdate()}else throw new Error(`Message with id ${t.message.id} not found`);break}case"MESSAGE_DONE":{let r=this.messages.find(n=>n.id===t.message.id);if(r)Object.assign(r,t.message),r.streaming=!1;else throw new Error(`Message with id ${t.message.id} not found`);this.isStreaming=!1,a(this,Z).requestUpdate(),a(this,X).onMessageDone?.(t,r),a(this,X).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,a(this,Z).requestUpdate();break}case"ERROR":{a(this,X).onMessageError?.(t);break}case"CONNECTED":{this.conversationId=t.conversationId,this.messages=t.messages,a(this,X).onConnect?.(t.conversationId),a(this,X).persistConversationState?.(t.conversationId,t.messages),this.isLiveMode=t.metadata?.isLiveMode,a(this,Z).requestUpdate();break}case"TYPING_START":{t.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:t.role,metadata:t.metadata},a(this,Z).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,a(this,Z).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,a(this,Z).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),a(this,Z).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(t)}`)}},Sa=function(t){console.error("onError",t),a(this,X).onError?.(t)},Ea=function(t){a(this,Z).isConnected&&a(this,q)&&!a(this,q).isConnected&&t.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,a(this,Z).requestUpdate(),a(this,X).onClose?.()};var Hh=Symbol(),Rc=Symbol();var _a=Object.getPrototypeOf,ks=new WeakMap,Uc=e=>e&&(ks.has(e)?ks.get(e):_a(e)===Object.prototype||_a(e)===Array.prototype);var Ma=e=>Uc(e)&&e[Rc]||null,Cs=(e,t=!0)=>{ks.set(e,t)};var Ss=e=>typeof e=="object"&&e!==null,Vc=e=>Ss(e)&&!Es.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)&&!(e instanceof Promise),Oa=(e,t)=>{let r=Aa.get(e);if(r?.[0]===t)return r[1];let n=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return Cs(n,!0),Aa.set(e,[t,n]),Reflect.ownKeys(e).forEach(i=>{if(Object.getOwnPropertyDescriptor(n,i))return;let s=Reflect.get(e,i),{enumerable:o}=Reflect.getOwnPropertyDescriptor(e,i),u={value:s,enumerable:o,configurable:!0};if(Es.has(s))Cs(s,!1);else if(ot.has(s)){let[l,c]=ot.get(s);u.value=Oa(l,c())}Object.defineProperty(n,i,u)}),Object.preventExtensions(n)},Bc=(e,t,r,n)=>({deleteProperty(i,s){let o=Reflect.get(i,s);r(s);let u=Reflect.deleteProperty(i,s);return u&&n(["delete",[s],o]),u},set(i,s,o,u){let l=!e()&&Reflect.has(i,s),c=Reflect.get(i,s,u);if(l&&(Ia(c,o)||Hn.has(o)&&Ia(c,Hn.get(o))))return!0;r(s),Ss(o)&&(o=Ma(o)||o);let p=!ot.has(o)&&Hc(o)?_s(o):o;return t(s,p),Reflect.set(i,s,p,u),n(["set",[s],o,c]),!0}}),ot=new WeakMap,Es=new WeakSet,Aa=new WeakMap,$s=[1],Hn=new WeakMap,Ia=Object.is,Nc=(e,t)=>new Proxy(e,t),Hc=Vc,Fc=Oa,qc=Bc;function _s(e={}){if(!Ss(e))throw new Error("object required");let t=Hn.get(e);if(t)return t;let r=$s[0],n=new Set,i=(C,M=++$s[0])=>{r!==M&&(s=r=M,n.forEach(k=>k(C,M)))},s=r,o=(C=$s[0])=>(s!==C&&(s=C,l.forEach(([M])=>{let k=M[1](C);k>r&&(r=k)})),r),u=C=>(M,k)=>{let E=[...M];E[1]=[C,...E[1]],i(E,k)},l=new Map,c=(C,M)=>{let k=!Es.has(M)&&ot.get(M);if(k){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(C))throw new Error("prop listener already exists");if(n.size){let E=k[2](u(C));l.set(C,[k,E])}else l.set(C,[k])}},p=C=>{var M;let k=l.get(C);k&&(l.delete(C),(M=k[1])==null||M.call(k))},h=C=>(n.add(C),n.size===1&&l.forEach(([k,E],j)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&E)throw new Error("remove already exists");let N=k[2](u(j));l.set(j,[k,N])}),()=>{n.delete(C),n.size===0&&l.forEach(([k,E],j)=>{E&&(E(),l.set(j,[k]))})}),v=!0,b=qc(()=>v,c,p,i),$=Nc(e,b);Hn.set(e,$);let O=[e,o,h];return ot.set($,O),Reflect.ownKeys(e).forEach(C=>{let M=Object.getOwnPropertyDescriptor(e,C);"value"in M&&M.writable&&($[C]=e[C])}),v=!1,$}function Fn(e,t,r){let n=ot.get(e);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i,s=[],o=n[2],u=!1,c=o(p=>{if(s.push(p),r){t(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,u&&t(s.splice(0))}))});return u=!0,()=>{u=!1,c()}}function Lt(e){let t=ot.get(e);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!t&&console.warn("Please use proxy object");let[r,n]=t;return Fc(r,n())}var Ir,Tt,at,Dt,Pt=class{constructor(t,r){f(this,Ir);f(this,Tt);f(this,at);f(this,Dt,()=>{});m(this,Ir,t),m(this,Tt,r),m(this,at,Lt(r)),t.addController(this)}get state(){return a(this,at)}get value(){return a(this,at)}hostConnected(){a(this,Dt).call(this),m(this,Dt,Fn(a(this,Tt),()=>{m(this,at,Lt(a(this,Tt))),a(this,Ir).requestUpdate()}))}hostDisconnected(){a(this,Dt).call(this)}};Ir=new WeakMap,Tt=new WeakMap,at=new WeakMap,Dt=new WeakMap;var Or,jr,lt,Rt,Ne=class{constructor(t,r,n){f(this,Or);f(this,jr);g(this,"proxyObject");f(this,lt);f(this,Rt,()=>{});m(this,Or,t),m(this,jr,n),this.proxyObject=_s(r),m(this,lt,Lt(this.proxyObject)),t.addController(this)}get state(){return a(this,lt)}get value(){return a(this,lt)}hostConnected(){a(this,Rt).call(this),a(this,jr)?.subscribe&&m(this,Rt,Fn(this.proxyObject,()=>{m(this,lt,Lt(this.proxyObject)),a(this,Or).requestUpdate()}))}hostDisconnected(){a(this,Rt).call(this)}};Or=new WeakMap,jr=new WeakMap,lt=new WeakMap,Rt=new WeakMap;var Ut,Lr,Vt,ut,ct,qn=class{constructor(t,{provider:r,tag:n,key:i}){f(this,Ut);f(this,Lr);f(this,Vt);f(this,ut,null);f(this,ct,null);m(this,Ut,t),m(this,Lr,n),m(this,Vt,i),t.addController(this)}get value(){return a(this,ct)?a(this,ct).value:null}hostConnected(){if(a(this,ct)||(m(this,ut,zc(a(this,Ut),a(this,Lr))),!a(this,ut)))return;let t=a(this,ut)[a(this,Vt)]instanceof Ne?a(this,ut)[a(this,Vt)]:null;t&&m(this,ct,new Pt(a(this,Ut),t.proxyObject))}hostDisconnected(){}};Ut=new WeakMap,Lr=new WeakMap,Vt=new WeakMap,ut=new WeakMap,ct=new WeakMap;function zc(e,t){let r=e;for(;r;){let n=r.closest(t);if(n)return n;let i=r.getRootNode();if(i instanceof ShadowRoot)r=i.host;else break}return null}var ja=()=>{if(window.Shopify)try{return{customerId:Wc()}}catch{return null}return null},Wc=()=>{try{let e=[()=>window.ShopifyAnalytics?.meta?.page?.customerId,()=>window.meta?.page?.customerId,()=>window._st?.cid,()=>window.ShopifyAnalytics?.lib?.user()?.traits()?.uniqToken];for(let t of e)try{let r=t();if(/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i.test(r))continue;if(r)return r}catch{}}catch{return null}return null},La=async()=>{try{return(await(await fetch(window.Shopify.routes.root+"cart.js")).json()).items.map(n=>({id:n.id,name:n.title,quantity:n.quantity,price:n.price,variantId:n.variant_id,sku:n.sku,url:n.url,description:n.product_description,image:n.featured_image?.url}))}catch{return[]}};function Ta(e,t="http"){return e.startsWith("http://")||e.startsWith("https://")?e:`${t}://${e}`}function Ms(e){return new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+!*'();@&=,$]*)*(\\?[-a-z\\d%_.~+!*'();@&=,$]*)?(\\#[-a-z\\d%_.~+!*'();@&=,$]*)?$","i").test(e)}function Da(e,t){let r=e instanceof URL?e:new URL(e);if(t)for(let[n,i]of t)r.searchParams.set(n,i);return r}var Pa=()=>{if(window.ShopRenter)try{let e=Gc();return{customerEmail:e?.customerEmail,customerId:e?.customerId,customerName:e?.customerName}}catch{return null}return null},Gc=()=>{try{if(window.ShopRenter){let e=window.ShopRenter.customer;return{customerEmail:e?.email,customerId:e?.userId,customerName:[e?.name?.firstName,e?.name?.lastName].filter(Boolean).join(" ")}}return{customerEmail:null,customerId:null,customerName:null}}catch{return{customerEmail:null,customerId:null,customerName:null}}},Ra=async()=>{try{let e=window.ShopRenter.shop?.domain;if(!e)return[];let t=Ta(e,"https")+"/cart.json";return(await(await fetch(t)).json()).items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku,image:s.image,url:s.href}))}catch{return[]}};var Ua=()=>{if(window.UNAS)try{let e=window.UNAS.customer;return{customerEmail:e?.email,customerId:e?.id}}catch(e){return console.error("Error fetching customer information:",e),null}return null},Va=async()=>new Promise((e,t)=>{try{window.UNAS.getCart(r=>{let i=r.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));e(i)})}catch(r){console.error("Error fetching cart information:",r),t(r)}});var As;function Is(e){return{lang:e?.lang??As?.lang,message:e?.message,abortEarly:e?.abortEarly??As?.abortEarly,abortPipeEarly:e?.abortPipeEarly??As?.abortPipeEarly}}var Xc;function Yc(e){return Xc?.get(e)}var Qc;function ep(e){return Qc?.get(e)}var tp;function rp(e,t){return tp?.get(e)?.get(t)}function Na(e){let t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&Object.getPrototypeOf(e)?.constructor?.name)??"null":t}function ue(e,t,r,n,i){let s=i&&"input"in i?i.input:r.value,o=i?.expected??e.expects??null,u=i?.received??Na(s),l={kind:e.kind,type:e.type,input:s,expected:o,received:u,message:`Invalid ${t}: ${o?`Expected ${o} but r`:"R"}eceived ${u}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=e.kind==="schema",p=i?.message??e.message??rp(e.reference,l.lang)??(c?ep(l.lang):null)??n.message??Yc(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function ce(e){return{version:1,vendor:"valibot",validate(t){return e["~run"]({value:t},Is())}}}function np(e,t){return Object.hasOwn(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}function Ha(e,t){let r=[...new Set(e)];return r.length>1?`(${r.join(` ${t} `)})`:r[0]??"never"}var ip=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}};function Os(e,t){return{kind:"validation",type:"max_length",reference:Os,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(r,n){return r.typed&&r.value.length>this.requirement&&ue(this,"length",r,n,{received:`${r.value.length}`}),r}}}function js(e,t){return{kind:"validation",type:"min_length",reference:js,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(r,n){return r.typed&&r.value.length<this.requirement&&ue(this,"length",r,n,{received:`${r.value.length}`}),r}}}function sp(e,t,r){return typeof e.fallback=="function"?e.fallback(t,r):e.fallback}function Fa(e,t,r){return typeof e.default=="function"?e.default(t,r):e.default}function Ls(){return{kind:"schema",type:"any",reference:Ls,expects:"any",async:!1,get"~standard"(){return ce(this)},"~run"(e){return e.typed=!0,e}}}function Bt(e,t){return{kind:"schema",type:"array",reference:Bt,expects:"Array",async:!1,item:e,message:t,get"~standard"(){return ce(this)},"~run"(r,n){let i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<i.length;s++){let o=i[s],u=this.item["~run"]({value:o},n);if(u.issues){let l={type:"array",origin:"value",input:i,key:s,value:o};for(let c of u.issues)c.path?c.path.unshift(l):c.path=[l],r.issues?.push(c);if(r.issues||(r.issues=u.issues),n.abortEarly){r.typed=!1;break}}u.typed||(r.typed=!1),r.value.push(u.value)}}else ue(this,"type",r,n);return r}}}function Ts(e){return{kind:"schema",type:"boolean",reference:Ts,expects:"boolean",async:!1,message:e,get"~standard"(){return ce(this)},"~run"(t,r){return typeof t.value=="boolean"?t.typed=!0:ue(this,"type",t,r),t}}}function Ds(e){return{kind:"schema",type:"null",reference:Ds,expects:"null",async:!1,message:e,get"~standard"(){return ce(this)},"~run"(t,r){return t.value===null?t.typed=!0:ue(this,"type",t,r),t}}}function zn(e){return{kind:"schema",type:"number",reference:zn,expects:"number",async:!1,message:e,get"~standard"(){return ce(this)},"~run"(t,r){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:ue(this,"type",t,r),t}}}function Te(e,t){return{kind:"schema",type:"object",reference:Te,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return ce(this)},"~run"(r,n){let i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(let s in this.entries){let o=this.entries[s];if(s in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){let u=s in i?i[s]:Fa(o),l=o["~run"]({value:u},n);if(l.issues){let c={type:"object",origin:"value",input:i,key:s,value:u};for(let p of l.issues)p.path?p.path.unshift(c):p.path=[c],r.issues?.push(p);if(r.issues||(r.issues=l.issues),n.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value[s]=l.value}else if(o.fallback!==void 0)r.value[s]=sp(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(ue(this,"key",r,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else ue(this,"type",r,n);return r}}}function Nt(e,t){return{kind:"schema",type:"optional",reference:Nt,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return ce(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=Fa(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function Ps(e,t){return{kind:"schema",type:"picklist",reference:Ps,expects:Ha(e.map(Na),"|"),async:!1,options:e,message:t,get"~standard"(){return ce(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:ue(this,"type",r,n),r}}}function Wn(e,t,r){return{kind:"schema",type:"record",reference:Wn,expects:"Object",async:!1,key:e,value:t,message:r,get"~standard"(){return ce(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let o in s)if(np(s,o)){let u=s[o],l=this.key["~run"]({value:o},i);if(l.issues){let p={type:"object",origin:"key",input:s,key:o,value:u};for(let h of l.issues)h.path=[p],n.issues?.push(h);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}let c=this.value["~run"]({value:u},i);if(c.issues){let p={type:"object",origin:"value",input:s,key:o,value:u};for(let h of c.issues)h.path?h.path.unshift(p):h.path=[p],n.issues?.push(h);if(n.issues||(n.issues=c.issues),i.abortEarly){n.typed=!1;break}}(!l.typed||!c.typed)&&(n.typed=!1),l.typed&&(n.value[l.value]=c.value)}}else ue(this,"type",n,i);return n}}}function J(e){return{kind:"schema",type:"string",reference:J,expects:"string",async:!1,message:e,get"~standard"(){return ce(this)},"~run"(t,r){return typeof t.value=="string"?t.typed=!0:ue(this,"type",t,r),t}}}function Ba(e){let t;if(e)for(let r of e)t?t.push(...r.issues):t=r.issues;return t}function Ht(e,t){return{kind:"schema",type:"union",reference:Ht,expects:Ha(e.map(r=>r.expects),"|"),async:!1,options:e,message:t,get"~standard"(){return ce(this)},"~run"(r,n){let i,s,o;for(let u of this.options){let l=u["~run"]({value:r.value},n);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{i=l;break}else o?o.push(l):o=[l]}if(i)return i;if(s){if(s.length===1)return s[0];ue(this,"type",r,n,{issues:Ba(s)}),r.typed=!0}else{if(o?.length===1)return o[0];ue(this,"type",r,n,{issues:Ba(o)})}return r}}}function qa(e,t,r){let n=e["~run"]({value:t},Is(r));if(n.issues)throw new ip(n.issues);return n.value}function za(e,t){let r={};for(let n in e.entries)r[n]=!t||t.includes(n)?Nt(e.entries[n]):e.entries[n];return{...e,entries:r,get"~standard"(){return ce(this)}}}function Wa(...e){return{...e[0],pipe:e,get"~standard"(){return ce(this)},"~run"(t,r){for(let n of e)if(n.kind!=="metadata"){if(t.issues&&(n.kind==="schema"||n.kind==="transformation")){t.typed=!1;break}(!t.issues||!r.abortEarly&&!r.abortPipeEarly)&&(t=n["~run"](t,r))}return t}}}function Tr(e,t,r){let n=e["~run"]({value:t},Is(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var Za=Wn(J(),Ht([J(),zn(),Ts(),Ds()])),Ga=Wa(J(),js(1),Os(5e3)),Ja=()=>{try{return window.UNAS?Ua():window.Shopify?ja():window.ShopRenter?Pa():null}catch{return null}},Ka=async()=>{try{return window.UNAS?await Va():window.Shopify?await La():window.ShopRenter?await Ra():[]}catch{return[]}},Ft={schema:Te({conversationId:Nt(J()),messages:Nt(Bt(Te({id:J(),timestamp:zn(),role:Ps(["user","assistant","support"]),content:J(),parts:Nt(Bt(Ht([Te({text:J()}),Te({html:J()}),Te({tag:J(),data:Wn(J(),Ls())})])))})))}),getStorageKey(e){if(!e)throw new Error("widgetId is not set");return`_molin_${e}`},persist(e,t,r){let n=this.getStorageKey(e);localStorage.setItem(n,JSON.stringify({conversationId:t,messages:r}))},restore(e){try{let t=this.getStorageKey(e),r=JSON.parse(localStorage.getItem(t)||"{}"),n=qa(this.schema,r);return{conversationId:n.conversationId||"",messages:n.messages||[]}}catch(t){return console.error("Failed to restore conversation state:",t),{conversationId:"",messages:[]}}},reset(e){let t=this.getStorageKey(e);localStorage.removeItem(t)}};var P,Xa,Pr,Rr,qt,V,Ya,Dr=class extends _{constructor(){super();f(this,P);g(this,"contextCtrl");f(this,Pr);f(this,Rr);f(this,qt,null);this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.autoConnect=!0,this.contextCtrl=new Ne(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,ranOutOfCredits:!1,isLiveMode:!1,lastMsg:void 0,hasQueuedMessages:!1,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this)})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.autoConnect&&a(this,P,V).connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:a(this,Pr),xCustomInstructions:a(this,Rr),conversationId:a(this,P,V).conversationId,messages:a(this,P,Xa),isStreaming:a(this,P,V).isStreaming,typingIndicator:a(this,P,V).typingIndicator,ranOutOfCredits:a(this,P,V).ranOutOfCredits,isLiveMode:a(this,P,V).isLiveMode,lastMsg:a(this,P,V).lastMsg,hasQueuedMessages:a(this,P,V).hasQueuedMessages,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this)}),y(this,P,Ya).call(this)}sendUserInput(r,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...n},s=a(this,P,V).sendUserInput(r,i);return s&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:a(this,P,V).conversationId}),s}async enqueueUserInput(r,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...n};return a(this,P,V).enqueueUserInput(r,i)}sendUserCancel(){a(this,P,V).sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){a(this,P,V).sendUserTypingStart()}sendUserTypingStop(){a(this,P,V).sendUserTypingStop()}reset(){a(this,P,V).reset()}reloadConfig(){a(this,P,V).reloadConfig()}connect(){a(this,P,V).connect()}render(){return d`<slot></slot>`}};P=new WeakSet,Xa=function(){return a(this,P,V)?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:a(this,P,V)?.messages||[]},Pr=new WeakMap,Rr=new WeakMap,qt=new WeakMap,V=function(){return a(this,qt)||m(this,qt,new Nn(this,{autoConnect:this.autoConnect,url:r=>{let n=new URL(this.config.wsApiUrl);return n.searchParams.set("widgetId",this.widgetId),n.searchParams.set("conversationId",r),n.searchParams.set("pageUrl",window.location.href),n},onReconnect:()=>{},onError:r=>{console.error("ws error",r)},onClose:()=>{},onNewMessage:r=>{r.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:r,conversationId:a(this,P,V).conversationId})},onMessageAppend:r=>{},onMessageDone:(r,n)=>{n.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:n.content??"",message:n,usage_TOKENS_COMPLETION:r.message.usage.TOKENS_COMPLETION,conversationId:a(this,P,V).conversationId})},onMessageError:r=>{console.error("ws message error",r),r.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+r.message})},onReset:()=>{Ft.reset(this.widgetId)},onConnect:r=>{let n=Ja();a(this,P,V).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:n,language:window.navigator.language,cart:[]}),Ka().then(i=>{i?.length>0&&a(this,P,V).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:n,cart:i,language:window.navigator.language})}).catch(i=>{console.error(i)})},persistConversationState:(r,n)=>{Ft.persist(this.widgetId,r,n)},restoreConversationState:()=>Ft.restore(this.widgetId)})),a(this,qt)},Ya=function(){function r(i){if(!i)return;let s;try{s=typeof i=="object"?i:JSON.parse(i)}catch(u){console.error("Molin: user-data is not valid JSON",u);return}if(!s||typeof s!="object"||Object.keys(s).length===0)return;let o=Tr(Za,s);if(!o.success){console.error("Molin: user-data does not pass schema validation",o.issues);return}return o.output}function n(i){if(!i)return;let s=Tr(Ga,i);if(!s.success){console.error("Molin: custom-instructions does not pass schema validation",s.issues);return}return s.output}m(this,Pr,r(this.xUserData)),m(this,Rr,n(this.xCustomInstructions))},g(Dr,"properties",{widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object},autoConnect:{type:Boolean}});function Qa(e){let t=new qn(e,{provider:Dr,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,n){if(n==="value")return t.value}})}customElements.get("mw-context-widget")||customElements.define("mw-context-widget",Dr);function Ws(e){return[...e.v,(e.i?"!":"")+e.n].join(":")}function op(e,t=","){return e.map(Ws).join(t)}var ol=typeof CSS<"u"&&CSS.escape||(e=>e.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Gn(e){for(var t=9,r=e.length;r--;)t=Math.imul(t^e.charCodeAt(r),1597334677);return"#"+((t^t>>>9)>>>0).toString(36)}function Xn(e,t="@media "){return t+R(e).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(n=>`(${n}-width:${r[n]})`).join(" and "))).join(",")}function R(e=[]){return Array.isArray(e)?e:e==null?[]:[e]}function el(e){return e}function Yn(){}var Y={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function al(e){return e.match(/[-=:;]/g)?.length||0}function Ns(e){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(e)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(al(e),15)<<18}var ap=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function Zs({n:e,i:t,v:r=[]},n,i,s){e&&(e=Ws({n:e,i:t,v:r})),s=[...R(s)];for(let u of r){let l=n.theme("screens",u);for(let c of R(l&&Xn(l)||n.v(u))){var o;s.push(c),i|=l?67108864|Ns(c):u=="dark"?1073741824:c[0]=="@"?Ns(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~ap.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:e,p:i,r:s,i:t}}var ll=new Map;function Hs(e){if(e.d){let t=[],r=Rs(e.r.reduce((n,i)=>i[0]=="@"?(t.push(i),n):i?Rs(n,s=>Rs(i,o=>{let u=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(u){let l=s.indexOf(u[1]);return~l?s.slice(0,l)+u[0]+s.slice(l+u[1].length):Us(s,o)}return Us(o,s)})):n,"&"),n=>Us(n,e.n?"."+ol(e.n):""));return r&&t.push(r.replace(/:merge\((.+?)\)/g,"$1")),t.reduceRight((n,i)=>i+"{"+n+"}",e.d)}}function Rs(e,t){return e.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,n,i)=>t(n)+i)}function Us(e,t){return e.replace(/&/g,t)}var tl=new Intl.Collator("en",{numeric:!0});function ul(e,t){for(var r=0,n=e.length;r<n;){let i=n+r>>1;0>=cl(e[i],t)?r=i+1:n=i}return n}function cl(e,t){let r=e.p&Y.o;return r==(t.p&Y.o)&&(r==Y.b||r==Y.o)?0:e.p-t.p||e.o-t.o||tl.compare(rl(e.n),rl(t.n))||tl.compare(nl(e.n),nl(t.n))}function rl(e){return(e||"").split(/:/).pop().split("/").pop()||"\0"}function nl(e){return(e||"").replace(/\W/g,t=>String.fromCharCode(127+t.charCodeAt(0)))+"\0"}function Vs(e,t){return Math.round(parseInt(e,16)*t)}function ge(e,t={}){if(typeof e=="function")return e(t);let{opacityValue:r="1",opacityVariable:n}=t,i=n?`var(${n})`:r;if(e.includes("<alpha-value>"))return e.replace("<alpha-value>",i);if(e[0]=="#"&&(e.length==4||e.length==7)){let s=(e.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Vs(e.substr(1,s),o),Vs(e.substr(1+s,s),o),Vs(e.substr(1+2*s,s),o),i]})`}return i=="1"?e:i=="0"?"#0000":e.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function pl(e,t,r,n,i=[]){return(function s(o,{n:u,p:l,r:c=[],i:p},h){let v=[],b="",$=0,O=0;for(let k in o||{}){var C,M;let E=o[k];if(k[0]=="@"){if(!E)continue;if(k[1]=="a"){v.push(...Js(u,l,Kn(""+E),h,l,c,p,!0));continue}if(k[1]=="l"){for(let j of R(E))v.push(...s(j,{n:u,p:(C=Y[k[7]],l&~Y.o|C),r:k[7]=="d"?[]:c,i:p},h));continue}if(k[1]=="i"){v.push(...R(E).map(j=>({p:-1,o:0,r:[],d:k+" "+j})));continue}if(k[1]=="k"){v.push({p:Y.d,o:0,r:[k],d:s(E,{p:Y.d},h).map(Hs).join("")});continue}if(k[1]=="f"){v.push(...R(E).map(j=>({p:Y.d,o:0,r:[k],d:s(j,{p:Y.d},h).map(Hs).join("")})));continue}}if(typeof E!="object"||Array.isArray(E))k=="label"&&E?u=E+Gn(JSON.stringify([l,p,o])):(E||E===0)&&(k=k.replace(/[A-Z]/g,j=>"-"+j.toLowerCase()),O+=1,$=Math.max($,(M=k)[0]=="-"?0:al(M)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(M)?+!!RegExp.$1||-!!RegExp.$2:0)+1),b+=(b?";":"")+R(E).map(j=>h.s(k,Gs(""+j,h.theme)+(p?" !important":""))).join(";"));else if(k[0]=="@"||k.includes("&")){let j=l;k[0]=="@"&&(k=k.replace(/\bscreen\(([^)]+)\)/g,(N,K)=>{let te=h.theme("screens",K);return te?(j|=67108864,Xn(te,"")):N}),j|=Ns(k)),v.push(...s(E,{n:u,p:j,r:[...c,k],i:p},h))}else v.push(...s(E,{p:l,r:[...c,k]},h))}return v.unshift({n:u,p:l,o:Math.max(0,15-O)+1.5*Math.min($||15,15),r:c,d:b}),v.sort(cl)})(e,Zs(t,r,n,i),r)}function Gs(e,t){return e.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,n,i,s,o="")=>{let u=t(i,o);return typeof u=="function"&&/color|fill|stroke/i.test(i)?ge(u):""+R(u).filter(l=>Object(l)!==l)})}function hl(e,t){let r,n=[];for(let i of e)i.d&&i.n?r?.p==i.p&&""+r.r==""+i.r?(r.c=[r.c,i.c].filter(Boolean).join(" "),r.d=r.d+";"+i.d):n.push(r={...i,n:i.n&&t}):n.push({...i,n:i.n&&t});return n}function Jn(e,t,r=Y.u,n,i){let s=[];for(let o of e)for(let u of(function(l,c,p,h,v){l={...l,i:l.i||v};let b=(function($,O){let C=ll.get($.n);return C?C($,O):O.r($.n,$.v[0]=="dark")})(l,c);return b?typeof b=="string"?({r:h,p}=Zs(l,c,p,h),hl(Jn(Kn(b),c,p,h,l.i),l.n)):Array.isArray(b)?b.map($=>{var O,C;return{o:0,...$,r:[...R(h),...R($.r)],p:(O=p,C=$.p??p,O&~Y.o|C)}}):pl(b,l,c,p,h):[{c:Ws(l),p:0,o:0,r:[]}]})(o,t,r,n,i))s.splice(ul(s,u),0,u);return s}function Js(e,t,r,n,i,s,o,u){return hl((u?r.flatMap(l=>Jn([l],n,i,s,o)):Jn(r,n,i,s,o)).map(l=>l.p&Y.o&&(l.n||t==Y.b)?{...l,p:l.p&~Y.o|t,o:0}:l),e)}function lp(e,t,r,n){var i;return i=(s,o)=>{let{n:u,p:l,r:c,i:p}=Zs(s,o,t);return r&&Js(u,t,r,o,l,c,p,n)},ll.set(e,i),e}function Bs(e,t,r){if(e[e.length-1]!="("){let n=[],i=!1,s=!1,o="";for(let u of e)if(!(u=="("||/[~@]$/.test(u))){if(u[0]=="!"&&(u=u.slice(1),i=!i),u.endsWith(":")){n[u=="dark:"?"unshift":"push"](u.slice(0,-1));continue}u[0]=="-"&&(u=u.slice(1),s=!s),u.endsWith("-")&&(u=u.slice(0,-1)),u&&u!="&"&&(o+=(o&&"-")+u)}o&&(s&&(o="-"+o),t[0].push({n:o,v:n.filter(up),i}))}}function up(e,t,r){return r.indexOf(e)==t}var il=new Map;function Kn(e){let t=il.get(e);if(!t){let r=[],n=[[]],i=0,s=0,o=null,u=0,l=(c,p=0)=>{i!=u&&(r.push(e.slice(i,u+p)),c&&Bs(r,n)),i=u+1};for(;u<e.length;u++){let c=e[u];if(s)e[u-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)e[u-1]!="\\"&&o.test(e.slice(u))&&(o=null,i=u+RegExp.lastMatch.length);else if(c=="/"&&e[u-1]!="\\"&&(e[u+1]=="*"||e[u+1]=="/"))o=e[u+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),r.push(c);else if(c==":")e[u+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let p=r.lastIndexOf("(");if(c==")"){let h=r[p-1];if(/[~@]$/.test(h)){let v=n.shift();r.length=p,Bs([...r,"#"],n);let{v:b}=n[0].pop();for(let $ of v)$.v.splice(+($.v[0]=="dark")-+(b[0]=="dark"),b.length);Bs([...r,lp(h.length>1?h.slice(0,-1)+Gn(JSON.stringify([h,v])):h+"("+op(v)+")",Y.a,v,/@$/.test(h))],n)}p=r.lastIndexOf("(",p-1)}r.length=p+1}else/[~@]/.test(c)&&e[u+1]=="("&&n.unshift([])}l(!0),il.set(e,t=n[0])}return t}function w(e,t,r){return[e,Fs(t,r)]}function Fs(e,t){return typeof e=="function"?e:typeof e=="string"&&/^[\w-]+$/.test(e)?(r,n)=>({[e]:t?t(r,n):qs(r,1)}):r=>e||{[r[1]]:qs(r,2)}}function qs(e,t,r=e.slice(t).find(Boolean)||e.$$||e.input){return e.input[0]=="-"?`calc(${r} * -1)`:r}function x(e,t,r,n){return[e,Ks(t,r,n)]}function Ks(e,t,r){let n=typeof t=="string"?(i,s)=>({[t]:r?r(i,s):i._}):t||(({1:i,_:s},o,u)=>({[i||u]:s}));return(i,s)=>{let o=dl(e||i[1]),u=s.theme(o,i.$$)??Me(i.$$,o,s);if(u!=null)return i._=qs(i,0,u),n(i,s,o)}}function Q(e,t={},r){return[e,cp(t,r)]}function cp(e={},t){return(r,n)=>{let{section:i=dl(r[0]).replace("-","")+"Color"}=e,[s,o]=pp(r.$$);if(!s)return;let u=n.theme(i,s)||Me(s,i,n);if(!u||typeof u=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:c=i.replace("Color","Opacity"),property:p=i,selector:h}=e,v=n.theme(c,o||"DEFAULT")||o&&Me(o,c,n),b=t||(({_:O})=>{let C=Ur(p,O);return h?{[h]:C}:C});r._={value:ge(u,{opacityVariable:l||void 0,opacityValue:v||void 0}),color:O=>ge(u,O),opacityVariable:l||void 0,opacityValue:v||void 0};let $=b(r,n);if(!r.dark){let O=n.d(i,s,u);O&&O!==u&&(r._={value:ge(O,{opacityVariable:l||void 0,opacityValue:v||"1"}),color:C=>ge(O,C),opacityVariable:l||void 0,opacityValue:v||void 0},$={"&":$,[n.v("dark")]:b(r,n)})}return $}}function pp(e){return(e.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Ur(e,t){let r={};return typeof t=="string"?r[e]=t:(t.opacityVariable&&t.value.includes(t.opacityVariable)&&(r[t.opacityVariable]=t.opacityValue||"1"),r[e]=t.value),r}function Me(e,t,r){if(e[0]=="["&&e.slice(-1)=="]"){if(e=zt(Gs(e.slice(1,-1),r.theme)),!t)return e;if(!(/color|fill|stroke/i.test(t)&&!(/^color:/.test(e)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(e))||/image/i.test(t)&&!(/^image:/.test(e)||/^[a-z-]+\(/.test(e))||/weight/i.test(t)&&!(/^(number|any):/.test(e)||/^\d+$/.test(e))||/position/i.test(t)&&/^(length|size):/.test(e)))return e.replace(/^[a-z-]+:/,"")}}function dl(e){return e.replace(/-./g,t=>t[1].toUpperCase())}function zt(e){return e.includes("url(")?e.replace(/(.*?)(url\(.*?\))(.*?)/g,(t,r="",n,i="")=>zt(r)+n+zt(i)):e.replace(/(^|[^\\])_+/g,(t,r)=>r+" ".repeat(t.length-r.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,t=>t.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function Xs({presets:e=[],...t}){let r={darkMode:void 0,darkColor:void 0,preflight:t.preflight!==!1&&[],theme:{},variants:R(t.variants),rules:R(t.rules),ignorelist:R(t.ignorelist),hash:void 0,stringify:(n,i)=>n+":"+i,finalize:[]};for(let n of R([...e,{darkMode:t.darkMode,darkColor:t.darkColor,preflight:t.preflight!==!1&&R(t.preflight),theme:t.theme,hash:t.hash,stringify:t.stringify,finalize:t.finalize}])){let{preflight:i,darkMode:s=r.darkMode,darkColor:o=r.darkColor,theme:u,variants:l,rules:c,ignorelist:p,hash:h=r.hash,stringify:v=r.stringify,finalize:b}=typeof n=="function"?n(r):n;r={preflight:r.preflight!==!1&&i!==!1&&[...r.preflight,...R(i)],darkMode:s,darkColor:o,theme:{...r.theme,...u,extend:{...r.theme.extend,...u?.extend}},variants:[...r.variants,...R(l)],rules:[...r.rules,...R(c)],ignorelist:[...r.ignorelist,...R(p)],hash:h,stringify:v,finalize:[...r.finalize,...R(b)]}}return r}function sl(e,t,r,n,i,s){for(let o of t){let u=r.get(o);u||r.set(o,u=n(o));let l=u(e,i,s);if(l)return l}}function hp(e){var t;return zs(e[0],typeof(t=e[1])=="function"?t:()=>t)}function dp(e){var t,r;return Array.isArray(e)?zs(e[0],Fs(e[1],e[2])):zs(e,Fs(t,r))}function zs(e,t){return fl(e,(r,n,i,s)=>{let o=n.exec(r);if(o)return o.$$=r.slice(o[0].length),o.dark=s,t(o,i)})}function fl(e,t){let r=R(e).map(fp);return(n,i,s)=>{for(let o of r){let u=t(n,o,i,s);if(u)return u}}}function fp(e){return typeof e=="string"?RegExp("^"+e+(e.includes("$")||e.slice(-1)=="-"?"":"$")):e}function ml(e,t){let r=Xs(e),n=(function({theme:l,darkMode:c,darkColor:p=Yn,variants:h,rules:v,hash:b,stringify:$,ignorelist:O,finalize:C}){let M=new Map,k=new Map,E=new Map,j=new Map,N=fl(O,(D,re)=>re.test(D));h.push(["dark",Array.isArray(c)||c=="class"?`${R(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let K=typeof b=="function"?D=>b(D,Gn):b?Gn:el;K!==el&&C.push(D=>({...D,n:D.n&&K(D.n),d:D.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(re,oe)=>"--"+K(oe).replace("#",""))}));let te={theme:(function({extend:D={},...re}){let oe={},is={get colors(){return Ye("colors")},theme:Ye,negative(){return{}},breakpoints(W){let ne={};for(let le in W)typeof W[le]=="string"&&(ne["screen-"+le]=W[le]);return ne}};return Ye;function Ye(W,ne,le,wr){if(W){if({1:W,2:wr}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(W)||[,W],/[.[]/.test(W)){let Oe=[];W.replace(/\[([^\]]+)\]|([^.[]+)/g,(et,xr,kc=xr)=>Oe.push(kc)),W=Oe.shift(),le=ne,ne=Oe.join("-")}let Ee=oe[W]||Object.assign(Object.assign(oe[W]={},An(re,W)),An(D,W));if(ne==null)return Ee;ne||(ne="DEFAULT");let Qe=Ee[ne]??ne.split("-").reduce((Oe,et)=>Oe?.[et],Ee)??le;return wr?ge(Qe,{opacityValue:Gs(wr,Ye)}):Qe}let vr={};for(let Ee of[...Object.keys(re),...Object.keys(D)])vr[Ee]=Ye(Ee);return vr}function An(W,ne){let le=W[ne];return typeof le=="function"&&(le=le(is)),le&&/color|fill|stroke/i.test(ne)?(function wr(vr,Ee=[]){let Qe={};for(let Oe in vr){let et=vr[Oe],xr=[...Ee,Oe];Qe[xr.join("-")]=et,Oe=="DEFAULT"&&(xr=Ee,Qe[Ee.join("-")]=et),typeof et=="object"&&Object.assign(Qe,wr(et,xr))}return Qe})(le):le}})(l),e:ol,h:K,s(D,re){return $(D,re,te)},d(D,re,oe){return p(D,re,te,oe)},v(D){return M.has(D)||M.set(D,sl(D,h,k,hp,te)||"&:"+D),M.get(D)},r(D,re){let oe=JSON.stringify([D,re]);return E.has(oe)||E.set(oe,!N(D,te)&&sl(D,v,j,dp,te,re)),E.get(oe)},f(D){return C.reduce((re,oe)=>oe(re,te),D)}};return te})(r),i=new Map,s=[],o=new Set;t.resume(l=>i.set(l,l),(l,c)=>{t.insert(l,s.length,c),s.push(c),o.add(l)});function u(l){let c=n.f(l),p=Hs(c);if(p&&!o.has(p)){o.add(p);let h=ul(s,l);t.insert(p,h,l),s.splice(h,0,l)}return c.n}return Object.defineProperties(function(c){if(!i.size)for(let h of R(r.preflight))typeof h=="function"&&(h=h(n)),h&&(typeof h=="string"?Js("",Y.b,Kn(h),n,Y.b,[],!1,!0):pl(h,{},n,Y.b)).forEach(u);c=""+c;let p=i.get(c);if(!p){let h=new Set;for(let v of Jn(Kn(c),n))h.add(v.c).add(u(v));p=[...h].filter(Boolean).join(" "),i.set(c,p).set(p,p)}return p},Object.getOwnPropertyDescriptors({get target(){return t.target},theme:n.theme,config:r,snapshot(){let l=t.snapshot(),c=new Set(o),p=new Map(i),h=[...s];return()=>{l(),o=c,i=p,s=h}},clear(){t.clear(),o=new Set,i=new Map,s=[]},destroy(){this.clear(),t.destroy()}}))}function mp(e,t){return e!=t&&""+e.split(" ").sort()!=""+t.split(" ").sort()}function gl(e){let t=new MutationObserver(r);return{observe(i){t.observe(i,{attributeFilter:["class"],subtree:!0,childList:!0}),n(i),r([{target:i,type:""}])},disconnect(){t.disconnect()}};function r(i){for(let{type:s,target:o}of i)if(s[0]=="a")n(o);else for(let u of o.querySelectorAll("[class]"))n(u);t.takeRecords()}function n(i){let s,o=i.getAttribute?.("class");o&&mp(o,s=e(o))&&i.setAttribute("class",s)}}function gp(e){let t=document.querySelector(e||'style[data-twind=""]');return(!t||t.tagName!="STYLE")&&(t=document.createElement("style"),document.head.prepend(t)),t.dataset.twind="claimed",t}function Qn(e){let t=e?.cssRules?e:(e&&typeof e!="string"?e:gp(e)).sheet;return{target:t,snapshot(){let r=Array.from(t.cssRules,n=>n.cssText);return()=>{this.clear(),r.forEach(this.insert)}},clear(){for(let r=t.cssRules.length;r--;)t.deleteRule(r)},destroy(){t.ownerNode?.remove()},insert(r,n){try{t.insertRule(r,n)}catch{t.insertRule(":root{}",n)}},resume:Yn}}var yp=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function yl(e){return yp.get(e)}function wl(e){var t=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(e);return t?t[1]?1:t[2]?2:t[3]?3:5:0}function vl(e,t){var r=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(e);return r?r[1]?/^sti/i.test(t)?1:0:r[2]?/^pat/i.test(t)?1:0:r[3]?/^image-/i.test(t)?1:0:r[4]?t[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(t)?4:0:0}var wp=[["-webkit-",1],["-moz-",2],["-ms-",4]];function xl(){return({stringify:e})=>({stringify(t,r,n){let i="",s=yl(t);s&&(i+=e(s,r,n)+";");let o=wl(t),u=vl(t,r);for(let l of wp)o&l[1]&&(i+=e(l[0]+t,r,n)+";"),u&l[1]&&(i+=e(t,l[0]+r,n)+";");return i+e(t,r,n)}})}function kl(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",Ks("lineClamp",({_:e})=>bl(e))],["line-clamp-(\\d+)",({1:e})=>bl(e)]]}}function bl(e){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${e}`}}var Br={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...pe(4,"rem",4,.5,.5),...pe(12,"rem",4,5),14:"3.5rem",...pe(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:T("blur"),backdropBrightness:T("brightness"),backdropContrast:T("contrast"),backdropGrayscale:T("grayscale"),backdropHueRotate:T("hueRotate"),backdropInvert:T("invert"),backdropOpacity:T("opacity"),backdropSaturate:T("saturate"),backdropSepia:T("sepia"),backgroundColor:T("colors"),backgroundImage:{none:"none"},backgroundOpacity:T("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...pe(200,"",100,0,50),...pe(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:e})=>({DEFAULT:e("colors.gray.200","currentColor"),...e("colors")}),borderOpacity:T("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:T("spacing"),borderWidth:{DEFAULT:"1px",...ye(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:T("colors"),caretColor:T("colors"),accentColor:({theme:e})=>({auto:"auto",...e("colors")}),contrast:{...pe(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:T("borderColor"),divideOpacity:T("borderOpacity"),divideWidth:T("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:e})=>({...e("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({...e("spacing"),...Vr(2,6),...Vr(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:T("spacing"),gradientColorStops:T("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:e})=>({...e("spacing"),...Vr(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:e})=>({...e("spacing"),...Vr(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...pe(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),maxHeight:({theme:e})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...e("spacing")}),maxWidth:({theme:e,breakpoints:t})=>({...t(e("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...pe(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:T("spacing"),placeholderColor:T("colors"),placeholderOpacity:T("opacity"),outlineColor:T("colors"),outlineOffset:ye(8,"px"),outlineWidth:ye(8,"px"),ringColor:({theme:e})=>({...e("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:T("colors"),ringOffsetWidth:ye(8,"px"),ringOpacity:({theme:e})=>({...e("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...ye(8,"px")},rotate:{...ye(2,"deg"),...ye(12,"deg",3),...ye(180,"deg",45)},saturate:pe(200,"",100,0,50),scale:{...pe(150,"",100,0,50),...pe(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:T("spacing"),scrollPadding:T("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...ye(2,"deg"),...ye(12,"deg",3)},space:T("spacing"),stroke:({theme:e})=>({...e("colors"),none:"none"}),strokeWidth:pe(2),textColor:T("colors"),textDecorationColor:T("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...ye(8,"px")},textUnderlineOffset:{auto:"auto",...ye(8,"px")},textIndent:T("spacing"),textOpacity:T("opacity"),transitionDuration:({theme:e})=>({...e("durations"),DEFAULT:"150ms"}),transitionDelay:T("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:e})=>({...e("spacing"),...Vr(2,4),full:"100%"}),width:({theme:e})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...e("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...pe(50,"",1,0,10),auto:"auto"}};function Vr(e,t){let r={};do for(var n=1;n<e;n++)r[`${n}/${e}`]=Number((n/e*100).toFixed(6))+"%";while(++e<=t);return r}function ye(e,t,r=0){let n={};for(;r<=e;r=2*r||1)n[r]=r+t;return n}function pe(e,t="",r=1,n=0,i=1,s={}){for(;n<=e;n+=i)s[n]=n/r+t;return s}function T(e){return({theme:t})=>t(e)}var Cl={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${Br.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${Br.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var Al=[w("\\[([-\\w]+):(.+)]",({1:e,2:t},r)=>({"@layer overrides":{"&":{[e]:Me(`[${t}]`,"",r)}}})),w("(group|peer)([~/][^-[]+)?",({input:e},{h:t})=>[{c:t(e)}]),x("aspect-","aspectRatio"),w("container",(e,{theme:t})=>{let{screens:r=t("screens"),center:n,padding:i}=t("container"),s={width:"100%",marginRight:n&&"auto",marginLeft:n&&"auto",...o("xs")};for(let u in r){let l=r[u];typeof l=="string"&&(s[Xn(l)]={"&":{maxWidth:l,...o(u)}})}return s;function o(u){let l=i&&(typeof i=="string"?i:i[u]||i.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),x("content-","content",({_:e})=>({"--tw-content":e,content:"var(--tw-content)"})),w("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),w("box-(border|content)","boxSizing",({1:e})=>e+"-box"),w("hidden",{display:"none"}),w("table-(auto|fixed)","tableLayout"),w(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",w("isolate","isolation"),w("object-(contain|cover|fill|none|scale-down)","objectFit"),x("object-","objectPosition"),w("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",ei),w("overscroll(-[xy])?-(auto|contain|none)",({1:e="",2:t})=>({["overscroll-behavior"+e]:t})),w("(static|fixed|absolute|relative|sticky)","position"),x("-?inset(-[xy])?(?:$|-)","inset",({1:e,_:t})=>({top:e!="-x"&&t,right:e!="-y"&&t,bottom:e!="-x"&&t,left:e!="-y"&&t})),x("-?(top|bottom|left|right)(?:$|-)","inset"),w("(visible|collapse)","visibility"),w("invisible",{visibility:"hidden"}),x("-?z-","zIndex"),w("flex-((row|col)(-reverse)?)","flexDirection",$l),w("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),x("(flex-(?:grow|shrink))(?:$|-)"),x("(flex)-"),x("grow(?:$|-)","flexGrow"),x("shrink(?:$|-)","flexShrink"),x("basis-","flexBasis"),x("-?(order)-"),"-?(order)-(\\d+)",x("grid-cols-","gridTemplateColumns"),w("grid-cols-(\\d+)","gridTemplateColumns",Ml),x("col-","gridColumn"),w("col-(span)-(\\d+)","gridColumn",_l),x("col-start-","gridColumnStart"),w("col-start-(auto|\\d+)","gridColumnStart"),x("col-end-","gridColumnEnd"),w("col-end-(auto|\\d+)","gridColumnEnd"),x("grid-rows-","gridTemplateRows"),w("grid-rows-(\\d+)","gridTemplateRows",Ml),x("row-","gridRow"),w("row-(span)-(\\d+)","gridRow",_l),x("row-start-","gridRowStart"),w("row-start-(auto|\\d+)","gridRowStart"),x("row-end-","gridRowEnd"),w("row-end-(auto|\\d+)","gridRowEnd"),w("grid-flow-((row|col)(-dense)?)","gridAutoFlow",e=>ei($l(e))),w("grid-flow-(dense)","gridAutoFlow"),x("auto-cols-","gridAutoColumns"),x("auto-rows-","gridAutoRows"),x("gap-x(?:$|-)","gap","columnGap"),x("gap-y(?:$|-)","gap","rowGap"),x("gap(?:$|-)","gap"),"(justify-(?:items|self))-",w("justify-","justifyContent",Sl),w("(content|items|self)-",e=>({["align-"+e[1]]:Sl(e)})),w("(place-(content|items|self))-",({1:e,$$:t})=>({[e]:("wun".includes(t[3])?"space-":"")+t})),x("p([xytrbl])?(?:$|-)","padding",Wt("padding")),x("-?m([xytrbl])?(?:$|-)","margin",Wt("margin")),x("-?space-(x|y)(?:$|-)","space",({1:e,_:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${e}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[e]]:`calc(${t} * calc(1 - var(--tw-space-${e}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[e]]:`calc(${t} * var(--tw-space-${e}-reverse))`}})),w("space-(x|y)-reverse",({1:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${e}-reverse`]:"1"}})),x("w-","width"),x("min-w-","minWidth"),x("max-w-","maxWidth"),x("h-","height"),x("min-h-","minHeight"),x("max-h-","maxHeight"),x("font-","fontWeight"),x("font-","fontFamily",({_:e})=>typeof(e=R(e))[1]=="string"?{fontFamily:ke(e)}:{fontFamily:ke(e[0]),...e[1]}),w("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),w("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),w("italic","fontStyle"),w("not-italic",{fontStyle:"normal"}),w("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:e,2:t="",3:r})=>t=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(r?"numeric-fraction":"pt".includes(t[0])?"numeric-spacing":t?"numeric-figure":e)]:e,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...He({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),x("tracking-","letterSpacing"),x("leading-","lineHeight"),w("list-(inside|outside)","listStylePosition"),x("list-","listStyleType"),w("list-","listStyleType"),x("placeholder-opacity-","placeholderOpacity",({_:e})=>({"&::placeholder":{"--tw-placeholder-opacity":e}})),Q("placeholder-",{property:"color",selector:"&::placeholder"}),w("text-(left|center|right|justify|start|end)","textAlign"),w("text-(ellipsis|clip)","textOverflow"),x("text-opacity-","textOpacity","--tw-text-opacity"),Q("text-",{property:"color"}),x("text-","fontSize",({_:e})=>typeof e=="string"?{fontSize:e}:{fontSize:e[0],...typeof e[1]=="string"?{lineHeight:e[1]}:e[1]}),x("indent-","textIndent"),w("(overline|underline|line-through)","textDecorationLine"),w("no-underline",{textDecorationLine:"none"}),x("underline-offset-","textUnderlineOffset"),Q("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),x("decoration-","textDecorationThickness"),w("decoration-","textDecorationStyle"),w("(uppercase|lowercase|capitalize)","textTransform"),w("normal-case",{textTransform:"none"}),w("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),w("align-","verticalAlign"),w("whitespace-","whiteSpace"),w("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),w("break-words",{overflowWrap:"break-word"}),w("break-all",{wordBreak:"break-all"}),w("break-keep",{wordBreak:"keep-all"}),Q("caret-",{opacityVariable:!1,opacitySection:"opacity"}),Q("accent-",{opacityVariable:!1,opacitySection:"opacity"}),w("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:e})=>`linear-gradient(to ${pt(e," ")},var(--tw-gradient-stops))`),Q("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:e})=>({"--tw-gradient-from":e.value,"--tw-gradient-to":e.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),Q("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:e})=>({"--tw-gradient-to":e.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${e.value},var(--tw-gradient-to)`})),Q("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),w("bg-(fixed|local|scroll)","backgroundAttachment"),w("bg-origin-(border|padding|content)","backgroundOrigin",({1:e})=>e+"-box"),w(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),w("bg-blend-","backgroundBlendMode"),w("bg-clip-(border|padding|content|text)","backgroundClip",({1:e})=>e+(e=="text"?"":"-box")),x("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),Q("bg-",{section:"backgroundColor"}),x("bg-","backgroundImage"),x("bg-","backgroundPosition"),w("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",ei),x("bg-","backgroundSize"),x("rounded(?:$|-)","borderRadius"),x("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:e,_:t})=>{let r={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[e]||[e,e];return{[`border-${pt(r[0])}-radius`]:t,[`border-${pt(r[1])}-radius`]:t}}),w("border-(collapse|separate)","borderCollapse"),x("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),w("border-(solid|dashed|dotted|double|none)","borderStyle"),x("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:e,_:t})=>({...He({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(e||"-x")]:t,["--tw-border-spacing"+(e||"-y")]:t,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),Q("border-([xytrbl])-",{section:"borderColor"},Wt("border","Color")),Q("border-"),x("border-([xytrbl])(?:$|-)","borderWidth",Wt("border","Width")),x("border(?:$|-)","borderWidth"),x("divide-opacity(?:$|-)","divideOpacity",({_:e})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":e}})),w("divide-(solid|dashed|dotted|double|none)",({1:e})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:e}})),w("divide-([xy]-reverse)",({1:e})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+e]:"1"}})),x("divide-([xy])(?:$|-)","divideWidth",({1:e,_:t})=>{let r={x:"lr",y:"tb"}[e];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${e}-reverse`]:"0",[`border-${pt(r[0])}Width`]:`calc(${t} * calc(1 - var(--tw-divide-${e}-reverse)))`,[`border-${pt(r[1])}Width`]:`calc(${t} * var(--tw-divide-${e}-reverse))`}}}),Q("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),x("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),Q("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),x("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),w("ring-inset",{"--tw-ring-inset":"inset"}),Q("ring-",{property:"--tw-ring-color"}),x("ring(?:$|-)","ringWidth",({_:e},{theme:t})=>({...He({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":t("ringOffsetWidth","","0px"),"--tw-ring-offset-color":ge(t("ringOffsetColor","","#fff")),"--tw-ring-color":ge(t("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":t("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${e} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),Q("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:e})=>({"--tw-shadow-color":e.value,"--tw-shadow":"var(--tw-shadow-colored)"})),x("shadow(?:$|-)","boxShadow",({_:e})=>({...He({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":ke(e),"--tw-shadow-colored":ke(e).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),x("(opacity)-"),w("mix-blend-","mixBlendMode"),...El(),...El("backdrop-"),x("transition(?:$|-)","transitionProperty",(e,{theme:t})=>({transitionProperty:ke(e),transitionTimingFunction:e._=="none"?void 0:ke(t("transitionTimingFunction","")),transitionDuration:e._=="none"?void 0:ke(t("transitionDuration",""))})),x("duration(?:$|-)","transitionDuration","transitionDuration",ke),x("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",ke),x("delay(?:$|-)","transitionDelay","transitionDelay",ke),x("animate(?:$|-)","animation",(e,{theme:t,h:r,e:n})=>{let i=ke(e),s=i.split(" "),o=t("keyframes",s[0]);return o?{["@keyframes "+(s[0]=n(r(s[0])))]:o,animation:s.join(" ")}:{animation:i}}),"(transform)-(none)",w("transform",Qs),w("transform-(cpu|gpu)",({1:e})=>({"--tw-transform":Il(e=="gpu")})),x("scale(-[xy])?-","scale",({1:e,_:t})=>({["--tw-scale"+(e||"-x")]:t,["--tw-scale"+(e||"-y")]:t,...Qs()})),x("-?(rotate)-","rotate",Ys),x("-?(translate-[xy])-","translate",Ys),x("-?(skew-[xy])-","skew",Ys),w("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",ei),"(appearance)-",x("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",x("(cursor)-"),"(cursor)-",w("snap-(none)","scroll-snap-type"),w("snap-(x|y|both)",({1:e})=>({...He({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":e+" var(--tw-scroll-snap-strictness)"})),w("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),w("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),w("snap-(normal|always)","scroll-snap-stop"),w("scroll-(auto|smooth)","scroll-behavior"),x("scroll-p([xytrbl])?(?:$|-)","padding",Wt("scroll-padding")),x("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",Wt("scroll-margin")),w("touch-(auto|none|manipulation)","touch-action"),w("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:e,2:t,3:r})=>({...He({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${t?"pan-x":r?"pan-y":e}`]:e,"touch-action":"var(--tw-touch-action)"})),w("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),w("outline",{outlineStyle:"solid"}),w("outline-(dashed|dotted|double)","outlineStyle"),x("-?(outline-offset)-"),Q("outline-",{opacityVariable:!1,opacitySection:"opacity"}),x("outline-","outlineWidth"),"(pointer-events)-",x("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:e})=>({x:"horizontal",y:"vertical"})[e]||e||"both"],w("select-(none|text|all|auto)","userSelect"),Q("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),Q("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),x("stroke-","strokeWidth"),w("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),w("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function ei(e){return(typeof e=="string"?e:e[1]).replace(/-/g," ").trim()}function $l(e){return(typeof e=="string"?e:e[1]).replace("col","column")}function pt(e,t="-"){let r=[];for(let n of e)r.push({t:"top",r:"right",b:"bottom",l:"left"}[n]);return r.join(t)}function ke(e){return e&&""+(e._||e)}function Sl({$$:e}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[e[3]||""]||"")+e}function Wt(e,t=""){return({1:r,_:n})=>{let i={x:"lr",y:"tb"}[r]||r+r;return i?{...Ur(e+"-"+pt(i[0])+t,n),...Ur(e+"-"+pt(i[1])+t,n)}:Ur(e+t,n)}}function El(e=""){let t=["blur","brightness","contrast","grayscale","hue-rotate","invert",e&&"opacity","saturate","sepia",!e&&"drop-shadow"].filter(Boolean),r={};for(let n of t)r[`--tw-${e}${n}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...He(r),[`${e}filter`]:t.map(n=>`var(--tw-${e}${n})`).join(" ")},[`(${e}filter)-(none)`,w(`${e}filter`,r),...t.map(n=>x(`${n[0]=="h"?"-?":""}(${e}${n})(?:$|-)`,n,({1:i,_:s})=>({[`--tw-${i}`]:R(s).map(o=>`${n}(${o})`).join(" "),...r})))]}function Ys({1:e,_:t}){return{["--tw-"+e]:t,...Qs()}}function Qs(){return{...He({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":Il()}),transform:"var(--tw-transform)"}}function Il(e){return[e?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function _l({1:e,2:t}){return`${e} ${t} / ${e} ${t}`}function Ml({1:e}){return`repeat(${e},minmax(0,1fr))`}function He(e){return{"@layer defaults":{"*,::before,::after":e,"::backdrop":e}}}var Ol=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:e})=>`@media (orientation:${e})`],["contrast-(more|less)",({1:e})=>`@media (prefers-contrast:${e})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:e})=>`&::${e}`],["(marker|selection)",({1:e})=>`& *::${e},&::${e}`],["file","&::file-selector-button"],["(first|last|only)",({1:e})=>`&:${e}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:e,$$:t},r)=>t&&`&[${e}-${r.theme(e,t)||Me(t,"",r)||`${t}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:e,3:t="",4:r,5:n="",6:i=t},{e:s,h:o,v:u})=>{let l=zt(n)||(r[0]=="["?r:u(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(e+i))})`)}${e[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:e})=>`[dir="${e}"] &`],["supports-",({$$:e},t)=>{if(e&&(e=t.theme("supports",e)||Me(e,"",t)),e)return e.includes(":")||(e+=":var(--tw)"),/^\w*\s*\(/.test(e)||(e=`(${e})`),`@supports ${e.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:e},t)=>{if(e&&(e=t.theme("screens",e)||Me(e,"",t)),typeof e=="string")return`@media not all and (min-width:${e})`}],["min-",({$$:e},t)=>(e&&(e=Me(e,"",t)),e&&`@media (min-width:${e})`)],[/^\[(.+)]$/,({1:e})=>/[&@]/.test(e)&&zt(e).replace(/[}]+$/,"").split("{")]];function jl({colors:e,disablePreflight:t}={}){return{preflight:t?void 0:Cl,theme:{...Br,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...e}},variants:Ol,rules:Al,finalize(r){return r.n&&r.d&&r.r.some(n=>/^&::(before|after)$/.test(n))&&!/(^|;)content:/.test(r.d)?{...r,d:"content:var(--tw-content);"+r.d}:r}}}var vp={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},xp={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},bp={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},kp={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Cp={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},$p={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Sp={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Ep={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},_p={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Mp={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Ap={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Ip={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Op={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},jp={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Lp={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Tp={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Dp={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Pp={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},Rp={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},Up={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},Vp={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},Bp={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Ll={__proto__:null,slate:vp,gray:xp,zinc:bp,neutral:kp,stone:Cp,red:$p,orange:Sp,amber:Ep,yellow:_p,lime:Mp,green:Ap,emerald:Ip,teal:Op,cyan:jp,sky:Lp,blue:Tp,indigo:Dp,violet:Pp,purple:Rp,fuchsia:Up,pink:Vp,rose:Bp};function Tl({disablePreflight:e}={}){return jl({colors:Ll,disablePreflight:e})}function Rl({className:e="prose",defaultColor:t="gray",extend:r={},colors:n={}}={}){return n={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...n,dark:n.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...n.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${e}-${s}`,(u,l)=>Ul(e,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${e})`,({1:s},{h:o})=>[{c:o(s)}]],[`${e}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[e+"-",({$$:s},o)=>{let u=Pl(o.theme("fontSize",s));return u&&{"@layer components":u}}],[e+"-",({$$:s},o)=>i(s,o)],[e,(s,o)=>({...i(t,o),"@layer base":[Dl(e,o,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:S(20,16),marginBottom:S(20,16),paddingLeft:S(26,16)},li:{marginTop:S(8,16),marginBottom:S(8,16)},"ol>li,ul>li":{paddingLeft:S(6,16)},">ul>li p":{marginTop:S(12,16),marginBottom:S(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:S(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:S(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:S(12,16),marginBottom:S(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:S(48,16),marginBottom:S(48,16)},blockquote:{marginTop:S(32,20),marginBottom:S(32,20),paddingLeft:S(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:S(20,16),marginBottom:S(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:S(36,16),marginTop:"0",marginBottom:S(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:S(24,16),marginTop:S(48,24),marginBottom:S(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:S(20,16),marginTop:S(32,20),marginBottom:S(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:S(24,16),marginBottom:S(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:S(32,16),marginBottom:S(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:S(14,16),lineHeight:"1.4",marginTop:S(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:S(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:S(21,24)},"h3 code":{fontSize:S(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:S(14,16),lineHeight:"1.7",marginTop:S(24,14),marginBottom:S(24,14),borderRadius:"0.375rem",paddingTop:S(12,14),paddingRight:S(16,14),paddingBottom:S(12,14),paddingLeft:S(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:S(32,16),marginBottom:S(32,16),fontSize:S(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:S(8,14),paddingBottom:S(8,14),paddingLeft:S(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:S(8,14),paddingRight:S(8,14),paddingBottom:S(8,14),paddingLeft:S(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${o.e(o.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:S(20,16),lineHeight:"1.6",marginTop:S(24,20),marginBottom:S(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Dl(e,o,r)],"@layer components":{...Pl(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function i(s,o){let u={},l={},c=(p,h,v)=>{let b=o.theme(`colors.${s}.${h}`,h);v["--tw-prose-"+p]=ge(b);let $=v!=l&&o.d("colors",`${s}-${h}`,b);$&&(l["--tw-prose-"+p]=ge($))};for(let p in n){let h=n[p];p!="dark"&&h&&c(p,h,u)}for(let p in n.dark||{}){let h=n.dark[p];h&&(n.dark?c("invert-"+p,h,u):c(p,h,l))}return Object.keys(u).length?{"@layer defaults":{"&":u,[o.v("dark")]:l}}:void 0}}function Dl(e,t,r){let n={};for(let i in r)n[Ul(e,i,t,s=>`.${t.e(t.h(e))}${s}`)]=r[i];return n}function Ul(e,t,{e:r,h:n},i){return t.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",u=s,l="")=>i(`${o}:where(${u}):not(:where(.${r(n("not-"+e))} *))${l}`))}function Pl(e){return e?typeof e=="string"?{fontSize:e}:{fontSize:e[0],...typeof e[1]=="string"?{lineHeight:e[1]}:e[1]}:void 0}function S(e,t){return`${(e/t).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var eo=Xs({hash:!1,darkMode:"class",theme:{extend:{colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}},spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]}}},presets:[Tl(),xl(),kl(),Rl()]});function Vl(e,t=!0){let r=(function(){if(Np)try{let l=Qn(new CSSStyleSheet);return l.connect=c=>{let p=to(c);p.adoptedStyleSheets=[...p.adoptedStyleSheets,l.target]},l.disconnect=Yn,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Qn(s)],u=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(c=>c.snapshot());return()=>l.forEach(c=>c())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,c,p){o[0].insert(l,c,p);let h=this.target.cssRules[c];o.forEach((v,b)=>b&&v.target.insertRule(h.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");to(l).appendChild(c);let p=Qn(c),{cssRules:h}=this.target;for(let v=0;v<h.length;v++)p.target.insertRule(h[v].cssText,v);o.push(p),u.set(l,p)},disconnect(l){let c=o.indexOf(u.get(l));c>=0&&o.splice(c,1)}}})(),n=ml({...e,hash:e.hash??t},r),i=gl(n);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),i.observe(to(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=n}}}}var Np=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function to(e){return e.shadowRoot||e.attachShadow({mode:"open"})}var A=e=>Vl(eo)(e);var Nr=class extends A(_){constructor(){super(),this.color="#601feb",this.radius="16.8576px",this.size="320px",this.border="#d1d5db"}render(){return d`
124
+ </svg>`};var nh=fl,eo=class extends ui{resolveIcon(e){let r=nh[e];if(!r)throw console.warn("hi-outline: icon not found",e),new Error(`Icon ${e} not found`);return r}render(){super.render();let e=this.shadowRoot?.querySelector("svg");if(!e)throw new Error("svgEl not found "+this.name);e.setAttribute("fill","none"),e.querySelectorAll("[stroke]").forEach(r=>{r.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",eo);var Xr,de,_e,Yr,to,pi=class{constructor(e,r){d(this,Yr);d(this,Xr);d(this,de);d(this,_e);if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");g(this,Xr,e),a(this,Xr).addController(this),g(this,de,r)}connect(e){g(this,de,e),g(this,_e,m(this,Yr,to).call(this))}hostConnected(){setTimeout(()=>{g(this,_e,m(this,Yr,to).call(this))},0)}hostDisconnected(){a(this,_e)?.close(1e3,"lit_host_disconnected"),g(this,_e,void 0)}send(e){a(this,_e)?.send(e)}close(e,r){a(this,_e)?.close(e,r)}get isConnected(){return a(this,_e)?.readyState===WebSocket.OPEN}get isConnecting(){return a(this,_e)?.readyState===WebSocket.CONNECTING}};Xr=new WeakMap,de=new WeakMap,_e=new WeakMap,Yr=new WeakSet,to=function(){let e=new WebSocket(a(this,de).url());return a(this,de).onClose&&(e.onclose=a(this,de).onClose),a(this,de).onOpen&&(e.onopen=a(this,de).onOpen),a(this,de).onError&&(e.onerror=a(this,de).onError),a(this,de).onMessage&&(e.onmessage=a(this,de).onMessage),e};var ml=Array.isArray;var ro=t=>!!(t&&t.constructor&&t.call&&t.apply);var gl=t=>!(!t||!t.then||!ro(t.then));var wl=(t,e,r=!1)=>{if(!t)return[];let n=(s,o)=>e(s)-e(o),i=(s,o)=>e(o)-e(s);return t.slice().sort(r===!0?i:n)};function*no(t,e,r=i=>i,n=1){let i=ro(r)?r:()=>r,s=e?t:0,o=e??t;for(let u=s;u<=o&&(yield i(u),!(u+n>o));u+=n);}var yl=(t,e,r,n)=>Array.from(no(t,e,r,n));var vl=(t,e)=>t?t.reduce((r,n)=>{let[i,s]=r;return e(n)?[[...i,n],s]:[i,[...s,n]]},[[],[]]):[[],[]];var io=class extends Error{constructor(e=[]){super();let r=e.find(n=>n.name)?.name??"";this.name=`AggregateError(${r}...)`,this.message=`AggregateError with ${e.length} errors`,this.stack=e.find(n=>n.stack)?.stack??this.stack,this.errors=e}},oo=async(t,e,r)=>{let n=e.map((c,p)=>({index:p,item:c})),i=async c=>{let p=[];for(;;){let h=n.pop();if(!h)return c(p);let[y,x]=await hi(r)(h.item);p.push({error:y,result:x,index:h.index})}},s=yl(1,t).map(()=>new Promise(i)),o=await Promise.all(s),[u,l]=vl(wl(o.flat(),c=>c.index),c=>!!c.error);if(u.length>0)throw new io(u.map(c=>c.error));return l.map(c=>c.result)};var ao=async(t,e)=>{let r=t?.times??3,n=t?.delay,i=t?.backoff??null;for(let s of no(1,r)){let[o,u]=await hi(e)(l=>{throw{_exited:l}});if(!o)return u;if(o._exited)throw o._exited;if(s===r)throw o;n&&await so(n),i&&await so(i(s))}},so=t=>new Promise(e=>setTimeout(e,t)),hi=t=>(...e)=>{try{let r=t(...e);return gl(r)?r.then(n=>[void 0,n]).catch(n=>[n,void 0]):[void 0,r]}catch(r){return[r,void 0]}};var ih=!0,lo="Invariant failed";function Ne(t,e){if(!t){if(ih)throw new Error(lo);var r=typeof e=="function"?e():e,n=r?"".concat(lo,": ").concat(r):lo;throw new Error(n)}}var Z,ee,W,zt,qt,be,K,Ae,bl,xl,kl,Cl,di=class{constructor(e,r){d(this,K);d(this,Z);d(this,ee);d(this,W,null);w(this,"isStreaming",!1);w(this,"typingIndicator");w(this,"ranOutOfCredits",!1);w(this,"messages",[]);w(this,"conversationId","");d(this,zt,0);d(this,qt);w(this,"isLiveMode",!1);d(this,be,[]);g(this,Z,e),g(this,ee,r),a(this,ee).autoConnect!==!1&&g(this,W,this.initWS()),e.addController(this)}get hasQueuedMessages(){return a(this,be).length>0}async enqueueMessage(e,{expectStreaming:r=!1}={}){if(a(this,be).length>0){let n=a(this,be)[a(this,be).length-1];if(e.type==="USER_INPUT"&&n.message.type==="USER_INPUT"&&e.value===n.message.value)return!0}return a(this,W)||this.connect(),a(this,W)?.isConnected?m(this,K,Ae).call(this,e,{expectStreaming:r}):(a(this,be).push({message:e,options:{expectStreaming:r}}),a(this,Z).requestUpdate(),a(this,W)&&!a(this,W).isConnecting&&!a(this,W).isConnected&&this.retry(),await ao({times:5,delay:2e3},async()=>{if(a(this,W)?.isConnected){let n=[...a(this,be)];g(this,be,[]),a(this,Z).requestUpdate();let i=!1;for(let{message:s,options:o}of n){let u=m(this,K,Ae).call(this,s,o);s===e&&(i=u)}return i}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),g(this,be,[]),a(this,Z).requestUpdate(),!1)))}sendUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1}={}){return m(this,K,Ae).call(this,{type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n},{expectStreaming:s})}sendImageDelete(e){return Ne(e,"imageId is required"),m(this,K,Ae).call(this,{type:"USER_FILE_DELETE",imageId:e})}sendUserCancel(){return m(this,K,Ae).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return m(this,K,Ae).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return m(this,K,Ae).call(this,{type:"USER_TYPING_STOP"})}sendUserMeta(e){return m(this,K,Ae).call(this,{type:"USER_META",metadata:e})}reloadConfig(){m(this,K,Ae).call(this,{type:"RELOAD_CONFIG"})}close(){a(this,W)?.close(1e3,"closed by user")}retry(){clearTimeout(a(this,qt)),g(this,qt,setTimeout(()=>{a(this,ee).onReconnect?.(),g(this,W,this.initWS())},1e3*a(this,zt))),Ka(this,zt)._++}initWS(){return new pi(a(this,Z),{url:()=>a(this,ee).url(this.conversationId,{}),onOpen:e=>m(this,K,bl).call(this,e),onMessage:e=>m(this,K,xl).call(this,JSON.parse(e.data)),onError:e=>m(this,K,kl).call(this,e),onClose:e=>m(this,K,Cl).call(this,e)})}hostConnected(){this.conversationId=a(this,ee).restoreConversationState?.()?.conversationId||"",this.messages=a(this,ee).restoreConversationState?.()?.messages||[]}reset(){m(this,K,Ae).call(this,{type:"NEW_CHAT"}),a(this,ee).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,g(this,be,[]),a(this,Z).requestUpdate()}hostDisconnected(){clearTimeout(a(this,qt))}connect(){a(this,W)||g(this,W,this.initWS())}reconnectSocket(){a(this,W)?.close(1e3,"destroy"),g(this,W,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};Z=new WeakMap,ee=new WeakMap,W=new WeakMap,zt=new WeakMap,qt=new WeakMap,be=new WeakMap,K=new WeakSet,Ae=function(e,{expectStreaming:r=!1}={}){return this.ranOutOfCredits?!1:a(this,W)?a(this,W).isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):a(this,W).isConnected?(r&&!this.isLiveMode&&(this.isStreaming=!0,a(this,Z).requestUpdate()),a(this,W).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent",e),this.retry(),!1):(console.warn("WebSocket not initialized, message not sent",e),this.connect(),!1)},bl=function(e){g(this,zt,0)},xl=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,{...e.message,streaming:!0}].filter((r,n,i)=>n===i.findIndex(s=>s.id===r.id)),this.typingIndicator=void 0,a(this,Z).requestUpdate(),a(this,ee).onNewMessage?.(e.message);break}case"APPEND_MESSAGE":{let r=this.messages.find(n=>n.id===e.message.id);if(r){switch(e.message.content_type){case"text":{let{part:n,delta:i,position:s}=e.message;r.content=r.content.slice(0,s)+i,r.parts||=[],r.parts[n]={text:r.parts[n]&&"text"in r.parts[n]?(r.parts[n].text||"").slice(0,s)+i:i};break}case"html":{let{part:n,delta:i,position:s}=e.message;r.parts||=[],r.parts[n]={html:r.parts[n]&&"html"in r.parts[n]?(r.parts[n].html||"").slice(0,s)+i:i};break}case"data":{let{part:n}=e.message;r.parts||=[],r.parts[n]={tag:e.message.tag,data:r.parts[n]&&"data"in r.parts[n]?Object.assign(r.parts[n].data||{},e.message.data):e.message.data};break}}e.metadata&&(r.metadata=e.metadata),a(this,ee).onMessageAppend?.(e),a(this,Z).requestUpdate()}else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let r=this.messages.find(n=>n.id===e.message.id);if(r)Object.assign(r,e.message),r.streaming=!1;else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,a(this,Z).requestUpdate(),a(this,ee).onMessageDone?.(e,r),a(this,ee).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,a(this,Z).requestUpdate();break}case"ERROR":{a(this,ee).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,a(this,ee).onConnect?.(e.conversationId,e.metadata),a(this,ee).persistConversationState?.(e.conversationId,e.messages),this.isLiveMode=e.metadata?.isLiveMode,a(this,Z).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},a(this,Z).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,a(this,Z).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,a(this,Z).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),a(this,Z).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},kl=function(e){console.error("onError",e),a(this,ee).onError?.(e)},Cl=function(e){a(this,Z).isConnected&&a(this,W)&&!a(this,W).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,a(this,Z).requestUpdate(),a(this,ee).onClose?.()};var k0=Symbol(),sh=Symbol();var Sl=Object.getPrototypeOf,co=new WeakMap,oh=t=>t&&(co.has(t)?co.get(t):Sl(t)===Object.prototype||Sl(t)===Array.prototype);var El=t=>oh(t)&&t[sh]||null,uo=(t,e=!0)=>{co.set(t,e)};var ho=t=>typeof t=="object"&&t!==null,ah=t=>ho(t)&&!fo.has(t)&&(Array.isArray(t)||!(Symbol.iterator in t))&&!(t instanceof WeakMap)&&!(t instanceof WeakSet)&&!(t instanceof Error)&&!(t instanceof Number)&&!(t instanceof Date)&&!(t instanceof String)&&!(t instanceof RegExp)&&!(t instanceof ArrayBuffer)&&!(t instanceof Promise),Al=(t,e)=>{let r=$l.get(t);if(r?.[0]===e)return r[1];let n=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return uo(n,!0),$l.set(t,[e,n]),Reflect.ownKeys(t).forEach(i=>{if(Object.getOwnPropertyDescriptor(n,i))return;let s=Reflect.get(t,i),{enumerable:o}=Reflect.getOwnPropertyDescriptor(t,i),u={value:s,enumerable:o,configurable:!0};if(fo.has(s))uo(s,!1);else if(yt.has(s)){let[l,c]=yt.get(s);u.value=Al(l,c())}Object.defineProperty(n,i,u)}),Object.preventExtensions(n)},lh=(t,e,r,n)=>({deleteProperty(i,s){let o=Reflect.get(i,s);r(s);let u=Reflect.deleteProperty(i,s);return u&&n(["delete",[s],o]),u},set(i,s,o,u){let l=!t()&&Reflect.has(i,s),c=Reflect.get(i,s,u);if(l&&(_l(c,o)||fi.has(o)&&_l(c,fi.get(o))))return!0;r(s),ho(o)&&(o=El(o)||o);let p=!yt.has(o)&&uh(o)?mo(o):o;return e(s,p),Reflect.set(i,s,p,u),n(["set",[s],o,c]),!0}}),yt=new WeakMap,fo=new WeakSet,$l=new WeakMap,po=[1],fi=new WeakMap,_l=Object.is,ch=(t,e)=>new Proxy(t,e),uh=ah,ph=Al,hh=lh;function mo(t={}){if(!ho(t))throw new Error("object required");let e=fi.get(t);if(e)return e;let r=po[0],n=new Set,i=(C,I=++po[0])=>{r!==I&&(s=r=I,n.forEach(k=>k(C,I)))},s=r,o=(C=po[0])=>(s!==C&&(s=C,l.forEach(([I])=>{let k=I[1](C);k>r&&(r=k)})),r),u=C=>(I,k)=>{let _=[...I];_[1]=[C,..._[1]],i(_,k)},l=new Map,c=(C,I)=>{let k=!fo.has(I)&&yt.get(I);if(k){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(C))throw new Error("prop listener already exists");if(n.size){let _=k[2](u(C));l.set(C,[k,_])}else l.set(C,[k])}},p=C=>{var I;let k=l.get(C);k&&(l.delete(C),(I=k[1])==null||I.call(k))},h=C=>(n.add(C),n.size===1&&l.forEach(([k,_],O)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&_)throw new Error("remove already exists");let H=k[2](u(O));l.set(O,[k,H])}),()=>{n.delete(C),n.size===0&&l.forEach(([k,_],O)=>{_&&(_(),l.set(O,[k]))})}),y=!0,x=hh(()=>y,c,p,i),S=ch(t,x);fi.set(t,S);let M=[t,o,h];return yt.set(S,M),Reflect.ownKeys(t).forEach(C=>{let I=Object.getOwnPropertyDescriptor(t,C);"value"in I&&I.writable&&(S[C]=t[C])}),y=!1,S}function mi(t,e,r){let n=yt.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i,s=[],o=n[2],u=!1,c=o(p=>{if(s.push(p),r){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,u&&e(s.splice(0))}))});return u=!0,()=>{u=!1,c()}}function Wt(t){let e=yt.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,n]=e;return ph(r,n())}var Qr,Gt,vt,Zt,Kt=class{constructor(e,r){d(this,Qr);d(this,Gt);d(this,vt);d(this,Zt,()=>{});g(this,Qr,e),g(this,Gt,r),g(this,vt,Wt(r)),e.addController(this)}get state(){return a(this,vt)}get value(){return a(this,vt)}hostConnected(){a(this,Zt).call(this),g(this,Zt,mi(a(this,Gt),()=>{g(this,vt,Wt(a(this,Gt))),a(this,Qr).requestUpdate()}))}hostDisconnected(){a(this,Zt).call(this)}};Qr=new WeakMap,Gt=new WeakMap,vt=new WeakMap,Zt=new WeakMap;var en,tn,bt,Jt,Je=class{constructor(e,r,n){d(this,en);d(this,tn);w(this,"proxyObject");d(this,bt);d(this,Jt,()=>{});g(this,en,e),g(this,tn,n),this.proxyObject=mo(r),g(this,bt,Wt(this.proxyObject)),e.addController(this)}get state(){return a(this,bt)}get value(){return a(this,bt)}hostConnected(){a(this,Jt).call(this),a(this,tn)?.subscribe&&g(this,Jt,mi(this.proxyObject,()=>{g(this,bt,Wt(this.proxyObject)),a(this,en).requestUpdate()}))}hostDisconnected(){a(this,Jt).call(this)}};en=new WeakMap,tn=new WeakMap,bt=new WeakMap,Jt=new WeakMap;var Xt,rn,Yt,xt,kt,gi=class{constructor(e,{provider:r,tag:n,key:i}){d(this,Xt);d(this,rn);d(this,Yt);d(this,xt,null);d(this,kt,null);g(this,Xt,e),g(this,rn,n),g(this,Yt,i),e.addController(this)}get value(){return a(this,kt)?a(this,kt).value:null}hostConnected(){if(a(this,kt)||(g(this,xt,dh(a(this,Xt),a(this,rn))),!a(this,xt)))return;let e=a(this,xt)[a(this,Yt)]instanceof Je?a(this,xt)[a(this,Yt)]:null;e&&g(this,kt,new Kt(a(this,Xt),e.proxyObject))}hostDisconnected(){}};Xt=new WeakMap,rn=new WeakMap,Yt=new WeakMap,xt=new WeakMap,kt=new WeakMap;function dh(t,e){let r=t;for(;r;){let n=r.closest(e);if(n)return n;let i=r.getRootNode();if(i instanceof ShadowRoot)r=i.host;else break}return null}var Ml=()=>{if(window.Shopify)try{return{customerId:fh()}}catch{return null}return null},fh=()=>{try{let t=[()=>window.ShopifyAnalytics?.meta?.page?.customerId,()=>window.meta?.page?.customerId,()=>window._st?.cid,()=>window.ShopifyAnalytics?.lib?.user()?.traits()?.uniqToken];for(let e of t)try{let r=e();if(/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i.test(r))continue;if(r)return r}catch{}}catch{return null}return null},Il=async()=>{try{return(await(await fetch(window.Shopify.routes.root+"cart.js")).json()).items.map(n=>({id:n.id,name:n.title,quantity:n.quantity,price:n.price,variantId:n.variant_id,sku:n.sku,url:n.url,description:n.product_description,image:n.featured_image?.url}))}catch{return[]}};function Tl(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function go(t){return new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+!*'();@&=,$]*)*(\\?[-a-z\\d%_.~+!*'();@&=,$]*)?(\\#[-a-z\\d%_.~+!*'();@&=,$]*)?$","i").test(t)}function Ol(t,e){let r=t instanceof URL?t:new URL(t);if(e)for(let[n,i]of e)r.searchParams.set(n,i);return r}var Ll=()=>{if(window.ShopRenter)try{let t=gh();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},gh=()=>{try{if(window.ShopRenter){let t=window.ShopRenter.customer;return{customerEmail:t?.email,customerId:t?.userId,customerName:[t?.name?.firstName,t?.name?.lastName].filter(Boolean).join(" ")}}return{customerEmail:null,customerId:null,customerName:null}}catch{return{customerEmail:null,customerId:null,customerName:null}}},jl=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=Tl(t,"https")+"/cart.json";return(await(await fetch(e)).json()).items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku,image:s.image,url:s.href}))}catch{return[]}};var Dl=()=>{if(window.UNAS)try{let t=window.UNAS.customer;return{customerEmail:t?.email,customerId:t?.id}}catch(t){return console.error("Error fetching customer information:",t),null}return null},Pl=async()=>new Promise((t,e)=>{try{window.UNAS.getCart(r=>{let i=r.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));t(i)})}catch(r){console.error("Error fetching cart information:",r),e(r)}});var wo;function yo(t){return{lang:t?.lang??wo?.lang,message:t?.message,abortEarly:t?.abortEarly??wo?.abortEarly,abortPipeEarly:t?.abortPipeEarly??wo?.abortPipeEarly}}var vh;function bh(t){return vh?.get(t)}var xh;function kh(t){return xh?.get(t)}var Ch;function Sh(t,e){return Ch?.get(t)?.get(e)}function Rl(t){let e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function me(t,e,r,n,i){let s=i&&"input"in i?i.input:r.value,o=i?.expected??t.expects??null,u=i?.received??Rl(s),l={kind:t.kind,type:t.type,input:s,expected:o,received:u,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${u}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=t.kind==="schema",p=i?.message??t.message??Sh(t.reference,l.lang)??(c?kh(l.lang):null)??n.message??bh(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function ge(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},yo())}}}function Eh(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Bl(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var $h=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function vo(t,e){return{kind:"validation",type:"max_length",reference:vo,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length>this.requirement&&me(this,"length",r,n,{received:`${r.value.length}`}),r}}}function bo(t,e){return{kind:"validation",type:"min_length",reference:bo,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length<this.requirement&&me(this,"length",r,n,{received:`${r.value.length}`}),r}}}function _h(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function Vl(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function xo(){return{kind:"schema",type:"any",reference:xo,expects:"any",async:!1,get"~standard"(){return ge(this)},"~run"(t){return t.typed=!0,t}}}function Qt(t,e){return{kind:"schema",type:"array",reference:Qt,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return ge(this)},"~run"(r,n){let i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<i.length;s++){let o=i[s],u=this.item["~run"]({value:o},n);if(u.issues){let l={type:"array",origin:"value",input:i,key:s,value:o};for(let c of u.issues)c.path?c.path.unshift(l):c.path=[l],r.issues?.push(c);if(r.issues||(r.issues=u.issues),n.abortEarly){r.typed=!1;break}}u.typed||(r.typed=!1),r.value.push(u.value)}}else me(this,"type",r,n);return r}}}function ko(t){return{kind:"schema",type:"boolean",reference:ko,expects:"boolean",async:!1,message:t,get"~standard"(){return ge(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:me(this,"type",e,r),e}}}function Co(t){return{kind:"schema",type:"null",reference:Co,expects:"null",async:!1,message:t,get"~standard"(){return ge(this)},"~run"(e,r){return e.value===null?e.typed=!0:me(this,"type",e,r),e}}}function wi(t){return{kind:"schema",type:"number",reference:wi,expects:"number",async:!1,message:t,get"~standard"(){return ge(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:me(this,"type",e,r),e}}}function Fe(t,e){return{kind:"schema",type:"object",reference:Fe,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return ge(this)},"~run"(r,n){let i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(let s in this.entries){let o=this.entries[s];if(s in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){let u=s in i?i[s]:Vl(o),l=o["~run"]({value:u},n);if(l.issues){let c={type:"object",origin:"value",input:i,key:s,value:u};for(let p of l.issues)p.path?p.path.unshift(c):p.path=[c],r.issues?.push(p);if(r.issues||(r.issues=l.issues),n.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value[s]=l.value}else if(o.fallback!==void 0)r.value[s]=_h(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(me(this,"key",r,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else me(this,"type",r,n);return r}}}function er(t,e){return{kind:"schema",type:"optional",reference:er,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return ge(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=Vl(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function So(t,e){return{kind:"schema",type:"picklist",reference:So,expects:Bl(t.map(Rl),"|"),async:!1,options:t,message:e,get"~standard"(){return ge(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:me(this,"type",r,n),r}}}function yi(t,e,r){return{kind:"schema",type:"record",reference:yi,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return ge(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let o in s)if(Eh(s,o)){let u=s[o],l=this.key["~run"]({value:o},i);if(l.issues){let p={type:"object",origin:"key",input:s,key:o,value:u};for(let h of l.issues)h.path=[p],n.issues?.push(h);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}let c=this.value["~run"]({value:u},i);if(c.issues){let p={type:"object",origin:"value",input:s,key:o,value:u};for(let h of c.issues)h.path?h.path.unshift(p):h.path=[p],n.issues?.push(h);if(n.issues||(n.issues=c.issues),i.abortEarly){n.typed=!1;break}}(!l.typed||!c.typed)&&(n.typed=!1),l.typed&&(n.value[l.value]=c.value)}}else me(this,"type",n,i);return n}}}function X(t){return{kind:"schema",type:"string",reference:X,expects:"string",async:!1,message:t,get"~standard"(){return ge(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:me(this,"type",e,r),e}}}function Ul(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function tr(t,e){return{kind:"schema",type:"union",reference:tr,expects:Bl(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return ge(this)},"~run"(r,n){let i,s,o;for(let u of this.options){let l=u["~run"]({value:r.value},n);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{i=l;break}else o?o.push(l):o=[l]}if(i)return i;if(s){if(s.length===1)return s[0];me(this,"type",r,n,{issues:Ul(s)}),r.typed=!0}else{if(o?.length===1)return o[0];me(this,"type",r,n,{issues:Ul(o)})}return r}}}function Nl(t,e,r){let n=t["~run"]({value:e},yo(r));if(n.issues)throw new $h(n.issues);return n.value}function Fl(t,e){let r={};for(let n in t.entries)r[n]=!e||e.includes(n)?er(t.entries[n]):t.entries[n];return{...t,entries:r,get"~standard"(){return ge(this)}}}function Hl(...t){return{...t[0],pipe:t,get"~standard"(){return ge(this)},"~run"(e,r){for(let n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=n["~run"](e,r))}return e}}}function nn(t,e,r){let n=t["~run"]({value:e},yo(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var zl=yi(X(),tr([X(),wi(),ko(),Co()])),ql=Hl(X(),bo(1),vo(5e3)),Wl=()=>{try{return window.UNAS?Dl():window.Shopify?Ml():window.ShopRenter?Ll():null}catch{return null}},Gl=async()=>{try{return window.UNAS?await Pl():window.Shopify?await Il():window.ShopRenter?await jl():[]}catch{return[]}},rr={schema:Fe({conversationId:er(X()),messages:er(Qt(Fe({id:X(),timestamp:wi(),role:So(["user","assistant","support"]),content:X(),parts:er(Qt(tr([Fe({text:X()}),Fe({html:X()}),Fe({tag:X(),data:yi(X(),xo())})])))})))}),getStorageKey(t){if(!t)throw new Error("widgetId is not set");return`_molin_${t}`},persist(t,e,r){let n=this.getStorageKey(t);localStorage.setItem(n,JSON.stringify({conversationId:e,messages:r}))},restore(t){try{let e=this.getStorageKey(t),r=JSON.parse(localStorage.getItem(e)||"{}"),n=Nl(this.schema,r);return{conversationId:n.conversationId||"",messages:n.messages||[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(t){let e=this.getStorageKey(t);localStorage.removeItem(e)}};var j,Zl,sn,on,nr,R,Kl,bi=class bi extends E{constructor(){super();d(this,j);w(this,"contextCtrl");d(this,sn);d(this,on);d(this,nr,null);this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.autoConnect=!0,this.contextCtrl=new Je(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,ranOutOfCredits:!1,isLiveMode:!1,lastMsg:void 0,hasQueuedMessages:!1,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this),sendImageDelete:a(this,j,R).sendImageDelete.bind(a(this,j,R))})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.autoConnect&&a(this,j,R).connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:a(this,sn),xCustomInstructions:a(this,on),conversationId:a(this,j,R).conversationId,messages:a(this,j,Zl),isStreaming:a(this,j,R).isStreaming,typingIndicator:a(this,j,R).typingIndicator,ranOutOfCredits:a(this,j,R).ranOutOfCredits,isLiveMode:a(this,j,R).isLiveMode,lastMsg:a(this,j,R).lastMsg,hasQueuedMessages:a(this,j,R).hasQueuedMessages,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this),sendImageDelete:a(this,j,R).sendImageDelete.bind(a(this,j,R))}),m(this,j,Kl).call(this)}sendUserInput(r,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...n},s=a(this,j,R).sendUserInput(r,i);return s&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:a(this,j,R).conversationId}),s}async enqueueUserInput(r,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...n};return a(this,j,R).enqueueUserInput(r,i)}sendUserCancel(){a(this,j,R).sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){a(this,j,R).sendUserTypingStart()}sendUserTypingStop(){a(this,j,R).sendUserTypingStop()}reset(){a(this,j,R).reset()}reloadConfig(){a(this,j,R).reloadConfig()}connect(){a(this,j,R).connect()}render(){return f`<slot></slot>`}};j=new WeakSet,Zl=function(){return a(this,j,R)?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:a(this,j,R)?.messages||[]},sn=new WeakMap,on=new WeakMap,nr=new WeakMap,R=function(){return a(this,nr)||g(this,nr,new di(this,{autoConnect:this.autoConnect,url:r=>{let n=new URL(this.config.wsApiUrl);return n.searchParams.set("widgetId",this.widgetId),n.searchParams.set("conversationId",r),n.searchParams.set("pageUrl",window.location.href),n},onReconnect:()=>{},onError:r=>{console.error("ws error",r)},onClose:()=>{},onNewMessage:r=>{r.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:r,conversationId:a(this,j,R).conversationId})},onMessageAppend:r=>{},onMessageDone:(r,n)=>{n.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:n.content??"",message:n,usage_TOKENS_COMPLETION:r.message.usage.TOKENS_COMPLETION,conversationId:a(this,j,R).conversationId})},onMessageError:r=>{console.error("ws message error",r),r.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+r.message})},onReset:()=>{rr.reset(this.widgetId)},onConnect:(r,n)=>{let i=Wl();a(this,j,R).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),Gl().then(s=>{s?.length>0&&a(this,j,R).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,cart:s,language:window.navigator.language})}).catch(s=>{console.error(s)}),this.dispatchEvent(new bi.ConnectedEvent({conversationId:r,metadata:n,widgetId:this.widgetId,pendingImages:n?.pendingImages||[]}))},persistConversationState:(r,n)=>{rr.persist(this.widgetId,r,n)},restoreConversationState:()=>rr.restore(this.widgetId)})),a(this,nr)},Kl=function(){function r(i){if(!i)return;let s;try{s=typeof i=="object"?i:JSON.parse(i)}catch(u){console.error("Molin: user-data is not valid JSON",u);return}if(!s||typeof s!="object"||Object.keys(s).length===0)return;let o=nn(zl,s);if(!o.success){console.error("Molin: user-data does not pass schema validation",o.issues);return}return o.output}function n(i){if(!i)return;let s=nn(ql,i);if(!s.success){console.error("Molin: custom-instructions does not pass schema validation",s.issues);return}return s.output}g(this,sn,r(this.xUserData)),g(this,on,n(this.xCustomInstructions))},w(bi,"properties",{widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object},autoConnect:{type:Boolean}});var ir=bi;function Jl(t){let e=new gi(t,{provider:ir,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,n){if(n==="value")return e.value}})}var Eo;ir.ConnectedEvent=(Eo=class extends CustomEvent{constructor(e,r={}){super(ir.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}},w(Eo,"type","mw-context-widget:connected"),Eo);customElements.get("mw-context-widget")||customElements.define("mw-context-widget",ir);function Do(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function Ah(t,e=","){return t.map(Do).join(e)}var nc=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function xi(t){for(var e=9,r=t.length;r--;)e=Math.imul(e^t.charCodeAt(r),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function Si(t,e="@media "){return e+B(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(n=>`(${n}-width:${r[n]})`).join(" and "))).join(",")}function B(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function Xl(t){return t}function Ei(){}var te={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function ic(t){return t.match(/[-=:;]/g)?.length||0}function Io(t){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(t)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(ic(t),15)<<18}var Mh=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function Po({n:t,i:e,v:r=[]},n,i,s){t&&(t=Do({n:t,i:e,v:r})),s=[...B(s)];for(let u of r){let l=n.theme("screens",u);for(let c of B(l&&Si(l)||n.v(u))){var o;s.push(c),i|=l?67108864|Io(c):u=="dark"?1073741824:c[0]=="@"?Io(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~Mh.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:i,r:s,i:e}}var sc=new Map;function To(t){if(t.d){let e=[],r=$o(t.r.reduce((n,i)=>i[0]=="@"?(e.push(i),n):i?$o(n,s=>$o(i,o=>{let u=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(u){let l=s.indexOf(u[1]);return~l?s.slice(0,l)+u[0]+s.slice(l+u[1].length):_o(s,o)}return _o(o,s)})):n,"&"),n=>_o(n,t.n?"."+nc(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((n,i)=>i+"{"+n+"}",t.d)}}function $o(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,n,i)=>e(n)+i)}function _o(t,e){return t.replace(/&/g,e)}var Yl=new Intl.Collator("en",{numeric:!0});function oc(t,e){for(var r=0,n=t.length;r<n;){let i=n+r>>1;0>=ac(t[i],e)?r=i+1:n=i}return n}function ac(t,e){let r=t.p&te.o;return r==(e.p&te.o)&&(r==te.b||r==te.o)?0:t.p-e.p||t.o-e.o||Yl.compare(Ql(t.n),Ql(e.n))||Yl.compare(ec(t.n),ec(e.n))}function Ql(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function ec(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Ao(t,e){return Math.round(parseInt(t,16)*e)}function xe(t,e={}){if(typeof t=="function")return t(e);let{opacityValue:r="1",opacityVariable:n}=e,i=n?`var(${n})`:r;if(t.includes("<alpha-value>"))return t.replace("<alpha-value>",i);if(t[0]=="#"&&(t.length==4||t.length==7)){let s=(t.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Ao(t.substr(1,s),o),Ao(t.substr(1+s,s),o),Ao(t.substr(1+2*s,s),o),i]})`}return i=="1"?t:i=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function lc(t,e,r,n,i=[]){return(function s(o,{n:u,p:l,r:c=[],i:p},h){let y=[],x="",S=0,M=0;for(let k in o||{}){var C,I;let _=o[k];if(k[0]=="@"){if(!_)continue;if(k[1]=="a"){y.push(...Ro(u,l,Ci(""+_),h,l,c,p,!0));continue}if(k[1]=="l"){for(let O of B(_))y.push(...s(O,{n:u,p:(C=te[k[7]],l&~te.o|C),r:k[7]=="d"?[]:c,i:p},h));continue}if(k[1]=="i"){y.push(...B(_).map(O=>({p:-1,o:0,r:[],d:k+" "+O})));continue}if(k[1]=="k"){y.push({p:te.d,o:0,r:[k],d:s(_,{p:te.d},h).map(To).join("")});continue}if(k[1]=="f"){y.push(...B(_).map(O=>({p:te.d,o:0,r:[k],d:s(O,{p:te.d},h).map(To).join("")})));continue}}if(typeof _!="object"||Array.isArray(_))k=="label"&&_?u=_+xi(JSON.stringify([l,p,o])):(_||_===0)&&(k=k.replace(/[A-Z]/g,O=>"-"+O.toLowerCase()),M+=1,S=Math.max(S,(I=k)[0]=="-"?0:ic(I)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(I)?+!!RegExp.$1||-!!RegExp.$2:0)+1),x+=(x?";":"")+B(_).map(O=>h.s(k,Uo(""+O,h.theme)+(p?" !important":""))).join(";"));else if(k[0]=="@"||k.includes("&")){let O=l;k[0]=="@"&&(k=k.replace(/\bscreen\(([^)]+)\)/g,(H,Q)=>{let ne=h.theme("screens",Q);return ne?(O|=67108864,Si(ne,"")):H}),O|=Io(k)),y.push(...s(_,{n:u,p:O,r:[...c,k],i:p},h))}else y.push(...s(_,{p:l,r:[...c,k]},h))}return y.unshift({n:u,p:l,o:Math.max(0,15-M)+1.5*Math.min(S||15,15),r:c,d:x}),y.sort(ac)})(t,Po(e,r,n,i),r)}function Uo(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,n,i,s,o="")=>{let u=e(i,o);return typeof u=="function"&&/color|fill|stroke/i.test(i)?xe(u):""+B(u).filter(l=>Object(l)!==l)})}function cc(t,e){let r,n=[];for(let i of t)i.d&&i.n?r?.p==i.p&&""+r.r==""+i.r?(r.c=[r.c,i.c].filter(Boolean).join(" "),r.d=r.d+";"+i.d):n.push(r={...i,n:i.n&&e}):n.push({...i,n:i.n&&e});return n}function ki(t,e,r=te.u,n,i){let s=[];for(let o of t)for(let u of(function(l,c,p,h,y){l={...l,i:l.i||y};let x=(function(S,M){let C=sc.get(S.n);return C?C(S,M):M.r(S.n,S.v[0]=="dark")})(l,c);return x?typeof x=="string"?({r:h,p}=Po(l,c,p,h),cc(ki(Ci(x),c,p,h,l.i),l.n)):Array.isArray(x)?x.map(S=>{var M,C;return{o:0,...S,r:[...B(h),...B(S.r)],p:(M=p,C=S.p??p,M&~te.o|C)}}):lc(x,l,c,p,h):[{c:Do(l),p:0,o:0,r:[]}]})(o,e,r,n,i))s.splice(oc(s,u),0,u);return s}function Ro(t,e,r,n,i,s,o,u){return cc((u?r.flatMap(l=>ki([l],n,i,s,o)):ki(r,n,i,s,o)).map(l=>l.p&te.o&&(l.n||e==te.b)?{...l,p:l.p&~te.o|e,o:0}:l),t)}function Ih(t,e,r,n){var i;return i=(s,o)=>{let{n:u,p:l,r:c,i:p}=Po(s,o,e);return r&&Ro(u,e,r,o,l,c,p,n)},sc.set(t,i),t}function Mo(t,e,r){if(t[t.length-1]!="("){let n=[],i=!1,s=!1,o="";for(let u of t)if(!(u=="("||/[~@]$/.test(u))){if(u[0]=="!"&&(u=u.slice(1),i=!i),u.endsWith(":")){n[u=="dark:"?"unshift":"push"](u.slice(0,-1));continue}u[0]=="-"&&(u=u.slice(1),s=!s),u.endsWith("-")&&(u=u.slice(0,-1)),u&&u!="&"&&(o+=(o&&"-")+u)}o&&(s&&(o="-"+o),e[0].push({n:o,v:n.filter(Th),i}))}}function Th(t,e,r){return r.indexOf(t)==e}var tc=new Map;function Ci(t){let e=tc.get(t);if(!e){let r=[],n=[[]],i=0,s=0,o=null,u=0,l=(c,p=0)=>{i!=u&&(r.push(t.slice(i,u+p)),c&&Mo(r,n)),i=u+1};for(;u<t.length;u++){let c=t[u];if(s)t[u-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)t[u-1]!="\\"&&o.test(t.slice(u))&&(o=null,i=u+RegExp.lastMatch.length);else if(c=="/"&&t[u-1]!="\\"&&(t[u+1]=="*"||t[u+1]=="/"))o=t[u+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),r.push(c);else if(c==":")t[u+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let p=r.lastIndexOf("(");if(c==")"){let h=r[p-1];if(/[~@]$/.test(h)){let y=n.shift();r.length=p,Mo([...r,"#"],n);let{v:x}=n[0].pop();for(let S of y)S.v.splice(+(S.v[0]=="dark")-+(x[0]=="dark"),x.length);Mo([...r,Ih(h.length>1?h.slice(0,-1)+xi(JSON.stringify([h,y])):h+"("+Ah(y)+")",te.a,y,/@$/.test(h))],n)}p=r.lastIndexOf("(",p-1)}r.length=p+1}else/[~@]/.test(c)&&t[u+1]=="("&&n.unshift([])}l(!0),tc.set(t,e=n[0])}return e}function v(t,e,r){return[t,Oo(e,r)]}function Oo(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,n)=>({[t]:e?e(r,n):Lo(r,1)}):r=>t||{[r[1]]:Lo(r,2)}}function Lo(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function b(t,e,r,n){return[t,Bo(e,r,n)]}function Bo(t,e,r){let n=typeof e=="string"?(i,s)=>({[e]:r?r(i,s):i._}):e||(({1:i,_:s},o,u)=>({[i||u]:s}));return(i,s)=>{let o=uc(t||i[1]),u=s.theme(o,i.$$)??Le(i.$$,o,s);if(u!=null)return i._=Lo(i,0,u),n(i,s,o)}}function re(t,e={},r){return[t,Oh(e,r)]}function Oh(t={},e){return(r,n)=>{let{section:i=uc(r[0]).replace("-","")+"Color"}=t,[s,o]=Lh(r.$$);if(!s)return;let u=n.theme(i,s)||Le(s,i,n);if(!u||typeof u=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:c=i.replace("Color","Opacity"),property:p=i,selector:h}=t,y=n.theme(c,o||"DEFAULT")||o&&Le(o,c,n),x=e||(({_:M})=>{let C=an(p,M);return h?{[h]:C}:C});r._={value:xe(u,{opacityVariable:l||void 0,opacityValue:y||void 0}),color:M=>xe(u,M),opacityVariable:l||void 0,opacityValue:y||void 0};let S=x(r,n);if(!r.dark){let M=n.d(i,s,u);M&&M!==u&&(r._={value:xe(M,{opacityVariable:l||void 0,opacityValue:y||"1"}),color:C=>xe(M,C),opacityVariable:l||void 0,opacityValue:y||void 0},S={"&":S,[n.v("dark")]:x(r,n)})}return S}}function Lh(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function an(t,e){let r={};return typeof e=="string"?r[t]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(r[e.opacityVariable]=e.opacityValue||"1"),r[t]=e.value),r}function Le(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=sr(Uo(t.slice(1,-1),r.theme)),!e)return t;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(t)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(t))||/image/i.test(e)&&!(/^image:/.test(t)||/^[a-z-]+\(/.test(t))||/weight/i.test(e)&&!(/^(number|any):/.test(t)||/^\d+$/.test(t))||/position/i.test(e)&&/^(length|size):/.test(t)))return t.replace(/^[a-z-]+:/,"")}}function uc(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function sr(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",n,i="")=>sr(r)+n+sr(i)):t.replace(/(^|[^\\])_+/g,(e,r)=>r+" ".repeat(e.length-r.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function Vo({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:B(e.variants),rules:B(e.rules),ignorelist:B(e.ignorelist),hash:void 0,stringify:(n,i)=>n+":"+i,finalize:[]};for(let n of B([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&B(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:i,darkMode:s=r.darkMode,darkColor:o=r.darkColor,theme:u,variants:l,rules:c,ignorelist:p,hash:h=r.hash,stringify:y=r.stringify,finalize:x}=typeof n=="function"?n(r):n;r={preflight:r.preflight!==!1&&i!==!1&&[...r.preflight,...B(i)],darkMode:s,darkColor:o,theme:{...r.theme,...u,extend:{...r.theme.extend,...u?.extend}},variants:[...r.variants,...B(l)],rules:[...r.rules,...B(c)],ignorelist:[...r.ignorelist,...B(p)],hash:h,stringify:y,finalize:[...r.finalize,...B(x)]}}return r}function rc(t,e,r,n,i,s){for(let o of e){let u=r.get(o);u||r.set(o,u=n(o));let l=u(t,i,s);if(l)return l}}function jh(t){var e;return jo(t[0],typeof(e=t[1])=="function"?e:()=>e)}function Dh(t){var e,r;return Array.isArray(t)?jo(t[0],Oo(t[1],t[2])):jo(t,Oo(e,r))}function jo(t,e){return pc(t,(r,n,i,s)=>{let o=n.exec(r);if(o)return o.$$=r.slice(o[0].length),o.dark=s,e(o,i)})}function pc(t,e){let r=B(t).map(Ph);return(n,i,s)=>{for(let o of r){let u=e(n,o,i,s);if(u)return u}}}function Ph(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function hc(t,e){let r=Vo(t),n=(function({theme:l,darkMode:c,darkColor:p=Ei,variants:h,rules:y,hash:x,stringify:S,ignorelist:M,finalize:C}){let I=new Map,k=new Map,_=new Map,O=new Map,H=pc(M,(U,ie)=>ie.test(U));h.push(["dark",Array.isArray(c)||c=="class"?`${B(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let Q=typeof x=="function"?U=>x(U,xi):x?xi:Xl;Q!==Xl&&C.push(U=>({...U,n:U.n&&Q(U.n),d:U.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(ie,he)=>"--"+Q(he).replace("#",""))}));let ne={theme:(function({extend:U={},...ie}){let he={},Ns={get colors(){return ut("colors")},theme:ut,negative(){return{}},breakpoints(G){let se={};for(let fe in G)typeof G[fe]=="string"&&(se["screen-"+fe]=G[fe]);return se}};return ut;function ut(G,se,fe,Vr){if(G){if({1:G,2:Vr}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(G)||[,G],/[.[]/.test(G)){let Re=[];G.replace(/\[([^\]]+)\]|([^.[]+)/g,(ht,Fr,Up=Fr)=>Re.push(Up)),G=Re.shift(),fe=se,se=Re.join("-")}let Oe=he[G]||Object.assign(Object.assign(he[G]={},ei(ie,G)),ei(U,G));if(se==null)return Oe;se||(se="DEFAULT");let pt=Oe[se]??se.split("-").reduce((Re,ht)=>Re?.[ht],Oe)??fe;return Vr?xe(pt,{opacityValue:Uo(Vr,ut)}):pt}let Nr={};for(let Oe of[...Object.keys(ie),...Object.keys(U)])Nr[Oe]=ut(Oe);return Nr}function ei(G,se){let fe=G[se];return typeof fe=="function"&&(fe=fe(Ns)),fe&&/color|fill|stroke/i.test(se)?(function Vr(Nr,Oe=[]){let pt={};for(let Re in Nr){let ht=Nr[Re],Fr=[...Oe,Re];pt[Fr.join("-")]=ht,Re=="DEFAULT"&&(Fr=Oe,pt[Oe.join("-")]=ht),typeof ht=="object"&&Object.assign(pt,Vr(ht,Fr))}return pt})(fe):fe}})(l),e:nc,h:Q,s(U,ie){return S(U,ie,ne)},d(U,ie,he){return p(U,ie,ne,he)},v(U){return I.has(U)||I.set(U,rc(U,h,k,jh,ne)||"&:"+U),I.get(U)},r(U,ie){let he=JSON.stringify([U,ie]);return _.has(he)||_.set(he,!H(U,ne)&&rc(U,y,O,Dh,ne,ie)),_.get(he)},f(U){return C.reduce((ie,he)=>he(ie,ne),U)}};return ne})(r),i=new Map,s=[],o=new Set;e.resume(l=>i.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),o.add(l)});function u(l){let c=n.f(l),p=To(c);if(p&&!o.has(p)){o.add(p);let h=oc(s,l);e.insert(p,h,l),s.splice(h,0,l)}return c.n}return Object.defineProperties(function(c){if(!i.size)for(let h of B(r.preflight))typeof h=="function"&&(h=h(n)),h&&(typeof h=="string"?Ro("",te.b,Ci(h),n,te.b,[],!1,!0):lc(h,{},n,te.b)).forEach(u);c=""+c;let p=i.get(c);if(!p){let h=new Set;for(let y of ki(Ci(c),n))h.add(y.c).add(u(y));p=[...h].filter(Boolean).join(" "),i.set(c,p).set(p,p)}return p},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:n.theme,config:r,snapshot(){let l=e.snapshot(),c=new Set(o),p=new Map(i),h=[...s];return()=>{l(),o=c,i=p,s=h}},clear(){e.clear(),o=new Set,i=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Uh(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function dc(t){let e=new MutationObserver(r);return{observe(i){e.observe(i,{attributeFilter:["class"],subtree:!0,childList:!0}),n(i),r([{target:i,type:""}])},disconnect(){e.disconnect()}};function r(i){for(let{type:s,target:o}of i)if(s[0]=="a")n(o);else for(let u of o.querySelectorAll("[class]"))n(u);e.takeRecords()}function n(i){let s,o=i.getAttribute?.("class");o&&Uh(o,s=t(o))&&i.setAttribute("class",s)}}function Rh(t){let e=document.querySelector(t||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function $i(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:Rh(t)).sheet;return{target:e,snapshot(){let r=Array.from(e.cssRules,n=>n.cssText);return()=>{this.clear(),r.forEach(this.insert)}},clear(){for(let r=e.cssRules.length;r--;)e.deleteRule(r)},destroy(){e.ownerNode?.remove()},insert(r,n){try{e.insertRule(r,n)}catch{e.insertRule(":root{}",n)}},resume:Ei}}var Bh=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function fc(t){return Bh.get(t)}function mc(t){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(t);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function gc(t,e){var r=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(t);return r?r[1]?/^sti/i.test(e)?1:0:r[2]?/^pat/i.test(e)?1:0:r[3]?/^image-/i.test(e)?1:0:r[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var Vh=[["-webkit-",1],["-moz-",2],["-ms-",4]];function wc(){return({stringify:t})=>({stringify(e,r,n){let i="",s=fc(e);s&&(i+=t(s,r,n)+";");let o=mc(e),u=gc(e,r);for(let l of Vh)o&l[1]&&(i+=t(l[0]+e,r,n)+";"),u&l[1]&&(i+=t(e,l[0]+r,n)+";");return i+t(e,r,n)}})}function vc(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",Bo("lineClamp",({_:t})=>yc(t))],["line-clamp-(\\d+)",({1:t})=>yc(t)]]}}function yc(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var cn={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...we(4,"rem",4,.5,.5),...we(12,"rem",4,5),14:"3.5rem",...we(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:D("blur"),backdropBrightness:D("brightness"),backdropContrast:D("contrast"),backdropGrayscale:D("grayscale"),backdropHueRotate:D("hueRotate"),backdropInvert:D("invert"),backdropOpacity:D("opacity"),backdropSaturate:D("saturate"),backdropSepia:D("sepia"),backgroundColor:D("colors"),backgroundImage:{none:"none"},backgroundOpacity:D("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...we(200,"",100,0,50),...we(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:D("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:D("spacing"),borderWidth:{DEFAULT:"1px",...ke(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:D("colors"),caretColor:D("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...we(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:D("borderColor"),divideOpacity:D("borderOpacity"),divideWidth:D("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:t})=>({...t("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:t})=>({...t("spacing"),...ln(2,6),...ln(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:D("spacing"),gradientColorStops:D("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:t})=>({...t("spacing"),...ln(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...ln(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...we(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:t})=>({auto:"auto",...t("spacing")}),maxHeight:({theme:t})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...t("spacing")}),maxWidth:({theme:t,breakpoints:e})=>({...e(t("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...we(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:D("spacing"),placeholderColor:D("colors"),placeholderOpacity:D("opacity"),outlineColor:D("colors"),outlineOffset:ke(8,"px"),outlineWidth:ke(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:D("colors"),ringOffsetWidth:ke(8,"px"),ringOpacity:({theme:t})=>({...t("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...ke(8,"px")},rotate:{...ke(2,"deg"),...ke(12,"deg",3),...ke(180,"deg",45)},saturate:we(200,"",100,0,50),scale:{...we(150,"",100,0,50),...we(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:D("spacing"),scrollPadding:D("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...ke(2,"deg"),...ke(12,"deg",3)},space:D("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:we(2),textColor:D("colors"),textDecorationColor:D("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...ke(8,"px")},textUnderlineOffset:{auto:"auto",...ke(8,"px")},textIndent:D("spacing"),textOpacity:D("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:D("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:t})=>({...t("spacing"),...ln(2,4),full:"100%"}),width:({theme:t})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...t("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...we(50,"",1,0,10),auto:"auto"}};function ln(t,e){let r={};do for(var n=1;n<t;n++)r[`${n}/${t}`]=Number((n/t*100).toFixed(6))+"%";while(++t<=e);return r}function ke(t,e,r=0){let n={};for(;r<=t;r=2*r||1)n[r]=r+e;return n}function we(t,e="",r=1,n=0,i=1,s={}){for(;n<=t;n+=i)s[n]=n/r+e;return s}function D(t){return({theme:e})=>e(t)}var bc={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${cn.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${cn.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var $c=[v("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:Le(`[${e}]`,"",r)}}})),v("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),b("aspect-","aspectRatio"),v("container",(t,{theme:e})=>{let{screens:r=e("screens"),center:n,padding:i}=e("container"),s={width:"100%",marginRight:n&&"auto",marginLeft:n&&"auto",...o("xs")};for(let u in r){let l=r[u];typeof l=="string"&&(s[Si(l)]={"&":{maxWidth:l,...o(u)}})}return s;function o(u){let l=i&&(typeof i=="string"?i:i[u]||i.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),b("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),v("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),v("box-(border|content)","boxSizing",({1:t})=>t+"-box"),v("hidden",{display:"none"}),v("table-(auto|fixed)","tableLayout"),v(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",v("isolate","isolation"),v("object-(contain|cover|fill|none|scale-down)","objectFit"),b("object-","objectPosition"),v("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",_i),v("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),v("(static|fixed|absolute|relative|sticky)","position"),b("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),b("-?(top|bottom|left|right)(?:$|-)","inset"),v("(visible|collapse)","visibility"),v("invisible",{visibility:"hidden"}),b("-?z-","zIndex"),v("flex-((row|col)(-reverse)?)","flexDirection",xc),v("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),b("(flex-(?:grow|shrink))(?:$|-)"),b("(flex)-"),b("grow(?:$|-)","flexGrow"),b("shrink(?:$|-)","flexShrink"),b("basis-","flexBasis"),b("-?(order)-"),"-?(order)-(\\d+)",b("grid-cols-","gridTemplateColumns"),v("grid-cols-(\\d+)","gridTemplateColumns",Ec),b("col-","gridColumn"),v("col-(span)-(\\d+)","gridColumn",Sc),b("col-start-","gridColumnStart"),v("col-start-(auto|\\d+)","gridColumnStart"),b("col-end-","gridColumnEnd"),v("col-end-(auto|\\d+)","gridColumnEnd"),b("grid-rows-","gridTemplateRows"),v("grid-rows-(\\d+)","gridTemplateRows",Ec),b("row-","gridRow"),v("row-(span)-(\\d+)","gridRow",Sc),b("row-start-","gridRowStart"),v("row-start-(auto|\\d+)","gridRowStart"),b("row-end-","gridRowEnd"),v("row-end-(auto|\\d+)","gridRowEnd"),v("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>_i(xc(t))),v("grid-flow-(dense)","gridAutoFlow"),b("auto-cols-","gridAutoColumns"),b("auto-rows-","gridAutoRows"),b("gap-x(?:$|-)","gap","columnGap"),b("gap-y(?:$|-)","gap","rowGap"),b("gap(?:$|-)","gap"),"(justify-(?:items|self))-",v("justify-","justifyContent",kc),v("(content|items|self)-",t=>({["align-"+t[1]]:kc(t)})),v("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),b("p([xytrbl])?(?:$|-)","padding",or("padding")),b("-?m([xytrbl])?(?:$|-)","margin",or("margin")),b("-?space-(x|y)(?:$|-)","space",({1:t,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[t]]:`calc(${e} * calc(1 - var(--tw-space-${t}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[t]]:`calc(${e} * var(--tw-space-${t}-reverse))`}})),v("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),b("w-","width"),b("min-w-","minWidth"),b("max-w-","maxWidth"),b("h-","height"),b("min-h-","minHeight"),b("max-h-","maxHeight"),b("font-","fontWeight"),b("font-","fontFamily",({_:t})=>typeof(t=B(t))[1]=="string"?{fontFamily:Me(t)}:{fontFamily:Me(t[0]),...t[1]}),v("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),v("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),v("italic","fontStyle"),v("not-italic",{fontStyle:"normal"}),v("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:t,2:e="",3:r})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(r?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":t)]:t,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...Xe({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),b("tracking-","letterSpacing"),b("leading-","lineHeight"),v("list-(inside|outside)","listStylePosition"),b("list-","listStyleType"),v("list-","listStyleType"),b("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),re("placeholder-",{property:"color",selector:"&::placeholder"}),v("text-(left|center|right|justify|start|end)","textAlign"),v("text-(ellipsis|clip)","textOverflow"),b("text-opacity-","textOpacity","--tw-text-opacity"),re("text-",{property:"color"}),b("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),b("indent-","textIndent"),v("(overline|underline|line-through)","textDecorationLine"),v("no-underline",{textDecorationLine:"none"}),b("underline-offset-","textUnderlineOffset"),re("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),b("decoration-","textDecorationThickness"),v("decoration-","textDecorationStyle"),v("(uppercase|lowercase|capitalize)","textTransform"),v("normal-case",{textTransform:"none"}),v("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),v("align-","verticalAlign"),v("whitespace-","whiteSpace"),v("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),v("break-words",{overflowWrap:"break-word"}),v("break-all",{wordBreak:"break-all"}),v("break-keep",{wordBreak:"keep-all"}),re("caret-",{opacityVariable:!1,opacitySection:"opacity"}),re("accent-",{opacityVariable:!1,opacitySection:"opacity"}),v("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${Ct(t," ")},var(--tw-gradient-stops))`),re("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-from":t.value,"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),re("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${t.value},var(--tw-gradient-to)`})),re("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),v("bg-(fixed|local|scroll)","backgroundAttachment"),v("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),v(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),v("bg-blend-","backgroundBlendMode"),v("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),b("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),re("bg-",{section:"backgroundColor"}),b("bg-","backgroundImage"),b("bg-","backgroundPosition"),v("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",_i),b("bg-","backgroundSize"),b("rounded(?:$|-)","borderRadius"),b("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:t,_:e})=>{let r={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[t]||[t,t];return{[`border-${Ct(r[0])}-radius`]:e,[`border-${Ct(r[1])}-radius`]:e}}),v("border-(collapse|separate)","borderCollapse"),b("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),v("border-(solid|dashed|dotted|double|none)","borderStyle"),b("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...Xe({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(t||"-x")]:e,["--tw-border-spacing"+(t||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),re("border-([xytrbl])-",{section:"borderColor"},or("border","Color")),re("border-"),b("border-([xytrbl])(?:$|-)","borderWidth",or("border","Width")),b("border(?:$|-)","borderWidth"),b("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),v("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),v("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),b("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${Ct(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${Ct(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),re("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),b("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),re("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),b("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),v("ring-inset",{"--tw-ring-inset":"inset"}),re("ring-",{property:"--tw-ring-color"}),b("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...Xe({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":xe(e("ringOffsetColor","","#fff")),"--tw-ring-color":xe(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${t} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),re("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),b("shadow(?:$|-)","boxShadow",({_:t})=>({...Xe({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":Me(t),"--tw-shadow-colored":Me(t).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),b("(opacity)-"),v("mix-blend-","mixBlendMode"),...Cc(),...Cc("backdrop-"),b("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:Me(t),transitionTimingFunction:t._=="none"?void 0:Me(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:Me(e("transitionDuration",""))})),b("duration(?:$|-)","transitionDuration","transitionDuration",Me),b("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Me),b("delay(?:$|-)","transitionDelay","transitionDelay",Me),b("animate(?:$|-)","animation",(t,{theme:e,h:r,e:n})=>{let i=Me(t),s=i.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=n(r(s[0])))]:o,animation:s.join(" ")}:{animation:i}}),"(transform)-(none)",v("transform",Fo),v("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":_c(t=="gpu")})),b("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...Fo()})),b("-?(rotate)-","rotate",No),b("-?(translate-[xy])-","translate",No),b("-?(skew-[xy])-","skew",No),v("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",_i),"(appearance)-",b("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",b("(cursor)-"),"(cursor)-",v("snap-(none)","scroll-snap-type"),v("snap-(x|y|both)",({1:t})=>({...Xe({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),v("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),v("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),v("snap-(normal|always)","scroll-snap-stop"),v("scroll-(auto|smooth)","scroll-behavior"),b("scroll-p([xytrbl])?(?:$|-)","padding",or("scroll-padding")),b("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",or("scroll-margin")),v("touch-(auto|none|manipulation)","touch-action"),v("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...Xe({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":r?"pan-y":t}`]:t,"touch-action":"var(--tw-touch-action)"})),v("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),v("outline",{outlineStyle:"solid"}),v("outline-(dashed|dotted|double)","outlineStyle"),b("-?(outline-offset)-"),re("outline-",{opacityVariable:!1,opacitySection:"opacity"}),b("outline-","outlineWidth"),"(pointer-events)-",b("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],v("select-(none|text|all|auto)","userSelect"),re("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),re("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),b("stroke-","strokeWidth"),v("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),v("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function _i(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function xc(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function Ct(t,e="-"){let r=[];for(let n of t)r.push({t:"top",r:"right",b:"bottom",l:"left"}[n]);return r.join(e)}function Me(t){return t&&""+(t._||t)}function kc({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function or(t,e=""){return({1:r,_:n})=>{let i={x:"lr",y:"tb"}[r]||r+r;return i?{...an(t+"-"+Ct(i[0])+e,n),...an(t+"-"+Ct(i[1])+e,n)}:an(t+e,n)}}function Cc(t=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",t&&"opacity","saturate","sepia",!t&&"drop-shadow"].filter(Boolean),r={};for(let n of e)r[`--tw-${t}${n}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...Xe(r),[`${t}filter`]:e.map(n=>`var(--tw-${t}${n})`).join(" ")},[`(${t}filter)-(none)`,v(`${t}filter`,r),...e.map(n=>b(`${n[0]=="h"?"-?":""}(${t}${n})(?:$|-)`,n,({1:i,_:s})=>({[`--tw-${i}`]:B(s).map(o=>`${n}(${o})`).join(" "),...r})))]}function No({1:t,_:e}){return{["--tw-"+t]:e,...Fo()}}function Fo(){return{...Xe({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":_c()}),transform:"var(--tw-transform)"}}function _c(t){return[t?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function Sc({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function Ec({1:t}){return`repeat(${t},minmax(0,1fr))`}function Xe(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var Ac=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:t})=>`@media (orientation:${t})`],["contrast-(more|less)",({1:t})=>`@media (prefers-contrast:${t})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:t})=>`&::${t}`],["(marker|selection)",({1:t})=>`& *::${t},&::${t}`],["file","&::file-selector-button"],["(first|last|only)",({1:t})=>`&:${t}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:t,$$:e},r)=>e&&`&[${t}-${r.theme(t,e)||Le(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:n="",6:i=e},{e:s,h:o,v:u})=>{let l=sr(n)||(r[0]=="["?r:u(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(t+i))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||Le(t,"",e)),t)return t.includes(":")||(t+=":var(--tw)"),/^\w*\s*\(/.test(t)||(t=`(${t})`),`@supports ${t.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:t},e)=>{if(t&&(t=e.theme("screens",t)||Le(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=Le(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&sr(t).replace(/[}]+$/,"").split("{")]];function Mc({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:bc,theme:{...cn,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:Ac,rules:$c,finalize(r){return r.n&&r.d&&r.r.some(n=>/^&::(before|after)$/.test(n))&&!/(^|;)content:/.test(r.d)?{...r,d:"content:var(--tw-content);"+r.d}:r}}}var Nh={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Fh={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Hh={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},zh={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},qh={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Wh={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Gh={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Zh={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Kh={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Jh={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Xh={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Yh={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Qh={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},ed={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},td={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},rd={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},nd={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},id={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},sd={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},od={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},ad={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},ld={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Ic={__proto__:null,slate:Nh,gray:Fh,zinc:Hh,neutral:zh,stone:qh,red:Wh,orange:Gh,amber:Zh,yellow:Kh,lime:Jh,green:Xh,emerald:Yh,teal:Qh,cyan:ed,sky:td,blue:rd,indigo:nd,violet:id,purple:sd,fuchsia:od,pink:ad,rose:ld};function Tc({disablePreflight:t}={}){return Mc({colors:Ic,disablePreflight:t})}function jc({className:t="prose",defaultColor:e="gray",extend:r={},colors:n={}}={}){return n={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...n,dark:n.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...n.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${t}-${s}`,(u,l)=>Dc(t,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${t})`,({1:s},{h:o})=>[{c:o(s)}]],[`${t}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[t+"-",({$$:s},o)=>{let u=Lc(o.theme("fontSize",s));return u&&{"@layer components":u}}],[t+"-",({$$:s},o)=>i(s,o)],[t,(s,o)=>({...i(e,o),"@layer base":[Oc(t,o,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:$(20,16),marginBottom:$(20,16),paddingLeft:$(26,16)},li:{marginTop:$(8,16),marginBottom:$(8,16)},"ol>li,ul>li":{paddingLeft:$(6,16)},">ul>li p":{marginTop:$(12,16),marginBottom:$(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:$(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:$(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:$(12,16),marginBottom:$(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:$(48,16),marginBottom:$(48,16)},blockquote:{marginTop:$(32,20),marginBottom:$(32,20),paddingLeft:$(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:$(20,16),marginBottom:$(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:$(36,16),marginTop:"0",marginBottom:$(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:$(24,16),marginTop:$(48,24),marginBottom:$(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:$(20,16),marginTop:$(32,20),marginBottom:$(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:$(24,16),marginBottom:$(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:$(32,16),marginBottom:$(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:$(14,16),lineHeight:"1.4",marginTop:$(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:$(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:$(21,24)},"h3 code":{fontSize:$(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:$(14,16),lineHeight:"1.7",marginTop:$(24,14),marginBottom:$(24,14),borderRadius:"0.375rem",paddingTop:$(12,14),paddingRight:$(16,14),paddingBottom:$(12,14),paddingLeft:$(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:$(32,16),marginBottom:$(32,16),fontSize:$(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:$(8,14),paddingBottom:$(8,14),paddingLeft:$(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:$(8,14),paddingRight:$(8,14),paddingBottom:$(8,14),paddingLeft:$(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${o.e(o.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:$(20,16),lineHeight:"1.6",marginTop:$(24,20),marginBottom:$(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Oc(t,o,r)],"@layer components":{...Lc(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function i(s,o){let u={},l={},c=(p,h,y)=>{let x=o.theme(`colors.${s}.${h}`,h);y["--tw-prose-"+p]=xe(x);let S=y!=l&&o.d("colors",`${s}-${h}`,x);S&&(l["--tw-prose-"+p]=xe(S))};for(let p in n){let h=n[p];p!="dark"&&h&&c(p,h,u)}for(let p in n.dark||{}){let h=n.dark[p];h&&(n.dark?c("invert-"+p,h,u):c(p,h,l))}return Object.keys(u).length?{"@layer defaults":{"&":u,[o.v("dark")]:l}}:void 0}}function Oc(t,e,r){let n={};for(let i in r)n[Dc(t,i,e,s=>`.${e.e(e.h(t))}${s}`)]=r[i];return n}function Dc(t,e,{e:r,h:n},i){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",u=s,l="")=>i(`${o}:where(${u}):not(:where(.${r(n("not-"+t))} *))${l}`))}function Lc(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function $(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var Ho=Vo({hash:!1,darkMode:"class",theme:{extend:{colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}},spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]}}},presets:[Tc(),wc(),vc(),jc()]});function Pc(t,e=!0){let r=(function(){if(cd)try{let l=$i(new CSSStyleSheet);return l.connect=c=>{let p=zo(c);p.adoptedStyleSheets=[...p.adoptedStyleSheets,l.target]},l.disconnect=Ei,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[$i(s)],u=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(c=>c.snapshot());return()=>l.forEach(c=>c())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,c,p){o[0].insert(l,c,p);let h=this.target.cssRules[c];o.forEach((y,x)=>x&&y.target.insertRule(h.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");zo(l).appendChild(c);let p=$i(c),{cssRules:h}=this.target;for(let y=0;y<h.length;y++)p.target.insertRule(h[y].cssText,y);o.push(p),u.set(l,p)},disconnect(l){let c=o.indexOf(u.get(l));c>=0&&o.splice(c,1)}}})(),n=hc({...t,hash:t.hash??e},r),i=dc(n);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),i.observe(zo(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=n}}}}var cd=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function zo(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var A=t=>Pc(Ho)(t);var un=class extends A(E){constructor(){super(),this.color="#601feb",this.radius="16.8576px",this.size="320px",this.border="#d1d5db"}render(){return f`
125
125
  <div class="flex flex-row flex-wrap gap-0">
126
126
  <div class="relative z-0 flex min-h-9 items-center justify-center overflow-hidden" style="border-radius: ${this.radius};">
127
127
  <!-- Spinning gradient background -->
128
128
  <div
129
- class="absolute z-[-2] m-auto animate-[spin-slow_4s_linear_infinite] bg-cover bg-[0_0] bg-no-repeat"
129
+ class="absolute z-[-2] m-auto animate-[spin-slow_4s_linear_infinite] bg-[0_0] bg-cover bg-no-repeat"
130
130
  style="background-image: conic-gradient(transparent, ${this.color}, transparent 30%); height: ${this.size}; width: ${this.size}; background-color: ${this.border};"></div>
131
131
  <!-- White background with 1px border space for gradient -->
132
- <div class="absolute left-[1px] top-[1px] z-[-1] h-[calc(100%_-_2px)] w-[calc(100%_-_2px)] bg-white" style="border-radius: ${this.radius};"></div>
132
+ <div class="absolute top-[1px] left-[1px] z-[-1] h-[calc(100%_-_2px)] w-[calc(100%_-_2px)] bg-white" style="border-radius: ${this.radius};"></div>
133
133
  <slot></slot>
134
134
  </div>
135
135
  </div>
136
- `}};g(Nr,"properties",{color:{type:String},radius:{type:String},size:{type:String},border:{type:String}}),g(Nr,"styles",ie`
136
+ `}};w(un,"properties",{color:{type:String},radius:{type:String},size:{type:String},border:{type:String}}),w(un,"styles",ae`
137
137
  :host {
138
138
  display: block;
139
139
  }
@@ -148,25 +148,25 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
148
148
  transform: rotate(360deg);
149
149
  }
150
150
  }
151
- `);customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",Nr);var Hr=class extends A(_){constructor(){super();g(this,"render",()=>d`
151
+ `);customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",un);var pn=class extends A(E){constructor(){super();w(this,"render",()=>f`
152
152
  <div class="shadow-button inline-block transition-transform hover:scale-105 active:scale-90" style="border-radius: ${this.dynamicRadius};">
153
153
  <mw-spinning-border .color="${this.color}" .border="${"#f9fafb"}" .radius="${this.dynamicRadius}">
154
154
  <!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
155
155
  <!-- the background color is set on the root button so that when we cross fade between the open/close states there's no white flicker -->
156
156
  <button
157
- class="leading-0 relative inline-block bg-transparent text-sm text-white"
157
+ class="relative inline-block bg-transparent text-sm leading-0 text-white"
158
158
  style="width: ${this.width}; height: ${this.height}; border-radius: ${this.dynamicRadius};"
159
159
  aria-label="Open Molin AI chat window">
160
160
  <!-- the 'open' state invites the user to open (e.g. the chat window) -->
161
- <div class="${this.state==="open"?"visible opacity-100":"invisible opacity-0"} absolute bottom-0 left-[1px] right-0 top-[1px] transition-[opacity,visibility]">
162
- ${this.src?d`
161
+ <div class="${this.state==="open"?"visible opacity-100":"invisible opacity-0"} absolute top-[1px] right-0 bottom-0 left-[1px] transition-[opacity,visibility]">
162
+ ${this.src?f`
163
163
  <!-- load given source -->
164
164
  <img
165
165
  class="flex items-center justify-center bg-white"
166
166
  style="width: calc(${this.width} - 2px); height: calc(${this.height} - 2px); border-radius: ${this.dynamicRadius};"
167
167
  src="${this.src}"
168
168
  alt="Molin AI chat" />
169
- `:d`
169
+ `:f`
170
170
  <!-- the solid background with AI text -->
171
171
  <div
172
172
  class="flex items-center justify-center bg-[${this.backgroundColor}]"
@@ -196,7 +196,7 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
196
196
 
197
197
  <!-- the 'close' state invites the user to close (e.g. the chat window) -->
198
198
  <div
199
- class="${this.state==="close"?"visible opacity-100":"invisible opacity-0"} absolute bottom-0 left-0 right-0 top-0 inline-flex items-center justify-center bg-slate-800 transition-[opacity,visibility]">
199
+ class="${this.state==="close"?"visible opacity-100":"invisible opacity-0"} absolute top-0 right-0 bottom-0 left-0 inline-flex items-center justify-center bg-slate-800 transition-[opacity,visibility]">
200
200
  <!-- down arrow -->
201
201
  <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
202
202
  <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5" />
@@ -205,7 +205,7 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
205
205
  </button>
206
206
  </mw-spinning-border>
207
207
  </div>
208
- `);this.state="open",this.color="#601feb",this.bubbleStyle="solid",this.src="",this.width="64px",this.height="64px"}get iconColor(){return this.bubbleStyle==="solid"?"#ffffff":this.color}get backgroundColor(){return this.bubbleStyle==="solid"?this.color:"#ffffff"}get svgSize(){let r=parseFloat(this.width),n=parseFloat(this.height),s=Math.min(r,n)*.55,o=s,u=s/1.65;return{width:o,height:u}}get dynamicRadius(){let r=parseFloat(this.width),n=parseFloat(this.height);return`${Math.min(r,n)*.265}px`}};g(Hr,"properties",{state:{type:String},color:{type:String},bubbleStyle:{type:String},src:{type:String},width:{type:String},height:{type:String}}),g(Hr,"styles",ie`
208
+ `);this.state="open",this.color="#601feb",this.bubbleStyle="solid",this.src="",this.width="64px",this.height="64px"}get iconColor(){return this.bubbleStyle==="solid"?"#ffffff":this.color}get backgroundColor(){return this.bubbleStyle==="solid"?this.color:"#ffffff"}get svgSize(){let r=parseFloat(this.width),n=parseFloat(this.height),s=Math.min(r,n)*.55,o=s,u=s/1.65;return{width:o,height:u}}get dynamicRadius(){let r=parseFloat(this.width),n=parseFloat(this.height);return`${Math.min(r,n)*.265}px`}};w(pn,"properties",{state:{type:String},color:{type:String},bubbleStyle:{type:String},src:{type:String},width:{type:String},height:{type:String}}),w(pn,"styles",ae`
209
209
  .shadow-button {
210
210
  box-shadow:
211
211
  -58.9194px 74.8436px 38.218px rgba(0, 0, 0, 0.01),
@@ -213,7 +213,7 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
213
213
  -14.3318px 19.109px 23.8863px rgba(0, 0, 0, 0.09),
214
214
  -3.18483px 4.77725px 12.7393px rgba(0, 0, 0, 0.1);
215
215
  }
216
- `);customElements.get("mw-bubble")||customElements.define("mw-bubble",Hr);var Bl={airplay:`<svg
216
+ `);customElements.get("mw-bubble")||customElements.define("mw-bubble",pn);var Uc={airplay:`<svg
217
217
  xmlns="http://www.w3.org/2000/svg"
218
218
  width="24"
219
219
  height="24"
@@ -264,7 +264,7 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
264
264
  stroke-linecap="round"
265
265
  stroke-linejoin="round"
266
266
  >
267
- <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
267
+ <path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z" />
268
268
  </svg>`,info:`<svg
269
269
  xmlns="http://www.w3.org/2000/svg"
270
270
  width="24"
@@ -607,8 +607,8 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
607
607
  stroke-linecap="round"
608
608
  stroke-linejoin="round"
609
609
  >
610
- <polygon points="5 4 15 12 5 20 5 4" />
611
- <line x1="19" x2="19" y1="5" y2="19" />
610
+ <path d="M21 4v16" />
611
+ <path d="M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z" />
612
612
  </svg>`,"skip-back":`<svg
613
613
  xmlns="http://www.w3.org/2000/svg"
614
614
  width="24"
@@ -620,8 +620,8 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
620
620
  stroke-linecap="round"
621
621
  stroke-linejoin="round"
622
622
  >
623
- <polygon points="19 20 9 12 19 4 19 20" />
624
- <line x1="5" x2="5" y1="19" y2="5" />
623
+ <path d="M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z" />
624
+ <path d="M3 20V4" />
625
625
  </svg>`,"mouse-pointer-click":`<svg
626
626
  xmlns="http://www.w3.org/2000/svg"
627
627
  width="24"
@@ -663,7 +663,7 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
663
663
  stroke-linecap="round"
664
664
  stroke-linejoin="round"
665
665
  >
666
- <polygon points="6 3 20 12 6 21 6 3" />
666
+ <path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" />
667
667
  </svg>`,pause:`<svg
668
668
  xmlns="http://www.w3.org/2000/svg"
669
669
  width="24"
@@ -675,8 +675,8 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
675
675
  stroke-linecap="round"
676
676
  stroke-linejoin="round"
677
677
  >
678
- <rect x="14" y="4" width="4" height="16" rx="1" />
679
- <rect x="6" y="4" width="4" height="16" rx="1" />
678
+ <rect x="14" y="3" width="5" height="18" rx="1" />
679
+ <rect x="5" y="3" width="5" height="18" rx="1" />
680
680
  </svg>`,"volume-off":`<svg
681
681
  xmlns="http://www.w3.org/2000/svg"
682
682
  width="24"
@@ -773,7 +773,7 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
773
773
  stroke-linecap="round"
774
774
  stroke-linejoin="round"
775
775
  >
776
- <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
776
+ <path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" />
777
777
  <circle cx="12" cy="12" r="3" />
778
778
  </svg>`,"dollar-sign":`<svg
779
779
  xmlns="http://www.w3.org/2000/svg"
@@ -861,7 +861,7 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
861
861
  stroke-linecap="round"
862
862
  stroke-linejoin="round"
863
863
  >
864
- <path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" />
864
+ <path d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401" />
865
865
  </svg>`,"log-out":`<svg
866
866
  xmlns="http://www.w3.org/2000/svg"
867
867
  width="24"
@@ -1034,11 +1034,26 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1034
1034
  stroke-linecap="round"
1035
1035
  stroke-linejoin="round"
1036
1036
  >
1037
- <path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z" />
1038
- <path d="M20 3v4" />
1039
- <path d="M22 5h-4" />
1040
- <path d="M4 17v2" />
1041
- <path d="M5 18H3" />
1037
+ <path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" />
1038
+ <path d="M20 2v4" />
1039
+ <path d="M22 4h-4" />
1040
+ <circle cx="4" cy="20" r="2" />
1041
+ </svg>`,"image-plus":`<svg
1042
+ xmlns="http://www.w3.org/2000/svg"
1043
+ width="24"
1044
+ height="24"
1045
+ viewBox="0 0 24 24"
1046
+ fill="none"
1047
+ stroke="currentColor"
1048
+ stroke-width="2"
1049
+ stroke-linecap="round"
1050
+ stroke-linejoin="round"
1051
+ >
1052
+ <path d="M16 5h6" />
1053
+ <path d="M19 2v6" />
1054
+ <path d="M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5" />
1055
+ <path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" />
1056
+ <circle cx="9" cy="9" r="2" />
1042
1057
  </svg>`,"external-link":`<svg
1043
1058
  xmlns="http://www.w3.org/2000/svg"
1044
1059
  width="24"
@@ -1111,26 +1126,26 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1111
1126
  >
1112
1127
  <rect width="14" height="14" x="8" y="8" rx="2" ry="2" />
1113
1128
  <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />
1114
- </svg>`};var Fr=class Fr extends HTMLElement{constructor(){super();g(this,"name","");g(this,"fill","none");g(this,"stroke","currentColor");this.attachShadow({mode:"open"})}attributeChangedCallback(r,n,i){if(n!==i&&Fr.observedAttributes.includes(r)){switch(r){case"name":this.name=i||"";break;case"fill":this.fill=i||"none";break;case"stroke":this.stroke=i||"currentColor";break}this.render()}}resolveIcon(r){throw new Error("Not implemented")}render(){let r=document.createElement("style");if(r.textContent=`
1129
+ </svg>`};var hn=class hn extends HTMLElement{constructor(){super();w(this,"name","");w(this,"fill","none");w(this,"stroke","currentColor");this.attachShadow({mode:"open"})}attributeChangedCallback(r,n,i){if(n!==i&&hn.observedAttributes.includes(r)){switch(r){case"name":this.name=i||"";break;case"fill":this.fill=i||"none";break;case"stroke":this.stroke=i||"currentColor";break}this.render()}}resolveIcon(r){throw new Error("Not implemented")}render(){let r=document.createElement("style");if(r.textContent=`
1115
1130
  :host {
1116
1131
  display: inline-block;
1117
1132
  line-height: 0;
1118
1133
  }
1119
- `,this.shadowRoot){for(;this.shadowRoot.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild);this.shadowRoot.appendChild(r)}if(!this.name)return;let n=this.resolveIcon(this.name);if(!n){console.warn(`'${this.name}' not found, please add it to ${Fr.name}`);return}let o=new DOMParser().parseFromString(n,"image/svg+xml").documentElement;o.setAttribute("fill",this.fill),o.setAttribute("stroke",this.stroke),o.style.width="100%",o.style.height="100%",this.shadowRoot?.appendChild(o)}};g(Fr,"observedAttributes",["name","fill","stroke"]);var ti=Fr;var Hp=Bl,ro=class extends ti{resolveIcon(t){return Hp[t]}};customElements.get("lucide-icon")||customElements.define("lucide-icon",ro);var zr,Ce,Nl,Hl,Fp,Fl,ql,qr=class qr extends A(_){constructor(){super();f(this,Ce);f(this,zr,new Date);this.color="#8B5CF6",this.disabled=!1,this.placeholder="Ask AI...",this.dark=!1,this._inputValue=""}render(){return d`
1134
+ `,this.shadowRoot){for(;this.shadowRoot.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild);this.shadowRoot.appendChild(r)}if(!this.name)return;let n=this.resolveIcon(this.name);if(!n){console.warn(`'${this.name}' not found, please add it to ${hn.name}`);return}let o=new DOMParser().parseFromString(n,"image/svg+xml").documentElement;o.setAttribute("fill",this.fill),o.setAttribute("stroke",this.stroke),o.style.width="100%",o.style.height="100%",this.shadowRoot?.appendChild(o)}};w(hn,"observedAttributes",["name","fill","stroke"]);var Ai=hn;var ud=Uc,qo=class extends Ai{resolveIcon(e){return ud[e]}};customElements.get("lucide-icon")||customElements.define("lucide-icon",qo);var fn,Ie,Rc,Bc,pd,Vc,Nc,dn=class dn extends A(E){constructor(){super();d(this,Ie);d(this,fn,new Date);this.color="#8B5CF6",this.disabled=!1,this.placeholder="Ask AI...",this.dark=!1,this._inputValue=""}render(){return f`
1120
1135
  <mw-spinning-border
1121
1136
  .size=${"420px"}
1122
1137
  .color=${this.color||"#8B5CF6"}
1123
1138
  .radius=${"24px"}
1124
1139
  class="${this.dark?"dark":""} rounded-[24px] font-sans text-sm shadow-lg transition-transform duration-500 hover:scale-105">
1125
1140
  <form
1126
- @submit="${y(this,Ce,Hl)}"
1127
- class="m-[1px] flex w-[250px] items-center rounded-[24px] bg-white px-2 py-2 text-gray-800 transition-all duration-500 focus-within:w-[calc(100vw-2rem)] focus-within:scale-100 active:w-[calc(100vw-2rem)] dark:bg-gray-900 dark:text-white md:focus-within:w-[350px] md:active:w-[350px]">
1141
+ @submit="${m(this,Ie,Bc)}"
1142
+ class="m-[1px] flex w-[250px] items-center rounded-[24px] bg-white px-2 py-2 text-gray-800 transition-all duration-500 focus-within:w-[calc(100vw-2rem)] focus-within:scale-100 active:w-[calc(100vw-2rem)] md:focus-within:w-[350px] md:active:w-[350px] dark:bg-gray-900 dark:text-white">
1128
1143
  <lucide-icon class="h-5 w-5 flex-none text-[${this.color||"#8B5CF6"}]" name="${"sparkles"}"></lucide-icon>
1129
1144
 
1130
1145
  <input
1131
1146
  ?disabled="${this.disabled}"
1132
- @keydown="${y(this,Ce,ql)}"
1133
- @input="${y(this,Ce,Nl)}"
1147
+ @keydown="${m(this,Ie,Nc)}"
1148
+ @input="${m(this,Ie,Rc)}"
1134
1149
  .value="${this._inputValue}"
1135
1150
  placeholder="${this.placeholder}"
1136
1151
  autocomplete="off"
@@ -1142,16 +1157,16 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1142
1157
  ?disabled="${this.disabled||!this._inputValue.trim()}"
1143
1158
  class="relative ml-2 h-8 w-8 flex-none rounded-full bg-[${this.color||"#8B5CF6"}] p-0 text-white hover:opacity-70 disabled:bg-gray-400 disabled:text-gray-300 disabled:hover:opacity-100"
1144
1159
  type="submit">
1145
- <div class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2">
1160
+ <div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2">
1146
1161
  <lucide-icon class="block h-5 w-5 text-white" name="${"arrow-up"}"></lucide-icon>
1147
1162
  </div>
1148
1163
  </button>
1149
1164
  </form>
1150
1165
  </mw-spinning-border>
1151
- `}};zr=new WeakMap,Ce=new WeakSet,Nl=function(r){let n=r.target;this._inputValue=n.value,this.dispatchEvent(new qr.ChangeEvent({value:this._inputValue}))},Hl=function(r){r.preventDefault();let n=new Date;if(n.getTime()-a(this,zr).getTime()<500)return;m(this,zr,n);let s=this._inputValue.trim();s&&this.dispatchEvent(new qr.SubmitInputEvent({text:s}))&&(this._inputValue="")},Fp=function(){return this.renderRoot.querySelector('input[name="input"]')??null},Fl=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},ql=function(r){qp(r)&&(r.preventDefault(),this.disabled||a(this,Ce,Fl)?.click())},g(qr,"properties",{color:{type:String},disabled:{type:Boolean},placeholder:{type:String},dark:{type:Boolean},_inputValue:{type:String,state:!0}});var ht=qr,no;ht.SubmitInputEvent=(no=class extends CustomEvent{constructor(t,r={}){super(ht.SubmitInputEvent.type,{detail:t,bubbles:!0,composed:!0,...r})}},g(no,"type","mw-floating-ask-ai:submit"),no);var io;ht.ChangeEvent=(io=class extends CustomEvent{constructor(t,r={}){super(ht.ChangeEvent.type,{detail:t,bubbles:!0,composed:!0,...r})}},g(io,"type","mw-floating-ask-ai:change"),io);function qp(e){return(e.code==="Enter"||e.code==="NumpadEnter")&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey}customElements.get("mw-floating-ask-ai")||customElements.define("mw-floating-ask-ai",ht);var ri={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ni=e=>(...t)=>({_$litDirective$:e,values:t}),Zt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,r,n){this._$Ct=t,this._$AM=r,this._$Ci=n}_$AS(t,r){return this.update(t,r)}update(t,r){return this.render(...r)}};var{I:zp}=ya;var zl=()=>document.createComment(""),Gt=(e,t,r)=>{let n=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(r===void 0){let s=n.insertBefore(zl(),i),o=n.insertBefore(zl(),i);r=new zp(s,o,e,e.options)}else{let s=r._$AB.nextSibling,o=r._$AM,u=o!==e;if(u){let l;r._$AQ?.(e),r._$AM=e,r._$AP!==void 0&&(l=e._$AU)!==o._$AU&&r._$AP(l)}if(s!==i||u){let l=r._$AA;for(;l!==s;){let c=l.nextSibling;n.insertBefore(l,i),l=c}}}return r},Fe=(e,t,r=e)=>(e._$AI(t,r),e),Wp={},Wl=(e,t=Wp)=>e._$AH=t,Zl=e=>e._$AH,ii=e=>{e._$AR(),e._$AA.remove()};var Gl=(e,t,r)=>{let n=new Map;for(let i=t;i<=r;i++)n.set(e[i],i);return n},$e=ni(class extends Zt{constructor(e){if(super(e),e.type!==ri.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,r){let n;r===void 0?r=t:t!==void 0&&(n=t);let i=[],s=[],o=0;for(let u of e)i[o]=n?n(u,o):o,s[o]=r(u,o),o++;return{values:s,keys:i}}render(e,t,r){return this.dt(e,t,r).values}update(e,[t,r,n]){let i=Zl(e),{values:s,keys:o}=this.dt(t,r,n);if(!Array.isArray(i))return this.ut=o,s;let u=this.ut??=[],l=[],c,p,h=0,v=i.length-1,b=0,$=s.length-1;for(;h<=v&&b<=$;)if(i[h]===null)h++;else if(i[v]===null)v--;else if(u[h]===o[b])l[b]=Fe(i[h],s[b]),h++,b++;else if(u[v]===o[$])l[$]=Fe(i[v],s[$]),v--,$--;else if(u[h]===o[$])l[$]=Fe(i[h],s[$]),Gt(e,l[$+1],i[h]),h++,$--;else if(u[v]===o[b])l[b]=Fe(i[v],s[b]),Gt(e,i[h],i[v]),v--,b++;else if(c===void 0&&(c=Gl(o,b,$),p=Gl(u,h,v)),c.has(u[h]))if(c.has(u[v])){let O=p.get(o[b]),C=O!==void 0?i[O]:null;if(C===null){let M=Gt(e,i[h]);Fe(M,s[b]),l[b]=M}else l[b]=Fe(C,s[b]),Gt(e,i[h],C),i[O]=null;b++}else ii(i[v]),v--;else ii(i[h]),h++;for(;b<=$;){let O=Gt(e,l[$+1]);Fe(O,s[b]),l[b++]=O}for(;h<=v;){let O=i[h++];O!==null&&ii(O)}return this.ut=o,Wl(e,l),xe}});var si,Jl,oi=class oi extends A(_){constructor(){super();f(this,si);this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?null:d`
1152
- <div class="flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pb-2 pt-6">
1153
- ${this.examples.title?d`
1154
- <h2 class="mt-14 px-2 pb-2 pt-9 text-left text-3xl font-bold leading-tight tracking-tight">
1166
+ `}};fn=new WeakMap,Ie=new WeakSet,Rc=function(r){let n=r.target;this._inputValue=n.value,this.dispatchEvent(new dn.ChangeEvent({value:this._inputValue}))},Bc=function(r){r.preventDefault();let n=new Date;if(n.getTime()-a(this,fn).getTime()<500)return;g(this,fn,n);let s=this._inputValue.trim();s&&this.dispatchEvent(new dn.SubmitInputEvent({text:s}))&&(this._inputValue="")},pd=function(){return this.renderRoot.querySelector('input[name="input"]')??null},Vc=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},Nc=function(r){hd(r)&&(r.preventDefault(),this.disabled||a(this,Ie,Vc)?.click())},w(dn,"properties",{color:{type:String},disabled:{type:Boolean},placeholder:{type:String},dark:{type:Boolean},_inputValue:{type:String,state:!0}});var St=dn,Wo;St.SubmitInputEvent=(Wo=class extends CustomEvent{constructor(e,r={}){super(St.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}},w(Wo,"type","mw-floating-ask-ai:submit"),Wo);var Go;St.ChangeEvent=(Go=class extends CustomEvent{constructor(e,r={}){super(St.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}},w(Go,"type","mw-floating-ask-ai:change"),Go);function hd(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-floating-ask-ai")||customElements.define("mw-floating-ask-ai",St);var Mi={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ii=t=>(...e)=>({_$litDirective$:t,values:e}),ar=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var{I:dd}=hl;var Fc=()=>document.createComment(""),lr=(t,e,r)=>{let n=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=n.insertBefore(Fc(),i),o=n.insertBefore(Fc(),i);r=new dd(s,o,t,t.options)}else{let s=r._$AB.nextSibling,o=r._$AM,u=o!==t;if(u){let l;r._$AQ?.(t),r._$AM=t,r._$AP!==void 0&&(l=t._$AU)!==o._$AU&&r._$AP(l)}if(s!==i||u){let l=r._$AA;for(;l!==s;){let c=l.nextSibling;n.insertBefore(l,i),l=c}}}return r},Ye=(t,e,r=t)=>(t._$AI(e,r),t),fd={},Hc=(t,e=fd)=>t._$AH=e,zc=t=>t._$AH,Ti=t=>{t._$AR(),t._$AA.remove()};var qc=(t,e,r)=>{let n=new Map;for(let i=e;i<=r;i++)n.set(t[i],i);return n},Ce=Ii(class extends ar{constructor(t){if(super(t),t.type!==Mi.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,r){let n;r===void 0?r=e:e!==void 0&&(n=e);let i=[],s=[],o=0;for(let u of t)i[o]=n?n(u,o):o,s[o]=r(u,o),o++;return{values:s,keys:i}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,n]){let i=zc(t),{values:s,keys:o}=this.dt(e,r,n);if(!Array.isArray(i))return this.ut=o,s;let u=this.ut??=[],l=[],c,p,h=0,y=i.length-1,x=0,S=s.length-1;for(;h<=y&&x<=S;)if(i[h]===null)h++;else if(i[y]===null)y--;else if(u[h]===o[x])l[x]=Ye(i[h],s[x]),h++,x++;else if(u[y]===o[S])l[S]=Ye(i[y],s[S]),y--,S--;else if(u[h]===o[S])l[S]=Ye(i[h],s[S]),lr(t,l[S+1],i[h]),h++,S--;else if(u[y]===o[x])l[x]=Ye(i[y],s[x]),lr(t,i[h],i[y]),y--,x++;else if(c===void 0&&(c=qc(o,x,S),p=qc(u,h,y)),c.has(u[h]))if(c.has(u[y])){let M=p.get(o[x]),C=M!==void 0?i[M]:null;if(C===null){let I=lr(t,i[h]);Ye(I,s[x]),l[x]=I}else l[x]=Ye(C,s[x]),lr(t,i[h],C),i[M]=null;x++}else Ti(i[y]),y--;else Ti(i[h]),h++;for(;x<=S;){let M=lr(t,l[S+1]);Ye(M,s[x]),l[x++]=M}for(;h<=y;){let M=i[h++];M!==null&&Ti(M)}return this.ut=o,Hc(t,l),$e}});var Oi,Wc,Li=class Li extends A(E){constructor(){super();d(this,Oi);this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?null:f`
1167
+ <div class="flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pt-6 pb-2">
1168
+ ${this.examples.title?f`
1169
+ <h2 class="mt-14 px-2 pt-9 pb-2 text-left text-3xl leading-tight font-bold tracking-tight">
1155
1170
  <span>${this.examples.title}</span>
1156
1171
  <svg class="inline-block h-9 w-9 align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 58 61">
1157
1172
  <path
@@ -1160,24 +1175,24 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1160
1175
  </svg>
1161
1176
  </h2>
1162
1177
  `:null}
1163
- ${this.examples?.items?.length?d`
1164
- <ul class="mt-auto flex select-none flex-wrap justify-end gap-2.5 text-sm/6 text-black">
1165
- ${$e(this.examples.items,r=>r,r=>d`
1178
+ ${this.examples?.items?.length?f`
1179
+ <ul class="mt-auto flex flex-wrap justify-end gap-2.5 text-sm leading-6 text-black select-none">
1180
+ ${Ce(this.examples.items,r=>r,r=>f`
1166
1181
  <li
1167
- class="border-1 hover:bg-[${this.color}]/[0.08] border-gray my-auto inline-block cursor-pointer rounded-2xl px-4 py-2 text-left transition-all duration-200 hover:-translate-y-0.5 hover:opacity-80 hover:shadow"
1168
- @click="${()=>y(this,si,Jl).call(this,r)}">
1182
+ class="my-auto inline-block cursor-pointer rounded-2xl border-1 border-gray-300 px-4 py-2 text-left transition-all duration-200 hover:-translate-y-0.5 hover:bg-[${this.color}]/[0.08] hover:opacity-80 hover:shadow"
1183
+ @click="${()=>m(this,Oi,Wc).call(this,r)}">
1169
1184
  <span>${r.trim()}</span>
1170
1185
  </li>
1171
1186
  `)}
1172
1187
  </ul>
1173
1188
  `:null}
1174
1189
  </div>
1175
- `}};si=new WeakSet,Jl=function(r){this.dispatchEvent(new oi.ExampleClickEvent({example:r}))},g(oi,"properties",{examples:{type:Object},color:{type:String}});var Wr=oi,so;Wr.ExampleClickEvent=(so=class extends CustomEvent{constructor(t,r={}){super(Wr.ExampleClickEvent.type,{detail:t,...r})}},g(so,"type","mw:example-click"),so);customElements.get("mw-chat-background")||customElements.define("mw-chat-background",Wr);var Kt,Kl,Xl,Jt=class Jt extends A(_){constructor(){super();f(this,Kt);this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}render(){return d`
1190
+ `}};Oi=new WeakSet,Wc=function(r){this.dispatchEvent(new Li.ExampleClickEvent({example:r}))},w(Li,"properties",{examples:{type:Object},color:{type:String}});var mn=Li,Zo;mn.ExampleClickEvent=(Zo=class extends CustomEvent{constructor(e,r={}){super(mn.ExampleClickEvent.type,{detail:e,...r})}},w(Zo,"type","mw:example-click"),Zo);customElements.get("mw-chat-background")||customElements.define("mw-chat-background",mn);var ur,Gc,Zc,cr=class cr extends A(E){constructor(){super();d(this,ur);this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}render(){return f`
1176
1191
  <div class="relative z-10 h-12">
1177
1192
  <div class="gradient-blur absolute inset-x-0.5 mt-2 h-12"></div>
1178
1193
 
1179
1194
  <div class="absolute inset-0 h-12 overflow-hidden rounded-full">
1180
- <svg class="text-[${this.content.color}]/80 absolute left-1/2 -translate-x-1/2" width="1000" height="48" viewBox="0 0 1000 48" fill="none" xmlns="http://www.w3.org/2000/svg">
1195
+ <svg class="absolute left-1/2 -translate-x-1/2 text-[${this.content.color}]/80" width="1000" height="48" viewBox="0 0 1000 48" fill="none" xmlns="http://www.w3.org/2000/svg">
1181
1196
  <path
1182
1197
  d="M0 0V48H448C459.674 47.8029 468.846 37.4168 476.669 28.559L476.764 28.4508C482.429 22.0372 490.665 18 499.833 18C509.002 18 517.239 22.0372 522.903 28.4508L522.998 28.559C530.895 37.5009 540.167 48 552 48H1000V0H0Z"
1183
1198
  fill="currentColor" />
@@ -1189,13 +1204,13 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1189
1204
  <!-- h-6 keeps the same height as the right buttons to stop the text jitter when they become visible -->
1190
1205
  <div class="z-10 flex h-6 items-center gap-3">
1191
1206
  <!-- TODO: line-clamp-2 -->
1192
- <h1 class="line-clamp-2 max-w-[40%] font-semibold leading-tight tracking-tight text-white">${this.content.title}</h1>
1207
+ <h1 class="line-clamp-2 max-w-[40%] leading-tight font-semibold tracking-tight text-white">${this.content.title}</h1>
1193
1208
 
1194
1209
  <!-- spacer to push other elements to the sides -->
1195
1210
  <div class="flex-grow"></div>
1196
1211
 
1197
1212
  <!-- new chat btn -->
1198
- <button @click=${y(this,Kt,Kl)} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
1213
+ <button @click=${m(this,ur,Gc)} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
1199
1214
  <!-- svg icon of a bubble with a plus -->
1200
1215
  <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 37 36">
1201
1216
  <path
@@ -1207,7 +1222,7 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1207
1222
  </button>
1208
1223
 
1209
1224
  <!-- close chat btn -->
1210
- <button @click=${y(this,Kt,Xl)} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
1225
+ <button @click=${m(this,ur,Zc)} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
1211
1226
  <!-- svg icon of an X -->
1212
1227
  <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="white">
1213
1228
  <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
@@ -1216,13 +1231,13 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1216
1231
  </div>
1217
1232
 
1218
1233
  <!-- logo -->
1219
- <div class="absolute left-1/2 top-1/2 z-10 -mt-0.5 -translate-x-1/2">
1234
+ <div class="absolute top-1/2 left-1/2 z-10 -mt-0.5 -translate-x-1/2">
1220
1235
  <!-- when injected from the dashboard, it's a base64 string data:image format -->
1221
1236
  <img class="inline-block h-[52px] w-[52px] rounded-full bg-white object-cover" src="${this.content.logoUrl}" alt="Logo" />
1222
1237
  </div>
1223
1238
  </div>
1224
1239
  </div>
1225
- `}};Kt=new WeakSet,Kl=function(){this.dispatchEvent(new Jt.NewChatClickEvent)},Xl=function(){this.dispatchEvent(new Jt.CloseClickEvent)},g(Jt,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}}),g(Jt,"styles",ie`
1240
+ `}};ur=new WeakSet,Gc=function(){this.dispatchEvent(new cr.NewChatClickEvent)},Zc=function(){this.dispatchEvent(new cr.CloseClickEvent)},w(cr,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}}),w(cr,"styles",ae`
1226
1241
  /* blurred background */
1227
1242
 
1228
1243
  .gradient-blur {
@@ -1234,46 +1249,39 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1234
1249
  /* bg-color gradient */
1235
1250
  background-image: linear-gradient(to bottom, white 20%, transparent);
1236
1251
  }
1237
- `);var dt=Jt,oo;dt.NewChatClickEvent=(oo=class extends CustomEvent{constructor(t={}){super(dt.NewChatClickEvent.type,{...t})}},g(oo,"type","mw:new-chat-click"),oo);var ao;dt.CloseClickEvent=(ao=class extends CustomEvent{constructor(t={}){super(dt.CloseClickEvent.type,{...t})}},g(ao,"type","mw:close-click"),ao);customElements.get("mw-chat-header")||customElements.define("mw-chat-header",dt);var lo={maxHeight:120,initialHeight:32,paddingY:12},Zr,ee,ai,Yl,Ql,eu,tu,li,ft=class ft extends A(_){constructor(){super();f(this,ee);f(this,Zr,new Date);this.disabled=!1,this.streaming=!1,this.loading=!1,this.placeholder="Type a message..."}render(){return d`
1238
- <form @submit="${y(this,ee,eu)}" class="flex w-full items-center overflow-hidden rounded-[18px] bg-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)]">
1239
- <textarea
1240
- name="input"
1241
- @input="${y(this,ee,tu)}"
1242
- @keydown="${y(this,ee,Ql)}"
1243
- autofocus
1244
- ?disabled="${this.disabled}"
1245
- placeholder="${this.placeholder}"
1246
- class="box-content h-[${lo.initialHeight}px] w-full resize-none place-content-center rounded bg-white px-3 py-[${lo.paddingY}px] text-base text-gray-800 outline-none disabled:place-content-baseline"></textarea>
1247
-
1248
- <button type="submit" ?disabled="${this.disabled||this.loading}" class="mx-1 px-2 transition-opacity duration-200 hover:opacity-80">
1249
- ${this.streaming?d`
1250
- <!-- x -->
1251
- <svg class="h-6 w-6 fill-current" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="#312E30">
1252
- <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
1253
- </svg>
1254
- `:this.loading?d`
1255
- <!-- loading spinner -->
1256
- <svg class="h-6 w-6 animate-spin" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
1257
- <circle class="opacity-25" cx="12" cy="12" r="10" stroke="#312E30" stroke-width="4"></circle>
1258
- <path class="opacity-75" fill="#312E30" d="m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
1259
- </svg>
1260
- `:d`
1261
- <!-- airplane -->
1262
- <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 35 34">
1263
- <path
1264
- stroke="#312E30"
1265
- stroke-linecap="round"
1266
- stroke-linejoin="round"
1267
- stroke-width="2.5"
1268
- d="M33 16.99a1.07 1.07 0 0 0-.589-.955L5.107 2.22a2.162 2.162 0 0 0-2.515.447 2.141 2.141 0 0 0-.318 2.524L9.537 16.99 2.274 28.808a2.138 2.138 0 0 0 .318 2.524 2.157 2.157 0 0 0 2.515.447l27.304-13.832A1.075 1.075 0 0 0 33 16.99Zm0 0H9.53" />
1269
- </svg>
1270
- `}
1271
- </button>
1272
- </form>
1273
- <slot>
1274
- <div class="h-5 w-full"></div>
1275
- </slot>
1276
- `}setValue(r){let n=a(this,ee,ai);if(!n){console.warn("input element not found, cannot set value");return}n.value=r,y(this,ee,li).call(this),this.dispatchEvent(new ft.ChangeEvent({delta:null,full:r}))}};Zr=new WeakMap,ee=new WeakSet,ai=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},Yl=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},Ql=function(r){Zp(r)&&(r.preventDefault(),this.streaming||a(this,ee,Yl)?.click())},eu=function(r){r.preventDefault();let n=new Date;if(n.getTime()-a(this,Zr).getTime()<500)return;if(m(this,Zr,n),this.streaming){this.dispatchEvent(new ft.CancelEvent);return}let s=a(this,ee,ai);if(!s)throw new Error("Expected input element to be present");let o=s.value.trim();o&&this.dispatchEvent(new ft.SubmitEvent(o))&&(s.value=""),y(this,ee,li).call(this)},tu=function(r){this.dispatchEvent(new ft.ChangeEvent({delta:r.data,full:r.target instanceof HTMLTextAreaElement?r.target.value:""})),y(this,ee,li).call(this)},li=function(){let r=a(this,ee,ai);if(!r)return;let{maxHeight:n,initialHeight:i,paddingY:s}=lo;r.style.height=`${i}px`;let o=r.scrollHeight,u=s*2,l=Math.min(o-u,n);r.style.height=`${l}px`},g(ft,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String}});var De=ft,uo;De.ChangeEvent=(uo=class extends CustomEvent{constructor(t,r={}){super(De.ChangeEvent.type,{detail:t,...r})}},g(uo,"type","mw:change"),uo);var co;De.SubmitEvent=(co=class extends CustomEvent{constructor(t,r={}){super(De.SubmitEvent.type,{detail:t,...r,cancelable:!0})}},g(co,"type","mw:submit"),co);var po;De.CancelEvent=(po=class extends CustomEvent{constructor(t={}){super(De.CancelEvent.type,{...t})}},g(po,"type","mw:cancel"),po);function Zp(e){return(e.code==="Enter"||e.code==="NumpadEnter")&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",De);var ui=class extends A(_){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single"}render(){let r=this.side==="user"&&this.position==="single"?"rounded-2xl":this.side==="user"&&["single-current","first"].includes(this.position)?"rounded-2xl rounded-br-[4px]":this.side==="user"&&["middle","last-current"].includes(this.position)?"rounded-2xl rounded-r-[4px]":this.side==="user"&&this.position==="last"?"rounded-2xl rounded-tr-[4px]":["support","assistant"].includes(this.side)&&["single","single-current"].includes(this.position)?"rounded-2xl":["support","assistant"].includes(this.side)&&this.position==="first"?"rounded-2xl rounded-bl-[4px]":["support","assistant"].includes(this.side)&&this.position==="middle"?"rounded-2xl rounded-l-[4px]":["support","assistant"].includes(this.side)&&["last","last-current"].includes(this.position)?"rounded-2xl rounded-tl-[4px]":"rounded-2xl";switch(this.side){case"user":return d`
1252
+ `);var Et=cr,Ko;Et.NewChatClickEvent=(Ko=class extends CustomEvent{constructor(e={}){super(Et.NewChatClickEvent.type,{...e})}},w(Ko,"type","mw:new-chat-click"),Ko);var Jo;Et.CloseClickEvent=(Jo=class extends CustomEvent{constructor(e={}){super(Et.CloseClickEvent.type,{...e})}},w(Jo,"type","mw:close-click"),Jo);customElements.get("mw-chat-header")||customElements.define("mw-chat-header",Et);var hp=qp(Yc(),1);var Mt,gn,Qe,It,Ui,Qc,Pi=class{constructor(e,r,n){d(this,Ui);d(this,Mt);d(this,gn);d(this,Qe);d(this,It);w(this,"isLoading",!1);w(this,"data");g(this,Mt,e),g(this,gn,r),g(this,Qe,n),e.addController(this)}fetch(){if(this.isLoading)return;a(this,It)?.abort();let e=new AbortController;g(this,It,e),this.isLoading=!0,this.data=void 0,a(this,Mt).requestUpdate(),(async()=>{let r=m(this,Ui,Qc).call(this);return r.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(r,{signal:e.signal})})().then(async r=>{if(!r.ok)throw new Error(`${r.statusText}: ${await r.text()}`);this.isLoading=!1,this.data=typeof a(this,Qe)?.transform=="function"?await a(this,Qe).transform(r):r,a(this,Mt).requestUpdate()}).catch(r=>{a(this,Qe)?.onError?.(r),this.isLoading=!1,this.data=void 0,a(this,Mt).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||a(this,Qe)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){a(this,It)?.abort(),g(this,It,void 0)}};Mt=new WeakMap,gn=new WeakMap,Qe=new WeakMap,It=new WeakMap,Ui=new WeakSet,Qc=function(){let e=a(this,gn);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var et,De,ta,wn,ea=class{constructor(e=window.localStorage){d(this,De);d(this,et);g(this,et,e)}setex(e,r,n){return a(this,et).setItem(e,m(this,De,wn).call(this,{value:m(this,De,wn).call(this,r),expiresAt:Date.now()+n*1e3})||"")}set(e,r){return a(this,et).setItem(e,m(this,De,wn).call(this,{value:m(this,De,wn).call(this,r)})||"")}get(e){let r=a(this,et).getItem(e);if(!r)return;let n=m(this,De,ta).call(this,r);if(n){if(n.expiresAt&&n.expiresAt<Date.now()){a(this,et).removeItem(e);return}return m(this,De,ta).call(this,n.value)}}get molin_shop_assistant_distinct_id(){return localStorage.getItem("molin_shop_assistant_distinct_id")}set molin_shop_assistant_distinct_id(e){e===null?localStorage.removeItem("molin_shop_assistant_distinct_id"):localStorage.setItem("molin_shop_assistant_distinct_id",e)}get molin_widget_open_state(){return ye.get("molin-shop-ai-widget-open")??null}set molin_widget_open_state(e){ye.set("molin-shop-ai-widget-open",e)}resetWidgetData(){ye.molin_shop_assistant_distinct_id=null,ye.molin_widget_open_state=null}};et=new WeakMap,De=new WeakSet,ta=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},wn=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var ye=new ea;var Tt,hr,dr,eu,tu,Ri,Bi,tt=class extends A(E){constructor(){super();d(this,dr);d(this,Tt,!1);d(this,hr,!1);d(this,Ri,r=>{console.error("Failed to load chat image:",this.src),g(this,hr,!0),this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:r},bubbles:!0}))});d(this,Bi,r=>{g(this,Tt,!0),this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:r},bubbles:!0}))});this.src="",this.alt="",this.side="right",this.position="single",this.width="300px",this.height="auto"}updated(r){r.has("src")&&(g(this,Tt,!1),g(this,hr,!1))}render(){return this.src?f`
1253
+ <div class="${a(this,dr,eu)} mb-2 min-h-[100px]">
1254
+ <div class="${a(this,dr,tu)} relative">
1255
+ <!-- Placeholder background that's only shown when loading or error -->
1256
+ ${a(this,Tt)?null:f`
1257
+ <div class="flex items-center justify-center bg-gray-100" style="width: ${this.width}; height: 200px;">
1258
+ ${a(this,hr)?f`
1259
+ <!-- Error icon -->
1260
+ <svg class="h-8 w-8 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
1261
+ <path
1262
+ stroke-linecap="round"
1263
+ stroke-linejoin="round"
1264
+ d="m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
1265
+ </svg>
1266
+ `:f`
1267
+ <!-- Loading pulse animation -->
1268
+ <div class="h-8 w-8 animate-pulse rounded-full bg-gray-300"></div>
1269
+ `}
1270
+ </div>
1271
+ `}
1272
+
1273
+ <!-- Actual image -->
1274
+ <img
1275
+ src="${this.src}"
1276
+ alt="${this.alt}"
1277
+ style="width: ${this.width}; height: ${this.height}; display: block;"
1278
+ class="${a(this,Tt)?"opacity-100":"opacity-0 hidden"} h-full w-full max-w-full cursor-pointer transition-all duration-200 hover:scale-[105%]"
1279
+ @error="${a(this,Ri)}"
1280
+ @load="${a(this,Bi)}"
1281
+ loading="lazy" />
1282
+ </div>
1283
+ </div>
1284
+ `:(console.warn("MwChatImage: No src provided"),null)}};Tt=new WeakMap,hr=new WeakMap,dr=new WeakSet,eu=function(){return this.side==="left"||this.side==="assistant"?"flex justify-start":"flex justify-end"},tu=function(){let r="inline-block overflow-hidden shadow-sm";if(this.side==="right"||this.side==="user")switch(this.position){case"first":r+=" rounded-2xl rounded-br-[4px]";break;case"middle":r+=" rounded-2xl rounded-r-[4px]";break;case"last":case"last-current":r+=" rounded-2xl rounded-tr-[4px]";break;default:r+=" rounded-2xl";break}else switch(this.position){case"first":r+=" rounded-2xl rounded-bl-[4px]";break;case"middle":r+=" rounded-2xl rounded-l-[4px]";break;case"last":case"last-current":r+=" rounded-2xl rounded-tl-[4px]";break;default:r+=" rounded-2xl";break}return r},Ri=new WeakMap,Bi=new WeakMap,w(tt,"properties",{src:{type:String},alt:{type:String},side:{type:String},position:{type:String},width:{type:String},height:{type:String}});var ra;tt.ErrorEvent=(ra=class extends CustomEvent{constructor(e,r={}){super(tt.ErrorEvent.type,{detail:e,...r})}},w(ra,"type","mw-chat-image:error"),ra);var na;tt.LoadEvent=(na=class extends CustomEvent{constructor(e,r={}){super(tt.LoadEvent.type,{detail:e,...r})}},w(na,"type","mw-chat-image:load"),na);customElements.get("mw-chat-image")||customElements.define("mw-chat-image",tt);var Vi=class extends A(E){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single"}render(){let r=this.side==="user"&&this.position==="single"?"rounded-2xl":this.side==="user"&&["single-current","first"].includes(this.position)?"rounded-2xl rounded-br-[4px]":this.side==="user"&&["middle","last-current"].includes(this.position)?"rounded-2xl rounded-r-[4px]":this.side==="user"&&this.position==="last"?"rounded-2xl rounded-tr-[4px]":["support","assistant"].includes(this.side)&&["single","single-current"].includes(this.position)?"rounded-2xl":["support","assistant"].includes(this.side)&&this.position==="first"?"rounded-2xl rounded-bl-[4px]":["support","assistant"].includes(this.side)&&this.position==="middle"?"rounded-2xl rounded-l-[4px]":["support","assistant"].includes(this.side)&&["last","last-current"].includes(this.position)?"rounded-2xl rounded-tl-[4px]":"rounded-2xl";switch(this.side){case"user":return f`
1277
1285
  <div class="ml-20 flex justify-end font-sans text-base">
1278
1286
  <div class="max-w-full">
1279
1287
  <!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
@@ -1282,7 +1290,7 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1282
1290
  </div>
1283
1291
 
1284
1292
  <!-- render status (if any) -->
1285
- ${this.status==="sent"?d`
1293
+ ${this.status==="sent"?f`
1286
1294
  <!-- tick mark -->
1287
1295
  <svg class="ml-auto h-3 w-3 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
1288
1296
  <path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
@@ -1290,7 +1298,7 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1290
1298
  `:null}
1291
1299
  </div>
1292
1300
  </div>
1293
- `;case"assistant":case"support":return d`
1301
+ `;case"assistant":case"support":return f`
1294
1302
  <div class="mr-8 flex justify-start font-sans text-base">
1295
1303
  <div class="flex max-w-full space-x-2">
1296
1304
  <!--
@@ -1309,8 +1317,59 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1309
1317
  </div>
1310
1318
  </div>
1311
1319
  </div>
1312
- `;default:throw new Error(`Unknown side: ${this.side}`)}}};g(ui,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String}});customElements.get("mw-chat-message")||customElements.define("mw-chat-message",ui);var ho=class extends A(_){constructor(){super(...arguments);g(this,"render",()=>d`
1313
- <svg class="leading-0 inline-block h-full w-full" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" xml:space="preserve">
1320
+ `;default:throw new Error(`Unknown side: ${this.side}`)}}};w(Vi,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String}});customElements.get("mw-chat-message")||customElements.define("mw-chat-message",Vi);var le=t=>t??z;var Md=["javascript:","data:text/html","vbscript:","data:text/javascript","data:text/vbscript","data:text/css","data:text/plain","data:text/xml"],He,sa,ru,Ni,nu,Fi,Hi=class Hi extends A(E){constructor(){super();d(this,He);d(this,Ni,r=>{r.preventDefault(),this._dismissed=!0,this.storageKey&&m(this,He,ru).call(this),this.dispatchEvent(new Hi.DismissEvent)});d(this,Fi,r=>{r.stopPropagation()});this.text="By chatting with us, you agree to the monitoring and recording of this chat to deliver our services and processing of your personal data in accordance with our [Privacy Policy](https://docs.molin.ai/legal/privacy-policy).",this.color="#3b82f6",this.dismissible=!1,this.storageKey="mw-disclaimer-dismissed",this._dismissed=!1}updated(r){super.updated(r),r.has("storageKey")&&this.storageKey&&this.dismissible&&(this._dismissed=m(this,He,sa).call(this))}connectedCallback(){super.connectedCallback(),this.storageKey&&this.dismissible&&(this._dismissed=m(this,He,sa).call(this))}render(){if(this._dismissed)return null;let r=m(this,He,nu).call(this,this.text);return f`
1321
+ <div class="flex items-center justify-between">
1322
+ <div class="flex flex-1 items-center justify-center">
1323
+ <span class="text-xs text-gray-600"> ${r} </span>
1324
+ </div>
1325
+
1326
+ ${this.dismissible?f`
1327
+ <button type="button" aria-label="Dismiss" class="ml-2 flex h-4 w-4 flex-shrink-0 cursor-pointer items-center justify-center rounded hover:bg-gray-200" @click="${a(this,Ni)}">
1328
+ <lucide-icon name="x" class="h-3 w-3 text-gray-500"></lucide-icon>
1329
+ </button>
1330
+ `:null}
1331
+ </div>
1332
+ `}};He=new WeakSet,sa=function(){try{return localStorage.getItem(this.storageKey)==="true"}catch{return!1}},ru=function(){try{localStorage.setItem(this.storageKey,"true")}catch(r){console.warn("Could not save disclaimer dismissed state to localStorage:",r)}},Ni=new WeakMap,nu=function(r){let i=/\[([^\]]+)\]\(([^)]+)\)/g.exec(r);if(i){let s=i[0],o=i[1],u=i[2],l=i.index;return Md.some(c=>u.toLowerCase().startsWith(c))||!u||!o?r:f`${r.slice(0,l)}<a href="${le(u)}" @click="${a(this,Fi)}" class="underline" style="color: ${this.color}">${o}</a>${r.slice(l+s.length)}`}return r},Fi=new WeakMap,w(Hi,"properties",{text:{type:String},color:{type:String},dismissible:{type:Boolean},storageKey:{type:String,attribute:"storage-key"},_dismissed:{type:Boolean,state:!0}});var yn=Hi,ia;yn.DismissEvent=(ia=class extends CustomEvent{constructor(e={}){super(yn.DismissEvent.type,{...e})}},w(ia,"type","mw-disclaimer:dismiss"),ia);customElements.get("mw-disclaimer")||customElements.define("mw-disclaimer",yn);var fr,iu,su,zi=class extends A(E){constructor(){super();d(this,fr);this.text="I'm still learning!",this.variant="info",this.autoDismissable=!1,this.dismissDelay=5e3,this._isVisible=!0}connectedCallback(){super.connectedCallback(),this.autoDismissable&&m(this,fr,iu).call(this)}render(){let r=m(this,fr,su).call(this);return f`
1333
+ <div
1334
+ class="${this._isVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-[50px] pointer-events-none mt-[-40px]"} flex justify-center transition-all transition-discrete duration-[1s] ease-in-out">
1335
+ <div class="${r.bg} mb-2 flex max-w-[70%] items-center justify-center rounded-full px-3 py-2 select-none">
1336
+ <!-- Icon based on variant -->
1337
+ ${this.variant==="info"?f`
1338
+ <!-- (i) symbol for info -->
1339
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
1340
+ <path
1341
+ fill-rule="evenodd"
1342
+ clip-rule="evenodd"
1343
+ d="M2.25 12C2.25 6.61522 6.61522 2.25 12 2.25C17.3848 2.25 21.75 6.61522 21.75 12C21.75 17.3848 17.3848 21.75 12 21.75C6.61522 21.75 2.25 17.3848 2.25 12ZM10.9562 10.5584C12.1025 9.98533 13.3931 11.0206 13.0823 12.2639L12.3733 15.0999L12.4148 15.0792C12.7852 14.894 13.2357 15.0441 13.421 15.4146C13.6062 15.7851 13.4561 16.2356 13.0856 16.4208L13.0441 16.4416C11.8979 17.0147 10.6072 15.9794 10.9181 14.7361L11.6271 11.9001L11.5856 11.9208C11.2151 12.1061 10.7646 11.9559 10.5793 11.5854C10.3941 11.2149 10.5443 10.7644 10.9148 10.5792L10.9562 10.5584ZM12 9C12.4142 9 12.75 8.66421 12.75 8.25C12.75 7.83579 12.4142 7.5 12 7.5C11.5858 7.5 11.25 7.83579 11.25 8.25C11.25 8.66421 11.5858 9 12 9Z"
1344
+ fill="white" />
1345
+ </svg>
1346
+ `:this.variant==="error"?f`
1347
+ <!-- Alert circle for error -->
1348
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
1349
+ <circle cx="12" cy="12" r="10" stroke="white" stroke-width="2" />
1350
+ <line x1="15" y1="9" x2="9" y2="15" stroke="white" stroke-width="2" />
1351
+ <line x1="9" y1="9" x2="15" y2="15" stroke="white" stroke-width="2" />
1352
+ </svg>
1353
+ `:this.variant==="warning"?f`
1354
+ <!-- Alert triangle for warning -->
1355
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
1356
+ <path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
1357
+ <line x1="12" y1="9" x2="12" y2="13" stroke="white" stroke-width="2" stroke-linecap="round" />
1358
+ <path d="M12 17h.01" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
1359
+ </svg>
1360
+ `:f`
1361
+ <!-- Check circle for success -->
1362
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
1363
+ <path d="M22 11.08V12a10 10 0 11-5.93-9.14" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
1364
+ <polyline points="22,4 12,14.01 9,11.01" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
1365
+ </svg>
1366
+ `}
1367
+
1368
+ <span class="${r.text} ml-1 text-xs">${this.text}</span>
1369
+ </div>
1370
+ </div>
1371
+ `}};fr=new WeakSet,iu=function(){setTimeout(()=>{this._isVisible=!1,this.requestUpdate()},this.dismissDelay)},su=function(){switch(this.variant){case"error":return{bg:"bg-red-600",text:"text-white",icon:"alert-circle"};case"warning":return{bg:"bg-yellow-600",text:"text-white",icon:"alert-triangle"};case"success":return{bg:"bg-green-600",text:"text-white",icon:"check-circle"};case"info":default:return{bg:"bg-black",text:"text-white",icon:"info"}}},w(zi,"properties",{text:{type:String},variant:{type:String},autoDismissable:{type:Boolean,attribute:"auto-dismissable"},dismissDelay:{type:Number,attribute:"dismiss-delay"},_isVisible:{type:Boolean,state:!0}});customElements.get("mw-info-banner")||customElements.define("mw-info-banner",zi);var oa=class extends A(E){constructor(){super(...arguments);w(this,"render",()=>f`
1372
+ <svg class="inline-block h-full w-full leading-0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" xml:space="preserve">
1314
1373
  <circle fill="currentFill" stroke="none" cx="27" cy="50" r="6">
1315
1374
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
1316
1375
  </circle>
@@ -1321,11 +1380,11 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1321
1380
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
1322
1381
  </circle>
1323
1382
  </svg>
1324
- `)}};customElements.get("mw-loading")||customElements.define("mw-loading",ho);var Gp="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",fo=class extends A(_){constructor(){super(...arguments);g(this,"render",()=>d`
1325
- <p class="flex items-center justify-center whitespace-nowrap text-xs">
1383
+ `)}};customElements.get("mw-loading")||customElements.define("mw-loading",oa);var Id="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",aa=class extends A(E){constructor(){super(...arguments);w(this,"render",()=>f`
1384
+ <p class="flex items-center justify-center text-xs whitespace-nowrap">
1326
1385
  <span>Powered by</span>
1327
1386
 
1328
- <a href="${Gp}" target="_blank" class="inline-flex items-center underline">
1387
+ <a href="${Id}" target="_blank" class="inline-flex items-center underline">
1329
1388
  <svg class="mx-1 inline-block h-4 w-4" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
1330
1389
  <circle cx="10.0361" cy="10.0361" r="10.0361" fill="#242038" />
1331
1390
  <path
@@ -1344,96 +1403,33 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1344
1403
  <span>Molin AI</span>
1345
1404
  </a>
1346
1405
  </p>
1347
- `)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",fo);var he=e=>e??H;var mt,Gr,gt,ci=class extends A(_){constructor(){super();f(this,mt,!1);f(this,Gr,!1);f(this,gt,!1);this.src=""}render(){return(this.src?.startsWith("https://cdn.shopify.com")||!1)&&m(this,mt,!0),this.src?d`
1348
- <div class="relative h-full w-full overflow-hidden rounded-lg">
1349
- <!-- use the same icon as for missing image url as the background behind the image so there is no flicker while it's loading -->
1350
- <div class="absolute inset-0 flex items-center justify-center bg-gray-100">
1351
- <!-- shopping bag icon -->
1352
- <svg class="h-1/3 w-1/3 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
1353
- <path
1354
- stroke-linecap="round"
1355
- stroke-linejoin="round"
1356
- d="M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
1357
- </svg>
1358
- </div>
1359
-
1360
- <!-- absolute position to take the height of the parent and to appear on top of the shopping bag background -->
1361
- <div class="absolute inset-0 flex h-full w-full bg-gray-100">
1362
- ${a(this,mt)&&a(this,Gr)?d`
1363
- <!-- missing image url -->
1364
- <div class="flex h-full w-full items-center justify-center">
1365
- <!-- shopping bag icon -->
1366
- <svg class="h-1/3 w-1/3 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
1367
- <path
1368
- stroke-linecap="round"
1369
- stroke-linejoin="round"
1370
- d="M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
1371
- </svg>
1372
- </div>
1373
- `:a(this,mt)?d`
1374
- <!-- we do not need an alt attribute because this does not matter for SEO and we do not have a non-generic image description anyway -->
1375
- <img
1376
- @error="${()=>{m(this,Gr,!0),this.requestUpdate()}}"
1377
- @load="${()=>{m(this,gt,!0),this.requestUpdate()}}"
1378
- src="${this.src}"
1379
- class="${a(this,gt)?"bg-white":""} h-full w-full object-contain"
1380
- loading="lazy" />
1381
- `:d`
1382
- <!-- Cloudflare Images: resize the source image -->
1383
- <!-- we do not need an alt attribute because this does not matter for SEO and we do not have a non-generic image description anyway -->
1384
- <img
1385
- @error="${()=>{m(this,mt,!0),this.requestUpdate()}}"
1386
- @load="${()=>{m(this,gt,!0),this.requestUpdate()}}"
1387
- src="https://molin.ai/cdn-cgi/image/w=70,fit=crop,format=auto,quality=75,dpr=1/${this.src}"
1388
- srcset="
1389
- https://molin.ai/cdn-cgi/image/w=70,fit=crop,format=auto,quality=75,dpr=1/${this.src} 1x,
1390
- https://molin.ai/cdn-cgi/image/w=70,fit=crop,format=auto,quality=75,dpr=2/${this.src} 2x
1391
- "
1392
- class="${a(this,gt)?"bg-white":""} h-full w-full object-contain"
1393
- loading="lazy" />
1394
- `}
1395
- </div>
1396
- </div>
1397
- `:d`
1398
- <!-- missing image url -->
1399
- <div class="flex h-full w-full overflow-hidden rounded-lg bg-gray-100">
1400
- <div class="flex h-full w-full items-center justify-center">
1401
- <!-- shopping bag icon -->
1402
- <svg class="h-1/3 w-1/3 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
1403
- <path
1404
- stroke-linecap="round"
1405
- stroke-linejoin="round"
1406
- d="M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
1407
- </svg>
1408
- </div>
1409
- </div>
1410
- `}};mt=new WeakMap,Gr=new WeakMap,gt=new WeakMap,g(ci,"properties",{src:{type:String}});customElements.get("mw-product-thumbnail")||customElements.define("mw-product-thumbnail",ci);var pi=class extends A(_){constructor(){super(),this.product=void 0,this.streaming=!1,this.linksNewTab=!1,this.searchParams=void 0,this.imagesByProductUrl={}}get trackedProductUrl(){let t=this.product?.url,r=this.searchParams;try{if(t&&r)return Da(t,r).href}catch{}return t}render(){let{name:t,description:r,price:n,url:i}=this.product||{},s=i?this.imagesByProductUrl?.[i]:void 0;return d`
1406
+ `)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",aa);var qi=class extends A(E){constructor(){super(),this.product=void 0,this.streaming=!1,this.linksNewTab=!1,this.searchParams=void 0,this.imagesByProductUrl={}}get trackedProductUrl(){let e=this.product?.url,r=this.searchParams;try{if(e&&r)return Ol(e,r).href}catch{}return e}render(){let{name:e,description:r,price:n,url:i}=this.product||{},s=i?this.imagesByProductUrl?.[i]:void 0;return f`
1411
1407
  <a
1412
- href="${he(this.trackedProductUrl)}"
1413
- title="${he(t)}"
1408
+ href="${le(this.trackedProductUrl)}"
1409
+ title="${le(e)}"
1414
1410
  class="group flex w-full max-w-md cursor-pointer gap-[10px] overflow-hidden rounded-lg"
1415
1411
  target="${this.linksNewTab?"_blank":"_self"}"
1416
1412
  ?disabled="${this.streaming}">
1417
- ${this.streaming?d`
1413
+ ${this.streaming?f`
1418
1414
  <!-- shimmer -->
1419
1415
  <div class="h-[70px] w-[70px] animate-pulse overflow-hidden rounded-lg bg-gray-200"></div>
1420
- `:d`<mw-product-thumbnail class="block h-[70px] w-[70px]" src="${he(s)}"></mw-product-thumbnail>`}
1416
+ `:f`<img src="${le(s)}" class="block h-[70px] w-[70px] rounded-lg bg-gray-100 object-contain" loading="lazy" />`}
1421
1417
 
1422
1418
  <div class="flex flex-1 flex-col justify-between">
1423
1419
  <div>
1424
- ${t||!this.streaming?d`<h3 class="line-clamp-1 text-sm font-medium group-hover:underline">${t}</h3>`:d`<div class="h-5 w-32 animate-pulse rounded bg-gray-200"></div>`}
1420
+ ${e||!this.streaming?f`<h3 class="line-clamp-1 text-sm font-medium group-hover:underline">${e}</h3>`:f`<div class="h-5 w-32 animate-pulse rounded bg-gray-200"></div>`}
1425
1421
 
1426
1422
  <!-- no margin here -->
1427
1423
 
1428
- ${r||!this.streaming?d`<p class="line-clamp-2 text-xs text-gray-500">${r}</p>`:d`<div class="my-1 h-6 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
1424
+ ${r||!this.streaming?f`<p class="line-clamp-2 text-xs text-gray-500">${r}</p>`:f`<div class="my-1 h-6 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
1429
1425
  </div>
1430
1426
 
1431
1427
  <!-- flexbox filled space -->
1432
1428
 
1433
- ${n||!this.streaming?d`<span class="text-xs text-gray-900">${n}</span>`:d`<div class="h-4 w-14 animate-pulse rounded bg-gray-200"></div>`}
1429
+ ${n||!this.streaming?f`<span class="text-xs text-gray-900">${n}</span>`:f`<div class="h-4 w-14 animate-pulse rounded bg-gray-200"></div>`}
1434
1430
  </div>
1435
1431
  </a>
1436
- `}};g(pi,"properties",{product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object}});customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",pi);function hi(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}var di=function(){},Xt=function(){};var Jr=(e,t,r)=>Math.min(Math.max(r,e),t);var mo=.001,Jp=.01,ru=10,Kp=.05,Xp=1;function nu({duration:e=800,bounce:t=.25,velocity:r=0,mass:n=1}){let i,s;di(e<=ru*1e3,"Spring duration must be 10 seconds or less");let o=1-t;o=Jr(Kp,Xp,o),e=Jr(Jp,ru,e/1e3),o<1?(i=c=>{let p=c*o,h=p*e,v=p-r,b=fi(c,o),$=Math.exp(-h);return mo-v/b*$},s=c=>{let h=c*o*e,v=h*r+r,b=Math.pow(o,2)*Math.pow(c,2)*e,$=Math.exp(-h),O=fi(Math.pow(c,2),o);return(-i(c)+mo>0?-1:1)*((v-b)*$)/O}):(i=c=>{let p=Math.exp(-c*e),h=(c-r)*e+1;return-mo+p*h},s=c=>{let p=Math.exp(-c*e),h=(r-c)*(e*e);return p*h});let u=5/e,l=Qp(i,s,u);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{let c=Math.pow(l,2)*n;return{stiffness:c,damping:o*2*Math.sqrt(n*c),duration:e}}}var Yp=12;function Qp(e,t,r){let n=r;for(let i=1;i<Yp;i++)n=n-e(n)/t(n);return n}function fi(e,t){return e*Math.sqrt(1-t*t)}var e1=["duration","bounce"],t1=["stiffness","damping","mass"];function iu(e,t){return t.some(r=>e[r]!==void 0)}function r1(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!iu(e,t1)&&iu(e,e1)){let r=nu(e);t=Object.assign(Object.assign(Object.assign({},t),r),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function mi(e){var{from:t=0,to:r=1,restSpeed:n=2,restDelta:i}=e,s=hi(e,["from","to","restSpeed","restDelta"]);let o={done:!1,value:t},{stiffness:u,damping:l,mass:c,velocity:p,duration:h,isResolvedFromDuration:v}=r1(s),b=su,$=su;function O(){let C=p?-(p/1e3):0,M=r-t,k=l/(2*Math.sqrt(u*c)),E=Math.sqrt(u/c)/1e3;if(i===void 0&&(i=Math.min(Math.abs(r-t)/100,.4)),k<1){let j=fi(E,k);b=N=>{let K=Math.exp(-k*E*N);return r-K*((C+k*E*M)/j*Math.sin(j*N)+M*Math.cos(j*N))},$=N=>{let K=Math.exp(-k*E*N);return k*E*K*(Math.sin(j*N)*(C+k*E*M)/j+M*Math.cos(j*N))-K*(Math.cos(j*N)*(C+k*E*M)-j*M*Math.sin(j*N))}}else if(k===1)b=j=>r-Math.exp(-E*j)*(M+(C+E*M)*j);else{let j=E*Math.sqrt(k*k-1);b=N=>{let K=Math.exp(-k*E*N),te=Math.min(j*N,300);return r-K*((C+k*E*M)*Math.sinh(te)+j*M*Math.cosh(te))/j}}}return O(),{next:C=>{let M=b(C);if(v)o.done=C>=h;else{let k=$(C)*1e3,E=Math.abs(k)<=n,j=Math.abs(r-M)<=i;o.done=E&&j}return o.value=o.done?r:M,o},flipTarget:()=>{p=-p,[t,r]=[r,t],O()}}}mi.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";var su=e=>0;var go=(e,t,r)=>{let n=t-e;return n===0?1:(r-e)/n};var Yt=(e,t,r)=>-r*e+r*t+e;var gi=(e,t)=>r=>Math.max(Math.min(r,t),e),qe=e=>e%1?Number(e.toFixed(5)):e,Qt=/(-)?([\d]*\.?[\d])+/g,yi=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,ou=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Pe(e){return typeof e=="string"}var er={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},wi=Object.assign(Object.assign({},er),{transform:gi(0,1)}),n2=Object.assign(Object.assign({},er),{default:1});var Kr=e=>({test:t=>Pe(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),o2=Kr("deg"),tr=Kr("%"),a2=Kr("px"),l2=Kr("vh"),u2=Kr("vw"),c2=Object.assign(Object.assign({},tr),{parse:e=>tr.parse(e)/100,transform:e=>tr.transform(e*100)});var rr=(e,t)=>r=>!!(Pe(r)&&ou.test(r)&&r.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(r,t)),vi=(e,t,r)=>n=>{if(!Pe(n))return n;let[i,s,o,u]=n.match(Qt);return{[e]:parseFloat(i),[t]:parseFloat(s),[r]:parseFloat(o),alpha:u!==void 0?parseFloat(u):1}};var Ae={test:rr("hsl","hue"),parse:vi("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+tr.transform(qe(t))+", "+tr.transform(qe(r))+", "+qe(wi.transform(n))+")"};var n1=gi(0,255),xi=Object.assign(Object.assign({},er),{transform:e=>Math.round(n1(e))}),we={test:rr("rgb","red"),parse:vi("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+xi.transform(e)+", "+xi.transform(t)+", "+xi.transform(r)+", "+qe(wi.transform(n))+")"};function i1(e){let t="",r="",n="",i="";return e.length>5?(t=e.substr(1,2),r=e.substr(3,2),n=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),r=e.substr(2,1),n=e.substr(3,1),i=e.substr(4,1),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}var nr={test:rr("#"),parse:i1,transform:we.transform};var ze={test:e=>we.test(e)||nr.test(e)||Ae.test(e),parse:e=>we.test(e)?we.parse(e):Ae.test(e)?Ae.parse(e):nr.parse(e),transform:e=>Pe(e)?e:e.hasOwnProperty("red")?we.transform(e):Ae.transform(e)};var au="${c}",lu="${n}";function s1(e){var t,r,n,i;return isNaN(e)&&Pe(e)&&((r=(t=e.match(Qt))===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0)+((i=(n=e.match(yi))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0)>0}function uu(e){typeof e=="number"&&(e=`${e}`);let t=[],r=0,n=e.match(yi);n&&(r=n.length,e=e.replace(yi,au),t.push(...n.map(ze.parse)));let i=e.match(Qt);return i&&(e=e.replace(Qt,lu),t.push(...i.map(er.parse))),{values:t,numColors:r,tokenised:e}}function cu(e){return uu(e).values}function pu(e){let{values:t,numColors:r,tokenised:n}=uu(e),i=t.length;return s=>{let o=n;for(let u=0;u<i;u++)o=o.replace(u<r?au:lu,u<r?ze.transform(s[u]):qe(s[u]));return o}}var o1=e=>typeof e=="number"?0:e;function a1(e){let t=cu(e);return pu(e)(t.map(o1))}var bi={test:s1,parse:cu,createTransformer:pu,getAnimatableNone:a1};function yo(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function wo({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,s=0,o=0;if(!t)i=s=o=r;else{let u=r<.5?r*(1+t):r+t-r*t,l=2*r-u;i=yo(l,u,e+1/3),s=yo(l,u,e),o=yo(l,u,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}var l1=(e,t,r)=>{let n=e*e,i=t*t;return Math.sqrt(Math.max(0,r*(i-n)+n))},u1=[nr,we,Ae],hu=e=>u1.find(t=>t.test(e)),du=e=>`'${e}' is not an animatable color. Use the equivalent color code instead.`,ki=(e,t)=>{let r=hu(e),n=hu(t);Xt(!!r,du(e)),Xt(!!n,du(t));let i=r.parse(e),s=n.parse(t);r===Ae&&(i=wo(i),r=we),n===Ae&&(s=wo(s),n=we);let o=Object.assign({},i);return u=>{for(let l in o)l!=="alpha"&&(o[l]=l1(i[l],s[l],u));return o.alpha=Yt(i.alpha,s.alpha,u),r.transform(o)}};var fu=e=>typeof e=="number";var c1=(e,t)=>r=>t(e(r)),Ci=(...e)=>e.reduce(c1);function gu(e,t){return fu(e)?r=>Yt(e,t,r):ze.test(e)?ki(e,t):xo(e,t)}var vo=(e,t)=>{let r=[...e],n=r.length,i=e.map((s,o)=>gu(s,t[o]));return s=>{for(let o=0;o<n;o++)r[o]=i[o](s);return r}},yu=(e,t)=>{let r=Object.assign(Object.assign({},e),t),n={};for(let i in r)e[i]!==void 0&&t[i]!==void 0&&(n[i]=gu(e[i],t[i]));return i=>{for(let s in n)r[s]=n[s](i);return r}};function mu(e){let t=bi.parse(e),r=t.length,n=0,i=0,s=0;for(let o=0;o<r;o++)n||typeof t[o]=="number"?n++:t[o].hue!==void 0?s++:i++;return{parsed:t,numNumbers:n,numRGB:i,numHSL:s}}var xo=(e,t)=>{let r=bi.createTransformer(t),n=mu(e),i=mu(t);return n.numHSL===i.numHSL&&n.numRGB===i.numRGB&&n.numNumbers>=i.numNumbers?Ci(vo(n.parsed,i.parsed),r):(di(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),o=>`${o>0?t:e}`)};var p1=(e,t)=>r=>Yt(e,t,r);function h1(e){if(typeof e=="number")return p1;if(typeof e=="string")return ze.test(e)?ki:xo;if(Array.isArray(e))return vo;if(typeof e=="object")return yu}function d1(e,t,r){let n=[],i=r||h1(e[0]),s=e.length-1;for(let o=0;o<s;o++){let u=i(e[o],e[o+1]);if(t){let l=Array.isArray(t)?t[o]:t;u=Ci(l,u)}n.push(u)}return n}function f1([e,t],[r]){return n=>r(go(e,t,n))}function m1(e,t){let r=e.length,n=r-1;return i=>{let s=0,o=!1;if(i<=e[0]?o=!0:i>=e[n]&&(s=n-1,o=!0),!o){let l=1;for(;l<r&&!(e[l]>i||l===n);l++);s=l-1}let u=go(e[s],e[s+1],i);return t[s](u)}}function $i(e,t,{clamp:r=!0,ease:n,mixer:i}={}){let s=e.length;Xt(s===t.length,"Both input and output ranges must be the same length"),Xt(!n||!Array.isArray(n)||n.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),e[0]>e[s-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());let o=d1(t,n,i),u=s===2?f1(e,o):m1(e,o);return r?l=>u(Jr(e[0],e[s-1],l)):u}var Xr=e=>t=>1-e(1-t),Si=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,wu=e=>t=>Math.pow(t,e),bo=e=>t=>t*t*((e+1)*t-e),vu=e=>{let t=bo(e);return r=>(r*=2)<1?.5*t(r):.5*(2-Math.pow(2,-10*(r-1)))};var xu=1.525,g1=4/11,y1=8/11,w1=9/10;var bu=wu(2),dm=Xr(bu),ku=Si(bu),v1=e=>1-Math.sin(Math.acos(e)),x1=Xr(v1),fm=Si(x1),Cu=bo(xu),mm=Xr(Cu),gm=Si(Cu),ym=vu(xu),b1=4356/361,k1=35442/1805,C1=16061/1805,$1=e=>{if(e===1||e===0)return e;let t=e*e;return e<g1?7.5625*t:e<y1?9.075*t-9.9*e+3.4:e<w1?b1*t-k1*e+C1:10.8*e*e-20.52*e+10.72},wm=Xr($1);function S1(e,t){return e.map(()=>t||ku).splice(0,e.length-1)}function E1(e){let t=e.length;return e.map((r,n)=>n!==0?n/(t-1):0)}function _1(e,t){return e.map(r=>r*t)}function Yr({from:e=0,to:t=1,ease:r,offset:n,duration:i=300}){let s={done:!1,value:e},o=Array.isArray(t)?t:[e,t],u=_1(n&&n.length===o.length?n:E1(o),i);function l(){return $i(u,o,{ease:Array.isArray(r)?r:S1(o,r)})}let c=l();return{next:p=>(s.value=c(p),s.done=p>=i,s),flipTarget:()=>{o.reverse(),c=l()}}}function $u({velocity:e=0,from:t=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){let o={done:!1,value:t},u=r*e,l=t+u,c=s===void 0?l:s(l);return c!==l&&(u=c-t),{next:p=>{let h=-u*Math.exp(-p/n);return o.done=!(h>i||h<-i),o.value=o.done?c:c+h,o},flipTarget:()=>{}}}var Su={keyframes:Yr,spring:mi,decay:$u};function Eu(e){if(Array.isArray(e.to))return Yr;if(Su[e.type])return Su[e.type];let t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?Yr:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?mi:Yr}var ko=16.666666666666668,M1=typeof performance<"u"?()=>performance.now():()=>Date.now(),Co=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(M1()),ko);function _u(e){let t=[],r=[],n=0,i=!1,s=!1,o=new WeakSet,u={schedule:(l,c=!1,p=!1)=>{let h=p&&i,v=h?t:r;return c&&o.add(l),v.indexOf(l)===-1&&(v.push(l),h&&i&&(n=t.length)),l},cancel:l=>{let c=r.indexOf(l);c!==-1&&r.splice(c,1),o.delete(l)},process:l=>{if(i){s=!0;return}if(i=!0,[t,r]=[r,t],r.length=0,n=t.length,n)for(let c=0;c<n;c++){let p=t[c];p(l),o.has(p)&&(u.schedule(p),e())}i=!1,s&&(s=!1,u.process(l))}};return u}var A1=40,$o=!0,en=!1,So=!1,Qr={delta:0,timestamp:0},tn=["read","update","preRender","render","postRender"],Ei=tn.reduce((e,t)=>(e[t]=_u(()=>en=!0),e),{}),I1=tn.reduce((e,t)=>{let r=Ei[t];return e[t]=(n,i=!1,s=!1)=>(en||j1(),r.schedule(n,i,s)),e},{}),Mu=tn.reduce((e,t)=>(e[t]=Ei[t].cancel,e),{}),jm=tn.reduce((e,t)=>(e[t]=()=>Ei[t].process(Qr),e),{}),O1=e=>Ei[e].process(Qr),Au=e=>{en=!1,Qr.delta=$o?ko:Math.max(Math.min(e-Qr.timestamp,A1),1),Qr.timestamp=e,So=!0,tn.forEach(O1),So=!1,en&&($o=!1,Co(Au))},j1=()=>{en=!0,$o=!0,So||Co(Au)};var Iu=I1;function Eo(e,t,r=0){return e-t-r}function Ou(e,t,r=0,n=!0){return n?Eo(t+-e,t,r):t-(e-t)+r}function ju(e,t,r,n){return n?e>=t+r:e<=-r}var L1=e=>{let t=({delta:r})=>e(r);return{start:()=>Iu.update(t,!0),stop:()=>Mu.update(t)}};function _o(e){var t,r,{from:n,autoplay:i=!0,driver:s=L1,elapsed:o=0,repeat:u=0,repeatType:l="loop",repeatDelay:c=0,onPlay:p,onStop:h,onComplete:v,onRepeat:b,onUpdate:$}=e,O=hi(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:C}=O,M,k=0,E=O.duration,j,N=!1,K=!0,te,D=Eu(O);!((r=(t=D).needsInterpolation)===null||r===void 0)&&r.call(t,n,C)&&(te=$i([0,100],[n,C],{clamp:!1}),n=0,C=100);let re=D(Object.assign(Object.assign({},O),{from:n,to:C}));function oe(){k++,l==="reverse"?(K=k%2===0,o=Ou(o,E,c,K)):(o=Eo(o,E,c),l==="mirror"&&re.flipTarget()),N=!1,b&&b()}function is(){M.stop(),v&&v()}function Ye(W){if(K||(W=-W),o+=W,!N){let ne=re.next(Math.max(0,o));j=ne.value,te&&(j=te(j)),N=K?ne.done:o<=0}$?.(j),N&&(k===0&&(E??(E=o)),k<u?ju(o,E,c,K)&&oe():is())}function An(){p?.(),M=s(Ye),M.start()}return i&&An(),{stop:()=>{h?.(),M.stop()}}}var B,Lu,_i,Tu,Mi,Du,Pu,Ru,Ai,Ii=class Ii extends A(_){constructor(){super();f(this,B);this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(r){r.has("product")&&y(this,B,Lu).call(this)}get images(){return this.product?.images||[]}render(){if(!this.product)return d`
1432
+ `}};w(qi,"properties",{product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object}});customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",qi);function Wi(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}var Gi=function(){},mr=function(){};var vn=(t,e,r)=>Math.min(Math.max(r,t),e);var la=.001,Td=.01,ou=10,Od=.05,Ld=1;function au({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s;Gi(t<=ou*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=vn(Od,Ld,o),t=vn(Td,ou,t/1e3),o<1?(i=c=>{let p=c*o,h=p*t,y=p-r,x=Zi(c,o),S=Math.exp(-h);return la-y/x*S},s=c=>{let h=c*o*t,y=h*r+r,x=Math.pow(o,2)*Math.pow(c,2)*t,S=Math.exp(-h),M=Zi(Math.pow(c,2),o);return(-i(c)+la>0?-1:1)*((y-x)*S)/M}):(i=c=>{let p=Math.exp(-c*t),h=(c-r)*t+1;return-la+p*h},s=c=>{let p=Math.exp(-c*t),h=(r-c)*(t*t);return p*h});let u=5/t,l=Dd(i,s,u);if(t=t*1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{let c=Math.pow(l,2)*n;return{stiffness:c,damping:o*2*Math.sqrt(n*c),duration:t}}}var jd=12;function Dd(t,e,r){let n=r;for(let i=1;i<jd;i++)n=n-t(n)/e(n);return n}function Zi(t,e){return t*Math.sqrt(1-e*e)}var Pd=["duration","bounce"],Ud=["stiffness","damping","mass"];function lu(t,e){return e.some(r=>t[r]!==void 0)}function Rd(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!lu(t,Ud)&&lu(t,Pd)){let r=au(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Ki(t){var{from:e=0,to:r=1,restSpeed:n=2,restDelta:i}=t,s=Wi(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:u,damping:l,mass:c,velocity:p,duration:h,isResolvedFromDuration:y}=Rd(s),x=cu,S=cu;function M(){let C=p?-(p/1e3):0,I=r-e,k=l/(2*Math.sqrt(u*c)),_=Math.sqrt(u/c)/1e3;if(i===void 0&&(i=Math.min(Math.abs(r-e)/100,.4)),k<1){let O=Zi(_,k);x=H=>{let Q=Math.exp(-k*_*H);return r-Q*((C+k*_*I)/O*Math.sin(O*H)+I*Math.cos(O*H))},S=H=>{let Q=Math.exp(-k*_*H);return k*_*Q*(Math.sin(O*H)*(C+k*_*I)/O+I*Math.cos(O*H))-Q*(Math.cos(O*H)*(C+k*_*I)-O*I*Math.sin(O*H))}}else if(k===1)x=O=>r-Math.exp(-_*O)*(I+(C+_*I)*O);else{let O=_*Math.sqrt(k*k-1);x=H=>{let Q=Math.exp(-k*_*H),ne=Math.min(O*H,300);return r-Q*((C+k*_*I)*Math.sinh(ne)+O*I*Math.cosh(ne))/O}}}return M(),{next:C=>{let I=x(C);if(y)o.done=C>=h;else{let k=S(C)*1e3,_=Math.abs(k)<=n,O=Math.abs(r-I)<=i;o.done=_&&O}return o.value=o.done?r:I,o},flipTarget:()=>{p=-p,[e,r]=[r,e],M()}}}Ki.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var cu=t=>0;var ca=(t,e,r)=>{let n=e-t;return n===0?1:(r-t)/n};var gr=(t,e,r)=>-r*t+r*e+t;var Ji=(t,e)=>r=>Math.max(Math.min(r,e),t),rt=t=>t%1?Number(t.toFixed(5)):t,wr=/(-)?([\d]*\.?[\d])+/g,Xi=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,uu=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function ze(t){return typeof t=="string"}var yr={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Yi=Object.assign(Object.assign({},yr),{transform:Ji(0,1)}),eg=Object.assign(Object.assign({},yr),{default:1});var bn=t=>({test:e=>ze(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ng=bn("deg"),vr=bn("%"),ig=bn("px"),sg=bn("vh"),og=bn("vw"),ag=Object.assign(Object.assign({},vr),{parse:t=>vr.parse(t)/100,transform:t=>vr.transform(t*100)});var br=(t,e)=>r=>!!(ze(r)&&uu.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Qi=(t,e,r)=>n=>{if(!ze(n))return n;let[i,s,o,u]=n.match(wr);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:u!==void 0?parseFloat(u):1}};var Pe={test:br("hsl","hue"),parse:Qi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+vr.transform(rt(e))+", "+vr.transform(rt(r))+", "+rt(Yi.transform(n))+")"};var Bd=Ji(0,255),es=Object.assign(Object.assign({},yr),{transform:t=>Math.round(Bd(t))}),Se={test:br("rgb","red"),parse:Qi("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+es.transform(t)+", "+es.transform(e)+", "+es.transform(r)+", "+rt(Yi.transform(n))+")"};function Vd(t){let e="",r="",n="",i="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),n=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),n=t.substr(3,1),i=t.substr(4,1),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}var xr={test:br("#"),parse:Vd,transform:Se.transform};var nt={test:t=>Se.test(t)||xr.test(t)||Pe.test(t),parse:t=>Se.test(t)?Se.parse(t):Pe.test(t)?Pe.parse(t):xr.parse(t),transform:t=>ze(t)?t:t.hasOwnProperty("red")?Se.transform(t):Pe.transform(t)};var pu="${c}",hu="${n}";function Nd(t){var e,r,n,i;return isNaN(t)&&ze(t)&&((r=(e=t.match(wr))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((i=(n=t.match(Xi))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0)>0}function du(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,n=t.match(Xi);n&&(r=n.length,t=t.replace(Xi,pu),e.push(...n.map(nt.parse)));let i=t.match(wr);return i&&(t=t.replace(wr,hu),e.push(...i.map(yr.parse))),{values:e,numColors:r,tokenised:t}}function fu(t){return du(t).values}function mu(t){let{values:e,numColors:r,tokenised:n}=du(t),i=e.length;return s=>{let o=n;for(let u=0;u<i;u++)o=o.replace(u<r?pu:hu,u<r?nt.transform(s[u]):rt(s[u]));return o}}var Fd=t=>typeof t=="number"?0:t;function Hd(t){let e=fu(t);return mu(t)(e.map(Fd))}var ts={test:Nd,parse:fu,createTransformer:mu,getAnimatableNone:Hd};function ua(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function pa({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{let u=r<.5?r*(1+e):r+e-r*e,l=2*r-u;i=ua(l,u,t+1/3),s=ua(l,u,t),o=ua(l,u,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}var zd=(t,e,r)=>{let n=t*t,i=e*e;return Math.sqrt(Math.max(0,r*(i-n)+n))},qd=[xr,Se,Pe],gu=t=>qd.find(e=>e.test(t)),wu=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,rs=(t,e)=>{let r=gu(t),n=gu(e);mr(!!r,wu(t)),mr(!!n,wu(e));let i=r.parse(t),s=n.parse(e);r===Pe&&(i=pa(i),r=Se),n===Pe&&(s=pa(s),n=Se);let o=Object.assign({},i);return u=>{for(let l in o)l!=="alpha"&&(o[l]=zd(i[l],s[l],u));return o.alpha=gr(i.alpha,s.alpha,u),r.transform(o)}};var yu=t=>typeof t=="number";var Wd=(t,e)=>r=>e(t(r)),ns=(...t)=>t.reduce(Wd);function bu(t,e){return yu(t)?r=>gr(t,e,r):nt.test(t)?rs(t,e):da(t,e)}var ha=(t,e)=>{let r=[...t],n=r.length,i=t.map((s,o)=>bu(s,e[o]));return s=>{for(let o=0;o<n;o++)r[o]=i[o](s);return r}},xu=(t,e)=>{let r=Object.assign(Object.assign({},t),e),n={};for(let i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=bu(t[i],e[i]));return i=>{for(let s in n)r[s]=n[s](i);return r}};function vu(t){let e=ts.parse(t),r=e.length,n=0,i=0,s=0;for(let o=0;o<r;o++)n||typeof e[o]=="number"?n++:e[o].hue!==void 0?s++:i++;return{parsed:e,numNumbers:n,numRGB:i,numHSL:s}}var da=(t,e)=>{let r=ts.createTransformer(e),n=vu(t),i=vu(e);return n.numHSL===i.numHSL&&n.numRGB===i.numRGB&&n.numNumbers>=i.numNumbers?ns(ha(n.parsed,i.parsed),r):(Gi(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),o=>`${o>0?e:t}`)};var Gd=(t,e)=>r=>gr(t,e,r);function Zd(t){if(typeof t=="number")return Gd;if(typeof t=="string")return nt.test(t)?rs:da;if(Array.isArray(t))return ha;if(typeof t=="object")return xu}function Kd(t,e,r){let n=[],i=r||Zd(t[0]),s=t.length-1;for(let o=0;o<s;o++){let u=i(t[o],t[o+1]);if(e){let l=Array.isArray(e)?e[o]:e;u=ns(l,u)}n.push(u)}return n}function Jd([t,e],[r]){return n=>r(ca(t,e,n))}function Xd(t,e){let r=t.length,n=r-1;return i=>{let s=0,o=!1;if(i<=t[0]?o=!0:i>=t[n]&&(s=n-1,o=!0),!o){let l=1;for(;l<r&&!(t[l]>i||l===n);l++);s=l-1}let u=ca(t[s],t[s+1],i);return e[s](u)}}function is(t,e,{clamp:r=!0,ease:n,mixer:i}={}){let s=t.length;mr(s===e.length,"Both input and output ranges must be the same length"),mr(!n||!Array.isArray(n)||n.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());let o=Kd(e,n,i),u=s===2?Jd(t,o):Xd(t,o);return r?l=>u(vn(t[0],t[s-1],l)):u}var xn=t=>e=>1-t(1-e),ss=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ku=t=>e=>Math.pow(e,t),fa=t=>e=>e*e*((t+1)*e-t),Cu=t=>{let e=fa(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var Su=1.525,Yd=4/11,Qd=8/11,e1=9/10;var Eu=ku(2),u5=xn(Eu),$u=ss(Eu),t1=t=>1-Math.sin(Math.acos(t)),r1=xn(t1),p5=ss(r1),_u=fa(Su),h5=xn(_u),d5=ss(_u),f5=Cu(Su),n1=4356/361,i1=35442/1805,s1=16061/1805,o1=t=>{if(t===1||t===0)return t;let e=t*t;return t<Yd?7.5625*e:t<Qd?9.075*e-9.9*t+3.4:t<e1?n1*e-i1*t+s1:10.8*t*t-20.52*t+10.72},m5=xn(o1);function a1(t,e){return t.map(()=>e||$u).splice(0,t.length-1)}function l1(t){let e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function c1(t,e){return t.map(r=>r*e)}function kn({from:t=0,to:e=1,ease:r,offset:n,duration:i=300}){let s={done:!1,value:t},o=Array.isArray(e)?e:[t,e],u=c1(n&&n.length===o.length?n:l1(o),i);function l(){return is(u,o,{ease:Array.isArray(r)?r:a1(o,r)})}let c=l();return{next:p=>(s.value=c(p),s.done=p>=i,s),flipTarget:()=>{o.reverse(),c=l()}}}function Au({velocity:t=0,from:e=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){let o={done:!1,value:e},u=r*t,l=e+u,c=s===void 0?l:s(l);return c!==l&&(u=c-e),{next:p=>{let h=-u*Math.exp(-p/n);return o.done=!(h>i||h<-i),o.value=o.done?c:c+h,o},flipTarget:()=>{}}}var Mu={keyframes:kn,spring:Ki,decay:Au};function Iu(t){if(Array.isArray(t.to))return kn;if(Mu[t.type])return Mu[t.type];let e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?kn:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Ki:kn}var ma=16.666666666666668,u1=typeof performance<"u"?()=>performance.now():()=>Date.now(),ga=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(u1()),ma);function Tu(t){let e=[],r=[],n=0,i=!1,s=!1,o=new WeakSet,u={schedule:(l,c=!1,p=!1)=>{let h=p&&i,y=h?e:r;return c&&o.add(l),y.indexOf(l)===-1&&(y.push(l),h&&i&&(n=e.length)),l},cancel:l=>{let c=r.indexOf(l);c!==-1&&r.splice(c,1),o.delete(l)},process:l=>{if(i){s=!0;return}if(i=!0,[e,r]=[r,e],r.length=0,n=e.length,n)for(let c=0;c<n;c++){let p=e[c];p(l),o.has(p)&&(u.schedule(p),t())}i=!1,s&&(s=!1,u.process(l))}};return u}var p1=40,wa=!0,Sn=!1,ya=!1,Cn={delta:0,timestamp:0},En=["read","update","preRender","render","postRender"],os=En.reduce((t,e)=>(t[e]=Tu(()=>Sn=!0),t),{}),h1=En.reduce((t,e)=>{let r=os[e];return t[e]=(n,i=!1,s=!1)=>(Sn||f1(),r.schedule(n,i,s)),t},{}),Ou=En.reduce((t,e)=>(t[e]=os[e].cancel,t),{}),M5=En.reduce((t,e)=>(t[e]=()=>os[e].process(Cn),t),{}),d1=t=>os[t].process(Cn),Lu=t=>{Sn=!1,Cn.delta=wa?ma:Math.max(Math.min(t-Cn.timestamp,p1),1),Cn.timestamp=t,ya=!0,En.forEach(d1),ya=!1,Sn&&(wa=!1,ga(Lu))},f1=()=>{Sn=!0,wa=!0,ya||ga(Lu)};var ju=h1;function va(t,e,r=0){return t-e-r}function Du(t,e,r=0,n=!0){return n?va(e+-t,e,r):e-(t-e)+r}function Pu(t,e,r,n){return n?t>=e+r:t<=-r}var m1=t=>{let e=({delta:r})=>t(r);return{start:()=>ju.update(e,!0),stop:()=>Ou.update(e)}};function ba(t){var e,r,{from:n,autoplay:i=!0,driver:s=m1,elapsed:o=0,repeat:u=0,repeatType:l="loop",repeatDelay:c=0,onPlay:p,onStop:h,onComplete:y,onRepeat:x,onUpdate:S}=t,M=Wi(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:C}=M,I,k=0,_=M.duration,O,H=!1,Q=!0,ne,U=Iu(M);!((r=(e=U).needsInterpolation)===null||r===void 0)&&r.call(e,n,C)&&(ne=is([0,100],[n,C],{clamp:!1}),n=0,C=100);let ie=U(Object.assign(Object.assign({},M),{from:n,to:C}));function he(){k++,l==="reverse"?(Q=k%2===0,o=Du(o,_,c,Q)):(o=va(o,_,c),l==="mirror"&&ie.flipTarget()),H=!1,x&&x()}function Ns(){I.stop(),y&&y()}function ut(G){if(Q||(G=-G),o+=G,!H){let se=ie.next(Math.max(0,o));O=se.value,ne&&(O=ne(O)),H=Q?se.done:o<=0}S?.(O),H&&(k===0&&(_??(_=o)),k<u?Pu(o,_,c,Q)&&he():Ns())}function ei(){p?.(),I=s(ut),I.start()}return i&&ei(),{stop:()=>{h?.(),I.stop()}}}var N,Uu,as,Ru,ls,Bu,Vu,Nu,cs,us=class us extends A(E){constructor(){super();d(this,N);this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(r){r.has("product")&&m(this,N,Uu).call(this)}get images(){return this.product?.images||[]}render(){if(!this.product)return f`
1437
1433
  <div class="my-2 w-full rounded-3xl border bg-white p-4">
1438
1434
  <div class="relative mx-auto mb-4 max-w-[240px]">
1439
1435
  <div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200"></div>
@@ -1452,23 +1448,15 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1452
1448
  <div class="h-8 flex-auto animate-pulse rounded-xl bg-gray-200"></div>
1453
1449
  </div>
1454
1450
  </div>
1455
- `;if(this.product.layout==="horizontal")return d` <mw-product-card-horizontal product="${JSON.stringify(this.product)}"></mw-product-card-horizontal> `;let{name:r,description:n,price:i,category:s}=this.product;return d`
1451
+ `;if(this.product.layout==="horizontal")return f` <mw-product-card-horizontal product="${JSON.stringify(this.product)}"></mw-product-card-horizontal> `;let{name:r,description:n,price:i,category:s}=this.product;return f`
1456
1452
  <div class="my-2 w-full rounded-3xl border-[0.5px] border-[#5e5d59]/25 bg-white p-4 hover:shadow-sm">
1457
1453
  <div class="pointer-events-auto mx-auto mb-4">
1458
1454
  <div class="group relative overflow-hidden rounded-2xl">
1459
1455
  <div class="image-slider z-0 flex transition-transform duration-300 ease-in-out" style="transform: translateX(-${this._currentImageIndex*100}%)">
1460
- ${this.images.length>0?$e(this.images,o=>o,(o,u)=>d`
1461
- <!-- Cloudflare Images: resize the source image -->
1462
- <img
1463
- src="https://molin.ai/cdn-cgi/image/w=100,fit=scale-down,format=auto,quality=75,dpr=1/${o}"
1464
- srcset="
1465
- https://molin.ai/cdn-cgi/image/w=100,fit=scale-down,format=auto,quality=75,dpr=1/${o} 1x,
1466
- https://molin.ai/cdn-cgi/image/w=100,fit=scale-down,format=auto,quality=75,dpr=2/${o} 2x
1467
- "
1468
- alt="image ${u+1}: ${r}"
1469
- class="h-auto w-full flex-shrink-0 object-scale-down"
1470
- loading="lazy" />
1471
- `):d`
1456
+ ${this.images.length>0?Ce(this.images,o=>o,(o,u)=>f`
1457
+ <!-- TODO: add srcset with 1x/2x variants for high DPI displays -->
1458
+ <img src="${o}" alt="image ${u+1}: ${r}" class="h-auto w-full flex-shrink-0 object-scale-down" loading="lazy" />
1459
+ `):f`
1472
1460
  <div class="h-full w-full flex-shrink-0 object-scale-down"></div>
1473
1461
  <svg class="rounded-lg" height="144" viewBox="0 0 100 133" fill="none" xmlns="http://www.w3.org/2000/svg">
1474
1462
  <rect width="100" height="133" rx="2" fill="#EEEEEE" style="" transform="matrix(0.9999999999999999, 0, 0, 0.9999999999999999, 0, -7.105427357601002e-15)" />
@@ -1480,67 +1468,67 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1480
1468
  </svg>
1481
1469
  `}
1482
1470
  </div>
1483
- ${this.images.length>1?d`
1471
+ ${this.images.length>1?f`
1484
1472
  <div class="absolute inset-0 flex items-center justify-between px-4">
1485
1473
  <button
1486
- @click="${y(this,B,Pu)}"
1487
- class="absolute left-2 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white bg-opacity-80 shadow transition-all hover:bg-opacity-100">
1474
+ @click="${m(this,N,Vu)}"
1475
+ class="bg-opacity-80 hover:bg-opacity-100 absolute top-1/2 left-2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white shadow transition-all">
1488
1476
  <hi-outline class="block h-6 w-3" name="chevron-left"></hi-outline>
1489
1477
  </button>
1490
1478
  <button
1491
- @click="${y(this,B,Du)}"
1492
- class="absolute right-2 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white bg-opacity-80 shadow transition-all hover:bg-opacity-100">
1479
+ @click="${m(this,N,Bu)}"
1480
+ class="bg-opacity-80 hover:bg-opacity-100 absolute top-1/2 right-2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white shadow transition-all">
1493
1481
  <hi-outline class="block h-6 w-3" name="chevron-right"></hi-outline>
1494
1482
  </button>
1495
1483
  </div>
1496
1484
  `:null}
1497
- ${this.images?.length>1?d`
1485
+ ${this.images?.length>1?f`
1498
1486
  <div class="slider-dots absolute bottom-3 left-1/2 flex -translate-x-1/2 gap-2">
1499
- ${this.images.map((o,u)=>d`
1487
+ ${this.images.map((o,u)=>f`
1500
1488
  <button
1501
- @click="${()=>y(this,B,Ru).call(this,u)}"
1502
- class="${u===this._currentImageIndex?"bg-opacity-100":"bg-opacity-60"} h-1.5 w-1.5 rounded-full bg-white transition-all hover:bg-opacity-80"></button>
1489
+ @click="${()=>m(this,N,Nu).call(this,u)}"
1490
+ class="${u===this._currentImageIndex?"bg-opacity-100":"bg-opacity-60"} hover:bg-opacity-80 h-1.5 w-1.5 rounded-full bg-white transition-all"></button>
1503
1491
  `)}
1504
1492
  </div>
1505
1493
  `:null}
1506
1494
  </div>
1507
1495
  </div>
1508
- <div @click="${y(this,B,_i)}" class="cursor-pointer">
1509
- ${s?d`<a @click="${y(this,B,_i)}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline"> ${s} </a>`:null}
1496
+ <div @click="${m(this,N,as)}" class="cursor-pointer">
1497
+ ${s?f`<a @click="${m(this,N,as)}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline"> ${s} </a>`:null}
1510
1498
 
1511
1499
  <h3
1512
- @click="${y(this,B,_i)}"
1500
+ @click="${m(this,N,as)}"
1513
1501
  class="${this._isValidUrl?"":"pointer-events-none cursor-default"} mb-1 line-clamp-2 cursor-pointer text-lg font-semibold transition-all hover:underline">
1514
- ${r||d`<span class="inline-block h-6 w-32 animate-pulse rounded bg-gray-200"></span>`}
1502
+ ${r||f`<span class="inline-block h-6 w-32 animate-pulse rounded bg-gray-200"></span>`}
1515
1503
  </h3>
1516
- ${n?d`<p class="mb-2 line-clamp-2 text-sm text-gray-600">${n}</p>`:d`<div class="mb-2 h-4 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
1517
- <span class="text-lg font-bold"> ${i||d`<span class="inline-block h-6 w-16 animate-pulse rounded bg-gray-200"></span>`} </span>
1504
+ ${n?f`<p class="mb-2 line-clamp-2 text-sm text-gray-600">${n}</p>`:f`<div class="mb-2 h-4 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
1505
+ <span class="text-lg font-bold"> ${i||f`<span class="inline-block h-6 w-16 animate-pulse rounded bg-gray-200"></span>`} </span>
1518
1506
 
1519
1507
  <!-- <div class="my-4 border-t border-gray-200"></div> -->
1520
1508
 
1521
1509
  <!-- <button
1522
- @click="${y(this,B,Tu)}"
1510
+ @click="${m(this,N,Ru)}"
1523
1511
  ?disabled="${!this._isValidUrl}"
1524
1512
  class="${this._isValidUrl?"bg-gray-900 hover:bg-gray-800":"bg-gray-900/80 cursor-default"} w-full rounded-xl px-4 py-1.5 text-sm text-white">
1525
1513
  ${this.labels.addToCart}
1526
1514
  </button> -->
1527
1515
  </div>
1528
1516
  </div>
1529
- `}};B=new WeakSet,Lu=function(){if(!this.product?.url){this._isValidUrl=!1;return}try{let r=new URL(this.product.url);this._isValidUrl=r.protocol==="http:"||r.protocol==="https:"}catch{this._isValidUrl=!1}},_i=function(r){r.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")},Tu=function(r){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new Ii.AddToCartEvent(this.product)))},Mi=function(r,n){a(this,B,Ai)&&_o({from:r,to:n,duration:300,onUpdate:i=>{a(this,B,Ai)&&(a(this,B,Ai).style.transform=`translateX(${i}%)`)}})},Du=function(){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=(r+1)%this.product.images.length,i=-(r*100),s=-(n*100);y(this,B,Mi).call(this,i,s),this._currentImageIndex=n},Pu=function(){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=(r-1+this.product.images.length)%this.product.images.length,i=-(r*100),s=-(n*100);y(this,B,Mi).call(this,i,s),this._currentImageIndex=n},Ru=function(r){if(!this.product?.images?.length)return;let n=this._currentImageIndex,i=Math.max(0,Math.min(r,this.product.images.length-1)),s=-(n*100),o=-(i*100);y(this,B,Mi).call(this,s,o),this._currentImageIndex=i},Ai=function(){return this.renderRoot.querySelector(".image-slider")},g(Ii,"properties",{product:{type:Object},labels:{type:Object},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}});var rn=Ii,Mo;rn.AddToCartEvent=(Mo=class extends CustomEvent{constructor(t,r={}){super(rn.AddToCartEvent.type,{detail:{product:t},...r})}},g(Mo,"type","mw-product-card:add-to-cart"),Mo);customElements.get("mw-product-card")||customElements.define("mw-product-card",rn);function ir(e){return Array.isArray(e)?e:e?[e]:[]}function Uu(e,t){let r=new Map;for(let n of e){let i=t(n);r.has(i)||r.set(i,[]),(r.get(i)||[]).push(n)}return r}var Vu=(e,t,r)=>{for(let n of t)if(n[0]===e)return(0,n[1])();return r?.()};var Oi=class extends A(_){constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1}render(){let t=ir(this.orderDetails?.order_status?.step||[]),r=ir(this.orderDetails?.items?.item||[]),n=ir(this.orderDetails?.actions||[]);return d`
1517
+ `}};N=new WeakSet,Uu=function(){if(!this.product?.url){this._isValidUrl=!1;return}try{let r=new URL(this.product.url);this._isValidUrl=r.protocol==="http:"||r.protocol==="https:"}catch{this._isValidUrl=!1}},as=function(r){r.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")},Ru=function(r){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new us.AddToCartEvent(this.product)))},ls=function(r,n){a(this,N,cs)&&ba({from:r,to:n,duration:300,onUpdate:i=>{a(this,N,cs)&&(a(this,N,cs).style.transform=`translateX(${i}%)`)}})},Bu=function(){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=(r+1)%this.product.images.length,i=-(r*100),s=-(n*100);m(this,N,ls).call(this,i,s),this._currentImageIndex=n},Vu=function(){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=(r-1+this.product.images.length)%this.product.images.length,i=-(r*100),s=-(n*100);m(this,N,ls).call(this,i,s),this._currentImageIndex=n},Nu=function(r){if(!this.product?.images?.length)return;let n=this._currentImageIndex,i=Math.max(0,Math.min(r,this.product.images.length-1)),s=-(n*100),o=-(i*100);m(this,N,ls).call(this,s,o),this._currentImageIndex=i},cs=function(){return this.renderRoot.querySelector(".image-slider")},w(us,"properties",{product:{type:Object},labels:{type:Object},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}});var $n=us,xa;$n.AddToCartEvent=(xa=class extends CustomEvent{constructor(e,r={}){super($n.AddToCartEvent.type,{detail:{product:e},...r})}},w(xa,"type","mw-product-card:add-to-cart"),xa);customElements.get("mw-product-card")||customElements.define("mw-product-card",$n);function kr(t){return Array.isArray(t)?t:t?[t]:[]}function Fu(t,e){let r=new Map;for(let n of t){let i=e(n);r.has(i)||r.set(i,[]),(r.get(i)||[]).push(n)}return r}var Hu=(t,e,r)=>{for(let n of e)if(n[0]===t)return(0,n[1])();return r?.()};var ps=class extends A(E){constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1}render(){let e=kr(this.orderDetails?.order_status?.step||[]),r=kr(this.orderDetails?.items?.item||[]),n=kr(this.orderDetails?.actions||[]);return f`
1530
1518
  <div class="flex w-full max-w-md flex-col rounded-3xl border bg-white p-4">
1531
1519
  <!-- Header with order ID -->
1532
1520
  <div class="mb-2">
1533
- ${this.orderDetails?.order_id?.label||!this.streaming?d`<h2 class="text-lg font-semibold">${this.orderDetails?.order_id?.label} ${this.orderDetails?.order_id?.value}</h2>`:d`<div class="h-7 w-full animate-pulse rounded bg-gray-200"></div>`}
1521
+ ${this.orderDetails?.order_id?.label||!this.streaming?f`<h2 class="text-lg font-semibold">${this.orderDetails?.order_id?.label} ${this.orderDetails?.order_id?.value}</h2>`:f`<div class="h-7 w-full animate-pulse rounded bg-gray-200"></div>`}
1534
1522
  </div>
1535
1523
 
1536
1524
  <!-- Progress Timeline -->
1537
1525
  <div>
1538
1526
  <ol role="list" class="w-full overflow-hidden">
1539
- ${this.streaming&&!this.orderDetails?d`
1527
+ ${this.streaming&&!this.orderDetails?f`
1540
1528
  <!-- Loading for status timeline -->
1541
- ${[1,2,3].map((i,s)=>d`
1529
+ ${[1,2,3].map((i,s)=>f`
1542
1530
  <li class="w-full pb-8">
1543
- ${s<2?d`<div class="absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 animate-pulse bg-gray-200" aria-hidden="true"></div>`:""}
1531
+ ${s<2?f`<div class="absolute top-2 left-2 mt-0.5 -ml-px h-full w-0.5 animate-pulse bg-gray-200" aria-hidden="true"></div>`:""}
1544
1532
  <div class="group relative flex items-start">
1545
1533
  <span class="flex h-6 items-center">
1546
1534
  <span class="h-4 w-4 animate-pulse rounded-full bg-gray-200"></span>
@@ -1551,25 +1539,25 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1551
1539
  </div>
1552
1540
  </li>
1553
1541
  `)}
1554
- `:$e(t,i=>i.label,(i,s)=>{let o=i.status==="completed",u=i.status==="in_progress",l=s===t.length-1;return d`<li class="relative pb-4">
1555
- ${l?"":d`<div class="${`absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 ${o?"bg-[#601feb]":"bg-gray-300"}`}" aria-hidden="true"></div>`}
1542
+ `:Ce(e,i=>i.label,(i,s)=>{let o=i.status==="completed",u=i.status==="in_progress",l=s===e.length-1;return f`<li class="relative pb-4">
1543
+ ${l?"":f`<div class="${`absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 ${o?"bg-[#601feb]":"bg-gray-300"}`}" aria-hidden="true"></div>`}
1556
1544
 
1557
1545
  <div class="group relative flex items-start">
1558
- ${Vu(i.status,[["pending",()=>d` <span class="flex h-6 items-center">
1546
+ ${Hu(i.status,[["pending",()=>f` <span class="flex h-6 items-center">
1559
1547
  <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-gray-300 bg-white">
1560
1548
  <span class="h-1.5 w-1.5 rounded-full bg-transparent"></span>
1561
1549
  </span>
1562
- </span>`],["in_progress",()=>d`<span class="flex h-6 items-center">
1550
+ </span>`],["in_progress",()=>f`<span class="flex h-6 items-center">
1563
1551
  <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[#601feb] bg-white">
1564
1552
  <span class="h-1.5 w-1.5 rounded-full bg-[#601feb]"></span>
1565
1553
  </span>
1566
- </span>`],["completed",()=>d`
1554
+ </span>`],["completed",()=>f`
1567
1555
  <span class="flex h-6 items-center">
1568
1556
  <span class="flex h-4 w-4 items-center justify-center rounded-full bg-[#601feb]">
1569
1557
  <hi-outline class="mb-3 block h-3 w-3 text-white" name="check"></hi-outline>
1570
1558
  </span>
1571
1559
  </span>
1572
- `]],()=>d`<span class="flex h-6 items-center">
1560
+ `]],()=>f`<span class="flex h-6 items-center">
1573
1561
  <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[#601feb] bg-white">
1574
1562
  <span class="h-1.5 w-1.5 rounded-full bg-[#601feb]"></span>
1575
1563
  </span>
@@ -1585,7 +1573,7 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1585
1573
 
1586
1574
  <!-- Products list with order items -->
1587
1575
  <div class="mb-2 w-full">
1588
- ${r.length===0&&!this.orderDetails?.total?.amount&&this.streaming?d`
1576
+ ${r.length===0&&!this.orderDetails?.total?.amount&&this.streaming?f`
1589
1577
  <!-- Loading shimmer for products -->
1590
1578
  <div class="w-full space-y-4">
1591
1579
  <div class="flex items-center gap-2">
@@ -1600,11 +1588,11 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1600
1588
  <div class="h-4 w-10 animate-pulse rounded bg-gray-200"></div>
1601
1589
  </div>
1602
1590
  </div>
1603
- `:d`
1591
+ `:f`
1604
1592
  <div class="divide-y divide-gray-100">
1605
- ${this.streaming&&!r.length?d`
1593
+ ${this.streaming&&!r.length?f`
1606
1594
  <!-- Loading shimmer for individual products -->
1607
- ${[1,2].map(()=>d`
1595
+ ${[1,2].map(()=>f`
1608
1596
  <div class="flex items-center gap-2 py-1.5">
1609
1597
  <div class="h-12 w-12 animate-pulse rounded-lg bg-gray-200"></div>
1610
1598
  <div class="min-w-0 flex-1">
@@ -1613,14 +1601,14 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1613
1601
  <div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>
1614
1602
  </div>
1615
1603
  `)}
1616
- `:r?.map(i=>{let s=i?.image_url;return d`
1604
+ `:r?.map(i=>{let s=i?.image_url;return f`
1617
1605
  <div class="flex items-center gap-2 py-1.5">
1618
- <mw-product-thumbnail class="block h-12 w-12" src="${he(s)}"></mw-product-thumbnail>
1606
+ <img src="${le(s)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain" loading="lazy" />
1619
1607
 
1620
1608
  <div class="min-w-0 flex-1">
1621
- ${!i?.name&&this.streaming?d`<div class="h-4 w-32 animate-pulse rounded bg-gray-200"></div>`:d`<h3 class="truncate text-sm font-medium">${i?.name}</h3>`}
1609
+ ${!i?.name&&this.streaming?f`<div class="h-4 w-32 animate-pulse rounded bg-gray-200"></div>`:f`<h3 class="truncate text-sm font-medium">${i?.name}</h3>`}
1622
1610
  </div>
1623
- ${!i?.price&&this.streaming?d`<div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>`:d`<span class="text-sm text-gray-500">${i?.quantity&&Number(i.quantity)>1?"x":""} ${i?.price}</span>`}
1611
+ ${!i?.price&&this.streaming?f`<div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>`:f`<span class="text-sm text-gray-500">${i?.quantity&&Number(i.quantity)>1?"x":""} ${i?.price}</span>`}
1624
1612
  </div>
1625
1613
  `})}
1626
1614
  </div>
@@ -1636,9 +1624,9 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1636
1624
 
1637
1625
  <!-- Shipping and payment information -->
1638
1626
  <div class="mb-2 flex w-full flex-col gap-2 overflow-hidden">
1639
- ${this.streaming&&!this.orderDetails?d`
1627
+ ${this.streaming&&!this.orderDetails?f`
1640
1628
  <!-- Loading shimmer template -->
1641
- ${[1,2].map(()=>d`
1629
+ ${[1,2].map(()=>f`
1642
1630
  <div>
1643
1631
  <div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
1644
1632
  <div class="space-y-2 overflow-hidden">
@@ -1647,10 +1635,10 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1647
1635
  </div>
1648
1636
  </div>
1649
1637
  `)}
1650
- `:d`
1638
+ `:f`
1651
1639
  <!-- Shipping Section -->
1652
1640
  <div>
1653
- ${this.streaming&&!this.orderDetails?.shipping?d`
1641
+ ${this.streaming&&!this.orderDetails?.shipping?f`
1654
1642
  <div>
1655
1643
  <div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
1656
1644
  <div class="space-y-2 overflow-hidden">
@@ -1658,18 +1646,18 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1658
1646
  <div class="h-4 w-36 animate-pulse rounded bg-gray-200"></div>
1659
1647
  </div>
1660
1648
  </div>
1661
- `:this.orderDetails?.shipping?.method||this.orderDetails?.customer?.name?d`
1649
+ `:this.orderDetails?.shipping?.method||this.orderDetails?.customer?.name?f`
1662
1650
  <h3 class="mb-1 text-sm font-medium">${this.orderDetails?.shipping?.label}</h3>
1663
1651
  <div class="space-y-1">
1664
- ${this.orderDetails.customer?.name?d`<p class="text-xs text-gray-600">${this.orderDetails.customer.name}</p>`:""}
1665
- ${this.orderDetails.shipping?.method?d`<p class="text-xs text-gray-600">${this.orderDetails.shipping.method}</p>`:""}
1652
+ ${this.orderDetails.customer?.name?f`<p class="text-xs text-gray-600">${this.orderDetails.customer.name}</p>`:""}
1653
+ ${this.orderDetails.shipping?.method?f`<p class="text-xs text-gray-600">${this.orderDetails.shipping.method}</p>`:""}
1666
1654
  </div>
1667
1655
  `:""}
1668
1656
  </div>
1669
1657
 
1670
1658
  <!-- Payment Section -->
1671
1659
  <div>
1672
- ${this.streaming&&!this.orderDetails?.payment?d`
1660
+ ${this.streaming&&!this.orderDetails?.payment?f`
1673
1661
  <div>
1674
1662
  <div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
1675
1663
  <div class="space-y-2 overflow-hidden">
@@ -1677,15 +1665,15 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1677
1665
  <div class="h-4 w-36 animate-pulse rounded bg-gray-200"></div>
1678
1666
  </div>
1679
1667
  </div>
1680
- `:this.orderDetails?.payment?d`
1668
+ `:this.orderDetails?.payment?f`
1681
1669
  <h3 class="mb-1 text-sm font-medium">${this.orderDetails.payment.label}</h3>
1682
- ${this.orderDetails.payment?.method?.value?d`
1670
+ ${this.orderDetails.payment?.method?.value?f`
1683
1671
  <p class="text-xs text-gray-600">
1684
1672
  <span class="font-medium">${this.orderDetails.payment.method.label}:</span>
1685
1673
  ${this.orderDetails.payment.method.value}
1686
1674
  </p>
1687
1675
  `:""}
1688
- ${this.orderDetails.payment.status?.value?d`
1676
+ ${this.orderDetails.payment.status?.value?f`
1689
1677
  <p class="text-xs text-gray-600">
1690
1678
  <span class="font-medium">${this.orderDetails.payment.status.label}:</span>
1691
1679
  <span>${this.orderDetails.payment.status.value}</span>
@@ -1698,11 +1686,11 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1698
1686
 
1699
1687
  <!-- Action buttons section -->
1700
1688
  <div class="flex w-full flex-col gap-2 overflow-hidden">
1701
- ${this.streaming&&!n[0]?.track_order?.label&&!Ms(n[0]?.track_order?.tracking_url||"")?d`
1689
+ ${this.streaming&&!n[0]?.track_order?.label&&!go(n[0]?.track_order?.tracking_url||"")?f`
1702
1690
  <!-- Loading shimmer for buttons -->
1703
1691
  <div class="h-10 w-full min-w-[250px] animate-pulse overflow-hidden rounded-xl bg-gray-200"></div>
1704
- `:$e(n,(i,s)=>`action-${s}`,i=>{if(i?.track_order?.label)return d`
1705
- ${Ms(i.track_order?.tracking_url||"")?d` <a
1692
+ `:Ce(n,(i,s)=>`action-${s}`,i=>{if(i?.track_order?.label)return f`
1693
+ ${go(i.track_order?.tracking_url||"")?f` <a
1706
1694
  target="${this.linksNewTab?"_blank":"_self"}"
1707
1695
  href="${i.track_order?.tracking_url}"
1708
1696
  class="mt-1 w-full rounded-xl bg-[#601feb] px-4 py-2 text-center text-sm font-medium text-white hover:opacity-90"
@@ -1711,25 +1699,25 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1711
1699
  `})}
1712
1700
  </div>
1713
1701
  </div>
1714
- `}};g(Oi,"properties",{orderDetails:{type:Object,attribute:"order-details"},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"}});customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",Oi);var nn=class extends Zt{constructor(t){if(super(t),this.it=H,t.type!==ri.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===H||t==null)return this._t=void 0,this.it=t;if(t===xe)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 r=[t];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}};nn.directiveName="unsafeHTML",nn.resultType=1;var Bu=ni(nn);var Nu=za(Te({name:J(),description:J(),price:J(),image_url:Ht([J(),Bt(J())]),category:J(),url:J()}));function Hu(e,t,r,{imagesByProductUrl:n,linksNewTab:i=!0,searchParams:s,messageIsStreaming:o=!1}){if(!e)return d``;let u=t>0&&r[t-1]&&"data"in r[t-1],l=t<r.length-1||!o;if("text"in e)return d`<p>${e.text}</p>`;if("html"in e)return d`${Bu(e.html)}`;if("data"in e)switch(e.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let c=Tr(Nu,e.data);if(c.success){let p={...c.output,images:[]};return p.images=ir(p.image_url),d`
1715
- ${u?d`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
1702
+ `}};w(ps,"properties",{orderDetails:{type:Object,attribute:"order-details"},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"}});customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",ps);var _n=class extends ar{constructor(e){if(super(e),this.it=z,e.type!==Mi.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===z||e==null)return this._t=void 0,this.it=e;if(e===$e)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let r=[e];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}};_n.directiveName="unsafeHTML",_n.resultType=1;var zu=Ii(_n);var qu=Fl(Fe({name:X(),description:X(),price:X(),image_url:tr([X(),Qt(X())]),category:X(),url:X()}));function Wu(t,e,r,{imagesByProductUrl:n,linksNewTab:i=!0,searchParams:s,messageIsStreaming:o=!1}){if(!t)return f``;let u=e>0&&r[e-1]&&"data"in r[e-1],l=e<r.length-1||!o;if("text"in t)return f`<p>${t.text}</p>`;if("html"in t)return f`${zu(t.html)}`;if("data"in t)switch(t.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let c=nn(qu,t.data);if(c.success){let p={...c.output,images:[]};return p.images=kr(p.image_url),f`
1703
+ ${u?f`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
1716
1704
  <mw-product-card-horizontal
1717
1705
  product="${JSON.stringify(p)}"
1718
1706
  ?streaming="${!l}"
1719
1707
  ?links-new-tab="${i}"
1720
1708
  .searchParams="${s}"
1721
1709
  .imagesByProductUrl="${n}"></mw-product-card-horizontal>
1722
- `}console.warn(c.issues);break}case"order-status-card-v1":return d`<mw-product-order-status-card order-details="${JSON.stringify(e.data)}" ?streaming="${!l}" ?links-new-tab="${i}"></mw-product-order-status-card> `}return console.warn("could not render part:",e),d`<p><i>data type not supported</i></p>`}var sn,sr,We,yt,Li,Fu,ji=class{constructor(t,r,{timeoutMs:n=2e3}={}){f(this,Li);f(this,sn);f(this,sr);f(this,We);f(this,yt,!1);g(this,"timeoutMs");m(this,sn,t),m(this,sr,r),this.timeoutMs=n,t.addController(this)}get isTyping(){return a(this,yt)}hostDisconnected(){clearTimeout(a(this,We)),m(this,We,void 0)}onInput(t){if(a(this,sn).isConnected){if(!t.trim()){this.typingStopped();return}clearTimeout(a(this,We)),m(this,We,setTimeout(()=>this.typingStopped(),this.timeoutMs)),a(this,yt)||y(this,Li,Fu).call(this)}}typingStopped(){clearTimeout(a(this,We)),m(this,yt,!1),a(this,sr).typingStopped()}};sn=new WeakMap,sr=new WeakMap,We=new WeakMap,yt=new WeakMap,Li=new WeakSet,Fu=function(){m(this,yt,!0),a(this,sr).typingStarted()};function qu(e,t="en-US"){let r=new Intl.DateTimeFormat(t,{hour:"numeric",minute:"numeric"}).format(e);return`${e.toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"})}, ${r}`}var T1=!0,Ao="Invariant failed";function wt(e,t){if(!e){if(T1)throw new Error(Ao);var r=typeof t=="function"?t():t,n=r?"".concat(Ao,": ").concat(r):Ao;throw new Error(n)}}var D1="\xB7 \xB7 \xB7",L,ln,un,z,zu,Wu,Zu,Gu,Ju,Ku,Xu,P1,on,Ti=class Ti extends A(_){constructor(){super();f(this,z);f(this,L,Qa(this));f(this,ln,new ji(this,{typingStarted:()=>a(this,L).value?.sendUserTypingStart(),typingStopped:()=>a(this,L).value?.sendUserTypingStop()}));f(this,un,"single");this.showClose=!1}get conversationId(){return a(this,L).value?.conversationId||""}get messages(){return a(this,L).value?.messages||[]}get config(){return a(this,L).value?.config}get callbacks(){return a(this,L).value?.callbacks||{}}get widgetId(){return a(this,L).value?.widgetId||""}get typingIndicator(){return a(this,L).value?.typingIndicator}get isStreaming(){return a(this,L).value?.isStreaming}get ranOutOfCredits(){return a(this,L).value?.ranOutOfCredits}get isLiveMode(){return a(this,L).value?.isLiveMode}get lastMsg(){return a(this,L).value?.lastMsg}get hasQueuedMessages(){return a(this,L).value?.hasQueuedMessages}render(){wt(this.config,"config is required");let r=Uu(this.messages,n=>{try{let i=new Date(n.timestamp),s=Math.floor(i.getUTCMinutes()/5)*5;return i.setUTCMinutes(s,0,0),i.valueOf().toString()}catch(i){console.error(i)}});return d`
1710
+ `}console.warn(c.issues);break}case"order-status-card-v1":return f`<mw-product-order-status-card order-details="${JSON.stringify(t.data)}" ?streaming="${!l}" ?links-new-tab="${i}"></mw-product-order-status-card> `}return console.warn("could not render part:",t),f`<p><i>data type not supported</i></p>`}var An,Cr,it,Ot,ds,Gu,hs=class{constructor(e,r,{timeoutMs:n=2e3}={}){d(this,ds);d(this,An);d(this,Cr);d(this,it);d(this,Ot,!1);w(this,"timeoutMs");g(this,An,e),g(this,Cr,r),this.timeoutMs=n,e.addController(this)}get isTyping(){return a(this,Ot)}hostDisconnected(){clearTimeout(a(this,it)),g(this,it,void 0)}onInput(e){if(a(this,An).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(a(this,it)),g(this,it,setTimeout(()=>this.typingStopped(),this.timeoutMs)),a(this,Ot)||m(this,ds,Gu).call(this)}}typingStopped(){clearTimeout(a(this,it)),g(this,Ot,!1),a(this,Cr).typingStopped()}};An=new WeakMap,Cr=new WeakMap,it=new WeakMap,Ot=new WeakMap,ds=new WeakSet,Gu=function(){g(this,Ot,!0),a(this,Cr).typingStarted()};function Zu(t,e="en-US"){let r=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(t);return`${t.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${r}`}var g1="\xB7 \xB7 \xB7",L,In,ce,Sr,fs,F,Ku,Ju,Xu,Yu,Qu,ep,tp,w1,Lt,ms=class ms extends A(E){constructor(){super();d(this,F);d(this,L,Jl(this));d(this,In,new hs(this,{typingStarted:()=>a(this,L).value?.sendUserTypingStart(),typingStopped:()=>a(this,L).value?.sendUserTypingStop()}));d(this,ce,new gs(this,{onImageDelete:r=>{if(!a(this,L).value){console.warn("widget context not available, cannot delete image");return}a(this,L).value.sendImageDelete(r),a(this,F,Lt)?.focus()}}));d(this,Sr,"single");d(this,fs,r=>{let n=r,{pendingImages:i}=n.detail;Array.isArray(i)&&a(this,ce).restoreImages(i)});this.showClose=!1}get conversationId(){return a(this,L).value?.conversationId||""}get messages(){return a(this,L).value?.messages||[]}get config(){return a(this,L).value?.config}get callbacks(){return a(this,L).value?.callbacks||{}}get widgetId(){return a(this,L).value?.widgetId||""}get typingIndicator(){return a(this,L).value?.typingIndicator}get isStreaming(){return a(this,L).value?.isStreaming}get ranOutOfCredits(){return a(this,L).value?.ranOutOfCredits}get isLiveMode(){return a(this,L).value?.isLiveMode}get lastMsg(){return a(this,L).value?.lastMsg}get hasQueuedMessages(){return a(this,L).value?.hasQueuedMessages}firstUpdated(){document.addEventListener("mw-context-widget:connected",a(this,fs),{once:!0})}updated(){a(this,L).value?.widgetId&&a(this,ce).updateUploadOptions({conversationId:this.conversationId,widgetId:a(this,L).value?.widgetId})}render(){Ne(this.config,"config is required");let r=Fu(this.messages,n=>{try{let i=new Date(n.timestamp),s=Math.floor(i.getUTCMinutes()/5)*5;return i.setUTCMinutes(s,0,0),i.valueOf().toString()}catch(i){console.error(i)}});return f`
1723
1711
  <div class="relative mx-auto h-full bg-[#FDFDFD] font-sans text-base before:absolute before:inset-0 before:bg-[#8d8d8d] before:opacity-10 sm:rounded-[36px] sm:p-1.5 sm:before:rounded-[36px]">
1724
1712
  <div
1725
1713
  class="relative flex h-full flex-col bg-white shadow-[0px_4px_4px_0px_rgba(0,0,0,0.25),-116px_177px_59px_0px_rgba(0,0,0,0.00),-74px_113px_54px_0px_rgba(0,0,0,0.01),-42px_64px_46px_0px_rgba(0,0,0,0.03),-19px_28px_34px_0px_rgba(0,0,0,0.06)] sm:rounded-[30px]">
1726
1714
  <mw-chat-header
1727
- class="absolute left-1.5 right-1.5 top-1.5"
1715
+ class="absolute top-1.5 right-1.5 left-1.5"
1728
1716
  .content="${{logoUrl:this.config.logoUrl,title:this.config.title,color:this.config.color}}"
1729
1717
  ?show-new-chat="${!this.isLiveMode&&this.messages.length>0}"
1730
1718
  ?show-close="${this.showClose}"
1731
- @mw:new-chat-click="${y(this,z,Ku)}"
1732
- @mw:close-click="${y(this,z,Xu)}">
1719
+ @mw:new-chat-click="${m(this,F,ep)}"
1720
+ @mw:close-click="${m(this,F,tp)}">
1733
1721
  </mw-chat-header>
1734
1722
 
1735
1723
  <!-- used by the dashboard to inject content -->
@@ -1737,24 +1725,21 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1737
1725
  <slot name="banner"> </slot>
1738
1726
  </div>
1739
1727
 
1728
+ <!-- drag overlay -->
1729
+ ${a(this,ce).isDragging?f`
1730
+ <div class="bg-opacity-90 absolute inset-0 z-50 flex items-center justify-center bg-white sm:rounded-[30px]">
1731
+ <div class="p-8 text-center">
1732
+ <lucide-icon name="image-plus" class="mx-auto mb-4 h-12 w-12 text-blue-500"></lucide-icon>
1733
+ <p class="mb-2 text-lg font-semibold text-black">Add images</p>
1734
+ <p class="text-opacity-80 text-sm text-black">JPEG, PNG, GIF, WebP, SVG, HEIC supported. Max size: 10MB.</p>
1735
+ </div>
1736
+ </div>
1737
+ `:null}
1738
+
1740
1739
  <!-- this structure of 2 divs is required for the browser native stick/scroll to bottom -->
1741
1740
  <div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto">
1742
- ${this.config?.showStillLearningBanner?d`
1743
- <div class="flex justify-center">
1744
- <div class="mb-2 flex max-w-[70%] select-none items-center justify-center rounded-full bg-black px-3 py-2">
1745
- <!-- (i) symbol -->
1746
- <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
1747
- <path
1748
- fill-rule="evenodd"
1749
- clip-rule="evenodd"
1750
- d="M2.25 12C2.25 6.61522 6.61522 2.25 12 2.25C17.3848 2.25 21.75 6.61522 21.75 12C21.75 17.3848 17.3848 21.75 12 21.75C6.61522 21.75 2.25 17.3848 2.25 12ZM10.9562 10.5584C12.1025 9.98533 13.3931 11.0206 13.0823 12.2639L12.3733 15.0999L12.4148 15.0792C12.7852 14.894 13.2357 15.0441 13.421 15.4146C13.6062 15.7851 13.4561 16.2356 13.0856 16.4208L13.0441 16.4416C11.8979 17.0147 10.6072 15.9794 10.9181 14.7361L11.6271 11.9001L11.5856 11.9208C11.2151 12.1061 10.7646 11.9559 10.5793 11.5854C10.3941 11.2149 10.5443 10.7644 10.9148 10.5792L10.9562 10.5584ZM12 9C12.4142 9 12.75 8.66421 12.75 8.25C12.75 7.83579 12.4142 7.5 12 7.5C11.5858 7.5 11.25 7.83579 11.25 8.25C11.25 8.66421 11.5858 9 12 9Z"
1751
- fill="white" />
1752
- </svg>
1753
-
1754
- <span class="ml-1 text-xs text-white">I'm still learning!</span>
1755
- </div>
1756
- </div>
1757
- `:d`
1741
+ ${a(this,ce).error?f`<mw-info-banner variant="error" text="${a(this,ce).error}" auto-dismissable></mw-info-banner> `:null}
1742
+ ${this.config?.showStillLearningBanner?f`<mw-info-banner variant="info" text="I'm still learning!"></mw-info-banner>`:f`
1758
1743
  <!-- this makes the chat stick to bottom when the banner is hidden -->
1759
1744
  <div class="flex p-1"></div>
1760
1745
  `}
@@ -1762,28 +1747,33 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1762
1747
  <!-- the padding at the top makes empty room at the top when scrolling and content is hidden behind header -->
1763
1748
  <!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
1764
1749
  <div class="${this.messages.length>0?"pt-20":""}">
1765
- ${$e(Array.from(r),([n])=>n,([n,i])=>d`
1766
- <div class="my-2 text-center text-xs text-gray-500">${qu(new Date(Number(n)),window.navigator.language)}</div>
1767
- ${$e(i??[],s=>s.id,(s,o)=>{let l=i[o+1]?.role===s.role,p=(o>0?i[o-1]:void 0)?.role===s.role,v=(i.length>0?i[i.length-1]:void 0)?.id===s.id;m(this,un,v&&!p&&!l?"single-current":!p&&!l?"single":!p&&l?"first":v&&p&&!l?"last-current":p&&!l?"last":p&&l?"middle":"single");let $=this.isLiveMode&&s.role==="user"&&s.id===this.lastMsg?.id?"sent":"";return d`
1768
- <div data-id="${s.id}" class="${l?"mb-[2px]":"mb-3"} mx-2 flex-row">
1769
- <mw-chat-message
1770
- .color="${this.config?.color}"
1771
- status="${$}"
1772
- logo="${s.metadata?.avatar||this.config?.logoUrl}"
1773
- side="${s.role}"
1774
- position=${a(this,un)}
1775
- @click="${y(this,z,zu)}">
1776
- <div
1777
- class="prose prose-h1:first:mt-0 prose-h2:first:mt-0 prose-h3:first:mt-0 prose-h4:first:mt-0 prose-h1:last:mb-0 prose-h2:last:mb-0 prose-h3:last:mb-0 prose-h4:last:mb-0 prose-h1:mt-5 prose-h2:mt-5 prose-h3:mt-5 prose-h4:mt-5 prose-h1:mb-2 prose-h2:mb-2 prose-h3:mb-2 prose-h4:mb-2 prose-h1:text-xl prose-h1:text-bold prose-h2:text-lg prose-h2:text-bold prose-h3:text-base prose-h3:text-bold prose-h4:text-sm prose-h4:text-bold break-words text-inherit">
1778
- ${s.content===D1?d`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config?.color}]"></mw-loading>`:s.parts?$e(s.parts,(O,C)=>C,(O,C)=>Hu(O,C,s.parts??[],{imagesByProductUrl:s.metadata?.imagesByProductUrl,linksNewTab:this.config?.linksNewTab??!0,searchParams:this.config?.disableUtmInjection?void 0:new URLSearchParams({utm_source:"molin.ai",utm_medium:"chat",utm_campaign:"general"}),messageIsStreaming:s.streaming})):d`<p>${s.content}</p>`}
1779
- </div>
1780
- </mw-chat-message>
1781
- </div>
1750
+ ${Ce(Array.from(r),([n])=>n,([n,i])=>f`
1751
+ <div class="my-2 text-center text-xs text-gray-500">${Zu(new Date(Number(n)),window.navigator.language)}</div>
1752
+ ${Ce(i??[],s=>s.id,(s,o)=>{let l=i[o+1]?.role===s.role,p=(o>0?i[o-1]:void 0)?.role===s.role,y=(i.length>0?i[i.length-1]:void 0)?.id===s.id;g(this,Sr,y&&!p&&!l?"single-current":!p&&!l?"single":!p&&l?"first":y&&p&&!l?"last-current":p&&!l?"last":p&&l?"middle":"single");let S=this.isLiveMode&&s.role==="user"&&s.id===this.lastMsg?.id?"sent":"";return f`
1753
+ ${s.images?Ce(s.images,M=>M,M=>f`
1754
+ <div data-id="${s.id}" class="${l?"mb-[1px]":"mb-3"} mx-2 flex-row">
1755
+ <mw-chat-image src="${M}" alt="User uploaded image" side="${s.role}" position=${a(this,Sr)} width="300px"></mw-chat-image>
1756
+ </div>
1757
+ `):null}
1758
+ ${s.content||s.parts?f` <div data-id="${s.id}" class="${l?"mb-[1px]":"mb-3"} mx-2 flex-row">
1759
+ <mw-chat-message
1760
+ .color="${this.config?.color}"
1761
+ status="${S}"
1762
+ logo="${s.metadata?.avatar||this.config?.logoUrl}"
1763
+ side="${s.role}"
1764
+ position=${a(this,Sr)}
1765
+ @click="${m(this,F,Ku)}">
1766
+ <div
1767
+ class="prose prose-h1:first:mt-0 prose-h2:first:mt-0 prose-h3:first:mt-0 prose-h4:first:mt-0 prose-h1:last:mb-0 prose-h2:last:mb-0 prose-h3:last:mb-0 prose-h4:last:mb-0 prose-h1:mt-5 prose-h2:mt-5 prose-h3:mt-5 prose-h4:mt-5 prose-h1:mb-2 prose-h2:mb-2 prose-h3:mb-2 prose-h4:mb-2 prose-h1:text-xl prose-h1:text-bold prose-h2:text-lg prose-h2:text-bold prose-h3:text-base prose-h3:text-bold prose-h4:text-sm prose-h4:text-bold break-words text-inherit">
1768
+ ${s.content===g1?f`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config?.color}]"></mw-loading>`:s.parts?Ce(s.parts,(M,C)=>C,(M,C)=>Wu(M,C,s.parts??[],{imagesByProductUrl:s.metadata?.imagesByProductUrl,linksNewTab:this.config?.linksNewTab??!0,searchParams:this.config?.disableUtmInjection?void 0:new URLSearchParams({utm_source:"molin.ai",utm_medium:"chat",utm_campaign:"general"}),messageIsStreaming:s.streaming})):f`<p>${s.content}</p>`}
1769
+ </div>
1770
+ </mw-chat-message>
1771
+ </div>`:null}
1782
1772
  `})}
1783
1773
  `)}
1784
1774
 
1785
1775
  <!-- show typing indicator if the non-user side is typing -->
1786
- ${["assistant","support"].includes(this.typingIndicator?.role??"")&&this.typingIndicator?.role?d`
1776
+ ${["assistant","support"].includes(this.typingIndicator?.role??"")&&this.typingIndicator?.role?f`
1787
1777
  <mw-chat-message class="mx-2 mb-3 block" color="${this.config?.color}" logo="${this.typingIndicator?.metadata?.avatar||this.config?.logoUrl}" side="${this.typingIndicator.role}">
1788
1778
  <div
1789
1779
  class="prose prose-h1:first:mt-0 prose-h2:first:mt-0 prose-h3:first:mt-0 prose-h4:first:mt-0 prose-h1:last:mb-0 prose-h2:last:mb-0 prose-h3:last:mb-0 prose-h4:last:mb-0 prose-h1:mt-5 prose-h2:mt-5 prose-h3:mt-5 prose-h4:mt-5 prose-h1:mb-2 prose-h2:mb-2 prose-h3:mb-2 prose-h4:mb-2 prose-h1:text-xl prose-h1:text-bold prose-h2:text-lg prose-h2:text-bold prose-h3:text-base prose-h3:text-bold prose-h4:text-sm prose-h4:text-bold break-words text-inherit">
@@ -1797,21 +1787,37 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1797
1787
  class="flex-grow"
1798
1788
  .examples="${this.messages.length>0?[]:this.config.examples}"
1799
1789
  color="${this.config.color}"
1800
- @mw:example-click="${y(this,z,Wu)}"></mw-chat-background>
1790
+ @mw:example-click="${m(this,F,Ju)}"></mw-chat-background>
1801
1791
  </div>
1802
1792
 
1803
1793
  <div class="m-1.5 flex-shrink-0 flex-grow-0 space-y-2 rounded-3xl bg-[#eeedf1] p-1.5">
1794
+ ${this.config.disclaimer&&!this.config.removePoweredBy?f`
1795
+ <!-- spacing between input box and disclaimer or bottom -->
1796
+ <div class="mb-1.5">
1797
+ <mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}"></mw-disclaimer>
1798
+ </div>
1799
+ `:null}
1800
+
1804
1801
  <mw-chat-input
1805
- @mw:change="${y(this,z,Gu)}"
1806
- @mw:submit="${y(this,z,Zu)}"
1807
- @mw:cancel="${y(this,z,Ju)}"
1802
+ @mw:change="${m(this,F,Yu)}"
1803
+ @mw:submit="${m(this,F,Xu)}"
1804
+ @mw:cancel="${m(this,F,Qu)}"
1808
1805
  placeholder="${this.config.input?.placeholder}"
1809
- ?disabled="${this.ranOutOfCredits||this.hasQueuedMessages}"
1806
+ ?disabled="${this.ranOutOfCredits||this.hasQueuedMessages||a(this,ce).hasPendingImages}"
1810
1807
  ?streaming="${this.isStreaming??!0}"
1811
- ?loading="${this.hasQueuedMessages}">
1808
+ ?loading="${this.hasQueuedMessages||a(this,ce).hasPendingImages}"
1809
+ color="${this.config.color}"
1810
+ .onImageUploadClick="${a(this,ce).openImagePicker}"
1811
+ .images="${a(this,ce).selectedImages}"
1812
+ .onImageDelete="${a(this,ce).onImageDelete}">
1812
1813
  </mw-chat-input>
1813
1814
 
1814
- ${this.config.removePoweredBy?null:d`
1815
+ ${this.config.removePoweredBy?this.config.disclaimer?f`
1816
+ <!-- spacing between input box and disclaimer or bottom -->
1817
+ <div class="mt-1.5">
1818
+ <mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}"></mw-disclaimer>
1819
+ </div>
1820
+ `:null:f`
1815
1821
  <!-- spacing between input box and powered-by or bottom -->
1816
1822
  <div class="h-4">
1817
1823
  <mw-powered-by></mw-powered-by>
@@ -1820,13 +1826,123 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1820
1826
  </div>
1821
1827
  </div>
1822
1828
  </div>
1823
- `}reloadConfig(){a(this,L).value?.reloadConfig(),this.requestUpdate()}async sendMessage(r){if(wt(a(this,L).value,"widget context is required"),!r||typeof r!="string")return console.warn("sendMessage requires a valid string message"),!1;let n=await a(this,L).value.enqueueUserInput(r,{xUserData:a(this,L).value?.xUserData,xCustomInstructions:a(this,L).value?.xCustomInstructions,role:"user",expectStreaming:!0});return n&&a(this,z,on)?.setValue(""),n??!1}setInputValue(r){if(!r||typeof r!="string"){console.warn("setInputValue requires a valid string value");return}let n=a(this,z,on);if(!n){console.warn("input element not found, cannot set value");return}n.setValue?n.setValue(r):console.warn("input element does not have setValue method")}reset(){a(this,L).value?.reset()}};L=new WeakMap,ln=new WeakMap,un=new WeakMap,z=new WeakSet,zu=function(r){let i=r.composedPath().find(s=>s instanceof HTMLAnchorElement);if(i){if(r.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}let o=this.config?.linksNewTab?"_blank":"_self";window.open(i.href,i.target||o)}},Wu=function(r){wt(a(this,L).value,"widget context is required"),r.preventDefault();let n=r.detail.example;a(this,L).value.enqueueUserInput(n,{xUserData:a(this,L).value?.xUserData,xCustomInstructions:a(this,L).value?.xCustomInstructions}).then(i=>{i&&(a(this,z,on)?.setValue(""),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:n,example:!0,conversationId:this.conversationId}))}).catch(console.warn)},Zu=function(r){wt(a(this,L).value,"widget context is required"),r.preventDefault();let n=r.detail;a(this,L).value.enqueueUserInput(n,{xUserData:a(this,L).value?.xUserData,xCustomInstructions:a(this,L).value?.xCustomInstructions}).then(i=>{i&&(a(this,z,on)?.setValue(""),a(this,ln).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:n,example:!1,conversationId:this.conversationId}))}).catch(console.warn)},Gu=function(r){a(this,ln).onInput(r.detail.full)},Ju=function(){wt(a(this,L).value,"widget context is required"),a(this,L).value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},Ku=function(){wt(a(this,L).value,"widget context is required"),a(this,L).value.reset()},Xu=function(){this.dispatchEvent(new Ti.CloseClickEvent)},P1=function(){return this.renderRoot.querySelector("#scrollable-content")},on=function(){return this.renderRoot.querySelector("mw-chat-input")},g(Ti,"properties",{showClose:{type:Boolean,attribute:"show-close"}});var an=Ti,Io;an.CloseClickEvent=(Io=class extends CustomEvent{constructor(t={}){super(an.CloseClickEvent.type,{...t})}},g(Io,"type","mw:close-click"),Io);customElements.get("mw-chat")||customElements.define("mw-chat",an);var ar,Yu,Qu,or=class or extends A(_){constructor(){super();f(this,ar);g(this,"render",()=>d`
1824
- <div class="popup-desktop group relative w-[300px] cursor-pointer select-none rounded-[17px] shadow-2xl">
1829
+ `}reloadConfig(){a(this,L).value?.reloadConfig(),this.requestUpdate()}async sendMessage(r){if(Ne(a(this,L).value,"widget context is required"),!r||typeof r!="string")return console.warn("sendMessage requires a valid string message"),!1;let n=await a(this,L).value.enqueueUserInput(r,{xUserData:a(this,L).value?.xUserData,xCustomInstructions:a(this,L).value?.xCustomInstructions,role:"user",expectStreaming:!0});return n&&a(this,F,Lt)?.setValue(""),n??!1}setInputValue(r){if(!r||typeof r!="string"){console.warn("setInputValue requires a valid string value");return}let n=a(this,F,Lt);if(!n){console.warn("input element not found, cannot set value");return}n.setValue?n.setValue(r):console.warn("input element does not have setValue method")}focusInput(){window.requestAnimationFrame(()=>{a(this,F,Lt)?.focus()})}reset(){a(this,L).value?.reset()}};L=new WeakMap,In=new WeakMap,ce=new WeakMap,Sr=new WeakMap,fs=new WeakMap,F=new WeakSet,Ku=function(r){let i=r.composedPath().find(s=>s instanceof HTMLAnchorElement);if(i){if(r.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}let o=this.config?.linksNewTab?"_blank":"_self";window.open(i.href,i.target||o)}},Ju=function(r){Ne(a(this,L).value,"widget context is required"),r.preventDefault();let n=r.detail.example;a(this,L).value.enqueueUserInput(n,{xUserData:a(this,L).value?.xUserData,xCustomInstructions:a(this,L).value?.xCustomInstructions}).then(i=>{i&&(a(this,F,Lt)?.setValue(""),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:n,example:!0,conversationId:this.conversationId}))}).catch(console.warn)},Xu=function(r){if(Ne(a(this,L).value,"widget context is required"),r.preventDefault(),a(this,ce).hasPendingImages)return;let n=r.detail;a(this,L).value.enqueueUserInput(n,{xUserData:a(this,L).value?.xUserData,xCustomInstructions:a(this,L).value?.xCustomInstructions}).then(i=>{i&&(a(this,F,Lt)?.setValue(""),a(this,ce).clearImages(),a(this,In).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:n,example:!1,conversationId:this.conversationId}))}).catch(console.warn)},Yu=function(r){a(this,In).onInput(r.detail.full)},Qu=function(){Ne(a(this,L).value,"widget context is required"),a(this,L).value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},ep=function(){Ne(a(this,L).value,"widget context is required"),a(this,L).value.reset()},tp=function(){this.dispatchEvent(new ms.CloseClickEvent)},w1=function(){return this.renderRoot.querySelector("#scrollable-content")},Lt=function(){return this.renderRoot.querySelector("mw-chat-input")},w(ms,"properties",{showClose:{type:Boolean,attribute:"show-close"}});var Mn=ms,ka;Mn.CloseClickEvent=(ka=class extends CustomEvent{constructor(e={}){super(Mn.CloseClickEvent.type,{...e})}},w(ka,"type","mw:close-click"),ka);customElements.get("mw-chat")||customElements.define("mw-chat",Mn);function rp(t){t?.body?.cancel().catch(console.warn)}var ue,qe,ws,Tn,Er,Ca=class{constructor(){d(this,ue,[]);d(this,qe);d(this,ws,10);d(this,Tn,5e3);d(this,Er,!1)}async add(e,r){if(a(this,ue).push(sp(e,r)),a(this,ue).length>=a(this,ws))return this.flush();a(this,qe)||g(this,qe,setTimeout(()=>{this.flush().catch(console.error)},a(this,Tn)))}async flush(){if(a(this,Er)||a(this,ue).length===0)return;let e=[...a(this,ue)];try{g(this,Er,!0),clearTimeout(a(this,qe)),g(this,qe,void 0),g(this,ue,[]);let r=new AbortController,n=setTimeout(()=>r.abort(),5e3);await ip(e,{signal:r.signal}),clearTimeout(n)}catch(r){if(r.name==="AbortError")console.error("Request timed out, retrying events"),g(this,ue,[...e,...a(this,ue)]);else{console.error("Failed to send events to backend:",r);let n=e.filter(i=>i.event.includes("error"));g(this,ue,[...n,...a(this,ue)])}}finally{g(this,Er,!1),a(this,ue).length>0&&!a(this,qe)&&g(this,qe,setTimeout(()=>{this.flush().catch(console.error)},a(this,Tn)))}}async flushBeforeUnload(){if(a(this,ue).length>0)try{let e=new FormData;e.set("events",JSON.stringify(a(this,ue))),navigator.sendBeacon(new URL("/widgets/data/collect",op()).href,e)}catch(e){console.error("Failed to send final events:",e)}}};ue=new WeakMap,qe=new WeakMap,ws=new WeakMap,Tn=new WeakMap,Er=new WeakMap;var np=new Ca;window.addEventListener("beforeunload",()=>{np.flushBeforeUnload().catch(console.error)});async function q(t,e,r){if(typeof t!="string")throw new TypeError("Event name must be a string");if(typeof e!="object"||e===null)throw new TypeError("Properties must be an object");try{if(t==="ShopAssistant: user clicked link"&&b1("molin_link_click",e),r?.immediate){await ip([sp(t,e)]);return}else return np.add(t,e)}catch(n){console.error("Failed to send event:",n)}}async function ip(t,{signal:e}={}){let r=new FormData;r.set("events",JSON.stringify(t));let n=await fetch(new URL("/widgets/data/collect",op()),{method:"POST",body:r,signal:e});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);rp(n)}function sp(t,e){return{event:t,widget_id:e.widgetId,properties:Object.assign({},e,v1()),distinct_id:y1(),timestamp:new Date().toISOString()}}function y1(){try{let t=ye.molin_shop_assistant_distinct_id;return t||(t=crypto.randomUUID(),ye.molin_shop_assistant_distinct_id=t),t}catch(t){console.error("Failed to deserialize distinct_id:",t);let e=crypto.randomUUID();try{ye.molin_shop_assistant_distinct_id=e}catch(r){console.error("Failed to store new distinct_id:",r)}return e}}function v1(){return{referrer:document.referrer,userAgent:navigator.userAgent,language:navigator.language,screenWidth:window.innerWidth,screenHeight:window.innerHeight,timestamp:new Date().toISOString(),timezoneOffset:new Date().getTimezoneOffset(),doNotTrack:navigator.doNotTrack??void 0}}function op(){let t=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8787","molin.localhost":"http://molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://molin.ai","molin.foo":"https://molin.foo"}[t]||"https://molin.ai"}function b1(t,e){try{window.dataLayer=window.dataLayer||[];let r={event:t,link_url:e.url};window.dataLayer.push(r)}catch(r){console.error("Failed to send event to dataLayer:",r)}}function st(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}var ys,jn,vs,We,lp,On,Ln=class Ln extends A(E){constructor(){super();d(this,We);d(this,ys,new ot(this,{onError:console.error}));d(this,jn);d(this,vs,{onError:r=>{alert(r.error),console.error(r.widgetId,r.error),q("ShopAssistant: error",{...r},{immediate:!0})},onNewMessageStartedStreaming:r=>{q("ShopAssistant: user received bot message (streaming started)",r)},onMessageEndedStreaming:r=>{q("ShopAssistant: user received bot message (streaming ended)",r)},onUserCanceledStreaming:r=>{q("ShopAssistant: user canceled streaming",r)},onUserClickedLink:r=>{q("ShopAssistant: user clicked link",r)},onUserSentInput:r=>{q("ShopAssistant: user sent input",r)}});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData=st()?.userData,this.xCustomInstructions=st()?.customInstructions}get config(){return a(this,jn)||a(this,ys).data}render(){return this.config?f`
1830
+ <mw-context-widget .widgetId="${this.widgetId}" .config="${this.config}" .callbacks="${a(this,vs)}" .xUserData="${this.xUserData}" .xCustomInstructions="${this.xCustomInstructions}">
1831
+ <!-- embed our chat component forwarding props -->
1832
+ <mw-chat ?show-close="${this.showClose}" @mw:close-click="${m(this,We,lp)}">
1833
+ <slot name="banner" slot="banner"></slot>
1834
+ </mw-chat>
1835
+ </mw-context-widget>
1836
+ `:null}injectConfig(r){g(this,jn,r),this.requestUpdate()}reloadConfig(){a(this,We,On)?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",a(this,We,On)?.reset(),this.requestUpdate()}get conversationId(){return a(this,We,On)?.conversationId??""}get messages(){return a(this,We,On)?.messages??[]}};ys=new WeakMap,jn=new WeakMap,vs=new WeakMap,We=new WeakSet,lp=function(){this.dispatchEvent(new Ln.CloseClickEvent)},On=function(){return this.renderRoot.querySelector("mw-chat")},w(Ln,"styles",ae`
1837
+ :host {
1838
+ all: initial; /* reset all properties that can pierce the shadow DOM */
1839
+ }
1840
+ `),w(Ln,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1}});var jt=Ln;customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",jt);var Sa;jt.CloseClickEvent=(Sa=class extends CustomEvent{constructor(e={}){super(jt.CloseClickEvent.type,{...e})}},w(Sa,"type","mw:close-click"),Sa);var Ea=class{constructor({hidden:e=!1}){w(this,"hidden");this.hidden=e}setUserData(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data")}setCustomInstructions(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions")}showLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof Te&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof Te&&e.hideLauncher()}openChat(e){let{message:r,autoSend:n}=e||{};for(let i of document.querySelectorAll("molin-shop-ai"))i instanceof Te&&i.openChat({message:r,autoSend:n})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof Te&&e.closeChat()}reset(){ye.resetWidgetData();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof Te&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof jt&&e.reset()}};function cp({hidden:t}){let e=new Ea({hidden:t});return window.Molin=e,e}function bs(){let t=window.Molin;if(!t)throw new Error("window.Molin global not initialized");return t}window.__INIT_MOLIN_SHOP_AI=function(e){x1(e);let r=st(),n=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(cp({hidden:n}),e.auto){let i=document.createElement("molin-shop-ai");i.setAttribute("cdn",e.cdn),i.setAttribute("widget",e.widgetId),document.body.appendChild(i)}};function x1(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function up(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Ee,Dn,$r,_r,ot=class{constructor(e,r){d(this,Ee);d(this,Dn);d(this,$r);d(this,_r);g(this,Ee,e),g(this,Dn,r),e.addController(this)}get data(){return a(this,_r)||a(this,$r)?.data}hostConnected(){if(a(this,$r)||a(this,_r))return;let e=up();e&&e.widgetId===a(this,Ee).widgetId?g(this,_r,e.config):g(this,$r,new Pi(a(this,Ee),()=>{if(a(this,Ee).cdn&&a(this,Ee).widgetId)return`${a(this,Ee).cdn}/config?w=${a(this,Ee).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:async r=>{let n=await r.json();return n&&!e&&window.__INIT_MOLIN_SHOP_AI({cdn:a(this,Ee).cdn,widgetId:a(this,Ee).widgetId,config:n}),n},onError:a(this,Dn)?.onError}))}};Ee=new WeakMap,Dn=new WeakMap,$r=new WeakMap,_r=new WeakMap;function pp(){let t=new URL(import.meta.url).hostname;return{localhost:"http://uploads.molin.localhost:8787","molin.localhost":"http://uploads.molin.localhost:8787","widget.molin.foo":"https://uploads.molin.foo","widget.molin.ai":"https://uploads.molin.ai","molin.ai":"https://uploads.molin.ai","molin.foo":"https://uploads.molin.foo"}[t]||"https://uploads.molin.ai"}var Ue=Object.freeze({PENDING:"pending",READY:"ready",ERROR:"error"}),V,J,oe,Ar,Mr,pe,P,dp,ks,Un,Rn,Bn,Vn,fp,xs,at,Pn,$a,mp,gp,wp,gs=class{constructor(e,r={}){d(this,P);d(this,V);d(this,J);d(this,oe,null);d(this,Ar,!1);d(this,Mr,null);d(this,pe,[]);d(this,ks,e=>{let r=e.target,n=Array.from(r.files||[]);m(this,P,$a).call(this,n),r.value=""});d(this,Un,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")});d(this,Rn,e=>{e.preventDefault(),e.dataTransfer&&m(this,P,fp).call(this,e.dataTransfer)&&m(this,P,xs).call(this,!0)});d(this,Bn,e=>{e.preventDefault();let r=e.relatedTarget;a(this,V).contains(r)||m(this,P,xs).call(this,!1)});d(this,Vn,e=>{if(e.preventDefault(),m(this,P,xs).call(this,!1),e.dataTransfer){let r=Array.from(e.dataTransfer.files||[]);m(this,P,$a).call(this,r)}});w(this,"openImagePicker",()=>{a(this,oe)&&a(this,oe).click()});w(this,"onImageDelete",e=>{g(this,pe,a(this,pe).filter(r=>r.id!==e)),m(this,P,Pn).call(this),a(this,V).requestUpdate(),a(this,J).onImageDelete&&a(this,J).onImageDelete(e)});g(this,V,e),g(this,J,{acceptedTypes:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/heic"],maxFileSize:10*1024*1024,maxFiles:3,onError:()=>{},uploadUrl:new URL("/v1/uploads",pp()).href,...r}),e.addController(this),m(this,P,dp).call(this)}hostConnected(){a(this,V).addEventListener("dragover",a(this,Un)),a(this,V).addEventListener("dragenter",a(this,Rn)),a(this,V).addEventListener("dragleave",a(this,Bn)),a(this,V).addEventListener("drop",a(this,Vn))}hostDisconnected(){a(this,V).removeEventListener("dragover",a(this,Un)),a(this,V).removeEventListener("dragenter",a(this,Rn)),a(this,V).removeEventListener("dragleave",a(this,Bn)),a(this,V).removeEventListener("drop",a(this,Vn)),a(this,oe)&&a(this,oe).parentNode&&a(this,oe).parentNode.removeChild(a(this,oe))}get isDragging(){return a(this,Ar)}get error(){return a(this,Mr)}get selectedImages(){return a(this,pe)}get hasPendingImages(){return a(this,pe).some(e=>e.processingState===Ue.PENDING)}clearError(){m(this,P,Pn).call(this)}updateUploadOptions(e){e.conversationId!==void 0&&(a(this,J).conversationId=e.conversationId),e.widgetId!==void 0&&(a(this,J).widgetId=e.widgetId)}restoreImages(e){if(!Array.isArray(e)||e.length===0){g(this,pe,[]),a(this,V).requestUpdate();return}let r=e.map(n=>{let i=new File([],n.name,{type:n.type});return{id:n.id,name:n.name,type:n.type,size:n.size,dataUrl:n.url,file:i,uploadProgress:100,processingState:Ue.READY,imageUrl:n.url}});g(this,pe,r),a(this,V).requestUpdate()}clearImages(){g(this,pe,[]),this.clearError(),a(this,V).requestUpdate()}};V=new WeakMap,J=new WeakMap,oe=new WeakMap,Ar=new WeakMap,Mr=new WeakMap,pe=new WeakMap,P=new WeakSet,dp=function(){g(this,oe,document.createElement("input")),a(this,oe).type="file",a(this,oe).accept=a(this,J).acceptedTypes.join(","),a(this,oe).multiple=a(this,J).maxFiles>1,a(this,oe).style.display="none",a(this,oe).addEventListener("change",a(this,ks)),document.body.appendChild(a(this,oe))},ks=new WeakMap,Un=new WeakMap,Rn=new WeakMap,Bn=new WeakMap,Vn=new WeakMap,fp=function(e){return e.types&&e.types.includes("Files")},xs=function(e){a(this,Ar)!==e&&(g(this,Ar,e),a(this,V).requestUpdate())},at=function(e){g(this,Mr,e),a(this,J).onError(e),a(this,V).requestUpdate(),setTimeout(()=>{m(this,P,Pn).call(this)},6e3)},Pn=function(){g(this,Mr,null),a(this,V).requestUpdate()},$a=async function(e){if(e.length===0)return;m(this,P,Pn).call(this);let r=e.filter(o=>m(this,P,mp).call(this,o));if(r.length===0)return;let n=a(this,pe).length,i=a(this,J).maxFiles??1/0,s=r.length;if(n+s>i){m(this,P,at).call(this,`You can upload a maximum of ${i} files`);return}try{let u=(await Promise.all(r.map(l=>m(this,P,gp).call(this,l)))).filter(l=>!a(this,pe).some(c=>c.dataUrl===l.dataUrl));g(this,pe,[...a(this,pe),...u]),await oo(3,u,async l=>{await m(this,P,wp).call(this,l)}),a(this,V).requestUpdate()}catch(o){let u=o instanceof Error?o:new Error(String(o));m(this,P,at).call(this,"Upload failed")}},mp=function(e){return a(this,J).acceptedTypes.includes(e.type)?e.size>a(this,J).maxFileSize?(m(this,P,at).call(this,`Max file size: ${a(this,J).maxFileSize/(1024*1024)}MB`),!1):!0:(m(this,P,at).call(this,"Invalid file type"),!1)},gp=async function(e){try{let r=await(0,hp.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:r,file:e,uploadProgress:0,processingState:Ue.PENDING}}catch(r){let n=r instanceof Error?r:new Error(String(r));throw new Error(`Failed to read file: ${e.name} - ${n.message}`)}},wp=async function(e){if(!e){console.error("No image provided to upload"),m(this,P,at).call(this,"No image provided");return}if(!a(this,J)?.uploadUrl){console.error("Missing uploadUrl in options"),m(this,P,at).call(this,"Upload URL not configured");return}e.processingState=Ue.PENDING,e.uploadProgress=0,a(this,V).requestUpdate();let r=new FormData;r.append("dataUrl",e.dataUrl),r.append("filename",e.name),r.append("fileType",e.type),r.append("fileSize",String(e.size)),a(this,J).conversationId&&r.append("conversationId",a(this,J).conversationId),a(this,J).widgetId&&r.append("widgetId",a(this,J).widgetId);let n=new XMLHttpRequest,i=(s,o)=>{o&&console.error(o),m(this,P,at).call(this,s),e.processingState=Ue.ERROR,e.uploadProgress=0,a(this,V).requestUpdate()};n.upload.addEventListener("progress",s=>{if(!s.lengthComputable)return;let o=Math.round(s.loaded/s.total*100),u=a(this,pe).find(l=>l.id===e.id);u&&(u.uploadProgress=Math.min(o,95),a(this,V).requestUpdate())}),n.addEventListener("load",()=>{if(n.status<200||n.status>=300){i("Upload failed",`Upload failed with status: ${n.status}`);return}let s;try{s=JSON.parse(n.responseText)}catch(u){i("Upload failed",`Upload response parsing error: ${u instanceof Error?u.message:String(u)}`);return}if(!!!s?.success){let u=s?.error||"Upload failed";i(u,`Server reported failure: ${u}`);return}e.uploadProgress=100,s.imageUrl&&s.imageId?(e.imageUrl=s.imageUrl,e.id=s.imageId,e.processingState=Ue.READY):e.processingState=Ue.PENDING,a(this,V).requestUpdate()}),n.addEventListener("error",()=>{i("Network error while uploading","Upload network error")}),n.addEventListener("timeout",()=>{i("Upload timed out","Upload timeout")});try{n.open("POST",a(this,J).uploadUrl),n.send(r)}catch(s){i("Unable to initiate upload",`Upload setup error: ${s instanceof Error?s.message:String(s)}`)}};var _a={maxHeight:120,initialHeight:32,paddingY:12},Nn,Y,Ir,yp,vp,bp,xp,Cs,Dt=class Dt extends A(E){constructor(){super();d(this,Y);d(this,Nn,new Date);this.disabled=!1,this.streaming=!1,this.loading=!1,this.placeholder="Type a message...",this.onImageUploadClick=void 0,this.images=[],this.onImageDelete=void 0,this.color="#8B5CF6"}get value(){return a(this,Y,Ir)?.value?.trim()??""}render(){return f`
1841
+ <div
1842
+ class="focus-within:ring-opacity-50 ${this.images.length>0?`ring-2 ring-[${this.color}] ring-opacity-50`:""} w-full overflow-hidden rounded-[18px] bg-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)] transition-all duration-200 focus-within:ring-2 focus-within:ring-[${this.color}]">
1843
+ <!-- Image preview area -->
1844
+ ${this.images&&this.images.length>0?f`
1845
+ <div class="mb-2 flex flex-wrap gap-2 rounded-t-[18px] bg-white p-2">
1846
+ ${this.images.map(r=>f`
1847
+ <div class="relative inline-block">
1848
+ <img src="${r.dataUrl}" alt="${r.name}" class="h-[60px] w-[60px] rounded-xl object-cover" />
1849
+
1850
+ <!-- Progress/Status overlay -->
1851
+ ${r.processingState===Ue.PENDING?f`
1852
+ <div class="absolute inset-0 flex items-center justify-center rounded-xl bg-black/40">
1853
+ ${r.uploadProgress<100?f`
1854
+ <!-- Upload progress circle -->
1855
+ <div class="relative h-8 w-8">
1856
+ <svg class="h-8 w-8 -rotate-90 transform" viewBox="0 0 32 32">
1857
+ <circle cx="16" cy="16" r="14" stroke="white" stroke-width="2" fill="none" opacity="0.3" />
1858
+ <circle
1859
+ cx="16"
1860
+ cy="16"
1861
+ r="14"
1862
+ stroke="white"
1863
+ stroke-width="2"
1864
+ fill="none"
1865
+ stroke-dasharray="87.96"
1866
+ stroke-dashoffset="${87.96*(1-r.uploadProgress/100)}"
1867
+ class="transition-all duration-300" />
1868
+ </svg>
1869
+ </div>
1870
+ `:f`
1871
+ <!-- Processing spinner -->
1872
+ <div class="relative h-8 w-8">
1873
+ <svg class="h-8 w-8 animate-spin" viewBox="0 0 24 24">
1874
+ <circle class="opacity-25" cx="12" cy="12" r="10" stroke="white" stroke-width="4" fill="none"></circle>
1875
+ <path
1876
+ class="opacity-75"
1877
+ fill="white"
1878
+ d="m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
1879
+ </svg>
1880
+ </div>
1881
+ `}
1882
+ </div>
1883
+ `:r.processingState===Ue.ERROR?f`
1884
+ <div class="absolute inset-0 flex items-center justify-center rounded-xl bg-red-500/60">
1885
+ <lucide-icon name="alert-circle" class="h-6 w-6 text-white"></lucide-icon>
1886
+ </div>
1887
+ `:null}
1888
+
1889
+ <!-- Delete button -->
1890
+ <button
1891
+ data-testid="image-delete-btn"
1892
+ type="button"
1893
+ @click="${()=>this.onImageDelete?.(r.id)}"
1894
+ class="absolute -top-1 -right-1 flex h-5 w-5 items-center justify-center rounded-full bg-[#eeedf1] text-white hover:bg-[#eeedf195]">
1895
+ <lucide-icon name="x" class="h-3 w-3 text-[#14161a]"></lucide-icon>
1896
+ </button>
1897
+ </div>
1898
+ `)}
1899
+ </div>
1900
+ `:null}
1901
+
1902
+ <!-- Input form -->
1903
+ <form @submit="${m(this,Y,bp)}" class="flex w-full items-center">
1904
+ <button
1905
+ data-testid="image-upload-btn"
1906
+ type="button"
1907
+ @click="${this.onImageUploadClick}"
1908
+ ?disabled="${this.disabled||this.loading}"
1909
+ class="mx-1 px-2 transition-opacity duration-200 hover:opacity-80">
1910
+ <lucide-icon name="image-plus" class="block h-6 w-6 text-[#312E30]"></lucide-icon>
1911
+ </button>
1912
+
1913
+ <textarea
1914
+ data-testid="mw-chat-input-textarea"
1915
+ name="input"
1916
+ @input="${m(this,Y,xp)}"
1917
+ @keydown="${m(this,Y,vp)}"
1918
+ autofocus
1919
+ ?disabled="${this.disabled}"
1920
+ placeholder="${this.placeholder}"
1921
+ class="box-content h-[${_a.initialHeight}px] w-full resize-none place-content-center rounded bg-white px-1 py-[${_a.paddingY}px] text-base text-gray-800 outline-none placeholder:text-[14px] placeholder:font-light disabled:place-content-baseline"></textarea>
1922
+
1923
+ <button
1924
+ type="submit"
1925
+ data-testid="mw-chat-input-submit-btn"
1926
+ ?disabled="${this.disabled||this.loading}"
1927
+ class="mx-1 rounded-full px-2 transition-all duration-150 ease-out disabled:cursor-not-allowed disabled:opacity-50">
1928
+ <div
1929
+ class="${this.streaming||this.loading||!this.value&&this.images.length===0?"bg-gray-400":""} ${this.streaming||this.loading?"scale-100":"scale-95"} flex h-8 w-8 flex-row items-center justify-center rounded-full bg-[${this.color}] p-1.5 transition-all transition-colors duration-200">
1930
+ ${this.loading?f`<lucide-icon name="loader-circle" class="inline-flex animate-spin text-white transition-all"></lucide-icon>`:this.streaming?f`<lucide-icon name="x" class="inline-flex h-4 w-4 text-white transition-colors"></lucide-icon>`:f`<lucide-icon name="arrow-up" class="inline-flex h-4 w-4 text-white transition-colors"></lucide-icon>`}
1931
+ </div>
1932
+ </button>
1933
+ </form>
1934
+ </div>
1935
+
1936
+ <slot>
1937
+ <div class="h-5 w-full"></div>
1938
+ </slot>
1939
+ `}setValue(r){let n=a(this,Y,Ir);if(!n){console.warn("input element not found, cannot set value");return}n.value=r,m(this,Y,Cs).call(this),this.dispatchEvent(new Dt.ChangeEvent({delta:null,full:r}))}focus(){a(this,Y,Ir)?.focus()}};Nn=new WeakMap,Y=new WeakSet,Ir=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},yp=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},vp=function(r){k1(r)&&(r.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&a(this,Y,yp)?.click())},bp=function(r){r.preventDefault();let n=new Date;if(n.getTime()-a(this,Nn).getTime()<500)return;if(g(this,Nn,n),this.streaming){this.dispatchEvent(new Dt.CancelEvent);return}let s=a(this,Y,Ir);if(!s)throw new Error("Expected input element to be present");let o=s.value.trim();(o||this.images.length>0)&&this.dispatchEvent(new Dt.SubmitEvent(o))&&(s.value=""),m(this,Y,Cs).call(this)},xp=function(r){this.dispatchEvent(new Dt.ChangeEvent({delta:r.data,full:r.target instanceof HTMLTextAreaElement?r.target.value:""})),m(this,Y,Cs).call(this)},Cs=function(){let r=a(this,Y,Ir);if(!r)return;let{maxHeight:n,initialHeight:i,paddingY:s}=_a;r.style.height=`${i}px`;let o=r.scrollHeight,u=s*2,l=Math.min(o-u,n);r.style.height=`${l}px`,this.requestUpdate()},w(Dt,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String},color:{type:String},onImageUploadClick:{type:Function},images:{type:Array},onImageDelete:{type:Function}});var Ge=Dt,Aa;Ge.ChangeEvent=(Aa=class extends CustomEvent{constructor(e,r={}){super(Ge.ChangeEvent.type,{detail:e,...r})}},w(Aa,"type","mw:change"),Aa);var Ma;Ge.SubmitEvent=(Ma=class extends CustomEvent{constructor(e,r={}){super(Ge.SubmitEvent.type,{detail:e,...r,cancelable:!0})}},w(Ma,"type","mw:submit"),Ma);var Ia;Ge.CancelEvent=(Ia=class extends CustomEvent{constructor(e={}){super(Ge.CancelEvent.type,{...e})}},w(Ia,"type","mw:cancel"),Ia);function k1(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",Ge);var Or,kp,Cp,Tr=class Tr extends A(E){constructor(){super();d(this,Or);w(this,"render",()=>f`
1940
+ <div class="popup-desktop group relative w-[300px] cursor-pointer rounded-[17px] shadow-2xl select-none">
1825
1941
  <mw-spinning-border .color="${this.color}" .border="${"transparent"}" .radius="${"17px"}">
1826
1942
  <!-- wrapper -->
1827
1943
  <div class="relative z-[2147483647] m-[1px] w-[300px] rounded-2xl bg-white font-sans text-base leading-normal">
1828
1944
  <!-- content -->
1829
- <div class="p-4 text-left text-gray-800" @click="${y(this,ar,Qu)}">
1945
+ <div class="p-4 text-left text-gray-800" @click="${m(this,Or,Cp)}">
1830
1946
  <p>${this.text}</p>
1831
1947
  </div>
1832
1948
  </div>
@@ -1834,13 +1950,13 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1834
1950
 
1835
1951
  <!-- close button -->
1836
1952
  <button
1837
- class="absolute -top-8 right-0 inline-flex h-6 w-6 items-center justify-center rounded-full bg-gray-300 bg-opacity-50 pb-[2px] text-center text-gray-700 opacity-0 shadow transition-opacity duration-300 ease-in-out group-hover:opacity-100"
1838
- @click="${y(this,ar,Yu)}"
1953
+ class="bg-opacity-50 absolute -top-8 right-0 inline-flex h-6 w-6 items-center justify-center rounded-full bg-gray-300 pb-[2px] text-center text-gray-700 opacity-0 shadow transition-opacity duration-300 ease-in-out group-hover:opacity-100"
1954
+ @click="${m(this,Or,kp)}"
1839
1955
  aria-label="Close">
1840
1956
  ×
1841
1957
  </button>
1842
1958
  </div>
1843
- `);this.text="Hello there. How can we help?",this.color="#601feb"}};ar=new WeakSet,Yu=function(){this.dispatchEvent(new or.CloseEvent)},Qu=function(){this.dispatchEvent(new or.ClickEvent)},g(or,"properties",{text:{type:String},color:{type:String}}),g(or,"styles",ie`
1959
+ `);this.text="Hello there. How can we help?",this.color="#601feb"}};Or=new WeakSet,kp=function(){this.dispatchEvent(new Tr.CloseEvent)},Cp=function(){this.dispatchEvent(new Tr.ClickEvent)},w(Tr,"properties",{text:{type:String},color:{type:String}}),w(Tr,"styles",ae`
1844
1960
  .popup-desktop:hover button {
1845
1961
  transition-delay: 0s !important;
1846
1962
  }
@@ -1848,23 +1964,23 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1848
1964
  .popup-desktop button {
1849
1965
  transition-delay: 1s;
1850
1966
  }
1851
- `);var vt=or,Oo;vt.CloseEvent=(Oo=class extends CustomEvent{constructor(t={}){super(vt.CloseEvent.type,{...t})}},g(Oo,"type","mw:close"),Oo);var jo;vt.ClickEvent=(jo=class extends CustomEvent{constructor(t={}){super(vt.ClickEvent.type,{...t})}},g(jo,"type","mw:click"),jo);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",vt);var lr,ec,tc,cn=class cn extends A(_){constructor(){super();f(this,lr);g(this,"render",()=>d`
1967
+ `);var Pt=Tr,Ta;Pt.CloseEvent=(Ta=class extends CustomEvent{constructor(e={}){super(Pt.CloseEvent.type,{...e})}},w(Ta,"type","mw:close"),Ta);var Oa;Pt.ClickEvent=(Oa=class extends CustomEvent{constructor(e={}){super(Pt.ClickEvent.type,{...e})}},w(Oa,"type","mw:click"),Oa);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",Pt);var Lr,Sp,Ep,Fn=class Fn extends A(E){constructor(){super();d(this,Lr);w(this,"render",()=>f`
1852
1968
  <!-- wrapper -->
1853
- <div class="group relative z-[2147483647] select-none rounded-t-2xl bg-white text-left font-sans text-[16px] text-base leading-normal text-gray-800 shadow-2xl transition-all">
1969
+ <div class="group relative z-[2147483647] rounded-t-2xl bg-white text-left font-sans text-base text-[16px] leading-normal text-gray-800 shadow-2xl transition-all select-none">
1854
1970
  <!-- close button -->
1855
1971
  <button
1856
- class="absolute right-4 top-[28px] inline-flex h-7 w-7 items-center justify-center rounded-full bg-gray-300 bg-opacity-50 pb-[2px] text-center text-xl shadow-none duration-300 ease-in-out focus:outline-none"
1857
- @click="${y(this,lr,ec)}"
1972
+ class="bg-opacity-50 absolute top-[28px] right-4 inline-flex h-7 w-7 items-center justify-center rounded-full bg-gray-300 pb-[2px] text-center text-xl shadow-none duration-300 ease-in-out focus:outline-none"
1973
+ @click="${m(this,Lr,Sp)}"
1858
1974
  aria-label="Close">
1859
1975
  ×
1860
1976
  </button>
1861
1977
 
1862
1978
  <!-- content -->
1863
- <div class="p-4 text-gray-800" @click="${y(this,lr,tc)}">
1864
- <h1 class="mr-8 py-2.5 text-left font-display text-lg font-bold">${this.title}</h1>
1979
+ <div class="p-4 text-gray-800" @click="${m(this,Lr,Ep)}">
1980
+ <h1 class="font-display mr-8 py-2.5 text-left text-lg font-bold">${this.title}</h1>
1865
1981
  <p class="py-2.5 text-left">${this.text}</p>
1866
1982
  <div class="h-4"></div>
1867
- ${this.button&&this.color?d`
1983
+ ${this.button&&this.color?f`
1868
1984
  <!-- only visible if button text and color are given -->
1869
1985
  <button class="w-full rounded-full bg-[${this.color}] px-5 py-2.5 text-center text-sm font-medium text-white" type="button">${this.button}</button>
1870
1986
  `:null}
@@ -1873,32 +1989,32 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1873
1989
  <!-- can append any other content -->
1874
1990
  <slot name="footer"></slot>
1875
1991
  </div>
1876
- `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};lr=new WeakSet,ec=function(){this.dispatchEvent(new cn.CloseEvent)},tc=function(){this.dispatchEvent(new cn.ClickEvent)},g(cn,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var xt=cn,Lo;xt.CloseEvent=(Lo=class extends CustomEvent{constructor(t={}){super(xt.CloseEvent.type,{...t})}},g(Lo,"type","mw:close"),Lo);var To;xt.ClickEvent=(To=class extends CustomEvent{constructor(t={}){super(xt.ClickEvent.type,{...t})}},g(To,"type","mw:click"),To);customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",xt);var ur,pn,bt,Di=class{constructor(t,r){f(this,ur);f(this,pn,!1);f(this,bt,()=>{a(this,pn)||(a(this,ur).userFirstInteracted?.(),m(this,pn,!0)),a(this,ur).userInteracted?.()});m(this,ur,r),t.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",a(this,bt)),window.addEventListener("keydown",a(this,bt))}stopListening(){window.removeEventListener("click",a(this,bt)),window.removeEventListener("keydown",a(this,bt))}};ur=new WeakMap,pn=new WeakMap,bt=new WeakMap;var R1=1440*60*1e3,cr,de,kt,hn,Ct,dn,Ri,rc,Pi=class{constructor(t,r,n=Date){f(this,Ri);f(this,cr);f(this,de);f(this,kt);f(this,hn);f(this,Ct,!1);f(this,dn,!1);m(this,cr,t),m(this,de,r),m(this,kt,n),t.addController(this)}get showing(){return a(this,Ct)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:t}={}){if(this.abortAutoShowTimer(),!a(this,Ct)&&(m(this,Ct,!0),a(this,cr).requestUpdate(),t)){a(this,de).playPopupSound();let r=a(this,de).getPersistedState();a(this,de).setPersistedState({...r,playedSoundOnce:!0})}}hide(){m(this,dn,!0),this.abortAutoShowTimer(),m(this,Ct,!1),a(this,cr).requestUpdate()}abortAutoShowTimer(){clearTimeout(a(this,hn))}onCloseClick(){let t=a(this,de).getPersistedState();a(this,de).setPersistedState({...t,userDismissedAt:a(this,kt).now()}),this.hide()}onContentClick(){let t=a(this,de).getPersistedState();a(this,de).setPersistedState({...t,userDismissedAt:a(this,kt).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),a(this,dn)||m(this,hn,setTimeout(()=>y(this,Ri,rc).call(this),a(this,de).getDelayMs()))}};cr=new WeakMap,de=new WeakMap,kt=new WeakMap,hn=new WeakMap,Ct=new WeakMap,dn=new WeakMap,Ri=new WeakSet,rc=function(){let t=a(this,de).getPersistedState(),r=!!t?.playedSoundOnce;t?.userDismissedAt&&a(this,kt).now()-t.userDismissedAt<R1||this.show({sound:!r})};var Ze,Ro,Re,Ui,Po,Vi=class Vi extends A(_){constructor(){super();f(this,Re);f(this,Ze,new Pi(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(r=>{console.error("Error playing audio:",r,{})})},setPersistedState:r=>{r?localStorage.setItem("_molin_popup",JSON.stringify(r)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let r=localStorage.getItem("_molin_popup");try{return r?JSON.parse(r):null}catch{return null}}}));f(this,Ro,new Di(this,a(this,Ze)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:"",color:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let r=a(this,Ze).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",n=this.content;return d`
1992
+ `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Lr=new WeakSet,Sp=function(){this.dispatchEvent(new Fn.CloseEvent)},Ep=function(){this.dispatchEvent(new Fn.ClickEvent)},w(Fn,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var Ut=Fn,La;Ut.CloseEvent=(La=class extends CustomEvent{constructor(e={}){super(Ut.CloseEvent.type,{...e})}},w(La,"type","mw:close"),La);var ja;Ut.ClickEvent=(ja=class extends CustomEvent{constructor(e={}){super(Ut.ClickEvent.type,{...e})}},w(ja,"type","mw:click"),ja);customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Ut);var jr,Hn,Rt,Ss=class{constructor(e,r){d(this,jr);d(this,Hn,!1);d(this,Rt,()=>{a(this,Hn)||(a(this,jr).userFirstInteracted?.(),g(this,Hn,!0)),a(this,jr).userInteracted?.()});g(this,jr,r),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",a(this,Rt)),window.addEventListener("keydown",a(this,Rt))}stopListening(){window.removeEventListener("click",a(this,Rt)),window.removeEventListener("keydown",a(this,Rt))}};jr=new WeakMap,Hn=new WeakMap,Rt=new WeakMap;var C1=1440*60*1e3,Dr,ve,Bt,zn,Vt,qn,$s,$p,Es=class{constructor(e,r,n=Date){d(this,$s);d(this,Dr);d(this,ve);d(this,Bt);d(this,zn);d(this,Vt,!1);d(this,qn,!1);g(this,Dr,e),g(this,ve,r),g(this,Bt,n),e.addController(this)}get showing(){return a(this,Vt)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!a(this,Vt)&&(g(this,Vt,!0),a(this,Dr).requestUpdate(),e)){a(this,ve).playPopupSound();let r=a(this,ve).getPersistedState();a(this,ve).setPersistedState({...r,playedSoundOnce:!0})}}hide(){g(this,qn,!0),this.abortAutoShowTimer(),g(this,Vt,!1),a(this,Dr).requestUpdate()}abortAutoShowTimer(){clearTimeout(a(this,zn))}onCloseClick(){let e=a(this,ve).getPersistedState();a(this,ve).setPersistedState({...e,userDismissedAt:a(this,Bt).now()}),this.hide()}onContentClick(){let e=a(this,ve).getPersistedState();a(this,ve).setPersistedState({...e,userDismissedAt:a(this,Bt).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),a(this,qn)||g(this,zn,setTimeout(()=>m(this,$s,$p).call(this),a(this,ve).getDelayMs()))}};Dr=new WeakMap,ve=new WeakMap,Bt=new WeakMap,zn=new WeakMap,Vt=new WeakMap,qn=new WeakMap,$s=new WeakSet,$p=function(){let e=a(this,ve).getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&a(this,Bt).now()-e.userDismissedAt<C1||this.show({sound:!r})};var lt,Ua,Ze,_s,Pa,As=class As extends A(E){constructor(){super();d(this,Ze);d(this,lt,new Es(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(r=>{console.error("Error playing audio:",r,{})})},setPersistedState:r=>{r?localStorage.setItem("_molin_popup",JSON.stringify(r)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let r=localStorage.getItem("_molin_popup");try{return r?JSON.parse(r):null}catch{return null}}}));d(this,Ua,new Ss(this,a(this,lt)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:"",color:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let r=a(this,lt).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",n=this.content;return f`
1877
1993
  <!-- mobile shadow backdrop -->
1878
- <div @click="${y(this,Re,Ui)}" class="${r} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
1994
+ <div @click="${m(this,Ze,_s)}" class="${r} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
1879
1995
 
1880
1996
  <!-- mobile overlay -->
1881
- <div class="${r} fixed bottom-0 left-0 right-0 z-[2147483647] sm:hidden">
1882
- <mw-popup-mobile title="${n.mobile.title}" text="${n.mobile.text}" button="${n.mobile.button}" color="${n.mobile.color}" @mw:click="${y(this,Re,Po)}" @mw:close="${y(this,Re,Ui)}">
1883
- ${n.mobile.poweredBy?d`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:null}
1997
+ <div class="${r} fixed right-0 bottom-0 left-0 z-[2147483647] sm:hidden">
1998
+ <mw-popup-mobile title="${n.mobile.title}" text="${n.mobile.text}" button="${n.mobile.button}" color="${n.mobile.color}" @mw:click="${m(this,Ze,Pa)}" @mw:close="${m(this,Ze,_s)}">
1999
+ ${n.mobile.poweredBy?f`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:null}
1884
2000
  </mw-popup-mobile>
1885
2001
  </div>
1886
2002
 
1887
2003
  <!-- desktop -->
1888
2004
  <div class="${r} ${this.positionClasses} fixed z-[2147483647] transition-[opacity,translate,visibility] max-sm:hidden">
1889
- <mw-popup-desktop color="${n.desktop.color}" text="${n.desktop.text}" @mw:click="${y(this,Re,Po)}" @mw:close="${y(this,Re,Ui)}"></mw-popup-desktop>
2005
+ <mw-popup-desktop color="${n.desktop.color}" text="${n.desktop.text}" @mw:click="${m(this,Ze,Pa)}" @mw:close="${m(this,Ze,_s)}"></mw-popup-desktop>
1890
2006
  </div>
1891
- `}hide(){a(this,Ze).hide()}};Ze=new WeakMap,Ro=new WeakMap,Re=new WeakSet,Ui=function(){a(this,Ze).onCloseClick()},Po=function(){this.dispatchEvent(new Vi.ClickEvent),a(this,Ze).onContentClick()},g(Vi,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var fn=Vi,Do;fn.ClickEvent=(Do=class extends CustomEvent{constructor(t={}){super(fn.ClickEvent.type,{...t})}},g(Do,"type","mw:click"),Do);customElements.get("mw-popup")||customElements.define("mw-popup",fn);var Ni,nc,Bi=class extends A(_){constructor(){super();f(this,Ni);g(this,"render",()=>d`
2007
+ `}hide(){a(this,lt).hide()}};lt=new WeakMap,Ua=new WeakMap,Ze=new WeakSet,_s=function(){a(this,lt).onCloseClick()},Pa=function(){this.dispatchEvent(new As.ClickEvent),a(this,lt).onContentClick()},w(As,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var Wn=As,Da;Wn.ClickEvent=(Da=class extends CustomEvent{constructor(e={}){super(Wn.ClickEvent.type,{...e})}},w(Da,"type","mw:click"),Da);customElements.get("mw-popup")||customElements.define("mw-popup",Wn);var Is,_p,Ms=class extends A(E){constructor(){super();d(this,Is);w(this,"render",()=>f`
1892
2008
  <span class="relative inline-flex">
1893
2009
  <slot></slot>
1894
- <span class="${a(this,Ni,nc)} pointer-events-none absolute z-10 flex h-3 w-3">
2010
+ <span class="${a(this,Is,_p)} pointer-events-none absolute z-10 flex h-3 w-3">
1895
2011
  <span class="bg-${this.color} absolute inline-flex h-3 w-3 animate-ping rounded-full opacity-75"></span>
1896
2012
  <span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
1897
2013
  </span>
1898
2014
  </span>
1899
- `);this.color="sky-500",this.position="top-right"}};Ni=new WeakSet,nc=function(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:throw new Error(`Invalid position: ${this.position}`)}},g(Bi,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",Bi);var Hi=class extends A(_){constructor(){super();g(this,"render",()=>d`
1900
- <div class="${this.positionClasses} fixed bottom-24 right-6 z-10 flex animate-bounce flex-col items-center justify-center font-sans text-base">
1901
- <p class="mb-2 -translate-x-4 -rotate-12 transform text-lg font-bold leading-normal text-gray-800">${this.text}</p>
2015
+ `);this.color="sky-500",this.position="top-right"}};Is=new WeakSet,_p=function(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:throw new Error(`Invalid position: ${this.position}`)}},w(Ms,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",Ms);var Ts=class extends A(E){constructor(){super();w(this,"render",()=>f`
2016
+ <div class="${this.positionClasses} fixed right-6 bottom-24 z-10 flex animate-bounce flex-col items-center justify-center font-sans text-base">
2017
+ <p class="mb-2 -translate-x-4 -rotate-12 transform text-lg leading-normal font-bold text-gray-800">${this.text}</p>
1902
2018
 
1903
2019
  <!-- arrow -->
1904
2020
  <svg class="h-14 w-14" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 55 58" fill="none">
@@ -1909,18 +2025,7 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1909
2025
  stroke-linecap="round"></path>
1910
2026
  </svg>
1911
2027
  </div>
1912
- `);this.positionClasses="",this.text="Try it out"}};g(Hi,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Hi);var Ge,Ie,Vo,mn,Uo=class{constructor(t=window.localStorage){f(this,Ie);f(this,Ge);m(this,Ge,t)}setex(t,r,n){return a(this,Ge).setItem(t,y(this,Ie,mn).call(this,{value:y(this,Ie,mn).call(this,r),expiresAt:Date.now()+n*1e3})||"")}set(t,r){return a(this,Ge).setItem(t,y(this,Ie,mn).call(this,{value:y(this,Ie,mn).call(this,r)})||"")}get(t){let r=a(this,Ge).getItem(t);if(!r)return;let n=y(this,Ie,Vo).call(this,r);if(n){if(n.expiresAt&&n.expiresAt<Date.now()){a(this,Ge).removeItem(t);return}return y(this,Ie,Vo).call(this,n.value)}}get molin_shop_assistant_distinct_id(){return localStorage.getItem("molin_shop_assistant_distinct_id")}set molin_shop_assistant_distinct_id(t){t===null?localStorage.removeItem("molin_shop_assistant_distinct_id"):localStorage.setItem("molin_shop_assistant_distinct_id",t)}get molin_widget_open_state(){return fe.get("molin-shop-ai-widget-open")??null}set molin_widget_open_state(t){fe.set("molin-shop-ai-widget-open",t)}resetWidgetData(){fe.molin_shop_assistant_distinct_id=null,fe.molin_widget_open_state=null}};Ge=new WeakMap,Ie=new WeakSet,Vo=function(t){if(!(typeof t!="string"||t===""))try{return JSON.parse(t)}catch{return}},mn=function(t){if(t!==void 0)try{return JSON.stringify(t)}catch{return}};var fe=new Uo;var se,Ue,Fi,gn,pr,Bo=class{constructor(){f(this,se,[]);f(this,Ue);f(this,Fi,10);f(this,gn,5e3);f(this,pr,!1)}async add(t,r){if(a(this,se).push(oc(t,r)),a(this,se).length>=a(this,Fi))return this.flush();a(this,Ue)||m(this,Ue,setTimeout(()=>{this.flush().catch(console.error)},a(this,gn)))}async flush(){if(a(this,pr)||a(this,se).length===0)return;let t=[...a(this,se)];try{m(this,pr,!0),clearTimeout(a(this,Ue)),m(this,Ue,void 0),m(this,se,[]);let r=new AbortController,n=setTimeout(()=>r.abort(),5e3);await sc(t,{signal:r.signal}),clearTimeout(n)}catch(r){if(r.name==="AbortError")console.error("Request timed out, retrying events"),m(this,se,[...t,...a(this,se)]);else{console.error("Failed to send events to backend:",r);let n=t.filter(i=>i.event.includes("error"));m(this,se,[...n,...a(this,se)])}}finally{m(this,pr,!1),a(this,se).length>0&&!a(this,Ue)&&m(this,Ue,setTimeout(()=>{this.flush().catch(console.error)},a(this,gn)))}}async flushBeforeUnload(){if(a(this,se).length>0)try{let t=new FormData;t.set("events",JSON.stringify(a(this,se))),navigator.sendBeacon(new URL("/widgets/data/collect",ac()).href,t)}catch(t){console.error("Failed to send final events:",t)}}};se=new WeakMap,Ue=new WeakMap,Fi=new WeakMap,gn=new WeakMap,pr=new WeakMap;var ic=new Bo;window.addEventListener("beforeunload",()=>{ic.flushBeforeUnload().catch(console.error)});async function F(e,t,r){if(typeof e!="string")throw new TypeError("Event name must be a string");if(typeof t!="object"||t===null)throw new TypeError("Properties must be an object");try{if(e==="ShopAssistant: user clicked link"&&B1("molin_link_click",t),r?.immediate){await sc([oc(e,t)]);return}else return ic.add(e,t)}catch(n){console.error("Failed to send event:",n)}}async function sc(e,{signal:t}={}){let r=new FormData;r.set("events",JSON.stringify(e));let n=await fetch(new URL("/widgets/data/collect",ac()),{method:"POST",body:r,signal:t});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);n.body?.cancel().catch(console.warn)}function oc(e,t){return{event:e,widget_id:t.widgetId,properties:Object.assign({},t,V1()),distinct_id:U1(),timestamp:new Date().toISOString()}}function U1(){try{let e=fe.molin_shop_assistant_distinct_id;return e||(e=crypto.randomUUID(),fe.molin_shop_assistant_distinct_id=e),e}catch(e){console.error("Failed to deserialize distinct_id:",e);let t=crypto.randomUUID();try{fe.molin_shop_assistant_distinct_id=t}catch(r){console.error("Failed to store new distinct_id:",r)}return t}}function V1(){return{referrer:document.referrer,userAgent:navigator.userAgent,language:navigator.language,screenWidth:window.innerWidth,screenHeight:window.innerHeight,timestamp:new Date().toISOString(),timezoneOffset:new Date().getTimezoneOffset(),doNotTrack:navigator.doNotTrack??void 0}}function ac(){let e=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8787","molin.localhost":"http://molin.localhost:8787","widget.molin.foo":"https://molin.foo","widget.molin.ai":"https://molin.ai","molin.ai":"https://molin.ai","molin.foo":"https://molin.foo"}[e]||"https://molin.ai"}function B1(e,t){try{window.dataLayer=window.dataLayer||[];let r={event:e,link_url:t.url};window.dataLayer.push(r)}catch(r){console.error("Failed to send event to dataLayer:",r)}}var $t,yn,Je,St,zi,uc,qi=class{constructor(t,r,n){f(this,zi);f(this,$t);f(this,yn);f(this,Je);f(this,St);g(this,"isLoading",!1);g(this,"data");m(this,$t,t),m(this,yn,r),m(this,Je,n),t.addController(this)}fetch(){if(this.isLoading)return;a(this,St)?.abort();let t=new AbortController;m(this,St,t),this.isLoading=!0,this.data=void 0,a(this,$t).requestUpdate(),(async()=>{let r=y(this,zi,uc).call(this);return r.signal?.addEventListener("abort",()=>t.abort(),{signal:t.signal}),fetch(r,{signal:t.signal})})().then(async r=>{if(!r.ok)throw new Error(`${r.statusText}: ${await r.text()}`);this.isLoading=!1,this.data=typeof a(this,Je)?.transform=="function"?await a(this,Je).transform(r):r,a(this,$t).requestUpdate()}).catch(r=>{a(this,Je)?.onError?.(r),this.isLoading=!1,this.data=void 0,a(this,$t).requestUpdate()}).finally(()=>{t.abort()})}hostConnected(){this.isLoading||a(this,Je)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){a(this,St)?.abort(),m(this,St,void 0)}};$t=new WeakMap,yn=new WeakMap,Je=new WeakMap,St=new WeakMap,zi=new WeakSet,uc=function(){let t=a(this,yn);if(typeof t=="function"&&(t=t()),!t)throw new Error("missing request");return new Request(t)};var ve,wn,hr,dr,Ke=class{constructor(t,r){f(this,ve);f(this,wn);f(this,hr);f(this,dr);m(this,ve,t),m(this,wn,r),t.addController(this)}get data(){return a(this,dr)||a(this,hr)?.data}hostConnected(){if(a(this,hr)||a(this,dr))return;let t=cc();t&&t.widgetId===a(this,ve).widgetId?m(this,dr,t.config):m(this,hr,new qi(a(this,ve),()=>{if(a(this,ve).cdn&&a(this,ve).widgetId)return`${a(this,ve).cdn}/config?w=${a(this,ve).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:async r=>{let n=await r.json();return n&&!t&&window.__INIT_MOLIN_SHOP_AI({cdn:a(this,ve).cdn,widgetId:a(this,ve).widgetId,config:n}),n},onError:a(this,wn)?.onError}))}};ve=new WeakMap,wn=new WeakMap,hr=new WeakMap,dr=new WeakMap;function Xe(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}var Wi,bn,Zi,Ve,pc,vn,xn=class xn extends A(_){constructor(){super();f(this,Ve);f(this,Wi,new Ke(this,{onError:console.error}));f(this,bn);f(this,Zi,{onError:r=>{alert(r.error),console.error(r.widgetId,r.error),F("ShopAssistant: error",{...r},{immediate:!0})},onNewMessageStartedStreaming:r=>{F("ShopAssistant: user received bot message (streaming started)",r)},onMessageEndedStreaming:r=>{F("ShopAssistant: user received bot message (streaming ended)",r)},onUserCanceledStreaming:r=>{F("ShopAssistant: user canceled streaming",r)},onUserClickedLink:r=>{F("ShopAssistant: user clicked link",r)},onUserSentInput:r=>{F("ShopAssistant: user sent input",r)}});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData=Xe()?.userData,this.xCustomInstructions=Xe()?.customInstructions}get config(){return a(this,bn)||a(this,Wi).data}render(){return this.config?d`
1913
- <mw-context-widget .widgetId="${this.widgetId}" .config="${this.config}" .callbacks="${a(this,Zi)}" .xUserData="${this.xUserData}" .xCustomInstructions="${this.xCustomInstructions}">
1914
- <!-- embed our chat component forwarding props -->
1915
- <mw-chat ?show-close="${this.showClose}" @mw:close-click="${y(this,Ve,pc)}">
1916
- <slot name="banner" slot="banner"></slot>
1917
- </mw-chat>
1918
- </mw-context-widget>
1919
- `:null}injectConfig(r){m(this,bn,r),this.requestUpdate()}reloadConfig(){a(this,Ve,vn)?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",a(this,Ve,vn)?.reset(),this.requestUpdate()}get conversationId(){return a(this,Ve,vn)?.conversationId??""}get messages(){return a(this,Ve,vn)?.messages??[]}};Wi=new WeakMap,bn=new WeakMap,Zi=new WeakMap,Ve=new WeakSet,pc=function(){this.dispatchEvent(new xn.CloseClickEvent)},vn=function(){return this.renderRoot.querySelector("mw-chat")},g(xn,"styles",ie`
1920
- :host {
1921
- all: initial; /* reset all properties that can pierce the shadow DOM */
1922
- }
1923
- `),g(xn,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1}});var Et=xn;customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",Et);var No;Et.CloseClickEvent=(No=class extends CustomEvent{constructor(t={}){super(Et.CloseClickEvent.type,{...t})}},g(No,"type","mw:close-click"),No);var Ho=class{constructor({hidden:t=!1}){g(this,"hidden");this.hidden=t}setUserData(t){for(let r of document.querySelectorAll("molin-shop-ai"))t?r.setAttribute("user-data",JSON.stringify(t)):r.removeAttribute("user-data");for(let r of document.querySelectorAll("molin-shop-ai-chat"))t?r.setAttribute("user-data",JSON.stringify(t)):r.removeAttribute("user-data")}setCustomInstructions(t){for(let r of document.querySelectorAll("molin-shop-ai"))t?r.setAttribute("custom-instructions",t):r.removeAttribute("custom-instructions");for(let r of document.querySelectorAll("molin-shop-ai-chat"))t?r.setAttribute("custom-instructions",t):r.removeAttribute("custom-instructions")}showLauncher(){for(let t of document.querySelectorAll("molin-shop-ai"))t instanceof Se&&t.showLauncher()}hideLauncher(){for(let t of document.querySelectorAll("molin-shop-ai"))t instanceof Se&&t.hideLauncher()}openChat({message:t,autoSend:r}={}){for(let n of document.querySelectorAll("molin-shop-ai"))n instanceof Se&&n.openChat({message:t,autoSend:r})}closeChat(){for(let t of document.querySelectorAll("molin-shop-ai"))t instanceof Se&&t.closeChat()}reset(){fe.resetWidgetData();for(let t of document.querySelectorAll("molin-shop-ai"))t instanceof Se&&t.reset();for(let t of document.querySelectorAll("molin-shop-ai-chat"))t instanceof Et&&t.reset()}};function hc({hidden:e}){let t=new Ho({hidden:e});return window.Molin=t,t}function Gi(){let e=window.Molin;if(!e)throw new Error("window.Molin global not initialized");return e}window.__INIT_MOLIN_SHOP_AI=function(t){N1(t);let r=Xe(),n=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(hc({hidden:n}),t.auto){let i=document.createElement("molin-shop-ai");i.setAttribute("cdn",t.cdn),i.setAttribute("widget",t.widgetId),document.body.appendChild(i)}};function N1(e){window.__INIT_MOLIN_SHOP_AI_OPTIONS=e}function cc(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Ji,kn=class extends A(_){constructor(){super();f(this,Ji,new Ke(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return a(this,Ji).data}render(){return this.config?d`
2028
+ `);this.positionClasses="",this.text="Try it out"}};w(Ts,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Ts);var Os,Gn=class extends A(E){constructor(){super();d(this,Os,new ot(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return a(this,Os).data}render(){return this.config?f`
1924
2029
  <!-- embed our bubble component forwarding props -->
1925
2030
  <!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
1926
2031
  <mw-bubble
@@ -1928,70 +2033,70 @@ var Cc=Object.defineProperty;var Qo=e=>{throw TypeError(e)};var $c=(e,t,r)=>t in
1928
2033
  .color="${this.config?.bubble?.color||this.config?.color}"
1929
2034
  .bubbleStyle="${this.config?.bubble?.style}"
1930
2035
  .src="${this.config?.bubble?.bubbleUrl}"
1931
- width="${he(this.config?.bubble?.size?.width)}"
1932
- height="${he(this.config?.bubble?.size?.height)}"></mw-bubble>
1933
- `:null}};Ji=new WeakMap,g(kn,"styles",ie`
2036
+ width="${le(this.config?.bubble?.size?.width)}"
2037
+ height="${le(this.config?.bubble?.size?.height)}"></mw-bubble>
2038
+ `:null}};Os=new WeakMap,w(Gn,"styles",ae`
1934
2039
  :host {
1935
2040
  all: initial; /* reset all properties that can pierce the shadow DOM */
1936
2041
  }
1937
- `),g(kn,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",kn);var N4="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),H4="navigator"in globalThis&&"share"in navigator,H1=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function F1(e){if(typeof window>"u")return!1;let t=H1[e];return typeof t!="number"?(console.warn(`Invalid breakpoint: ${e}`),!1):window.matchMedia(`(min-width: ${t}px)`).matches}function Fo(){return F1("sm")}var Xi,fr,mr,_t,Cn,Yi,Ki=class{constructor(t,r,n,i=window.history){f(this,Xi);f(this,fr);f(this,mr);f(this,_t);f(this,Cn,!1);f(this,Yi,()=>{a(this,fr).test(window.location.pathname)&&a(this,mr).navigated()});m(this,Xi,t),m(this,fr,r),m(this,mr,n),m(this,_t,i),t.addController(this)}hostConnected(){a(this,Yi).call(this);let t=a(this,_t).pushState;a(this,_t).pushState=(...r)=>{if(t.call(a(this,_t),...r),!a(this,Cn))try{let n=new URL(r[2],window.location.origin);a(this,fr).test(n.pathname)&&a(this,mr).navigated()}catch{}}}hostDisconnected(){m(this,Cn,!0)}};Xi=new WeakMap,fr=new WeakMap,mr=new WeakMap,_t=new WeakMap,Cn=new WeakMap,Yi=new WeakMap;function dc({minMs:e,maxMs:t}){return Math.random()*(t-e)+e}function Qi(e,t=""){return Object.entries(e).filter(([r,n])=>n).map(([r,n])=>`${t}${r}-[${n}]`).join(" ")}function fc(e,t={}){return[Qi(e),Qi(t,"max-sm:")].join(" ")}function mc(e){return Qi(e)}function gc(e){return Object.entries(e).filter(([t,r])=>r).filter(([t])=>t==="left"||t==="right").map(([t,r])=>{let n=`sm:${t}-[${r}]`;return t==="left"&&(n+=" sm:right-auto"),t==="right"&&(n+=" sm:left-auto"),n}).join(" ")}function yc(e){let t=Qi(e),n=`sm:bottom-[${e.bottom?`calc(${e.bottom}+72px)`:"72px"}]`;return[t,n].filter(Boolean).join(" ")}var gr,yr,$n,Sn,En,es,qo=class{constructor(t,r,{threshold:n=5}={}){f(this,gr,0);f(this,yr,!1);f(this,$n);f(this,Sn);f(this,En,()=>{a(this,yr)||(requestAnimationFrame(a(this,es)),m(this,yr,!0))});f(this,es,()=>{let t=window.scrollY,r=t-a(this,gr);if(Math.abs(r)>=a(this,Sn)){let n=r>0?"down":"up";a(this,$n).call(this,{scrollY:t,direction:n,deltaY:Math.abs(r)}),m(this,gr,t)}m(this,yr,!1)});m(this,$n,r),m(this,Sn,n),t.addController(this)}hostConnected(){m(this,gr,window.scrollY),window.addEventListener("scroll",a(this,En),{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",a(this,En))}};gr=new WeakMap,yr=new WeakMap,$n=new WeakMap,Sn=new WeakMap,En=new WeakMap,es=new WeakMap;function wc(e,t,r){return new qo(e,t,r)}var ts,Xo,Mn,Yo,U,Be,rs,I,zo,Wo,_n,Mt,Zo,vc,xc,bc,ns,Go,Jo,Ko,At,Se=class extends A(_){constructor(){super();f(this,I);f(this,ts,new Ke(this,{onError:console.error}));f(this,Xo,wc(this,r=>{a(this,I,Wo)&&!a(this,U)&&(r.direction==="down"?this._floatingInputVisible=!1:r.direction==="up"&&(this._floatingInputVisible=!0),this.requestUpdate())},{threshold:20}));f(this,Mn);f(this,Yo,new Ki(this,/.*/i,{navigated:()=>{if(!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let r=a(this,I,Mt)?.conversationId,n=Ft.restore(this.widgetId)?.conversationId,i=r||n;i&&F("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:i,url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0})}}));f(this,U,!1);f(this,Be,!1);f(this,rs,{onError:r=>{alert(r.error),console.error(r.widgetId,r.error),F("ShopAssistant: error",{...r},{immediate:!0})},onNewMessageStartedStreaming:r=>{F("ShopAssistant: user received bot message (streaming started)",r)},onMessageEndedStreaming:r=>{F("ShopAssistant: user received bot message (streaming ended)",r)},onUserCanceledStreaming:r=>{F("ShopAssistant: user canceled streaming",r)},onUserClickedLink:r=>{F("ShopAssistant: user clicked link",r)},onUserSentInput:r=>{F("ShopAssistant: user sent input",r)}});f(this,ns,r=>{let n=r.detail.text,i=a(this,I,Zo);i&&typeof i.connect=="function"&&i.connect(),m(this,U,!0),m(this,Be,!0),this.requestUpdate(),y(this,I,At).call(this,!0),setTimeout(()=>{y(this,I,Ko).call(this,n),y(this,I,Jo).call(this,n).catch(console.warn)},100),F("ShopAssistant: user sent input",{widgetId:this.widgetId,text:n,example:!1,conversationId:a(this,I,Mt)?.conversationId||"",source:"ask-ai"})});this.cdn="https://widget.molin.ai",this.widgetId="",this._floatingInputVisible=!0,this.xUserData=Xe()?.userData,this.xCustomInstructions=Xe()?.customInstructions}get config(){return a(this,Mn)||a(this,ts).data}render(){if(!this.config)return null;let r=fc(this.config.bubble.position,this.config.bubble.mobilePosition),n=mc(this.config.bubble.position),i=gc(this.config.bubble.position),s=yc(this.config.bubble.position);return this.config.hidden||Gi().hidden?null:d`
2042
+ `),w(Gn,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",Gn);var av="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),lv="navigator"in globalThis&&"share"in navigator,S1=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function E1(t){if(typeof window>"u")return!1;let e=S1[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function Ra(){return E1("sm")}var js,Pr,Ur,Nt,Zn,Ds,Ls=class{constructor(e,r,n,i=window.history){d(this,js);d(this,Pr);d(this,Ur);d(this,Nt);d(this,Zn,!1);d(this,Ds,()=>{a(this,Pr).test(window.location.pathname)&&a(this,Ur).navigated()});g(this,js,e),g(this,Pr,r),g(this,Ur,n),g(this,Nt,i),e.addController(this)}hostConnected(){a(this,Ds).call(this);let e=a(this,Nt).pushState;a(this,Nt).pushState=(...r)=>{if(e.call(a(this,Nt),...r),!a(this,Zn))try{let n=new URL(r[2],window.location.origin);a(this,Pr).test(n.pathname)&&a(this,Ur).navigated()}catch{}}}hostDisconnected(){g(this,Zn,!0)}};js=new WeakMap,Pr=new WeakMap,Ur=new WeakMap,Nt=new WeakMap,Zn=new WeakMap,Ds=new WeakMap;function Ap({minMs:t,maxMs:e}){return Math.random()*(e-t)+t}function Ps(t,e=""){return Object.entries(t).filter(([r,n])=>n).map(([r,n])=>`${e}${r}-[${n}]`).join(" ")}function Mp(t,e={}){return[Ps(t),Ps(e,"max-sm:")].join(" ")}function Ip(t){return Ps(t)}function Tp(t){return Object.entries(t).filter(([e,r])=>r).filter(([e])=>e==="left"||e==="right").map(([e,r])=>{let n=`sm:${e}-[${r}]`;return e==="left"&&(n+=" sm:right-auto"),e==="right"&&(n+=" sm:left-auto"),n}).join(" ")}function Op(t){let e=Ps(t),n=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,n].filter(Boolean).join(" ")}var Rr,Br,Kn,Jn,Xn,Us,Ba=class{constructor(e,r,{threshold:n=5}={}){d(this,Rr,0);d(this,Br,!1);d(this,Kn);d(this,Jn);d(this,Xn,()=>{a(this,Br)||(requestAnimationFrame(a(this,Us)),g(this,Br,!0))});d(this,Us,()=>{let e=window.scrollY,r=e-a(this,Rr);if(Math.abs(r)>=a(this,Jn)){let n=r>0?"down":"up";a(this,Kn).call(this,{scrollY:e,direction:n,deltaY:Math.abs(r)}),g(this,Rr,e)}g(this,Br,!1)});g(this,Kn,r),g(this,Jn,n),e.addController(this)}hostConnected(){g(this,Rr,window.scrollY),window.addEventListener("scroll",a(this,Xn),{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",a(this,Xn))}};Rr=new WeakMap,Br=new WeakMap,Kn=new WeakMap,Jn=new WeakMap,Xn=new WeakMap,Us=new WeakMap;function Lp(t,e,r){return new Ba(t,e,r)}var Rs,Wa,Qn,Ga,Ke,Bs,T,Va,Na,Yn,ct,Fa,jp,Dp,Pp,Vs,Ha,za,qa,Ft,Te=class extends A(E){constructor(){super();d(this,T);d(this,Rs,new ot(this,{onError:console.error}));d(this,Wa,Lp(this,r=>{a(this,T,Na)&&!this._dialogShown&&(r.direction==="down"?this._floatingInputVisible=!1:r.direction==="up"&&(this._floatingInputVisible=!0),this.requestUpdate())},{threshold:20}));d(this,Qn);d(this,Ga,new Ls(this,/.*/i,{navigated:()=>{if(!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let r=a(this,T,ct)?.conversationId,n=rr.restore(this.widgetId)?.conversationId,i=r||n;i&&q("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:i,url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0})}}));d(this,Ke,!1);d(this,Bs,{onError:r=>{alert(r.error),console.error(r.widgetId,r.error),q("ShopAssistant: error",{...r},{immediate:!0})},onNewMessageStartedStreaming:r=>{q("ShopAssistant: user received bot message (streaming started)",r)},onMessageEndedStreaming:r=>{q("ShopAssistant: user received bot message (streaming ended)",r)},onUserCanceledStreaming:r=>{q("ShopAssistant: user canceled streaming",r)},onUserClickedLink:r=>{q("ShopAssistant: user clicked link",r)},onUserSentInput:r=>{q("ShopAssistant: user sent input",r)}});d(this,Vs,r=>{let n=r.detail.text,i=a(this,T,Fa);i&&typeof i.connect=="function"&&i.connect(),this._dialogShown=!0,g(this,Ke,!0),this.requestUpdate(),m(this,T,Ft).call(this,!0),setTimeout(()=>{m(this,T,qa).call(this,n),m(this,T,za).call(this,n).catch(console.warn)},100),q("ShopAssistant: user sent input",{widgetId:this.widgetId,text:n,example:!1,conversationId:a(this,T,ct)?.conversationId||"",source:"ask-ai"})});this.cdn="https://widget.molin.ai",this.widgetId="",this._floatingInputVisible=!0,this._dialogShown=!1,this.xUserData=st()?.userData,this.xCustomInstructions=st()?.customInstructions}get config(){return a(this,Qn)||a(this,Rs).data}render(){if(!this.config)return null;let r=Mp(this.config.bubble.position,this.config.bubble.mobilePosition),n=Ip(this.config.bubble.position),i=Tp(this.config.bubble.position),s=Op(this.config.bubble.position);return this.config.hidden||bs().hidden?null:f`
1938
2043
  <mw-context-widget
1939
2044
  .widgetId="${this.widgetId}"
1940
2045
  .config="${this.config}"
1941
- .callbacks="${a(this,rs)}"
2046
+ .callbacks="${a(this,Bs)}"
1942
2047
  .xUserData="${this.xUserData}"
1943
2048
  .xCustomInstructions="${this.xCustomInstructions}"
1944
- .autoConnect="${a(this,Be)}">
2049
+ .autoConnect="${a(this,Ke)}">
1945
2050
  <mw-bubble
1946
- class="${r} ${a(this,U)?"opacity-0":"opacity-100"} fixed z-[${a(this,I,zo)}] transition-opacity"
1947
- @click="${y(this,I,xc)}"
1948
- state="${a(this,U)?"close":"open"}"
2051
+ class="${r} ${this._dialogShown?"opacity-0":"opacity-100"} fixed z-[${a(this,T,Va)}] transition-opacity"
2052
+ @click="${m(this,T,Dp)}"
2053
+ state="${this._dialogShown?"close":"open"}"
1949
2054
  .color="${this.config?.bubble?.color||this.config?.color}"
1950
2055
  .bubbleStyle="${this.config?.bubble?.style}"
1951
2056
  .src="${this.config?.bubble?.bubbleUrl}"
1952
- width="${he(this.config?.bubble?.size?.width)}"
1953
- height="${he(this.config?.bubble?.size?.height)}"></mw-bubble>
2057
+ width="${le(this.config?.bubble?.size?.width)}"
2058
+ height="${le(this.config?.bubble?.size?.height)}"></mw-bubble>
1954
2059
 
1955
2060
  <!-- only load the component if enabled on any platform -->
1956
- ${this.isPopupEnabled?d`
2061
+ ${this.isPopupEnabled?f`
1957
2062
  <mw-popup
1958
2063
  position="${s}"
1959
- delay="${this.config.popup?.delayMs||dc({minMs:2e3,maxMs:5e3})}"
1960
- sound="${this.config.popup?.muteSounds?"":"https://assets.molinai.io/2024/widget-v20241209/popup.aac"}"
2064
+ delay="${this.config.popup?.delayMs||Ap({minMs:2e3,maxMs:5e3})}"
2065
+ sound="${this.config.popup?.muteSounds?"":this.config.popup?.soundUrl||""}"
1961
2066
  .content="${{desktop:{text:this.config.popup?.text||"Hello there. How can we help?",color:this.config?.bubble?.color||this.config.color},mobile:{title:this.config.popup?.mobileTitleText||`Chat with ${this.config.title}`,text:this.config.popup?.text||"Hello there. How can we help?",button:this.config.popup?.mobileButtonText||`Chat with ${this.config.title}`,color:this.config.color,poweredBy:!this.config.removePoweredBy}}}"
1962
- @mw:click="${y(this,I,vc)}"></mw-popup>
2067
+ @mw:click="${m(this,T,jp)}"></mw-popup>
1963
2068
  `:null}
1964
2069
 
1965
2070
  <!-- show "Try it out" if enabled (even if the chat window is showing) -->
1966
- ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?d`<mw-try-it-out
2071
+ ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?f`<mw-try-it-out
1967
2072
  class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}"
1968
2073
  position="${n}"
1969
2074
  text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:null}
1970
2075
 
1971
2076
  <!-- On first render, do not render the dialog, so it does not connect to backend. Once it's rendered once, it's never removed from the DOM. -->
1972
2077
  <div
1973
- class="${a(this,U)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${i} fixed inset-0 z-[2147483647] bg-white font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:bottom-[1.5rem] sm:top-auto sm:h-[92%] sm:max-h-[800px] sm:w-[calc(100dvh*0.50)] sm:min-w-[300px] sm:max-w-[400px] sm:rounded-[36px] 2xl:max-w-[420px]">
1974
- <mw-chat ?show-close="${!0}" @mw:close-click="${y(this,I,bc)}">
2078
+ class="${this._dialogShown?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${i} fixed inset-0 z-[2147483647] bg-white font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:top-auto sm:bottom-[1.5rem] sm:h-[92%] sm:max-h-[800px] sm:w-[calc(100dvh*0.50)] sm:max-w-[400px] sm:min-w-[300px] sm:rounded-[36px] 2xl:max-w-[420px]">
2079
+ <mw-chat ?show-close="${!0}" @mw:close-click="${m(this,T,Pp)}">
1975
2080
  <slot name="banner" slot="banner"></slot>
1976
2081
  </mw-chat>
1977
2082
  </div>
1978
2083
 
1979
2084
  <!-- Floating input only visible when enabled, in center, on desktop only -->
1980
- ${this.config?.floatingAskAI?.enabled&&a(this,I,Wo)?d`
2085
+ ${this.config?.floatingAskAI?.enabled&&a(this,T,Na)?f`
1981
2086
  <mw-floating-ask-ai
1982
2087
  ?dark="${this.config?.floatingAskAI?.darkMode}"
1983
2088
  .color="${this.config.color||this.config?.bubble?.color}"
1984
- placeholder="${he(this.config?.floatingAskAI?.placeholder)}"
1985
- class="${!a(this,U)&&this._floatingInputVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-full"} fixed left-1/2 z-[${a(this,I,zo)}] hidden -translate-x-1/2 transition-all duration-300 ease-in-out max-md:hidden sm:block"
2089
+ placeholder="${le(this.config?.floatingAskAI?.placeholder)}"
2090
+ class="${!this._dialogShown&&this._floatingInputVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-full"} fixed left-1/2 z-[${a(this,T,Va)}] hidden -translate-x-1/2 transition-all duration-300 ease-in-out max-md:hidden sm:block"
1986
2091
  style="bottom: ${this.config.bubble.position.bottom||"1.5rem"}"
1987
- @mw-floating-ask-ai:submit="${a(this,ns)}"></mw-floating-ask-ai>
2092
+ @mw-floating-ask-ai:submit="${a(this,Vs)}"></mw-floating-ask-ai>
1988
2093
  `:null}
1989
2094
  </mw-context-widget>
1990
- `}get isPopupEnabled(){return Fo()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){a(this,U)&&a(this,I,_n)?.hide()}firstUpdated(){Fo()&&fe.molin_widget_open_state?.isOpen&&!a(this,U)&&(m(this,U,!0),m(this,Be,!0),this.requestUpdate())}openChat({message:r,autoSend:n=!1}={}){if(a(this,U)){y(this,I,Go).call(this,{message:r,autoSend:n});return}let i=a(this,I,Zo);i&&typeof i.connect=="function"&&i.connect(),m(this,U,!0),m(this,Be,!0),this.requestUpdate(),y(this,I,At).call(this,!0),a(this,I,_n)?.hide(),setTimeout(()=>{y(this,I,Go).call(this,{message:r,autoSend:n})},200),F("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:a(this,U)?"open":"close"})}closeChat(){a(this,U)&&(m(this,U,!1),this._floatingInputVisible=!0,this.requestUpdate(),y(this,I,At).call(this,!1),a(this,I,_n)?.hide(),F("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:a(this,U)?"open":"close"}))}showLauncher(){let r=Gi();r.hidden=!1,this.requestUpdate(),F("ShopAssistant: called show launcher",{widgetId:this.widgetId,source:"programmatic-method"})}hideLauncher(){let r=Gi();r.hidden=!0,this.requestUpdate(),F("ShopAssistant: called hide launcher",{widgetId:this.widgetId,source:"programmatic-method"})}injectConfig(r){m(this,Mn,r),this.requestUpdate()}reset(){this.xUserData={},this.xCustomInstructions="",a(this,I,Mt)?.reset(),this.requestUpdate()}};ts=new WeakMap,Xo=new WeakMap,Mn=new WeakMap,Yo=new WeakMap,U=new WeakMap,Be=new WeakMap,rs=new WeakMap,I=new WeakSet,zo=function(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647},Wo=function(){return this.config?.floatingAskAI?.enabled||!0},_n=function(){return this.renderRoot.querySelector("mw-popup")},Mt=function(){return this.renderRoot.querySelector("mw-chat")},Zo=function(){return this.renderRoot.querySelector("mw-context-widget")},vc=function(){m(this,U,!0),m(this,Be,!0),this.requestUpdate(),y(this,I,At).call(this,!0),F("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:a(this,U)?"open":"close"})},xc=function(){m(this,U,!a(this,U)),m(this,Be,!0),this.requestUpdate(),y(this,I,At).call(this,a(this,U)),a(this,I,_n)?.hide(),F("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:a(this,U)?"open":"close"})},bc=function(){m(this,U,!1),this._floatingInputVisible=!0,this.requestUpdate(),y(this,I,At).call(this,!1),F("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:a(this,U)?"open":"close"})},ns=new WeakMap,Go=function({message:r,autoSend:n=!1}={}){if(!r)return;y(this,I,Ko).call(this,r);let i=a(this,I,Mt)?.isLiveMode;i||this.reset(),n&&!i&&y(this,I,Jo).call(this,r).catch(console.warn)},Jo=async function(r){let n=a(this,I,Mt);if(!n){console.warn("Chat element not found, cannot send message");return}n.sendMessage?await n.sendMessage(r):console.warn("Chat element does not have sendMessage method")},Ko=function(r){let n=a(this,I,Mt);if(!n){console.warn("Chat element not found, cannot set input value");return}n.setInputValue?n.setInputValue(r):console.warn("Chat element does not have setInputValue method")},At=function(r){fe.molin_widget_open_state={isOpen:r}},g(Se,"styles",ie`
2095
+ `}get isPopupEnabled(){return Ra()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){this._dialogShown&&a(this,T,Yn)?.hide(),this._dialogShown&&setTimeout(()=>{a(this,T,ct)?.focusInput()},0)}firstUpdated(){Ra()&&ye.molin_widget_open_state?.isOpen&&!this._dialogShown&&(this._dialogShown=!0,g(this,Ke,!0),this.requestUpdate())}openChat(r){let{message:n,autoSend:i}=r||{};if(this._dialogShown){m(this,T,Ha).call(this,{message:n,autoSend:i});return}let s=a(this,T,Fa);s&&typeof s.connect=="function"&&s.connect(),this._dialogShown=!0,g(this,Ke,!0),this.requestUpdate(),m(this,T,Ft).call(this,!0),a(this,T,Yn)?.hide(),setTimeout(()=>{m(this,T,Ha).call(this,{message:n,autoSend:i})},200),q("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:this._dialogShown?"open":"close"})}closeChat(){this._dialogShown&&(this._dialogShown=!1,this._floatingInputVisible=!0,this.requestUpdate(),m(this,T,Ft).call(this,!1),a(this,T,Yn)?.hide(),q("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:this._dialogShown?"open":"close"}))}showLauncher(){let r=bs();r.hidden=!1,this.requestUpdate(),q("ShopAssistant: called show launcher",{widgetId:this.widgetId,source:"programmatic-method"})}hideLauncher(){let r=bs();r.hidden=!0,this.requestUpdate(),q("ShopAssistant: called hide launcher",{widgetId:this.widgetId,source:"programmatic-method"})}injectConfig(r){g(this,Qn,r),this.requestUpdate()}reset(){this.xUserData={},this.xCustomInstructions="",a(this,T,ct)?.reset(),this.requestUpdate()}};Rs=new WeakMap,Wa=new WeakMap,Qn=new WeakMap,Ga=new WeakMap,Ke=new WeakMap,Bs=new WeakMap,T=new WeakSet,Va=function(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647},Na=function(){return this.config?.floatingAskAI?.enabled||!0},Yn=function(){return this.renderRoot.querySelector("mw-popup")},ct=function(){return this.renderRoot.querySelector("mw-chat")},Fa=function(){return this.renderRoot.querySelector("mw-context-widget")},jp=function(){this._dialogShown=!0,g(this,Ke,!0),this.requestUpdate(),m(this,T,Ft).call(this,!0),q("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:this._dialogShown?"open":"close"})},Dp=function(){this._dialogShown=!this._dialogShown,g(this,Ke,!0),this.requestUpdate(),m(this,T,Ft).call(this,this._dialogShown),a(this,T,Yn)?.hide(),q("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:this._dialogShown?"open":"close"})},Pp=function(){this._dialogShown=!1,this._floatingInputVisible=!0,this.requestUpdate(),m(this,T,Ft).call(this,!1),q("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:this._dialogShown?"open":"close"})},Vs=new WeakMap,Ha=function({message:r,autoSend:n=!1}={}){if(!r)return;m(this,T,qa).call(this,r);let i=a(this,T,ct)?.isLiveMode;i||this.reset(),n&&!i&&m(this,T,za).call(this,r).catch(console.warn)},za=async function(r){let n=a(this,T,ct);if(!n){console.warn("Chat element not found, cannot send message");return}n.sendMessage?await n.sendMessage(r):console.warn("Chat element does not have sendMessage method")},qa=function(r){let n=a(this,T,ct);if(!n){console.warn("Chat element not found, cannot set input value");return}n.setInputValue?n.setInputValue(r):console.warn("Chat element does not have setInputValue method")},Ft=function(r){ye.molin_widget_open_state={isOpen:r}},w(Te,"styles",ae`
1991
2096
  :host {
1992
2097
  all: initial; /* reset all properties that can pierce the shadow DOM */
1993
2098
  }
1994
- `),g(Se,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1},_floatingInputVisible:{type:Boolean,state:!0}});customElements.get("molin-shop-ai")||customElements.define("molin-shop-ai",Se);export{Se as MolinShopAI};
2099
+ `),w(Te,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1},_floatingInputVisible:{type:Boolean,state:!0},_dialogShown:{type:Boolean,state:!0}});customElements.get("molin-shop-ai")||customElements.define("molin-shop-ai",Te);export{Te as MolinShopAI};
1995
2100
  /*! Bundled license information:
1996
2101
 
1997
2102
  @lit/reactive-element/css-tag.js: