@molin.ai/shop-ai 0.9.74 → 0.9.76

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,6 +1,6 @@
1
- var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDescriptor;var Al=Object.getOwnPropertyNames;var Tl=Object.getPrototypeOf,Dl=Object.prototype.hasOwnProperty;var Je=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ml=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Al(e))!Dl.call(t,n)&&n!==r&&hs(t,n,{get:()=>e[n],enumerable:!(i=Il(e,n))||i.enumerable});return t};var pi=(t,e,r)=>(r=t!=null?Sl(Tl(t)):{},Ml(e||!t||!t.__esModule?hs(r,"default",{value:t,enumerable:!0}):r,t));var Wi=Je(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.parseCookie=ro;le.parse=ro;le.stringifyCookie=vc;le.stringifySetCookie=wr;le.serialize=wr;le.parseSetCookie=wc;le.stringifySetCookie=wr;le.serialize=wr;var eo=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,to=/^[\u0021-\u003A\u003C-\u007E]*$/,fc=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,mc=/^[\u0020-\u003A\u003D-\u007E]*$/,gc=/^-?\d+$/,yc=Object.prototype.toString,bc=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function ro(t,e){let r=new bc,i=t.length;if(i<2)return r;let n=e?.decode||io,s=0;do{let o=zi(t,s,i);if(o===-1)break;let a=Ni(t,s,i);if(o>a){s=t.lastIndexOf(";",o-1)+1;continue}let l=Ce(t,s,o);r[l]===void 0&&(r[l]=n(Ce(t,o+1,a))),s=a+1}while(s<i);return r}function vc(t,e){let r=e?.encode||encodeURIComponent,i=[];for(let n of Object.keys(t)){let s=t[n];if(s===void 0)continue;if(!eo.test(n))throw new TypeError(`cookie name is invalid: ${n}`);let o=r(s);if(!to.test(o))throw new TypeError(`cookie val is invalid: ${s}`);i.push(`${n}=${o}`)}return i.join("; ")}function wr(t,e,r){let i=typeof t=="object"?t:{...r,name:t,value:String(e)},s=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!eo.test(i.name))throw new TypeError(`argument name is invalid: ${i.name}`);let o=i.value?s(i.value):"";if(!to.test(o))throw new TypeError(`argument val is invalid: ${i.value}`);let a=i.name+"="+o;if(i.maxAge!==void 0){if(!Number.isInteger(i.maxAge))throw new TypeError(`option maxAge is invalid: ${i.maxAge}`);a+="; Max-Age="+i.maxAge}if(i.domain){if(!fc.test(i.domain))throw new TypeError(`option domain is invalid: ${i.domain}`);a+="; Domain="+i.domain}if(i.path){if(!mc.test(i.path))throw new TypeError(`option path is invalid: ${i.path}`);a+="; Path="+i.path}if(i.expires){if(!xc(i.expires)||!Number.isFinite(i.expires.valueOf()))throw new TypeError(`option expires is invalid: ${i.expires}`);a+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.partitioned&&(a+="; Partitioned"),i.priority)switch(typeof i.priority=="string"?i.priority.toLowerCase():void 0){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${i.priority}`)}if(i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:case"strict":a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"none":a+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${i.sameSite}`)}return a}function wc(t,e){let r=e?.decode||io,i=t.length,n=Ni(t,0,i),s=zi(t,0,n),o=s===-1?{name:"",value:r(Ce(t,0,n))}:{name:Ce(t,0,s),value:r(Ce(t,s+1,n))},a=n+1;for(;a<i;){let l=Ni(t,a,i),c=zi(t,a,l),d=c===-1?Ce(t,a,l):Ce(t,a,c),p=c===-1?void 0:Ce(t,c+1,l);switch(d.toLowerCase()){case"httponly":o.httpOnly=!0;break;case"secure":o.secure=!0;break;case"partitioned":o.partitioned=!0;break;case"domain":o.domain=p;break;case"path":o.path=p;break;case"max-age":p&&gc.test(p)&&(o.maxAge=Number(p));break;case"expires":if(!p)break;let h=new Date(p);Number.isFinite(h.valueOf())&&(o.expires=h);break;case"priority":if(!p)break;let y=p.toLowerCase();(y==="low"||y==="medium"||y==="high")&&(o.priority=y);break;case"samesite":if(!p)break;let f=p.toLowerCase();(f==="lax"||f==="strict"||f==="none")&&(o.sameSite=f);break}a=l+1}return o}function Ni(t,e,r){let i=t.indexOf(";",e);return i===-1?r:i}function zi(t,e,r){let i=t.indexOf("=",e);return i<r?i:-1}function Ce(t,e,r){let i=e,n=r;do{let s=t.charCodeAt(i);if(s!==32&&s!==9)break}while(++i<n);for(;n>i;){let s=t.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}return t.slice(i,n)}function io(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function xc(t){return yc.call(t)==="[object Date]"}});var ia=Je(qe=>{"use strict";var au=qe&&qe.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},lu=qe&&qe.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=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++,n=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(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(qe,"__esModule",{value:!0});qe.base64ToBlob=cu;function cu(t){return au(this,void 0,void 0,function(){var e,r,i;return lu(this,function(n){switch(n.label){case 0:return[4,fetch(t)];case 1:return e=n.sent(),[4,e.blob()];case 2:return r=n.sent(),i=du(t),i&&(r=r.slice(0,r.size,i)),[2,r]}})})}var uu=/^data:(.+);base64,/;function du(t){var e;return(e=t.match(uu))===null||e===void 0?void 0:e.slice(1,2).pop()}});var na=Je(Be=>{"use strict";var pu=Be&&Be.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},hu=Be&&Be.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=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++,n=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(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Be,"__esModule",{value:!0});Be.base64ToFile=fu;function fu(t,e,r){return pu(this,void 0,void 0,function(){var i,n;return hu(this,function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:return i=s.sent(),[4,i.blob()];case 2:return n=s.sent(),[2,new File([n],e,r)]}})})}});var bn=Je(Ne=>{"use strict";var gn=Ne&&Ne.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},yn=Ne&&Ne.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=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++,n=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(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.blobToBase64=mu;function mu(t){return gn(this,void 0,void 0,function(){return yn(this,function(e){return[2,typeof FileReader=="function"?gu(t):bu(t)]})})}var lt;(function(t){t.error="error",t.loadend="loadend"})(lt||(lt={}));function gu(t){return gn(this,void 0,void 0,function(){return yn(this,function(e){return[2,new Promise(function(r,i){try{var n=new FileReader,s=function(){r(n.result),n.removeEventListener(lt.loadend,s)};n.addEventListener(lt.loadend,s);var o=function(){i(n.error),n.removeEventListener(lt.error,o)};n.addEventListener(lt.error,o),n.readAsDataURL(t)}catch(a){i(a)}})]})})}var yu="application/octet-stream";function bu(t){return gn(this,void 0,void 0,function(){var e,r,i,n;return yn(this,function(s){switch(s.label){case 0:return i=(r=Buffer).from,[4,t.text()];case 1:return e=i.apply(r,[s.sent()]),n=t.type||yu,[2,"data:".concat(n,";base64,").concat(e.toString("base64"))]}})})}});var sa=Je(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.fileToBase64=void 0;var vu=bn();Object.defineProperty(Or,"fileToBase64",{enumerable:!0,get:function(){return vu.blobToBase64}})});var oa=Je(ue=>{"use strict";var wu=ue&&ue.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),Pr=ue&&ue.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wu(e,t,r)};Object.defineProperty(ue,"__esModule",{value:!0});Pr(ia(),ue);Pr(na(),ue);Pr(bn(),ue);Pr(sa(),ue)});var Zt=globalThis,er=Zt.ShadowRoot&&(Zt.ShadyCSS===void 0||Zt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,hi=Symbol(),fs=new WeakMap,xt=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==hi)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(er&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=fs.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&fs.set(r,e))}return e}toString(){return this.cssText}},ms=t=>new xt(typeof t=="string"?t:t+"",void 0,hi),O=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((i,n,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new xt(r,t,hi)},gs=(t,e)=>{if(er)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=Zt.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},fi=er?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return ms(r)})(t):t;var{is:Ol,defineProperty:Pl,getOwnPropertyDescriptor:Ul,getOwnPropertyNames:Ll,getOwnPropertySymbols:jl,getPrototypeOf:Rl}=Object,tr=globalThis,ys=tr.trustedTypes,Fl=ys?ys.emptyScript:"",ql=tr.reactiveElementPolyfillSupport,kt=(t,e)=>t,mi={toAttribute(t,e){switch(e){case Boolean:t=t?Fl: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}},vs=(t,e)=>!Ol(t,e),bs={attribute:!0,type:String,converter:mi,reflect:!1,useDefault:!1,hasChanged:vs};Symbol.metadata??=Symbol("metadata"),tr.litPropertyMetadata??=new WeakMap;var me=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=bs){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 i=Symbol(),n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Pl(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){let{get:n,set:s}=Ul(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get:n,set(o){let a=n?.call(this);s?.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??bs}static _$Ei(){if(this.hasOwnProperty(kt("elementProperties")))return;let e=Rl(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(kt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(kt("properties"))){let r=this.properties,i=[...Ll(r),...jl(r)];for(let n of i)this.createProperty(n,r[n])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[i,n]of r)this.elementProperties.set(i,n)}this._$Eh=new Map;for(let[r,i]of this.elementProperties){let n=this._$Eu(r,i);n!==void 0&&this._$Eh.set(n,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)r.unshift(fi(n))}else e!==void 0&&r.push(fi(e));return r}static _$Eu(e,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i: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 i of r.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return gs(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,i){this._$AK(e,i)}_$ET(e,r){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:mi).toAttribute(r,i.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,r){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=i.getPropertyOptions(n),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:mi;this._$Em=n;let a=o.fromAttribute(r,s.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(e,r,i,n=!1,s){if(e!==void 0){let o=this.constructor;if(n===!1&&(s=this[e]),i??=o.getPropertyOptions(e),!((i.hasChanged??vs)(s,r)||i.useDefault&&i.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,r,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:i,reflect:n,wrapped:s},o){i&&!(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||i||(r=void 0),this._$AL.set(e,r)),n===!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[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[n,s]of i){let{wrapped:o}=s,a=this[n];o!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,s,a)}}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(r)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}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){}};me.elementStyles=[],me.shadowRootOptions={mode:"open"},me[kt("elementProperties")]=new Map,me[kt("finalized")]=new Map,ql?.({ReactiveElement:me}),(tr.reactiveElementVersions??=[]).push("2.1.2");var yi=globalThis,ws=t=>t,rr=yi.trustedTypes,xs=rr?rr.createPolicy("lit-html",{createHTML:t=>t}):void 0,bi="$lit$",ge=`lit$${Math.random().toFixed(9).slice(2)}$`,vi="?"+ge,Bl=`<${vi}>`,Ue=document,Ct=()=>Ue.createComment(""),Et=t=>t===null||typeof t!="object"&&typeof t!="function",wi=Array.isArray,Ss=t=>wi(t)||typeof t?.[Symbol.iterator]=="function",gi=`[
2
- \f\r]`,_t=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ks=/-->/g,_s=/>/g,Oe=RegExp(`>|${gi}(?:([^\\s"'>=/]+)(${gi}*=${gi}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Cs=/'/g,Es=/"/g,Is=/^(?:script|style|textarea|title)$/i,xi=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),u=xi(1),Md=xi(2),Od=xi(3),ne=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),$s=new WeakMap,Pe=Ue.createTreeWalker(Ue,129);function As(t,e){if(!wi(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return xs!==void 0?xs.createHTML(e):e}var Ts=(t,e)=>{let r=t.length-1,i=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=_t;for(let a=0;a<r;a++){let l=t[a],c,d,p=-1,h=0;for(;h<l.length&&(o.lastIndex=h,d=o.exec(l),d!==null);)h=o.lastIndex,o===_t?d[1]==="!--"?o=ks:d[1]!==void 0?o=_s:d[2]!==void 0?(Is.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Oe):d[3]!==void 0&&(o=Oe):o===Oe?d[0]===">"?(o=n??_t,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Oe:d[3]==='"'?Es:Cs):o===Es||o===Cs?o=Oe:o===ks||o===_s?o=_t:(o=Oe,n=void 0);let y=o===Oe&&t[a+1].startsWith("/>")?" ":"";s+=o===_t?l+Bl:p>=0?(i.push(c),l.slice(0,p)+bi+l.slice(p)+ge+y):l+ge+(p===-2?a:y)}return[As(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},$t=class t{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,o=0,a=e.length-1,l=this.parts,[c,d]=Ts(e,r);if(this.el=t.createElement(c,i),Pe.currentNode=this.el.content,r===2||r===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=Pe.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let p of n.getAttributeNames())if(p.endsWith(bi)){let h=d[o++],y=n.getAttribute(p).split(ge),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:s,name:f[2],strings:y,ctor:f[1]==="."?nr:f[1]==="?"?sr:f[1]==="@"?or:je}),n.removeAttribute(p)}else p.startsWith(ge)&&(l.push({type:6,index:s}),n.removeAttribute(p));if(Is.test(n.tagName)){let p=n.textContent.split(ge),h=p.length-1;if(h>0){n.textContent=rr?rr.emptyScript:"";for(let y=0;y<h;y++)n.append(p[y],Ct()),Pe.nextNode(),l.push({type:2,index:++s});n.append(p[h],Ct())}}}else if(n.nodeType===8)if(n.data===vi)l.push({type:2,index:s});else{let p=-1;for(;(p=n.data.indexOf(ge,p+1))!==-1;)l.push({type:7,index:s}),p+=ge.length-1}s++}}static createElement(e,r){let i=Ue.createElement("template");return i.innerHTML=e,i}};function Le(t,e,r=t,i){if(e===ne)return e;let n=i!==void 0?r._$Co?.[i]:r._$Cl,s=Et(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(t),n._$AT(t,r,i)),i!==void 0?(r._$Co??=[])[i]=n:r._$Cl=n),n!==void 0&&(e=Le(t,n._$AS(t,e.values),n,i)),e}var ir=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:i}=this._$AD,n=(e?.creationScope??Ue).importNode(r,!0);Pe.currentNode=n;let s=Pe.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Ke(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new ar(s,this,e)),this._$AV.push(c),l=i[++a]}o!==l?.index&&(s=Pe.nextNode(),o++)}return Pe.currentNode=Ue,n}p(e){let r=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}},Ke=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,i,n){this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=n,this._$Cv=n?.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=Le(this,e,r),Et(e)?e===U||e==null||e===""?(this._$AH!==U&&this._$AR(),this._$AH=U):e!==this._$AH&&e!==ne&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ss(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!==U&&Et(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ue.createTextNode(e)),this._$AH=e}$(e){let{values:r,_$litType$:i}=e,n=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=$t.createElement(As(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(r);else{let s=new ir(n,this),o=s.u(this.options);s.p(r),this.T(o),this._$AH=s}}_$AC(e){let r=$s.get(e.strings);return r===void 0&&$s.set(e.strings,r=new $t(e)),r}k(e){wi(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,i,n=0;for(let s of e)n===r.length?r.push(i=new t(this.O(Ct()),this.O(Ct()),this,this.options)):i=r[n],i._$AI(s),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e!==this._$AB;){let i=ws(e).nextSibling;ws(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},je=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,i,n,s){this.type=1,this._$AH=U,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=U}_$AI(e,r=this,i,n){let s=this.strings,o=!1;if(s===void 0)e=Le(this,e,r,0),o=!Et(e)||e!==this._$AH&&e!==ne,o&&(this._$AH=e);else{let a=e,l,c;for(e=s[0],l=0;l<s.length-1;l++)c=Le(this,a[i+l],r,l),c===ne&&(c=this._$AH[l]),o||=!Et(c)||c!==this._$AH[l],c===U?e=U:e!==U&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!n&&this.j(e)}j(e){e===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},nr=class extends je{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}},sr=class extends je{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==U)}},or=class extends je{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){if((e=Le(this,e,r,0)??U)===ne)return;let i=this._$AH,n=e===U&&i!==U||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==U&&(i===U||n);n&&this.element.removeEventListener(this.name,this,i),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)}},ar=class{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Le(this,e)}},Ds={M:bi,P:ge,A:vi,C:1,L:Ts,R:ir,D:Ss,V:Le,I:Ke,H:je,N:sr,U:or,B:nr,F:ar},Nl=yi.litHtmlPolyfillSupport;Nl?.($t,Ke),(yi.litHtmlVersions??=[]).push("3.3.2");var Ms=(t,e,r)=>{let i=r?.renderBefore??e,n=i._$litPart$;if(n===void 0){let s=r?.renderBefore??null;i._$litPart$=n=new Ke(e.insertBefore(Ct(),s),s,void 0,r??{})}return n._$AI(t),n};var ki=globalThis,v=class extends me{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=Ms(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ne}};v._$litElement$=!0,v.finalized=!0,ki.litElementHydrateSupport?.({LitElement:v});var zl=ki.litElementPolyfillSupport;zl?.({LitElement:v});(ki.litElementVersions??=[]).push("4.2.2");var lr=class{#e;#t;#r;constructor(e,r){if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");this.#e=e,this.#e.addController(this),this.#t=r}connect(e){this.#t=e,this.#r=this.#n()}hostConnected(){this.#r||setTimeout(()=>{this.#r||(this.#r=this.#n())},0)}hostDisconnected(){this.#r?.close(1e3,"lit_host_disconnected"),this.#r=void 0}send(e){this.#r?.send(e)}close(e,r){this.#r?.close(e,r)}get isConnected(){return this.#r?.readyState===WebSocket.OPEN}get isConnecting(){return this.#r?.readyState===WebSocket.CONNECTING}#n(){let e=new WebSocket(this.#t.url());return this.#t.onClose&&(e.onclose=this.#t.onClose),this.#t.onOpen&&(e.onopen=this.#t.onOpen),this.#t.onError&&(e.onerror=this.#t.onError),this.#t.onMessage&&(e.onmessage=this.#t.onMessage),e}};async function _i(t){await new Promise(e=>setTimeout(e,t))}async function cr({times:t=3,backoff:e=0},r){let i=n=>{throw{_bailed:n}};for(let n=0;n<t;n++)try{return await r(i,n)}catch(s){if(s&&typeof s=="object"&&"_bailed"in s)throw s._bailed;if(n===t-1)throw s;if(typeof e=="number")await _i(e);else if(typeof e=="function")await _i(e(n+1));else throw new TypeError("Invalid backoff option")}throw new Error("unreachable")}var Wl=!0,Ci="Invariant failed";function D(t,e){if(!t){if(Wl)throw new Error(Ci);var r=typeof e=="function"?e():e,i=r?"".concat(Ci,": ").concat(r):Ci;throw new Error(i)}}function Ei(t,e,r){return t.slice(0,r)+e}function Vl({content:t,parts:e,appendMessage:r}){let i=[...e],n=t,s=r.part??0;switch(r.content_type){case"text":{let{delta:o,position:a}=r;n=Ei(n,o,a);let l=i[s]&&"text"in i[s]?i[s].text:"";i[s]={text:l?Ei(l,o,a):o};break}case"html":{let{delta:o,position:a}=r,l=i[s]&&"html"in i[s]?i[s].html:"";i[s]={html:l?Ei(l,o,a):o};break}case"data":{let o=i[s]&&"data"in i[s]?i[s].data:{};i[s]={tag:r.tag,data:Object.assign({},o,r.data)};break}}return{content:n,parts:i}}var ur=class{messages=Object.freeze([]);onEvent(e){switch(e.type){case"NEW_MESSAGE":{let r={...e.message,streaming:!0,parts:e.message.parts};return this.messages=Object.freeze([...this.messages.filter(i=>i.id!==r.id),r]),r}case"APPEND_MESSAGE":{let i=this.messages.find(s=>s.id===e.message.id)??(()=>{let s={id:e.message.id,timestamp:Date.now(),role:"assistant",content:"",streaming:!0,parts:[]};return this.messages=Object.freeze([...this.messages,s]),s})(),n=Vl({content:i.content,parts:i.parts||[],appendMessage:e.message});return i.content=n.content,i.parts=n.parts,e.metadata&&(i.metadata=e.metadata),i}case"MESSAGE_DONE":{let r=this.messages.find(i=>i.id===e.message.id);return r?(Object.assign(r,e.message),r.streaming=!1,r):void 0}default:return}}onEvents(e){for(let r of e)this.onEvent(r)}getMessage(e){return this.messages.find(r=>r.id===e)}get lastMessage(){return this.messages.at(-1)}reset(){this.messages=Object.freeze([])}};var dr=class{#e;#t;#r=null;#n=new ur;isStreaming=!1;typingIndicator;toolCallIndicator;ranOutOfCredits=!1;get messages(){return this.#n.messages}set messages(e){this.#n.messages=e}conversationId="";#i=0;#s;isLiveMode=!1;get hasQueuedMessages(){return this.#o.length>0}constructor(e,r){this.#e=e,this.#t=r,this.#t.autoConnect!==!1&&(this.#r=this.initWS()),e.addController(this)}#o=[];#a(e,{expectStreaming:r=!1}={}){return this.ranOutOfCredits?!1:this.#r?this.#r.isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):this.#r.isConnected?(r&&!this.isLiveMode&&(this.isStreaming=!0,this.#e.requestUpdate()),this.#r.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)}async enqueueMessage(e,{expectStreaming:r=!1}={}){if(this.#o.length>0){let i=this.#o[this.#o.length-1];if(e.type==="USER_INPUT"&&i.message.type==="USER_INPUT"&&e.value===i.message.value)return!0}return this.#r||this.connect(),this.#r?.isConnected?this.#a(e,{expectStreaming:r}):(this.#o.push({message:e,options:{expectStreaming:r}}),this.#e.requestUpdate(),this.#r&&!this.#r.isConnecting&&!this.#r.isConnected&&this.retry(),await cr({times:5,backoff:2e3},async()=>{if(this.#r?.isConnected){let i=[...this.#o];this.#o=[],this.#e.requestUpdate();let n=!1;for(let{message:s,options:o}of i){let a=this.#a(s,o);s===e&&(n=a)}return n}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),this.#o=[],this.#e.requestUpdate(),!1)))}async sendUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i},{expectStreaming:s})}async sendUserFeedback(e){return this.enqueueMessage({type:"USER_FEEDBACK",responses:e},{expectStreaming:!0})}sendFileDelete(e){D(e,"fileId is required"),this.enqueueMessage({type:"USER_FILE_DELETE",fileId:e}).catch(console.warn)}sendUserCancel(){this.enqueueMessage({type:"USER_CANCEL"}).catch(console.warn)}sendUserTypingStart(){this.#a({type:"USER_TYPING_START"})}sendUserTypingStop(){this.enqueueMessage({type:"USER_TYPING_STOP"}).catch(console.warn)}sendNewChat(){this.enqueueMessage({type:"NEW_CHAT"})}sendUserMeta(e){this.enqueueMessage({type:"USER_META",metadata:e}).catch(console.warn)}reloadConfig(){this.enqueueMessage({type:"RELOAD_CONFIG"}).catch(console.warn)}close(){this.#r?.close(1e3,"closed by user")}retry(){clearTimeout(this.#s),this.#s=setTimeout(()=>{this.#t.onReconnect?.(),this.#r=this.initWS()},1e3*this.#i),this.#i++}initWS(){return new lr(this.#e,{url:()=>this.#t.url(this.conversationId,{}),onOpen:e=>this.#l(e),onMessage:e=>this.#c(JSON.parse(e.data)),onError:e=>this.#d(e),onClose:e=>this.#u(e)})}#l(e){this.#i=0}#c(e){switch(e.type){case"NEW_MESSAGE":{this.#n.onEvent(e),this.typingIndicator=void 0,this.toolCallIndicator=void 0,this.#t.onNewMessage?.(e.message),this.#t.persistConversationState?.(this.conversationId,this.messages),this.#e.requestUpdate();break}case"APPEND_MESSAGE":{let r=!this.#n.getMessage(e.message.id),i=this.#n.onEvent(e);i&&(this.typingIndicator=void 0,this.toolCallIndicator=void 0,r&&(this.#t.onNewMessage?.({id:i.id,timestamp:i.timestamp,role:i.role,content:i.content}),this.#t.persistConversationState?.(this.conversationId,this.messages)),this.#t.onMessageAppend?.(e),this.#e.requestUpdate());break}case"MESSAGE_DONE":{let r=this.#n.onEvent(e);if(!r)throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,this.#e.requestUpdate(),this.#t.onMessageDone?.(e,r),this.#t.persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate();break}case"ERROR":{this.#t.onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.#n.messages=e.messages,this.#t.onConnect?.(e.conversationId,e.metadata),this.#t.persistConversationState?.(e.conversationId,e.messages),this.isLiveMode=e.metadata.isLiveMode,this.#e.requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.toolCallIndicator=void 0,this.typingIndicator={role:e.role,metadata:e.metadata},this.#e.requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,this.#e.requestUpdate();break}case"TOOL_CALL_START":{this.typingIndicator=void 0,this.toolCallIndicator=e.text,this.#e.requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,this.#e.requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),this.#e.requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}}#d(e){console.error("onError",e),this.#t.onError?.(e)}#u(e){this.#e.isConnected&&this.#r&&!this.#r.isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate(),this.#t.onClose?.()}hostConnected(){this.conversationId=this.#t.restoreConversationState?.()?.conversationId||"",this.#n.messages=this.#t.restoreConversationState?.()?.messages||[]}reset(){this.#t.onReset?.(),this.#n.reset(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.conversationId="",this.isLiveMode=!1,this.#o=[],this.#e.requestUpdate()}hostDisconnected(){clearTimeout(this.#s)}connect(){this.#r||(this.#r=this.initWS())}reconnectSocket(){this.#r?.close(1e3,"destroy"),this.#r=this.initWS()}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}get isConnected(){return this.#r?.isConnected??!1}};var $i;function Ps(t){return{lang:t?.lang??$i?.lang,message:t?.message,abortEarly:t?.abortEarly??$i?.abortEarly,abortPipeEarly:t?.abortPipeEarly??$i?.abortPipeEarly}}var Hl;function Gl(t){return Hl?.get(t)}var Xl;function Jl(t){return Xl?.get(t)}var Kl;function Yl(t,e){return Kl?.get(t)?.get(e)}function Us(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 H(t,e,r,i,n){let s=n&&"input"in n?n.input:r.value,o=n?.expected??t.expects??null,a=n?.received??Us(s),l={kind:t.kind,type:t.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:n?.path,issues:n?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},c=t.kind==="schema",d=n?.message??t.message??Yl(t.reference,l.lang)??(c?Jl(l.lang):null)??i.message??Gl(l.lang);d!==void 0&&(l.message=typeof d=="function"?d(l):d),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function G(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Ps())}}}function Ql(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Ls(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var Zl=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z|[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;function Si(t){return{kind:"validation",type:"iso_timestamp",reference:Si,async:!1,expects:null,requirement:Zl,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&H(this,"timestamp",e,r),e}}}function Ii(t,e){return{kind:"validation",type:"max_length",reference:Ii,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(r,i){return r.typed&&r.value.length>this.requirement&&H(this,"length",r,i,{received:`${r.value.length}`}),r}}}function Ai(t,e){return{kind:"validation",type:"min_length",reference:Ai,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,i){return r.typed&&r.value.length<this.requirement&&H(this,"length",r,i,{received:`${r.value.length}`}),r}}}function Ti(t){return{kind:"transformation",type:"to_date",reference:Ti,async:!1,message:t,"~run"(e,r){try{e.value=new Date(e.value),isNaN(e.value)&&(H(this,"date",e,r,{received:'"Invalid Date"'}),e.typed=!1)}catch{H(this,"date",e,r),e.typed=!1}return e}}}function Di(t){return{kind:"transformation",type:"transform",reference:Di,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function js(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function Q(t,e){return{...t,fallback:e,get"~standard"(){return G(this)},"~run"(r,i){let n=t["~run"](r,i);return n.issues?{typed:!0,value:js(this,n,i)}:n}}}function Mi(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function St(){return{kind:"schema",type:"any",reference:St,expects:"any",async:!1,get"~standard"(){return G(this)},"~run"(t){return t.typed=!0,t}}}function Ye(t,e){return{kind:"schema",type:"array",reference:Ye,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return G(this)},"~run"(r,i){let n=r.value;if(Array.isArray(n)){r.typed=!0,r.value=[];for(let s=0;s<n.length;s++){let o=n[s],a=this.item["~run"]({value:o},i);if(a.issues){let l={type:"array",origin:"value",input:n,key:s,value:o};for(let c of a.issues)c.path?c.path.unshift(l):c.path=[l],r.issues?.push(c);if(r.issues||(r.issues=a.issues),i.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value.push(a.value)}}else H(this,"type",r,i);return r}}}function Oi(t){return{kind:"schema",type:"boolean",reference:Oi,expects:"boolean",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:H(this,"type",e,r),e}}}function Pi(t){return{kind:"schema",type:"null",reference:Pi,expects:"null",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return e.value===null?e.typed=!0:H(this,"type",e,r),e}}}function pr(t,e){return{kind:"schema",type:"nullish",reference:pr,expects:`(${t.expects} | null | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return G(this)},"~run"(r,i){return(r.value===null||r.value===void 0)&&(this.default!==void 0&&(r.value=Mi(this,r,i)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function hr(t){return{kind:"schema",type:"number",reference:hr,expects:"number",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:H(this,"type",e,r),e}}}function B(t,e){return{kind:"schema",type:"object",reference:B,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return G(this)},"~run"(r,i){let n=r.value;if(n&&typeof n=="object"){r.typed=!0,r.value={};for(let s in this.entries){let o=this.entries[s];if(s in n||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){let a=s in n?n[s]:Mi(o),l=o["~run"]({value:a},i);if(l.issues){let c={type:"object",origin:"value",input:n,key:s,value:a};for(let d of l.issues)d.path?d.path.unshift(c):d.path=[c],r.issues?.push(d);if(r.issues||(r.issues=l.issues),i.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value[s]=l.value}else if(o.fallback!==void 0)r.value[s]=js(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(H(this,"key",r,i,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:n,key:s,value:n[s]}]}),i.abortEarly))break}}else H(this,"type",r,i);return r}}}function A(t,e){return{kind:"schema",type:"optional",reference:A,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return G(this)},"~run"(r,i){return r.value===void 0&&(this.default!==void 0&&(r.value=Mi(this,r,i)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function It(t,e){return{kind:"schema",type:"picklist",reference:It,expects:Ls(t.map(Us),"|"),async:!1,options:t,message:e,get"~standard"(){return G(this)},"~run"(r,i){return this.options.includes(r.value)?r.typed=!0:H(this,"type",r,i),r}}}function At(t,e,r){return{kind:"schema",type:"record",reference:At,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return G(this)},"~run"(i,n){let s=i.value;if(s&&typeof s=="object"){i.typed=!0,i.value={};for(let o in s)if(Ql(s,o)){let a=s[o],l=this.key["~run"]({value:o},n);if(l.issues){let d={type:"object",origin:"key",input:s,key:o,value:a};for(let p of l.issues)p.path=[d],i.issues?.push(p);if(i.issues||(i.issues=l.issues),n.abortEarly){i.typed=!1;break}}let c=this.value["~run"]({value:a},n);if(c.issues){let d={type:"object",origin:"value",input:s,key:o,value:a};for(let p of c.issues)p.path?p.path.unshift(d):p.path=[d],i.issues?.push(p);if(i.issues||(i.issues=c.issues),n.abortEarly){i.typed=!1;break}}(!l.typed||!c.typed)&&(i.typed=!1),l.typed&&(i.value[l.value]=c.value)}}else H(this,"type",i,n);return i}}}function C(t){return{kind:"schema",type:"string",reference:C,expects:"string",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:H(this,"type",e,r),e}}}function Os(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function fr(t,e){return{kind:"schema",type:"union",reference:fr,expects:Ls(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return G(this)},"~run"(r,i){let n,s,o;for(let a of this.options){let l=a["~run"]({value:r.value},i);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{n=l;break}else o?o.push(l):o=[l]}if(n)return n;if(s){if(s.length===1)return s[0];H(this,"type",r,i,{issues:Os(s)}),r.typed=!0}else{if(o?.length===1)return o[0];H(this,"type",r,i,{issues:Os(o)})}return r}}}function Rs(t,e){let r={};for(let i in t.entries)r[i]=!e||e.includes(i)?A(t.entries[i]):t.entries[i];return{...t,entries:r,get"~standard"(){return G(this)}}}function Qe(...t){return{...t[0],pipe:t,get"~standard"(){return G(this)},"~run"(e,r){for(let i of t)if(i.kind!=="metadata"){if(e.issues&&(i.kind==="schema"||i.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=i["~run"](e,r))}return e}}}function se(t,e,r){let i=t["~run"]({value:e},Ps(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var mr=Rs(B({url:C(),name:C(),description:C(),price:C()}));function Fs(t){return t.flatMap(e=>{if(!("tag"in e))return[];switch(e.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let r=se(mr,e.data);if(r.success)return[{name:r.output.name??"",price:r.output.price??"0"}];break}case"thought":case"order-status-card-v1":case"order-card-v2":case"live-chat-wait-card-v1":case"live-chat-wait-card-v2":case"request-input-v1":break}return[]})}var ec=Symbol();var qs=Object.getPrototypeOf,Ui=new WeakMap,tc=t=>t&&(Ui.has(t)?Ui.get(t):qs(t)===Object.prototype||qs(t)===Array.prototype);var Bs=t=>tc(t)&&t[ec]||null,Li=(t,e=!0)=>{Ui.set(t,e)};var Ri=t=>typeof t=="object"&&t!==null,rc=t=>Ri(t)&&!Fi.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),Ws=(t,e)=>{let r=Ns.get(t);if(r?.[0]===e)return r[1];let i=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return Li(i,!0),Ns.set(t,[e,i]),Reflect.ownKeys(t).forEach(n=>{if(Object.getOwnPropertyDescriptor(i,n))return;let s=Reflect.get(t,n),{enumerable:o}=Reflect.getOwnPropertyDescriptor(t,n),a={value:s,enumerable:o,configurable:!0};if(Fi.has(s))Li(s,!1);else if(Re.has(s)){let[l,c]=Re.get(s);a.value=Ws(l,c())}Object.defineProperty(i,n,a)}),Object.preventExtensions(i)},ic=(t,e,r,i)=>({deleteProperty(n,s){let o=Reflect.get(n,s);r(s);let a=Reflect.deleteProperty(n,s);return a&&i(gr?.("delete",s,o)),a},set(n,s,o,a){let l=!t()&&Reflect.has(n,s),c=Reflect.get(n,s,a);if(l&&(zs(c,o)||yr.has(o)&&zs(c,yr.get(o))))return!0;r(s),Ri(o)&&(o=Bs(o)||o);let d=!Re.has(o)&&sc(o)?qi(o):o;return e(s,d),Reflect.set(n,s,d,a),i(gr?.("set",s,o,c)),!0}});var Re=new WeakMap,Fi=new WeakSet,Ns=new WeakMap,ji=[1],yr=new WeakMap,zs=Object.is,nc=(t,e)=>new Proxy(t,e),sc=rc,oc=Ws,ac=ic,gr;function qi(t={}){if(!Ri(t))throw new Error("object required");let e=yr.get(t);if(e)return e;let r=ji[0],i=new Set,n=(x,E=++ji[0])=>{r!==E&&(s=r=E,i.forEach(b=>b(x,E)))},s=r,o=(x=ji[0])=>(s!==x&&(s=x,l.forEach(([E])=>{let b=E[1](x);b>r&&(r=b)})),r),a=x=>(E,b)=>{let k;E&&(k=[...E],k[1]=[x,...k[1]]),n(k,b)},l=new Map,c=(x,E)=>{let b=!Fi.has(E)&&Re.get(E);if(b){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(x))throw new Error("prop listener already exists");if(i.size){let k=b[2](a(x));l.set(x,[b,k])}else l.set(x,[b])}},d=x=>{var E;let b=l.get(x);b&&(l.delete(x),(E=b[1])==null||E.call(b))},p=x=>(i.add(x),i.size===1&&l.forEach(([b,k],S)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&k)throw new Error("remove already exists");let P=b[2](a(S));l.set(S,[b,P])}),()=>{i.delete(x),i.size===0&&l.forEach(([b,k],S)=>{k&&(k(),l.set(S,[b]))})}),h=!0,y=ac(()=>h,c,d,n),f=nc(t,y);yr.set(t,f);let $=[t,o,p];return Re.set(f,$),Reflect.ownKeys(t).forEach(x=>{let E=Object.getOwnPropertyDescriptor(t,x);"value"in E&&E.writable&&(f[x]=t[x])}),h=!1,f}function br(t,e,r){let i=Re.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!i&&console.warn("Please use proxy object");let n,s=[],o=i[2],a=!1,c=o(d=>{if(d&&s.push(d),r){e(s.splice(0));return}n||(n=Promise.resolve().then(()=>{n=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,c()}}function Ze(t){let e=Re.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,i]=e;return oc(r,i())}var et=class{#e;#t;#r;#n=()=>{};constructor(e,r){this.#e=e,this.#t=r,this.#r=Ze(r),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#n(),this.#n=br(this.#t,()=>{this.#r=Ze(this.#t),this.#e.requestUpdate()})}hostDisconnected(){this.#n()}};var _e=class{#e;#t;proxyObject;#r;#n=()=>{};constructor(e,r,i){this.#e=e,this.#t=i,this.proxyObject=qi(r),this.#r=Ze(this.proxyObject),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#n(),this.#t?.subscribe&&(this.#n=br(this.proxyObject,()=>{this.#r=Ze(this.proxyObject),this.#e.requestUpdate()}))}hostDisconnected(){this.#n()}};var vr=class{#e;#t;#r;#n=null;#i=null;constructor(e,{provider:r,tag:i,key:n}){this.#e=e,this.#t=i,this.#r=n,e.addController(this)}get value(){return this.#i?this.#i.value:null}hostConnected(){if(this.#i||(this.#n=lc(this.#e,this.#t),!this.#n))return;let e=this.#n[this.#r]instanceof _e?this.#n[this.#r]:null;e&&(this.#i=new et(this.#e,e.proxyObject))}hostDisconnected(){}};function lc(t,e){let r=t;for(;r;){let i=r.closest(e);if(i)return i;let n=r.getRootNode();if(n instanceof ShadowRoot)r=n.host;else break}return null}function Bi(t,e){if(e<=0)return"";if(t=t??"",t.length>e){let r=e-1;return r>0&&t.charCodeAt(r-1)>=55296&&t.charCodeAt(r-1)<=56319&&r--,t.slice(0,r)+"\u2026"}return t}var Vs=()=>{if(window.Shopify)try{return{customerId:cc()}}catch{return null}return null},cc=()=>{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},Hs=async()=>{try{return(await(await fetch(window.Shopify.routes.root+"cart.js")).json()).items.map(i=>({id:i.id,name:i.title,quantity:i.quantity,price:i.price,variantId:i.variant_id,sku:i.sku,url:i.url,description:i.product_description,image:i.featured_image?.url}))}catch{return[]}};function Gs(t){if(t instanceof URLSearchParams)return new URLSearchParams(t);let e=new URLSearchParams;for(let[r,i]of Object.entries(t))i!=null&&e.set(r,String(i));return e}function Xs(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function tt(t){let e="[-a-z\\d%_.~!$&'()*+,;=:@]",r="[-a-z\\d%_.~!$&'()*+,;=:@/?]";return new RegExp(`^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/${e}*)*(\\?${r}*)?(\\#${r}*)?$`,"i").test(t)}function Js(t,e){let r=t instanceof URL?t:new URL(t);if(e)for(let[i,n]of e)r.searchParams.set(i,n);return r}var Ks=()=>{if(window.ShopRenter)try{let t=dc();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},dc=()=>{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}}},Ys=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=Xs(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 Qs=()=>{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},Zs=async()=>new Promise((t,e)=>{try{window.UNAS.getCart(r=>{let n=r.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));t(n)})}catch(r){console.error("Error fetching cart information:",r),e(r)}});var Tt=pi(Wi(),1);var xr=class{#e;constructor({document:e}){this.#e=e}getCookies(){return(0,Tt.parseCookie)(this.#e.cookie)||{}}getCookie(e){return this.getCookies()[e]||null}setCookie(e,r,i){if(D(typeof e=="string",`cookie name must be a string, got: ${typeof e}`),D(e,"cookie name must not be empty"),r==null){this.#e.cookie=(0,Tt.stringifySetCookie)(e,"",{expires:new Date(0)});return}D(typeof r=="string",`value of cookie \`${e}\` must be a string, got: ${typeof r}`),this.#e.cookie=(0,Tt.stringifySetCookie)(e,r,i)}deleteCookie(e){this.setCookie(e,null)}deleteCookies(e){let r=this.getCookies();for(let i in r)e(i)&&this.deleteCookie(i)}};var kr=class{#e;constructor({localStorage:e}){this.#e=e}getItem(e){try{let r=this.#e.getItem(e);return r?JSON.parse(r):null}catch{return null}}setItem(e,r){if(r==null){this.#e.removeItem(e);return}try{let i=JSON.stringify(r);this.#e.setItem(e,i)}catch(i){console.error(`Failed to store ${e} in localStorage:`,i)}}removeItem(e){this.#e.removeItem(e)}removeItems(e){let r=[];for(let i=0;i<this.#e.length;i++){let n=this.#e.key(i);n&&e(n)&&r.push(n)}for(let i of r)this.#e.removeItem(i)}};var Dt=pi(Wi(),1);function Vi({window:t}){let e=t.location.hostname,r=t.document;if(e==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(e)||/^\[.*\]$/.test(e))return;let i=e.split(".");if(i.length<2)return;let n="__molin_domain_test__";for(let s=2;s<=i.length;s++){let o=`.${i.slice(-s).join(".")}`;try{if(r.cookie=(0,Dt.stringifySetCookie)(n,"1",{domain:o,path:"/"}),(0,Dt.parseCookie)(r.cookie)[n]==="1")return r.cookie=(0,Dt.stringifySetCookie)(n,"",{domain:o,path:"/",expires:new Date(0)}),o}catch{continue}}return`.${i.slice(-2).join(".")}`}var Hi=class{#e;#t;#r;#n;constructor({window:e}){this.#e=e,this.#t=new xr({document:e.document}),this.#r=new kr({localStorage:e.localStorage}),this.#n=e.localStorage}get distinctID(){return this.#t.getCookie("molin_distinct_id")||this.#n.getItem("molin_distinct_id")}set distinctID(e){if(!e){this.#t.deleteCookie("molin_distinct_id"),this.#n.removeItem("molin_distinct_id");return}D(typeof e=="string","distinct_id must be a string");try{this.#t.setCookie("molin_distinct_id",e,{path:"/",sameSite:"lax",expires:new Date(Date.now()+1e3*60*60*24*365),domain:Vi({window:this.#e})})}catch(r){console.warn("Could not write distinct_id to cookie:",r)}try{this.#n.setItem("molin_distinct_id",e)}catch(r){console.warn("Could not write distinct_id to localStorage:",r)}}get widgetState(){return this.#r.getItem("molin_widget")}set widgetState(e){this.#r.setItem("molin_widget",e)}get popupState(){return this.#r.getItem("molin_popup")}set popupState(e){this.#r.setItem("molin_popup",e)}get disclaimerDismissed(){return this.#r.getItem("molin_disclaimer_dismissed")??!1}set disclaimerDismissed(e){this.#r.setItem("molin_disclaimer_dismissed",e)}getConversationId(e){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let r=`molin_${e}_conversation_id`;return this.#t.getCookie(r)||this.#n.getItem(r)}setConversationId(e,r){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let i=`molin_${e}_conversation_id`;if(!r){this.#t.deleteCookie(i),this.#n.removeItem(i);return}D(typeof r=="string",`conversation ID for widget ${e} must be a string`);try{this.#t.setCookie(i,r,{path:"/",sameSite:"lax",expires:new Date(Date.now()+1e3*60*60*24*365),domain:Vi({window:this.#e})})}catch(n){console.warn(`Could not write ${i} to cookie:`,n)}try{this.#n.setItem(i,r)}catch(n){console.warn(`Could not write ${i} to localStorage:`,n)}}getConversationState(e){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let r=`molin_${e}_conversation`;return this.#r.getItem(r)}setConversationState(e,r){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let i=`molin_${e}_conversation`;this.#r.setItem(i,r)}resetAll(){this.distinctID=null,this.widgetState=null,this.popupState=null,this.disclaimerDismissed=!1,this.#r.removeItems(e=>e.startsWith("_molin_")),this.#t.deleteCookies(e=>e.startsWith("_molin_"))}},no;function j(){return no??=new Hi({window}),no}var so=At(C(),fr([C(),hr(),Oi(),Pi()])),oo=Qe(C(),Ai(1),Ii(5e3)),ao=()=>{try{return window.UNAS?Qs():window.Shopify?Vs():window.ShopRenter?Ks():null}catch{return null}},lo=async()=>{try{return window.UNAS?await Zs():window.Shopify?await Hs():window.ShopRenter?await Ys():[]}catch{return[]}},rt={schema:B({conversationId:A(C()),messages:A(Ye(B({id:C(),timestamp:hr(),role:It(["user","assistant","support"]),content:C(),parts:A(Ye(fr([B({text:C()}),B({html:C()}),B({tag:C(),data:At(C(),St())})])))})))}),persist(t,e,r){j().setConversationState(t,{conversationId:e,messages:r}),j().setConversationId(t,e)},restore(t){try{let e=j().getConversationState(t),r=e?se(this.schema,e):void 0;return r?.success&&r.output.conversationId?{conversationId:r.output.conversationId,messages:r.output.messages||[]}:{conversationId:j().getConversationId(t)||"",messages:[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(t){j().setConversationState(t,null),j().setConversationId(t,null)}};var it=class t extends v{static properties={widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object}};contextCtrl;constructor(){super(),this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.contextCtrl=new _e(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,toolCallIndicator:void 0,ranOutOfCredits:!1,isLiveMode:!1,lastMsg:void 0,hasQueuedMessages:!1,isConnected:()=>this.#i.isConnected,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),sendNewChat:this.sendNewChat.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),sendUserFeedback:this.sendUserFeedback.bind(this),sendFileDelete:this.#i.sendFileDelete.bind(this.#i)})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.#i.connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:this.#t,xCustomInstructions:this.#r,conversationId:this.#i.conversationId,messages:this.#e,isStreaming:this.#i.isStreaming,typingIndicator:this.#i.typingIndicator,toolCallIndicator:this.#i.toolCallIndicator,ranOutOfCredits:this.#i.ranOutOfCredits,isLiveMode:this.#i.isLiveMode,lastMsg:this.#i.lastMsg,hasQueuedMessages:this.#i.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),sendUserFeedback:this.sendUserFeedback.bind(this),sendFileDelete:this.#i.sendFileDelete.bind(this.#i)}),this.#s()}get#e(){return this.#i?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:this.#i?.messages||[]}#t;#r;#n=null;get#i(){return this.#n||(this.#n=new dr(this,{url:e=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("conversationId",e),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:e=>{console.error("ws error",e)},onClose:()=>{},onNewMessage:e=>{e.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:e,conversationId:this.#i.conversationId})},onMessageAppend:e=>{},onMessageDone:(e,r)=>{if(r.role==="assistant"){let i=Fs(r.parts??[]);this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,conversationId:this.#i.conversationId,products:i})}},onMessageError:e=>{console.error("ws message error",e),e.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+e.message})},onReset:()=>{rt.reset(this.widgetId)},onConnect:(e,r)=>{let i=ao();this.#i.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),lo().then(n=>{n?.length>0&&this.#i.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,cart:n,language:window.navigator.language})}).catch(n=>{console.error(n)}),this.dispatchEvent(new t.ConnectedEvent({conversationId:e,metadata:r,widgetId:this.widgetId,pendingImages:r?.pendingImages||[]}))},persistConversationState:(e,r)=>{rt.persist(this.widgetId,e,r)},restoreConversationState:()=>rt.restore(this.widgetId)})),this.#n}#s(){function e(i){if(!i)return;let n;try{n=typeof i=="object"?i:JSON.parse(i)}catch(o){console.error("Molin: user-data is not valid JSON",o);return}if(!n||typeof n!="object"||Object.keys(n).length===0)return;let s=se(so,n);if(!s.success){console.error("Molin: user-data does not pass schema validation",s.issues);return}return s.output}function r(i){if(!i)return;let n=se(oo,i);if(!n.success){console.error("Molin: custom-instructions does not pass schema validation",n.issues);return}return n.output}this.#t=e(this.xUserData),this.#r=r(this.xCustomInstructions)}async sendUserInput(e,r={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...r},n=await this.#i.sendUserInput(e,i);return n&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!1,conversationId:this.#i.conversationId}),n}async enqueueUserInput(e,r={}){e.length>1e3&&(console.error("Message exceeds max length of 1000 characters, trimming"),e=Bi(e,1e3)),this.#e.some(o=>o.role==="assistant"&&o.parts?.some(a=>"tag"in a&&a.tag==="request-input-v1"&&"data"in a&&a.data.type==="new-conversation-button"))&&(this.sendNewChat(),this.reset());let s={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...r};return this.#i.enqueueUserInput(e,s)}async sendUserFeedback(e){return this.#i.sendUserFeedback(e)}sendUserCancel(){this.#i.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){this.#i.sendUserTypingStart()}sendUserTypingStop(){this.#i.sendUserTypingStop()}sendNewChat(){this.#i.sendNewChat()}reset(){this.#i.reset()}reloadConfig(){this.#i.reloadConfig()}render(){return u`<slot></slot>`}};function co(t){let e=new vr(t,{provider:it,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,i){if(i==="value")return e.value}})}it.ConnectedEvent=class extends CustomEvent{static type="mw-context-widget:connected";constructor(e,r={}){super(it.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-context-widget")||customElements.define("mw-context-widget",it);var kc=Object.freeze({"lucide:arrow-up":u`
1
+ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDescriptor;var Rl=Object.getOwnPropertyNames;var Ul=Object.getPrototypeOf,Ll=Object.prototype.hasOwnProperty;var Ke=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var jl=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Rl(e))!Ll.call(t,n)&&n!==r&&ws(t,n,{get:()=>e[n],enumerable:!(i=Pl(e,n))||i.enumerable});return t};var vi=(t,e,r)=>(r=t!=null?Ol(Ul(t)):{},jl(e||!t||!t.__esModule?ws(r,"default",{value:t,enumerable:!0}):r,t));var Ki=Ke(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.parseCookie=co;ce.parse=co;ce.stringifyCookie=Ec;ce.stringifySetCookie=Er;ce.serialize=Er;ce.parseSetCookie=Sc;ce.stringifySetCookie=Er;ce.serialize=Er;var ao=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,lo=/^[\u0021-\u003A\u003C-\u007E]*$/,wc=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,xc=/^[\u0020-\u003A\u003D-\u007E]*$/,kc=/^-?\d+$/,_c=Object.prototype.toString,Cc=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function co(t,e){let r=new Cc,i=t.length;if(i<2)return r;let n=e?.decode||uo,s=0;do{let o=Yi(t,s,i);if(o===-1)break;let a=Xi(t,s,i);if(o>a){s=t.lastIndexOf(";",o-1)+1;continue}let l=Ee(t,s,o);r[l]===void 0&&(r[l]=n(Ee(t,o+1,a))),s=a+1}while(s<i);return r}function Ec(t,e){let r=e?.encode||encodeURIComponent,i=[];for(let n of Object.keys(t)){let s=t[n];if(s===void 0)continue;if(!ao.test(n))throw new TypeError(`cookie name is invalid: ${n}`);let o=r(s);if(!lo.test(o))throw new TypeError(`cookie val is invalid: ${s}`);i.push(`${n}=${o}`)}return i.join("; ")}function Er(t,e,r){let i=typeof t=="object"?t:{...r,name:t,value:String(e)},s=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!ao.test(i.name))throw new TypeError(`argument name is invalid: ${i.name}`);let o=i.value?s(i.value):"";if(!lo.test(o))throw new TypeError(`argument val is invalid: ${i.value}`);let a=i.name+"="+o;if(i.maxAge!==void 0){if(!Number.isInteger(i.maxAge))throw new TypeError(`option maxAge is invalid: ${i.maxAge}`);a+="; Max-Age="+i.maxAge}if(i.domain){if(!wc.test(i.domain))throw new TypeError(`option domain is invalid: ${i.domain}`);a+="; Domain="+i.domain}if(i.path){if(!xc.test(i.path))throw new TypeError(`option path is invalid: ${i.path}`);a+="; Path="+i.path}if(i.expires){if(!$c(i.expires)||!Number.isFinite(i.expires.valueOf()))throw new TypeError(`option expires is invalid: ${i.expires}`);a+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.partitioned&&(a+="; Partitioned"),i.priority)switch(typeof i.priority=="string"?i.priority.toLowerCase():void 0){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${i.priority}`)}if(i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:case"strict":a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"none":a+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${i.sameSite}`)}return a}function Sc(t,e){let r=e?.decode||uo,i=t.length,n=Xi(t,0,i),s=Yi(t,0,n),o=s===-1?{name:"",value:r(Ee(t,0,n))}:{name:Ee(t,0,s),value:r(Ee(t,s+1,n))},a=n+1;for(;a<i;){let l=Xi(t,a,i),c=Yi(t,a,l),d=c===-1?Ee(t,a,l):Ee(t,a,c),p=c===-1?void 0:Ee(t,c+1,l);switch(d.toLowerCase()){case"httponly":o.httpOnly=!0;break;case"secure":o.secure=!0;break;case"partitioned":o.partitioned=!0;break;case"domain":o.domain=p;break;case"path":o.path=p;break;case"max-age":p&&kc.test(p)&&(o.maxAge=Number(p));break;case"expires":if(!p)break;let h=new Date(p);Number.isFinite(h.valueOf())&&(o.expires=h);break;case"priority":if(!p)break;let m=p.toLowerCase();(m==="low"||m==="medium"||m==="high")&&(o.priority=m);break;case"samesite":if(!p)break;let f=p.toLowerCase();(f==="lax"||f==="strict"||f==="none")&&(o.sameSite=f);break}a=l+1}return o}function Xi(t,e,r){let i=t.indexOf(";",e);return i===-1?r:i}function Yi(t,e,r){let i=t.indexOf("=",e);return i<r?i:-1}function Ee(t,e,r){let i=e,n=r;do{let s=t.charCodeAt(i);if(s!==32&&s!==9)break}while(++i<n);for(;n>i;){let s=t.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}return t.slice(i,n)}function uo(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function $c(t){return _c.call(t)==="[object Date]"}});var ha=Ke(Ne=>{"use strict";var bu=Ne&&Ne.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},vu=Ne&&Ne.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=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++,n=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(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.base64ToBlob=wu;function wu(t){return bu(this,void 0,void 0,function(){var e,r,i;return vu(this,function(n){switch(n.label){case 0:return[4,fetch(t)];case 1:return e=n.sent(),[4,e.blob()];case 2:return r=n.sent(),i=ku(t),i&&(r=r.slice(0,r.size,i)),[2,r]}})})}var xu=/^data:(.+);base64,/;function ku(t){var e;return(e=t.match(xu))===null||e===void 0?void 0:e.slice(1,2).pop()}});var fa=Ke(ze=>{"use strict";var _u=ze&&ze.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},Cu=ze&&ze.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=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++,n=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(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(ze,"__esModule",{value:!0});ze.base64ToFile=Eu;function Eu(t,e,r){return _u(this,void 0,void 0,function(){var i,n;return Cu(this,function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:return i=s.sent(),[4,i.blob()];case 2:return n=s.sent(),[2,new File([n],e,r)]}})})}});var Sn=Ke(We=>{"use strict";var Cn=We&&We.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},En=We&&We.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=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++,n=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(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(We,"__esModule",{value:!0});We.blobToBase64=Su;function Su(t){return Cn(this,void 0,void 0,function(){return En(this,function(e){return[2,typeof FileReader=="function"?$u(t):Au(t)]})})}var ut;(function(t){t.error="error",t.loadend="loadend"})(ut||(ut={}));function $u(t){return Cn(this,void 0,void 0,function(){return En(this,function(e){return[2,new Promise(function(r,i){try{var n=new FileReader,s=function(){r(n.result),n.removeEventListener(ut.loadend,s)};n.addEventListener(ut.loadend,s);var o=function(){i(n.error),n.removeEventListener(ut.error,o)};n.addEventListener(ut.error,o),n.readAsDataURL(t)}catch(a){i(a)}})]})})}var Iu="application/octet-stream";function Au(t){return Cn(this,void 0,void 0,function(){var e,r,i,n;return En(this,function(s){switch(s.label){case 0:return i=(r=Buffer).from,[4,t.text()];case 1:return e=i.apply(r,[s.sent()]),n=t.type||Iu,[2,"data:".concat(n,";base64,").concat(e.toString("base64"))]}})})}});var ma=Ke(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.fileToBase64=void 0;var Tu=Sn();Object.defineProperty(qr,"fileToBase64",{enumerable:!0,get:function(){return Tu.blobToBase64}})});var ga=Ke(de=>{"use strict";var Mu=de&&de.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),Br=de&&de.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Mu(e,t,r)};Object.defineProperty(de,"__esModule",{value:!0});Br(ha(),de);Br(fa(),de);Br(Sn(),de);Br(ma(),de)});var nr=globalThis,sr=nr.ShadowRoot&&(nr.ShadyCSS===void 0||nr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,wi=Symbol(),xs=new WeakMap,Ct=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==wi)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(sr&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=xs.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&xs.set(r,e))}return e}toString(){return this.cssText}},ks=t=>new Ct(typeof t=="string"?t:t+"",void 0,wi),O=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((i,n,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new Ct(r,t,wi)},_s=(t,e)=>{if(sr)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=nr.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},xi=sr?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return ks(r)})(t):t;var{is:Fl,defineProperty:ql,getOwnPropertyDescriptor:Bl,getOwnPropertyNames:Nl,getOwnPropertySymbols:zl,getPrototypeOf:Wl}=Object,or=globalThis,Cs=or.trustedTypes,Vl=Cs?Cs.emptyScript:"",Hl=or.reactiveElementPolyfillSupport,Et=(t,e)=>t,ki={toAttribute(t,e){switch(e){case Boolean:t=t?Vl: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}},Ss=(t,e)=>!Fl(t,e),Es={attribute:!0,type:String,converter:ki,reflect:!1,useDefault:!1,hasChanged:Ss};Symbol.metadata??=Symbol("metadata"),or.litPropertyMetadata??=new WeakMap;var ge=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=Es){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 i=Symbol(),n=this.getPropertyDescriptor(e,i,r);n!==void 0&&ql(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){let{get:n,set:s}=Bl(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get:n,set(o){let a=n?.call(this);s?.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Es}static _$Ei(){if(this.hasOwnProperty(Et("elementProperties")))return;let e=Wl(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Et("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Et("properties"))){let r=this.properties,i=[...Nl(r),...zl(r)];for(let n of i)this.createProperty(n,r[n])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[i,n]of r)this.elementProperties.set(i,n)}this._$Eh=new Map;for(let[r,i]of this.elementProperties){let n=this._$Eu(r,i);n!==void 0&&this._$Eh.set(n,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)r.unshift(xi(n))}else e!==void 0&&r.push(xi(e));return r}static _$Eu(e,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i: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 i of r.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _s(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,i){this._$AK(e,i)}_$ET(e,r){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:ki).toAttribute(r,i.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,r){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=i.getPropertyOptions(n),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:ki;this._$Em=n;let a=o.fromAttribute(r,s.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(e,r,i,n=!1,s){if(e!==void 0){let o=this.constructor;if(n===!1&&(s=this[e]),i??=o.getPropertyOptions(e),!((i.hasChanged??Ss)(s,r)||i.useDefault&&i.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,r,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:i,reflect:n,wrapped:s},o){i&&!(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||i||(r=void 0),this._$AL.set(e,r)),n===!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[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[n,s]of i){let{wrapped:o}=s,a=this[n];o!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,s,a)}}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(r)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}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){}};ge.elementStyles=[],ge.shadowRootOptions={mode:"open"},ge[Et("elementProperties")]=new Map,ge[Et("finalized")]=new Map,Hl?.({ReactiveElement:ge}),(or.reactiveElementVersions??=[]).push("2.1.2");var Ci=globalThis,$s=t=>t,ar=Ci.trustedTypes,Is=ar?ar.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ei="$lit$",ye=`lit$${Math.random().toFixed(9).slice(2)}$`,Si="?"+ye,Gl=`<${Si}>`,Ue=document,$t=()=>Ue.createComment(""),It=t=>t===null||typeof t!="object"&&typeof t!="function",$i=Array.isArray,Ps=t=>$i(t)||typeof t?.[Symbol.iterator]=="function",_i=`[
2
+ \f\r]`,St=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,As=/-->/g,Ts=/>/g,Pe=RegExp(`>|${_i}(?:([^\\s"'>=/]+)(${_i}*=${_i}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ms=/'/g,Ds=/"/g,Rs=/^(?:script|style|textarea|title)$/i,Ii=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),u=Ii(1),Vd=Ii(2),Hd=Ii(3),se=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),Os=new WeakMap,Re=Ue.createTreeWalker(Ue,129);function Us(t,e){if(!$i(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Is!==void 0?Is.createHTML(e):e}var Ls=(t,e)=>{let r=t.length-1,i=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=St;for(let a=0;a<r;a++){let l=t[a],c,d,p=-1,h=0;for(;h<l.length&&(o.lastIndex=h,d=o.exec(l),d!==null);)h=o.lastIndex,o===St?d[1]==="!--"?o=As:d[1]!==void 0?o=Ts:d[2]!==void 0?(Rs.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Pe):d[3]!==void 0&&(o=Pe):o===Pe?d[0]===">"?(o=n??St,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Pe:d[3]==='"'?Ds:Ms):o===Ds||o===Ms?o=Pe:o===As||o===Ts?o=St:(o=Pe,n=void 0);let m=o===Pe&&t[a+1].startsWith("/>")?" ":"";s+=o===St?l+Gl:p>=0?(i.push(c),l.slice(0,p)+Ei+l.slice(p)+ye+m):l+ye+(p===-2?a:m)}return[Us(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},At=class t{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,o=0,a=e.length-1,l=this.parts,[c,d]=Ls(e,r);if(this.el=t.createElement(c,i),Re.currentNode=this.el.content,r===2||r===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=Re.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let p of n.getAttributeNames())if(p.endsWith(Ei)){let h=d[o++],m=n.getAttribute(p).split(ye),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:s,name:f[2],strings:m,ctor:f[1]==="."?cr:f[1]==="?"?ur:f[1]==="@"?dr:je}),n.removeAttribute(p)}else p.startsWith(ye)&&(l.push({type:6,index:s}),n.removeAttribute(p));if(Rs.test(n.tagName)){let p=n.textContent.split(ye),h=p.length-1;if(h>0){n.textContent=ar?ar.emptyScript:"";for(let m=0;m<h;m++)n.append(p[m],$t()),Re.nextNode(),l.push({type:2,index:++s});n.append(p[h],$t())}}}else if(n.nodeType===8)if(n.data===Si)l.push({type:2,index:s});else{let p=-1;for(;(p=n.data.indexOf(ye,p+1))!==-1;)l.push({type:7,index:s}),p+=ye.length-1}s++}}static createElement(e,r){let i=Ue.createElement("template");return i.innerHTML=e,i}};function Le(t,e,r=t,i){if(e===se)return e;let n=i!==void 0?r._$Co?.[i]:r._$Cl,s=It(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(t),n._$AT(t,r,i)),i!==void 0?(r._$Co??=[])[i]=n:r._$Cl=n),n!==void 0&&(e=Le(t,n._$AS(t,e.values),n,i)),e}var lr=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:i}=this._$AD,n=(e?.creationScope??Ue).importNode(r,!0);Re.currentNode=n;let s=Re.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Qe(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new pr(s,this,e)),this._$AV.push(c),l=i[++a]}o!==l?.index&&(s=Re.nextNode(),o++)}return Re.currentNode=Ue,n}p(e){let r=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}},Qe=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,i,n){this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=n,this._$Cv=n?.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=Le(this,e,r),It(e)?e===R||e==null||e===""?(this._$AH!==R&&this._$AR(),this._$AH=R):e!==this._$AH&&e!==se&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ps(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!==R&&It(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ue.createTextNode(e)),this._$AH=e}$(e){let{values:r,_$litType$:i}=e,n=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=At.createElement(Us(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(r);else{let s=new lr(n,this),o=s.u(this.options);s.p(r),this.T(o),this._$AH=s}}_$AC(e){let r=Os.get(e.strings);return r===void 0&&Os.set(e.strings,r=new At(e)),r}k(e){$i(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,i,n=0;for(let s of e)n===r.length?r.push(i=new t(this.O($t()),this.O($t()),this,this.options)):i=r[n],i._$AI(s),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e!==this._$AB;){let i=$s(e).nextSibling;$s(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},je=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,i,n,s){this.type=1,this._$AH=R,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}_$AI(e,r=this,i,n){let s=this.strings,o=!1;if(s===void 0)e=Le(this,e,r,0),o=!It(e)||e!==this._$AH&&e!==se,o&&(this._$AH=e);else{let a=e,l,c;for(e=s[0],l=0;l<s.length-1;l++)c=Le(this,a[i+l],r,l),c===se&&(c=this._$AH[l]),o||=!It(c)||c!==this._$AH[l],c===R?e=R:e!==R&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!n&&this.j(e)}j(e){e===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},cr=class extends je{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===R?void 0:e}},ur=class extends je{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==R)}},dr=class extends je{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){if((e=Le(this,e,r,0)??R)===se)return;let i=this._$AH,n=e===R&&i!==R||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==R&&(i===R||n);n&&this.element.removeEventListener(this.name,this,i),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)}},pr=class{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Le(this,e)}},js={M:Ei,P:ye,A:Si,C:1,L:Ls,R:lr,D:Ps,V:Le,I:Qe,H:je,N:ur,U:dr,B:cr,F:pr},Jl=Ci.litHtmlPolyfillSupport;Jl?.(At,Qe),(Ci.litHtmlVersions??=[]).push("3.3.2");var Fs=(t,e,r)=>{let i=r?.renderBefore??e,n=i._$litPart$;if(n===void 0){let s=r?.renderBefore??null;i._$litPart$=n=new Qe(e.insertBefore($t(),s),s,void 0,r??{})}return n._$AI(t),n};var Ai=globalThis,v=class extends ge{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=Fs(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return se}};v._$litElement$=!0,v.finalized=!0,Ai.litElementHydrateSupport?.({LitElement:v});var Xl=Ai.litElementPolyfillSupport;Xl?.({LitElement:v});(Ai.litElementVersions??=[]).push("4.2.2");var hr=class{#e;#t;#r;constructor(e,r){if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");this.#e=e,this.#e.addController(this),this.#t=r}connect(e){this.#t=e,this.#r=this.#i()}hostConnected(){this.#r||setTimeout(()=>{this.#r||(this.#r=this.#i())},0)}hostDisconnected(){this.#r?.close(1e3,"lit_host_disconnected"),this.#r=void 0}send(e){this.#r?.send(e)}close(e,r){this.#r?.close(e,r)}get isConnected(){return this.#r?.readyState===WebSocket.OPEN}get isConnecting(){return this.#r?.readyState===WebSocket.CONNECTING}#i(){let e=new WebSocket(this.#t.url());return this.#t.onClose&&(e.onclose=this.#t.onClose),this.#t.onOpen&&(e.onopen=this.#t.onOpen),this.#t.onError&&(e.onerror=this.#t.onError),this.#t.onMessage&&(e.onmessage=this.#t.onMessage),e}};async function Ti(t){await new Promise(e=>setTimeout(e,t))}async function fr({times:t=3,backoff:e=0},r){let i=n=>{throw{_bailed:n}};for(let n=0;n<t;n++)try{return await r(i,n)}catch(s){if(s&&typeof s=="object"&&"_bailed"in s)throw s._bailed;if(n===t-1)throw s;if(typeof e=="number")await Ti(e);else if(typeof e=="function")await Ti(e(n+1));else throw new TypeError("Invalid backoff option")}throw new Error("unreachable")}var Yl=!0,Mi="Invariant failed";function M(t,e){if(!t){if(Yl)throw new Error(Mi);var r=typeof e=="function"?e():e,i=r?"".concat(Mi,": ").concat(r):Mi;throw new Error(i)}}function Di(t,e,r){return t.slice(0,r)+e}function Kl({content:t,parts:e,appendMessage:r}){let i=[...e],n=t,s=r.part??0;switch(r.content_type){case"text":{let{delta:o,position:a}=r;n=Di(n,o,a);let l=i[s]&&"text"in i[s]?i[s].text:"";i[s]={text:l?Di(l,o,a):o};break}case"html":{let{delta:o,position:a}=r,l=i[s]&&"html"in i[s]?i[s].html:"";i[s]={html:l?Di(l,o,a):o};break}case"data":{let o=i[s]&&"data"in i[s]?i[s].data:{};i[s]={tag:r.tag,data:Object.assign({},o,r.data)};break}}return{content:n,parts:i}}var mr=class{messages=Object.freeze([]);onEvent(e){switch(e.type){case"NEW_MESSAGE":{let r={...e.message,streaming:!0,parts:e.message.parts};return this.messages=Object.freeze([...this.messages.filter(i=>i.id!==r.id),r]),r}case"APPEND_MESSAGE":{let i=this.messages.find(s=>s.id===e.message.id)??(()=>{let s={id:e.message.id,timestamp:Date.now(),role:"assistant",content:"",streaming:!0,parts:[]};return this.messages=Object.freeze([...this.messages,s]),s})(),n=Kl({content:i.content,parts:i.parts||[],appendMessage:e.message});return i.content=n.content,i.parts=n.parts,e.metadata&&(i.metadata=e.metadata),i}case"MESSAGE_DONE":{let r=this.messages.find(i=>i.id===e.message.id);return r?(Object.assign(r,e.message),r.streaming=!1,r):void 0}default:return}}onEvents(e){for(let r of e)this.onEvent(r)}getMessage(e){return this.messages.find(r=>r.id===e)}get lastMessage(){return this.messages.at(-1)}reset(){this.messages=Object.freeze([])}};var gr=class{#e;#t;#r=null;#i=new mr;isStreaming=!1;typingIndicator;toolCallIndicator;ranOutOfCredits=!1;get messages(){return this.#i.messages}set messages(e){this.#i.messages=e}conversationId="";#n=0;#s;isLiveMode=!1;get hasQueuedMessages(){return this.#a.length>0}constructor(e,r){this.#e=e,this.#t=r,this.#t.autoConnect!==!1&&(this.#r=this.initWS()),e.addController(this)}#a=[];#o(e,{expectStreaming:r=!1}={}){return this.ranOutOfCredits?!1:this.#r?this.#r.isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):this.#r.isConnected?(r&&!this.isLiveMode&&(this.isStreaming=!0,this.#e.requestUpdate()),this.#r.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)}async enqueueMessage(e,{expectStreaming:r=!1}={}){if(this.#a.length>0){let i=this.#a[this.#a.length-1];if(e.type==="USER_INPUT"&&i.message.type==="USER_INPUT"&&e.value===i.message.value)return!0}return this.#r||this.connect(),this.#r?.isConnected?this.#o(e,{expectStreaming:r}):(this.#a.push({message:e,options:{expectStreaming:r}}),this.#e.requestUpdate(),this.#r&&!this.#r.isConnecting&&!this.#r.isConnected&&this.retry(),await fr({times:5,backoff:2e3},async()=>{if(this.#r?.isConnected){let i=[...this.#a];this.#a=[],this.#e.requestUpdate();let n=!1;for(let{message:s,options:o}of i){let a=this.#o(s,o);s===e&&(n=a)}return n}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),this.#a=[],this.#e.requestUpdate(),!1)))}async sendUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i},{expectStreaming:s})}async sendUserFeedback(e){return this.enqueueMessage({type:"USER_FEEDBACK",responses:e},{expectStreaming:!0})}sendFileDelete(e){M(e,"fileId is required"),this.enqueueMessage({type:"USER_FILE_DELETE",fileId:e}).catch(console.warn)}sendUserCancel(){this.enqueueMessage({type:"USER_CANCEL"}).catch(console.warn)}sendUserTypingStart(){this.#o({type:"USER_TYPING_START"})}sendUserTypingStop(){this.enqueueMessage({type:"USER_TYPING_STOP"}).catch(console.warn)}sendNewChat(){this.enqueueMessage({type:"NEW_CHAT"})}sendUserMeta(e){this.enqueueMessage({type:"USER_META",metadata:e}).catch(console.warn)}reloadConfig(){this.enqueueMessage({type:"RELOAD_CONFIG"}).catch(console.warn)}close(){this.#r?.close(1e3,"closed by user")}retry(){clearTimeout(this.#s),this.#s=setTimeout(()=>{this.#t.onReconnect?.(),this.#r=this.initWS()},1e3*this.#n),this.#n++}initWS(){return new hr(this.#e,{url:()=>this.#t.url(this.conversationId,{}),onOpen:e=>this.#l(e),onMessage:e=>this.#c(JSON.parse(e.data)),onError:e=>this.#u(e),onClose:e=>this.#d(e)})}#l(e){this.#n=0}#c(e){switch(e.type){case"NEW_MESSAGE":{this.#i.onEvent(e),this.typingIndicator=void 0,this.toolCallIndicator=void 0,this.#t.onNewMessage?.(e.message),this.#t.persistConversationState?.(this.conversationId,this.messages),this.#e.requestUpdate();break}case"APPEND_MESSAGE":{let r=!this.#i.getMessage(e.message.id),i=this.#i.onEvent(e);i&&(this.typingIndicator=void 0,this.toolCallIndicator=void 0,r&&(this.#t.onNewMessage?.({id:i.id,timestamp:i.timestamp,role:i.role,content:i.content}),this.#t.persistConversationState?.(this.conversationId,this.messages)),this.#t.onMessageAppend?.(e),this.#e.requestUpdate());break}case"MESSAGE_DONE":{let r=this.#i.onEvent(e);if(!r)throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,this.#e.requestUpdate(),this.#t.onMessageDone?.(e,r),this.#t.persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate();break}case"ERROR":{this.#t.onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.#i.messages=e.messages,this.#t.onConnect?.(e.conversationId,e.metadata),this.#t.persistConversationState?.(e.conversationId,e.messages),this.isLiveMode=e.metadata.isLiveMode,this.#e.requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.toolCallIndicator=void 0,this.typingIndicator={role:e.role,metadata:e.metadata},this.#e.requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,this.#e.requestUpdate();break}case"TOOL_CALL_START":{this.typingIndicator=void 0,this.toolCallIndicator=e.text,this.#e.requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,this.#e.requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),this.#e.requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}}#u(e){console.error("onError",e),this.#t.onError?.(e)}#d(e){this.#e.isConnected&&this.#r&&!this.#r.isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate(),this.#t.onClose?.()}hostConnected(){this.conversationId=this.#t.restoreConversationState?.()?.conversationId||"",this.#i.messages=this.#t.restoreConversationState?.()?.messages||[]}reset(){this.#t.onReset?.(),this.#i.reset(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.conversationId="",this.isLiveMode=!1,this.#a=[],this.#e.requestUpdate()}hostDisconnected(){clearTimeout(this.#s)}connect(){this.#r||(this.#r=this.initWS())}reconnectSocket(){this.#r?.close(1e3,"destroy"),this.#r=this.initWS()}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}get isConnected(){return this.#r?.isConnected??!1}};var Oi;function Bs(t){return{lang:t?.lang??Oi?.lang,message:t?.message,abortEarly:t?.abortEarly??Oi?.abortEarly,abortPipeEarly:t?.abortPipeEarly??Oi?.abortPipeEarly}}var Ql;function Zl(t){return Ql?.get(t)}var ec;function tc(t){return ec?.get(t)}var rc;function ic(t,e){return rc?.get(t)?.get(e)}function Ns(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 G(t,e,r,i,n){let s=n&&"input"in n?n.input:r.value,o=n?.expected??t.expects??null,a=n?.received??Ns(s),l={kind:t.kind,type:t.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:n?.path,issues:n?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},c=t.kind==="schema",d=n?.message??t.message??ic(t.reference,l.lang)??(c?tc(l.lang):null)??i.message??Zl(l.lang);d!==void 0&&(l.message=typeof d=="function"?d(l):d),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function J(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Bs())}}}function nc(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function zs(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var sc=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z|[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;function Pi(t){return{kind:"validation",type:"iso_timestamp",reference:Pi,async:!1,expects:null,requirement:sc,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&G(this,"timestamp",e,r),e}}}function Ri(t,e){return{kind:"validation",type:"max_length",reference:Ri,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(r,i){return r.typed&&r.value.length>this.requirement&&G(this,"length",r,i,{received:`${r.value.length}`}),r}}}function Ui(t,e){return{kind:"validation",type:"min_length",reference:Ui,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,i){return r.typed&&r.value.length<this.requirement&&G(this,"length",r,i,{received:`${r.value.length}`}),r}}}function Li(t){return{kind:"transformation",type:"to_date",reference:Li,async:!1,message:t,"~run"(e,r){try{e.value=new Date(e.value),isNaN(e.value)&&(G(this,"date",e,r,{received:'"Invalid Date"'}),e.typed=!1)}catch{G(this,"date",e,r),e.typed=!1}return e}}}function ji(t){return{kind:"transformation",type:"transform",reference:ji,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function Ws(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function Q(t,e){return{...t,fallback:e,get"~standard"(){return J(this)},"~run"(r,i){let n=t["~run"](r,i);return n.issues?{typed:!0,value:Ws(this,n,i)}:n}}}function Fi(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function Tt(){return{kind:"schema",type:"any",reference:Tt,expects:"any",async:!1,get"~standard"(){return J(this)},"~run"(t){return t.typed=!0,t}}}function Ze(t,e){return{kind:"schema",type:"array",reference:Ze,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return J(this)},"~run"(r,i){let n=r.value;if(Array.isArray(n)){r.typed=!0,r.value=[];for(let s=0;s<n.length;s++){let o=n[s],a=this.item["~run"]({value:o},i);if(a.issues){let l={type:"array",origin:"value",input:n,key:s,value:o};for(let c of a.issues)c.path?c.path.unshift(l):c.path=[l],r.issues?.push(c);if(r.issues||(r.issues=a.issues),i.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value.push(a.value)}}else G(this,"type",r,i);return r}}}function qi(t){return{kind:"schema",type:"boolean",reference:qi,expects:"boolean",async:!1,message:t,get"~standard"(){return J(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:G(this,"type",e,r),e}}}function Bi(t){return{kind:"schema",type:"null",reference:Bi,expects:"null",async:!1,message:t,get"~standard"(){return J(this)},"~run"(e,r){return e.value===null?e.typed=!0:G(this,"type",e,r),e}}}function yr(t,e){return{kind:"schema",type:"nullish",reference:yr,expects:`(${t.expects} | null | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return J(this)},"~run"(r,i){return(r.value===null||r.value===void 0)&&(this.default!==void 0&&(r.value=Fi(this,r,i)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function br(t){return{kind:"schema",type:"number",reference:br,expects:"number",async:!1,message:t,get"~standard"(){return J(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:G(this,"type",e,r),e}}}function N(t,e){return{kind:"schema",type:"object",reference:N,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return J(this)},"~run"(r,i){let n=r.value;if(n&&typeof n=="object"){r.typed=!0,r.value={};for(let s in this.entries){let o=this.entries[s];if(s in n||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){let a=s in n?n[s]:Fi(o),l=o["~run"]({value:a},i);if(l.issues){let c={type:"object",origin:"value",input:n,key:s,value:a};for(let d of l.issues)d.path?d.path.unshift(c):d.path=[c],r.issues?.push(d);if(r.issues||(r.issues=l.issues),i.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value[s]=l.value}else if(o.fallback!==void 0)r.value[s]=Ws(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(G(this,"key",r,i,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:n,key:s,value:n[s]}]}),i.abortEarly))break}}else G(this,"type",r,i);return r}}}function A(t,e){return{kind:"schema",type:"optional",reference:A,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return J(this)},"~run"(r,i){return r.value===void 0&&(this.default!==void 0&&(r.value=Fi(this,r,i)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function Mt(t,e){return{kind:"schema",type:"picklist",reference:Mt,expects:zs(t.map(Ns),"|"),async:!1,options:t,message:e,get"~standard"(){return J(this)},"~run"(r,i){return this.options.includes(r.value)?r.typed=!0:G(this,"type",r,i),r}}}function Dt(t,e,r){return{kind:"schema",type:"record",reference:Dt,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return J(this)},"~run"(i,n){let s=i.value;if(s&&typeof s=="object"){i.typed=!0,i.value={};for(let o in s)if(nc(s,o)){let a=s[o],l=this.key["~run"]({value:o},n);if(l.issues){let d={type:"object",origin:"key",input:s,key:o,value:a};for(let p of l.issues)p.path=[d],i.issues?.push(p);if(i.issues||(i.issues=l.issues),n.abortEarly){i.typed=!1;break}}let c=this.value["~run"]({value:a},n);if(c.issues){let d={type:"object",origin:"value",input:s,key:o,value:a};for(let p of c.issues)p.path?p.path.unshift(d):p.path=[d],i.issues?.push(p);if(i.issues||(i.issues=c.issues),n.abortEarly){i.typed=!1;break}}(!l.typed||!c.typed)&&(i.typed=!1),l.typed&&(i.value[l.value]=c.value)}}else G(this,"type",i,n);return i}}}function C(t){return{kind:"schema",type:"string",reference:C,expects:"string",async:!1,message:t,get"~standard"(){return J(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:G(this,"type",e,r),e}}}function qs(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function vr(t,e){return{kind:"schema",type:"union",reference:vr,expects:zs(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return J(this)},"~run"(r,i){let n,s,o;for(let a of this.options){let l=a["~run"]({value:r.value},i);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{n=l;break}else o?o.push(l):o=[l]}if(n)return n;if(s){if(s.length===1)return s[0];G(this,"type",r,i,{issues:qs(s)}),r.typed=!0}else{if(o?.length===1)return o[0];G(this,"type",r,i,{issues:qs(o)})}return r}}}function Vs(t,e){let r={};for(let i in t.entries)r[i]=!e||e.includes(i)?A(t.entries[i]):t.entries[i];return{...t,entries:r,get"~standard"(){return J(this)}}}function et(...t){return{...t[0],pipe:t,get"~standard"(){return J(this)},"~run"(e,r){for(let i of t)if(i.kind!=="metadata"){if(e.issues&&(i.kind==="schema"||i.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=i["~run"](e,r))}return e}}}function oe(t,e,r){let i=t["~run"]({value:e},Bs(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var wr=Vs(N({url:C(),name:C(),description:C(),price:C()}));function Hs(t){return t.flatMap(e=>{if(!("tag"in e))return[];switch(e.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let r=oe(wr,e.data);if(r.success)return[{name:r.output.name??"",price:r.output.price??"0"}];break}case"thought":case"order-status-card-v1":case"order-card-v2":case"live-chat-wait-card-v1":case"live-chat-wait-card-v2":case"request-input-v1":break}return[]})}var oc=Symbol();var Gs=Object.getPrototypeOf,Ni=new WeakMap,ac=t=>t&&(Ni.has(t)?Ni.get(t):Gs(t)===Object.prototype||Gs(t)===Array.prototype);var Js=t=>ac(t)&&t[oc]||null,zi=(t,e=!0)=>{Ni.set(t,e)};var Vi=t=>typeof t=="object"&&t!==null,lc=t=>Vi(t)&&!Hi.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),Ks=(t,e)=>{let r=Xs.get(t);if(r?.[0]===e)return r[1];let i=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return zi(i,!0),Xs.set(t,[e,i]),Reflect.ownKeys(t).forEach(n=>{if(Object.getOwnPropertyDescriptor(i,n))return;let s=Reflect.get(t,n),{enumerable:o}=Reflect.getOwnPropertyDescriptor(t,n),a={value:s,enumerable:o,configurable:!0};if(Hi.has(s))zi(s,!1);else if(Fe.has(s)){let[l,c]=Fe.get(s);a.value=Ks(l,c())}Object.defineProperty(i,n,a)}),Object.preventExtensions(i)},cc=(t,e,r,i)=>({deleteProperty(n,s){let o=Reflect.get(n,s);r(s);let a=Reflect.deleteProperty(n,s);return a&&i(xr?.("delete",s,o)),a},set(n,s,o,a){let l=!t()&&Reflect.has(n,s),c=Reflect.get(n,s,a);if(l&&(Ys(c,o)||kr.has(o)&&Ys(c,kr.get(o))))return!0;r(s),Vi(o)&&(o=Js(o)||o);let d=!Fe.has(o)&&dc(o)?Gi(o):o;return e(s,d),Reflect.set(n,s,d,a),i(xr?.("set",s,o,c)),!0}});var Fe=new WeakMap,Hi=new WeakSet,Xs=new WeakMap,Wi=[1],kr=new WeakMap,Ys=Object.is,uc=(t,e)=>new Proxy(t,e),dc=lc,pc=Ks,hc=cc,xr;function Gi(t={}){if(!Vi(t))throw new Error("object required");let e=kr.get(t);if(e)return e;let r=Wi[0],i=new Set,n=(x,S=++Wi[0])=>{r!==S&&(s=r=S,i.forEach(b=>b(x,S)))},s=r,o=(x=Wi[0])=>(s!==x&&(s=x,l.forEach(([S])=>{let b=S[1](x);b>r&&(r=b)})),r),a=x=>(S,b)=>{let k;S&&(k=[...S],k[1]=[x,...k[1]]),n(k,b)},l=new Map,c=(x,S)=>{let b=!Hi.has(S)&&Fe.get(S);if(b){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(x))throw new Error("prop listener already exists");if(i.size){let k=b[2](a(x));l.set(x,[b,k])}else l.set(x,[b])}},d=x=>{var S;let b=l.get(x);b&&(l.delete(x),(S=b[1])==null||S.call(b))},p=x=>(i.add(x),i.size===1&&l.forEach(([b,k],$)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&k)throw new Error("remove already exists");let P=b[2](a($));l.set($,[b,P])}),()=>{i.delete(x),i.size===0&&l.forEach(([b,k],$)=>{k&&(k(),l.set($,[b]))})}),h=!0,m=hc(()=>h,c,d,n),f=uc(t,m);kr.set(t,f);let E=[t,o,p];return Fe.set(f,E),Reflect.ownKeys(t).forEach(x=>{let S=Object.getOwnPropertyDescriptor(t,x);"value"in S&&S.writable&&(f[x]=t[x])}),h=!1,f}function _r(t,e,r){let i=Fe.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!i&&console.warn("Please use proxy object");let n,s=[],o=i[2],a=!1,c=o(d=>{if(d&&s.push(d),r){e(s.splice(0));return}n||(n=Promise.resolve().then(()=>{n=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,c()}}function tt(t){let e=Fe.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,i]=e;return pc(r,i())}var rt=class{#e;#t;#r;#i=()=>{};constructor(e,r){this.#e=e,this.#t=r,this.#r=tt(r),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#i(),this.#i=_r(this.#t,()=>{this.#r=tt(this.#t),this.#e.requestUpdate()})}hostDisconnected(){this.#i()}};var Ce=class{#e;#t;proxyObject;#r;#i=()=>{};constructor(e,r,i){this.#e=e,this.#t=i,this.proxyObject=Gi(r),this.#r=tt(this.proxyObject),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#i(),this.#t?.subscribe&&(this.#i=_r(this.proxyObject,()=>{this.#r=tt(this.proxyObject),this.#e.requestUpdate()}))}hostDisconnected(){this.#i()}};var Cr=class{#e;#t;#r;#i=null;#n=null;constructor(e,{provider:r,tag:i,key:n}){this.#e=e,this.#t=i,this.#r=n,e.addController(this)}get value(){return this.#n?this.#n.value:null}hostConnected(){if(this.#n||(this.#i=fc(this.#e,this.#t),!this.#i))return;let e=this.#i[this.#r]instanceof Ce?this.#i[this.#r]:null;e&&(this.#n=new rt(this.#e,e.proxyObject))}hostDisconnected(){}};function fc(t,e){let r=t;for(;r;){let i=r.closest(e);if(i)return i;let n=r.getRootNode();if(n instanceof ShadowRoot)r=n.host;else break}return null}function Ji(t,e){if(e<=0)return"";if(t=t??"",t.length>e){let r=e-1;return r>0&&t.charCodeAt(r-1)>=55296&&t.charCodeAt(r-1)<=56319&&r--,t.slice(0,r)+"\u2026"}return t}var Qs=()=>{if(window.Shopify)try{return{customerId:mc()}}catch{return null}return null},mc=()=>{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},Zs=async()=>{try{return(await(await fetch(window.Shopify.routes.root+"cart.js")).json()).items.map(i=>({id:i.id,name:i.title,quantity:i.quantity,price:i.price,variantId:i.variant_id,sku:i.sku,url:i.url,description:i.product_description,image:i.featured_image?.url}))}catch{return[]}};function eo(t){if(t instanceof URLSearchParams)return new URLSearchParams(t);let e=new URLSearchParams;for(let[r,i]of Object.entries(t))i!=null&&e.set(r,String(i));return e}function to(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function it(t){let e="[-a-z\\d%_.~!$&'()*+,;=:@]",r="[-a-z\\d%_.~!$&'()*+,;=:@/?]";return new RegExp(`^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/${e}*)*(\\?${r}*)?(\\#${r}*)?$`,"i").test(t)}function ro(t,e){let r=t instanceof URL?t:new URL(t);if(e)for(let[i,n]of e)r.searchParams.set(i,n);return r}var io=()=>{if(window.ShopRenter)try{let t=yc();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},yc=()=>{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}}},no=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=to(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 so=()=>{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},oo=async()=>new Promise((t,e)=>{try{window.UNAS.getCart(r=>{let n=r.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));t(n)})}catch(r){console.error("Error fetching cart information:",r),e(r)}});var Ot=vi(Ki(),1);var Sr=class{#e;constructor({document:e}){this.#e=e}getCookies(){return(0,Ot.parseCookie)(this.#e.cookie)||{}}getCookie(e){return this.getCookies()[e]||null}setCookie(e,r,i){if(M(typeof e=="string",`cookie name must be a string, got: ${typeof e}`),M(e,"cookie name must not be empty"),r==null){this.#e.cookie=(0,Ot.stringifySetCookie)(e,"",{expires:new Date(0)});return}M(typeof r=="string",`value of cookie \`${e}\` must be a string, got: ${typeof r}`),this.#e.cookie=(0,Ot.stringifySetCookie)(e,r,i)}deleteCookie(e){this.setCookie(e,null)}deleteCookies(e){let r=this.getCookies();for(let i in r)e(i)&&this.deleteCookie(i)}};var $r=class{#e;constructor({localStorage:e}){this.#e=e}getItem(e){try{let r=this.#e.getItem(e);return r?JSON.parse(r):null}catch{return null}}setItem(e,r){if(r==null){this.#e.removeItem(e);return}try{let i=JSON.stringify(r);this.#e.setItem(e,i)}catch(i){console.error(`Failed to store ${e} in localStorage:`,i)}}removeItem(e){this.#e.removeItem(e)}removeItems(e){let r=[];for(let i=0;i<this.#e.length;i++){let n=this.#e.key(i);n&&e(n)&&r.push(n)}for(let i of r)this.#e.removeItem(i)}};var Pt=vi(Ki(),1);function Qi({window:t}){let e=t.location.hostname,r=t.document;if(e==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(e)||/^\[.*\]$/.test(e))return;let i=e.split(".");if(i.length<2)return;let n="__molin_domain_test__";for(let s=2;s<=i.length;s++){let o=`.${i.slice(-s).join(".")}`;try{if(r.cookie=(0,Pt.stringifySetCookie)(n,"1",{domain:o,path:"/"}),(0,Pt.parseCookie)(r.cookie)[n]==="1")return r.cookie=(0,Pt.stringifySetCookie)(n,"",{domain:o,path:"/",expires:new Date(0)}),o}catch{continue}}return`.${i.slice(-2).join(".")}`}var Zi=class{#e;#t;#r;#i;constructor({window:e}){this.#e=e,this.#t=new Sr({document:e.document}),this.#r=new $r({localStorage:e.localStorage}),this.#i=e.localStorage}get distinctID(){return this.#t.getCookie("molin_distinct_id")||this.#i.getItem("molin_distinct_id")}set distinctID(e){if(!e){this.#t.deleteCookie("molin_distinct_id"),this.#i.removeItem("molin_distinct_id");return}M(typeof e=="string","distinct_id must be a string");try{this.#t.setCookie("molin_distinct_id",e,{path:"/",sameSite:"lax",expires:new Date(Date.now()+1e3*60*60*24*365),domain:Qi({window:this.#e})})}catch(r){console.warn("Could not write distinct_id to cookie:",r)}try{this.#i.setItem("molin_distinct_id",e)}catch(r){console.warn("Could not write distinct_id to localStorage:",r)}}get widgetState(){return this.#r.getItem("molin_widget")}set widgetState(e){this.#r.setItem("molin_widget",e)}get popupState(){return this.#r.getItem("molin_popup")}set popupState(e){this.#r.setItem("molin_popup",e)}get disclaimerDismissed(){return this.#r.getItem("molin_disclaimer_dismissed")??!1}set disclaimerDismissed(e){this.#r.setItem("molin_disclaimer_dismissed",e)}getConversationId(e){M(typeof e=="string","widgetId must be a string"),M(e,"widgetId must not be empty");let r=`molin_${e}_conversation_id`;return this.#t.getCookie(r)||this.#i.getItem(r)}setConversationId(e,r){M(typeof e=="string","widgetId must be a string"),M(e,"widgetId must not be empty");let i=`molin_${e}_conversation_id`;if(!r){this.#t.deleteCookie(i),this.#i.removeItem(i);return}M(typeof r=="string",`conversation ID for widget ${e} must be a string`);try{this.#t.setCookie(i,r,{path:"/",sameSite:"lax",expires:new Date(Date.now()+1e3*60*60*24*365),domain:Qi({window:this.#e})})}catch(n){console.warn(`Could not write ${i} to cookie:`,n)}try{this.#i.setItem(i,r)}catch(n){console.warn(`Could not write ${i} to localStorage:`,n)}}getConversationState(e){M(typeof e=="string","widgetId must be a string"),M(e,"widgetId must not be empty");let r=`molin_${e}_conversation`;return this.#r.getItem(r)}setConversationState(e,r){M(typeof e=="string","widgetId must be a string"),M(e,"widgetId must not be empty");let i=`molin_${e}_conversation`;this.#r.setItem(i,r)}resetAll(){this.distinctID=null,this.widgetState=null,this.popupState=null,this.disclaimerDismissed=!1,this.#r.removeItems(e=>e.startsWith("_molin_")),this.#t.deleteCookies(e=>e.startsWith("_molin_"))}},po;function L(){return po??=new Zi({window}),po}var ho=Dt(C(),vr([C(),br(),qi(),Bi()])),fo=et(C(),Ui(1),Ri(5e3)),mo=()=>{try{return window.UNAS?so():window.Shopify?Qs():window.ShopRenter?io():null}catch{return null}},go=async()=>{try{return window.UNAS?await oo():window.Shopify?await Zs():window.ShopRenter?await no():[]}catch{return[]}},nt={schema:N({conversationId:A(C()),messages:A(Ze(N({id:C(),timestamp:br(),role:Mt(["user","assistant","support"]),content:C(),parts:A(Ze(vr([N({text:C()}),N({html:C()}),N({tag:C(),data:Dt(C(),Tt())})])))})))}),persist(t,e,r){L().setConversationState(t,{conversationId:e,messages:r}),L().setConversationId(t,e)},restore(t){try{let e=L().getConversationState(t),r=e?oe(this.schema,e):void 0;return r?.success&&r.output.conversationId?{conversationId:r.output.conversationId,messages:r.output.messages||[]}:{conversationId:L().getConversationId(t)||"",messages:[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(t){L().setConversationState(t,null),L().setConversationId(t,null)}};var st=class t extends v{static properties={widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object}};contextCtrl;constructor(){super(),this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.contextCtrl=new Ce(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,toolCallIndicator:void 0,ranOutOfCredits:!1,isLiveMode:!1,lastMsg:void 0,hasQueuedMessages:!1,isConnected:()=>this.#n.isConnected,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),sendNewChat:this.sendNewChat.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),sendUserFeedback:this.sendUserFeedback.bind(this),sendFileDelete:this.#n.sendFileDelete.bind(this.#n)})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.#n.connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:this.#t,xCustomInstructions:this.#r,conversationId:this.#n.conversationId,messages:this.#e,isStreaming:this.#n.isStreaming,typingIndicator:this.#n.typingIndicator,toolCallIndicator:this.#n.toolCallIndicator,ranOutOfCredits:this.#n.ranOutOfCredits,isLiveMode:this.#n.isLiveMode,lastMsg:this.#n.lastMsg,hasQueuedMessages:this.#n.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),sendUserFeedback:this.sendUserFeedback.bind(this),sendFileDelete:this.#n.sendFileDelete.bind(this.#n)}),this.#s()}get#e(){return this.#n?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:this.#n?.messages||[]}#t;#r;#i=null;get#n(){return this.#i||(this.#i=new gr(this,{url:e=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("conversationId",e),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:e=>{console.error("ws error",e)},onClose:()=>{},onNewMessage:e=>{e.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:e,conversationId:this.#n.conversationId})},onMessageAppend:e=>{},onMessageDone:(e,r)=>{if(r.role==="assistant"){let i=Hs(r.parts??[]);this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,conversationId:this.#n.conversationId,products:i})}},onMessageError:e=>{console.error("ws message error",e),e.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+e.message})},onReset:()=>{nt.reset(this.widgetId)},onConnect:(e,r)=>{let i=mo();this.#n.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),go().then(n=>{n?.length>0&&this.#n.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,cart:n,language:window.navigator.language})}).catch(n=>{console.error(n)}),this.dispatchEvent(new t.ConnectedEvent({conversationId:e,metadata:r,widgetId:this.widgetId,pendingImages:r?.pendingImages||[]}))},persistConversationState:(e,r)=>{nt.persist(this.widgetId,e,r)},restoreConversationState:()=>nt.restore(this.widgetId)})),this.#i}#s(){function e(i){if(!i)return;let n;try{n=typeof i=="object"?i:JSON.parse(i)}catch(o){console.error("Molin: user-data is not valid JSON",o);return}if(!n||typeof n!="object"||Object.keys(n).length===0)return;let s=oe(ho,n);if(!s.success){console.error("Molin: user-data does not pass schema validation",s.issues);return}return s.output}function r(i){if(!i)return;let n=oe(fo,i);if(!n.success){console.error("Molin: custom-instructions does not pass schema validation",n.issues);return}return n.output}this.#t=e(this.xUserData),this.#r=r(this.xCustomInstructions)}async sendUserInput(e,r={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...r},n=await this.#n.sendUserInput(e,i);return n&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!1,conversationId:this.#n.conversationId}),n}async enqueueUserInput(e,r={}){e.length>1e3&&(console.error("Message exceeds max length of 1000 characters, trimming"),e=Ji(e,1e3)),this.#e.some(o=>o.role==="assistant"&&o.parts?.some(a=>"tag"in a&&a.tag==="request-input-v1"&&"data"in a&&a.data.type==="new-conversation-button"))&&(this.sendNewChat(),this.reset());let s={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...r};return this.#n.enqueueUserInput(e,s)}async sendUserFeedback(e){return this.#n.sendUserFeedback(e)}sendUserCancel(){this.#n.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){this.#n.sendUserTypingStart()}sendUserTypingStop(){this.#n.sendUserTypingStop()}sendNewChat(){this.#n.sendNewChat()}reset(){this.#n.reset()}reloadConfig(){this.#n.reloadConfig()}render(){return u`<slot></slot>`}};function yo(t){let e=new Cr(t,{provider:st,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,i){if(i==="value")return e.value}})}st.ConnectedEvent=class extends CustomEvent{static type="mw-context-widget:connected";constructor(e,r={}){super(st.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-context-widget")||customElements.define("mw-context-widget",st);var Ic=Object.freeze({"lucide:arrow-up":u`
4
4
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
5
5
  <path d="m5 12 7-7 7 7" />
6
6
  <path d="M12 19V5" />
@@ -63,6 +63,20 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
63
63
  <path d="M12 16v-4" />
64
64
  <path d="M12 8h.01" />
65
65
  </svg>
66
+ `,"lucide:maximize-2":u`
67
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
68
+ <path d="M15 3h6v6" />
69
+ <path d="m21 3-7 7" />
70
+ <path d="m3 21 7-7" />
71
+ <path d="M9 21H3v-6" />
72
+ </svg>
73
+ `,"lucide:minimize-2":u`
74
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
75
+ <path d="m14 10 7-7" />
76
+ <path d="M20 10h-6V4" />
77
+ <path d="m3 21 7-7" />
78
+ <path d="M4 14h6v6" />
79
+ </svg>
66
80
  `,"lucide:message-circle-plus":u`
67
81
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
68
82
  <path d="M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719" />
@@ -73,6 +87,12 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
73
87
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
74
88
  <path d="M21 12a9 9 0 1 1-6.219-8.56" />
75
89
  </svg>
90
+ `,"lucide:mic":u`
91
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
92
+ <path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" />
93
+ <path d="M19 10v2a7 7 0 0 1-14 0v-2" />
94
+ <line x1="12" x2="12" y1="19" y2="22" />
95
+ </svg>
76
96
  `,"lucide:star":u`
77
97
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
78
98
  <path
@@ -113,7 +133,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
113
133
  <path d="M18 6 6 18" />
114
134
  <path d="m6 6 12 12" />
115
135
  </svg>
116
- `}),Gi=class extends v{static properties={name:{type:String},fill:{type:Boolean,reflect:!0}};static styles=O`
136
+ `}),en=class extends v{static properties={name:{type:String},fill:{type:Boolean,reflect:!0}};static styles=O`
117
137
  :host {
118
138
  display: inline-block;
119
139
  line-height: 0;
@@ -125,7 +145,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
125
145
  :host([fill]) svg {
126
146
  fill: currentColor;
127
147
  }
128
- `;constructor(){super(),this.name,this.fill=!1}render(){if(!this.name)return null;let e=kc[this.name];return e||(console.warn(`mw-icon: '${this.name}' not found`),null)}};customElements.get("mw-icon")||customElements.define("mw-icon",Gi);function nn(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function _c(t,e=","){return t.map(nn).join(e)}var yo=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function _r(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 $r(t,e="@media "){return e+M(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(i=>`(${i}-width:${r[i]})`).join(" and "))).join(",")}function M(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function uo(t){return t}function Sr(){}var F={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function bo(t){return t.match(/[-=:;]/g)?.length||0}function Qi(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(bo(t),15)<<18}var Cc=["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 sn({n:t,i:e,v:r=[]},i,n,s){t&&(t=nn({n:t,i:e,v:r})),s=[...M(s)];for(let a of r){let l=i.theme("screens",a);for(let c of M(l&&$r(l)||i.v(a))){var o;s.push(c),n|=l?67108864|Qi(c):a=="dark"?1073741824:c[0]=="@"?Qi(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~Cc.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:n,r:s,i:e}}var vo=new Map;function Zi(t){if(t.d){let e=[],r=Xi(t.r.reduce((i,n)=>n[0]=="@"?(e.push(n),i):n?Xi(i,s=>Xi(n,o=>{let a=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(a){let l=s.indexOf(a[1]);return~l?s.slice(0,l)+a[0]+s.slice(l+a[1].length):Ji(s,o)}return Ji(o,s)})):i,"&"),i=>Ji(i,t.n?"."+yo(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,n)=>n+"{"+i+"}",t.d)}}function Xi(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,i,n)=>e(i)+n)}function Ji(t,e){return t.replace(/&/g,e)}var po=new Intl.Collator("en",{numeric:!0});function wo(t,e){for(var r=0,i=t.length;r<i;){let n=i+r>>1;0>=xo(t[n],e)?r=n+1:i=n}return i}function xo(t,e){let r=t.p&F.o;return r==(e.p&F.o)&&(r==F.b||r==F.o)?0:t.p-e.p||t.o-e.o||po.compare(ho(t.n),ho(e.n))||po.compare(fo(t.n),fo(e.n))}function ho(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function fo(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Ki(t,e){return Math.round(parseInt(t,16)*e)}function te(t,e={}){if(typeof t=="function")return t(e);let{opacityValue:r="1",opacityVariable:i}=e,n=i?`var(${i})`:r;if(t.includes("<alpha-value>"))return t.replace("<alpha-value>",n);if(t[0]=="#"&&(t.length==4||t.length==7)){let s=(t.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Ki(t.substr(1,s),o),Ki(t.substr(1+s,s),o),Ki(t.substr(1+2*s,s),o),n]})`}return n=="1"?t:n=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function ko(t,e,r,i,n=[]){return(function s(o,{n:a,p:l,r:c=[],i:d},p){let h=[],y="",f=0,$=0;for(let b in o||{}){var x,E;let k=o[b];if(b[0]=="@"){if(!k)continue;if(b[1]=="a"){h.push(...an(a,l,Er(""+k),p,l,c,d,!0));continue}if(b[1]=="l"){for(let S of M(k))h.push(...s(S,{n:a,p:(x=F[b[7]],l&~F.o|x),r:b[7]=="d"?[]:c,i:d},p));continue}if(b[1]=="i"){h.push(...M(k).map(S=>({p:-1,o:0,r:[],d:b+" "+S})));continue}if(b[1]=="k"){h.push({p:F.d,o:0,r:[b],d:s(k,{p:F.d},p).map(Zi).join("")});continue}if(b[1]=="f"){h.push(...M(k).map(S=>({p:F.d,o:0,r:[b],d:s(S,{p:F.d},p).map(Zi).join("")})));continue}}if(typeof k!="object"||Array.isArray(k))b=="label"&&k?a=k+_r(JSON.stringify([l,d,o])):(k||k===0)&&(b=b.replace(/[A-Z]/g,S=>"-"+S.toLowerCase()),$+=1,f=Math.max(f,(E=b)[0]=="-"?0:bo(E)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(E)?+!!RegExp.$1||-!!RegExp.$2:0)+1),y+=(y?";":"")+M(k).map(S=>p.s(b,on(""+S,p.theme)+(d?" !important":""))).join(";"));else if(b[0]=="@"||b.includes("&")){let S=l;b[0]=="@"&&(b=b.replace(/\bscreen\(([^)]+)\)/g,(P,R)=>{let z=p.theme("screens",R);return z?(S|=67108864,$r(z,"")):P}),S|=Qi(b)),h.push(...s(k,{n:a,p:S,r:[...c,b],i:d},p))}else h.push(...s(k,{p:l,r:[...c,b]},p))}return h.unshift({n:a,p:l,o:Math.max(0,15-$)+1.5*Math.min(f||15,15),r:c,d:y}),h.sort(xo)})(t,sn(e,r,i,n),r)}function on(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,i,n,s,o="")=>{let a=e(n,o);return typeof a=="function"&&/color|fill|stroke/i.test(n)?te(a):""+M(a).filter(l=>Object(l)!==l)})}function _o(t,e){let r,i=[];for(let n of t)n.d&&n.n?r?.p==n.p&&""+r.r==""+n.r?(r.c=[r.c,n.c].filter(Boolean).join(" "),r.d=r.d+";"+n.d):i.push(r={...n,n:n.n&&e}):i.push({...n,n:n.n&&e});return i}function Cr(t,e,r=F.u,i,n){let s=[];for(let o of t)for(let a of(function(l,c,d,p,h){l={...l,i:l.i||h};let y=(function(f,$){let x=vo.get(f.n);return x?x(f,$):$.r(f.n,f.v[0]=="dark")})(l,c);return y?typeof y=="string"?({r:p,p:d}=sn(l,c,d,p),_o(Cr(Er(y),c,d,p,l.i),l.n)):Array.isArray(y)?y.map(f=>{var $,x;return{o:0,...f,r:[...M(p),...M(f.r)],p:($=d,x=f.p??d,$&~F.o|x)}}):ko(y,l,c,d,p):[{c:nn(l),p:0,o:0,r:[]}]})(o,e,r,i,n))s.splice(wo(s,a),0,a);return s}function an(t,e,r,i,n,s,o,a){return _o((a?r.flatMap(l=>Cr([l],i,n,s,o)):Cr(r,i,n,s,o)).map(l=>l.p&F.o&&(l.n||e==F.b)?{...l,p:l.p&~F.o|e,o:0}:l),t)}function Ec(t,e,r,i){var n;return n=(s,o)=>{let{n:a,p:l,r:c,i:d}=sn(s,o,e);return r&&an(a,e,r,o,l,c,d,i)},vo.set(t,n),t}function Yi(t,e,r){if(t[t.length-1]!="("){let i=[],n=!1,s=!1,o="";for(let a of t)if(!(a=="("||/[~@]$/.test(a))){if(a[0]=="!"&&(a=a.slice(1),n=!n),a.endsWith(":")){i[a=="dark:"?"unshift":"push"](a.slice(0,-1));continue}a[0]=="-"&&(a=a.slice(1),s=!s),a.endsWith("-")&&(a=a.slice(0,-1)),a&&a!="&"&&(o+=(o&&"-")+a)}o&&(s&&(o="-"+o),e[0].push({n:o,v:i.filter($c),i:n}))}}function $c(t,e,r){return r.indexOf(t)==e}var mo=new Map;function Er(t){let e=mo.get(t);if(!e){let r=[],i=[[]],n=0,s=0,o=null,a=0,l=(c,d=0)=>{n!=a&&(r.push(t.slice(n,a+d)),c&&Yi(r,i)),n=a+1};for(;a<t.length;a++){let c=t[a];if(s)t[a-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)t[a-1]!="\\"&&o.test(t.slice(a))&&(o=null,n=a+RegExp.lastMatch.length);else if(c=="/"&&t[a-1]!="\\"&&(t[a+1]=="*"||t[a+1]=="/"))o=t[a+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),r.push(c);else if(c==":")t[a+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let d=r.lastIndexOf("(");if(c==")"){let p=r[d-1];if(/[~@]$/.test(p)){let h=i.shift();r.length=d,Yi([...r,"#"],i);let{v:y}=i[0].pop();for(let f of h)f.v.splice(+(f.v[0]=="dark")-+(y[0]=="dark"),y.length);Yi([...r,Ec(p.length>1?p.slice(0,-1)+_r(JSON.stringify([p,h])):p+"("+_c(h)+")",F.a,h,/@$/.test(p))],i)}d=r.lastIndexOf("(",d-1)}r.length=d+1}else/[~@]/.test(c)&&t[a+1]=="("&&i.unshift([])}l(!0),mo.set(t,e=i[0])}return e}function m(t,e,r){return[t,en(e,r)]}function en(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,i)=>({[t]:e?e(r,i):tn(r,1)}):r=>t||{[r[1]]:tn(r,2)}}function tn(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function g(t,e,r,i){return[t,ln(e,r,i)]}function ln(t,e,r){let i=typeof e=="string"?(n,s)=>({[e]:r?r(n,s):n._}):e||(({1:n,_:s},o,a)=>({[n||a]:s}));return(n,s)=>{let o=Co(t||n[1]),a=s.theme(o,n.$$)??ce(n.$$,o,s);if(a!=null)return n._=tn(n,0,a),i(n,s,o)}}function q(t,e={},r){return[t,Sc(e,r)]}function Sc(t={},e){return(r,i)=>{let{section:n=Co(r[0]).replace("-","")+"Color"}=t,[s,o]=Ic(r.$$);if(!s)return;let a=i.theme(n,s)||ce(s,n,i);if(!a||typeof a=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:c=n.replace("Color","Opacity"),property:d=n,selector:p}=t,h=i.theme(c,o||"DEFAULT")||o&&ce(o,c,i),y=e||(({_:$})=>{let x=Mt(d,$);return p?{[p]:x}:x});r._={value:te(a,{opacityVariable:l||void 0,opacityValue:h||void 0}),color:$=>te(a,$),opacityVariable:l||void 0,opacityValue:h||void 0};let f=y(r,i);if(!r.dark){let $=i.d(n,s,a);$&&$!==a&&(r._={value:te($,{opacityVariable:l||void 0,opacityValue:h||"1"}),color:x=>te($,x),opacityVariable:l||void 0,opacityValue:h||void 0},f={"&":f,[i.v("dark")]:y(r,i)})}return f}}function Ic(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Mt(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 ce(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=nt(on(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 Co(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function nt(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",i,n="")=>nt(r)+i+nt(n)):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 cn({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:M(e.variants),rules:M(e.rules),ignorelist:M(e.ignorelist),hash:void 0,stringify:(i,n)=>i+":"+n,finalize:[]};for(let i of M([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&M(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:n,darkMode:s=r.darkMode,darkColor:o=r.darkColor,theme:a,variants:l,rules:c,ignorelist:d,hash:p=r.hash,stringify:h=r.stringify,finalize:y}=typeof i=="function"?i(r):i;r={preflight:r.preflight!==!1&&n!==!1&&[...r.preflight,...M(n)],darkMode:s,darkColor:o,theme:{...r.theme,...a,extend:{...r.theme.extend,...a?.extend}},variants:[...r.variants,...M(l)],rules:[...r.rules,...M(c)],ignorelist:[...r.ignorelist,...M(d)],hash:p,stringify:h,finalize:[...r.finalize,...M(y)]}}return r}function go(t,e,r,i,n,s){for(let o of e){let a=r.get(o);a||r.set(o,a=i(o));let l=a(t,n,s);if(l)return l}}function Ac(t){var e;return rn(t[0],typeof(e=t[1])=="function"?e:()=>e)}function Tc(t){var e,r;return Array.isArray(t)?rn(t[0],en(t[1],t[2])):rn(t,en(e,r))}function rn(t,e){return Eo(t,(r,i,n,s)=>{let o=i.exec(r);if(o)return o.$$=r.slice(o[0].length),o.dark=s,e(o,n)})}function Eo(t,e){let r=M(t).map(Dc);return(i,n,s)=>{for(let o of r){let a=e(i,o,n,s);if(a)return a}}}function Dc(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function $o(t,e){let r=cn(t),i=(function({theme:l,darkMode:c,darkColor:d=Sr,variants:p,rules:h,hash:y,stringify:f,ignorelist:$,finalize:x}){let E=new Map,b=new Map,k=new Map,S=new Map,P=Eo($,(T,W)=>W.test(T));p.push(["dark",Array.isArray(c)||c=="class"?`${M(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let R=typeof y=="function"?T=>y(T,_r):y?_r:uo;R!==uo&&x.push(T=>({...T,n:T.n&&R(T.n),d:T.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(W,K)=>"--"+R(K).replace("#",""))}));let z={theme:(function({extend:T={},...W}){let K={},di={get colors(){return Te("colors")},theme:Te,negative(){return{}},breakpoints(L){let V={};for(let Y in L)typeof L[Y]=="string"&&(V["screen-"+Y]=L[Y]);return V}};return Te;function Te(L,V,Y,bt){if(L){if({1:L,2:bt}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(L)||[,L],/[.[]/.test(L)){let fe=[];L.replace(/\[([^\]]+)\]|([^.[]+)/g,(Me,wt,$l=wt)=>fe.push($l)),L=fe.shift(),Y=V,V=fe.join("-")}let ae=K[L]||Object.assign(Object.assign(K[L]={},Qt(W,L)),Qt(T,L));if(V==null)return ae;V||(V="DEFAULT");let De=ae[V]??V.split("-").reduce((fe,Me)=>fe?.[Me],ae)??Y;return bt?te(De,{opacityValue:on(bt,Te)}):De}let vt={};for(let ae of[...Object.keys(W),...Object.keys(T)])vt[ae]=Te(ae);return vt}function Qt(L,V){let Y=L[V];return typeof Y=="function"&&(Y=Y(di)),Y&&/color|fill|stroke/i.test(V)?(function bt(vt,ae=[]){let De={};for(let fe in vt){let Me=vt[fe],wt=[...ae,fe];De[wt.join("-")]=Me,fe=="DEFAULT"&&(wt=ae,De[ae.join("-")]=Me),typeof Me=="object"&&Object.assign(De,bt(Me,wt))}return De})(Y):Y}})(l),e:yo,h:R,s(T,W){return f(T,W,z)},d(T,W,K){return d(T,W,z,K)},v(T){return E.has(T)||E.set(T,go(T,p,b,Ac,z)||"&:"+T),E.get(T)},r(T,W){let K=JSON.stringify([T,W]);return k.has(K)||k.set(K,!P(T,z)&&go(T,h,S,Tc,z,W)),k.get(K)},f(T){return x.reduce((W,K)=>K(W,z),T)}};return z})(r),n=new Map,s=[],o=new Set;e.resume(l=>n.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),o.add(l)});function a(l){let c=i.f(l),d=Zi(c);if(d&&!o.has(d)){o.add(d);let p=wo(s,l);e.insert(d,p,l),s.splice(p,0,l)}return c.n}return Object.defineProperties(function(c){if(!n.size)for(let p of M(r.preflight))typeof p=="function"&&(p=p(i)),p&&(typeof p=="string"?an("",F.b,Er(p),i,F.b,[],!1,!0):ko(p,{},i,F.b)).forEach(a);c=""+c;let d=n.get(c);if(!d){let p=new Set;for(let h of Cr(Er(c),i))p.add(h.c).add(a(h));d=[...p].filter(Boolean).join(" "),n.set(c,d).set(d,d)}return d},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:r,snapshot(){let l=e.snapshot(),c=new Set(o),d=new Map(n),p=[...s];return()=>{l(),o=c,n=d,s=p}},clear(){e.clear(),o=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Mc(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function So(t){let e=new MutationObserver(r);return{observe(n){e.observe(n,{attributeFilter:["class"],subtree:!0,childList:!0}),i(n),r([{target:n,type:""}])},disconnect(){e.disconnect()}};function r(n){for(let{type:s,target:o}of n)if(s[0]=="a")i(o);else for(let a of o.querySelectorAll("[class]"))i(a);e.takeRecords()}function i(n){let s,o=n.getAttribute?.("class");o&&Mc(o,s=t(o))&&n.setAttribute("class",s)}}function Oc(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 Ir(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:Oc(t)).sheet;return{target:e,snapshot(){let r=Array.from(e.cssRules,i=>i.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,i){try{e.insertRule(r,i)}catch{e.insertRule(":root{}",i)}},resume:Sr}}var Pc=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 Io(t){return Pc.get(t)}function Ao(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 To(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 Uc=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Do(){return({stringify:t})=>({stringify(e,r,i){let n="",s=Io(e);s&&(n+=t(s,r,i)+";");let o=Ao(e),a=To(e,r);for(let l of Uc)o&l[1]&&(n+=t(l[0]+e,r,i)+";"),a&l[1]&&(n+=t(e,l[0]+r,i)+";");return n+t(e,r,i)}})}function Oo(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",ln("lineClamp",({_:t})=>Mo(t))],["line-clamp-(\\d+)",({1:t})=>Mo(t)]]}}function Mo(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var Pt={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",...Z(4,"rem",4,.5,.5),...Z(12,"rem",4,5),14:"3.5rem",...Z(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:I("blur"),backdropBrightness:I("brightness"),backdropContrast:I("contrast"),backdropGrayscale:I("grayscale"),backdropHueRotate:I("hueRotate"),backdropInvert:I("invert"),backdropOpacity:I("opacity"),backdropSaturate:I("saturate"),backdropSepia:I("sepia"),backgroundColor:I("colors"),backgroundImage:{none:"none"},backgroundOpacity:I("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:{...Z(200,"",100,0,50),...Z(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:I("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:I("spacing"),borderWidth:{DEFAULT:"1px",...re(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:I("colors"),caretColor:I("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...Z(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:I("borderColor"),divideOpacity:I("borderOpacity"),divideWidth:I("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"),...Ot(2,6),...Ot(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:I("spacing"),gradientColorStops:I("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"),...Ot(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...Ot(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:{...Z(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:{...Z(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:I("spacing"),placeholderColor:I("colors"),placeholderOpacity:I("opacity"),outlineColor:I("colors"),outlineOffset:re(8,"px"),outlineWidth:re(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:I("colors"),ringOffsetWidth:re(8,"px"),ringOpacity:({theme:t})=>({...t("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...re(8,"px")},rotate:{...re(2,"deg"),...re(12,"deg",3),...re(180,"deg",45)},saturate:Z(200,"",100,0,50),scale:{...Z(150,"",100,0,50),...Z(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:I("spacing"),scrollPadding:I("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...re(2,"deg"),...re(12,"deg",3)},space:I("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:Z(2),textColor:I("colors"),textDecorationColor:I("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...re(8,"px")},textUnderlineOffset:{auto:"auto",...re(8,"px")},textIndent:I("spacing"),textOpacity:I("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:I("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"),...Ot(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:{...Z(50,"",1,0,10),auto:"auto"}};function Ot(t,e){let r={};do for(var i=1;i<t;i++)r[`${i}/${t}`]=Number((i/t*100).toFixed(6))+"%";while(++t<=e);return r}function re(t,e,r=0){let i={};for(;r<=t;r=2*r||1)i[r]=r+e;return i}function Z(t,e="",r=1,i=0,n=1,s={}){for(;i<=t;i+=n)s[i]=i/r+e;return s}function I(t){return({theme:e})=>e(t)}var Po={"*,::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, ${Pt.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, ${Pt.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 qo=[m("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:ce(`[${e}]`,"",r)}}})),m("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),g("aspect-","aspectRatio"),m("container",(t,{theme:e})=>{let{screens:r=e("screens"),center:i,padding:n}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...o("xs")};for(let a in r){let l=r[a];typeof l=="string"&&(s[$r(l)]={"&":{maxWidth:l,...o(a)}})}return s;function o(a){let l=n&&(typeof n=="string"?n:n[a]||n.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),g("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),m("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),m("box-(border|content)","boxSizing",({1:t})=>t+"-box"),m("hidden",{display:"none"}),m("table-(auto|fixed)","tableLayout"),m(["(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)",m("isolate","isolation"),m("object-(contain|cover|fill|none|scale-down)","objectFit"),g("object-","objectPosition"),m("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Ar),m("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),m("(static|fixed|absolute|relative|sticky)","position"),g("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),g("-?(top|bottom|left|right)(?:$|-)","inset"),m("(visible|collapse)","visibility"),m("invisible",{visibility:"hidden"}),g("-?z-","zIndex"),m("flex-((row|col)(-reverse)?)","flexDirection",Uo),m("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),g("(flex-(?:grow|shrink))(?:$|-)"),g("(flex)-"),g("grow(?:$|-)","flexGrow"),g("shrink(?:$|-)","flexShrink"),g("basis-","flexBasis"),g("-?(order)-"),"-?(order)-(\\d+)",g("grid-cols-","gridTemplateColumns"),m("grid-cols-(\\d+)","gridTemplateColumns",Fo),g("col-","gridColumn"),m("col-(span)-(\\d+)","gridColumn",Ro),g("col-start-","gridColumnStart"),m("col-start-(auto|\\d+)","gridColumnStart"),g("col-end-","gridColumnEnd"),m("col-end-(auto|\\d+)","gridColumnEnd"),g("grid-rows-","gridTemplateRows"),m("grid-rows-(\\d+)","gridTemplateRows",Fo),g("row-","gridRow"),m("row-(span)-(\\d+)","gridRow",Ro),g("row-start-","gridRowStart"),m("row-start-(auto|\\d+)","gridRowStart"),g("row-end-","gridRowEnd"),m("row-end-(auto|\\d+)","gridRowEnd"),m("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>Ar(Uo(t))),m("grid-flow-(dense)","gridAutoFlow"),g("auto-cols-","gridAutoColumns"),g("auto-rows-","gridAutoRows"),g("gap-x(?:$|-)","gap","columnGap"),g("gap-y(?:$|-)","gap","rowGap"),g("gap(?:$|-)","gap"),"(justify-(?:items|self))-",m("justify-","justifyContent",Lo),m("(content|items|self)-",t=>({["align-"+t[1]]:Lo(t)})),m("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),g("p([xytrbl])?(?:$|-)","padding",st("padding")),g("-?m([xytrbl])?(?:$|-)","margin",st("margin")),g("-?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))`}})),m("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),g("w-","width"),g("min-w-","minWidth"),g("max-w-","maxWidth"),g("h-","height"),g("min-h-","minHeight"),g("max-h-","maxHeight"),g("font-","fontWeight"),g("font-","fontFamily",({_:t})=>typeof(t=M(t))[1]=="string"?{fontFamily:oe(t)}:{fontFamily:oe(t[0]),...t[1]}),m("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),m("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),m("italic","fontStyle"),m("not-italic",{fontStyle:"normal"}),m("(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)",...Ee({"--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,/*!*/ /*!*/)"})}),g("tracking-","letterSpacing"),g("leading-","lineHeight"),m("list-(inside|outside)","listStylePosition"),g("list-","listStyleType"),m("list-","listStyleType"),g("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),q("placeholder-",{property:"color",selector:"&::placeholder"}),m("text-(left|center|right|justify|start|end)","textAlign"),m("text-(ellipsis|clip)","textOverflow"),g("text-opacity-","textOpacity","--tw-text-opacity"),q("text-",{property:"color"}),g("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),g("indent-","textIndent"),m("(overline|underline|line-through)","textDecorationLine"),m("no-underline",{textDecorationLine:"none"}),g("underline-offset-","textUnderlineOffset"),q("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),g("decoration-","textDecorationThickness"),m("decoration-","textDecorationStyle"),m("(uppercase|lowercase|capitalize)","textTransform"),m("normal-case",{textTransform:"none"}),m("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),m("align-","verticalAlign"),m("whitespace-","whiteSpace"),m("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),m("break-words",{overflowWrap:"break-word"}),m("break-all",{wordBreak:"break-all"}),m("break-keep",{wordBreak:"keep-all"}),q("caret-",{opacityVariable:!1,opacitySection:"opacity"}),q("accent-",{opacityVariable:!1,opacitySection:"opacity"}),m("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${Fe(t," ")},var(--tw-gradient-stops))`),q("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)"})),q("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)`})),q("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),m("bg-(fixed|local|scroll)","backgroundAttachment"),m("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),m(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),m("bg-blend-","backgroundBlendMode"),m("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),g("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),q("bg-",{section:"backgroundColor"}),g("bg-","backgroundImage"),g("bg-","backgroundPosition"),m("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Ar),g("bg-","backgroundSize"),g("rounded(?:$|-)","borderRadius"),g("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-${Fe(r[0])}-radius`]:e,[`border-${Fe(r[1])}-radius`]:e}}),m("border-(collapse|separate)","borderCollapse"),g("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),m("border-(solid|dashed|dotted|double|none)","borderStyle"),g("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...Ee({"--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)"})),q("border-([xytrbl])-",{section:"borderColor"},st("border","Color")),q("border-"),g("border-([xytrbl])(?:$|-)","borderWidth",st("border","Width")),g("border(?:$|-)","borderWidth"),g("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),m("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),m("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),g("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${Fe(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${Fe(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),q("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),g("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),q("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),g("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),m("ring-inset",{"--tw-ring-inset":"inset"}),q("ring-",{property:"--tw-ring-color"}),g("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...Ee({"--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":te(e("ringOffsetColor","","#fff")),"--tw-ring-color":te(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)"})),q("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),g("shadow(?:$|-)","boxShadow",({_:t})=>({...Ee({"--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":oe(t),"--tw-shadow-colored":oe(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)"})),g("(opacity)-"),m("mix-blend-","mixBlendMode"),...jo(),...jo("backdrop-"),g("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:oe(t),transitionTimingFunction:t._=="none"?void 0:oe(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:oe(e("transitionDuration",""))})),g("duration(?:$|-)","transitionDuration","transitionDuration",oe),g("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",oe),g("delay(?:$|-)","transitionDelay","transitionDelay",oe),g("animate(?:$|-)","animation",(t,{theme:e,h:r,e:i})=>{let n=oe(t),s=n.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=i(r(s[0])))]:o,animation:s.join(" ")}:{animation:n}}),"(transform)-(none)",m("transform",dn),m("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":Bo(t=="gpu")})),g("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...dn()})),g("-?(rotate)-","rotate",un),g("-?(translate-[xy])-","translate",un),g("-?(skew-[xy])-","skew",un),m("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Ar),"(appearance)-",g("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",g("(cursor)-"),"(cursor)-",m("snap-(none)","scroll-snap-type"),m("snap-(x|y|both)",({1:t})=>({...Ee({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),m("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),m("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),m("snap-(normal|always)","scroll-snap-stop"),m("scroll-(auto|smooth)","scroll-behavior"),g("scroll-p([xytrbl])?(?:$|-)","padding",st("scroll-padding")),g("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",st("scroll-margin")),m("touch-(auto|none|manipulation)","touch-action"),m("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...Ee({"--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)"})),m("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),m("outline",{outlineStyle:"solid"}),m("outline-(dashed|dotted|double)","outlineStyle"),g("-?(outline-offset)-"),q("outline-",{opacityVariable:!1,opacitySection:"opacity"}),g("outline-","outlineWidth"),"(pointer-events)-",g("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],m("select-(none|text|all|auto)","userSelect"),q("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),q("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),g("stroke-","strokeWidth"),m("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),m("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Ar(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function Uo(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function Fe(t,e="-"){let r=[];for(let i of t)r.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return r.join(e)}function oe(t){return t&&""+(t._||t)}function Lo({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function st(t,e=""){return({1:r,_:i})=>{let n={x:"lr",y:"tb"}[r]||r+r;return n?{...Mt(t+"-"+Fe(n[0])+e,i),...Mt(t+"-"+Fe(n[1])+e,i)}:Mt(t+e,i)}}function jo(t=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",t&&"opacity","saturate","sepia",!t&&"drop-shadow"].filter(Boolean),r={};for(let i of e)r[`--tw-${t}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...Ee(r),[`${t}filter`]:e.map(i=>`var(--tw-${t}${i})`).join(" ")},[`(${t}filter)-(none)`,m(`${t}filter`,r),...e.map(i=>g(`${i[0]=="h"?"-?":""}(${t}${i})(?:$|-)`,i,({1:n,_:s})=>({[`--tw-${n}`]:M(s).map(o=>`${i}(${o})`).join(" "),...r})))]}function un({1:t,_:e}){return{["--tw-"+t]:e,...dn()}}function dn(){return{...Ee({"--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":Bo()}),transform:"var(--tw-transform)"}}function Bo(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 Ro({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function Fo({1:t}){return`repeat(${t},minmax(0,1fr))`}function Ee(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var No=[["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)||ce(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:i="",6:n=e},{e:s,h:o,v:a})=>{let l=nt(i)||(r[0]=="["?r:a(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(t+n))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||ce(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)||ce(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=ce(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&nt(t).replace(/[}]+$/,"").split("{")]];function zo({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:Po,theme:{...Pt,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:No,rules:qo,finalize(r){return r.n&&r.d&&r.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(r.d)?{...r,d:"content:var(--tw-content);"+r.d}:r}}}var Lc={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},jc={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Rc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Fc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},qc={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Bc={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Nc={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},zc={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Wc={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Vc={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Hc={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Gc={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Xc={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Jc={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Kc={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Yc={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Qc={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Zc={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},eu={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},tu={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},ru={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},iu={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Wo={__proto__:null,slate:Lc,gray:jc,zinc:Rc,neutral:Fc,stone:qc,red:Bc,orange:Nc,amber:zc,yellow:Wc,lime:Vc,green:Hc,emerald:Gc,teal:Xc,cyan:Jc,sky:Kc,blue:Yc,indigo:Qc,violet:Zc,purple:eu,fuchsia:tu,pink:ru,rose:iu};function Vo({disablePreflight:t}={}){return zo({colors:Wo,disablePreflight:t})}function Xo({className:t="prose",defaultColor:e="gray",extend:r={},colors:i={}}={}){return i={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",...i,dark:i.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",...i.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}`,(a,l)=>Jo(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 a=Go(o.theme("fontSize",s));return a&&{"@layer components":a}}],[t+"-",({$$:s},o)=>n(s,o)],[t,(s,o)=>({...n(e,o),"@layer base":[Ho(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"}}),Ho(t,o,r)],"@layer components":{...Go(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,o){let a={},l={},c=(d,p,h)=>{let y=o.theme(`colors.${s}.${p}`,p);h["--tw-prose-"+d]=te(y);let f=h!=l&&o.d("colors",`${s}-${p}`,y);f&&(l["--tw-prose-"+d]=te(f))};for(let d in i){let p=i[d];d!="dark"&&p&&c(d,p,a)}for(let d in i.dark||{}){let p=i.dark[d];p&&(i.dark?c("invert-"+d,p,a):c(d,p,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function Ho(t,e,r){let i={};for(let n in r)i[Jo(t,n,e,s=>`.${e.e(e.h(t))}${s}`)]=r[n];return i}function Jo(t,e,{e:r,h:i},n){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",a=s,l="")=>n(`${o}:where(${a}):not(:where(.${r(i("not-"+t))} *))${l}`))}function Go(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 pn=cn({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:[Vo(),Do(),Oo(),Xo()]});function Ko(t,e=!0){let r=(function(){if(nu)try{let l=Ir(new CSSStyleSheet);return l.connect=c=>{let d=hn(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,l.target]},l.disconnect=Sr,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Ir(s)],a=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,d){o[0].insert(l,c,d);let p=this.target.cssRules[c];o.forEach((h,y)=>y&&h.target.insertRule(p.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");hn(l).appendChild(c);let d=Ir(c),{cssRules:p}=this.target;for(let h=0;h<p.length;h++)d.target.insertRule(p[h].cssText,h);o.push(d),a.set(l,d)},disconnect(l){let c=o.indexOf(a.get(l));c>=0&&o.splice(c,1)}}})(),i=$o({...t,hash:t.hash??e},r),n=So(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),n.observe(hn(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var nu=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function hn(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var w=t=>Ko(pn)(t);var fn=class extends w(v){static properties={color:{type:String},radius:{type:String},size:{type:String},border:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
148
+ `;constructor(){super(),this.name,this.fill=!1}render(){if(!this.name)return null;let e=Ic[this.name];return e||(console.warn(`mw-icon: '${this.name}' not found`),null)}};customElements.get("mw-icon")||customElements.define("mw-icon",en);function dn(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function Ac(t,e=","){return t.map(dn).join(e)}var Co=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Ir(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 Mr(t,e="@media "){return e+D(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(i=>`(${i}-width:${r[i]})`).join(" and "))).join(",")}function D(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function bo(t){return t}function Dr(){}var q={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function Eo(t){return t.match(/[-=:;]/g)?.length||0}function on(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(Eo(t),15)<<18}var Tc=["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 pn({n:t,i:e,v:r=[]},i,n,s){t&&(t=dn({n:t,i:e,v:r})),s=[...D(s)];for(let a of r){let l=i.theme("screens",a);for(let c of D(l&&Mr(l)||i.v(a))){var o;s.push(c),n|=l?67108864|on(c):a=="dark"?1073741824:c[0]=="@"?on(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~Tc.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:n,r:s,i:e}}var So=new Map;function an(t){if(t.d){let e=[],r=tn(t.r.reduce((i,n)=>n[0]=="@"?(e.push(n),i):n?tn(i,s=>tn(n,o=>{let a=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(a){let l=s.indexOf(a[1]);return~l?s.slice(0,l)+a[0]+s.slice(l+a[1].length):rn(s,o)}return rn(o,s)})):i,"&"),i=>rn(i,t.n?"."+Co(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,n)=>n+"{"+i+"}",t.d)}}function tn(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,i,n)=>e(i)+n)}function rn(t,e){return t.replace(/&/g,e)}var vo=new Intl.Collator("en",{numeric:!0});function $o(t,e){for(var r=0,i=t.length;r<i;){let n=i+r>>1;0>=Io(t[n],e)?r=n+1:i=n}return i}function Io(t,e){let r=t.p&q.o;return r==(e.p&q.o)&&(r==q.b||r==q.o)?0:t.p-e.p||t.o-e.o||vo.compare(wo(t.n),wo(e.n))||vo.compare(xo(t.n),xo(e.n))}function wo(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function xo(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function nn(t,e){return Math.round(parseInt(t,16)*e)}function te(t,e={}){if(typeof t=="function")return t(e);let{opacityValue:r="1",opacityVariable:i}=e,n=i?`var(${i})`:r;if(t.includes("<alpha-value>"))return t.replace("<alpha-value>",n);if(t[0]=="#"&&(t.length==4||t.length==7)){let s=(t.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[nn(t.substr(1,s),o),nn(t.substr(1+s,s),o),nn(t.substr(1+2*s,s),o),n]})`}return n=="1"?t:n=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function Ao(t,e,r,i,n=[]){return(function s(o,{n:a,p:l,r:c=[],i:d},p){let h=[],m="",f=0,E=0;for(let b in o||{}){var x,S;let k=o[b];if(b[0]=="@"){if(!k)continue;if(b[1]=="a"){h.push(...fn(a,l,Tr(""+k),p,l,c,d,!0));continue}if(b[1]=="l"){for(let $ of D(k))h.push(...s($,{n:a,p:(x=q[b[7]],l&~q.o|x),r:b[7]=="d"?[]:c,i:d},p));continue}if(b[1]=="i"){h.push(...D(k).map($=>({p:-1,o:0,r:[],d:b+" "+$})));continue}if(b[1]=="k"){h.push({p:q.d,o:0,r:[b],d:s(k,{p:q.d},p).map(an).join("")});continue}if(b[1]=="f"){h.push(...D(k).map($=>({p:q.d,o:0,r:[b],d:s($,{p:q.d},p).map(an).join("")})));continue}}if(typeof k!="object"||Array.isArray(k))b=="label"&&k?a=k+Ir(JSON.stringify([l,d,o])):(k||k===0)&&(b=b.replace(/[A-Z]/g,$=>"-"+$.toLowerCase()),E+=1,f=Math.max(f,(S=b)[0]=="-"?0:Eo(S)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(S)?+!!RegExp.$1||-!!RegExp.$2:0)+1),m+=(m?";":"")+D(k).map($=>p.s(b,hn(""+$,p.theme)+(d?" !important":""))).join(";"));else if(b[0]=="@"||b.includes("&")){let $=l;b[0]=="@"&&(b=b.replace(/\bscreen\(([^)]+)\)/g,(P,F)=>{let W=p.theme("screens",F);return W?($|=67108864,Mr(W,"")):P}),$|=on(b)),h.push(...s(k,{n:a,p:$,r:[...c,b],i:d},p))}else h.push(...s(k,{p:l,r:[...c,b]},p))}return h.unshift({n:a,p:l,o:Math.max(0,15-E)+1.5*Math.min(f||15,15),r:c,d:m}),h.sort(Io)})(t,pn(e,r,i,n),r)}function hn(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,i,n,s,o="")=>{let a=e(n,o);return typeof a=="function"&&/color|fill|stroke/i.test(n)?te(a):""+D(a).filter(l=>Object(l)!==l)})}function To(t,e){let r,i=[];for(let n of t)n.d&&n.n?r?.p==n.p&&""+r.r==""+n.r?(r.c=[r.c,n.c].filter(Boolean).join(" "),r.d=r.d+";"+n.d):i.push(r={...n,n:n.n&&e}):i.push({...n,n:n.n&&e});return i}function Ar(t,e,r=q.u,i,n){let s=[];for(let o of t)for(let a of(function(l,c,d,p,h){l={...l,i:l.i||h};let m=(function(f,E){let x=So.get(f.n);return x?x(f,E):E.r(f.n,f.v[0]=="dark")})(l,c);return m?typeof m=="string"?({r:p,p:d}=pn(l,c,d,p),To(Ar(Tr(m),c,d,p,l.i),l.n)):Array.isArray(m)?m.map(f=>{var E,x;return{o:0,...f,r:[...D(p),...D(f.r)],p:(E=d,x=f.p??d,E&~q.o|x)}}):Ao(m,l,c,d,p):[{c:dn(l),p:0,o:0,r:[]}]})(o,e,r,i,n))s.splice($o(s,a),0,a);return s}function fn(t,e,r,i,n,s,o,a){return To((a?r.flatMap(l=>Ar([l],i,n,s,o)):Ar(r,i,n,s,o)).map(l=>l.p&q.o&&(l.n||e==q.b)?{...l,p:l.p&~q.o|e,o:0}:l),t)}function Mc(t,e,r,i){var n;return n=(s,o)=>{let{n:a,p:l,r:c,i:d}=pn(s,o,e);return r&&fn(a,e,r,o,l,c,d,i)},So.set(t,n),t}function sn(t,e,r){if(t[t.length-1]!="("){let i=[],n=!1,s=!1,o="";for(let a of t)if(!(a=="("||/[~@]$/.test(a))){if(a[0]=="!"&&(a=a.slice(1),n=!n),a.endsWith(":")){i[a=="dark:"?"unshift":"push"](a.slice(0,-1));continue}a[0]=="-"&&(a=a.slice(1),s=!s),a.endsWith("-")&&(a=a.slice(0,-1)),a&&a!="&"&&(o+=(o&&"-")+a)}o&&(s&&(o="-"+o),e[0].push({n:o,v:i.filter(Dc),i:n}))}}function Dc(t,e,r){return r.indexOf(t)==e}var ko=new Map;function Tr(t){let e=ko.get(t);if(!e){let r=[],i=[[]],n=0,s=0,o=null,a=0,l=(c,d=0)=>{n!=a&&(r.push(t.slice(n,a+d)),c&&sn(r,i)),n=a+1};for(;a<t.length;a++){let c=t[a];if(s)t[a-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)t[a-1]!="\\"&&o.test(t.slice(a))&&(o=null,n=a+RegExp.lastMatch.length);else if(c=="/"&&t[a-1]!="\\"&&(t[a+1]=="*"||t[a+1]=="/"))o=t[a+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),r.push(c);else if(c==":")t[a+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let d=r.lastIndexOf("(");if(c==")"){let p=r[d-1];if(/[~@]$/.test(p)){let h=i.shift();r.length=d,sn([...r,"#"],i);let{v:m}=i[0].pop();for(let f of h)f.v.splice(+(f.v[0]=="dark")-+(m[0]=="dark"),m.length);sn([...r,Mc(p.length>1?p.slice(0,-1)+Ir(JSON.stringify([p,h])):p+"("+Ac(h)+")",q.a,h,/@$/.test(p))],i)}d=r.lastIndexOf("(",d-1)}r.length=d+1}else/[~@]/.test(c)&&t[a+1]=="("&&i.unshift([])}l(!0),ko.set(t,e=i[0])}return e}function g(t,e,r){return[t,ln(e,r)]}function ln(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,i)=>({[t]:e?e(r,i):cn(r,1)}):r=>t||{[r[1]]:cn(r,2)}}function cn(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function y(t,e,r,i){return[t,mn(e,r,i)]}function mn(t,e,r){let i=typeof e=="string"?(n,s)=>({[e]:r?r(n,s):n._}):e||(({1:n,_:s},o,a)=>({[n||a]:s}));return(n,s)=>{let o=Mo(t||n[1]),a=s.theme(o,n.$$)??ue(n.$$,o,s);if(a!=null)return n._=cn(n,0,a),i(n,s,o)}}function B(t,e={},r){return[t,Oc(e,r)]}function Oc(t={},e){return(r,i)=>{let{section:n=Mo(r[0]).replace("-","")+"Color"}=t,[s,o]=Pc(r.$$);if(!s)return;let a=i.theme(n,s)||ue(s,n,i);if(!a||typeof a=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:c=n.replace("Color","Opacity"),property:d=n,selector:p}=t,h=i.theme(c,o||"DEFAULT")||o&&ue(o,c,i),m=e||(({_:E})=>{let x=Rt(d,E);return p?{[p]:x}:x});r._={value:te(a,{opacityVariable:l||void 0,opacityValue:h||void 0}),color:E=>te(a,E),opacityVariable:l||void 0,opacityValue:h||void 0};let f=m(r,i);if(!r.dark){let E=i.d(n,s,a);E&&E!==a&&(r._={value:te(E,{opacityVariable:l||void 0,opacityValue:h||"1"}),color:x=>te(E,x),opacityVariable:l||void 0,opacityValue:h||void 0},f={"&":f,[i.v("dark")]:m(r,i)})}return f}}function Pc(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Rt(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 ue(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=ot(hn(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 Mo(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function ot(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",i,n="")=>ot(r)+i+ot(n)):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 gn({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:D(e.variants),rules:D(e.rules),ignorelist:D(e.ignorelist),hash:void 0,stringify:(i,n)=>i+":"+n,finalize:[]};for(let i of D([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&D(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:n,darkMode:s=r.darkMode,darkColor:o=r.darkColor,theme:a,variants:l,rules:c,ignorelist:d,hash:p=r.hash,stringify:h=r.stringify,finalize:m}=typeof i=="function"?i(r):i;r={preflight:r.preflight!==!1&&n!==!1&&[...r.preflight,...D(n)],darkMode:s,darkColor:o,theme:{...r.theme,...a,extend:{...r.theme.extend,...a?.extend}},variants:[...r.variants,...D(l)],rules:[...r.rules,...D(c)],ignorelist:[...r.ignorelist,...D(d)],hash:p,stringify:h,finalize:[...r.finalize,...D(m)]}}return r}function _o(t,e,r,i,n,s){for(let o of e){let a=r.get(o);a||r.set(o,a=i(o));let l=a(t,n,s);if(l)return l}}function Rc(t){var e;return un(t[0],typeof(e=t[1])=="function"?e:()=>e)}function Uc(t){var e,r;return Array.isArray(t)?un(t[0],ln(t[1],t[2])):un(t,ln(e,r))}function un(t,e){return Do(t,(r,i,n,s)=>{let o=i.exec(r);if(o)return o.$$=r.slice(o[0].length),o.dark=s,e(o,n)})}function Do(t,e){let r=D(t).map(Lc);return(i,n,s)=>{for(let o of r){let a=e(i,o,n,s);if(a)return a}}}function Lc(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function Oo(t,e){let r=gn(t),i=(function({theme:l,darkMode:c,darkColor:d=Dr,variants:p,rules:h,hash:m,stringify:f,ignorelist:E,finalize:x}){let S=new Map,b=new Map,k=new Map,$=new Map,P=Do(E,(T,V)=>V.test(T));p.push(["dark",Array.isArray(c)||c=="class"?`${D(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let F=typeof m=="function"?T=>m(T,Ir):m?Ir:bo;F!==bo&&x.push(T=>({...T,n:T.n&&F(T.n),d:T.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(V,Y)=>"--"+F(Y).replace("#",""))}));let W={theme:(function({extend:T={},...V}){let Y={},bi={get colors(){return Me("colors")},theme:Me,negative(){return{}},breakpoints(U){let H={};for(let K in U)typeof U[K]=="string"&&(H["screen-"+K]=U[K]);return H}};return Me;function Me(U,H,K,xt){if(U){if({1:U,2:xt}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(U)||[,U],/[.[]/.test(U)){let me=[];U.replace(/\[([^\]]+)\]|([^.[]+)/g,(Oe,_t,Dl=_t)=>me.push(Dl)),U=me.shift(),K=H,H=me.join("-")}let le=Y[U]||Object.assign(Object.assign(Y[U]={},ir(V,U)),ir(T,U));if(H==null)return le;H||(H="DEFAULT");let De=le[H]??H.split("-").reduce((me,Oe)=>me?.[Oe],le)??K;return xt?te(De,{opacityValue:hn(xt,Me)}):De}let kt={};for(let le of[...Object.keys(V),...Object.keys(T)])kt[le]=Me(le);return kt}function ir(U,H){let K=U[H];return typeof K=="function"&&(K=K(bi)),K&&/color|fill|stroke/i.test(H)?(function xt(kt,le=[]){let De={};for(let me in kt){let Oe=kt[me],_t=[...le,me];De[_t.join("-")]=Oe,me=="DEFAULT"&&(_t=le,De[le.join("-")]=Oe),typeof Oe=="object"&&Object.assign(De,xt(Oe,_t))}return De})(K):K}})(l),e:Co,h:F,s(T,V){return f(T,V,W)},d(T,V,Y){return d(T,V,W,Y)},v(T){return S.has(T)||S.set(T,_o(T,p,b,Rc,W)||"&:"+T),S.get(T)},r(T,V){let Y=JSON.stringify([T,V]);return k.has(Y)||k.set(Y,!P(T,W)&&_o(T,h,$,Uc,W,V)),k.get(Y)},f(T){return x.reduce((V,Y)=>Y(V,W),T)}};return W})(r),n=new Map,s=[],o=new Set;e.resume(l=>n.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),o.add(l)});function a(l){let c=i.f(l),d=an(c);if(d&&!o.has(d)){o.add(d);let p=$o(s,l);e.insert(d,p,l),s.splice(p,0,l)}return c.n}return Object.defineProperties(function(c){if(!n.size)for(let p of D(r.preflight))typeof p=="function"&&(p=p(i)),p&&(typeof p=="string"?fn("",q.b,Tr(p),i,q.b,[],!1,!0):Ao(p,{},i,q.b)).forEach(a);c=""+c;let d=n.get(c);if(!d){let p=new Set;for(let h of Ar(Tr(c),i))p.add(h.c).add(a(h));d=[...p].filter(Boolean).join(" "),n.set(c,d).set(d,d)}return d},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:r,snapshot(){let l=e.snapshot(),c=new Set(o),d=new Map(n),p=[...s];return()=>{l(),o=c,n=d,s=p}},clear(){e.clear(),o=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function jc(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function Po(t){let e=new MutationObserver(r);return{observe(n){e.observe(n,{attributeFilter:["class"],subtree:!0,childList:!0}),i(n),r([{target:n,type:""}])},disconnect(){e.disconnect()}};function r(n){for(let{type:s,target:o}of n)if(s[0]=="a")i(o);else for(let a of o.querySelectorAll("[class]"))i(a);e.takeRecords()}function i(n){let s,o=n.getAttribute?.("class");o&&jc(o,s=t(o))&&n.setAttribute("class",s)}}function Fc(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 Or(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:Fc(t)).sheet;return{target:e,snapshot(){let r=Array.from(e.cssRules,i=>i.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,i){try{e.insertRule(r,i)}catch{e.insertRule(":root{}",i)}},resume:Dr}}var qc=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 Ro(t){return qc.get(t)}function Uo(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 Lo(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 Bc=[["-webkit-",1],["-moz-",2],["-ms-",4]];function jo(){return({stringify:t})=>({stringify(e,r,i){let n="",s=Ro(e);s&&(n+=t(s,r,i)+";");let o=Uo(e),a=Lo(e,r);for(let l of Bc)o&l[1]&&(n+=t(l[0]+e,r,i)+";"),a&l[1]&&(n+=t(e,l[0]+r,i)+";");return n+t(e,r,i)}})}function qo(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",mn("lineClamp",({_:t})=>Fo(t))],["line-clamp-(\\d+)",({1:t})=>Fo(t)]]}}function Fo(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var Lt={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",...Z(4,"rem",4,.5,.5),...Z(12,"rem",4,5),14:"3.5rem",...Z(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:I("blur"),backdropBrightness:I("brightness"),backdropContrast:I("contrast"),backdropGrayscale:I("grayscale"),backdropHueRotate:I("hueRotate"),backdropInvert:I("invert"),backdropOpacity:I("opacity"),backdropSaturate:I("saturate"),backdropSepia:I("sepia"),backgroundColor:I("colors"),backgroundImage:{none:"none"},backgroundOpacity:I("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:{...Z(200,"",100,0,50),...Z(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:I("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:I("spacing"),borderWidth:{DEFAULT:"1px",...re(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:I("colors"),caretColor:I("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...Z(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:I("borderColor"),divideOpacity:I("borderOpacity"),divideWidth:I("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"),...Ut(2,6),...Ut(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:I("spacing"),gradientColorStops:I("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"),...Ut(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...Ut(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:{...Z(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:{...Z(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:I("spacing"),placeholderColor:I("colors"),placeholderOpacity:I("opacity"),outlineColor:I("colors"),outlineOffset:re(8,"px"),outlineWidth:re(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:I("colors"),ringOffsetWidth:re(8,"px"),ringOpacity:({theme:t})=>({...t("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...re(8,"px")},rotate:{...re(2,"deg"),...re(12,"deg",3),...re(180,"deg",45)},saturate:Z(200,"",100,0,50),scale:{...Z(150,"",100,0,50),...Z(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:I("spacing"),scrollPadding:I("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...re(2,"deg"),...re(12,"deg",3)},space:I("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:Z(2),textColor:I("colors"),textDecorationColor:I("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...re(8,"px")},textUnderlineOffset:{auto:"auto",...re(8,"px")},textIndent:I("spacing"),textOpacity:I("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:I("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"),...Ut(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:{...Z(50,"",1,0,10),auto:"auto"}};function Ut(t,e){let r={};do for(var i=1;i<t;i++)r[`${i}/${t}`]=Number((i/t*100).toFixed(6))+"%";while(++t<=e);return r}function re(t,e,r=0){let i={};for(;r<=t;r=2*r||1)i[r]=r+e;return i}function Z(t,e="",r=1,i=0,n=1,s={}){for(;i<=t;i+=n)s[i]=i/r+e;return s}function I(t){return({theme:e})=>e(t)}var Bo={"*,::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, ${Lt.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, ${Lt.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 Go=[g("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:ue(`[${e}]`,"",r)}}})),g("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),y("aspect-","aspectRatio"),g("container",(t,{theme:e})=>{let{screens:r=e("screens"),center:i,padding:n}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...o("xs")};for(let a in r){let l=r[a];typeof l=="string"&&(s[Mr(l)]={"&":{maxWidth:l,...o(a)}})}return s;function o(a){let l=n&&(typeof n=="string"?n:n[a]||n.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),y("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),g("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),g("box-(border|content)","boxSizing",({1:t})=>t+"-box"),g("hidden",{display:"none"}),g("table-(auto|fixed)","tableLayout"),g(["(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)",g("isolate","isolation"),g("object-(contain|cover|fill|none|scale-down)","objectFit"),y("object-","objectPosition"),g("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Pr),g("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),g("(static|fixed|absolute|relative|sticky)","position"),y("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),y("-?(top|bottom|left|right)(?:$|-)","inset"),g("(visible|collapse)","visibility"),g("invisible",{visibility:"hidden"}),y("-?z-","zIndex"),g("flex-((row|col)(-reverse)?)","flexDirection",No),g("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),y("(flex-(?:grow|shrink))(?:$|-)"),y("(flex)-"),y("grow(?:$|-)","flexGrow"),y("shrink(?:$|-)","flexShrink"),y("basis-","flexBasis"),y("-?(order)-"),"-?(order)-(\\d+)",y("grid-cols-","gridTemplateColumns"),g("grid-cols-(\\d+)","gridTemplateColumns",Ho),y("col-","gridColumn"),g("col-(span)-(\\d+)","gridColumn",Vo),y("col-start-","gridColumnStart"),g("col-start-(auto|\\d+)","gridColumnStart"),y("col-end-","gridColumnEnd"),g("col-end-(auto|\\d+)","gridColumnEnd"),y("grid-rows-","gridTemplateRows"),g("grid-rows-(\\d+)","gridTemplateRows",Ho),y("row-","gridRow"),g("row-(span)-(\\d+)","gridRow",Vo),y("row-start-","gridRowStart"),g("row-start-(auto|\\d+)","gridRowStart"),y("row-end-","gridRowEnd"),g("row-end-(auto|\\d+)","gridRowEnd"),g("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>Pr(No(t))),g("grid-flow-(dense)","gridAutoFlow"),y("auto-cols-","gridAutoColumns"),y("auto-rows-","gridAutoRows"),y("gap-x(?:$|-)","gap","columnGap"),y("gap-y(?:$|-)","gap","rowGap"),y("gap(?:$|-)","gap"),"(justify-(?:items|self))-",g("justify-","justifyContent",zo),g("(content|items|self)-",t=>({["align-"+t[1]]:zo(t)})),g("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),y("p([xytrbl])?(?:$|-)","padding",at("padding")),y("-?m([xytrbl])?(?:$|-)","margin",at("margin")),y("-?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))`}})),g("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),y("w-","width"),y("min-w-","minWidth"),y("max-w-","maxWidth"),y("h-","height"),y("min-h-","minHeight"),y("max-h-","maxHeight"),y("font-","fontWeight"),y("font-","fontFamily",({_:t})=>typeof(t=D(t))[1]=="string"?{fontFamily:ae(t)}:{fontFamily:ae(t[0]),...t[1]}),g("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),g("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),g("italic","fontStyle"),g("not-italic",{fontStyle:"normal"}),g("(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)",...Se({"--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,/*!*/ /*!*/)"})}),y("tracking-","letterSpacing"),y("leading-","lineHeight"),g("list-(inside|outside)","listStylePosition"),y("list-","listStyleType"),g("list-","listStyleType"),y("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),B("placeholder-",{property:"color",selector:"&::placeholder"}),g("text-(left|center|right|justify|start|end)","textAlign"),g("text-(ellipsis|clip)","textOverflow"),y("text-opacity-","textOpacity","--tw-text-opacity"),B("text-",{property:"color"}),y("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),y("indent-","textIndent"),g("(overline|underline|line-through)","textDecorationLine"),g("no-underline",{textDecorationLine:"none"}),y("underline-offset-","textUnderlineOffset"),B("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),y("decoration-","textDecorationThickness"),g("decoration-","textDecorationStyle"),g("(uppercase|lowercase|capitalize)","textTransform"),g("normal-case",{textTransform:"none"}),g("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),g("align-","verticalAlign"),g("whitespace-","whiteSpace"),g("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),g("break-words",{overflowWrap:"break-word"}),g("break-all",{wordBreak:"break-all"}),g("break-keep",{wordBreak:"keep-all"}),B("caret-",{opacityVariable:!1,opacitySection:"opacity"}),B("accent-",{opacityVariable:!1,opacitySection:"opacity"}),g("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${qe(t," ")},var(--tw-gradient-stops))`),B("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)"})),B("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)`})),B("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),g("bg-(fixed|local|scroll)","backgroundAttachment"),g("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),g(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),g("bg-blend-","backgroundBlendMode"),g("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),y("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),B("bg-",{section:"backgroundColor"}),y("bg-","backgroundImage"),y("bg-","backgroundPosition"),g("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Pr),y("bg-","backgroundSize"),y("rounded(?:$|-)","borderRadius"),y("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-${qe(r[0])}-radius`]:e,[`border-${qe(r[1])}-radius`]:e}}),g("border-(collapse|separate)","borderCollapse"),y("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),g("border-(solid|dashed|dotted|double|none)","borderStyle"),y("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...Se({"--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)"})),B("border-([xytrbl])-",{section:"borderColor"},at("border","Color")),B("border-"),y("border-([xytrbl])(?:$|-)","borderWidth",at("border","Width")),y("border(?:$|-)","borderWidth"),y("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),g("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),g("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),y("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${qe(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${qe(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),B("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),y("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),B("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),y("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),g("ring-inset",{"--tw-ring-inset":"inset"}),B("ring-",{property:"--tw-ring-color"}),y("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...Se({"--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":te(e("ringOffsetColor","","#fff")),"--tw-ring-color":te(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)"})),B("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),y("shadow(?:$|-)","boxShadow",({_:t})=>({...Se({"--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":ae(t),"--tw-shadow-colored":ae(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)"})),y("(opacity)-"),g("mix-blend-","mixBlendMode"),...Wo(),...Wo("backdrop-"),y("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:ae(t),transitionTimingFunction:t._=="none"?void 0:ae(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:ae(e("transitionDuration",""))})),y("duration(?:$|-)","transitionDuration","transitionDuration",ae),y("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",ae),y("delay(?:$|-)","transitionDelay","transitionDelay",ae),y("animate(?:$|-)","animation",(t,{theme:e,h:r,e:i})=>{let n=ae(t),s=n.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=i(r(s[0])))]:o,animation:s.join(" ")}:{animation:n}}),"(transform)-(none)",g("transform",bn),g("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":Jo(t=="gpu")})),y("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...bn()})),y("-?(rotate)-","rotate",yn),y("-?(translate-[xy])-","translate",yn),y("-?(skew-[xy])-","skew",yn),g("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Pr),"(appearance)-",y("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",y("(cursor)-"),"(cursor)-",g("snap-(none)","scroll-snap-type"),g("snap-(x|y|both)",({1:t})=>({...Se({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),g("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),g("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),g("snap-(normal|always)","scroll-snap-stop"),g("scroll-(auto|smooth)","scroll-behavior"),y("scroll-p([xytrbl])?(?:$|-)","padding",at("scroll-padding")),y("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",at("scroll-margin")),g("touch-(auto|none|manipulation)","touch-action"),g("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...Se({"--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)"})),g("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),g("outline",{outlineStyle:"solid"}),g("outline-(dashed|dotted|double)","outlineStyle"),y("-?(outline-offset)-"),B("outline-",{opacityVariable:!1,opacitySection:"opacity"}),y("outline-","outlineWidth"),"(pointer-events)-",y("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],g("select-(none|text|all|auto)","userSelect"),B("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),B("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),y("stroke-","strokeWidth"),g("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),g("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Pr(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function No(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function qe(t,e="-"){let r=[];for(let i of t)r.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return r.join(e)}function ae(t){return t&&""+(t._||t)}function zo({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function at(t,e=""){return({1:r,_:i})=>{let n={x:"lr",y:"tb"}[r]||r+r;return n?{...Rt(t+"-"+qe(n[0])+e,i),...Rt(t+"-"+qe(n[1])+e,i)}:Rt(t+e,i)}}function Wo(t=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",t&&"opacity","saturate","sepia",!t&&"drop-shadow"].filter(Boolean),r={};for(let i of e)r[`--tw-${t}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...Se(r),[`${t}filter`]:e.map(i=>`var(--tw-${t}${i})`).join(" ")},[`(${t}filter)-(none)`,g(`${t}filter`,r),...e.map(i=>y(`${i[0]=="h"?"-?":""}(${t}${i})(?:$|-)`,i,({1:n,_:s})=>({[`--tw-${n}`]:D(s).map(o=>`${i}(${o})`).join(" "),...r})))]}function yn({1:t,_:e}){return{["--tw-"+t]:e,...bn()}}function bn(){return{...Se({"--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":Jo()}),transform:"var(--tw-transform)"}}function Jo(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 Vo({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function Ho({1:t}){return`repeat(${t},minmax(0,1fr))`}function Se(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var Xo=[["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)||ue(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:i="",6:n=e},{e:s,h:o,v:a})=>{let l=ot(i)||(r[0]=="["?r:a(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(t+n))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||ue(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)||ue(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=ue(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&ot(t).replace(/[}]+$/,"").split("{")]];function Yo({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:Bo,theme:{...Lt,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:Xo,rules:Go,finalize(r){return r.n&&r.d&&r.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(r.d)?{...r,d:"content:var(--tw-content);"+r.d}:r}}}var Nc={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},zc={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Wc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Vc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Hc={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Gc={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Jc={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Xc={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Yc={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Kc={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Qc={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Zc={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},eu={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},tu={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},ru={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},iu={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},nu={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},su={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},ou={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},au={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},lu={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},cu={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Ko={__proto__:null,slate:Nc,gray:zc,zinc:Wc,neutral:Vc,stone:Hc,red:Gc,orange:Jc,amber:Xc,yellow:Yc,lime:Kc,green:Qc,emerald:Zc,teal:eu,cyan:tu,sky:ru,blue:iu,indigo:nu,violet:su,purple:ou,fuchsia:au,pink:lu,rose:cu};function Qo({disablePreflight:t}={}){return Yo({colors:Ko,disablePreflight:t})}function ta({className:t="prose",defaultColor:e="gray",extend:r={},colors:i={}}={}){return i={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",...i,dark:i.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",...i.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}`,(a,l)=>ra(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 a=ea(o.theme("fontSize",s));return a&&{"@layer components":a}}],[t+"-",({$$:s},o)=>n(s,o)],[t,(s,o)=>({...n(e,o),"@layer base":[Zo(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"}}),Zo(t,o,r)],"@layer components":{...ea(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,o){let a={},l={},c=(d,p,h)=>{let m=o.theme(`colors.${s}.${p}`,p);h["--tw-prose-"+d]=te(m);let f=h!=l&&o.d("colors",`${s}-${p}`,m);f&&(l["--tw-prose-"+d]=te(f))};for(let d in i){let p=i[d];d!="dark"&&p&&c(d,p,a)}for(let d in i.dark||{}){let p=i.dark[d];p&&(i.dark?c("invert-"+d,p,a):c(d,p,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function Zo(t,e,r){let i={};for(let n in r)i[ra(t,n,e,s=>`.${e.e(e.h(t))}${s}`)]=r[n];return i}function ra(t,e,{e:r,h:i},n){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",a=s,l="")=>n(`${o}:where(${a}):not(:where(.${r(i("not-"+t))} *))${l}`))}function ea(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 vn=gn({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:[Qo(),jo(),qo(),ta()]});function ia(t,e=!0){let r=(function(){if(uu)try{let l=Or(new CSSStyleSheet);return l.connect=c=>{let d=wn(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,l.target]},l.disconnect=Dr,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Or(s)],a=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,d){o[0].insert(l,c,d);let p=this.target.cssRules[c];o.forEach((h,m)=>m&&h.target.insertRule(p.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");wn(l).appendChild(c);let d=Or(c),{cssRules:p}=this.target;for(let h=0;h<p.length;h++)d.target.insertRule(p[h].cssText,h);o.push(d),a.set(l,d)},disconnect(l){let c=o.indexOf(a.get(l));c>=0&&o.splice(c,1)}}})(),i=Oo({...t,hash:t.hash??e},r),n=Po(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),n.observe(wn(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var uu=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function wn(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var w=t=>ia(vn)(t);var xn=class extends w(v){static properties={color:{type:String},radius:{type:String},size:{type:String},border:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
129
149
  :host {
130
150
  display: block;
131
151
  }
@@ -165,7 +185,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
165
185
  <slot></slot>
166
186
  </div>
167
187
  </div>
168
- `}};customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",fn);var mn=class extends w(v){static properties={state:{type:String},color:{type:String},bubbleStyle:{type:String},src:{type:String},width:{type:String},height:{type:String}};static styles=O`
188
+ `}};customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",xn);var kn=class extends w(v){static properties={state:{type:String},color:{type:String},bubbleStyle:{type:String},src:{type:String},width:{type:String},height:{type:String}};static styles=O`
169
189
  .shadow-button {
170
190
  box-shadow:
171
191
  -58.9194px 74.8436px 38.218px rgba(0, 0, 0, 0.01),
@@ -228,7 +248,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
228
248
  </button>
229
249
  </mw-spinning-border>
230
250
  </div>
231
- `};customElements.get("mw-bubble")||customElements.define("mw-bubble",mn);var Tr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Dr=t=>(...e)=>({_$litDirective$:t,values:e}),ot=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var{I:su}=Ds,Yo=t=>t;var Qo=()=>document.createComment(""),at=(t,e,r)=>{let i=t._$AA.parentNode,n=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=i.insertBefore(Qo(),n),o=i.insertBefore(Qo(),n);r=new su(s,o,t,t.options)}else{let s=r._$AB.nextSibling,o=r._$AM,a=o!==t;if(a){let l;r._$AQ?.(t),r._$AM=t,r._$AP!==void 0&&(l=t._$AU)!==o._$AU&&r._$AP(l)}if(s!==n||a){let l=r._$AA;for(;l!==s;){let c=Yo(l).nextSibling;Yo(i).insertBefore(l,n),l=c}}}return r},$e=(t,e,r=t)=>(t._$AI(e,r),t),ou={},Zo=(t,e=ou)=>t._$AH=e,ea=t=>t._$AH,Mr=t=>{t._$AR(),t._$AA.remove()};var ta=(t,e,r)=>{let i=new Map;for(let n=e;n<=r;n++)i.set(t[n],n);return i},X=Dr(class extends ot{constructor(t){if(super(t),t.type!==Tr.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,r){let i;r===void 0?r=e:e!==void 0&&(i=e);let n=[],s=[],o=0;for(let a of t)n[o]=i?i(a,o):o,s[o]=r(a,o),o++;return{values:s,keys:n}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,i]){let n=ea(t),{values:s,keys:o}=this.dt(e,r,i);if(!Array.isArray(n))return this.ut=o,s;let a=this.ut??=[],l=[],c,d,p=0,h=n.length-1,y=0,f=s.length-1;for(;p<=h&&y<=f;)if(n[p]===null)p++;else if(n[h]===null)h--;else if(a[p]===o[y])l[y]=$e(n[p],s[y]),p++,y++;else if(a[h]===o[f])l[f]=$e(n[h],s[f]),h--,f--;else if(a[p]===o[f])l[f]=$e(n[p],s[f]),at(t,l[f+1],n[p]),p++,f--;else if(a[h]===o[y])l[y]=$e(n[h],s[y]),at(t,n[p],n[h]),h--,y++;else if(c===void 0&&(c=ta(o,y,f),d=ta(a,p,h)),c.has(a[p]))if(c.has(a[h])){let $=d.get(o[y]),x=$!==void 0?n[$]:null;if(x===null){let E=at(t,n[p]);$e(E,s[y]),l[y]=E}else l[y]=$e(x,s[y]),at(t,n[p],x),n[$]=null;y++}else Mr(n[h]),h--;else Mr(n[p]),p++;for(;y<=f;){let $=at(t,l[f+1]);$e($,s[y]),l[y++]=$}for(;p<=h;){let $=n[p++];$!==null&&Mr($)}return this.ut=o,Zo(t,l),ne}});var Ut=class t extends w(v){static properties={examples:{type:Object},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.examples={title:"",items:[]},this.color="",this.darkMode=!1}render(){return!this.examples?.title&&!this.examples?.items?.length?null:u`
251
+ `};customElements.get("mw-bubble")||customElements.define("mw-bubble",kn);var Rr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ur=t=>(...e)=>({_$litDirective$:t,values:e}),lt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var{I:du}=js,na=t=>t;var sa=()=>document.createComment(""),ct=(t,e,r)=>{let i=t._$AA.parentNode,n=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=i.insertBefore(sa(),n),o=i.insertBefore(sa(),n);r=new du(s,o,t,t.options)}else{let s=r._$AB.nextSibling,o=r._$AM,a=o!==t;if(a){let l;r._$AQ?.(t),r._$AM=t,r._$AP!==void 0&&(l=t._$AU)!==o._$AU&&r._$AP(l)}if(s!==n||a){let l=r._$AA;for(;l!==s;){let c=na(l).nextSibling;na(i).insertBefore(l,n),l=c}}}return r},$e=(t,e,r=t)=>(t._$AI(e,r),t),pu={},oa=(t,e=pu)=>t._$AH=e,aa=t=>t._$AH,Lr=t=>{t._$AR(),t._$AA.remove()};var la=(t,e,r)=>{let i=new Map;for(let n=e;n<=r;n++)i.set(t[n],n);return i},X=Ur(class extends lt{constructor(t){if(super(t),t.type!==Rr.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,r){let i;r===void 0?r=e:e!==void 0&&(i=e);let n=[],s=[],o=0;for(let a of t)n[o]=i?i(a,o):o,s[o]=r(a,o),o++;return{values:s,keys:n}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,i]){let n=aa(t),{values:s,keys:o}=this.dt(e,r,i);if(!Array.isArray(n))return this.ut=o,s;let a=this.ut??=[],l=[],c,d,p=0,h=n.length-1,m=0,f=s.length-1;for(;p<=h&&m<=f;)if(n[p]===null)p++;else if(n[h]===null)h--;else if(a[p]===o[m])l[m]=$e(n[p],s[m]),p++,m++;else if(a[h]===o[f])l[f]=$e(n[h],s[f]),h--,f--;else if(a[p]===o[f])l[f]=$e(n[p],s[f]),ct(t,l[f+1],n[p]),p++,f--;else if(a[h]===o[m])l[m]=$e(n[h],s[m]),ct(t,n[p],n[h]),h--,m++;else if(c===void 0&&(c=la(o,m,f),d=la(a,p,h)),c.has(a[p]))if(c.has(a[h])){let E=d.get(o[m]),x=E!==void 0?n[E]:null;if(x===null){let S=ct(t,n[p]);$e(S,s[m]),l[m]=S}else l[m]=$e(x,s[m]),ct(t,n[p],x),n[E]=null;m++}else Lr(n[h]),h--;else Lr(n[p]),p++;for(;m<=f;){let E=ct(t,l[f+1]);$e(E,s[m]),l[m++]=E}for(;p<=h;){let E=n[p++];E!==null&&Lr(E)}return this.ut=o,oa(t,l),se}});var jt=class t extends w(v){static properties={examples:{type:Object},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.examples={title:"",items:[]},this.color="",this.darkMode=!1}render(){return!this.examples?.title&&!this.examples?.items?.length?null:u`
232
252
  <div class="${this.darkMode?"dark":""} flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pt-6 pb-2">
233
253
  ${this.examples.title?u`
234
254
  <h2 class="mt-14 px-2 pt-9 pb-2 text-left text-3xl leading-tight font-bold tracking-tight text-black dark:text-white">
@@ -247,7 +267,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
247
267
  </ul>
248
268
  `:null}
249
269
  </div>
250
- `}#e(e){this.dispatchEvent(new t.ExampleClickEvent({example:e}))}};Ut.ExampleClickEvent=class extends CustomEvent{static type="mw:example-click";constructor(e,r={}){super(Ut.ExampleClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-background")||customElements.define("mw-chat-background",Ut);var ye=class t extends w(v){static properties={content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"},showExpand:{type:Boolean,attribute:"show-expand"},expanded:{type:Boolean},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
270
+ `}#e(e){this.dispatchEvent(new t.ExampleClickEvent({example:e}))}};jt.ExampleClickEvent=class extends CustomEvent{static type="mw:example-click";constructor(e,r={}){super(jt.ExampleClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-background")||customElements.define("mw-chat-background",jt);var be=class t extends w(v){static properties={content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"},showExpand:{type:Boolean,attribute:"show-expand"},expanded:{type:Boolean},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
251
271
  /* blurred background */
252
272
 
253
273
  [part='gradient-blur'] {
@@ -288,7 +308,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
288
308
 
289
309
  <!-- expand/collapse btn (desktop only, hidden on mobile) -->
290
310
  <button @click=${this.#t} type="button" class="${this.showExpand?"hidden sm:inline-flex":"hidden"} shrink-0 transition-all duration-150 hover:scale-110 active:scale-95">
291
- <lucide-icon class="h-5 w-5 text-white dark:text-black" name="${this.expanded?"minimize-2":"maximize-2"}"></lucide-icon>
311
+ <mw-icon class="h-5 w-5 text-white dark:text-black" name="${this.expanded?"lucide:minimize-2":"lucide:maximize-2"}"></mw-icon>
292
312
  </button>
293
313
 
294
314
  <!-- new chat btn -->
@@ -309,26 +329,55 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
309
329
  </div>
310
330
  </div>
311
331
  </div>
312
- `}#e(){this.dispatchEvent(new t.NewChatClickEvent)}#t(){this.dispatchEvent(new t.ExpandClickEvent)}#r(){this.dispatchEvent(new t.CloseClickEvent)}};ye.NewChatClickEvent=class extends CustomEvent{static type="mw:new-chat-click";constructor(e={}){super(ye.NewChatClickEvent.type,{...e})}};ye.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(ye.ExpandClickEvent.type,{...e})}};ye.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(ye.CloseClickEvent.type,{...e})}};customElements.get("mw-chat-header")||customElements.define("mw-chat-header",ye);async function ra(t,e,r){let i=e.map((c,d)=>({index:d,item:c})),n=async c=>{let d=[];for(;;){let p=i.pop();if(!p)return c(d);try{let h=await r(p.item);d.push({error:null,result:h,index:p.index})}catch(h){d.push({error:h,result:void 0,index:p.index})}}},s=Array.from({length:t},()=>new Promise(n)),a=(await Promise.all(s)).flat().sort((c,d)=>c.index-d.index),l=a.filter(c=>c.error);if(l.length>0)throw new AggregateError(l.map(c=>c.error));return a.map(c=>c.result)}var aa=pi(oa(),1);var vn=(t,e)=>{let r=t.reduce((i,n)=>{let s=e?e(n):n;return i[s]||(i[s]=n),i},{});return Object.values(r)};var wn=({interval:t},e)=>{let r=!0,i,n=(...s)=>{r&&(e(...s),r=!1,i=setTimeout(()=>{r=!0,i=void 0},t))};return n.isThrottled=()=>i!==void 0,n};var de=Object.freeze({pending_upload:"pending_upload",uploaded:"uploaded",errored:"errored"}),Ur=class{#e;#t;#r=!1;#n=!1;#i=null;#s=null;#o=null;#a=[];constructor(e,{acceptedTypes:r,maxFileSize:i,maxFileCount:n,canAcceptFiles:s,onFilesAdded:o,onFileDelete:a,onFileUpload:l,onError:c}){this.#e=e,this.#t={acceptedTypes:r,maxFileSize:i,maxFileCount:n,canAcceptFiles:s,onFilesAdded:o,onFileDelete:a,onFileUpload:l,onError:c},e.addController(this)}hostConnected(){this.#p()}hostDisconnected(){this.#c(),this.#u(),this.#o&&(clearTimeout(this.#o),this.#o=null),this.#i&&this.#i.parentNode&&this.#i.parentNode.removeChild(this.#i),this.#i=null}#l(){this.#c(),this.#e.addEventListener("dragover",this.#f),this.#e.addEventListener("dragenter",this.#g),this.#e.addEventListener("dragleave",this.#m),this.#e.addEventListener("drop",this.#_)}#c(){this.#e.removeEventListener("dragover",this.#f),this.#e.removeEventListener("dragenter",this.#g),this.#e.removeEventListener("dragleave",this.#m),this.#e.removeEventListener("drop",this.#_)}#d(){this.#u(),this.#e.addEventListener("paste",this.#w)}#u(){this.#e.removeEventListener("paste",this.#w)}#p(){this.#i||(this.#i=document.createElement("input"),this.#i.type="file",this.#i.accept=this.#t.acceptedTypes?.join(",")??"",this.#i.multiple=this.#t.maxFileCount>1,this.#i.style.display="none",this.#i.addEventListener("change",this.#v),document.body.appendChild(this.#i))}#v=e=>{if(e.target instanceof HTMLInputElement){let r=e.target,i=Array.from(r.files||[]);this.#h(i),r.value=""}};#f=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")};#g=e=>{e.preventDefault(),e.dataTransfer&&this.#C(e.dataTransfer)&&this.#x(!0)};#m=e=>{if(e.preventDefault(),e.relatedTarget instanceof Node){let r=e.relatedTarget;this.#e.contains(r)||this.#x(!1)}};#_=e=>{if(e.preventDefault(),this.#x(!1),e.dataTransfer){let r=Array.from(e.dataTransfer.files||[]);this.#h(r)}};#w=e=>{if(!e.clipboardData)return;let i=Array.from(e.clipboardData.items||[]).filter(s=>s.kind==="file");if(i.length===0)return;e.preventDefault();let n=i.map(s=>s.getAsFile()).flatMap(s=>s?[s]:[]);this.#h(n)};#C(e){return e.types&&e.types.includes("Files")}#x(e){this.#n!==e&&(this.#n=e,this.#e.requestUpdate())}#y(e){this.#s=e,this.#t.onError?.(e),this.#e.requestUpdate(),this.#o&&clearTimeout(this.#o),this.#o=setTimeout(()=>{this.#b()},6e3)}#b(){this.#o&&(clearTimeout(this.#o),this.#o=null),this.#s=null,this.#e.requestUpdate()}async#h(e){if(e.length===0||this.#t.canAcceptFiles?.()===!1)return;this.#t.onFilesAdded?.(),this.#b();let r=e.filter(o=>this.#$(o));if(r.length===0)return;let i=this.#a.length,n=this.#t.maxFileCount??1/0,s=r.length;if(i+s>n){this.#y(`You can upload a maximum of ${n} files`);return}try{let o=await Promise.all(r.map(l=>this.#S(l))),a=vn(o,l=>l.dataUrl);this.#a=[...this.#a,...a],this.#e.requestUpdate(),await ra(3,a,l=>cr({times:5,backoff:c=>c*3e3},()=>this.#E(l))),this.#e.requestUpdate()}catch(o){console.error("Failed to process and upload files:",o),this.#y("Upload failed")}}#$(e){return this.#t.acceptedTypes&&!this.#t.acceptedTypes.includes(e.type)?(this.#y("Invalid file type"),!1):e.size>this.#t.maxFileSize?(this.#y(`Max file size: ${this.#t.maxFileSize/(1024*1024)}MB`),!1):!0}async#S(e){try{let r=await(0,aa.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:r,file:e,processingState:de.pending_upload}}catch(r){let i=r instanceof Error?r:new Error(String(r));throw new Error(`Failed to read file: ${e.name} - ${i.message}`)}}async#E(e){if(!e){console.error("No file provided to upload"),this.#y("No file provided");return}e.processingState=de.pending_upload,this.#e.requestUpdate();try{let r=await this.#t.onFileUpload(e);e.publicUrl=r.publicUrl,e.processingState=de.uploaded,this.#e.requestUpdate()}catch(r){console.error("Upload error:",r);let i=r instanceof Error?r:new Error(String(r));this.#y(i.message),e.processingState=de.errored,this.#e.requestUpdate()}}get isDragging(){return this.#n}get error(){return this.#s}get selectedFiles(){return this.#a}get hasPendingFiles(){return this.#a.some(e=>e.processingState===de.pending_upload)}openFilePicker=()=>{if(!this.#r){console.warn("File uploads are disabled");return}this.#i&&this.#i.click()};clearError(){this.#b()}clearFiles(){this.#a=[],this.clearError(),this.#e.requestUpdate()}setEnabled(e){this.#r!==e&&(this.#r=e,this.#r?(this.#l(),this.#d()):(this.#c(),this.#u()))}restoreFiles(e){this.#a=e,this.#e.requestUpdate()}deleteFile=e=>{this.#t.onFileDelete?.(e),this.#a=this.#a.filter(r=>r.id!==e),this.#b(),this.#e.requestUpdate()}};var Lr={maxHeight:120,initialHeight:32,paddingY:12},ee=class t extends w(v){static properties={disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String},color:{type:String},enableFileUpload:{type:Boolean},darkMode:{type:Boolean,attribute:"dark-mode"},files:{type:Array}};#e=new Date;constructor(){super(),this.disabled=!1,this.streaming=!1,this.loading=!1,this.placeholder="Type a message...",this.color="#8B5CF6",this.enableFileUpload=!1,this.darkMode=!1,this.files=[]}get value(){return this.#t?.value?.trim()??""}render(){let e=this.streaming||this.loading||!this.value&&(!this.enableFileUpload||this.files.length===0);return u`
332
+ `}#e(){this.dispatchEvent(new t.NewChatClickEvent)}#t(){this.dispatchEvent(new t.ExpandClickEvent)}#r(){this.dispatchEvent(new t.CloseClickEvent)}};be.NewChatClickEvent=class extends CustomEvent{static type="mw:new-chat-click";constructor(e={}){super(be.NewChatClickEvent.type,{...e})}};be.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(be.ExpandClickEvent.type,{...e})}};be.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(be.CloseClickEvent.type,{...e})}};customElements.get("mw-chat-header")||customElements.define("mw-chat-header",be);var Ft=class{#e;#t;constructor(e,r){this.#t=r,e.addController(this)}request(){this.cancel(),this.#e=requestAnimationFrame(this.#t)}cancel(){this.#e!==void 0&&(cancelAnimationFrame(this.#e),this.#e=void 0)}get pending(){return this.#e!==void 0}hostDisconnected(){this.cancel()}};function ca(t,e){return new Ft(t,e)}var jr=2,hu=2,fu=1.5,mu=30,gu=1e3/mu,Be=class t extends w(v){static properties={color:{type:String},isTranscribing:{type:Boolean,attribute:"is-transcribing"},voiceController:{attribute:!1},_timerText:{type:String,state:!0}};#e=0;#t=[];#r=0;#i=null;#n=e=>{if(this.#s.request(),e-this.#e<gu)return;this.#e=e;let r=this.voiceController?.frequencyBinCount??0;r>0&&(!this.#i||this.#i.length!==r)&&(this.#i=new Uint8Array(r));let i=this.#i,n=r>0&&i!==null&&this.voiceController?.getFrequencyData(i)===!0,s=this.voiceController?.getElapsedMs()??0,o=Math.floor(s/1e3),a=Math.floor(o/60),l=o%60;this._timerText=`${a}:${String(l).padStart(2,"0")}`,this.#l(n?this.#i:null)};#s=new Ft(this,this.#n);constructor(){super(),this.color="#8B5CF6",this.isTranscribing=!1,this.voiceController=null,this._timerText="0:00"}render(){return u`
333
+ <div class="flex w-full items-center gap-2 px-3 py-3">
334
+ <!-- cancel button -->
335
+ <button
336
+ type="button"
337
+ aria-label="Cancel recording"
338
+ @click="${this.#c}"
339
+ ?disabled="${this.isTranscribing}"
340
+ class="flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-gray-200 transition-colors hover:bg-gray-300 disabled:opacity-50 dark:bg-gray-700 dark:hover:bg-gray-600">
341
+ <mw-icon name="lucide:x" class="h-4 w-4 text-gray-600 dark:text-gray-300"></mw-icon>
342
+ </button>
343
+
344
+ <!-- waveform canvas + timer -->
345
+ <div class="flex flex-1 items-center gap-2 overflow-hidden">
346
+ <canvas class="h-8 flex-1"></canvas>
347
+ <span class="w-8 shrink-0 text-xs text-gray-500 tabular-nums dark:text-gray-400">${this._timerText}</span>
348
+ </div>
349
+
350
+ <!-- approve button (or spinner when transcribing) -->
351
+ <button
352
+ type="button"
353
+ aria-label="${this.isTranscribing?"Transcribing":"Stop and transcribe"}"
354
+ @click="${this.#u}"
355
+ ?disabled="${this.isTranscribing}"
356
+ class="flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition-opacity disabled:opacity-70"
357
+ style="background-color: ${this.color}">
358
+ ${this.isTranscribing?u`<mw-icon name="lucide:loader-circle" class="h-4 w-4 animate-spin text-white dark:text-gray-800"></mw-icon>`:u`<mw-icon name="lucide:check" class="h-4 w-4 text-white dark:text-gray-800"></mw-icon>`}
359
+ </button>
360
+ </div>
361
+ `}connectedCallback(){super.connectedCallback(),this.isTranscribing||this.#a()}updated(e){e.has("isTranscribing")&&(this.isTranscribing?(this.#o(),this.#l(null)):this.#a())}#a(){this.#e=0,this.#s.request()}#o(){this.#s.cancel()}#l(e){let r=this.renderRoot.querySelector("canvas");if(!r)return;let i=r.getContext("2d");if(!i)return;let n=r.getBoundingClientRect(),s=window.devicePixelRatio||1;(r.width!==n.width*s||r.height!==n.height*s)&&(r.width=n.width*s,r.height=n.height*s,i.scale(s,s));let o=n.width,a=n.height,l=3;this.#r=Math.floor((o+jr)/(l+jr));let c=0;if(e&&e.length>0){let h=0;for(let m=0;m<e.length;m++){let f=e[m]/255;h+=f*f}c=Math.min(Math.pow(Math.sqrt(h/e.length)*2.5,1.4),1)}this.#t.push(c),this.#t.length>this.#r&&this.#t.splice(0,this.#t.length-this.#r),i.clearRect(0,0,o,a);let d=a-4,p=this.#t.length;for(let h=0;h<p;h++){let m=this.#t[h],f=Math.max(m*d,hu),E=o-(p-h)*(l+jr)+jr,x=(a-f)/2;i.fillStyle=this.isTranscribing?"#9CA3AF":this.color,i.globalAlpha=this.isTranscribing?.4:.6,i.beginPath(),i.roundRect(E,x,l,f,fu),i.fill()}i.globalAlpha=1}#c(){this.dispatchEvent(new t.CancelEvent)}#u(){this.isTranscribing||this.dispatchEvent(new t.ApproveEvent)}};Be.CancelEvent=class extends CustomEvent{static type="mw-voice-waveform-bar:cancel";constructor(e={}){super(Be.CancelEvent.type,{bubbles:!0,composed:!0,...e})}};Be.ApproveEvent=class extends CustomEvent{static type="mw-voice-waveform-bar:approve";constructor(e={}){super(Be.ApproveEvent.type,{bubbles:!0,composed:!0,...e})}};customElements.get("mw-voice-waveform-bar")||customElements.define("mw-voice-waveform-bar",Be);function ua(t){let e=new FormData;for(let[r,i]of Object.entries(t))i!=null&&(i instanceof Blob?e.append(r,i):e.append(r,String(i)));return e}function yu(t){if(!t||typeof t!="string")return{mimeType:"",parameters:{}};let e=t.split(";"),r=e[0].trim().toLowerCase(),i={};for(let n=1;n<e.length;n++){let s=e[n].trim(),o=s.indexOf("=");if(o>0){let a=s.substring(0,o).trim().toLowerCase(),l=s.substring(o+1).trim();(l.startsWith('"')&&l.endsWith('"')||l.startsWith("'")&&l.endsWith("'"))&&(l=l.slice(1,-1)),i[a]=l}}return{mimeType:r,parameters:i}}function da(t){if(!t)return!1;for(let e of t.split(",")){let{mimeType:r}=yu(e);if(r==="text/html"||r==="application/xhtml+xml")return!0}return!1}var qt=class extends Error{constructor(e,r,i,n){super(),this.name=this.constructor.name,this.message=e,this.type=r,this.code=i,this.responseBody=n}},_n=class{#e;#t;constructor(e,r,{fetch:i,headers:n}={}){this.baseUrl=e,this.path=r,this.#e=i,this.#t=n}GET({query:e,params:r,headers:i,signal:n}={}){return this.#i(this.#r(this.path,r),"GET",{query:e,headers:i,signal:n})}POST({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#i(this.#r(this.path,r),"POST",{query:e,body:i,formData:n,headers:s,signal:o})}PUT({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#i(this.#r(this.path,r),"PUT",{query:e,body:i,formData:n,headers:s,signal:o})}PATCH({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#i(this.#r(this.path,r),"PATCH",{query:e,body:i,formData:n,headers:s,signal:o})}DELETE({query:e,params:r,headers:i,signal:n}={}){return this.#i(this.#r(this.path,r),"DELETE",{query:e,headers:i,signal:n})}#r(e,r){if(!r)return e;let i=e;for(let[n,s]of Object.entries(r))i=i.replace(`:${n}`,encodeURIComponent(s.toString()));return i}async#i(e,r,{query:i,body:n,formData:s,headers:o,signal:a}){let l=new URL(e,this.baseUrl);i&&(l.search=eo(i).toString());let c=new Headers(this.#t);if(o)for(let[p,h]of new Headers(o))c.set(p,h);s||n instanceof URLSearchParams||n instanceof FormData||n instanceof Blob||n instanceof ArrayBuffer||n instanceof ReadableStream||c.set("Content-Type","application/json");let d=await(this.#e??fetch)(l,{method:r,headers:c,body:c.get("Content-Type")==="application/json"?JSON.stringify(n):(s?ua(s):null)||n,signal:a});if(!d.ok){let p="";try{p=await d.text().then(h=>h.substring(0,1e3))}catch(h){p=h?.toString()??""}throw da(d.headers.get("Content-Type"))?new qt(`Received HTML instead of JSON (HTTP ${d.status})`,"HTTP",d.status,p):new qt(p,"HTTP",d.status)}if(d.status!==204){if(d.headers.get("Content-Type")?.startsWith("application/json"))return d.json();throw new qt("Response content type is not JSON and we do not handle others yet","HTTP",d.status)}}};function Fr(t,{fetch:e,headers:r}={}){let i={baseUrl:t};return new Proxy(i,{get(s,o){if(typeof o!="string"||!o.startsWith("/"))return;let a=o;return new _n(s.baseUrl,a,{fetch:e,headers:r})}})}async function pa(t,e,r){let i=e.map((c,d)=>({index:d,item:c})),n=async c=>{let d=[];for(;;){let p=i.pop();if(!p)return c(d);try{let h=await r(p.item);d.push({error:null,result:h,index:p.index})}catch(h){d.push({error:h,result:void 0,index:p.index})}}},s=Array.from({length:t},()=>new Promise(n)),a=(await Promise.all(s)).flat().sort((c,d)=>c.index-d.index),l=a.filter(c=>c.error);if(l.length>0)throw new AggregateError(l.map(c=>c.error));return a.map(c=>c.result)}var ya=vi(ga(),1);var $n=(t,e)=>{let r=t.reduce((i,n)=>{let s=e?e(n):n;return i[s]||(i[s]=n),i},{});return Object.values(r)};var In=({interval:t},e)=>{let r=!0,i,n=(...s)=>{r&&(e(...s),r=!1,i=setTimeout(()=>{r=!0,i=void 0},t))};return n.isThrottled=()=>i!==void 0,n};var pe=Object.freeze({pending_upload:"pending_upload",uploaded:"uploaded",errored:"errored"}),Nr=class{#e;#t;#r=!1;#i=!1;#n=null;#s=null;#a=null;#o=[];constructor(e,{acceptedTypes:r,maxFileSize:i,maxFileCount:n,canAcceptFiles:s,onFilesAdded:o,onFileDelete:a,onFileUpload:l,onError:c}){this.#e=e,this.#t={acceptedTypes:r,maxFileSize:i,maxFileCount:n,canAcceptFiles:s,onFilesAdded:o,onFileDelete:a,onFileUpload:l,onError:c},e.addController(this)}hostConnected(){this.#p()}hostDisconnected(){this.#c(),this.#d(),this.#a&&(clearTimeout(this.#a),this.#a=null),this.#n&&this.#n.parentNode&&this.#n.parentNode.removeChild(this.#n),this.#n=null}#l(){this.#c(),this.#e.addEventListener("dragover",this.#h),this.#e.addEventListener("dragenter",this.#m),this.#e.addEventListener("dragleave",this.#f),this.#e.addEventListener("drop",this.#k)}#c(){this.#e.removeEventListener("dragover",this.#h),this.#e.removeEventListener("dragenter",this.#m),this.#e.removeEventListener("dragleave",this.#f),this.#e.removeEventListener("drop",this.#k)}#u(){this.#d(),this.#e.addEventListener("paste",this.#_)}#d(){this.#e.removeEventListener("paste",this.#_)}#p(){this.#n||(this.#n=document.createElement("input"),this.#n.type="file",this.#n.accept=this.#t.acceptedTypes?.join(",")??"",this.#n.multiple=this.#t.maxFileCount>1,this.#n.style.display="none",this.#n.addEventListener("change",this.#w),document.body.appendChild(this.#n))}#w=e=>{if(e.target instanceof HTMLInputElement){let r=e.target,i=Array.from(r.files||[]);this.#v(i),r.value=""}};#h=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")};#m=e=>{e.preventDefault(),e.dataTransfer&&this.#E(e.dataTransfer)&&this.#x(!0)};#f=e=>{if(e.preventDefault(),e.relatedTarget instanceof Node){let r=e.relatedTarget;this.#e.contains(r)||this.#x(!1)}};#k=e=>{if(e.preventDefault(),this.#x(!1),e.dataTransfer){let r=Array.from(e.dataTransfer.files||[]);this.#v(r)}};#_=e=>{if(!e.clipboardData)return;let i=Array.from(e.clipboardData.items||[]).filter(s=>s.kind==="file");if(i.length===0)return;e.preventDefault();let n=i.map(s=>s.getAsFile()).flatMap(s=>s?[s]:[]);this.#v(n)};#E(e){return e.types&&e.types.includes("Files")}#x(e){this.#i!==e&&(this.#i=e,this.#e.requestUpdate())}#g(e){this.#s=e,this.#t.onError?.(e),this.#e.requestUpdate(),this.#a&&clearTimeout(this.#a),this.#a=setTimeout(()=>{this.#y()},6e3)}#y(){this.#a&&(clearTimeout(this.#a),this.#a=null),this.#s=null,this.#e.requestUpdate()}async#v(e){if(e.length===0||this.#t.canAcceptFiles?.()===!1)return;this.#t.onFilesAdded?.(),this.#y();let r=e.filter(o=>this.#S(o));if(r.length===0)return;let i=this.#o.length,n=this.#t.maxFileCount??1/0,s=r.length;if(i+s>n){this.#g(`You can upload a maximum of ${n} files`);return}try{let o=await Promise.all(r.map(l=>this.#$(l))),a=$n(o,l=>l.dataUrl);this.#o=[...this.#o,...a],this.#e.requestUpdate(),await pa(3,a,l=>fr({times:5,backoff:c=>c*3e3},()=>this.#I(l))),this.#e.requestUpdate()}catch(o){console.error("Failed to process and upload files:",o),this.#g("Upload failed")}}#S(e){return this.#t.acceptedTypes&&!this.#t.acceptedTypes.includes(e.type)?(this.#g("Invalid file type"),!1):e.size>this.#t.maxFileSize?(this.#g(`Max file size: ${this.#t.maxFileSize/(1024*1024)}MB`),!1):!0}async#$(e){try{let r=await(0,ya.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:r,file:e,processingState:pe.pending_upload}}catch(r){let i=r instanceof Error?r:new Error(String(r));throw new Error(`Failed to read file: ${e.name} - ${i.message}`)}}async#I(e){if(!e){console.error("No file provided to upload"),this.#g("No file provided");return}e.processingState=pe.pending_upload,this.#e.requestUpdate();try{let r=await this.#t.onFileUpload(e);e.publicUrl=r.publicUrl,e.processingState=pe.uploaded,this.#e.requestUpdate()}catch(r){console.error("Upload error:",r),this.#g("Upload failed"),e.processingState=pe.errored,this.#e.requestUpdate()}}get isDragging(){return this.#i}get error(){return this.#s}get selectedFiles(){return this.#o}get hasPendingFiles(){return this.#o.some(e=>e.processingState===pe.pending_upload)}openFilePicker=()=>{if(!this.#r){console.warn("File uploads are disabled");return}this.#n&&this.#n.click()};clearError(){this.#y()}clearFiles(){this.#o=[],this.clearError(),this.#e.requestUpdate()}setEnabled(e){this.#r!==e&&(this.#r=e,this.#r?(this.#l(),this.#u()):(this.#c(),this.#d()))}restoreFiles(e){this.#o=e,this.#e.requestUpdate()}deleteFile=e=>{this.#t.onFileDelete?.(e),this.#o=this.#o.filter(r=>r.id!==e),this.#y(),this.#e.requestUpdate()}};var zr=class{#e;#t=null;#r=null;#i=null;#n=null;#s=[];#a=0;#o="";isSupported=typeof navigator<"u"&&!!navigator.mediaDevices?.getUserMedia&&typeof MediaRecorder<"u";isRecording=!1;constructor(e){this.#e=e,e.addController(this)}async start(){if(this.isRecording)return;this.#t=await navigator.mediaDevices.getUserMedia({audio:!0}),this.#i=new AudioContext;let e=this.#i.createMediaStreamSource(this.#t);this.#n=this.#i.createAnalyser(),this.#n.fftSize=256,e.connect(this.#n),this.#o=Du(),this.#s=[],this.#r=new MediaRecorder(this.#t,{mimeType:this.#o}),this.#r.ondataavailable=r=>{r.data.size>0&&this.#s.push(r.data)},this.#r.start(),this.#a=performance.now(),this.isRecording=!0,this.#e.requestUpdate()}async stop(){if(!this.#r||this.#r.state!=="recording")throw new Error("not recording");let e=Math.round(performance.now()-this.#a),r=await new Promise(i=>{if(!this.#r)throw new Error("recorder unexpectedly null");this.#r.onstop=()=>{i(new Blob(this.#s,{type:this.#o}))},this.#r.stop()});return this.#l(),{audioBlob:r,durationMs:e,mimeType:this.#o}}cancel(){this.#r&&this.#r.state==="recording"&&this.#r.stop(),this.#l()}get frequencyBinCount(){return this.#n?.frequencyBinCount??0}getFrequencyData(e){return this.#n?(this.#n.getByteFrequencyData(e),!0):!1}getElapsedMs(){return this.isRecording?Math.round(performance.now()-this.#a):0}#l(){if(this.#t){for(let e of this.#t.getTracks())e.stop();this.#t=null}this.#i&&(this.#i.close(),this.#i=null),this.#n=null,this.#r=null,this.#s=[],this.isRecording=!1,this.#e.requestUpdate()}hostDisconnected(){this.cancel()}};function Du(){return MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":MediaRecorder.isTypeSupported("audio/mp4")?"audio/mp4":"audio/webm"}var Ou=500,dt=Object.freeze({PERMISSION_DENIED:"Microphone access denied, check your browser settings",START_FAILED:"Couldn't start recording",TOO_SHORT:"Recording too short",EMPTY_TRANSCRIPTION:"Couldn't catch that, try again",CONNECTION_ERROR:"Connection error, try again",TRANSCRIPTION_FAILED:"Couldn't transcribe, try again"}),ie=class t{#e;#t;#r;isTranscribing=!1;constructor(e,{voiceAPI:r,audioCaptureCtrl:i}){this.#e=e,this.#t=r,this.#r=i??new zr(e),e.addController(this)}get isSupported(){return this.#r.isSupported}get isRecording(){return this.#r.isRecording}async start(){try{await this.#r.start(),this.#e.dispatchEvent(new t.RecordingStartedEvent)}catch(e){let r=e instanceof DOMException&&e.name==="NotAllowedError";this.#e.dispatchEvent(new t.ErrorEvent({message:r?dt.PERMISSION_DENIED:dt.START_FAILED,code:r?"permission_denied":"start_failed"}))}}cancel(){this.#r.cancel(),this.isTranscribing=!1,this.#e.requestUpdate()}async approve(){try{let e=await this.#r.stop();if(this.#e.dispatchEvent(new t.RecordingCompletedEvent({durationMs:e.durationMs})),e.durationMs<Ou){this.#e.dispatchEvent(new t.ErrorEvent({message:dt.TOO_SHORT,code:"too_short"}));return}this.isTranscribing=!0,this.#e.requestUpdate();let r=await this.#i(e.audioBlob,e.mimeType);if(this.isTranscribing=!1,this.#e.requestUpdate(),!r.text){this.#e.dispatchEvent(new t.ErrorEvent({message:dt.EMPTY_TRANSCRIPTION,code:"empty_transcription"}));return}this.#e.dispatchEvent(new t.TranscribedEvent({text:r.text,language:r.language,processingMs:r.processingMs,durationMs:e.durationMs}))}catch(e){this.isTranscribing=!1,this.#e.requestUpdate();let r=e instanceof TypeError;this.#e.dispatchEvent(new t.ErrorEvent({message:r?dt.CONNECTION_ERROR:dt.TRANSCRIPTION_FAILED,code:r?"connection_error":"transcription_failed"}))}}get frequencyBinCount(){return this.#r.frequencyBinCount}getFrequencyData(e){return this.#r.getFrequencyData(e)}getElapsedMs(){return this.#r.getElapsedMs()}async#i(e,r){let i=r.includes("mp4")?"m4a":"webm";return await this.#t["/widgets/voice/transcribe"].POST({formData:{audio:new File([e],`recording.${i}`,{type:e.type}),widgetId:this.#e.widgetId}})}hostDisconnected(){this.#r.cancel(),this.isTranscribing=!1}};ie.RecordingStartedEvent=class extends CustomEvent{static type="mw:voice-recording-started";constructor(e={}){super(ie.RecordingStartedEvent.type,{bubbles:!0,composed:!0,...e})}};ie.RecordingCompletedEvent=class extends CustomEvent{static type="mw:voice-recording-completed";constructor(e,r={}){super(ie.RecordingCompletedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};ie.TranscribedEvent=class extends CustomEvent{static type="mw:voice-transcribed";constructor(e,r={}){super(ie.TranscribedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};ie.ErrorEvent=class extends CustomEvent{static type="mw:voice-error";constructor(e,r={}){super(ie.ErrorEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};var Wr=Object.freeze({maxHeight:120,initialHeight:32,paddingY:12}),ee=class t extends w(v){static properties={disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String},color:{type:String},enableFileUpload:{type:Boolean},darkMode:{type:Boolean,attribute:"dark-mode"},widgetId:{type:String,attribute:"widget-id"},cdnBaseUrl:{type:String,attribute:"cdn-base-url"},files:{type:Array}};#e=new Date;constructor(){super(),this.disabled=!1,this.streaming=!1,this.loading=!1,this.placeholder="Type a message...",this.color="#8B5CF6",this.enableFileUpload=!1,this.darkMode=!1,this.widgetId="",this.cdnBaseUrl="",this.files=[]}#t=null;get voiceEnabled(){return this.#t?.isSupported??!1}get value(){return this.#r?.value?.trim()??""}updated(e){(e.has("widgetId")||e.has("cdnBaseUrl"))&&this.widgetId&&this.cdnBaseUrl&&!this.#t&&(this.#t=new ie(this,{voiceAPI:Fr(this.cdnBaseUrl)}))}render(){let e=this.#t?.isRecording??!1,r=this.#t?.isTranscribing??!1,i=this.streaming||this.loading||!this.value&&(!this.enableFileUpload||this.files.length===0),n=this.voiceEnabled&&!this.value&&!this.streaming&&!this.loading&&!e&&!r;return u`
313
362
  <div
314
363
  class="${this.darkMode?"dark bg-[#1E1F23]":"bg-white"} ${this.enableFileUpload&&this.files.length>0?`ring-2 ring-[${this.color}] ring-opacity-50`:""} focus-within:ring-opacity-50 w-full overflow-hidden rounded-[18px] shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)] transition-all duration-200 focus-within:ring-2 focus-within:ring-[${this.color}]">
315
364
  <!-- File preview area -->
316
365
  ${this.enableFileUpload&&this.files&&this.files.length>0?u`
317
366
  <div class="mb-2 flex flex-wrap gap-2 rounded-t-[18px] p-2">
318
- ${this.files.map(r=>{let i=r.type.startsWith("image/");return u`
367
+ ${this.files.map(s=>{let o=s.type.startsWith("image/");return u`
319
368
  <div class="relative inline-block">
320
- ${i?u`<img src="${r.dataUrl}" alt="${r.name}" class="h-[60px] w-[60px] rounded-xl object-cover" />`:u`
369
+ ${o?u`<img src="${s.dataUrl}" alt="${s.name}" class="h-[60px] w-[60px] rounded-xl object-cover" />`:u`
321
370
  <div class="flex h-[60px] w-[60px] items-center justify-center rounded-xl bg-gray-100 dark:bg-gray-700">
322
371
  <mw-icon name="lucide:file" class="h-6 w-6 text-gray-500 dark:text-gray-300"></mw-icon>
323
372
  </div>
324
373
  `}
325
374
 
326
375
  <!-- Progress/Status overlay -->
327
- ${r.processingState===de.pending_upload?u`
376
+ ${s.processingState===pe.pending_upload?u`
328
377
  <div class="absolute inset-0 flex items-center justify-center rounded-xl bg-black/40">
329
378
  <mw-icon name="lucide:loader-circle" class="inline-flex h-6 w-6 animate-spin text-white transition-all duration-1000"></mw-icon>
330
379
  </div>
331
- `:r.processingState===de.errored?u`
380
+ `:s.processingState===pe.errored?u`
332
381
  <div class="absolute inset-0 flex items-center justify-center rounded-xl bg-red-500/60">
333
382
  <mw-icon name="lucide:badge-alert" class="h-6 w-6 text-white"></mw-icon>
334
383
  </div>
@@ -338,7 +387,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
338
387
  <button
339
388
  data-testid="file-delete-btn"
340
389
  type="button"
341
- @click="${()=>this.#l(r.id)}"
390
+ @click="${()=>this.#p(s.id)}"
342
391
  class="absolute -top-1 -right-1 flex h-5 w-5 items-center justify-center rounded-full bg-[#eeedf1] text-white hover:bg-[#eeedf195] dark:bg-gray-700 dark:hover:bg-gray-600">
343
392
  <mw-icon name="lucide:x" class="h-3 w-3 text-[#14161a] dark:text-gray-200"></mw-icon>
344
393
  </button>
@@ -347,48 +396,82 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
347
396
  </div>
348
397
  `:null}
349
398
 
350
- <!-- Input form -->
351
- <form @submit="${this.#i}" class="flex w-full items-center">
352
- ${this.enableFileUpload?u`
353
- <button
354
- data-testid="file-upload-btn"
355
- type="button"
356
- @click="${this.#a}"
357
- ?disabled="${this.disabled||this.loading}"
358
- class="mx-1 px-2 transition-opacity duration-200 hover:opacity-80">
359
- <mw-icon name="lucide:image-plus" class="block h-6 w-6 text-[#312E30] dark:text-gray-300"></mw-icon>
360
- </button>
361
- `:null}
399
+ <!-- Recording state: waveform bar replaces normal input -->
400
+ ${e||r?u`
401
+ <mw-voice-waveform-bar
402
+ .color="${this.color}"
403
+ .isTranscribing="${r}"
404
+ .voiceController="${this.#t}"
405
+ @mw-voice-waveform-bar:cancel="${this.#c}"
406
+ @mw-voice-waveform-bar:approve="${this.#u}">
407
+ </mw-voice-waveform-bar>
408
+ `:u`
409
+ <!-- Input form -->
410
+ <form @submit="${this.#s}" class="flex w-full items-center">
411
+ ${this.enableFileUpload?u`
412
+ <button
413
+ data-testid="file-upload-btn"
414
+ type="button"
415
+ @click="${this.#d}"
416
+ ?disabled="${this.disabled||this.loading}"
417
+ class="mx-1 px-2 transition-opacity duration-200 hover:opacity-80">
418
+ <mw-icon name="lucide:image-plus" class="block h-6 w-6 text-[#312E30] dark:text-gray-300"></mw-icon>
419
+ </button>
420
+ `:null}
421
+
422
+ <!-- autofocus is supposed to work on pageload, in our case the dialog opens which may not trigger autofocus, but this may work only in case the widget dialog was left open before pageload -->
423
+ <textarea
424
+ data-testid="mw-chat-input-textarea"
425
+ name="input"
426
+ @input="${this.#a}"
427
+ @keydown="${this.#n}"
428
+ autofocus
429
+ ?disabled="${this.disabled}"
430
+ maxlength="1000"
431
+ placeholder="${this.placeholder}"
432
+ class="${this.enableFileUpload?"px-1":"pl-3 pr-1"} box-content h-[${Wr.initialHeight}px] w-full resize-none place-content-center rounded bg-transparent py-[${Wr.paddingY}px] text-base text-gray-800 outline-none placeholder:text-[14px] placeholder:font-light disabled:content-baseline disabled:leading-[${Wr.initialHeight}px] dark:text-gray-200"></textarea>
433
+
434
+ <!-- Mic button: shown when voice is enabled and input is empty -->
435
+ ${n?u`
436
+ <button
437
+ type="button"
438
+ data-testid="mw-chat-input-mic-btn"
439
+ aria-label="Record voice message"
440
+ @click="${this.#l}"
441
+ ?disabled="${this.disabled}"
442
+ class="mx-1 rounded-full px-2 transition-all duration-150 ease-out disabled:cursor-not-allowed disabled:opacity-50">
443
+ <div class="flex h-8 w-8 items-center justify-center rounded-full transition-all duration-200" style="background-color: ${this.color}">
444
+ <mw-icon name="lucide:mic" class="inline-flex h-4 w-4 text-white transition-colors dark:text-gray-800"></mw-icon>
445
+ </div>
446
+ </button>
447
+ `:null}
362
448
 
363
- <!-- autofocus is supposed to work on pageload, in our case the dialog opens which may not trigger autofocus, but this may work only in case the widget dialog was left open before pageload -->
364
- <textarea
365
- data-testid="mw-chat-input-textarea"
366
- name="input"
367
- @input="${this.#s}"
368
- @keydown="${this.#n}"
369
- autofocus
370
- ?disabled="${this.disabled}"
371
- maxlength="1000"
372
- placeholder="${this.placeholder}"
373
- class="${this.enableFileUpload?"px-1":"pl-3 pr-1"} box-content h-[${Lr.initialHeight}px] w-full resize-none place-content-center rounded bg-transparent py-[${Lr.paddingY}px] text-base text-gray-800 outline-none placeholder:text-[14px] placeholder:font-light disabled:content-baseline disabled:leading-[${Lr.initialHeight}px] dark:text-gray-200"></textarea>
374
-
375
- <button
376
- type="submit"
377
- data-testid="mw-chat-input-submit-btn"
378
- ?disabled="${this.disabled||this.loading}"
379
- class="mx-1 rounded-full px-2 transition-all duration-150 ease-out disabled:cursor-not-allowed disabled:opacity-50">
380
- <div
381
- class="${this.streaming||this.loading||!this.value&&(!this.enableFileUpload||this.files.length===0)?"bg-gray-400 dark:bg-gray-600":""} ${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">
382
- ${this.loading?u`<mw-icon name="lucide:loader-circle" class="${e?"text-white":"text-white dark:text-gray-800"} inline-flex h-5 w-5 animate-spin transition-all"></mw-icon>`:this.streaming?u`<mw-icon name="lucide:x" class="${e?"text-white":"text-white dark:text-gray-800"} inline-flex h-4 w-4 transition-colors"></mw-icon>`:u`<mw-icon name="lucide:arrow-up" class="${e?"text-white":"text-white dark:text-gray-800"} inline-flex h-4 w-4 transition-colors"></mw-icon>`}
383
- </div>
384
- </button>
385
- </form>
449
+ <!-- Send/cancel button: hidden when mic button is shown -->
450
+ ${n?null:u`
451
+ <button
452
+ type="submit"
453
+ data-testid="mw-chat-input-submit-btn"
454
+ ?disabled="${this.disabled||this.loading}"
455
+ class="mx-1 rounded-full px-2 transition-all duration-150 ease-out disabled:cursor-not-allowed disabled:opacity-50">
456
+ <div
457
+ class="${i?"bg-gray-400 dark:bg-gray-600":""} flex h-8 w-8 flex-row items-center justify-center rounded-full transition-all duration-200"
458
+ style="background-color: ${i?"":this.color}">
459
+ ${this.loading?u`
460
+ <mw-icon
461
+ name="lucide:loader-circle"
462
+ class="${i?"text-white":"text-white dark:text-gray-800"} inline-flex h-5 w-5 animate-spin transition-all"></mw-icon>
463
+ `:this.streaming?u`<mw-icon name="lucide:x" class="${i?"text-white":"text-white dark:text-gray-800"} inline-flex h-4 w-4 transition-colors"></mw-icon>`:u`<mw-icon name="lucide:arrow-up" class="${i?"text-white":"text-white dark:text-gray-800"} inline-flex h-4 w-4 transition-colors"></mw-icon>`}
464
+ </div>
465
+ </button>
466
+ `}
467
+ </form>
468
+ `}
386
469
 
387
470
  <slot>
388
471
  <div class="h-5 w-full"></div>
389
472
  </slot>
390
473
  </div>
391
- `}get#t(){return this.renderRoot.querySelector('textarea[name="input"]')??null}get#r(){return this.renderRoot.querySelector('button[type="submit"]')??null}#n(e){xu(e)&&(e.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&this.#r?.click())}#i(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;if(this.#e=r,this.streaming){this.dispatchEvent(new t.CancelEvent);return}let n=this.#t;if(!n)throw new Error("Expected input element to be present");let s=n.value.trim();(s||this.enableFileUpload&&this.files.length>0)&&this.dispatchEvent(new t.SubmitEvent(s))&&(n.value=""),this.#o(),this.focus()}#s(e){this.dispatchEvent(new t.ChangeEvent({delta:e.data,full:e.target instanceof HTMLTextAreaElement?e.target.value:""})),this.#o()}#o(){let e=this.#t;if(!e)return;let{maxHeight:r,initialHeight:i,paddingY:n}=Lr;e.style.height=`${i}px`;let s=e.scrollHeight,o=n*2,a=Math.min(s-o,r);e.style.height=`${a}px`,this.requestUpdate()}#a(){this.dispatchEvent(new t.FileUploadClickEvent)}#l(e){this.dispatchEvent(new t.FileDeleteEvent(e))}setValue(e){let r=this.#t;if(!r){console.warn("input element not found, cannot set value");return}r.value=e,this.#o(),this.dispatchEvent(new t.ChangeEvent({delta:null,full:e}))}focus(){window.requestAnimationFrame(()=>{this.#t?.focus()})}};ee.ChangeEvent=class extends CustomEvent{static type="mw:change";constructor(e,r={}){super(ee.ChangeEvent.type,{detail:e,...r})}};ee.SubmitEvent=class extends CustomEvent{static type="mw:submit";constructor(e,r={}){super(ee.SubmitEvent.type,{detail:e,...r,cancelable:!0})}};ee.CancelEvent=class extends CustomEvent{static type="mw:cancel";constructor(e={}){super(ee.CancelEvent.type,{...e})}};ee.FileUploadClickEvent=class extends CustomEvent{static type="mw:file-upload-click";constructor(e={}){super(ee.FileUploadClickEvent.type,{...e})}};ee.FileDeleteEvent=class extends CustomEvent{static type="mw:file-delete";constructor(e,r={}){super(ee.FileDeleteEvent.type,{detail:e,...r})}};function xu(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",ee);function la({delay:t},e){let r=!0,i;return Object.assign((...n)=>{r?(clearTimeout(i),i=setTimeout(()=>{r&&e(...n),i=void 0},t)):e(...n)},{isPending:()=>i!==void 0,cancel:()=>{r=!1},flush:(...n)=>e(...n)})}var xn=class{#e;constructor(e,{delay:r},i){this.#e=la({delay:r},i),e.addController(this)}get call(){return this.#e}hostDisconnected(){this.#e.cancel()}};function ca(t,e,r){return new xn(t,e,r)}function da(t){let e=Math.floor(t/3600);t=t%3600;let r=Math.floor(t/60);return t=Math.floor(t%60),e>0?r>0?`${ua(e)} hr ${r} min`:`${ua(e)} hr`:r>0?t>0?`${r} min ${t} sec`:`${r} min`:`${t} sec`}function pa(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}`}function ua(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}var kn=class extends w(v){static properties={content:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},expanded:{type:Boolean,state:!0},_inProgress:{type:Boolean,state:!0}};static styles=O`
474
+ `}get#r(){return this.renderRoot.querySelector('textarea[name="input"]')??null}get#i(){return this.renderRoot.querySelector('button[type="submit"]')??null}#n(e){Pu(e)&&(e.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&this.#i?.click())}#s(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;if(this.#e=r,this.streaming){this.dispatchEvent(new t.CancelEvent);return}let n=this.#r;if(!n)throw new Error("Expected input element to be present");let s=n.value.trim();(s||this.enableFileUpload&&this.files.length>0)&&this.dispatchEvent(new t.SubmitEvent(s))&&(n.value=""),this.#o(),this.focus()}#a(e){this.dispatchEvent(new t.ChangeEvent({delta:e.data,full:e.target instanceof HTMLTextAreaElement?e.target.value:""})),this.#o()}#o(){let e=this.#r;if(!e)return;let{maxHeight:r,initialHeight:i,paddingY:n}=Wr;e.style.height=`${i}px`;let s=e.scrollHeight,o=n*2,a=Math.min(s-o,r);e.style.height=`${a}px`,this.requestUpdate()}#l(){this.#t?.start()}#c(){this.#t?.cancel()}#u(){this.#t?.approve()}#d(){this.dispatchEvent(new t.FileUploadClickEvent)}#p(e){this.dispatchEvent(new t.FileDeleteEvent(e))}setValue(e){let r=this.#r;if(!r){console.warn("input element not found, cannot set value");return}r.value=e,this.#o(),this.dispatchEvent(new t.ChangeEvent({delta:null,full:e}))}cancelVoice(){this.#t?.cancel()}focus(){window.requestAnimationFrame(()=>{this.#r?.focus()})}};ee.ChangeEvent=class extends CustomEvent{static type="mw:change";constructor(e,r={}){super(ee.ChangeEvent.type,{detail:e,...r})}};ee.SubmitEvent=class extends CustomEvent{static type="mw:submit";constructor(e,r={}){super(ee.SubmitEvent.type,{detail:e,...r,cancelable:!0})}};ee.CancelEvent=class extends CustomEvent{static type="mw:cancel";constructor(e={}){super(ee.CancelEvent.type,{...e})}};ee.FileUploadClickEvent=class extends CustomEvent{static type="mw:file-upload-click";constructor(e={}){super(ee.FileUploadClickEvent.type,{...e})}};ee.FileDeleteEvent=class extends CustomEvent{static type="mw:file-delete";constructor(e,r={}){super(ee.FileDeleteEvent.type,{detail:e,...r})}};function Pu(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",ee);function ba({delay:t},e){let r=!0,i;return Object.assign((...n)=>{r?(clearTimeout(i),i=setTimeout(()=>{r&&e(...n),i=void 0},t)):e(...n)},{isPending:()=>i!==void 0,cancel:()=>{r=!1},flush:(...n)=>e(...n)})}var An=class{#e;constructor(e,{delay:r},i){this.#e=ba({delay:r},i),e.addController(this)}get call(){return this.#e}hostDisconnected(){this.#e.cancel()}};function va(t,e,r){return new An(t,e,r)}function xa(t){let e=Math.floor(t/3600);t=t%3600;let r=Math.floor(t/60);return t=Math.floor(t%60),e>0?r>0?`${wa(e)} hr ${r} min`:`${wa(e)} hr`:r>0?t>0?`${r} min ${t} sec`:`${r} min`:`${t} sec`}function ka(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}`}function wa(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}var Tn=class extends w(v){static properties={content:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},expanded:{type:Boolean,state:!0},_inProgress:{type:Boolean,state:!0}};static styles=O`
392
475
  @keyframes ellipsis {
393
476
  0% {
394
477
  content: '';
@@ -408,14 +491,14 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
408
491
  content: '';
409
492
  animation: ellipsis 1.5s infinite;
410
493
  }
411
- `;#e=ca(this,{delay:1200},()=>{this._inProgress=!1,this.#t&&(this.#r=Date.now()),this.requestUpdate()});#t=null;#r=null;constructor(){super(),this.content="",this.darkMode=!1,this.expanded=!1,this._inProgress=!1}getStreamDuration(){return this.#t?Date.now()-this.#t:null}#n(){if(!this.#t||!this.#r)return null;let e=this.#r-this.#t,r=Math.round(e/1e3);return Math.max(1,r)}#i(){if(this._inProgress)return"Thinking";let e=this.#n();return e?`Thought for ${da(e)}`:"Thought"}updated(e){e.has("content")&&(!this.#t&&this.content&&(this.#t=Date.now()),this._inProgress=!0,this.#e.call())}#s=()=>{this.expanded=!this.expanded};render(){return u`
494
+ `;#e=va(this,{delay:1200},()=>{this._inProgress=!1,this.#t&&(this.#r=Date.now()),this.requestUpdate()});#t=null;#r=null;constructor(){super(),this.content="",this.darkMode=!1,this.expanded=!1,this._inProgress=!1}getStreamDuration(){return this.#t?Date.now()-this.#t:null}#i(){if(!this.#t||!this.#r)return null;let e=this.#r-this.#t,r=Math.round(e/1e3);return Math.max(1,r)}#n(){if(this._inProgress)return"Thinking";let e=this.#i();return e?`Thought for ${xa(e)}`:"Thought"}updated(e){e.has("content")&&(!this.#t&&this.content&&(this.#t=Date.now()),this._inProgress=!0,this.#e.call())}#s=()=>{this.expanded=!this.expanded};render(){return u`
412
495
  <div class="${this.darkMode?"dark":""} w-full">
413
496
  <button
414
497
  @click="${this.#s}"
415
498
  class="flex items-center gap-1.5 text-left text-xs text-gray-500 transition-colors hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"
416
499
  type="button">
417
500
  <mw-icon class="${this.expanded?"rotate-90":""} h-3 w-3 shrink-0 transition-transform" name="lucide:chevron-right"></mw-icon>
418
- <span class="thinking-text ${this._inProgress?"in-progress":""}">${this.#i()}</span>
501
+ <span class="thinking-text ${this._inProgress?"in-progress":""}">${this.#n()}</span>
419
502
  </button>
420
503
 
421
504
  ${this.expanded?u`
@@ -426,7 +509,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
426
509
  </div>
427
510
  `:null}
428
511
  </div>
429
- `}};customElements.get("mw-thought-block")||customElements.define("mw-thought-block",kn);var _n=class extends w(v){static properties={side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single",this.darkMode=!1}render(){return this.#e()}#e(){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 u`
512
+ `}};customElements.get("mw-thought-block")||customElements.define("mw-thought-block",Tn);var Mn=class extends w(v){static properties={side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single",this.darkMode=!1}render(){return this.#e()}#e(){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 u`
430
513
  <div class="${this.darkMode?"dark":""} ml-20 flex justify-end font-sans text-base">
431
514
  <div class="max-w-full">
432
515
  <!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
@@ -437,7 +520,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
437
520
  <!-- render status (if any) -->
438
521
  ${this.status==="sent"?u`
439
522
  <!-- tick mark -->
440
- <mw-icon class="ml-auto h-3 w-3 text-gray-400" name="lucide:check"></mw-icon>
523
+ <mw-icon class="ml-auto block h-3 w-3 text-gray-400" name="lucide:check"></mw-icon>
441
524
  `:null}
442
525
  </div>
443
526
  </div>
@@ -460,16 +543,16 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
460
543
  </div>
461
544
  </div>
462
545
  </div>
463
- `;default:throw new Error(`Unknown side: ${this.side}`)}}};customElements.get("mw-chat-message")||customElements.define("mw-chat-message",_n);function ha(t){return e=>{let i=(t?Math[t]:Math.trunc)(e);return i===0?0:i}}var ku=Math.pow(10,8)*24*60*60*1e3,Km=-ku;var _u=3600;var fa=_u*24,Ym=fa*7,Cu=fa*365.2425,Eu=Cu/12,Qm=Eu*3,Cn=Symbol.for("constructDateFrom");function ma(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Cn in t?t[Cn](e):t instanceof Date?new t.constructor(e):new Date(e)}function En(t,e){return ma(e||t,t)}function ga(t,e){return+En(t)-+En(e)}function $n(t,e,r){let i=ga(t,e)/1e3;return ha(r?.roundingMethod)(i)}var Sn=class extends w(v){static properties={question:{type:String},options:{type:Array},heading:{type:String},gameTitle:{type:String},resultPrefix:{type:String},correctButtonText:{type:String},wrongButtonText:{type:String},color:{type:String},apiBaseUrl:{type:String},cdnBaseUrl:{type:String},minutes:{type:String},seconds:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},_currentQuestion:{type:String,state:!0},_questionHistory:{type:Array,state:!0},_guessedJob:{type:String,state:!0},_isLoadingNextQuestion:{type:Boolean,state:!0},_loadingAnswer:{type:String,state:!0},_guessValidated:{type:Boolean,state:!0},_validatingButton:{type:String,state:!0},_currentAttemptQuestionCount:{type:Number,state:!0}};static styles=O`
546
+ `;default:throw new Error(`Unknown side: ${this.side}`)}}};customElements.get("mw-chat-message")||customElements.define("mw-chat-message",Mn);function _a(t){return e=>{let i=(t?Math[t]:Math.trunc)(e);return i===0?0:i}}var Ru=Math.pow(10,8)*24*60*60*1e3,Ug=-Ru;var Uu=3600;var Ca=Uu*24,Lg=Ca*7,Lu=Ca*365.2425,ju=Lu/12,jg=ju*3,Dn=Symbol.for("constructDateFrom");function Ea(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Dn in t?t[Dn](e):t instanceof Date?new t.constructor(e):new Date(e)}function On(t,e){return Ea(e||t,t)}function Sa(t,e){return+On(t)-+On(e)}function Pn(t,e,r){let i=Sa(t,e)/1e3;return _a(r?.roundingMethod)(i)}var Rn=class extends w(v){static properties={question:{type:String},options:{type:Array},heading:{type:String},gameTitle:{type:String},resultPrefix:{type:String},correctButtonText:{type:String},wrongButtonText:{type:String},color:{type:String},apiBaseUrl:{type:String},cdnBaseUrl:{type:String},minutes:{type:String},seconds:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},_currentQuestion:{type:String,state:!0},_questionHistory:{type:Array,state:!0},_guessedJob:{type:String,state:!0},_isLoadingNextQuestion:{type:Boolean,state:!0},_loadingAnswer:{type:String,state:!0},_guessValidated:{type:Boolean,state:!0},_validatingButton:{type:String,state:!0},_currentAttemptQuestionCount:{type:Number,state:!0}};static styles=O`
464
547
  :host {
465
548
  display: block;
466
549
  }
467
- `;#e=7;constructor(){super(),this.question="",this.options=["No","Yes"],this.heading="",this.gameTitle="",this.resultPrefix="",this.correctButtonText="Correct",this.wrongButtonText="Wrong",this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.minutes="00",this.seconds="00",this.darkMode=!1,this._currentQuestion="",this._questionHistory=[],this._guessedJob="",this._isLoadingNextQuestion=!1,this._loadingAnswer="",this._guessValidated=!1,this._validatingButton="",this._currentAttemptQuestionCount=0}firstUpdated(){this._currentQuestion=this.question}async#t(){if(!this.apiBaseUrl)return console.warn("API base URL not configured, cannot fetch next question"),null;this._isLoadingNextQuestion=!0;try{let e=await fetch(`${this.apiBaseUrl}/preview/wait-game/next-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({questionAnswers:this._questionHistory,takeGuess:this._currentAttemptQuestionCount>=this.#e})});return e.ok?await e.json():(console.error("failed to fetch next question",e.status),null)}catch(e){return console.error("error fetching next question",e),null}finally{this._isLoadingNextQuestion=!1}}#r=async e=>{this._loadingAnswer=e,this._questionHistory.push({question:this._currentQuestion,answer:e}),this._currentAttemptQuestionCount++,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:question-answered",{bubbles:!0,composed:!0,detail:{questionIndex:this._questionHistory.length-1,question:this._currentQuestion,answer:e,totalQuestions:this.#e,allAnswers:this._questionHistory.map(i=>i.answer)}}));let r=await this.#t();r&&(r.isComplete&&r.guessedJob?(this._guessedJob=r.guessedJob,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:game-completed",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(i=>i.answer)}}))):r.nextQuestion&&(this._currentQuestion=r.nextQuestion)),this._loadingAnswer=""};#n=async e=>{if(this._validatingButton=e?"correct":"wrong",this.dispatchEvent(new CustomEvent("mw-chat-wait-game:guess-validated",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,isCorrect:e,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(r=>r.answer)}})),e)this._guessValidated=!0,this._validatingButton="";else{let r=await this.#t();r?.nextQuestion&&(this._currentQuestion=r.nextQuestion),this._guessedJob="",this._currentAttemptQuestionCount=0,this._validatingButton=""}};#i(){return Math.round(this._currentAttemptQuestionCount/this.#e*100)}#s(){let e=new URL("/assets/career-ladder.png",this.cdnBaseUrl||"https://widget.molin.ai");return u`
550
+ `;#e=7;constructor(){super(),this.question="",this.options=["No","Yes"],this.heading="",this.gameTitle="",this.resultPrefix="",this.correctButtonText="Correct",this.wrongButtonText="Wrong",this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.minutes="00",this.seconds="00",this.darkMode=!1,this._currentQuestion="",this._questionHistory=[],this._guessedJob="",this._isLoadingNextQuestion=!1,this._loadingAnswer="",this._guessValidated=!1,this._validatingButton="",this._currentAttemptQuestionCount=0}firstUpdated(){this._currentQuestion=this.question}async#t(){if(!this.apiBaseUrl)return console.warn("API base URL not configured, cannot fetch next question"),null;this._isLoadingNextQuestion=!0;try{let e=await fetch(`${this.apiBaseUrl}/preview/wait-game/next-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({questionAnswers:this._questionHistory,takeGuess:this._currentAttemptQuestionCount>=this.#e})});return e.ok?await e.json():(console.error("failed to fetch next question",e.status),null)}catch(e){return console.error("error fetching next question",e),null}finally{this._isLoadingNextQuestion=!1}}#r=async e=>{this._loadingAnswer=e,this._questionHistory.push({question:this._currentQuestion,answer:e}),this._currentAttemptQuestionCount++,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:question-answered",{bubbles:!0,composed:!0,detail:{questionIndex:this._questionHistory.length-1,question:this._currentQuestion,answer:e,totalQuestions:this.#e,allAnswers:this._questionHistory.map(i=>i.answer)}}));let r=await this.#t();r&&(r.isComplete&&r.guessedJob?(this._guessedJob=r.guessedJob,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:game-completed",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(i=>i.answer)}}))):r.nextQuestion&&(this._currentQuestion=r.nextQuestion)),this._loadingAnswer=""};#i=async e=>{if(this._validatingButton=e?"correct":"wrong",this.dispatchEvent(new CustomEvent("mw-chat-wait-game:guess-validated",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,isCorrect:e,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(r=>r.answer)}})),e)this._guessValidated=!0,this._validatingButton="";else{let r=await this.#t();r?.nextQuestion&&(this._currentQuestion=r.nextQuestion),this._guessedJob="",this._currentAttemptQuestionCount=0,this._validatingButton=""}};#n(){return Math.round(this._currentAttemptQuestionCount/this.#e*100)}#s(){let e=new URL("/assets/career-ladder.png",this.cdnBaseUrl||"https://widget.molin.ai");return u`
468
551
  <div class="mt-3 flex items-center justify-center gap-1">
469
552
  <span class="text-[11px] text-black/40 dark:text-gray-500">Inspired by</span>
470
553
  <img src="${e.href}" alt="Career Ladder" class="h-6" />
471
554
  </div>
472
- `}render(){let e=this.#i(),r=this.heading||"Agent joining in",i=this.gameTitle||"\u{1F9E0} I'll guess your job",n=this.resultPrefix||"I'm pretty confident:";return this._guessedJob?u`
555
+ `}render(){let e=this.#n(),r=this.heading||"Agent joining in",i=this.gameTitle||"\u{1F9E0} I'll guess your job",n=this.resultPrefix||"I'm pretty confident:";return this._guessedJob?u`
473
556
  <div class="${this.darkMode?"dark bg-[#1E1F23] ring-white/10":"bg-white/70 ring-black/10"} mx-auto w-full rounded-2xl p-4 shadow-sm ring-1 backdrop-blur">
474
557
  <div class="flex items-center justify-between">
475
558
  <div class="text-[13px] text-black/60 dark:text-gray-300">${r}</div>
@@ -488,13 +571,13 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
488
571
  ${this._guessValidated?"":u`
489
572
  <div class="mt-3 grid grid-cols-2 gap-2">
490
573
  <button
491
- @click="${()=>this.#n(!1)}"
574
+ @click="${()=>this.#i(!1)}"
492
575
  ?disabled="${!!this._validatingButton}"
493
576
  class="flex items-center justify-center gap-1 rounded-xl border border-[${this.color}] bg-white px-4 py-2 text-sm font-medium text-black transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[#2B2D31] dark:text-white">
494
577
  ${this._validatingButton==="wrong"?u`<mw-icon class="h-4 w-4 animate-spin" name="lucide:loader-circle"></mw-icon>`:this.wrongButtonText}
495
578
  </button>
496
579
  <button
497
- @click="${()=>this.#n(!0)}"
580
+ @click="${()=>this.#i(!0)}"
498
581
  ?disabled="${!!this._validatingButton}"
499
582
  class="flex items-center justify-center gap-1 rounded-xl bg-[${this.color}] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50 dark:text-black">
500
583
  ${this._validatingButton==="correct"?u`<mw-icon class="h-4 w-4 animate-spin" name="lucide:loader-circle"></mw-icon>`:this.correctButtonText}
@@ -544,11 +627,11 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
544
627
 
545
628
  ${this.#s()}
546
629
  </div>
547
- `:u`<p class="text-sm text-black italic dark:text-white">There was a problem loading the game, please refresh the page.</p>`}};customElements.get("mw-chat-wait-game")||customElements.define("mw-chat-wait-game",Sn);var In=class extends w(v){static styles=O`
630
+ `:u`<p class="text-sm text-black italic dark:text-white">There was a problem loading the game, please refresh the page.</p>`}};customElements.get("mw-chat-wait-game")||customElements.define("mw-chat-wait-game",Rn);var Un=class extends w(v){static styles=O`
548
631
  :host {
549
632
  display: block;
550
633
  }
551
- `;static properties={data:{type:Object},color:{type:String},apiBaseUrl:{type:String},cdnBaseUrl:{type:String},soundUrl:{type:String,attribute:"sound"},darkMode:{type:Boolean,attribute:"dark-mode"},_remainingSeconds:{type:Number,state:!0},_isComplete:{type:Boolean,state:!0},_showGame:{type:Boolean,state:!0}};#e=null;#t=null;#r=0;constructor(){super(),this.data,this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.soundUrl="",this.darkMode=!1,this._remainingSeconds=480,this._isComplete=!1,this._showGame=!1}connectedCallback(){super.connectedCallback(),this.#n(),this.#s()}disconnectedCallback(){super.disconnectedCallback(),this.#o()}#n(){this.data?.expected_join_time?this.#t=new Date(this.data.expected_join_time):this.#t=new Date(Date.now()+this._remainingSeconds*1e3),this.#r=Math.max($n(this.#t,new Date),0),this.#i()}#i(){if(this.#t===null)return;let e=new Date,r=$n(this.#t,e);r>=0?(this._remainingSeconds=r,this._isComplete=!1):(this._remainingSeconds=Math.abs(r),this._isComplete=!0)}#s(){this.#o(),this.#e=setInterval(()=>{this.#i()},1e3)}#o(){this.#e!==null&&(clearInterval(this.#e),this.#e=null)}#a=()=>{this.#d(),this._showGame=!0,this.dispatchEvent(new CustomEvent("mw-chat-wait-timer:game-click",{bubbles:!0,composed:!0}))};#l(){if(!this.data?.game_first_question)return!1;try{return localStorage.getItem("_molin_timer_sound_question")===this.data.game_first_question}catch{return!1}}#c(){if(this.data?.game_first_question)try{localStorage.setItem("_molin_timer_sound_question",this.data.game_first_question)}catch(e){console.error("Error saving sound state to localStorage:",e,{})}}#d(){if(!this.soundUrl||!this.data?.game_first_question||this.#l())return;let e=new Audio(this.soundUrl);e.volume=.5,e.play().then(()=>{this.#c()}).catch(r=>{console.error("Error playing audio:",r,{})})}#u(){let e=Math.floor(this._remainingSeconds/60),r=this._remainingSeconds%60,i=n=>String(n).padStart(2,"0");return{minutes:i(e),seconds:i(r)}}#p(){return this._isComplete?0:this.#t===null||this.#r===0?100:Math.round(this._remainingSeconds/this.#r*100)}render(){let{minutes:e,seconds:r}=this.#u();if(this._showGame)return u`
634
+ `;static properties={data:{type:Object},color:{type:String},apiBaseUrl:{type:String},cdnBaseUrl:{type:String},soundUrl:{type:String,attribute:"sound"},darkMode:{type:Boolean,attribute:"dark-mode"},_remainingSeconds:{type:Number,state:!0},_isComplete:{type:Boolean,state:!0},_showGame:{type:Boolean,state:!0}};#e=null;#t=null;#r=0;constructor(){super(),this.data,this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.soundUrl="",this.darkMode=!1,this._remainingSeconds=480,this._isComplete=!1,this._showGame=!1}connectedCallback(){super.connectedCallback(),this.#i(),this.#s()}disconnectedCallback(){super.disconnectedCallback(),this.#a()}#i(){this.data?.expected_join_time?this.#t=new Date(this.data.expected_join_time):this.#t=new Date(Date.now()+this._remainingSeconds*1e3),this.#r=Math.max(Pn(this.#t,new Date),0),this.#n()}#n(){if(this.#t===null)return;let e=new Date,r=Pn(this.#t,e);r>=0?(this._remainingSeconds=r,this._isComplete=!1):(this._remainingSeconds=Math.abs(r),this._isComplete=!0)}#s(){this.#a(),this.#e=setInterval(()=>{this.#n()},1e3)}#a(){this.#e!==null&&(clearInterval(this.#e),this.#e=null)}#o=()=>{this.#u(),this._showGame=!0,this.dispatchEvent(new CustomEvent("mw-chat-wait-timer:game-click",{bubbles:!0,composed:!0}))};#l(){if(!this.data?.game_first_question)return!1;try{return localStorage.getItem("_molin_timer_sound_question")===this.data.game_first_question}catch{return!1}}#c(){if(this.data?.game_first_question)try{localStorage.setItem("_molin_timer_sound_question",this.data.game_first_question)}catch(e){console.error("Error saving sound state to localStorage:",e,{})}}#u(){if(!this.soundUrl||!this.data?.game_first_question||this.#l())return;let e=new Audio(this.soundUrl);e.volume=.5,e.play().then(()=>{this.#c()}).catch(r=>{console.error("Error playing audio:",r,{})})}#d(){let e=Math.floor(this._remainingSeconds/60),r=this._remainingSeconds%60,i=n=>String(n).padStart(2,"0");return{minutes:i(e),seconds:i(r)}}#p(){return this._isComplete?0:this.#t===null||this.#r===0?100:Math.round(this._remainingSeconds/this.#r*100)}render(){let{minutes:e,seconds:r}=this.#d();if(this._showGame)return u`
552
635
  <mw-chat-wait-game
553
636
  .question="${this.data?.game_first_question}"
554
637
  .options="${[this.data?.game_button_answer_negative||"No",this.data?.game_button_answer_affirmative||"Yes"]}"
@@ -580,12 +663,12 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
580
663
 
581
664
  <!-- Play a Game Button -->
582
665
  <div class="mt-4">
583
- <button @click="${this.#a}" class="w-full rounded-xl bg-[${this.color}] px-4 py-2 text-sm font-medium text-white transition hover:opacity-90 dark:text-black">
666
+ <button @click="${this.#o}" class="w-full rounded-xl bg-[${this.color}] px-4 py-2 text-sm font-medium text-white transition hover:opacity-90 dark:text-black">
584
667
  ${this.data?.game_button_start}
585
668
  </button>
586
669
  </div>
587
670
  </div>
588
- `}};customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",In);var An=class{#e=[];#t=[];#r=[];constructor(e){e.addController(this)}hostDisconnected(){this.clearTimeouts(),this.clearIntervals(),this.clearAnimationFrames()}clearTimeouts(){this.#e.forEach(clearTimeout),this.#e=[]}clearIntervals(){this.#t.forEach(clearInterval),this.#t=[]}clearAnimationFrames(){this.#r.forEach(cancelAnimationFrame),this.#r=[]}setTimeout(e,r,...i){let n=setTimeout(e,r,...i);return this.#e.push(n),n}setInterval(e,r,...i){let n=setInterval(e,r,...i);return this.#t.push(n),n}requestAnimationFrame(e){let r=requestAnimationFrame(e);return this.#r.push(r),r}};function Se(t){return new An(t)}var be=class extends w(v){static properties={src:{type:String},alt:{type:String},side:{type:String},position:{type:String},width:{type:String},height:{type:String},clickable:{type:Boolean}};constructor(){super(),this.src="",this.alt="",this.side="right",this.position="single",this.width="300px",this.height="auto",this.clickable=!1}#e=Se(this);#t=!1;#r=!1;#n=!1;#i=!1;updated(e){e.has("src")&&(this.#t=!1,this.#r=!1)}#s(){document.addEventListener("keydown",this.#a)}#o(){document.removeEventListener("keydown",this.#a)}#a=e=>{e.key==="Escape"&&this.#f(e)};get#l(){return this.side==="left"||this.side==="assistant"?"flex justify-start ml-[25px]":"flex justify-end"}get#c(){let e="inline-block overflow-hidden shadow-sm";if(this.side==="right"||this.side==="user")switch(this.position){case"first":e+=" rounded-2xl rounded-br-[4px]";break;case"middle":e+=" rounded-2xl rounded-r-[4px]";break;case"last":case"last-current":e+=" rounded-2xl rounded-tr-[4px]";break;default:e+=" rounded-2xl";break}else switch(this.position){case"first":e+=" rounded-2xl rounded-bl-[4px]";break;case"middle":e+=" rounded-2xl rounded-l-[4px]";break;case"last":case"last-current":e+=" rounded-2xl rounded-tl-[4px]";break;default:e+=" rounded-2xl";break}return e}#d(){if(!this.src)return"";try{let e=new URL(this.src);return e.searchParams.set("for","full"),e.href}catch{return this.src}}render(){return this.src?u`
671
+ `}};customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",Un);var Ln=class{#e=[];#t=[];#r=[];constructor(e){e.addController(this)}hostDisconnected(){this.clearTimeouts(),this.clearIntervals(),this.clearAnimationFrames()}clearTimeouts(){this.#e.forEach(clearTimeout),this.#e=[]}clearIntervals(){this.#t.forEach(clearInterval),this.#t=[]}clearAnimationFrames(){this.#r.forEach(cancelAnimationFrame),this.#r=[]}setTimeout(e,r,...i){let n=setTimeout(e,r,...i);return this.#e.push(n),n}setInterval(e,r,...i){let n=setInterval(e,r,...i);return this.#t.push(n),n}requestAnimationFrame(e){let r=requestAnimationFrame(e);return this.#r.push(r),r}};function Ie(t){return new Ln(t)}var ve=class extends w(v){static properties={src:{type:String},alt:{type:String},side:{type:String},position:{type:String},width:{type:String},height:{type:String},clickable:{type:Boolean}};constructor(){super(),this.src="",this.alt="",this.side="right",this.position="single",this.width="300px",this.height="auto",this.clickable=!1}#e=Ie(this);#t=!1;#r=!1;#i=!1;#n=!1;updated(e){e.has("src")&&(this.#t=!1,this.#r=!1)}#s(){document.addEventListener("keydown",this.#o)}#a(){document.removeEventListener("keydown",this.#o)}#o=e=>{e.key==="Escape"&&this.#h(e)};get#l(){return this.side==="left"||this.side==="assistant"?"flex justify-start ml-[25px]":"flex justify-end"}get#c(){let e="inline-block overflow-hidden shadow-sm";if(this.side==="right"||this.side==="user")switch(this.position){case"first":e+=" rounded-2xl rounded-br-[4px]";break;case"middle":e+=" rounded-2xl rounded-r-[4px]";break;case"last":case"last-current":e+=" rounded-2xl rounded-tr-[4px]";break;default:e+=" rounded-2xl";break}else switch(this.position){case"first":e+=" rounded-2xl rounded-bl-[4px]";break;case"middle":e+=" rounded-2xl rounded-l-[4px]";break;case"last":case"last-current":e+=" rounded-2xl rounded-tl-[4px]";break;default:e+=" rounded-2xl";break}return e}#u(){if(!this.src)return"";try{let e=new URL(this.src);return e.searchParams.set("for","full"),e.href}catch{return this.src}}render(){return this.src?u`
589
672
  <div class="${this.#l} mb-2 min-h-[100px]">
590
673
  <div class="${this.#c} relative">
591
674
  <!-- Placeholder background that's only shown when loading or error -->
@@ -607,39 +690,39 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
607
690
  alt="${this.alt}"
608
691
  style="width: ${this.width}; height: ${this.height}; display: block;"
609
692
  class="${this.#t?"opacity-100":"opacity-0 hidden"} ${this.clickable?"cursor-pointer hover:scale-[105%]":""} h-full w-full max-w-full transition-all duration-200"
610
- @error="${this.#u}"
693
+ @error="${this.#d}"
611
694
  @load="${this.#p}"
612
- @click="${this.clickable?this.#v:void 0}"
695
+ @click="${this.clickable?this.#w:void 0}"
613
696
  loading="lazy" />
614
697
  </div>
615
698
  </div>
616
699
 
617
700
  <!-- Full image modal -->
618
- ${this.#n?u`
701
+ ${this.#i?u`
619
702
  <div
620
- class="${this.#i?"bg-opacity-0":"bg-opacity-75"} fixed inset-0 z-50 flex items-center justify-center bg-black p-4 transition-opacity duration-300"
621
- @click="${this.#f}">
703
+ class="${this.#n?"bg-opacity-0":"bg-opacity-75"} fixed inset-0 z-50 flex items-center justify-center bg-black p-4 transition-opacity duration-300"
704
+ @click="${this.#h}">
622
705
  <!-- Close button -->
623
706
  <button
624
707
  type="button"
625
- class="bg-opacity-50 ${this.#i?"opacity-0":"opacity-75"} hover:bg-opacity-75 absolute top-8 right-8 z-10 rounded-full bg-black p-2 text-white transition-[colors,opacity] delay-300 focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-transparent focus:outline-none"
626
- @click="${this.#f}"
708
+ class="bg-opacity-50 ${this.#n?"opacity-0":"opacity-75"} hover:bg-opacity-75 absolute top-8 right-8 z-10 rounded-full bg-black p-2 text-white transition-[colors,opacity] delay-300 focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-transparent focus:outline-none"
709
+ @click="${this.#h}"
627
710
  aria-label="Close full image">
628
711
  <!-- X mark icon -->
629
712
  <mw-icon class="h-5 w-5" name="lucide:x"></mw-icon>
630
713
  </button>
631
714
  <div class="relative flex max-h-full max-w-full">
632
715
  <img
633
- src="${this.#d()}"
716
+ src="${this.#u()}"
634
717
  alt="${this.alt}"
635
- class="${this.#i?"scale-75 opacity-0":"scale-100 opacity-100"} max-h-full max-w-full transform rounded-lg shadow-2xl transition-all duration-100 ease-out"
636
- @click="${this.#g}" />
718
+ class="${this.#n?"scale-75 opacity-0":"scale-100 opacity-100"} max-h-full max-w-full transform rounded-lg shadow-2xl transition-all duration-100 ease-out"
719
+ @click="${this.#m}" />
637
720
  </div>
638
721
  </div>
639
722
  `:null}
640
- `:(console.warn("MwChatImage: No src provided"),null)}#u=e=>{console.error("Failed to load chat image:",this.src),this.#r=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:e},bubbles:!0}))};#p=e=>{this.#t=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:e},bubbles:!0}))};#v=e=>{this.clickable&&(e.preventDefault(),e.stopPropagation(),this.#n=!0,this.#s(),this.requestUpdate(),this.#i=!0,this.requestUpdate(),this.#e.setTimeout(()=>{this.#i=!1,this.requestUpdate()},500),this.dispatchEvent(new CustomEvent("mw-chat-image:click",{detail:{src:this.src,event:e},bubbles:!0})))};#f=e=>{e.preventDefault(),e.stopPropagation(),this.#o(),this.#n=!1,this.requestUpdate()};#g=e=>{e.preventDefault(),e.stopPropagation()}};be.ErrorEvent=class extends CustomEvent{static type="mw-chat-image:error";constructor(e,r={}){super(be.ErrorEvent.type,{detail:e,...r})}};be.LoadEvent=class extends CustomEvent{static type="mw-chat-image:load";constructor(e,r={}){super(be.LoadEvent.type,{detail:e,...r})}};be.ClickEvent=class extends CustomEvent{static type="mw-chat-image:click";constructor(e,r={}){super(be.ClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-image")||customElements.define("mw-chat-image",be);var N=t=>t??U;var $u=["javascript:","data:text/html","vbscript:","data:text/javascript","data:text/vbscript","data:text/css","data:text/plain","data:text/xml"],Lt=class t extends w(v){static properties={text:{type:String},color:{type:String},dismissible:{type:Boolean},ephemeral:{type:Boolean},darkMode:{type:Boolean,attribute:"dark-mode"},_dismissed:{type:Boolean,state:!0}};constructor(){super(),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.ephemeral=!1,this.darkMode=!1,this._dismissed=!1}connectedCallback(){super.connectedCallback(),this.dismissible&&(this._dismissed=this.#e())}#e(){return this.ephemeral?!1:j().disclaimerDismissed}#t(){this.ephemeral||(j().disclaimerDismissed=!0)}#r=e=>{e.preventDefault(),this._dismissed=!0,this.#t(),this.dispatchEvent(new t.DismissEvent)};#n(e){let i=/\[([^\]]+)\]\(([^)]+)\)/g.exec(e);if(i){let n=i[0],s=i[1],o=i[2],a=i.index;return $u.some(l=>o.toLowerCase().startsWith(l))||!o||!s?e:u`${e.slice(0,a)}<a href="${N(o)}" target="_blank" rel="noopener noreferrer" @click="${this.#i}" class="underline" style="color: ${this.color}"
723
+ `:(console.warn("MwChatImage: No src provided"),null)}#d=e=>{console.error("Failed to load chat image:",this.src),this.#r=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:e},bubbles:!0}))};#p=e=>{this.#t=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:e},bubbles:!0}))};#w=e=>{this.clickable&&(e.preventDefault(),e.stopPropagation(),this.#i=!0,this.#s(),this.requestUpdate(),this.#n=!0,this.requestUpdate(),this.#e.setTimeout(()=>{this.#n=!1,this.requestUpdate()},500),this.dispatchEvent(new CustomEvent("mw-chat-image:click",{detail:{src:this.src,event:e},bubbles:!0})))};#h=e=>{e.preventDefault(),e.stopPropagation(),this.#a(),this.#i=!1,this.requestUpdate()};#m=e=>{e.preventDefault(),e.stopPropagation()}};ve.ErrorEvent=class extends CustomEvent{static type="mw-chat-image:error";constructor(e,r={}){super(ve.ErrorEvent.type,{detail:e,...r})}};ve.LoadEvent=class extends CustomEvent{static type="mw-chat-image:load";constructor(e,r={}){super(ve.LoadEvent.type,{detail:e,...r})}};ve.ClickEvent=class extends CustomEvent{static type="mw-chat-image:click";constructor(e,r={}){super(ve.ClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-image")||customElements.define("mw-chat-image",ve);var z=t=>t??R;var Fu=["javascript:","data:text/html","vbscript:","data:text/javascript","data:text/vbscript","data:text/css","data:text/plain","data:text/xml"],Bt=class t extends w(v){static properties={text:{type:String},color:{type:String},dismissible:{type:Boolean},ephemeral:{type:Boolean},darkMode:{type:Boolean,attribute:"dark-mode"},_dismissed:{type:Boolean,state:!0}};constructor(){super(),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.ephemeral=!1,this.darkMode=!1,this._dismissed=!1}connectedCallback(){super.connectedCallback(),this.dismissible&&(this._dismissed=this.#e())}#e(){return this.ephemeral?!1:L().disclaimerDismissed}#t(){this.ephemeral||(L().disclaimerDismissed=!0)}#r=e=>{e.preventDefault(),this._dismissed=!0,this.#t(),this.dispatchEvent(new t.DismissEvent)};#i(e){let i=/\[([^\]]+)\]\(([^)]+)\)/g.exec(e);if(i){let n=i[0],s=i[1],o=i[2],a=i.index;return Fu.some(l=>o.toLowerCase().startsWith(l))||!o||!s?e:u`${e.slice(0,a)}<a href="${z(o)}" target="_blank" rel="noopener noreferrer" @click="${this.#n}" class="underline" style="color: ${this.color}"
641
724
  >${s}</a
642
- >${e.slice(a+n.length)}`}return e}#i=e=>{e.stopPropagation()};render(){if(this._dismissed)return null;let e=this.#n(this.text);return u`
725
+ >${e.slice(a+n.length)}`}return e}#n=e=>{e.stopPropagation()};render(){if(this._dismissed)return null;let e=this.#i(this.text);return u`
643
726
  <div class="${this.darkMode?"dark":""} flex items-center justify-between">
644
727
  <div class="flex flex-1 items-center justify-center">
645
728
  <span class="px-3 text-center text-xs font-light text-gray-500 dark:text-gray-400">${e}</span>
@@ -655,7 +738,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
655
738
  </button>
656
739
  `:null}
657
740
  </div>
658
- `}};Lt.DismissEvent=class extends CustomEvent{static type="mw-disclaimer:dismiss";constructor(e={}){super(Lt.DismissEvent.type,{...e})}};customElements.get("mw-disclaimer")||customElements.define("mw-disclaimer",Lt);var Tn=class extends w(v){static properties={text:{type:String},variant:{type:String},autoDismissable:{type:Boolean,attribute:"auto-dismissable"},dismissDelay:{type:Number,attribute:"dismiss-delay"},_isVisible:{type:Boolean,state:!0}};constructor(){super(),this.text="I'm still learning!",this.variant="info",this.autoDismissable=!1,this.dismissDelay=5e3,this._isVisible=!0}#e=Se(this);connectedCallback(){super.connectedCallback(),this.autoDismissable&&this.#t()}#t(){this.#e.setTimeout(()=>{this._isVisible=!1,this.requestUpdate()},this.dismissDelay)}#r(){switch(this.variant){case"error":return{bg:"bg-red-600",text:"text-white",icon:"badge-alert"};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"};default:return{bg:"bg-black",text:"text-white",icon:"info"}}}render(){let e=this.#r();return u`
741
+ `}};Bt.DismissEvent=class extends CustomEvent{static type="mw-disclaimer:dismiss";constructor(e={}){super(Bt.DismissEvent.type,{...e})}};customElements.get("mw-disclaimer")||customElements.define("mw-disclaimer",Bt);var jn=class extends w(v){static properties={text:{type:String},variant:{type:String},autoDismissable:{type:Boolean,attribute:"auto-dismissable"},dismissDelay:{type:Number,attribute:"dismiss-delay"},_isVisible:{type:Boolean,state:!0}};constructor(){super(),this.text="I'm still learning!",this.variant="info",this.autoDismissable=!1,this.dismissDelay=5e3,this._isVisible=!0}#e=Ie(this);connectedCallback(){super.connectedCallback(),this.autoDismissable&&this.#t()}#t(){this.#e.setTimeout(()=>{this._isVisible=!1,this.requestUpdate()},this.dismissDelay)}#r(){switch(this.variant){case"error":return{bg:"bg-red-600",text:"text-white",icon:"badge-alert"};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"};default:return{bg:"bg-black",text:"text-white",icon:"info"}}}render(){let e=this.#r();return u`
659
742
  <div
660
743
  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">
661
744
  <div class="${e.bg} mb-2 flex max-w-[70%] items-center justify-center rounded-full px-3 py-2 select-none">
@@ -665,7 +748,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
665
748
  <span class="${e.text} ml-1 text-xs">${this.text}</span>
666
749
  </div>
667
750
  </div>
668
- `}};customElements.get("mw-info-banner")||customElements.define("mw-info-banner",Tn);var Dn=class extends w(v){render=()=>u`
751
+ `}};customElements.get("mw-info-banner")||customElements.define("mw-info-banner",jn);var Fn=class extends w(v){render=()=>u`
669
752
  <svg class="inline-block h-full w-full leading-none" 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">
670
753
  <circle fill="currentColor" stroke="none" cx="27" cy="50" r="6">
671
754
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
@@ -677,11 +760,11 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
677
760
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
678
761
  </circle>
679
762
  </svg>
680
- `};customElements.get("mw-loading")||customElements.define("mw-loading",Dn);var Su="https://molin.ai/?utm_source=molin.ai&utm_medium=widget&utm_campaign=poweredby",Mn=class extends w(v){static properties={darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.darkMode=!1}render(){return u`
763
+ `};customElements.get("mw-loading")||customElements.define("mw-loading",Fn);var qu="https://molin.ai/?utm_source=molin.ai&utm_medium=widget&utm_campaign=poweredby",qn=class extends w(v){static properties={darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.darkMode=!1}render(){return u`
681
764
  <p class="${this.darkMode?"text-gray-300":"text-gray-600"} flex items-center justify-center text-xs whitespace-nowrap">
682
765
  <span>Powered by</span>
683
766
 
684
- <a href="${Su}" target="_blank" class="inline-flex items-center underline">
767
+ <a href="${qu}" target="_blank" class="inline-flex items-center underline">
685
768
  <svg class="mx-1 inline-block h-4 w-4" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
686
769
  <circle cx="10.0361" cy="10.0361" r="10.0361" fill="#242038" />
687
770
  <path
@@ -700,7 +783,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
700
783
  <span>Molin AI</span>
701
784
  </a>
702
785
  </p>
703
- `}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",Mn);var ct=(t,e,r)=>{for(let i of e)if(i[0]===t)return(0,i[1])();return r?.()};var On=class extends w(v){static properties={orderDetails:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1,this.color="#601feb",this.darkMode=!1}render(){if(!this.orderDetails)return u`
786
+ `}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",qn);var pt=(t,e,r)=>{for(let i of e)if(i[0]===t)return(0,i[1])();return r?.()};var Bn=class extends w(v){static properties={orderDetails:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1,this.color="#601feb",this.darkMode=!1}render(){if(!this.orderDetails)return u`
704
787
  <div class="${this.darkMode?"dark border-white/10 bg-[#1E1F23]":"border-gray-200 bg-white"} flex w-full max-w-md flex-col rounded-3xl border p-4">
705
788
  <div class="mb-2">
706
789
  <div class="h-7 w-full animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
@@ -721,7 +804,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
721
804
  ${a?"":u`<div class="${`absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 ${s?`bg-[${this.color}]`:"bg-gray-300 dark:bg-gray-600"}`}" aria-hidden="true"></div>`}
722
805
 
723
806
  <div class="group relative flex items-start">
724
- ${ct(i.status,[["completed",()=>u`
807
+ ${pt(i.status,[["completed",()=>u`
725
808
  <span class="flex h-6 items-center">
726
809
  <span class="flex h-4 w-4 items-center justify-center rounded-full bg-[${this.color}]">
727
810
  <mw-icon class="h-3 w-3 text-white dark:text-gray-800" name="lucide:check"></mw-icon>
@@ -790,7 +873,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
790
873
  `)}
791
874
  `:X(r,i=>i.name,i=>u`
792
875
  <div class="flex items-center gap-2 py-1.5">
793
- <img src="${N(i.image)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
876
+ <img src="${z(i.image)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
794
877
 
795
878
  <div class="min-w-0 flex-1">
796
879
  ${!i.name&&this.streaming?u`<div class="h-4 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`:u`<h3 class="truncate text-sm font-medium text-gray-900 dark:text-gray-100">${i.name}</h3>`}
@@ -881,10 +964,10 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
881
964
 
882
965
  <!-- Action buttons section -->
883
966
  <div class="flex w-full flex-col gap-2 overflow-hidden">
884
- ${this.streaming&&!this.orderDetails.order_tracking_label&&!tt(this.orderDetails.order_tracking_url||"")?u`
967
+ ${this.streaming&&!this.orderDetails.order_tracking_label&&!it(this.orderDetails.order_tracking_url||"")?u`
885
968
  <!-- Loading shimmer for buttons -->
886
969
  <div class="h-10 w-full min-w-[250px] animate-pulse overflow-hidden rounded-xl bg-gray-200 dark:bg-gray-600"></div>
887
- `:this.orderDetails.order_tracking_url&&tt(this.orderDetails.order_tracking_url)?u`
970
+ `:this.orderDetails.order_tracking_url&&it(this.orderDetails.order_tracking_url)?u`
888
971
  <a
889
972
  target="${this.linksNewTab?"_blank":"_self"}"
890
973
  href="${this.orderDetails.order_tracking_url}"
@@ -894,7 +977,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
894
977
  `:null}
895
978
  </div>
896
979
  </div>
897
- `}};customElements.get("mw-order-card")||customElements.define("mw-order-card",On);function jr(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}var Rr=function(){},ut=function(){};var jt=(t,e,r)=>Math.min(Math.max(r,t),e);var Pn=.001,Iu=.01,ya=10,Au=.05,Tu=1;function ba({duration:t=800,bounce:e=.25,velocity:r=0,mass:i=1}){let n,s;Rr(t<=ya*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=jt(Au,Tu,o),t=jt(Iu,ya,t/1e3),o<1?(n=c=>{let d=c*o,p=d*t,h=d-r,y=Fr(c,o),f=Math.exp(-p);return Pn-h/y*f},s=c=>{let p=c*o*t,h=p*r+r,y=Math.pow(o,2)*Math.pow(c,2)*t,f=Math.exp(-p),$=Fr(Math.pow(c,2),o);return(-n(c)+Pn>0?-1:1)*((h-y)*f)/$}):(n=c=>{let d=Math.exp(-c*t),p=(c-r)*t+1;return-Pn+d*p},s=c=>{let d=Math.exp(-c*t),p=(r-c)*(t*t);return d*p});let a=5/t,l=Mu(n,s,a);if(t=t*1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{let c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:t}}}var Du=12;function Mu(t,e,r){let i=r;for(let n=1;n<Du;n++)i=i-t(i)/e(i);return i}function Fr(t,e){return t*Math.sqrt(1-e*e)}var Ou=["duration","bounce"],Pu=["stiffness","damping","mass"];function va(t,e){return e.some(r=>t[r]!==void 0)}function Uu(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!va(t,Pu)&&va(t,Ou)){let r=ba(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function qr(t){var{from:e=0,to:r=1,restSpeed:i=2,restDelta:n}=t,s=jr(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:a,damping:l,mass:c,velocity:d,duration:p,isResolvedFromDuration:h}=Uu(s),y=wa,f=wa;function $(){let x=d?-(d/1e3):0,E=r-e,b=l/(2*Math.sqrt(a*c)),k=Math.sqrt(a/c)/1e3;if(n===void 0&&(n=Math.min(Math.abs(r-e)/100,.4)),b<1){let S=Fr(k,b);y=P=>{let R=Math.exp(-b*k*P);return r-R*((x+b*k*E)/S*Math.sin(S*P)+E*Math.cos(S*P))},f=P=>{let R=Math.exp(-b*k*P);return b*k*R*(Math.sin(S*P)*(x+b*k*E)/S+E*Math.cos(S*P))-R*(Math.cos(S*P)*(x+b*k*E)-S*E*Math.sin(S*P))}}else if(b===1)y=S=>r-Math.exp(-k*S)*(E+(x+k*E)*S);else{let S=k*Math.sqrt(b*b-1);y=P=>{let R=Math.exp(-b*k*P),z=Math.min(S*P,300);return r-R*((x+b*k*E)*Math.sinh(z)+S*E*Math.cosh(z))/S}}}return $(),{next:x=>{let E=y(x);if(h)o.done=x>=p;else{let b=f(x)*1e3,k=Math.abs(b)<=i,S=Math.abs(r-E)<=n;o.done=k&&S}return o.value=o.done?r:E,o},flipTarget:()=>{d=-d,[e,r]=[r,e],$()}}}qr.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var wa=t=>0;var Un=(t,e,r)=>{let i=e-t;return i===0?1:(r-t)/i};var dt=(t,e,r)=>-r*t+r*e+t;var Br=(t,e)=>r=>Math.max(Math.min(r,e),t),Ie=t=>t%1?Number(t.toFixed(5)):t,pt=/(-)?([\d]*\.?[\d])+/g,Nr=/(#[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,xa=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function ve(t){return typeof t=="string"}var ht={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},zr=Object.assign(Object.assign({},ht),{transform:Br(0,1)}),x0=Object.assign(Object.assign({},ht),{default:1});var Rt=t=>({test:e=>ve(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),C0=Rt("deg"),ft=Rt("%"),E0=Rt("px"),$0=Rt("vh"),S0=Rt("vw"),I0=Object.assign(Object.assign({},ft),{parse:t=>ft.parse(t)/100,transform:t=>ft.transform(t*100)});var mt=(t,e)=>r=>!!(ve(r)&&xa.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Wr=(t,e,r)=>i=>{if(!ve(i))return i;let[n,s,o,a]=i.match(pt);return{[t]:parseFloat(n),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var pe={test:mt("hsl","hue"),parse:Wr("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:i=1})=>"hsla("+Math.round(t)+", "+ft.transform(Ie(e))+", "+ft.transform(Ie(r))+", "+Ie(zr.transform(i))+")"};var Lu=Br(0,255),Vr=Object.assign(Object.assign({},ht),{transform:t=>Math.round(Lu(t))}),ie={test:mt("rgb","red"),parse:Wr("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:i=1})=>"rgba("+Vr.transform(t)+", "+Vr.transform(e)+", "+Vr.transform(r)+", "+Ie(zr.transform(i))+")"};function ju(t){let e="",r="",i="",n="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),i=t.substr(5,2),n=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),i=t.substr(3,1),n=t.substr(4,1),e+=e,r+=r,i+=i,n+=n),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(i,16),alpha:n?parseInt(n,16)/255:1}}var gt={test:mt("#"),parse:ju,transform:ie.transform};var Ae={test:t=>ie.test(t)||gt.test(t)||pe.test(t),parse:t=>ie.test(t)?ie.parse(t):pe.test(t)?pe.parse(t):gt.parse(t),transform:t=>ve(t)?t:t.hasOwnProperty("red")?ie.transform(t):pe.transform(t)};var ka="${c}",_a="${n}";function Ru(t){var e,r,i,n;return isNaN(t)&&ve(t)&&((r=(e=t.match(pt))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((n=(i=t.match(Nr))===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0)>0}function Ca(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,i=t.match(Nr);i&&(r=i.length,t=t.replace(Nr,ka),e.push(...i.map(Ae.parse)));let n=t.match(pt);return n&&(t=t.replace(pt,_a),e.push(...n.map(ht.parse))),{values:e,numColors:r,tokenised:t}}function Ea(t){return Ca(t).values}function $a(t){let{values:e,numColors:r,tokenised:i}=Ca(t),n=e.length;return s=>{let o=i;for(let a=0;a<n;a++)o=o.replace(a<r?ka:_a,a<r?Ae.transform(s[a]):Ie(s[a]));return o}}var Fu=t=>typeof t=="number"?0:t;function qu(t){let e=Ea(t);return $a(t)(e.map(Fu))}var Hr={test:Ru,parse:Ea,createTransformer:$a,getAnimatableNone:qu};function Ln(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 jn({hue:t,saturation:e,lightness:r,alpha:i}){t/=360,e/=100,r/=100;let n=0,s=0,o=0;if(!e)n=s=o=r;else{let a=r<.5?r*(1+e):r+e-r*e,l=2*r-a;n=Ln(l,a,t+1/3),s=Ln(l,a,t),o=Ln(l,a,t-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}var Bu=(t,e,r)=>{let i=t*t,n=e*e;return Math.sqrt(Math.max(0,r*(n-i)+i))},Nu=[gt,ie,pe],Sa=t=>Nu.find(e=>e.test(t)),Ia=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,Gr=(t,e)=>{let r=Sa(t),i=Sa(e);ut(!!r,Ia(t)),ut(!!i,Ia(e));let n=r.parse(t),s=i.parse(e);r===pe&&(n=jn(n),r=ie),i===pe&&(s=jn(s),i=ie);let o=Object.assign({},n);return a=>{for(let l in o)l!=="alpha"&&(o[l]=Bu(n[l],s[l],a));return o.alpha=dt(n.alpha,s.alpha,a),r.transform(o)}};var Aa=t=>typeof t=="number";var zu=(t,e)=>r=>e(t(r)),Xr=(...t)=>t.reduce(zu);function Da(t,e){return Aa(t)?r=>dt(t,e,r):Ae.test(t)?Gr(t,e):Fn(t,e)}var Rn=(t,e)=>{let r=[...t],i=r.length,n=t.map((s,o)=>Da(s,e[o]));return s=>{for(let o=0;o<i;o++)r[o]=n[o](s);return r}},Ma=(t,e)=>{let r=Object.assign(Object.assign({},t),e),i={};for(let n in r)t[n]!==void 0&&e[n]!==void 0&&(i[n]=Da(t[n],e[n]));return n=>{for(let s in i)r[s]=i[s](n);return r}};function Ta(t){let e=Hr.parse(t),r=e.length,i=0,n=0,s=0;for(let o=0;o<r;o++)i||typeof e[o]=="number"?i++:e[o].hue!==void 0?s++:n++;return{parsed:e,numNumbers:i,numRGB:n,numHSL:s}}var Fn=(t,e)=>{let r=Hr.createTransformer(e),i=Ta(t),n=Ta(e);return i.numHSL===n.numHSL&&i.numRGB===n.numRGB&&i.numNumbers>=n.numNumbers?Xr(Rn(i.parsed,n.parsed),r):(Rr(!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 Wu=(t,e)=>r=>dt(t,e,r);function Vu(t){if(typeof t=="number")return Wu;if(typeof t=="string")return Ae.test(t)?Gr:Fn;if(Array.isArray(t))return Rn;if(typeof t=="object")return Ma}function Hu(t,e,r){let i=[],n=r||Vu(t[0]),s=t.length-1;for(let o=0;o<s;o++){let a=n(t[o],t[o+1]);if(e){let l=Array.isArray(e)?e[o]:e;a=Xr(l,a)}i.push(a)}return i}function Gu([t,e],[r]){return i=>r(Un(t,e,i))}function Xu(t,e){let r=t.length,i=r-1;return n=>{let s=0,o=!1;if(n<=t[0]?o=!0:n>=t[i]&&(s=i-1,o=!0),!o){let l=1;for(;l<r&&!(t[l]>n||l===i);l++);s=l-1}let a=Un(t[s],t[s+1],n);return e[s](a)}}function Jr(t,e,{clamp:r=!0,ease:i,mixer:n}={}){let s=t.length;ut(s===e.length,"Both input and output ranges must be the same length"),ut(!i||!Array.isArray(i)||i.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=Hu(e,i,n),a=s===2?Gu(t,o):Xu(t,o);return r?l=>a(jt(t[0],t[s-1],l)):a}var Ft=t=>e=>1-t(1-e),Kr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Oa=t=>e=>Math.pow(e,t),qn=t=>e=>e*e*((t+1)*e-t),Pa=t=>{let e=qn(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var Ua=1.525,Ju=4/11,Ku=8/11,Yu=9/10;var La=Oa(2),Dy=Ft(La),ja=Kr(La),Qu=t=>1-Math.sin(Math.acos(t)),Zu=Ft(Qu),My=Kr(Zu),Ra=qn(Ua),Oy=Ft(Ra),Py=Kr(Ra),Uy=Pa(Ua),ed=4356/361,td=35442/1805,rd=16061/1805,id=t=>{if(t===1||t===0)return t;let e=t*t;return t<Ju?7.5625*e:t<Ku?9.075*e-9.9*t+3.4:t<Yu?ed*e-td*t+rd:10.8*t*t-20.52*t+10.72},Ly=Ft(id);function nd(t,e){return t.map(()=>e||ja).splice(0,t.length-1)}function sd(t){let e=t.length;return t.map((r,i)=>i!==0?i/(e-1):0)}function od(t,e){return t.map(r=>r*e)}function qt({from:t=0,to:e=1,ease:r,offset:i,duration:n=300}){let s={done:!1,value:t},o=Array.isArray(e)?e:[t,e],a=od(i&&i.length===o.length?i:sd(o),n);function l(){return Jr(a,o,{ease:Array.isArray(r)?r:nd(o,r)})}let c=l();return{next:d=>(s.value=c(d),s.done=d>=n,s),flipTarget:()=>{o.reverse(),c=l()}}}function Fa({velocity:t=0,from:e=0,power:r=.8,timeConstant:i=350,restDelta:n=.5,modifyTarget:s}){let o={done:!1,value:e},a=r*t,l=e+a,c=s===void 0?l:s(l);return c!==l&&(a=c-e),{next:d=>{let p=-a*Math.exp(-d/i);return o.done=!(p>n||p<-n),o.value=o.done?c:c+p,o},flipTarget:()=>{}}}var qa={keyframes:qt,spring:qr,decay:Fa};function Ba(t){if(Array.isArray(t.to))return qt;if(qa[t.type])return qa[t.type];let e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?qt:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?qr:qt}var Bn=16.666666666666668,ad=typeof performance<"u"?()=>performance.now():()=>Date.now(),Nn=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(ad()),Bn);function Na(t){let e=[],r=[],i=0,n=!1,s=!1,o=new WeakSet,a={schedule:(l,c=!1,d=!1)=>{let p=d&&n,h=p?e:r;return c&&o.add(l),h.indexOf(l)===-1&&(h.push(l),p&&n&&(i=e.length)),l},cancel:l=>{let c=r.indexOf(l);c!==-1&&r.splice(c,1),o.delete(l)},process:l=>{if(n){s=!0;return}if(n=!0,[e,r]=[r,e],r.length=0,i=e.length,i)for(let c=0;c<i;c++){let d=e[c];d(l),o.has(d)&&(a.schedule(d),t())}n=!1,s&&(s=!1,a.process(l))}};return a}var ld=40,zn=!0,Nt=!1,Wn=!1,Bt={delta:0,timestamp:0},zt=["read","update","preRender","render","postRender"],Yr=zt.reduce((t,e)=>(t[e]=Na(()=>Nt=!0),t),{}),cd=zt.reduce((t,e)=>{let r=Yr[e];return t[e]=(i,n=!1,s=!1)=>(Nt||dd(),r.schedule(i,n,s)),t},{}),za=zt.reduce((t,e)=>(t[e]=Yr[e].cancel,t),{}),Ky=zt.reduce((t,e)=>(t[e]=()=>Yr[e].process(Bt),t),{}),ud=t=>Yr[t].process(Bt),Wa=t=>{Nt=!1,Bt.delta=zn?Bn:Math.max(Math.min(t-Bt.timestamp,ld),1),Bt.timestamp=t,Wn=!0,zt.forEach(ud),Wn=!1,Nt&&(zn=!1,Nn(Wa))},dd=()=>{Nt=!0,zn=!0,Wn||Nn(Wa)};var Va=cd;function Vn(t,e,r=0){return t-e-r}function Ha(t,e,r=0,i=!0){return i?Vn(e+-t,e,r):e-(t-e)+r}function Ga(t,e,r,i){return i?t>=e+r:t<=-r}var pd=t=>{let e=({delta:r})=>t(r);return{start:()=>Va.update(e,!0),stop:()=>za.update(e)}};function Hn(t){var e,r,{from:i,autoplay:n=!0,driver:s=pd,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:d,onStop:p,onComplete:h,onRepeat:y,onUpdate:f}=t,$=jr(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:x}=$,E,b=0,k=$.duration,S,P=!1,R=!0,z,T=Ba($);!((r=(e=T).needsInterpolation)===null||r===void 0)&&r.call(e,i,x)&&(z=Jr([0,100],[i,x],{clamp:!1}),i=0,x=100);let W=T(Object.assign(Object.assign({},$),{from:i,to:x}));function K(){b++,l==="reverse"?(R=b%2===0,o=Ha(o,k,c,R)):(o=Vn(o,k,c),l==="mirror"&&W.flipTarget()),P=!1,y&&y()}function di(){E.stop(),h&&h()}function Te(L){if(R||(L=-L),o+=L,!P){let V=W.next(Math.max(0,o));S=V.value,z&&(S=z(S)),P=R?V.done:o<=0}f?.(S),P&&(b===0&&(k??(k=o)),b<a?Ga(o,k,c,R)&&K():di())}function Qt(){d?.(),E=s(Te),E.start()}return n&&Qt(),{stop:()=>{p?.(),E.stop()}}}var ze=class t extends w(v){static properties={product:{type:Object},labels:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}};constructor(){super(),this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this.darkMode=!1,this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(e){e.has("product")&&this.#e()}#e(){if(!this.product?.url){this._isValidUrl=!1;return}try{let e=new URL(this.product.url);this._isValidUrl=e.protocol==="http:"||e.protocol==="https:"}catch{this._isValidUrl=!1}}get images(){return this.product?.images||[]}render(){if(!this.product)return u`
980
+ `}};customElements.get("mw-order-card")||customElements.define("mw-order-card",Bn);function Vr(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}var Hr=function(){},ht=function(){};var Nt=(t,e,r)=>Math.min(Math.max(r,t),e);var Nn=.001,Bu=.01,$a=10,Nu=.05,zu=1;function Ia({duration:t=800,bounce:e=.25,velocity:r=0,mass:i=1}){let n,s;Hr(t<=$a*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=Nt(Nu,zu,o),t=Nt(Bu,$a,t/1e3),o<1?(n=c=>{let d=c*o,p=d*t,h=d-r,m=Gr(c,o),f=Math.exp(-p);return Nn-h/m*f},s=c=>{let p=c*o*t,h=p*r+r,m=Math.pow(o,2)*Math.pow(c,2)*t,f=Math.exp(-p),E=Gr(Math.pow(c,2),o);return(-n(c)+Nn>0?-1:1)*((h-m)*f)/E}):(n=c=>{let d=Math.exp(-c*t),p=(c-r)*t+1;return-Nn+d*p},s=c=>{let d=Math.exp(-c*t),p=(r-c)*(t*t);return d*p});let a=5/t,l=Vu(n,s,a);if(t=t*1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{let c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:t}}}var Wu=12;function Vu(t,e,r){let i=r;for(let n=1;n<Wu;n++)i=i-t(i)/e(i);return i}function Gr(t,e){return t*Math.sqrt(1-e*e)}var Hu=["duration","bounce"],Gu=["stiffness","damping","mass"];function Aa(t,e){return e.some(r=>t[r]!==void 0)}function Ju(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Aa(t,Gu)&&Aa(t,Hu)){let r=Ia(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Jr(t){var{from:e=0,to:r=1,restSpeed:i=2,restDelta:n}=t,s=Vr(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:a,damping:l,mass:c,velocity:d,duration:p,isResolvedFromDuration:h}=Ju(s),m=Ta,f=Ta;function E(){let x=d?-(d/1e3):0,S=r-e,b=l/(2*Math.sqrt(a*c)),k=Math.sqrt(a/c)/1e3;if(n===void 0&&(n=Math.min(Math.abs(r-e)/100,.4)),b<1){let $=Gr(k,b);m=P=>{let F=Math.exp(-b*k*P);return r-F*((x+b*k*S)/$*Math.sin($*P)+S*Math.cos($*P))},f=P=>{let F=Math.exp(-b*k*P);return b*k*F*(Math.sin($*P)*(x+b*k*S)/$+S*Math.cos($*P))-F*(Math.cos($*P)*(x+b*k*S)-$*S*Math.sin($*P))}}else if(b===1)m=$=>r-Math.exp(-k*$)*(S+(x+k*S)*$);else{let $=k*Math.sqrt(b*b-1);m=P=>{let F=Math.exp(-b*k*P),W=Math.min($*P,300);return r-F*((x+b*k*S)*Math.sinh(W)+$*S*Math.cosh(W))/$}}}return E(),{next:x=>{let S=m(x);if(h)o.done=x>=p;else{let b=f(x)*1e3,k=Math.abs(b)<=i,$=Math.abs(r-S)<=n;o.done=k&&$}return o.value=o.done?r:S,o},flipTarget:()=>{d=-d,[e,r]=[r,e],E()}}}Jr.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var Ta=t=>0;var zn=(t,e,r)=>{let i=e-t;return i===0?1:(r-t)/i};var ft=(t,e,r)=>-r*t+r*e+t;var Xr=(t,e)=>r=>Math.max(Math.min(r,e),t),Ae=t=>t%1?Number(t.toFixed(5)):t,mt=/(-)?([\d]*\.?[\d])+/g,Yr=/(#[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,Ma=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function we(t){return typeof t=="string"}var gt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Kr=Object.assign(Object.assign({},gt),{transform:Xr(0,1)}),ay=Object.assign(Object.assign({},gt),{default:1});var zt=t=>({test:e=>we(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),uy=zt("deg"),yt=zt("%"),dy=zt("px"),py=zt("vh"),hy=zt("vw"),fy=Object.assign(Object.assign({},yt),{parse:t=>yt.parse(t)/100,transform:t=>yt.transform(t*100)});var bt=(t,e)=>r=>!!(we(r)&&Ma.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Qr=(t,e,r)=>i=>{if(!we(i))return i;let[n,s,o,a]=i.match(mt);return{[t]:parseFloat(n),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var he={test:bt("hsl","hue"),parse:Qr("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:i=1})=>"hsla("+Math.round(t)+", "+yt.transform(Ae(e))+", "+yt.transform(Ae(r))+", "+Ae(Kr.transform(i))+")"};var Xu=Xr(0,255),Zr=Object.assign(Object.assign({},gt),{transform:t=>Math.round(Xu(t))}),ne={test:bt("rgb","red"),parse:Qr("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:i=1})=>"rgba("+Zr.transform(t)+", "+Zr.transform(e)+", "+Zr.transform(r)+", "+Ae(Kr.transform(i))+")"};function Yu(t){let e="",r="",i="",n="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),i=t.substr(5,2),n=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),i=t.substr(3,1),n=t.substr(4,1),e+=e,r+=r,i+=i,n+=n),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(i,16),alpha:n?parseInt(n,16)/255:1}}var vt={test:bt("#"),parse:Yu,transform:ne.transform};var Te={test:t=>ne.test(t)||vt.test(t)||he.test(t),parse:t=>ne.test(t)?ne.parse(t):he.test(t)?he.parse(t):vt.parse(t),transform:t=>we(t)?t:t.hasOwnProperty("red")?ne.transform(t):he.transform(t)};var Da="${c}",Oa="${n}";function Ku(t){var e,r,i,n;return isNaN(t)&&we(t)&&((r=(e=t.match(mt))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((n=(i=t.match(Yr))===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0)>0}function Pa(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,i=t.match(Yr);i&&(r=i.length,t=t.replace(Yr,Da),e.push(...i.map(Te.parse)));let n=t.match(mt);return n&&(t=t.replace(mt,Oa),e.push(...n.map(gt.parse))),{values:e,numColors:r,tokenised:t}}function Ra(t){return Pa(t).values}function Ua(t){let{values:e,numColors:r,tokenised:i}=Pa(t),n=e.length;return s=>{let o=i;for(let a=0;a<n;a++)o=o.replace(a<r?Da:Oa,a<r?Te.transform(s[a]):Ae(s[a]));return o}}var Qu=t=>typeof t=="number"?0:t;function Zu(t){let e=Ra(t);return Ua(t)(e.map(Qu))}var ei={test:Ku,parse:Ra,createTransformer:Ua,getAnimatableNone:Zu};function Wn(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 Vn({hue:t,saturation:e,lightness:r,alpha:i}){t/=360,e/=100,r/=100;let n=0,s=0,o=0;if(!e)n=s=o=r;else{let a=r<.5?r*(1+e):r+e-r*e,l=2*r-a;n=Wn(l,a,t+1/3),s=Wn(l,a,t),o=Wn(l,a,t-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}var ed=(t,e,r)=>{let i=t*t,n=e*e;return Math.sqrt(Math.max(0,r*(n-i)+i))},td=[vt,ne,he],La=t=>td.find(e=>e.test(t)),ja=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,ti=(t,e)=>{let r=La(t),i=La(e);ht(!!r,ja(t)),ht(!!i,ja(e));let n=r.parse(t),s=i.parse(e);r===he&&(n=Vn(n),r=ne),i===he&&(s=Vn(s),i=ne);let o=Object.assign({},n);return a=>{for(let l in o)l!=="alpha"&&(o[l]=ed(n[l],s[l],a));return o.alpha=ft(n.alpha,s.alpha,a),r.transform(o)}};var Fa=t=>typeof t=="number";var rd=(t,e)=>r=>e(t(r)),ri=(...t)=>t.reduce(rd);function Ba(t,e){return Fa(t)?r=>ft(t,e,r):Te.test(t)?ti(t,e):Gn(t,e)}var Hn=(t,e)=>{let r=[...t],i=r.length,n=t.map((s,o)=>Ba(s,e[o]));return s=>{for(let o=0;o<i;o++)r[o]=n[o](s);return r}},Na=(t,e)=>{let r=Object.assign(Object.assign({},t),e),i={};for(let n in r)t[n]!==void 0&&e[n]!==void 0&&(i[n]=Ba(t[n],e[n]));return n=>{for(let s in i)r[s]=i[s](n);return r}};function qa(t){let e=ei.parse(t),r=e.length,i=0,n=0,s=0;for(let o=0;o<r;o++)i||typeof e[o]=="number"?i++:e[o].hue!==void 0?s++:n++;return{parsed:e,numNumbers:i,numRGB:n,numHSL:s}}var Gn=(t,e)=>{let r=ei.createTransformer(e),i=qa(t),n=qa(e);return i.numHSL===n.numHSL&&i.numRGB===n.numRGB&&i.numNumbers>=n.numNumbers?ri(Hn(i.parsed,n.parsed),r):(Hr(!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 id=(t,e)=>r=>ft(t,e,r);function nd(t){if(typeof t=="number")return id;if(typeof t=="string")return Te.test(t)?ti:Gn;if(Array.isArray(t))return Hn;if(typeof t=="object")return Na}function sd(t,e,r){let i=[],n=r||nd(t[0]),s=t.length-1;for(let o=0;o<s;o++){let a=n(t[o],t[o+1]);if(e){let l=Array.isArray(e)?e[o]:e;a=ri(l,a)}i.push(a)}return i}function od([t,e],[r]){return i=>r(zn(t,e,i))}function ad(t,e){let r=t.length,i=r-1;return n=>{let s=0,o=!1;if(n<=t[0]?o=!0:n>=t[i]&&(s=i-1,o=!0),!o){let l=1;for(;l<r&&!(t[l]>n||l===i);l++);s=l-1}let a=zn(t[s],t[s+1],n);return e[s](a)}}function ii(t,e,{clamp:r=!0,ease:i,mixer:n}={}){let s=t.length;ht(s===e.length,"Both input and output ranges must be the same length"),ht(!i||!Array.isArray(i)||i.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=sd(e,i,n),a=s===2?od(t,o):ad(t,o);return r?l=>a(Nt(t[0],t[s-1],l)):a}var Wt=t=>e=>1-t(1-e),ni=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,za=t=>e=>Math.pow(e,t),Jn=t=>e=>e*e*((t+1)*e-t),Wa=t=>{let e=Jn(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var Va=1.525,ld=4/11,cd=8/11,ud=9/10;var Ha=za(2),yb=Wt(Ha),Ga=ni(Ha),dd=t=>1-Math.sin(Math.acos(t)),pd=Wt(dd),bb=ni(pd),Ja=Jn(Va),vb=Wt(Ja),wb=ni(Ja),xb=Wa(Va),hd=4356/361,fd=35442/1805,md=16061/1805,gd=t=>{if(t===1||t===0)return t;let e=t*t;return t<ld?7.5625*e:t<cd?9.075*e-9.9*t+3.4:t<ud?hd*e-fd*t+md:10.8*t*t-20.52*t+10.72},kb=Wt(gd);function yd(t,e){return t.map(()=>e||Ga).splice(0,t.length-1)}function bd(t){let e=t.length;return t.map((r,i)=>i!==0?i/(e-1):0)}function vd(t,e){return t.map(r=>r*e)}function Vt({from:t=0,to:e=1,ease:r,offset:i,duration:n=300}){let s={done:!1,value:t},o=Array.isArray(e)?e:[t,e],a=vd(i&&i.length===o.length?i:bd(o),n);function l(){return ii(a,o,{ease:Array.isArray(r)?r:yd(o,r)})}let c=l();return{next:d=>(s.value=c(d),s.done=d>=n,s),flipTarget:()=>{o.reverse(),c=l()}}}function Xa({velocity:t=0,from:e=0,power:r=.8,timeConstant:i=350,restDelta:n=.5,modifyTarget:s}){let o={done:!1,value:e},a=r*t,l=e+a,c=s===void 0?l:s(l);return c!==l&&(a=c-e),{next:d=>{let p=-a*Math.exp(-d/i);return o.done=!(p>n||p<-n),o.value=o.done?c:c+p,o},flipTarget:()=>{}}}var Ya={keyframes:Vt,spring:Jr,decay:Xa};function Ka(t){if(Array.isArray(t.to))return Vt;if(Ya[t.type])return Ya[t.type];let e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Vt:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Jr:Vt}var Xn=16.666666666666668,wd=typeof performance<"u"?()=>performance.now():()=>Date.now(),Yn=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(wd()),Xn);function Qa(t){let e=[],r=[],i=0,n=!1,s=!1,o=new WeakSet,a={schedule:(l,c=!1,d=!1)=>{let p=d&&n,h=p?e:r;return c&&o.add(l),h.indexOf(l)===-1&&(h.push(l),p&&n&&(i=e.length)),l},cancel:l=>{let c=r.indexOf(l);c!==-1&&r.splice(c,1),o.delete(l)},process:l=>{if(n){s=!0;return}if(n=!0,[e,r]=[r,e],r.length=0,i=e.length,i)for(let c=0;c<i;c++){let d=e[c];d(l),o.has(d)&&(a.schedule(d),t())}n=!1,s&&(s=!1,a.process(l))}};return a}var xd=40,Kn=!0,Gt=!1,Qn=!1,Ht={delta:0,timestamp:0},Jt=["read","update","preRender","render","postRender"],si=Jt.reduce((t,e)=>(t[e]=Qa(()=>Gt=!0),t),{}),kd=Jt.reduce((t,e)=>{let r=si[e];return t[e]=(i,n=!1,s=!1)=>(Gt||Cd(),r.schedule(i,n,s)),t},{}),Za=Jt.reduce((t,e)=>(t[e]=si[e].cancel,t),{}),Ub=Jt.reduce((t,e)=>(t[e]=()=>si[e].process(Ht),t),{}),_d=t=>si[t].process(Ht),el=t=>{Gt=!1,Ht.delta=Kn?Xn:Math.max(Math.min(t-Ht.timestamp,xd),1),Ht.timestamp=t,Qn=!0,Jt.forEach(_d),Qn=!1,Gt&&(Kn=!1,Yn(el))},Cd=()=>{Gt=!0,Kn=!0,Qn||Yn(el)};var tl=kd;function Zn(t,e,r=0){return t-e-r}function rl(t,e,r=0,i=!0){return i?Zn(e+-t,e,r):e-(t-e)+r}function il(t,e,r,i){return i?t>=e+r:t<=-r}var Ed=t=>{let e=({delta:r})=>t(r);return{start:()=>tl.update(e,!0),stop:()=>Za.update(e)}};function es(t){var e,r,{from:i,autoplay:n=!0,driver:s=Ed,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:d,onStop:p,onComplete:h,onRepeat:m,onUpdate:f}=t,E=Vr(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:x}=E,S,b=0,k=E.duration,$,P=!1,F=!0,W,T=Ka(E);!((r=(e=T).needsInterpolation)===null||r===void 0)&&r.call(e,i,x)&&(W=ii([0,100],[i,x],{clamp:!1}),i=0,x=100);let V=T(Object.assign(Object.assign({},E),{from:i,to:x}));function Y(){b++,l==="reverse"?(F=b%2===0,o=rl(o,k,c,F)):(o=Zn(o,k,c),l==="mirror"&&V.flipTarget()),P=!1,m&&m()}function bi(){S.stop(),h&&h()}function Me(U){if(F||(U=-U),o+=U,!P){let H=V.next(Math.max(0,o));$=H.value,W&&($=W($)),P=F?H.done:o<=0}f?.($),P&&(b===0&&(k??(k=o)),b<a?il(o,k,c,F)&&Y():bi())}function ir(){d?.(),S=s(Me),S.start()}return n&&ir(),{stop:()=>{p?.(),S.stop()}}}var Ve=class t extends w(v){static properties={product:{type:Object},labels:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}};constructor(){super(),this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this.darkMode=!1,this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(e){e.has("product")&&this.#e()}#e(){if(!this.product?.url){this._isValidUrl=!1;return}try{let e=new URL(this.product.url);this._isValidUrl=e.protocol==="http:"||e.protocol==="https:"}catch{this._isValidUrl=!1}}get images(){return this.product?.images||[]}render(){if(!this.product)return u`
898
981
  <div class="${this.darkMode?"dark border-gray-600 bg-[#1E1F23]":"border-[#5e5d59]/25 bg-white"} my-2 w-full rounded-3xl border p-4">
899
982
  <div class="relative mx-auto mb-4 max-w-[240px]">
900
983
  <div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200 dark:bg-gray-700"></div>
@@ -941,7 +1024,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
941
1024
  <mw-icon class="block h-6 w-3" name="lucide:chevron-left"></mw-icon>
942
1025
  </button>
943
1026
  <button
944
- @click="${this.#i}"
1027
+ @click="${this.#n}"
945
1028
  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 dark:bg-gray-700">
946
1029
  <mw-icon class="block h-6 w-3" name="lucide:chevron-right"></mw-icon>
947
1030
  </button>
@@ -951,7 +1034,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
951
1034
  <div class="slider-dots absolute bottom-3 left-1/2 flex -translate-x-1/2 gap-2">
952
1035
  ${this.images.map((s,o)=>u`
953
1036
  <button
954
- @click="${()=>this.#o(o)}"
1037
+ @click="${()=>this.#a(o)}"
955
1038
  class="${o===this._currentImageIndex?"bg-opacity-100":"bg-opacity-60"} hover:bg-opacity-80 h-1.5 w-1.5 rounded-full bg-white transition-all dark:bg-gray-400"></button>
956
1039
  `)}
957
1040
  </div>
@@ -983,10 +1066,10 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
983
1066
  </button> -->
984
1067
  </div>
985
1068
  </div>
986
- `}#t(e){e.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")}#r(e){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new t.AddToCartEvent(this.product)))}#n(e,r){this.#a&&Hn({from:e,to:r,duration:300,onUpdate:i=>{this.#a&&(this.#a.style.transform=`translateX(${i}%)`)}})}#i(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e+1)%this.product.images.length,i=-(e*100),n=-(r*100);this.#n(i,n),this._currentImageIndex=r}#s(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e-1+this.product.images.length)%this.product.images.length,i=-(e*100),n=-(r*100);this.#n(i,n),this._currentImageIndex=r}#o(e){if(!this.product?.images?.length)return;let r=this._currentImageIndex,i=Math.max(0,Math.min(e,this.product.images.length-1)),n=-(r*100),s=-(i*100);this.#n(n,s),this._currentImageIndex=i}get#a(){return this.renderRoot.querySelector(".image-slider")}};ze.AddToCartEvent=class extends CustomEvent{static type="mw-product-card:add-to-cart";constructor(e,r={}){super(ze.AddToCartEvent.type,{detail:{product:e},...r})}};customElements.get("mw-product-card")||customElements.define("mw-product-card",ze);var Gn=class{#e;isLoading=!0;hasError=!1;isLoaded=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){}hostDisconnected(){}handleLoad=()=>{this.isLoading=!1,this.isLoaded=!0,this.hasError=!1,this.#e.requestUpdate()};handleError=()=>{this.isLoading=!1,this.hasError=!0,this.isLoaded=!1,this.#e.requestUpdate()}};function Xa(t){return new Gn(t)}var Wt=class extends w(v){static properties={product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"}};#e=Xa(this);constructor(){super(),this.product=void 0,this.streaming=!1,this.linksNewTab=!1,this.searchParams=void 0,this.imagesByProductUrl={},this.darkMode=!1}get trackedProductUrl(){let e=this.product?.url,r=this.searchParams;try{if(e&&r)return Js(e,r).href}catch{}return e}render(){let{name:e,description:r,price:i,url:n}=this.product||{},s=n?this.imagesByProductUrl?.[n]:void 0;return u`
1069
+ `}#t(e){e.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")}#r(e){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new t.AddToCartEvent(this.product)))}#i(e,r){this.#o&&es({from:e,to:r,duration:300,onUpdate:i=>{this.#o&&(this.#o.style.transform=`translateX(${i}%)`)}})}#n(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e+1)%this.product.images.length,i=-(e*100),n=-(r*100);this.#i(i,n),this._currentImageIndex=r}#s(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e-1+this.product.images.length)%this.product.images.length,i=-(e*100),n=-(r*100);this.#i(i,n),this._currentImageIndex=r}#a(e){if(!this.product?.images?.length)return;let r=this._currentImageIndex,i=Math.max(0,Math.min(e,this.product.images.length-1)),n=-(r*100),s=-(i*100);this.#i(n,s),this._currentImageIndex=i}get#o(){return this.renderRoot.querySelector(".image-slider")}};Ve.AddToCartEvent=class extends CustomEvent{static type="mw-product-card:add-to-cart";constructor(e,r={}){super(Ve.AddToCartEvent.type,{detail:{product:e},...r})}};customElements.get("mw-product-card")||customElements.define("mw-product-card",Ve);var ts=class{#e;isLoading=!0;hasError=!1;isLoaded=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){}hostDisconnected(){}handleLoad=()=>{this.isLoading=!1,this.isLoaded=!0,this.hasError=!1,this.#e.requestUpdate()};handleError=()=>{this.isLoading=!1,this.hasError=!0,this.isLoaded=!1,this.#e.requestUpdate()}};function nl(t){return new ts(t)}var Xt=class extends w(v){static properties={product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"}};#e=nl(this);constructor(){super(),this.product=void 0,this.streaming=!1,this.linksNewTab=!1,this.searchParams=void 0,this.imagesByProductUrl={},this.darkMode=!1}get trackedProductUrl(){let e=this.product?.url,r=this.searchParams;try{if(e&&r)return ro(e,r).href}catch{}return e}render(){let{name:e,description:r,price:i,url:n}=this.product||{},s=n?this.imagesByProductUrl?.[n]:void 0;return u`
987
1070
  <a
988
- href="${N(this.trackedProductUrl)}"
989
- title="${N(e)}"
1071
+ href="${z(this.trackedProductUrl)}"
1072
+ title="${z(e)}"
990
1073
  class="${this.darkMode?"dark":""} group flex w-full max-w-md cursor-pointer gap-2.5 overflow-hidden rounded-lg"
991
1074
  target="${this.linksNewTab?"_blank":"_self"}"
992
1075
  ?disabled="${this.streaming}">
@@ -1029,7 +1112,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1029
1112
  ${i||!this.streaming?u`<span class="text-xs text-gray-900 dark:text-white">${i}</span>`:u`<div class="h-4 w-14 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></div>`}
1030
1113
  </div>
1031
1114
  </a>
1032
- `}};customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",Wt);function Qr(t){return Array.isArray(t)?t:t?[t]:[]}function Ja(t,e){let r=new Map;for(let i of t){let n=e(i),s=r.get(n);s?s.push(i):r.set(n,[i])}return r}var Xn=class extends w(v){static properties={orderDetails:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1,this.color="#601feb",this.darkMode=!1}render(){let e=Qr(this.orderDetails?.order_status?.step||[]),r=Qr(this.orderDetails?.items?.item||[]),i=Qr(this.orderDetails?.actions||[]);return u`
1115
+ `}};customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",Xt);function oi(t){return Array.isArray(t)?t:t?[t]:[]}function sl(t,e){let r=new Map;for(let i of t){let n=e(i),s=r.get(n);s?s.push(i):r.set(n,[i])}return r}var rs=class extends w(v){static properties={orderDetails:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1,this.color="#601feb",this.darkMode=!1}render(){let e=oi(this.orderDetails?.order_status?.step||[]),r=oi(this.orderDetails?.items?.item||[]),i=oi(this.orderDetails?.actions||[]);return u`
1033
1116
  <div class="${this.darkMode?"dark border-white/10 bg-[#1E1F23]":"border-gray-200 bg-white"} flex w-full max-w-md flex-col rounded-3xl border p-4">
1034
1117
  <!-- Header with order ID -->
1035
1118
  <div class="mb-2">
@@ -1059,7 +1142,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1059
1142
  ${l?"":u`<div class="${`absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 ${o?`bg-[${this.color}]`:"bg-gray-300 dark:bg-gray-600"}`}" aria-hidden="true"></div>`}
1060
1143
 
1061
1144
  <div class="group relative flex items-start">
1062
- ${ct(n.status,[["pending",()=>u`
1145
+ ${pt(n.status,[["pending",()=>u`
1063
1146
  <span class="flex h-6 items-center">
1064
1147
  <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-gray-300 bg-white dark:border-gray-500 dark:bg-[#1E1F23]">
1065
1148
  <span class="h-1.5 w-1.5 rounded-full bg-transparent"></span>
@@ -1128,7 +1211,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1128
1211
  `)}
1129
1212
  `:r?.map(n=>{let s=n?.image_url;return u`
1130
1213
  <div class="flex items-center gap-2 py-1.5">
1131
- <img src="${N(s)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
1214
+ <img src="${z(s)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
1132
1215
 
1133
1216
  <div class="min-w-0 flex-1">
1134
1217
  ${!n?.name&&this.streaming?u`<div class="h-4 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`:u`<h3 class="truncate text-sm font-medium text-gray-900 dark:text-gray-100">${n?.name}</h3>`}
@@ -1211,11 +1294,11 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1211
1294
 
1212
1295
  <!-- Action buttons section -->
1213
1296
  <div class="flex w-full flex-col gap-2 overflow-hidden">
1214
- ${this.streaming&&!i[0]?.track_order?.label&&!tt(i[0]?.track_order?.tracking_url||"")?u`
1297
+ ${this.streaming&&!i[0]?.track_order?.label&&!it(i[0]?.track_order?.tracking_url||"")?u`
1215
1298
  <!-- Loading shimmer for buttons -->
1216
1299
  <div class="h-10 w-full min-w-[250px] animate-pulse overflow-hidden rounded-xl bg-gray-200 dark:bg-gray-600"></div>
1217
1300
  `:X(i,(n,s)=>`action-${s}`,n=>{if(n?.track_order?.label)return u`
1218
- ${tt(n.track_order?.tracking_url||"")?u` <a
1301
+ ${it(n.track_order?.tracking_url||"")?u` <a
1219
1302
  target="${this.linksNewTab?"_blank":"_self"}"
1220
1303
  href="${n.track_order?.tracking_url}"
1221
1304
  class="mt-1 w-full rounded-xl bg-[${this.color}] px-4 py-2 text-center text-sm font-medium text-white hover:opacity-90 dark:text-black"
@@ -1224,11 +1307,11 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1224
1307
  `})}
1225
1308
  </div>
1226
1309
  </div>
1227
- `}};customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",Xn);var Vt=class t extends w(v){static properties={heading:{type:String},type:{type:String,reflect:!0},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},_hoverRating:{type:Number,state:!0},_selectedRating:{type:Number,state:!0},_selectedVote:{type:String,state:!0}};constructor(){super(),this.heading="",this.type="star-rating",this.color="#8B5CF6",this.darkMode=!1,this._hoverRating=0,this._selectedRating=0,this._selectedVote=""}updated(e){(e.has("type")||e.has("heading"))&&(this._selectedRating=0,this._selectedVote="",this._hoverRating=0)}render(){return u`
1310
+ `}};customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",rs);var Yt=class t extends w(v){static properties={heading:{type:String},type:{type:String,reflect:!0},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},_hoverRating:{type:Number,state:!0},_selectedRating:{type:Number,state:!0},_selectedVote:{type:String,state:!0}};constructor(){super(),this.heading="",this.type="star-rating",this.color="#8B5CF6",this.darkMode=!1,this._hoverRating=0,this._selectedRating=0,this._selectedVote=""}updated(e){(e.has("type")||e.has("heading"))&&(this._selectedRating=0,this._selectedVote="",this._hoverRating=0)}render(){return u`
1228
1311
  <div
1229
1312
  class="${this.darkMode?"dark bg-[#1E1F23]":"bg-white"} focus-within:ring-opacity-50 w-full overflow-hidden rounded-[18px] shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)] transition-all duration-200 focus-within:ring-2 focus-within:ring-[${this.color}]">
1230
1313
  <div class="flex flex-col gap-2 p-4">
1231
- ${ct(this.type,[["star-rating",()=>this.#t()],["binary-vote",()=>this.#r()],["new-conversation-button",()=>this.#e()]],()=>u`<span class="text-sm text-gray-500">Unsupported input type</span>`)}
1314
+ ${pt(this.type,[["star-rating",()=>this.#t()],["binary-vote",()=>this.#r()],["new-conversation-button",()=>this.#e()]],()=>u`<span class="text-sm text-gray-500">Unsupported input type</span>`)}
1232
1315
  </div>
1233
1316
  </div>
1234
1317
  `}#e(){return u`
@@ -1247,12 +1330,12 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1247
1330
  <button
1248
1331
  type="button"
1249
1332
  ?disabled="${this._selectedRating>0}"
1250
- @click="${()=>this.#i(e)}"
1333
+ @click="${()=>this.#n(e)}"
1251
1334
  @mouseenter="${()=>this.#s(e)}"
1252
- @mouseleave="${this.#o}"
1335
+ @mouseleave="${this.#a}"
1253
1336
  class="p-1 transition-transform hover:scale-110 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:scale-100"
1254
1337
  aria-label="${e} star${e>1?"s":""}">
1255
- ${this.#n(e)}
1338
+ ${this.#i(e)}
1256
1339
  </button>
1257
1340
  `)}
1258
1341
  </div>
@@ -1262,25 +1345,25 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1262
1345
  <button
1263
1346
  type="button"
1264
1347
  ?disabled="${this._selectedVote!==""}"
1265
- @click="${()=>this.#a("negative")}"
1348
+ @click="${()=>this.#o("negative")}"
1266
1349
  class="${e?"border-red-400 bg-red-50 dark:bg-red-900/20":"border-gray-300 hover:border-red-400 dark:border-gray-600"} flex flex-col items-center gap-1 rounded-lg border-2 p-1 transition-all disabled:cursor-not-allowed disabled:opacity-50">
1267
1350
  <mw-icon class="${e?"text-red-500":"text-gray-400 dark:text-gray-300"} h-6 w-6" name="lucide:thumbs-down"></mw-icon>
1268
1351
  </button>
1269
1352
  <button
1270
1353
  type="button"
1271
1354
  ?disabled="${this._selectedVote!==""}"
1272
- @click="${()=>this.#a("positive")}"
1355
+ @click="${()=>this.#o("positive")}"
1273
1356
  class="${r?"border-green-400 bg-green-50 dark:bg-green-900/20":"border-gray-300 hover:border-green-400 dark:border-gray-600"} flex flex-col items-center gap-1 rounded-lg border-2 p-1 transition-all disabled:cursor-not-allowed disabled:opacity-50">
1274
1357
  <mw-icon class="${r?"text-green-500":"text-gray-400 dark:text-gray-300"} h-6 w-6" name="lucide:thumbs-up"></mw-icon>
1275
1358
  </button>
1276
1359
  </div>
1277
- `}#n(e){let r=this._selectedRating>0?this._selectedRating:this._hoverRating,i=e<=r;return u`<mw-icon class="${i?"text-yellow-400":"text-gray-300"} h-6 w-6" name="lucide:star" ?fill="${i}"></mw-icon>`}#i(e){this._selectedRating>0||(this._selectedRating=e,this._hoverRating=0,this.dispatchEvent(new t.SubmitEvent({type:"star-rating",rating:e})))}#s(e){this._selectedRating>0||(this._hoverRating=e)}#o(){this._selectedRating>0||(this._hoverRating=0)}#a(e){this._selectedVote||(this._selectedVote=e,this.dispatchEvent(new t.SubmitEvent({type:"binary-vote",vote:e})))}};Vt.SubmitEvent=class extends CustomEvent{static type="mw-request-input:submit";constructor(e,r={}){super(Vt.SubmitEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-request-input")||customElements.define("mw-request-input",Vt);var Jn=class{#e;#t=0;#r;#n;#i;#s;#o=0;#a;constructor(e,{duration:r,initial:i,easing:n,onFrame:s,onComplete:o}){this.#a=i,this.#t=typeof r=="function"?0:r,this.#r=typeof r=="function"?r:void 0,this.#n=n??(a=>a),this.#i=s,this.#s=o,e.addController(this)}start(e){this.cancel(),this.#a=e,this.#r&&(this.#t=this.#r(e)),this.#o=performance.now(),this.#e=requestAnimationFrame(this.#l)}cancel(){this.#e!==void 0&&(cancelAnimationFrame(this.#e),this.#e=void 0)}get running(){return this.#e!==void 0}#l=e=>{let r=Math.min((e-this.#o)/this.#t,1),i=this.#n(r);this.#i(i,this.#a),r<1?this.#e=requestAnimationFrame(this.#l):(this.#e=void 0,this.#s?.(this.#a))};hostDisconnected(){this.cancel()}};function Ka(t,e){return new Jn(t,e)}var Kn=class extends w(v){static properties={text:{type:String},speed:{type:Number},spotlightWidth:{type:Number},loop:{type:Boolean},delay:{type:Number},textColor:{type:String},highlightColor:{type:String},className:{type:String},_position:{type:Number,state:!0},_containerWidth:{type:Number,state:!0}};constructor(){super(),this.text="",this.speed=5,this.spotlightWidth=120,this.loop=!0,this.delay=0,this.textColor="#9CA3AF",this.highlightColor="#000000",this.className="",this._position=-this.spotlightWidth,this._containerWidth=0}#e=Se(this);#t=Ka(this,{duration:({range:e})=>e*10/this.speed,initial:{range:0},onFrame:(e,{range:r})=>{this._position=-this.spotlightWidth+e*r,this.requestUpdate()},onComplete:({range:e})=>{this.loop&&(this._position=-this.spotlightWidth,this.requestUpdate(),this.#e.setTimeout(()=>this.#t.start({range:e}),this.delay))}});firstUpdated(){this.#e.setTimeout(()=>{this._containerWidth=this.#r?.offsetWidth||0;let e=this._containerWidth+this.spotlightWidth*3;this.#t.start({range:e})},this.delay)}render(){let e=this.text.split("");return u`
1360
+ `}#i(e){let r=this._selectedRating>0?this._selectedRating:this._hoverRating,i=e<=r;return u`<mw-icon class="${i?"text-yellow-400":"text-gray-300"} h-6 w-6" name="lucide:star" ?fill="${i}"></mw-icon>`}#n(e){this._selectedRating>0||(this._selectedRating=e,this._hoverRating=0,this.dispatchEvent(new t.SubmitEvent({type:"star-rating",rating:e})))}#s(e){this._selectedRating>0||(this._hoverRating=e)}#a(){this._selectedRating>0||(this._hoverRating=0)}#o(e){this._selectedVote||(this._selectedVote=e,this.dispatchEvent(new t.SubmitEvent({type:"binary-vote",vote:e})))}};Yt.SubmitEvent=class extends CustomEvent{static type="mw-request-input:submit";constructor(e,r={}){super(Yt.SubmitEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-request-input")||customElements.define("mw-request-input",Yt);var is=class{#e;#t=0;#r;#i;#n;#s;#a=0;#o;constructor(e,{duration:r,initial:i,easing:n,onFrame:s,onComplete:o}){this.#o=i,this.#t=typeof r=="function"?0:r,this.#r=typeof r=="function"?r:void 0,this.#i=n??(a=>a),this.#n=s,this.#s=o,e.addController(this)}start(e){this.cancel(),this.#o=e,this.#r&&(this.#t=this.#r(e)),this.#a=performance.now(),this.#e=requestAnimationFrame(this.#l)}cancel(){this.#e!==void 0&&(cancelAnimationFrame(this.#e),this.#e=void 0)}get running(){return this.#e!==void 0}#l=e=>{let r=Math.min((e-this.#a)/this.#t,1),i=this.#i(r);this.#n(i,this.#o),r<1?this.#e=requestAnimationFrame(this.#l):(this.#e=void 0,this.#s?.(this.#o))};hostDisconnected(){this.cancel()}};function ol(t,e){return new is(t,e)}var ns=class extends w(v){static properties={text:{type:String},speed:{type:Number},spotlightWidth:{type:Number},loop:{type:Boolean},delay:{type:Number},textColor:{type:String},highlightColor:{type:String},className:{type:String},_position:{type:Number,state:!0},_containerWidth:{type:Number,state:!0}};constructor(){super(),this.text="",this.speed=5,this.spotlightWidth=120,this.loop=!0,this.delay=0,this.textColor="#9CA3AF",this.highlightColor="#000000",this.className="",this._position=-this.spotlightWidth,this._containerWidth=0}#e=Ie(this);#t=ol(this,{duration:({range:e})=>e*10/this.speed,initial:{range:0},onFrame:(e,{range:r})=>{this._position=-this.spotlightWidth+e*r,this.requestUpdate()},onComplete:({range:e})=>{this.loop&&(this._position=-this.spotlightWidth,this.requestUpdate(),this.#e.setTimeout(()=>this.#t.start({range:e}),this.delay))}});firstUpdated(){this.#e.setTimeout(()=>{this._containerWidth=this.#r?.offsetWidth||0;let e=this._containerWidth+this.spotlightWidth*3;this.#t.start({range:e})},this.delay)}render(){let e=this.text.split("");return u`
1278
1361
  <div id="text-spotlight-container" class="${this.className} relative inline-block overflow-hidden whitespace-nowrap">
1279
1362
  <div class="text-[${this.textColor}]">
1280
1363
  ${e.map((r,i)=>{let n=i*(this._containerWidth/e.length),o=Math.abs(n-this._position)<this.spotlightWidth/2;return u`<span class="inline text-[${o?this.highlightColor:this.textColor}] transition-colors duration-300">${r}</span>`})}
1281
1364
  </div>
1282
1365
  </div>
1283
- `}get#r(){return this.renderRoot.querySelector("#text-spotlight-container")}};customElements.define("mw-text-spotlight",Kn);var Yn=class extends w(v){static properties={text:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.text="",this.color="",this.darkMode=!1}render(){return u`
1366
+ `}get#r(){return this.renderRoot.querySelector("#text-spotlight-container")}};customElements.define("mw-text-spotlight",ns);var ss=class extends w(v){static properties={text:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.text="",this.color="",this.darkMode=!1}render(){return u`
1284
1367
  <mw-text-spotlight
1285
1368
  text="${`${this.text||"Working"}\u2026`}"
1286
1369
  .speed="${3}"
@@ -1288,11 +1371,11 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1288
1371
  .highlightColor="${this.color||(this.darkMode?"#FFFFFF":"#000000")}"
1289
1372
  class="block h-6 leading-6">
1290
1373
  </mw-text-spotlight>
1291
- `}};customElements.get("mw-tool-call-indicator")||customElements.define("mw-tool-call-indicator",Yn);var Ya=["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/heic"];var Ht=class extends ot{constructor(e){if(super(e),this.it=U,e.type!==Tr.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===U||e==null)return this._t=void 0,this.it=e;if(e===ne)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:[]}}};Ht.directiveName="unsafeHTML",Ht.resultType=1;var Qa=Dr(Ht);var Za=B({title:Q(C(),"Agent joining in"),subtitle:Q(C(),"We are finding a human agent to help you."),subtitle_past_join_time:Q(C(),"It is taking a bit longer. A human agent will join any moment now."),expected_join_time:pr(Qe(C(),Si(),Ti())),game_title:Q(C(),"\u{1F9E0} I will guess your job"),game_first_question:Q(C(),"Does your job involve computers?"),game_result_prefix:Q(C(),"My guess:"),game_button_start:Q(C(),"\u{1F3AE} Play a game"),game_button_answer_affirmative:Q(C(),"Yes"),game_button_answer_negative:Q(C(),"No"),game_button_result_correct:Q(C(),"Correct"),game_button_result_wrong:Q(C(),"Wrong")});var Qn=t=>Qe(St(),Di(e=>Array.isArray(e)?e:[e]),Ye(t));var el=B({order_id_label:A(C()),order_id_value:A(C()),timeline:A(B({step:Qn(B({label:A(C()),status:A(It(["completed","in_progress","pending"]))}))})),items:A(B({item:Qn(B({name:A(C()),quantity:A(C()),price:A(C()),image:A(C())}))})),shipping_cost_label:A(C()),shipping_cost_amount:A(C()),total_label:A(C()),total_amount:A(C()),customer_name:A(C()),shipping_label:A(C()),shipping_method:A(C()),payment_label:A(C()),payment_method_label:A(C()),payment_method_value:A(C()),payment_status_label:A(C()),payment_status_value:A(C()),order_tracking_label:A(C()),order_tracking_url:A(C())});function tl(t,e,r,{imagesByProductUrl:i,linksNewTab:n=!0,searchParams:s,messageIsStreaming:o=!1,isSupportAgent:a,color:l="#601feb",darkMode:c=!1,apiBaseUrl:d="",cdnBaseUrl:p=""}){if(!t)return u``;let h=e>0&&r[e-1]&&"data"in r[e-1],y=e<r.length-1||!o;if("text"in t)return u`<p>${t.text}</p>`;if("html"in t)return u`${Qa(t.html)}`;if("data"in t)switch(t.tag){case"thought":{let f=t.data.__TEXT__?String(t.data.__TEXT__):"";return u`<mw-thought-block .content="${f}" ?dark-mode="${c}"></mw-thought-block>`}case"product-card":case"product-card-v1":case"product-card-horizontal":{let f=se(mr,t.data);if(f.success)return u`
1374
+ `}};customElements.get("mw-tool-call-indicator")||customElements.define("mw-tool-call-indicator",ss);var al=["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/heic"];var Kt=class extends lt{constructor(e){if(super(e),this.it=R,e.type!==Rr.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===R||e==null)return this._t=void 0,this.it=e;if(e===se)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:[]}}};Kt.directiveName="unsafeHTML",Kt.resultType=1;var ll=Ur(Kt);var cl=N({title:Q(C(),"Agent joining in"),subtitle:Q(C(),"We are finding a human agent to help you."),subtitle_past_join_time:Q(C(),"It is taking a bit longer. A human agent will join any moment now."),expected_join_time:yr(et(C(),Pi(),Li())),game_title:Q(C(),"\u{1F9E0} I will guess your job"),game_first_question:Q(C(),"Does your job involve computers?"),game_result_prefix:Q(C(),"My guess:"),game_button_start:Q(C(),"\u{1F3AE} Play a game"),game_button_answer_affirmative:Q(C(),"Yes"),game_button_answer_negative:Q(C(),"No"),game_button_result_correct:Q(C(),"Correct"),game_button_result_wrong:Q(C(),"Wrong")});var os=t=>et(Tt(),ji(e=>Array.isArray(e)?e:[e]),Ze(t));var ul=N({order_id_label:A(C()),order_id_value:A(C()),timeline:A(N({step:os(N({label:A(C()),status:A(Mt(["completed","in_progress","pending"]))}))})),items:A(N({item:os(N({name:A(C()),quantity:A(C()),price:A(C()),image:A(C())}))})),shipping_cost_label:A(C()),shipping_cost_amount:A(C()),total_label:A(C()),total_amount:A(C()),customer_name:A(C()),shipping_label:A(C()),shipping_method:A(C()),payment_label:A(C()),payment_method_label:A(C()),payment_method_value:A(C()),payment_status_label:A(C()),payment_status_value:A(C()),order_tracking_label:A(C()),order_tracking_url:A(C())});function dl(t,e,r,{imagesByProductUrl:i,linksNewTab:n=!0,searchParams:s,messageIsStreaming:o=!1,isSupportAgent:a,color:l="#601feb",darkMode:c=!1,apiBaseUrl:d="",cdnBaseUrl:p=""}){if(!t)return u``;let h=e>0&&r[e-1]&&"data"in r[e-1],m=e<r.length-1||!o;if("text"in t)return u`<p>${t.text}</p>`;if("html"in t)return u`${ll(t.html)}`;if("data"in t)switch(t.tag){case"thought":{let f=t.data.__TEXT__?String(t.data.__TEXT__):"";return u`<mw-thought-block .content="${f}" ?dark-mode="${c}"></mw-thought-block>`}case"product-card":case"product-card-v1":case"product-card-horizontal":{let f=oe(wr,t.data);if(f.success)return u`
1292
1375
  ${h?u`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
1293
1376
  <mw-product-card-horizontal
1294
1377
  .product="${f.output}"
1295
- ?streaming="${!y}"
1378
+ ?streaming="${!m}"
1296
1379
  ?links-new-tab="${n}"
1297
1380
  ?dark-mode="${c}"
1298
1381
  .searchParams="${s}"
@@ -1300,13 +1383,13 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1300
1383
  `;console.warn("cannot parse product-card-v1",f.issues);break}case"order-status-card-v1":return u`
1301
1384
  <mw-product-order-status-card
1302
1385
  .orderDetails="${t.data}"
1303
- ?streaming="${!y}"
1386
+ ?streaming="${!m}"
1304
1387
  ?links-new-tab="${n}"
1305
1388
  ?dark-mode="${c}"
1306
1389
  color="${l}"></mw-product-order-status-card>
1307
- `;case"order-card-v2":{let f=se(el,t.data);f.success||console.warn("cannot parse order-card-v2",f.issues);let $=f.success?f.output:t.data;return u`
1390
+ `;case"order-card-v2":{let f=oe(ul,t.data);f.success||console.warn("cannot parse order-card-v2",f.issues);let E=f.success?f.output:t.data;return u`
1308
1391
  <!-- -->
1309
- <mw-order-card .orderDetails="${$}" ?streaming="${!y}" ?links-new-tab="${n}" ?dark-mode="${c}" color="${l}"></mw-order-card>
1392
+ <mw-order-card .orderDetails="${E}" ?streaming="${!m}" ?links-new-tab="${n}" ?dark-mode="${c}" color="${l}"></mw-order-card>
1310
1393
  `}case"live-chat-wait-card-v1":{let f=t.data||{};return a?u`<p><i>${f.message}</i></p>`:u`
1311
1394
  <mw-chat-wait-timer
1312
1395
  heading="${f.title||""}"
@@ -1325,20 +1408,20 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1325
1408
  cdnBaseUrl="${p}"
1326
1409
  sound="${p?`${p}/assets/game-intro.aac`:""}"
1327
1410
  ?dark-mode="${c}"></mw-chat-wait-timer>
1328
- `}case"live-chat-wait-card-v2":{let f=se(Za,t.data||{});f.success||console.warn("cannot parse live-chat-wait-card-v2",f.issues);let $=f.success?f.output:t.data||{};return a?u`<p><i>${$.subtitle}</i></p>`:u`
1411
+ `}case"live-chat-wait-card-v2":{let f=oe(cl,t.data||{});f.success||console.warn("cannot parse live-chat-wait-card-v2",f.issues);let E=f.success?f.output:t.data||{};return a?u`<p><i>${E.subtitle}</i></p>`:u`
1329
1412
  <mw-chat-wait-timer
1330
- .data="${$}"
1413
+ .data="${E}"
1331
1414
  color="${l}"
1332
1415
  apiBaseUrl="${d}"
1333
1416
  cdnBaseUrl="${p}"
1334
1417
  sound="${p?`${p}/assets/game-intro.aac`:""}"
1335
1418
  ?dark-mode="${c}"></mw-chat-wait-timer>
1336
- `}case"request-input-v1":return u``}return console.warn("could not render part:",t),u`<p><i>data type not supported</i></p>`}var Zr=class{#e;#t;#r;#n=!1;timeoutMs;get isTyping(){return this.#n}constructor(e,r,{timeoutMs:i=2e3}={}){this.#e=e,this.#t=r,this.timeoutMs=i,e.addController(this)}hostDisconnected(){clearTimeout(this.#r),this.#r=void 0}onInput(e){if(this.#e.isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(this.#r),this.#r=setTimeout(()=>this.typingStopped(),this.timeoutMs),this.#n||this.#i()}}#i(){this.#n=!0,this.#t.typingStarted()}typingStopped(){clearTimeout(this.#r),this.#n=!1,this.#t.typingStopped()}};function Zn({interval:t},e){let r=!0,i;return Object.assign((...n)=>{r&&(e(...n),r=!1,i=setTimeout(()=>{r=!0,i=void 0},t))},{isThrottled:()=>i!==void 0})}function rl(t){let e=new FormData;for(let[r,i]of Object.entries(t))i!=null&&(i instanceof Blob?e.append(r,i):e.append(r,String(i)));return e}var ei=class extends Error{constructor(e,r,i){super(),this.name=this.constructor.name,this.message=e,this.type=r,this.code=i}},es=class{#e;#t;constructor(e,r,{fetch:i,headers:n}={}){this.baseUrl=e,this.path=r,this.#e=i,this.#t=n}GET({query:e,params:r,headers:i,signal:n}={}){return this.#n(this.#r(this.path,r),"GET",{query:e,headers:i,signal:n})}POST({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#n(this.#r(this.path,r),"POST",{query:e,body:i,formData:n,headers:s,signal:o})}PUT({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#n(this.#r(this.path,r),"PUT",{query:e,body:i,formData:n,headers:s,signal:o})}PATCH({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#n(this.#r(this.path,r),"PATCH",{query:e,body:i,formData:n,headers:s,signal:o})}DELETE({query:e,params:r,headers:i,signal:n}={}){return this.#n(this.#r(this.path,r),"DELETE",{query:e,headers:i,signal:n})}#r(e,r){if(!r)return e;let i=e;for(let[n,s]of Object.entries(r))i=i.replace(`:${n}`,encodeURIComponent(s.toString()));return i}async#n(e,r,{query:i,body:n,formData:s,headers:o,signal:a}){let l=new URL(e,this.baseUrl);i&&(l.search=Gs(i).toString());let c=new Headers(this.#t);if(o)for(let[p,h]of new Headers(o))c.set(p,h);s||n instanceof URLSearchParams||n instanceof FormData||n instanceof Blob||n instanceof ArrayBuffer||n instanceof ReadableStream||c.set("Content-Type","application/json");let d=await(this.#e??fetch)(l,{method:r,headers:c,body:c.get("Content-Type")==="application/json"?JSON.stringify(n):(s?rl(s):null)||n,signal:a});if(!d.ok){let p="";try{p=await d.text().then(h=>h.substring(0,1e3))}catch(h){p=h?.toString()??""}throw new ei(p,"HTTP",d.status)}if(d.status!==204){if(d.headers.get("Content-Type")?.startsWith("application/json"))return d.json();throw new ei("Response content type is not JSON and we do not handle others yet","HTTP",d.status)}}};function il(t,{fetch:e,headers:r}={}){let i={baseUrl:t};return new Proxy(i,{get(s,o){if(typeof o!="string"||!o.startsWith("/"))return;let a=o;return new es(s.baseUrl,a,{fetch:e,headers:r})}})}var ts=class{#e;uploadsAPI;constructor(e,r){this.#e=e,this.uploadsAPI=il(r),e.addController(this)}hostDisconnected(){}};function nl(t,e){return new ts(t,e).uploadsAPI}var rs="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:font-bold prose-h2:text-lg prose-h2:font-bold prose-h3:text-base prose-h3:font-bold prose-h4:text-sm prose-h4:font-bold prose-p:whitespace-pre-wrap prose-blockquote:border-l-4 prose-blockquote:border-gray-300 prose-blockquote:pl-4 prose-blockquote:my-4 prose-blockquote:italic prose-blockquote:text-gray-600 prose-blockquote:whitespace-normal prose-blockquote:before:content-none prose-blockquote:after:content-none dark:prose-headings:text-white dark:prose-strong:text-white dark:prose-p:text-inherit dark:prose-a:text-white dark:prose-blockquote:border-gray-500 dark:prose-blockquote:text-gray-300";function is(){return new URL(import.meta.url).hostname}function ti(){let t=Object.freeze({localhost:"http://localhost:8787","molin.localhost":"http://molin.localhost:8787","molin.ai":"https://molin.ai","molin.foo":"https://molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=is(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinApiBaseUrl.`);return r}function sl(){let t=Object.freeze({localhost:"http://uploads.molin.localhost:8787","molin.localhost":"http://uploads.molin.localhost:8787","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=is(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinUploadsBaseUrl.`);return r}function ol(){let t=Object.freeze({localhost:"http://localhost:8702","molin.localhost":"http://localhost:8702","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=is(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinCdnBaseUrl.`);return r}var fd=["star-rating","binary-vote","new-conversation-button"],We=class t extends w(v){static styles=O`
1419
+ `}case"request-input-v1":return u``}return console.warn("could not render part:",t),u`<p><i>data type not supported</i></p>`}var ai=class{#e;#t;#r;#i=!1;timeoutMs;get isTyping(){return this.#i}constructor(e,r,{timeoutMs:i=2e3}={}){this.#e=e,this.#t=r,this.timeoutMs=i,e.addController(this)}hostDisconnected(){clearTimeout(this.#r),this.#r=void 0}onInput(e){if(this.#e.isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(this.#r),this.#r=setTimeout(()=>this.typingStopped(),this.timeoutMs),this.#i||this.#n()}}#n(){this.#i=!0,this.#t.typingStarted()}typingStopped(){clearTimeout(this.#r),this.#i=!1,this.#t.typingStopped()}};function as({interval:t},e){let r=!0,i;return Object.assign((...n)=>{r&&(e(...n),r=!1,i=setTimeout(()=>{r=!0,i=void 0},t))},{isThrottled:()=>i!==void 0})}var ls=class{#e;uploadsAPI;constructor(e,r){this.#e=e,this.uploadsAPI=Fr(r),e.addController(this)}hostDisconnected(){}};function pl(t,e){return new ls(t,e).uploadsAPI}var cs="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:font-bold prose-h2:text-lg prose-h2:font-bold prose-h3:text-base prose-h3:font-bold prose-h4:text-sm prose-h4:font-bold prose-p:whitespace-pre-wrap prose-blockquote:border-l-4 prose-blockquote:border-gray-300 prose-blockquote:pl-4 prose-blockquote:my-4 prose-blockquote:italic prose-blockquote:text-gray-600 prose-blockquote:whitespace-normal prose-blockquote:before:content-none prose-blockquote:after:content-none dark:prose-headings:text-white dark:prose-strong:text-white dark:prose-p:text-inherit dark:prose-a:text-white dark:prose-blockquote:border-gray-500 dark:prose-blockquote:text-gray-300";function us(){return new URL(import.meta.url).hostname}function li(){let t=Object.freeze({localhost:"http://localhost:8787","molin.localhost":"http://molin.localhost:8787","molin.ai":"https://molin.ai","molin.foo":"https://molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=us(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinApiBaseUrl.`);return r}function hl(){let t=Object.freeze({localhost:"http://uploads.molin.localhost:8787","molin.localhost":"http://uploads.molin.localhost:8787","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=us(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinUploadsBaseUrl.`);return r}function ds(){let t=Object.freeze({localhost:"http://localhost:8702","molin.localhost":"http://localhost:8702","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=us(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinCdnBaseUrl.`);return r}var $d=["star-rating","binary-vote","new-conversation-button"],He=class t extends w(v){static styles=O`
1337
1420
  div.dark::before {
1338
1421
  opacity: 0.8;
1339
1422
  background-color: rgba(20, 22, 26, var(--tw-bg-opacity));
1340
1423
  }
1341
- `;static properties={showClose:{type:Boolean,attribute:"show-close"},showExpand:{type:Boolean,attribute:"show-expand"},expanded:{type:Boolean},open:{type:Boolean},_currentRequestInputIndex:{type:Number,state:!0}};#e=co(this);#t=nl(this,sl());#r=new Map;constructor(){super(),this.showClose=!1,this.showExpand=!1,this.expanded=!1,this.open=!1,this._currentRequestInputIndex=0}#n=new Zr(this,{typingStarted:()=>this.#e.value?.sendUserTypingStart(),typingStopped:()=>this.#e.value?.sendUserTypingStop()});#i=new Ur(this,{acceptedTypes:Ya,maxFileSize:10485760,maxFileCount:3,onFileUpload:async e=>{let r=this.#e.value;if(!r?.isConnected())throw new Error("Not connected");return this.#t["/v1/uploads"].POST({formData:{file:e.file,fileId:e.id,conversationId:this.conversationId,widgetId:r.widgetId,role:"user"}})},onFileDelete:e=>{if(!this.#e.value){console.warn("widget context not available, cannot delete file");return}this.#e.value.sendFileDelete(e),this.#k?.focus()},onFilesAdded:()=>{this.focusInput()}});get conversationId(){return this.#e.value?.conversationId||""}get messages(){return this.#e.value?.messages||[]}get config(){return this.#e.value?.config}get callbacks(){return this.#e.value?.callbacks||{}}get widgetId(){return this.#e.value?.widgetId||""}get typingIndicator(){return this.#e.value?.typingIndicator}get toolCallIndicator(){return this.#e.value?.toolCallIndicator}get isStreaming(){return this.#e.value?.isStreaming}get ranOutOfCredits(){return this.#e.value?.ranOutOfCredits}get isLiveMode(){return this.#e.value?.isLiveMode}get lastMsg(){return this.#e.value?.lastMsg}get hasQueuedMessages(){return this.#e.value?.hasQueuedMessages}#s="single";#o=null;firstUpdated(){document.addEventListener("mw-context-widget:connected",this.#a,{once:!0}),this.addEventListener("mw-chat-wait-game:question-answered",this.#l),this.addEventListener("mw-chat-wait-game:game-completed",this.#c),this.addEventListener("mw-chat-wait-game:guess-validated",this.#d)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mw-chat-wait-game:question-answered",this.#l),this.removeEventListener("mw-chat-wait-game:game-completed",this.#c),this.removeEventListener("mw-chat-wait-game:guess-validated",this.#d)}#a=e=>{let r=e,{pendingImages:i}=r.detail;Array.isArray(i)&&this.#i.restoreFiles(i.map(n=>({id:n.id,name:n.name,type:n.type,size:n.size,dataUrl:n.url,file:new File([],n.name,{type:n.type}),processingState:de.uploaded,publicUrl:n.url})))};#l=e=>{let r=e,{questionIndex:i,question:n,answer:s,totalQuestions:o}=r.detail;this.callbacks.onWaitGameQuestionAnswered?.({widgetId:this.widgetId,conversationId:this.conversationId,questionIndex:i,question:n,answer:s,totalQuestions:o})};#c=e=>{let r=e,{guessedProfession:i,questionCount:n}=r.detail;this.callbacks.onWaitGameCompleted?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:i,questionCount:n})};#d=e=>{let r=e,{guessedProfession:i,isCorrect:n,questionCount:s}=r.detail;this.callbacks.onWaitGameGuessValidated?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:i,isCorrect:n,questionCount:s})};updated(e){e.has("open")&&this.open&&this.focusInput();let r=this.lastMsg?.id;r&&r!==this.#o&&(this.#o=r,this._currentRequestInputIndex=0),this.#i.setEnabled(!!this.#e.value?.widgetId)}render(){D(this.config,"config is required");let e=Ja(this.messages,s=>{try{let o=new Date(s.timestamp),a=Math.floor(o.getUTCMinutes()/5)*5;return o.setUTCMinutes(a,0,0),o.valueOf().toString()}catch(o){console.error(o)}}),r=Math.max(0,Math.min(this._currentRequestInputIndex,this.#h.length-1)),i=this.#h[r],n=this.config.darkMode;return u`
1424
+ `;static properties={showClose:{type:Boolean,attribute:"show-close"},showExpand:{type:Boolean,attribute:"show-expand"},expanded:{type:Boolean},open:{type:Boolean},_currentRequestInputIndex:{type:Number,state:!0},_voiceError:{type:String,state:!0}};#e=yo(this);#t=pl(this,hl());#r=new Map;constructor(){super(),this.showClose=!1,this.showExpand=!1,this.expanded=!1,this.open=!1,this._currentRequestInputIndex=0,this._voiceError=""}#i=new ai(this,{typingStarted:()=>this.#e.value?.sendUserTypingStart(),typingStopped:()=>this.#e.value?.sendUserTypingStop()});#n=new Nr(this,{acceptedTypes:al,maxFileSize:10485760,maxFileCount:3,onFileUpload:async e=>{let r=this.#e.value;if(!r?.isConnected())throw new Error("Not connected");return this.#t["/v1/uploads"].POST({formData:{file:e.file,fileId:e.id,conversationId:this.conversationId,widgetId:r.widgetId,role:"user"}})},onFileDelete:e=>{if(!this.#e.value){console.warn("widget context not available, cannot delete file");return}this.#e.value.sendFileDelete(e),this.#b?.focus()},onFilesAdded:()=>{this.focusInput()}});get conversationId(){return this.#e.value?.conversationId||""}get messages(){return this.#e.value?.messages||[]}get config(){return this.#e.value?.config}get callbacks(){return this.#e.value?.callbacks||{}}get widgetId(){return this.#e.value?.widgetId||""}get typingIndicator(){return this.#e.value?.typingIndicator}get toolCallIndicator(){return this.#e.value?.toolCallIndicator}get isStreaming(){return this.#e.value?.isStreaming}get ranOutOfCredits(){return this.#e.value?.ranOutOfCredits}get isLiveMode(){return this.#e.value?.isLiveMode}get lastMsg(){return this.#e.value?.lastMsg}get hasQueuedMessages(){return this.#e.value?.hasQueuedMessages}#s="single";#a=null;firstUpdated(){document.addEventListener("mw-context-widget:connected",this.#o,{once:!0}),this.addEventListener("mw-chat-wait-game:question-answered",this.#l),this.addEventListener("mw-chat-wait-game:game-completed",this.#c),this.addEventListener("mw-chat-wait-game:guess-validated",this.#u)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mw-chat-wait-game:question-answered",this.#l),this.removeEventListener("mw-chat-wait-game:game-completed",this.#c),this.removeEventListener("mw-chat-wait-game:guess-validated",this.#u)}#o=e=>{let r=e,{pendingImages:i}=r.detail;Array.isArray(i)&&this.#n.restoreFiles(i.map(n=>({id:n.id,name:n.name,type:n.type,size:n.size,dataUrl:n.url,file:new File([],n.name,{type:n.type}),processingState:pe.uploaded,publicUrl:n.url})))};#l=e=>{let r=e,{questionIndex:i,question:n,answer:s,totalQuestions:o}=r.detail;this.callbacks.onWaitGameQuestionAnswered?.({widgetId:this.widgetId,conversationId:this.conversationId,questionIndex:i,question:n,answer:s,totalQuestions:o})};#c=e=>{let r=e,{guessedProfession:i,questionCount:n}=r.detail;this.callbacks.onWaitGameCompleted?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:i,questionCount:n})};#u=e=>{let r=e,{guessedProfession:i,isCorrect:n,questionCount:s}=r.detail;this.callbacks.onWaitGameGuessValidated?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:i,isCorrect:n,questionCount:s})};updated(e){e.has("open")&&this.open&&this.focusInput();let r=this.lastMsg?.id;r&&r!==this.#a&&(this.#a=r,this._currentRequestInputIndex=0),this.#n.setEnabled(!!this.#e.value?.widgetId)}render(){M(this.config,"config is required");let e=sl(this.messages,s=>{try{let o=new Date(s.timestamp),a=Math.floor(o.getUTCMinutes()/5)*5;return o.setUTCMinutes(a,0,0),o.valueOf().toString()}catch(o){console.error(o)}}),r=Math.max(0,Math.min(this._currentRequestInputIndex,this.#C.length-1)),i=this.#C[r],n=this.config.darkMode;return u`
1342
1425
  <div
1343
1426
  class="${n?"dark":""} 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] dark:bg-[#14161A]">
1344
1427
  <div
@@ -1346,14 +1429,14 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1346
1429
  <mw-chat-header
1347
1430
  class="absolute top-1.5 right-1.5 left-1.5"
1348
1431
  .content="${{logoUrl:this.config.logoUrl,title:this.config.title,color:this.config.color}}"
1349
- ?show-new-chat="${!this.isLiveMode&&this.messages.length>0&&!this.#$}"
1432
+ ?show-new-chat="${!this.isLiveMode&&this.messages.length>0&&!this.#T}"
1350
1433
  ?show-close="${this.showClose}"
1351
1434
  ?show-expand="${this.showExpand}"
1352
1435
  ?expanded="${this.expanded}"
1353
1436
  ?dark-mode="${n}"
1354
- @mw:new-chat-click="${this.#w}"
1355
- @mw:expand-click="${this.#C}"
1356
- @mw:close-click="${this.#x}">
1437
+ @mw:new-chat-click="${this.#y}"
1438
+ @mw:expand-click="${this.#v}"
1439
+ @mw:close-click="${this.#S}">
1357
1440
  </mw-chat-header>
1358
1441
 
1359
1442
  <!-- used by the dashboard to inject content -->
@@ -1362,7 +1445,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1362
1445
  </div>
1363
1446
 
1364
1447
  <!-- drag overlay -->
1365
- ${this.#i.isDragging?u`
1448
+ ${this.#n.isDragging?u`
1366
1449
  <div class="bg-opacity-90 absolute inset-0 z-50 flex items-center justify-center bg-white sm:rounded-[30px] dark:bg-[#2B2D31]">
1367
1450
  <div class="p-8 text-center">
1368
1451
  <mw-icon name="lucide:image-plus" class="mx-auto mb-4 h-12 w-12 text-blue-500"></mw-icon>
@@ -1374,7 +1457,8 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1374
1457
 
1375
1458
  <!-- this structure of 2 divs is required for the browser native stick/scroll to bottom -->
1376
1459
  <div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto">
1377
- ${this.#i.error?u`<mw-info-banner variant="error" text="${this.#i.error}" auto-dismissable></mw-info-banner> `:null}
1460
+ ${this.#n.error?u`<mw-info-banner variant="error" text="${this.#n.error}" auto-dismissable></mw-info-banner> `:null}
1461
+ ${this._voiceError?u`<mw-info-banner variant="error" text="${this._voiceError}" auto-dismissable></mw-info-banner>`:null}
1378
1462
  ${this.config?.showStillLearningBanner?u`<mw-info-banner variant="info" text="I'm still learning!"></mw-info-banner>`:u`
1379
1463
  <!-- this makes the chat stick to bottom when the banner is hidden -->
1380
1464
  <div class="flex p-1"></div>
@@ -1384,8 +1468,8 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1384
1468
  <!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
1385
1469
  <div class="${this.messages.length>0?"pt-20":""}">
1386
1470
  ${X(Array.from(e),([s])=>s,([s,o])=>u`
1387
- <div class="my-2 text-center text-xs text-gray-500 dark:text-gray-400">${pa(new Date(Number(s)),window.navigator.language)}</div>
1388
- ${X(o??[],a=>a.id,(a,l)=>{let d=o[l+1]?.role===a.role,h=(l>0?o[l-1]:void 0)?.role===a.role,f=(o.length>0?o[o.length-1]:void 0)?.id===a.id,$=()=>f&&!h&&!d?"single-current":!h&&!d?"single":!h&&d?"first":f&&h&&!d?"last-current":h&&!d?"last":h&&d?"middle":"single";this.#s=$();let x=this.isLiveMode&&a.role==="user"&&a.id===this.lastMsg?.id?"sent":"",E=(a.content.includes("<request-input-v1>")||!a.content)&&a.parts?.every(b=>"data"in b&&b.tag==="request-input-v1");return u`
1471
+ <div class="my-2 text-center text-xs text-gray-500 dark:text-gray-400">${ka(new Date(Number(s)),window.navigator.language)}</div>
1472
+ ${X(o??[],a=>a.id,(a,l)=>{let d=o[l+1]?.role===a.role,h=(l>0?o[l-1]:void 0)?.role===a.role,f=(o.length>0?o[o.length-1]:void 0)?.id===a.id,E=()=>f&&!h&&!d?"single-current":!h&&!d?"single":!h&&d?"first":f&&h&&!d?"last-current":h&&!d?"last":h&&d?"middle":"single";this.#s=E();let x=this.isLiveMode&&a.role==="user"&&a.id===this.lastMsg?.id?"sent":"",S=(a.content.includes("<request-input-v1>")||!a.content)&&a.parts?.every(b=>"data"in b&&b.tag==="request-input-v1");return u`
1389
1473
  ${a.images?X(a.images,b=>b,b=>u`
1390
1474
  <div data-id="${a.id}" class="${d?"mb-[1px]":"mb-3"} mr-2 ml-[15px] flex-row">
1391
1475
  <mw-chat-image
@@ -1396,7 +1480,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1396
1480
  width="300px"></mw-chat-image>
1397
1481
  </div>
1398
1482
  `):null}
1399
- ${(a.content||a.parts)&&!E?u`
1483
+ ${(a.content||a.parts)&&!S?u`
1400
1484
  <div data-id="${a.id}" class="${d?"mb-[1px]":"mb-3"} mx-2 flex-row">
1401
1485
  <mw-chat-message
1402
1486
  .color="${this.config?.color}"
@@ -1405,9 +1489,9 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1405
1489
  side="${a.role}"
1406
1490
  position=${this.#s}
1407
1491
  ?dark-mode="${n}"
1408
- @click="${this.#u}">
1409
- <div class="${rs} break-words text-inherit">
1410
- ${a.parts?.length?X(a.parts,(b,k)=>k,(b,k)=>tl(b,k,a.parts??[],{imagesByProductUrl:a.role==="assistant"&&a.metadata&&"imagesByProductUrl"in a.metadata?a.metadata.imagesByProductUrl:void 0,linksNewTab:this.config?.linksNewTab??!0,searchParams:this.config?.disableUtmInjection?void 0:new URLSearchParams({utm_source:"molin.ai"}),messageIsStreaming:a.streaming,color:this.config?.color,darkMode:n,apiBaseUrl:ti(),cdnBaseUrl:ol()})):u`<p>${a.content}</p>`}
1492
+ @click="${this.#d}">
1493
+ <div class="${cs} break-words text-inherit">
1494
+ ${a.parts?.length?X(a.parts,(b,k)=>k,(b,k)=>dl(b,k,a.parts??[],{imagesByProductUrl:a.role==="assistant"&&a.metadata&&"imagesByProductUrl"in a.metadata?a.metadata.imagesByProductUrl:void 0,linksNewTab:this.config?.linksNewTab??!0,searchParams:this.config?.disableUtmInjection?void 0:new URLSearchParams({utm_source:"molin.ai"}),messageIsStreaming:a.streaming,color:this.config?.color,darkMode:n,apiBaseUrl:li(),cdnBaseUrl:ds()})):u`<p>${a.content}</p>`}
1411
1495
  </div>
1412
1496
  </mw-chat-message>
1413
1497
  </div>
@@ -1417,7 +1501,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1417
1501
 
1418
1502
  <!-- show tool call indicator when a tool is being executed -->
1419
1503
  ${this.toolCallIndicator?u`
1420
- <mw-chat-message class="mx-2 mb-3 block" color="${this.config?.color}" logo="${N(this.config?.logoUrl)}" side="assistant" ?dark-mode="${n}">
1504
+ <mw-chat-message class="mx-2 mb-3 block" color="${this.config?.color}" logo="${z(this.config?.logoUrl)}" side="assistant" ?dark-mode="${n}">
1421
1505
  <mw-tool-call-indicator text="${this.toolCallIndicator}" color="${this.config?.color}" ?dark-mode="${n}"></mw-tool-call-indicator>
1422
1506
  </mw-chat-message>
1423
1507
  `:null}
@@ -1430,7 +1514,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1430
1514
  logo="${this.typingIndicator?.metadata?.avatar||this.config?.logoUrl}"
1431
1515
  side="${this.typingIndicator.role}"
1432
1516
  ?dark-mode="${n}">
1433
- <div class="${rs} break-words text-inherit">
1517
+ <div class="${cs} break-words text-inherit">
1434
1518
  <mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}] text-[${this.config.color}]"></mw-loading>
1435
1519
  </div>
1436
1520
  </mw-chat-message>
@@ -1458,21 +1542,27 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1458
1542
  <mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}" ?dark-mode="${n}"></mw-disclaimer>
1459
1543
  </div>
1460
1544
  `:null}
1461
- ${this.#h.length===0?u`
1545
+ ${this.#C.length===0?u`
1462
1546
  <mw-chat-input
1463
- @mw:change="${this.#g}"
1464
- @mw:submit="${this.#f}"
1465
- @mw:cancel="${this.#m}"
1466
- @mw:file-upload-click="${this.#i.openFilePicker}"
1467
- @mw:file-delete="${this.#_}"
1547
+ @mw:change="${this.#m}"
1548
+ @mw:submit="${this.#h}"
1549
+ @mw:cancel="${this.#f}"
1550
+ @mw:voice-recording-started="${this.#_}"
1551
+ @mw:voice-recording-completed="${this.#E}"
1552
+ @mw:voice-transcribed="${this.#x}"
1553
+ @mw:voice-error="${this.#g}"
1554
+ @mw:file-upload-click="${this.#n.openFilePicker}"
1555
+ @mw:file-delete="${this.#k}"
1468
1556
  placeholder="${this.config?.input?.placeholder??""}"
1469
1557
  ?disabled="${this.ranOutOfCredits||this.hasQueuedMessages}"
1470
1558
  ?streaming="${this.isStreaming??!0}"
1471
- ?loading="${this.hasQueuedMessages||this.#i.hasPendingFiles}"
1559
+ ?loading="${this.hasQueuedMessages||this.#n.hasPendingFiles}"
1472
1560
  ?enableFileUpload="${!this.ranOutOfCredits}"
1473
1561
  ?dark-mode="${n}"
1474
1562
  color="${this.config?.color??""}"
1475
- .files="${this.#i.selectedFiles}">
1563
+ widget-id="${this.widgetId}"
1564
+ cdn-base-url="${ds()}"
1565
+ .files="${this.#n.selectedFiles}">
1476
1566
  </mw-chat-input>
1477
1567
  `:u`
1478
1568
  <mw-request-input
@@ -1480,7 +1570,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1480
1570
  .type="${i?.type}"
1481
1571
  .color="${this.config?.color??"#8B5CF6"}"
1482
1572
  ?dark-mode="${n}"
1483
- @mw-request-input:submit="${this.#y}">
1573
+ @mw-request-input:submit="${this.#$}">
1484
1574
  </mw-request-input>
1485
1575
  `}
1486
1576
  ${this.config.removePoweredBy?this.config.disclaimer?u`
@@ -1497,7 +1587,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1497
1587
  </div>
1498
1588
  </div>
1499
1589
  </div>
1500
- `}#u(e){let r=e.composedPath(),i=r.find(n=>n instanceof HTMLAnchorElement);if(i){e.preventDefault();let n=r.find(c=>c instanceof ze||c instanceof Wt),s=n?.product,o=0;if(n){let c=n.parentElement?.querySelectorAll("mw-product-card, mw-product-card-horizontal");c&&(o=Array.from(c).indexOf(n))}if(this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId,product:s?.name&&s?.price?{name:s.name,price:s.price,rank:o}:void 0}),window.self!==window.top){window.open(i.href,"_blank");return}let l=this.config?.linksNewTab?"_blank":"_self";window.open(i.href,i.target||l)}}#p(e){if(this.isStreaming)return;e.preventDefault();let r=e.detail.example;this.#v(r)}#v=Zn({interval:200},async e=>{D(this.#e.value,"widget context is required"),await this.#e.value.enqueueUserInput(e,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions})&&(this.#k?.setValue(""),this.#E(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!0,conversationId:this.conversationId}))});#f(e){if(D(this.#e.value,"widget context is required"),e.preventDefault(),this.#i.hasPendingFiles)return;let r=e.detail;this.#e.value.enqueueUserInput(r,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions}).then(i=>{i&&(this.#k?.setValue(""),this.#i.clearFiles(),this.#n.typingStopped(),this.#E(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:this.conversationId}),window.requestAnimationFrame(()=>{this.#k?.focus()}))}).catch(console.warn)}#g(e){this.#n.onInput(e.detail.full)}#m(){D(this.#e.value,"widget context is required"),this.#e.value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}#_(e){this.#i.deleteFile(e.detail)}#w(){D(this.#e.value,"widget context is required"),this.#e.value.sendNewChat(),this.reset()}#C(){this.dispatchEvent(new t.ExpandClickEvent)}#x(){this.dispatchEvent(new t.CloseClickEvent)}#y(e){D(this.#e.value,"widget context is required");let r=this.#h,i=r[this._currentRequestInputIndex];if(!i){console.warn("no current state found for request input");return}switch(e.detail.type){case"star-rating":{let{rating:s,type:o}=e.detail;this.#r.set(i.key||i.title,{type:o,rating:s,key:i.key,title:i.title});break}case"binary-vote":{let{vote:s,type:o}=e.detail;this.#r.set(i.key||i.title,{type:o,vote:s,key:i.key,title:i.title});break}case"new-conversation-button":{this.#w(),this.requestUpdate();return}default:console.warn("unknown request input type",e.detail);return}this._currentRequestInputIndex+=1;let n=r.filter(s=>s.type==="star-rating"||s.type==="binary-vote").length;this.#r.size>=n&&this.#b(),this.requestUpdate()}async#b(){if(D(this.#e.value,"widget context is required"),this.#r.size===0)return;if(!this.#e.value.lastMsg?.id){console.warn("cannot submit request inputs without message ID");return}await this.#e.value.sendUserFeedback([...this.#r.values()])&&this.#r.clear(),this.requestUpdate()}get#h(){D(this.#e.value,"widget context is required");let e=this.messages.findLast(n=>n.role==="assistant"&&n.parts?.some(s=>"tag"in s&&s.tag==="request-input-v1"&&"data"in s&&s.data.type==="new-conversation-button")),r=this.#e.value.lastMsg;if(e&&r?.id!==e.id){let n=e?.parts?.find(s=>"tag"in s&&s.tag==="request-input-v1"&&"data"in s&&s.data.type==="new-conversation-button");if(n&&"data"in n&&(n.data.type==="new-conversation-button"||n.data.type==="binary-vote"||n.data.type==="star-rating"))return[{title:String(n.data.title),type:n.data.type,key:String(n.data.key)}]}if(r?.role!=="assistant")return[];let i=r.parts?.filter(n=>"tag"in n&&n.tag==="request-input-v1");return!i||i.length===0?[]:i.map(n=>!("data"in n)||n.data.type!=="star-rating"&&n.data.type!=="binary-vote"&&n.data.type!=="new-conversation-button"||!fd.includes(n.data.type)?null:{title:String(n.data.title),type:n.data.type,key:String(n.data.key)}).filter(n=>n!==null)}get#$(){if(this.#h.length===0)return!1;let r=this.#h.filter(i=>i.type==="star-rating"||i.type==="binary-vote").length;return this.#r.size<r}get#S(){return this.renderRoot.querySelector("#scrollable-content")}#E(){this.#S?.scrollTo({top:0,behavior:"instant"})}get#k(){return this.renderRoot.querySelector("mw-chat-input")}reloadConfig(){this.#e.value?.reloadConfig(),this.requestUpdate()}sendMessage=Zn({interval:200},async e=>{if(!e?.trim())return console.warn("sendMessage: Message must be a non-empty string"),!1;D(this.#e.value,"Widget context is required");let{value:r}=this.#e,i=await r.enqueueUserInput(e,{xUserData:r.xUserData,xCustomInstructions:r.xCustomInstructions,role:"user",expectStreaming:!0});return i&&this.#k?.setValue(""),i??!1});setInputValue(e){if(!e||typeof e!="string"){console.warn("setInputValue requires a valid string value");return}let r=this.#k;if(!r){console.warn("input element not found, cannot set value");return}r.setValue?r.setValue(e):console.warn("input element does not have setValue method")}focusInput(){window.requestAnimationFrame(()=>{this.#k?.focus()})}reset(){this.#i.clearFiles(),this._currentRequestInputIndex=0,this.#r.clear(),this.#e.value?.reset()}};We.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(We.ExpandClickEvent.type,{...e})}};We.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(We.CloseClickEvent.type,{...e})}};customElements.get("mw-chat")||customElements.define("mw-chat",We);var Ve=class t extends w(v){static properties={color:{type:String},disabled:{type:Boolean},placeholder:{type:String},dark:{type:Boolean},_inputValue:{type:String,state:!0}};constructor(){super(),this.color="#8B5CF6",this.disabled=!1,this.placeholder="Ask AI...",this.dark=!1,this._inputValue=""}#e=new Date;#t(e){let r=e.target;this._inputValue=r.value,this.dispatchEvent(new t.ChangeEvent({value:this._inputValue}))}render(){return u`
1590
+ `}#d(e){let r=e.composedPath(),i=r.find(n=>n instanceof HTMLAnchorElement);if(i){e.preventDefault();let n=r.find(c=>c instanceof Ve||c instanceof Xt),s=n?.product,o=0;if(n){let c=n.parentElement?.querySelectorAll("mw-product-card, mw-product-card-horizontal");c&&(o=Array.from(c).indexOf(n))}if(this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId,product:s?.name&&s?.price?{name:s.name,price:s.price,rank:o}:void 0}),window.self!==window.top){window.open(i.href,"_blank");return}let l=this.config?.linksNewTab?"_blank":"_self";window.open(i.href,i.target||l)}}#p(e){if(this.isStreaming)return;e.preventDefault();let r=e.detail.example;this.#w(r)}#w=as({interval:200},async e=>{M(this.#e.value,"widget context is required"),await this.#e.value.enqueueUserInput(e,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions})&&(this.#b?.setValue(""),this.#A(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!0,conversationId:this.conversationId}))});#h(e){if(M(this.#e.value,"widget context is required"),e.preventDefault(),this.#n.hasPendingFiles)return;let r=e.detail;this.#e.value.enqueueUserInput(r,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions}).then(i=>{i&&(this.#b?.setValue(""),this.#n.clearFiles(),this.#i.typingStopped(),this.#A(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:this.conversationId}),window.requestAnimationFrame(()=>{this.#b?.focus()}))}).catch(console.warn)}#m(e){this.#i.onInput(e.detail.full)}#f(){M(this.#e.value,"widget context is required"),this.#e.value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}#k(e){this.#n.deleteFile(e.detail)}#_(){this._voiceError="",this.callbacks.onVoiceRecordingStarted?.({widgetId:this.widgetId,conversationId:this.conversationId})}#E(e){this.callbacks.onVoiceRecordingCompleted?.({widgetId:this.widgetId,conversationId:this.conversationId,durationMs:e.detail.durationMs})}#x(e){let{text:r,language:i,processingMs:n,durationMs:s}=e.detail;this.callbacks.onVoiceTranscriptionCompleted?.({widgetId:this.widgetId,conversationId:this.conversationId,durationMs:s,processingMs:n,language:i,textLength:r.length}),this.updateComplete.then(()=>{this.#b?.setValue(r),this.focusInput()})}#g(e){let{message:r,code:i}=e.detail;this._voiceError=r,i==="permission_denied"&&this.callbacks.onVoicePermissionDenied?.({widgetId:this.widgetId}),(i==="connection_error"||i==="transcription_failed")&&this.callbacks.onVoiceTranscriptionFailed?.({widgetId:this.widgetId,conversationId:this.conversationId,error:r})}#y(){M(this.#e.value,"widget context is required"),this.#e.value.sendNewChat(),this.reset()}#v(){this.dispatchEvent(new t.ExpandClickEvent)}#S(){this.dispatchEvent(new t.CloseClickEvent)}#$(e){M(this.#e.value,"widget context is required");let r=this.#C,i=r[this._currentRequestInputIndex];if(!i){console.warn("no current state found for request input");return}switch(e.detail.type){case"star-rating":{let{rating:s,type:o}=e.detail;this.#r.set(i.key||i.title,{type:o,rating:s,key:i.key,title:i.title});break}case"binary-vote":{let{vote:s,type:o}=e.detail;this.#r.set(i.key||i.title,{type:o,vote:s,key:i.key,title:i.title});break}case"new-conversation-button":{this.#y(),this.requestUpdate();return}default:console.warn("unknown request input type",e.detail);return}this._currentRequestInputIndex+=1;let n=r.filter(s=>s.type==="star-rating"||s.type==="binary-vote").length;this.#r.size>=n&&this.#I(),this.requestUpdate()}async#I(){if(M(this.#e.value,"widget context is required"),this.#r.size===0)return;if(!this.#e.value.lastMsg?.id){console.warn("cannot submit request inputs without message ID");return}await this.#e.value.sendUserFeedback([...this.#r.values()])&&this.#r.clear(),this.requestUpdate()}get#C(){M(this.#e.value,"widget context is required");let e=this.messages.findLast(n=>n.role==="assistant"&&n.parts?.some(s=>"tag"in s&&s.tag==="request-input-v1"&&"data"in s&&s.data.type==="new-conversation-button")),r=this.#e.value.lastMsg;if(e&&r?.id!==e.id){let n=e?.parts?.find(s=>"tag"in s&&s.tag==="request-input-v1"&&"data"in s&&s.data.type==="new-conversation-button");if(n&&"data"in n&&(n.data.type==="new-conversation-button"||n.data.type==="binary-vote"||n.data.type==="star-rating"))return[{title:String(n.data.title),type:n.data.type,key:String(n.data.key)}]}if(r?.role!=="assistant")return[];let i=r.parts?.filter(n=>"tag"in n&&n.tag==="request-input-v1");return!i||i.length===0?[]:i.map(n=>!("data"in n)||n.data.type!=="star-rating"&&n.data.type!=="binary-vote"&&n.data.type!=="new-conversation-button"||!$d.includes(n.data.type)?null:{title:String(n.data.title),type:n.data.type,key:String(n.data.key)}).filter(n=>n!==null)}get#T(){if(this.#C.length===0)return!1;let r=this.#C.filter(i=>i.type==="star-rating"||i.type==="binary-vote").length;return this.#r.size<r}get#M(){return this.renderRoot.querySelector("#scrollable-content")}#A(){this.#M?.scrollTo({top:0,behavior:"instant"})}get#b(){return this.renderRoot.querySelector("mw-chat-input")}reloadConfig(){this.#e.value?.reloadConfig(),this.requestUpdate()}sendMessage=as({interval:200},async e=>{if(!e?.trim())return console.warn("sendMessage: Message must be a non-empty string"),!1;M(this.#e.value,"Widget context is required");let{value:r}=this.#e,i=await r.enqueueUserInput(e,{xUserData:r.xUserData,xCustomInstructions:r.xCustomInstructions,role:"user",expectStreaming:!0});return i&&this.#b?.setValue(""),i??!1});setInputValue(e){if(!e||typeof e!="string"){console.warn("setInputValue requires a valid string value");return}let r=this.#b;if(!r){console.warn("input element not found, cannot set value");return}r.setValue?r.setValue(e):console.warn("input element does not have setValue method")}focusInput(){window.requestAnimationFrame(()=>{this.#b?.focus()})}reset(){this.#n.clearFiles(),this.#b?.cancelVoice(),this._voiceError="",this._currentRequestInputIndex=0,this.#r.clear(),this.#e.value?.reset()}};He.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(He.ExpandClickEvent.type,{...e})}};He.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(He.CloseClickEvent.type,{...e})}};customElements.get("mw-chat")||customElements.define("mw-chat",He);var Ge=class t extends w(v){static properties={color:{type:String},disabled:{type:Boolean},placeholder:{type:String},dark:{type:Boolean},_inputValue:{type:String,state:!0}};constructor(){super(),this.color="#8B5CF6",this.disabled=!1,this.placeholder="Ask AI...",this.dark=!1,this._inputValue=""}#e=new Date;#t(e){let r=e.target;this._inputValue=r.value,this.dispatchEvent(new t.ChangeEvent({value:this._inputValue}))}render(){return u`
1501
1591
  <div class="${this.dark?"dark":""} group rounded-[18px] font-sans text-sm shadow-lg transition-transform duration-500 focus-within:scale-100 hover:scale-105">
1502
1592
  <mw-spinning-border .size=${"420px"} .color=${this.color||"#8B5CF6"} .radius=${"18px"} ?dark-mode="${this.dark}">
1503
1593
  <form
@@ -1507,7 +1597,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1507
1597
 
1508
1598
  <input
1509
1599
  ?disabled="${this.disabled}"
1510
- @keydown="${this.#i}"
1600
+ @keydown="${this.#n}"
1511
1601
  @input="${this.#t}"
1512
1602
  .value="${this._inputValue}"
1513
1603
  placeholder="${this.placeholder}"
@@ -1528,7 +1618,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1528
1618
  </form>
1529
1619
  </mw-spinning-border>
1530
1620
  </div>
1531
- `}#r(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;this.#e=r;let n=this._inputValue.trim();n&&this.dispatchEvent(new t.SubmitInputEvent({text:n}))&&(this._inputValue="")}get#n(){return this.renderRoot.querySelector('button[type="submit"]')??null}#i(e){md(e)&&(e.preventDefault(),this.disabled||this.#n?.click())}};Ve.SubmitInputEvent=class extends CustomEvent{static type="mw-floating-ask-ai:submit";constructor(e,r={}){super(Ve.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};Ve.ChangeEvent=class extends CustomEvent{static type="mw-floating-ask-ai:change";constructor(e,r={}){super(Ve.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};function md(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",Ve);var He=class t extends w(v){static properties={text:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
1621
+ `}#r(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;this.#e=r;let n=this._inputValue.trim();n&&this.dispatchEvent(new t.SubmitInputEvent({text:n}))&&(this._inputValue="")}get#i(){return this.renderRoot.querySelector('button[type="submit"]')??null}#n(e){Id(e)&&(e.preventDefault(),this.disabled||this.#i?.click())}};Ge.SubmitInputEvent=class extends CustomEvent{static type="mw-floating-ask-ai:submit";constructor(e,r={}){super(Ge.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};Ge.ChangeEvent=class extends CustomEvent{static type="mw-floating-ask-ai:change";constructor(e,r={}){super(Ge.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};function Id(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",Ge);var Je=class t extends w(v){static properties={text:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
1532
1622
  .popup-desktop:hover button {
1533
1623
  transition-delay: 0s !important;
1534
1624
  }
@@ -1556,7 +1646,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1556
1646
  ×
1557
1647
  </button>
1558
1648
  </div>
1559
- `;#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};He.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(He.CloseEvent.type,{...e})}};He.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(He.ClickEvent.type,{...e})}};customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",He);var Ge=class t extends w(v){static properties={text:{type:String},button:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb",this.darkMode=!1}render(){return u`
1649
+ `;#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};Je.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(Je.CloseEvent.type,{...e})}};Je.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Je.ClickEvent.type,{...e})}};customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",Je);var Xe=class t extends w(v){static properties={text:{type:String},button:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb",this.darkMode=!1}render(){return u`
1560
1650
  <!-- wrapper -->
1561
1651
  <div
1562
1652
  class="${this.darkMode?"dark bg-[#2B2D31] text-gray-200":"bg-white text-gray-800"} group relative z-[2147483647] rounded-t-2xl text-left font-sans text-base text-[16px] leading-normal shadow-2xl transition-all select-none">
@@ -1581,7 +1671,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1581
1671
  <!-- can append any other content -->
1582
1672
  <slot name="footer"></slot>
1583
1673
  </div>
1584
- `}#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};Ge.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(Ge.CloseEvent.type,{...e})}};Ge.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Ge.ClickEvent.type,{...e})}};customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Ge);var ri=class{#e;#t=!1;constructor(e,r){this.#e=r,e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",this.#r),window.addEventListener("keydown",this.#r)}stopListening(){window.removeEventListener("click",this.#r),window.removeEventListener("keydown",this.#r)}#r=()=>{this.#t||(this.#e.userFirstInteracted?.(),this.#t=!0),this.#e.userInteracted?.()}};var gd=1440*60*1e3,ii=class{#e;#t;#r;#n;#i=!1;#s=!1;get showing(){return this.#i}constructor(e,r,i=Date){this.#e=e,this.#t=r,this.#r=i,e.addController(this)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!this.#i&&(this.#i=!0,this.#e.requestUpdate(),e)){this.#t.playPopupSound();let r=this.#t.getPersistedState();this.#t.setPersistedState({...r,playedSoundOnce:!0})}}#o(){let e=this.#t.getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&this.#r.now()-e.userDismissedAt<gd||this.show({sound:!r})}hide(){this.#s=!0,this.abortAutoShowTimer(),this.#i=!1,this.#e.requestUpdate()}abortAutoShowTimer(){clearTimeout(this.#n)}onCloseClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}onContentClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),this.#s||(this.#n=setTimeout(()=>this.#o(),this.#t.getDelayMs()))}};var Gt=class t extends w(v){static properties={positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"}};#e=new ii(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(e=>{console.error("Error playing audio:",e,{})})},setPersistedState:e=>{j().popupState=e},getPersistedState:()=>j().popupState});#t=new ri(this,this.#e);constructor(){super(),this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:"",color:""},mobile:{text:"",button:"",color:"",poweredBy:!0}},this.darkMode=!1}render(){let e=this.#e.showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",r=this.content;return u`
1674
+ `}#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};Xe.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(Xe.CloseEvent.type,{...e})}};Xe.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Xe.ClickEvent.type,{...e})}};customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Xe);var ci=class{#e;#t=!1;constructor(e,r){this.#e=r,e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",this.#r),window.addEventListener("keydown",this.#r)}stopListening(){window.removeEventListener("click",this.#r),window.removeEventListener("keydown",this.#r)}#r=()=>{this.#t||(this.#e.userFirstInteracted?.(),this.#t=!0),this.#e.userInteracted?.()}};var Ad=1440*60*1e3,ui=class{#e;#t;#r;#i;#n=!1;#s=!1;get showing(){return this.#n}constructor(e,r,i=Date){this.#e=e,this.#t=r,this.#r=i,e.addController(this)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!this.#n&&(this.#n=!0,this.#e.requestUpdate(),e)){this.#t.playPopupSound();let r=this.#t.getPersistedState();this.#t.setPersistedState({...r,playedSoundOnce:!0})}}#a(){let e=this.#t.getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&this.#r.now()-e.userDismissedAt<Ad||this.show({sound:!r})}hide(){this.#s=!0,this.abortAutoShowTimer(),this.#n=!1,this.#e.requestUpdate()}abortAutoShowTimer(){clearTimeout(this.#i)}onCloseClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}onContentClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),this.#s||(this.#i=setTimeout(()=>this.#a(),this.#t.getDelayMs()))}};var Qt=class t extends w(v){static properties={positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"}};#e=new ui(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(e=>{console.error("Error playing audio:",e,{})})},setPersistedState:e=>{L().popupState=e},getPersistedState:()=>L().popupState});#t=new ci(this,this.#e);constructor(){super(),this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:"",color:""},mobile:{text:"",button:"",color:"",poweredBy:!0}},this.darkMode=!1}render(){let e=this.#e.showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",r=this.content;return u`
1585
1675
  <!-- mobile shadow backdrop -->
1586
1676
  <div @click="${this.#r}" class="${e} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
1587
1677
 
@@ -1592,7 +1682,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1592
1682
  button="${r.mobile.button}"
1593
1683
  color="${r.mobile.color}"
1594
1684
  ?dark-mode="${this.darkMode}"
1595
- @mw:click="${this.#n}"
1685
+ @mw:click="${this.#i}"
1596
1686
  @mw:close="${this.#r}">
1597
1687
  ${r.mobile.poweredBy?u`<mw-powered-by class="block p-4" slot="footer" ?dark-mode="${this.darkMode}"></mw-powered-by>`:null}
1598
1688
  </mw-popup-mobile>
@@ -1600,9 +1690,9 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1600
1690
 
1601
1691
  <!-- desktop -->
1602
1692
  <div class="${e} ${this.positionClasses} fixed z-[2147483647] transition-[opacity,translate,visibility] max-sm:hidden">
1603
- <mw-popup-desktop color="${r.desktop.color}" text="${r.desktop.text}" ?dark-mode="${this.darkMode}" @mw:click="${this.#n}" @mw:close="${this.#r}"></mw-popup-desktop>
1693
+ <mw-popup-desktop color="${r.desktop.color}" text="${r.desktop.text}" ?dark-mode="${this.darkMode}" @mw:click="${this.#i}" @mw:close="${this.#r}"></mw-popup-desktop>
1604
1694
  </div>
1605
- `}#r(){this.#e.onCloseClick()}#n(){this.dispatchEvent(new t.ClickEvent),this.#e.onContentClick()}hide(){this.#e.hide()}};Gt.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Gt.ClickEvent.type,{...e})}};customElements.get("mw-popup")||customElements.define("mw-popup",Gt);var ns=class extends w(v){static properties={color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}};constructor(){super(),this.color="sky-500",this.position="top-right"}render=()=>u`
1695
+ `}#r(){this.#e.onCloseClick()}#i(){this.dispatchEvent(new t.ClickEvent),this.#e.onContentClick()}hide(){this.#e.hide()}};Qt.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Qt.ClickEvent.type,{...e})}};customElements.get("mw-popup")||customElements.define("mw-popup",Qt);var ps=class extends w(v){static properties={color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}};constructor(){super(),this.color="sky-500",this.position="top-right"}render=()=>u`
1606
1696
  <span class="relative inline-flex">
1607
1697
  <slot></slot>
1608
1698
  <span class="${this.#e} pointer-events-none absolute z-10 flex h-3 w-3">
@@ -1610,7 +1700,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1610
1700
  <span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
1611
1701
  </span>
1612
1702
  </span>
1613
- `;get#e(){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}`)}}};customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",ns);var ss=class extends w(v){static properties={positionClasses:{type:String,attribute:"position"},text:{type:String}};constructor(){super(),this.positionClasses="",this.text="Try it out"}render=()=>u`
1703
+ `;get#e(){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}`)}}};customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",ps);var hs=class extends w(v){static properties={positionClasses:{type:String,attribute:"position"},text:{type:String}};constructor(){super(),this.positionClasses="",this.text="Try it out"}render=()=>u`
1614
1704
  <div class="${this.positionClasses} fixed right-6 bottom-24 z-10 flex animate-bounce flex-col items-center justify-center font-sans text-base">
1615
1705
  <p class="mb-2 -translate-x-4 -rotate-12 transform text-lg leading-normal font-bold text-gray-800">${this.text}</p>
1616
1706
 
@@ -1623,24 +1713,24 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1623
1713
  stroke-linecap="round"></path>
1624
1714
  </svg>
1625
1715
  </div>
1626
- `};customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",ss);function he(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}function Xe(t,e){try{window.dispatchEvent(new CustomEvent(t,{detail:e}))}catch(r){console.error(r)}try{let r=he();if(!r)return;switch(t){case"molin:ready":r.onReady?.(e);break;case"molin:chat-open":r.onChatOpen?.(e);break;case"molin:chat-close":r.onChatClose?.(e);break;case"molin:message-sent":r.onMessageSent?.(e);break;case"molin:link-click":r.onLinkClick?.(e);break}}catch(r){console.error(r)}}var ni=class{#e;#t;#r;#n;isLoading=!1;data=void 0;constructor(e,r,i){this.#e=e,this.#t=r,this.#r=i,e.addController(this)}fetch(){if(this.isLoading)return;this.#n?.abort();let e=new AbortController;this.#n=e,this.isLoading=!0,this.data=void 0,this.#e.requestUpdate(),(async()=>{let r=this.#i();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 this.#r?.transform=="function"?await this.#r.transform(r):r,this.#e.requestUpdate()}).catch(r=>{this.#r?.onError?.(r),this.isLoading=!1,this.data=void 0,this.#e.requestUpdate()}).finally(()=>{e.abort()})}#i(){let e=this.#t;if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)}hostConnected(){this.isLoading||this.#r?.fetchWhenConnected&&this.fetch()}hostDisconnected(){this.#n?.abort(),this.#n=void 0}};var os=class{#e;#t;#r;#n;get data(){return this.#n||this.#r?.data}constructor(e,r){this.#e=e,this.#t=r,e.addController(this)}hostConnected(){if(this.#r||this.#n)return;let e=al();e&&e.widgetId===this.#e.widgetId?this.#n=e.config:this.#r=new ni(this.#e,()=>{if(this.#e.cdn&&this.#e.widgetId)return`${this.#e.cdn}/config?w=${this.#e.widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:async r=>{let i=await r.json();return i&&!e&&window.__INIT_MOLIN_SHOP_AI({cdn:this.#e.cdn,widgetId:this.#e.widgetId,config:i}),i},onError:this.#t?.onError})}},yt=(t,e)=>new os(t,{onError:e?.onError||console.error,...e});var si=class{#e=[];#t;#r=!1;#n;#i;#s;#o;#a;constructor({send:e,sendBeacon:r,maxBufferSize:i=10,flushIntervalMs:n=5*1e3,sendTimeoutMs:s=10*1e3}){this.#n=e,this.#i=r,this.#s=i,this.#o=n,this.#a=s}async add(e){if(this.#e.push(e),this.#e.length>=this.#s)return this.flush();this.#l()}async flush(){if(this.#r||this.#e.length===0)return;this.#r=!0,clearTimeout(this.#t),this.#t=void 0;let e=[...this.#e];this.#e=[];let r=new AbortController,i=setTimeout(()=>r.abort(),this.#a);try{await this.#n(e,r.signal)}catch(n){console.error("sending events failed",n),this.#e=[...e,...this.#e]}finally{clearTimeout(i),this.#r=!1,this.#l()}}async flushBeacon(){if(this.#e.length>0)try{this.#i(this.#e)}catch(e){console.error("Failed to send final events:",e)}}#l(){this.#e.length!==0&&(this.#t||(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#o)))}};function ll(t){t?.body?.cancel().catch(console.warn)}function ul(){return new URL("/widgets/data/collect",ti())}var cl;function yd(){return cl??=new si({send:async(t,e)=>bd(t,{signal:e}),sendBeacon:t=>navigator.sendBeacon(ul(),dl(t))}),cl}function J(t,e,{flush:r=!1,now:i=new Date,buffer:n=yd(),storage:s=j(),window:o=globalThis}={}){if(typeof t!="string")throw new TypeError("ClickHouse: event name must be a string");if(!e||typeof e!="object")throw new TypeError("ClickHouse: properties must be an object");try{let a=vd(t,e,{storage:s,window:o,now:i});n.add(a).catch(console.error),r&&n.flush().catch(console.error)}catch(a){console.error("Failed to send event:",a)}}function dl(t){let e=new FormData;return e.set("events",JSON.stringify(t)),e}async function bd(t,{signal:e}={}){let r=await fetch(ul(),{method:"POST",body:dl(t),signal:e});if(ll(r),!r.ok)throw new Error(`HTTP error! status: ${r.status}`)}function vd(t,e,{storage:r,window:i,now:n}){return{event:t,widget_id:e.widgetId,properties:Object.assign({},e,xd({window:i,now:n})),distinct_id:wd({storage:r,window:i}),timestamp:n.toISOString()}}function wd({storage:t,window:e}){let r=t.distinctID;if(r&&typeof r=="string")return r;let i=e.crypto.randomUUID();try{t.distinctID=i}catch(n){console.error("Failed to store distinct_id:",n)}return i}function xd({window:t,now:e}){return{referrer:t.document.referrer,userAgent:t.navigator.userAgent,language:t.navigator.language,screenWidth:t.innerWidth,screenHeight:t.innerHeight,timestamp:e.toISOString(),timezoneOffset:e.getTimezoneOffset(),doNotTrack:t.navigator.doNotTrack??void 0}}function oi(t,e=globalThis){try{(!("dataLayer"in e)||!Array.isArray(e.dataLayer))&&(e.dataLayer=[]),t(e.dataLayer)}catch(r){console.error(r)}}function Xt(t,e){oi(r=>{r.push(t)},e)}function pl(t,e){t.items.length&&oi(r=>{r.push({ecommerce:null}),r.push({event:"view_item_list",ecommerce:t})},e)}function hl(t,e){oi(r=>{r.push({ecommerce:null}),r.push({event:"select_item",ecommerce:t})},e)}function fl(t,e){oi(r=>{r.push({ecommerce:null}),r.push({event:"view_item",ecommerce:t})},e)}function _d(t,e=globalThis){try{"klaviyo"in e&&e.klaviyo&&typeof e.klaviyo.push=="function"&&t(e.klaviyo)}catch(r){console.error(r)}}function Jt(t,e){_d(r=>{r.push(["track",t])},e)}function as(t,e=globalThis){try{"clarity"in e&&typeof e.clarity=="function"&&t(e.clarity)}catch(r){console.error(r)}}var ml=!1;function Kt(t,e){ml||as(r=>{r("set","molin_widget_id",t),ml=!0},e)}function Yt(t,e){as(r=>{r("event",t)},e)}function gl(t,e){as(r=>{r("upgrade",t)},e)}function ai(){return{onError:t=>{console.error("Molin","ERROR",t.widgetId,t.error),J("ShopAssistant: error",{...t},{flush:!0}),alert(t.error)},onNewMessageStartedStreaming:t=>{J("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{J("ShopAssistant: user received bot message (streaming ended)",t),t.products.length&&pl({item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",items:t.products.map((e,r)=>({item_name:e.name,price:0,index:r,item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",google_business_vertical:"retail"}))})},onUserCanceledStreaming:t=>{J("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{if(J("ShopAssistant: user clicked link",t),Xt({event:"molin_link_click",widget_id:t.widgetId,url:t.url}),t.product){let e={item_name:t.product.name,price:0,index:t.product.rank,item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",google_business_vertical:"retail"};hl({item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",items:[e]}),fl({items:[e]})}Kt(t.widgetId),Yt("molin_link_click"),Jt("molin_link_click"),Xe("molin:link-click",{widgetId:t.widgetId,url:t.url})},onUserSentInput:t=>{J("ShopAssistant: user sent input",t),Xt({event:"molin_message_sent",widget_id:t.widgetId}),Kt(t.widgetId),Yt("molin_message_sent"),gl("molin_message_sent"),Jt("molin_message_sent"),Xe("molin:message-sent",{widgetId:t.widgetId})},onWaitGameQuestionAnswered:t=>{J("ShopAssistant: wait game question answered",t)},onWaitGameCompleted:t=>{J("ShopAssistant: wait game completed",t)},onWaitGameGuessValidated:t=>{J("ShopAssistant: wait game guess validated",t)}}}function yl(){return{onPageview:t=>{J("ShopAssistant: pageview",t)},onChatOpen:({widgetId:t,source:e})=>{J("ShopAssistant: user toggled window",{widgetId:t,source:e,state:"open"}),Xt({event:"molin_chat_open",widget_id:t}),Kt(t),Yt("molin_chat_open"),Jt("molin_chat_open"),Xe("molin:chat-open",{widgetId:t})},onChatClose:({widgetId:t,source:e})=>{J("ShopAssistant: user toggled window",{widgetId:t,source:e,state:"close"}),Xt({event:"molin_chat_close",widget_id:t}),Kt(t),Yt("molin_chat_close"),Jt("molin_chat_close"),Xe("molin:chat-close",{widgetId:t})},onShowLauncher:({widgetId:t,source:e})=>{J("ShopAssistant: called show launcher",{widgetId:t,source:e})},onHideLauncher:({widgetId:t,source:e})=>{J("ShopAssistant: called hide launcher",{widgetId:t,source:e})}}}var we=class t extends w(v){static styles=O`
1716
+ `};customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",hs);function fe(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}function Ye(t,e){try{window.dispatchEvent(new CustomEvent(t,{detail:e}))}catch(r){console.error(r)}try{let r=fe();if(!r)return;switch(t){case"molin:ready":r.onReady?.(e);break;case"molin:chat-open":r.onChatOpen?.(e);break;case"molin:chat-close":r.onChatClose?.(e);break;case"molin:message-sent":r.onMessageSent?.(e);break;case"molin:link-click":r.onLinkClick?.(e);break}}catch(r){console.error(r)}}var di=class{#e;#t;#r;#i;isLoading=!1;data=void 0;constructor(e,r,i){this.#e=e,this.#t=r,this.#r=i,e.addController(this)}fetch(){if(this.isLoading)return;this.#i?.abort();let e=new AbortController;this.#i=e,this.isLoading=!0,this.data=void 0,this.#e.requestUpdate(),(async()=>{let r=this.#n();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 this.#r?.transform=="function"?await this.#r.transform(r):r,this.#e.requestUpdate()}).catch(r=>{this.#r?.onError?.(r),this.isLoading=!1,this.data=void 0,this.#e.requestUpdate()}).finally(()=>{e.abort()})}#n(){let e=this.#t;if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)}hostConnected(){this.isLoading||this.#r?.fetchWhenConnected&&this.fetch()}hostDisconnected(){this.#i?.abort(),this.#i=void 0}};var fs=class{#e;#t;#r;#i;get data(){return this.#i||this.#r?.data}constructor(e,r){this.#e=e,this.#t=r,e.addController(this)}hostConnected(){if(this.#r||this.#i)return;let e=fl();e&&e.widgetId===this.#e.widgetId?this.#i=e.config:this.#r=new di(this.#e,()=>{if(this.#e.cdn&&this.#e.widgetId)return`${this.#e.cdn}/config?w=${this.#e.widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:async r=>{let i=await r.json();return i&&!e&&window.__INIT_MOLIN_SHOP_AI({cdn:this.#e.cdn,widgetId:this.#e.widgetId,config:i}),i},onError:this.#t?.onError})}},wt=(t,e)=>new fs(t,{onError:e?.onError||console.error,...e});var pi=class{#e=[];#t;#r=!1;#i;#n;#s;#a;#o;constructor({send:e,sendBeacon:r,maxBufferSize:i=10,flushIntervalMs:n=5*1e3,sendTimeoutMs:s=10*1e3}){this.#i=e,this.#n=r,this.#s=i,this.#a=n,this.#o=s}async add(e){if(this.#e.push(e),this.#e.length>=this.#s)return this.flush();this.#l()}async flush(){if(this.#r||this.#e.length===0)return;this.#r=!0,clearTimeout(this.#t),this.#t=void 0;let e=[...this.#e];this.#e=[];let r=new AbortController,i=setTimeout(()=>r.abort(),this.#o);try{await this.#i(e,r.signal)}catch(n){console.error("sending events failed",n),this.#e=[...e,...this.#e]}finally{clearTimeout(i),this.#r=!1,this.#l()}}async flushBeacon(){if(this.#e.length>0)try{this.#n(this.#e)}catch(e){console.error("Failed to send final events:",e)}}#l(){this.#e.length!==0&&(this.#t||(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#a)))}};function ml(t){t?.body?.cancel().catch(console.warn)}function yl(){return new URL("/widgets/data/collect",li())}var gl;function Td(){return gl??=new pi({send:async(t,e)=>Md(t,{signal:e}),sendBeacon:t=>navigator.sendBeacon(yl(),bl(t))}),gl}function j(t,e,{flush:r=!1,now:i=new Date,buffer:n=Td(),storage:s=L(),window:o=globalThis}={}){if(typeof t!="string")throw new TypeError("ClickHouse: event name must be a string");if(!e||typeof e!="object")throw new TypeError("ClickHouse: properties must be an object");try{let a=Dd(t,e,{storage:s,window:o,now:i});n.add(a).catch(console.error),r&&n.flush().catch(console.error)}catch(a){console.error("Failed to send event:",a)}}function bl(t){let e=new FormData;return e.set("events",JSON.stringify(t)),e}async function Md(t,{signal:e}={}){let r=await fetch(yl(),{method:"POST",body:bl(t),signal:e});if(ml(r),!r.ok)throw new Error(`HTTP error! status: ${r.status}`)}function Dd(t,e,{storage:r,window:i,now:n}){return{event:t,widget_id:e.widgetId,properties:Object.assign({},e,Pd({window:i,now:n})),distinct_id:Od({storage:r,window:i}),timestamp:n.toISOString()}}function Od({storage:t,window:e}){let r=t.distinctID;if(r&&typeof r=="string")return r;let i=e.crypto.randomUUID();try{t.distinctID=i}catch(n){console.error("Failed to store distinct_id:",n)}return i}function Pd({window:t,now:e}){return{referrer:t.document.referrer,userAgent:t.navigator.userAgent,language:t.navigator.language,screenWidth:t.innerWidth,screenHeight:t.innerHeight,timestamp:e.toISOString(),timezoneOffset:e.getTimezoneOffset(),doNotTrack:t.navigator.doNotTrack??void 0}}function hi(t,e=globalThis){try{(!("dataLayer"in e)||!Array.isArray(e.dataLayer))&&(e.dataLayer=[]),t(e.dataLayer)}catch(r){console.error(r)}}function Zt(t,e){hi(r=>{r.push(t)},e)}function vl(t,e){t.items.length&&hi(r=>{r.push({ecommerce:null}),r.push({event:"view_item_list",ecommerce:t})},e)}function wl(t,e){hi(r=>{r.push({ecommerce:null}),r.push({event:"select_item",ecommerce:t})},e)}function xl(t,e){hi(r=>{r.push({ecommerce:null}),r.push({event:"view_item",ecommerce:t})},e)}function Ud(t,e=globalThis){try{"klaviyo"in e&&e.klaviyo&&typeof e.klaviyo.push=="function"&&t(e.klaviyo)}catch(r){console.error(r)}}function er(t,e){Ud(r=>{r.push(["track",t])},e)}function ms(t,e=globalThis){try{"clarity"in e&&typeof e.clarity=="function"&&t(e.clarity)}catch(r){console.error(r)}}var kl=!1;function tr(t,e){kl||ms(r=>{r("set","molin_widget_id",t),kl=!0},e)}function rr(t,e){ms(r=>{r("event",t)},e)}function _l(t,e){ms(r=>{r("upgrade",t)},e)}function fi(){return{onError:t=>{console.error("Molin","ERROR",t.widgetId,t.error),j("ShopAssistant: error",{...t},{flush:!0}),alert(t.error)},onNewMessageStartedStreaming:t=>{j("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{j("ShopAssistant: user received bot message (streaming ended)",t),t.products.length&&vl({item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",items:t.products.map((e,r)=>({item_name:e.name,price:0,index:r,item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",google_business_vertical:"retail"}))})},onUserCanceledStreaming:t=>{j("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{if(j("ShopAssistant: user clicked link",t),Zt({event:"molin_link_click",widget_id:t.widgetId,url:t.url}),t.product){let e={item_name:t.product.name,price:0,index:t.product.rank,item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",google_business_vertical:"retail"};wl({item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",items:[e]}),xl({items:[e]})}tr(t.widgetId),rr("molin_link_click"),er("molin_link_click"),Ye("molin:link-click",{widgetId:t.widgetId,url:t.url})},onUserSentInput:t=>{j("ShopAssistant: user sent input",t),Zt({event:"molin_message_sent",widget_id:t.widgetId}),tr(t.widgetId),rr("molin_message_sent"),_l("molin_message_sent"),er("molin_message_sent"),Ye("molin:message-sent",{widgetId:t.widgetId})},onWaitGameQuestionAnswered:t=>{j("ShopAssistant: wait game question answered",t)},onWaitGameCompleted:t=>{j("ShopAssistant: wait game completed",t)},onWaitGameGuessValidated:t=>{j("ShopAssistant: wait game guess validated",t)},onVoiceRecordingStarted:t=>{j("ShopAssistant: voice recording started",t)},onVoiceRecordingCompleted:t=>{j("ShopAssistant: voice recording completed",t)},onVoiceTranscriptionCompleted:t=>{j("ShopAssistant: voice transcription completed",t)},onVoiceTranscriptionFailed:t=>{j("ShopAssistant: voice transcription failed",t)},onVoicePermissionDenied:t=>{j("ShopAssistant: voice permission denied",t)}}}function Cl(){return{onPageview:t=>{j("ShopAssistant: pageview",t)},onChatOpen:({widgetId:t,source:e})=>{j("ShopAssistant: user toggled window",{widgetId:t,source:e,state:"open"}),Zt({event:"molin_chat_open",widget_id:t}),tr(t),rr("molin_chat_open"),er("molin_chat_open"),Ye("molin:chat-open",{widgetId:t})},onChatClose:({widgetId:t,source:e})=>{j("ShopAssistant: user toggled window",{widgetId:t,source:e,state:"close"}),Zt({event:"molin_chat_close",widget_id:t}),tr(t),rr("molin_chat_close"),er("molin_chat_close"),Ye("molin:chat-close",{widgetId:t})},onShowLauncher:({widgetId:t,source:e})=>{j("ShopAssistant: called show launcher",{widgetId:t,source:e})},onHideLauncher:({widgetId:t,source:e})=>{j("ShopAssistant: called hide launcher",{widgetId:t,source:e})}}}var xe=class t extends w(v){static styles=O`
1627
1717
  :host {
1628
1718
  all: initial; /* reset all properties that can pierce the shadow DOM */
1629
1719
  visibility: inherit; /* re-inherit so parent's invisible class propagates */
1630
1720
  pointer-events: inherit; /* re-inherit so parent can disable click interception */
1631
1721
  }
1632
- `;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},showExpand:{type:Boolean,attribute:"show-expand"},expanded:{type:Boolean},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1}};#e;get config(){return this.#t||this.#e.data}#t;#r=ai();constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.showExpand=!1,this.expanded=!1,this.xUserData=he()?.userData,this.xCustomInstructions=he()?.customInstructions,this.#e=yt(this)}render(){return this.config?u`
1722
+ `;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},showExpand:{type:Boolean,attribute:"show-expand"},expanded:{type:Boolean},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1}};#e;get config(){return this.#t||this.#e.data}#t;#r=fi();constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.showExpand=!1,this.expanded=!1,this.xUserData=fe()?.userData,this.xCustomInstructions=fe()?.customInstructions,this.#e=wt(this)}render(){return this.config?u`
1633
1723
  <mw-context-widget .widgetId="${this.widgetId}" .config="${this.config}" .callbacks="${this.#r}" .xUserData="${this.xUserData}" .xCustomInstructions="${this.xCustomInstructions}">
1634
1724
  <!-- embed our chat component forwarding props -->
1635
- <mw-chat ?show-close="${this.showClose}" ?show-expand="${this.showExpand}" ?expanded="${this.expanded}" @mw:close-click="${this.#n}" @mw:expand-click="${this.#i}">
1725
+ <mw-chat ?show-close="${this.showClose}" ?show-expand="${this.showExpand}" ?expanded="${this.expanded}" @mw:close-click="${this.#i}" @mw:expand-click="${this.#n}">
1636
1726
  <slot name="banner" slot="banner"></slot>
1637
1727
  </mw-chat>
1638
1728
  </mw-context-widget>
1639
- `:null}#n(){this.dispatchEvent(new t.CloseClickEvent)}#i(){this.dispatchEvent(new t.ExpandClickEvent)}injectConfig(e){this.#t=e,this.requestUpdate()}reloadConfig(){this.#s?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",this.#s?.reset(),this.requestUpdate()}get#s(){return this.renderRoot.querySelector("mw-chat")}get conversationId(){return this.#s?.conversationId??""}get messages(){return this.#s?.messages??[]}};we.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(we.CloseClickEvent.type,{...e})}};we.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(we.ExpandClickEvent.type,{...e})}};customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",we);var ls=class{#e;#t;get hidden(){return this.#e}get version(){return this.#t}constructor({hidden:e,version:r}){this.#e=e,this.#t=r}setHidden(e){this.#e=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 xe&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof xe&&e.hideLauncher()}openChat(e){let{message:r,autoSend:i}=e||{};for(let n of document.querySelectorAll("molin-shop-ai"))n instanceof xe&&n.openChat({message:r,autoSend:i})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof xe&&e.closeChat()}reset(){j().resetAll();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof xe&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof we&&e.reset()}};function bl({hidden:t,version:e}){let r=new ls({hidden:t,version:e});return window.Molin=r,r}function li(){let t=window.Molin;if(!t)throw new Error("window.Molin global not initialized");return t}window.__INIT_MOLIN_SHOP_AI=function(e){Cd(e);let r=he(),i=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(bl({hidden:i,version:e.version}),e.auto){let n=document.createElement("molin-shop-ai");n.setAttribute("cdn",e.cdn),n.setAttribute("widget",e.widgetId),document.body.appendChild(n)}Xe("molin:ready",{widgetId:e.widgetId})};function Cd(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function al(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var cs=class extends w(v){static styles=O`
1729
+ `:null}#i(){this.dispatchEvent(new t.CloseClickEvent)}#n(){this.dispatchEvent(new t.ExpandClickEvent)}injectConfig(e){this.#t=e,this.requestUpdate()}reloadConfig(){this.#s?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",this.#s?.reset(),this.requestUpdate()}get#s(){return this.renderRoot.querySelector("mw-chat")}get conversationId(){return this.#s?.conversationId??""}get messages(){return this.#s?.messages??[]}};xe.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(xe.CloseClickEvent.type,{...e})}};xe.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(xe.ExpandClickEvent.type,{...e})}};customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",xe);var gs=class{#e;#t;get hidden(){return this.#e}get version(){return this.#t}constructor({hidden:e,version:r}){this.#e=e,this.#t=r}setHidden(e){this.#e=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 ke&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ke&&e.hideLauncher()}openChat(e){let{message:r,autoSend:i}=e||{};for(let n of document.querySelectorAll("molin-shop-ai"))n instanceof ke&&n.openChat({message:r,autoSend:i})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ke&&e.closeChat()}reset(){L().resetAll();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ke&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof xe&&e.reset()}};function El({hidden:t,version:e}){let r=new gs({hidden:t,version:e});return window.Molin=r,r}function mi(){let t=window.Molin;if(!t)throw new Error("window.Molin global not initialized");return t}window.__INIT_MOLIN_SHOP_AI=function(e){Ld(e);let r=fe(),i=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(El({hidden:i,version:e.version}),e.auto){let n=document.createElement("molin-shop-ai");n.setAttribute("cdn",e.cdn),n.setAttribute("widget",e.widgetId),document.body.appendChild(n)}Ye("molin:ready",{widgetId:e.widgetId})};function Ld(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function fl(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var ys=class extends w(v){static styles=O`
1640
1730
  :host {
1641
1731
  all: initial; /* reset all properties that can pierce the shadow DOM */
1642
1732
  }
1643
- `;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}#e=yt(this);get config(){return this.#e.data}render(){return this.config?u`
1733
+ `;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}#e=wt(this);get config(){return this.#e.data}render(){return this.config?u`
1644
1734
  <!-- embed our bubble component forwarding props -->
1645
1735
  <!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
1646
1736
  <mw-bubble
@@ -1648,32 +1738,32 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1648
1738
  .color="${this.config?.bubble?.color||this.config?.color}"
1649
1739
  .bubbleStyle="${this.config?.bubble?.style}"
1650
1740
  .src="${this.config?.bubble?.bubbleUrl}"
1651
- width="${N(this.config?.bubble?.size?.width)}"
1652
- height="${N(this.config?.bubble?.size?.height)}"></mw-bubble>
1653
- `:null}};customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",cs);var T1="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),D1="navigator"in globalThis&&"share"in navigator,Ed=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function $d(t){if(typeof window>"u")return!1;let e=Ed[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function us(){return $d("sm")}var ci=class{#e;#t;#r;#n;#i=!1;constructor(e,r,i,n=window.history){this.#e=e,this.#t=r,this.#r=i,this.#n=n,e.addController(this)}hostConnected(){this.#s();let e=this.#n.pushState;this.#n.pushState=(...r)=>{if(e.call(this.#n,...r),!this.#i)try{let i=new URL(r[2],window.location.origin);this.#t.test(i.pathname)&&this.#r.navigated()}catch{}}}hostDisconnected(){this.#i=!0}#s=()=>{this.#t.test(window.location.pathname)&&this.#r.navigated()}};var ds=class{#e;#t;constructor(e,r){this.#t=r,e.addController(this)}request(){this.cancel(),this.#e=requestAnimationFrame(this.#t)}cancel(){this.#e!==void 0&&(cancelAnimationFrame(this.#e),this.#e=void 0)}get pending(){return this.#e!==void 0}hostDisconnected(){this.cancel()}};function vl(t,e){return new ds(t,e)}function wl({minMs:t,maxMs:e}){return Math.random()*(e-t)+t}function ui(t,e=""){return Object.entries(t).filter(([r,i])=>i).map(([r,i])=>`${e}${r}-[${i}]`).join(" ")}function xl(t,e={}){return[ui(t),ui(e,"max-sm:")].join(" ")}function kl(t){return ui(t)}function _l(t){return Object.entries(t).filter(([e,r])=>r).filter(([e])=>e==="left"||e==="right").map(([e,r])=>{let i=`sm:${e}-[${r}]`;return e==="left"&&(i+=" sm:right-auto"),e==="right"&&(i+=" sm:left-auto"),i}).join(" ")}function Cl(t){let e=ui(t),i=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,i].filter(Boolean).join(" ")}var ps=class{#e=0;#t;#r;#n;constructor(e,r,{threshold:i=5}={}){this.#t=r,this.#r=i,e.addController(this)}hostConnected(){this.#e=window.scrollY,window.removeEventListener("scroll",this.#i),window.addEventListener("scroll",this.#i,{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",this.#i),this.#n!==void 0&&(cancelAnimationFrame(this.#n),this.#n=void 0)}#i=()=>{this.#n===void 0&&(this.#n=requestAnimationFrame(this.#s))};#s=()=>{this.#n=void 0;let e=window.scrollY,r=e-this.#e;if(Math.abs(r)>=this.#r){let i=r>0?"down":"up";this.#t({scrollY:e,direction:i,deltaY:Math.abs(r)}),this.#e=e}}};function El(t,e,r){return new ps(t,e,r)}var xe=class extends w(v){static styles=O`
1741
+ width="${z(this.config?.bubble?.size?.width)}"
1742
+ height="${z(this.config?.bubble?.size?.height)}"></mw-bubble>
1743
+ `:null}};customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",ys);var f2="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),m2="navigator"in globalThis&&"share"in navigator,jd=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function Fd(t){if(typeof window>"u")return!1;let e=jd[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function bs(){return Fd("sm")}var gi=class{#e;#t;#r;#i;#n=!1;constructor(e,r,i,n=window.history){this.#e=e,this.#t=r,this.#r=i,this.#i=n,e.addController(this)}hostConnected(){this.#s();let e=this.#i.pushState;this.#i.pushState=(...r)=>{if(e.call(this.#i,...r),!this.#n)try{let i=new URL(r[2],window.location.origin);this.#t.test(i.pathname)&&this.#r.navigated()}catch{}}}hostDisconnected(){this.#n=!0}#s=()=>{this.#t.test(window.location.pathname)&&this.#r.navigated()}};function Sl({minMs:t,maxMs:e}){return Math.random()*(e-t)+t}function yi(t,e=""){return Object.entries(t).filter(([r,i])=>i).map(([r,i])=>`${e}${r}-[${i}]`).join(" ")}function $l(t,e={}){return[yi(t),yi(e,"max-sm:")].join(" ")}function Il(t){return yi(t)}function Al(t){return Object.entries(t).filter(([e,r])=>r).filter(([e])=>e==="left"||e==="right").map(([e,r])=>{let i=`sm:${e}-[${r}]`;return e==="left"&&(i+=" sm:right-auto"),e==="right"&&(i+=" sm:left-auto"),i}).join(" ")}function Tl(t){let e=yi(t),i=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,i].filter(Boolean).join(" ")}var vs=class{#e=0;#t;#r;#i;constructor(e,r,{threshold:i=5}={}){this.#t=r,this.#r=i,e.addController(this)}hostConnected(){this.#e=window.scrollY,window.removeEventListener("scroll",this.#n),window.addEventListener("scroll",this.#n,{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",this.#n),this.#i!==void 0&&(cancelAnimationFrame(this.#i),this.#i=void 0)}#n=()=>{this.#i===void 0&&(this.#i=requestAnimationFrame(this.#s))};#s=()=>{this.#i=void 0;let e=window.scrollY,r=e-this.#e;if(Math.abs(r)>=this.#r){let i=r>0?"down":"up";this.#t({scrollY:e,direction:i,deltaY:Math.abs(r)}),this.#e=e}}};function Ml(t,e,r){return new vs(t,e,r)}var ke=class extends w(v){static styles=O`
1654
1744
  :host {
1655
1745
  all: initial; /* reset all properties that can pierce the shadow DOM */
1656
1746
  }
1657
- `;static 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},_expanded:{type:Boolean,state:!0}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.xUserData=he()?.userData,this.xCustomInstructions=he()?.customInstructions,this._floatingInputVisible=!0,this._dialogShown=!1,this._expanded=!1}#e=yt(this);#t=El(this,e=>{this.#d&&!this._dialogShown&&(e.direction==="down"?this._floatingInputVisible=!1:e.direction==="up"&&(this._floatingInputVisible=!0),this.requestUpdate())},{threshold:20});get config(){return this.#r||this.#e.data}#r;#n=new ci(this,/.*/i,{navigated:()=>{if(this.requestUpdate(),!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let e=this.#m?.conversationId,r=rt.restore(this.widgetId)?.conversationId,i=e||r;i&&this.#a.onPageview({widgetId:this.widgetId,conversationId:i,url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0,shouldHideForCurrentUrl:this.#u})}});#i=!1;#s=vl(this,()=>{this._dialogShown=!0});#o=ai();#a=yl();#l=Se(this);get#c(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647}get#d(){return this.config?.floatingAskAI?.enabled||!0}get#u(){if(!this.config?.hideUrls||!Array.isArray(this.config.hideUrls))return!1;let e=window.location.href,r=window.location.pathname;return this.config.hideUrls.some(i=>{if(!i||typeof i!="string")return!1;let n=i.endsWith("*"),s=n?i.slice(0,-1):i;return i.startsWith("http")?n?e.startsWith(s):e===s:n?r.startsWith(s):r===s})}render(){if(!this.config)return null;let e=xl(this.config.bubble.position,this.config.bubble.mobilePosition),r=kl(this.config.bubble.position),i=_l(this.config.bubble.position),n=Cl(this.config.bubble.position);return this.config.hidden||li().hidden||this.#u?null:u`
1747
+ `;static 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},_expanded:{type:Boolean,state:!0}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.xUserData=fe()?.userData,this.xCustomInstructions=fe()?.customInstructions,this._floatingInputVisible=!0,this._dialogShown=!1,this._expanded=!1}#e=wt(this);#t=Ml(this,e=>{this.#u&&!this._dialogShown&&(e.direction==="down"?this._floatingInputVisible=!1:e.direction==="up"&&(this._floatingInputVisible=!0),this.requestUpdate())},{threshold:20});get config(){return this.#r||this.#e.data}#r;#i=new gi(this,/.*/i,{navigated:()=>{if(this.requestUpdate(),!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let e=this.#f?.conversationId,r=nt.restore(this.widgetId)?.conversationId,i=e||r;i&&this.#o.onPageview({widgetId:this.widgetId,conversationId:i,url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0,shouldHideForCurrentUrl:this.#d})}});#n=!1;#s=ca(this,()=>{this._dialogShown=!0});#a=fi();#o=Cl();#l=Ie(this);get#c(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647}get#u(){return this.config?.floatingAskAI?.enabled||!0}get#d(){if(!this.config?.hideUrls||!Array.isArray(this.config.hideUrls))return!1;let e=window.location.href,r=window.location.pathname;return this.config.hideUrls.some(i=>{if(!i||typeof i!="string")return!1;let n=i.endsWith("*"),s=n?i.slice(0,-1):i;return i.startsWith("http")?n?e.startsWith(s):e===s:n?r.startsWith(s):r===s})}render(){if(!this.config)return null;let e=$l(this.config.bubble.position,this.config.bubble.mobilePosition),r=Il(this.config.bubble.position),i=Al(this.config.bubble.position),n=Tl(this.config.bubble.position);return this.config.hidden||mi().hidden||this.#d?null:u`
1658
1748
  <mw-bubble
1659
1749
  class="${e} ${this._dialogShown?"opacity-0":"opacity-100"} fixed z-[${this.#c}] transition-opacity"
1660
- @click="${this.#w}"
1750
+ @click="${this.#_}"
1661
1751
  state="${this._dialogShown?"close":"open"}"
1662
1752
  .color="${this.config?.bubble?.color||this.config?.color}"
1663
1753
  .bubbleStyle="${this.config?.bubble?.style}"
1664
1754
  .src="${this.config?.bubble?.bubbleUrl}"
1665
- width="${N(this.config?.bubble?.size?.width)}"
1666
- height="${N(this.config?.bubble?.size?.height)}"></mw-bubble>
1755
+ width="${z(this.config?.bubble?.size?.width)}"
1756
+ height="${z(this.config?.bubble?.size?.height)}"></mw-bubble>
1667
1757
 
1668
1758
  <!-- only load the component if enabled on any platform -->
1669
1759
  ${this.isPopupEnabled?u`
1670
1760
  <mw-popup
1671
1761
  position="${n}"
1672
- delay="${this.config.popup?.delayMs||wl({minMs:2e3,maxMs:5e3})}"
1762
+ delay="${this.config.popup?.delayMs||Sl({minMs:2e3,maxMs:5e3})}"
1673
1763
  sound="${this.config.popup?.muteSounds?"":this.config.popup?.soundUrl||""}"
1674
1764
  ?dark-mode="${this.config?.darkMode}"
1675
1765
  .content="${{desktop:{text:this.config.popup?.text||"Hello there. How can we help?",color:this.config?.bubble?.color||this.config.color},mobile:{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}}}"
1676
- @mw:click="${this.#_}"></mw-popup>
1766
+ @mw:click="${this.#k}"></mw-popup>
1677
1767
  `:null}
1678
1768
 
1679
1769
  <!-- show "Try it out" if enabled (even if the chat window is showing) -->
@@ -1685,7 +1775,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1685
1775
  `:null}
1686
1776
 
1687
1777
  <!-- 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. -->
1688
- ${this.#i?u`
1778
+ ${this.#n?u`
1689
1779
  <div
1690
1780
  class="${this._dialogShown?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3 pointer-events-none"} ${i} ${this.config?.darkMode?"bg-[#14161A]":"bg-white"} ${this._expanded?"sm:w-[700px] sm:max-w-[700px] sm:min-w-[300px]":"sm:w-[calc(100dvh*0.50)] sm:max-w-[400px] sm:min-w-[300px] 2xl:max-w-[420px]"} fixed inset-0 z-[2147483647] font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all duration-300 ease-in-out sm:top-auto sm:bottom-6 sm:h-[92%] sm:max-h-[800px] sm:rounded-[36px]">
1691
1781
  <!-- NOTE: molin-shop-ai-chat has all:initial on :host which resets styles -->
@@ -1697,24 +1787,24 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
1697
1787
  ?expanded="${this._expanded}"
1698
1788
  .xUserData="${this.xUserData}"
1699
1789
  .xCustomInstructions="${this.xCustomInstructions}"
1700
- @mw:expand-click="${this.#v}"
1701
- @mw:close-click="${this.#C}">
1790
+ @mw:expand-click="${this.#w}"
1791
+ @mw:close-click="${this.#E}">
1702
1792
  <slot name="banner" slot="banner"></slot>
1703
1793
  </molin-shop-ai-chat>
1704
1794
  </div>
1705
1795
  `:null}
1706
1796
 
1707
1797
  <!-- floating input only visible when enabled, in center, on desktop only -->
1708
- ${this.config?.floatingAskAI?.enabled&&this.#d?u`
1798
+ ${this.config?.floatingAskAI?.enabled&&this.#u?u`
1709
1799
  <mw-floating-ask-ai
1710
1800
  ?dark="${this.config?.floatingAskAI?.darkMode}"
1711
1801
  .color="${this.config.color||this.config?.bubble?.color}"
1712
- placeholder="${N(this.config?.floatingAskAI?.placeholder)}"
1802
+ placeholder="${z(this.config?.floatingAskAI?.placeholder)}"
1713
1803
  class="${!this._dialogShown&&this._floatingInputVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-full"} fixed left-1/2 z-[${this.#c}] hidden -translate-x-1/2 transition-all duration-300 ease-in-out max-md:hidden sm:block"
1714
1804
  style="bottom: ${this.config.bubble.position.bottom||"1.5rem"}"
1715
1805
  @mw-floating-ask-ai:submit="${this.#x}"></mw-floating-ask-ai>
1716
1806
  `:null}
1717
- `}#p({source:e}){this.#i?this._dialogShown=!0:(this.#i=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.#s.request()})),j().widgetState={isOpen:!0},this.#a.onChatOpen({widgetId:this.widgetId,source:e})}#v(){this._expanded=!this._expanded,this.requestUpdate()}#f({source:e}){this._dialogShown=!1,this._expanded=!1,this._floatingInputVisible=!0,j().widgetState={isOpen:!1},this.#a.onChatClose({widgetId:this.widgetId,source:e})}get isPopupEnabled(){return us()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){this._dialogShown&&this.#g?.hide(),this._dialogShown&&this.#l.setTimeout(()=>this.#m?.focusInput(),0)}firstUpdated(){us()&&j().widgetState?.isOpen&&!this._dialogShown&&this.#p({source:"page-navigation-restore"})}get#g(){return this.renderRoot.querySelector("mw-popup")}get#m(){return this.renderRoot.querySelector("molin-shop-ai-chat")?.renderRoot.querySelector("mw-chat")??null}#_(){this.#p({source:"popup-click"})}#w(){this._dialogShown?this.#f({source:"bubble-toggle"}):this.#p({source:"bubble-toggle"}),this.#g?.hide()}#C(){this.#f({source:"top-right-close-button"})}#x=e=>{this.#p({source:"ask-ai"});let r=e.detail.text;this.#l.setTimeout(()=>{this.#h(r),this.#b(r)},100),this.#o.onUserSentInput({widgetId:this.widgetId,text:r,example:!1,conversationId:this.#m?.conversationId||""})};#y=wn({interval:200},({message:e,autoSend:r=!1}={})=>{if(!e)return;this.#h(e);let i=this.#m?.isLiveMode;i||this.reset(),r&&!i&&this.#b(e)});openChat(e){let{message:r,autoSend:i}=e||{};if(this._dialogShown){this.#y({message:r,autoSend:i});return}this.#p({source:"programmatic-method"}),this.#g?.hide(),this.#l.setTimeout(()=>{this.#y({message:r,autoSend:i})},100)}closeChat(){this._dialogShown&&(this.#f({source:"programmatic-method"}),this.#g?.hide())}showLauncher(){li().setHidden(!1),this.requestUpdate(),this.#a.onShowLauncher({widgetId:this.widgetId,source:"programmatic-method"})}hideLauncher(){li().setHidden(!0),this.requestUpdate(),this.#a.onHideLauncher({widgetId:this.widgetId,source:"programmatic-method"})}injectConfig(e){this.#r=e,this.requestUpdate()}reset(){this.xUserData={},this.xCustomInstructions="",this.#m?.reset(),this.requestUpdate()}#b(e){let r=this.#m;if(!r){console.warn("Chat element not found, cannot send message");return}if(!r.sendMessage){console.warn("Chat element does not have sendMessage method, cannot send message");return}r.sendMessage(e)}#h(e){let r=this.#m;if(!r){console.warn("Chat element not found, cannot set input value");return}if(!r.setInputValue){console.warn("Chat element does not have setInputValue method, cannot set input value");return}r.setInputValue(e)}};customElements.get("molin-shop-ai")||customElements.define("molin-shop-ai",xe);export{xe as MolinShopAI};
1807
+ `}#p({source:e}){this.#n?this._dialogShown=!0:(this.#n=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.#s.request()})),L().widgetState={isOpen:!0},this.#o.onChatOpen({widgetId:this.widgetId,source:e})}#w(){this._expanded=!this._expanded,this.requestUpdate()}#h({source:e}){this._dialogShown=!1,this._expanded=!1,this._floatingInputVisible=!0,L().widgetState={isOpen:!1},this.#o.onChatClose({widgetId:this.widgetId,source:e})}get isPopupEnabled(){return bs()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){this._dialogShown&&this.#m?.hide(),this._dialogShown&&this.#l.setTimeout(()=>this.#f?.focusInput(),0)}firstUpdated(){bs()&&L().widgetState?.isOpen&&!this._dialogShown&&this.#p({source:"page-navigation-restore"})}get#m(){return this.renderRoot.querySelector("mw-popup")}get#f(){return this.renderRoot.querySelector("molin-shop-ai-chat")?.renderRoot.querySelector("mw-chat")??null}#k(){this.#p({source:"popup-click"})}#_(){this._dialogShown?this.#h({source:"bubble-toggle"}):this.#p({source:"bubble-toggle"}),this.#m?.hide()}#E(){this.#h({source:"top-right-close-button"})}#x=e=>{this.#p({source:"ask-ai"});let r=e.detail.text;this.#l.setTimeout(()=>{this.#v(r),this.#y(r)},100),this.#a.onUserSentInput({widgetId:this.widgetId,text:r,example:!1,conversationId:this.#f?.conversationId||""})};#g=In({interval:200},({message:e,autoSend:r=!1}={})=>{if(!e)return;this.#v(e);let i=this.#f?.isLiveMode;i||this.reset(),r&&!i&&this.#y(e)});openChat(e){let{message:r,autoSend:i}=e||{};if(this._dialogShown){this.#g({message:r,autoSend:i});return}this.#p({source:"programmatic-method"}),this.#m?.hide(),this.#l.setTimeout(()=>{this.#g({message:r,autoSend:i})},100)}closeChat(){this._dialogShown&&(this.#h({source:"programmatic-method"}),this.#m?.hide())}showLauncher(){mi().setHidden(!1),this.requestUpdate(),this.#o.onShowLauncher({widgetId:this.widgetId,source:"programmatic-method"})}hideLauncher(){mi().setHidden(!0),this.requestUpdate(),this.#o.onHideLauncher({widgetId:this.widgetId,source:"programmatic-method"})}injectConfig(e){this.#r=e,this.requestUpdate()}reset(){this.xUserData={},this.xCustomInstructions="",this.#f?.reset(),this.requestUpdate()}#y(e){let r=this.#f;if(!r){console.warn("Chat element not found, cannot send message");return}if(!r.sendMessage){console.warn("Chat element does not have sendMessage method, cannot send message");return}r.sendMessage(e)}#v(e){let r=this.#f;if(!r){console.warn("Chat element not found, cannot set input value");return}if(!r.setInputValue){console.warn("Chat element does not have setInputValue method, cannot set input value");return}r.setInputValue(e)}};customElements.get("molin-shop-ai")||customElements.define("molin-shop-ai",ke);export{ke as MolinShopAI};
1718
1808
  /*! Bundled license information:
1719
1809
 
1720
1810
  @lit/reactive-element/css-tag.js: