@molin.ai/shop-ai 0.9.70 → 0.9.71

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 Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDescriptor;var Sl=Object.getOwnPropertyNames;var $l=Object.getPrototypeOf,Il=Object.prototype.hasOwnProperty;var Ye=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Al=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Sl(e))!Il.call(t,n)&&n!==r&&fs(t,n,{get:()=>e[n],enumerable:!(i=El(e,n))||i.enumerable});return t};var pi=(t,e,r)=>(r=t!=null?Cl($l(t)):{},Al(e||!t||!t.__esModule?fs(r,"default",{value:t,enumerable:!0}):r,t));var Wi=Ye(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.parseCookie=Xs;le.parse=Xs;le.stringifyCookie=dc;le.stringifySetCookie=xr;le.serialize=xr;le.parseSetCookie=pc;le.stringifySetCookie=xr;le.serialize=xr;var Hs=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,Gs=/^[\u0021-\u003A\u003C-\u007E]*$/,oc=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,ac=/^[\u0020-\u003A\u003D-\u007E]*$/,lc=/^-?\d+$/,cc=Object.prototype.toString,uc=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function Xs(t,e){let r=new uc,i=t.length;if(i<2)return r;let n=e?.decode||Js,s=0;do{let o=zi(t,s,i);if(o===-1)break;let a=Bi(t,s,i);if(o>a){s=t.lastIndexOf(";",o-1)+1;continue}let l=_e(t,s,o);r[l]===void 0&&(r[l]=n(_e(t,o+1,a))),s=a+1}while(s<i);return r}function dc(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(!Hs.test(n))throw new TypeError(`cookie name is invalid: ${n}`);let o=r(s);if(!Gs.test(o))throw new TypeError(`cookie val is invalid: ${s}`);i.push(`${n}=${o}`)}return i.join("; ")}function xr(t,e,r){let i=typeof t=="object"?t:{...r,name:t,value:String(e)},s=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!Hs.test(i.name))throw new TypeError(`argument name is invalid: ${i.name}`);let o=i.value?s(i.value):"";if(!Gs.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(!oc.test(i.domain))throw new TypeError(`option domain is invalid: ${i.domain}`);a+="; Domain="+i.domain}if(i.path){if(!ac.test(i.path))throw new TypeError(`option path is invalid: ${i.path}`);a+="; Path="+i.path}if(i.expires){if(!hc(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 pc(t,e){let r=e?.decode||Js,i=t.length,n=Bi(t,0,i),s=zi(t,0,n),o=s===-1?{name:"",value:r(_e(t,0,n))}:{name:_e(t,0,s),value:r(_e(t,s+1,n))},a=n+1;for(;a<i;){let l=Bi(t,a,i),c=zi(t,a,l),d=c===-1?_e(t,a,l):_e(t,a,c),p=c===-1?void 0:_e(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&&lc.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 Bi(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 _e(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 Js(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function hc(t){return cc.call(t)==="[object Date]"}});var ia=Ye(Fe=>{"use strict";var nu=Fe&&Fe.__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())})},su=Fe&&Fe.__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(Fe,"__esModule",{value:!0});Fe.base64ToBlob=ou;function ou(t){return nu(this,void 0,void 0,function(){var e,r,i;return su(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=lu(t),i&&(r=r.slice(0,r.size,i)),[2,r]}})})}var au=/^data:(.+);base64,/;function lu(t){var e;return(e=t.match(au))===null||e===void 0?void 0:e.slice(1,2).pop()}});var na=Ye(qe=>{"use strict";var cu=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())})},uu=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.base64ToFile=du;function du(t,e,r){return cu(this,void 0,void 0,function(){var i,n;return uu(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=Ye(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=pu;function pu(t){return gn(this,void 0,void 0,function(){return yn(this,function(e){return[2,typeof FileReader=="function"?hu(t):mu(t)]})})}var ct;(function(t){t.error="error",t.loadend="loadend"})(ct||(ct={}));function hu(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(ct.loadend,s)};n.addEventListener(ct.loadend,s);var o=function(){i(n.error),n.removeEventListener(ct.error,o)};n.addEventListener(ct.error,o),n.readAsDataURL(t)}catch(a){i(a)}})]})})}var fu="application/octet-stream";function mu(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||fu,[2,"data:".concat(n,";base64,").concat(e.toString("base64"))]}})})}});var sa=Ye(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.fileToBase64=void 0;var gu=bn();Object.defineProperty(Pr,"fileToBase64",{enumerable:!0,get:function(){return gu.blobToBase64}})});var oa=Ye(ue=>{"use strict";var yu=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]})),Ur=ue&&ue.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yu(e,t,r)};Object.defineProperty(ue,"__esModule",{value:!0});Ur(ia(),ue);Ur(na(),ue);Ur(bn(),ue);Ur(sa(),ue)});var er=globalThis,tr=er.ShadowRoot&&(er.ShadyCSS===void 0||er.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,hi=Symbol(),ms=new WeakMap,kt=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(tr&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=ms.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&ms.set(r,e))}return e}toString(){return this.cssText}},gs=t=>new kt(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 kt(r,t,hi)},ys=(t,e)=>{if(tr)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=er.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},fi=tr?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return gs(r)})(t):t;var{is:Tl,defineProperty:Dl,getOwnPropertyDescriptor:Ml,getOwnPropertyNames:Ol,getOwnPropertySymbols:Pl,getPrototypeOf:Ul}=Object,rr=globalThis,bs=rr.trustedTypes,Ll=bs?bs.emptyScript:"",Rl=rr.reactiveElementPolyfillSupport,_t=(t,e)=>t,mi={toAttribute(t,e){switch(e){case Boolean:t=t?Ll: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}},ws=(t,e)=>!Tl(t,e),vs={attribute:!0,type:String,converter:mi,reflect:!1,useDefault:!1,hasChanged:ws};Symbol.metadata??=Symbol("metadata"),rr.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=vs){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&&Dl(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){let{get:n,set:s}=Ml(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)??vs}static _$Ei(){if(this.hasOwnProperty(_t("elementProperties")))return;let e=Ul(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(_t("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_t("properties"))){let r=this.properties,i=[...Ol(r),...Pl(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 ys(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??ws)(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[_t("elementProperties")]=new Map,me[_t("finalized")]=new Map,Rl?.({ReactiveElement:me}),(rr.reactiveElementVersions??=[]).push("2.1.2");var yi=globalThis,xs=t=>t,ir=yi.trustedTypes,ks=ir?ir.createPolicy("lit-html",{createHTML:t=>t}):void 0,bi="$lit$",ge=`lit$${Math.random().toFixed(9).slice(2)}$`,vi="?"+ge,jl=`<${vi}>`,Pe=document,Et=()=>Pe.createComment(""),St=t=>t===null||typeof t!="object"&&typeof t!="function",wi=Array.isArray,Is=t=>wi(t)||typeof t?.[Symbol.iterator]=="function",gi=`[
2
- \f\r]`,Ct=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_s=/-->/g,Cs=/>/g,Me=RegExp(`>|${gi}(?:([^\\s"'>=/]+)(${gi}*=${gi}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Es=/'/g,Ss=/"/g,As=/^(?:script|style|textarea|title)$/i,xi=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),u=xi(1),Dd=xi(2),Md=xi(3),ne=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),$s=new WeakMap,Oe=Pe.createTreeWalker(Pe,129);function Ts(t,e){if(!wi(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ks!==void 0?ks.createHTML(e):e}var Ds=(t,e)=>{let r=t.length-1,i=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=Ct;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===Ct?d[1]==="!--"?o=_s:d[1]!==void 0?o=Cs:d[2]!==void 0?(As.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Me):d[3]!==void 0&&(o=Me):o===Me?d[0]===">"?(o=n??Ct,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Me:d[3]==='"'?Ss:Es):o===Ss||o===Es?o=Me:o===_s||o===Cs?o=Ct:(o=Me,n=void 0);let y=o===Me&&t[a+1].startsWith("/>")?" ":"";s+=o===Ct?l+jl:p>=0?(i.push(c),l.slice(0,p)+bi+l.slice(p)+ge+y):l+ge+(p===-2?a:y)}return[Ts(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]=Ds(e,r);if(this.el=t.createElement(c,i),Oe.currentNode=this.el.content,r===2||r===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=Oe.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]==="."?sr:f[1]==="?"?or:f[1]==="@"?ar:Le}),n.removeAttribute(p)}else p.startsWith(ge)&&(l.push({type:6,index:s}),n.removeAttribute(p));if(As.test(n.tagName)){let p=n.textContent.split(ge),h=p.length-1;if(h>0){n.textContent=ir?ir.emptyScript:"";for(let y=0;y<h;y++)n.append(p[y],Et()),Oe.nextNode(),l.push({type:2,index:++s});n.append(p[h],Et())}}}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=Pe.createElement("template");return i.innerHTML=e,i}};function Ue(t,e,r=t,i){if(e===ne)return e;let n=i!==void 0?r._$Co?.[i]:r._$Cl,s=St(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=Ue(t,n._$AS(t,e.values),n,i)),e}var nr=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??Pe).importNode(r,!0);Oe.currentNode=n;let s=Oe.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 lr(s,this,e)),this._$AV.push(c),l=i[++a]}o!==l?.index&&(s=Oe.nextNode(),o++)}return Oe.currentNode=Pe,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=Ue(this,e,r),St(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):Is(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&&St(this._$AH)?this._$AA.nextSibling.data=e:this.T(Pe.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(Ts(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(r);else{let s=new nr(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(Et()),this.O(Et()),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=xs(e).nextSibling;xs(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Le=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=Ue(this,e,r,0),o=!St(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=Ue(this,a[i+l],r,l),c===ne&&(c=this._$AH[l]),o||=!St(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??"")}},sr=class extends Le{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}},or=class extends Le{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==U)}},ar=class extends Le{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){if((e=Ue(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)}},lr=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){Ue(this,e)}},Ms={M:bi,P:ge,A:vi,C:1,L:Ds,R:nr,D:Is,V:Ue,I:Ke,H:Le,N:or,U:ar,B:sr,F:lr},Fl=yi.litHtmlPolyfillSupport;Fl?.($t,Ke),(yi.litHtmlVersions??=[]).push("3.3.2");var Os=(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(Et(),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=Os(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 ql=ki.litElementPolyfillSupport;ql?.({LitElement:v});(ki.litElementVersions??=[]).push("4.2.2");var cr=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 ur({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 Nl=!0,Ci="Invariant failed";function D(t,e){if(!t){if(Nl)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 Bl({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 dr=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=Bl({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 pr=class{#e;#t;#r=null;#n=new dr;isStreaming=!1;typingIndicator;toolCallIndicator;ranOutOfCredits=!1;get messages(){return this.#n.messages}set messages(e){this.#n.messages=e}conversationId="";#i=0;#o;isLiveMode=!1;get hasQueuedMessages(){return this.#s.length>0}constructor(e,r){this.#e=e,this.#t=r,this.#t.autoConnect!==!1&&(this.#r=this.initWS()),e.addController(this)}#s=[];#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.#s.length>0){let i=this.#s[this.#s.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.#s.push({message:e,options:{expectStreaming:r}}),this.#e.requestUpdate(),this.#r&&!this.#r.isConnecting&&!this.#r.isConnected&&this.retry(),await ur({times:5,backoff:2e3},async()=>{if(this.#r?.isConnected){let i=[...this.#s];this.#s=[],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.#s=[],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.#o),this.#o=setTimeout(()=>{this.#t.onReconnect?.(),this.#r=this.initWS()},1e3*this.#i),this.#i++}initWS(){return new cr(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.#s=[],this.#e.requestUpdate()}hostDisconnected(){clearTimeout(this.#o)}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 Si;function Us(t){return{lang:t?.lang??Si?.lang,message:t?.message,abortEarly:t?.abortEarly??Si?.abortEarly,abortPipeEarly:t?.abortPipeEarly??Si?.abortPipeEarly}}var zl;function Wl(t){return zl?.get(t)}var Vl;function Hl(t){return Vl?.get(t)}var Gl;function Xl(t,e){return Gl?.get(t)?.get(e)}function Ls(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??Ls(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??Xl(t.reference,l.lang)??(c?Hl(l.lang):null)??i.message??Wl(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},Us())}}}function Jl(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Rs(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var Yl=/^\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 $i(t){return{kind:"validation",type:"iso_timestamp",reference:$i,async:!1,expects:null,requirement:Yl,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 It(){return{kind:"schema",type:"any",reference:It,expects:"any",async:!1,get"~standard"(){return G(this)},"~run"(t){return t.typed=!0,t}}}function Qe(t,e){return{kind:"schema",type:"array",reference:Qe,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 hr(t,e){return{kind:"schema",type:"nullish",reference:hr,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 fr(t){return{kind:"schema",type:"number",reference:fr,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 N(t,e){return{kind:"schema",type:"object",reference:N,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 At(t,e){return{kind:"schema",type:"picklist",reference:At,expects:Rs(t.map(Ls),"|"),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 Tt(t,e,r){return{kind:"schema",type:"record",reference:Tt,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(Jl(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 Ps(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function mr(t,e){return{kind:"schema",type:"union",reference:mr,expects:Rs(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:Ps(s)}),r.typed=!0}else{if(o?.length===1)return o[0];H(this,"type",r,i,{issues:Ps(o)})}return r}}}function Fs(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 Ze(...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},Us(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var gr=Fs(N({url:C(),name:C(),description:C(),price:C()}));function qs(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(gr,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 Kl=Symbol();var Ns=Object.getPrototypeOf,Ui=new WeakMap,Ql=t=>t&&(Ui.has(t)?Ui.get(t):Ns(t)===Object.prototype||Ns(t)===Array.prototype);var Bs=t=>Ql(t)&&t[Kl]||null,Li=(t,e=!0)=>{Ui.set(t,e)};var ji=t=>typeof t=="object"&&t!==null,Zl=t=>ji(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),Vs=(t,e)=>{let r=zs.get(t);if(r?.[0]===e)return r[1];let i=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return Li(i,!0),zs.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=Vs(l,c())}Object.defineProperty(i,n,a)}),Object.preventExtensions(i)},ec=(t,e,r,i)=>({deleteProperty(n,s){let o=Reflect.get(n,s);r(s);let a=Reflect.deleteProperty(n,s);return a&&i(yr?.("delete",s,o)),a},set(n,s,o,a){let l=!t()&&Reflect.has(n,s),c=Reflect.get(n,s,a);if(l&&(Ws(c,o)||br.has(o)&&Ws(c,br.get(o))))return!0;r(s),ji(o)&&(o=Bs(o)||o);let d=!Re.has(o)&&rc(o)?qi(o):o;return e(s,d),Reflect.set(n,s,d,a),i(yr?.("set",s,o,c)),!0}});var Re=new WeakMap,Fi=new WeakSet,zs=new WeakMap,Ri=[1],br=new WeakMap,Ws=Object.is,tc=(t,e)=>new Proxy(t,e),rc=Zl,ic=Vs,nc=ec,yr;function qi(t={}){if(!ji(t))throw new Error("object required");let e=br.get(t);if(e)return e;let r=Ri[0],i=new Set,n=(x,E=++Ri[0])=>{r!==E&&(s=r=E,i.forEach(b=>b(x,E)))},s=r,o=(x=Ri[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],$)=>{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,y=nc(()=>h,c,d,n),f=tc(t,y);br.set(t,f);let S=[t,o,p];return Re.set(f,S),Reflect.ownKeys(t).forEach(x=>{let E=Object.getOwnPropertyDescriptor(t,x);"value"in E&&E.writable&&(f[x]=t[x])}),h=!1,f}function vr(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 et(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 ic(r,i())}var tt=class{#e;#t;#r;#n=()=>{};constructor(e,r){this.#e=e,this.#t=r,this.#r=et(r),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#n(),this.#n=vr(this.#t,()=>{this.#r=et(this.#t),this.#e.requestUpdate()})}hostDisconnected(){this.#n()}};var ke=class{#e;#t;proxyObject;#r;#n=()=>{};constructor(e,r,i){this.#e=e,this.#t=i,this.proxyObject=qi(r),this.#r=et(this.proxyObject),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#n(),this.#t?.subscribe&&(this.#n=vr(this.proxyObject,()=>{this.#r=et(this.proxyObject),this.#e.requestUpdate()}))}hostDisconnected(){this.#n()}};var wr=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=sc(this.#e,this.#t),!this.#n))return;let e=this.#n[this.#r]instanceof ke?this.#n[this.#r]:null;e&&(this.#i=new tt(this.#e,e.proxyObject))}hostDisconnected(){}};function sc(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 Ni(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 Dt=pi(Wi(),1);var kr=class{#e;constructor({document:e}){this.#e=e}getCookies(){return(0,Dt.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,Dt.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,Dt.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 Mt=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,Mt.stringifySetCookie)(n,"1",{domain:o,path:"/"}),(0,Mt.parseCookie)(r.cookie)[n]==="1")return r.cookie=(0,Mt.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 kr({document:e.document}),this.#r=new _r({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_"))}},R=new Hi({window});var Ys=()=>{if(window.Shopify)try{return{customerId:fc()}}catch{return null}return null},fc=()=>{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},Ks=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 Qs(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 Zs(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function rt(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 eo(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 to=()=>{if(window.ShopRenter)try{let t=gc();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},gc=()=>{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}}},ro=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=Zs(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 io=()=>{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},no=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 so=Tt(C(),mr([C(),fr(),Oi(),Pi()])),oo=Ze(C(),Ai(1),Ii(5e3)),ao=()=>{try{return window.UNAS?io():window.Shopify?Ys():window.ShopRenter?to():null}catch{return null}},lo=async()=>{try{return window.UNAS?await no():window.Shopify?await Ks():window.ShopRenter?await ro():[]}catch{return[]}},it={schema:N({conversationId:A(C()),messages:A(Qe(N({id:C(),timestamp:fr(),role:At(["user","assistant","support"]),content:C(),parts:A(Qe(mr([N({text:C()}),N({html:C()}),N({tag:C(),data:Tt(C(),It())})])))})))}),persist(t,e,r){R.setConversationState(t,{conversationId:e,messages:r}),R.setConversationId(t,e)},restore(t){try{let e=R.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:R.getConversationId(t)||"",messages:[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(t){R.setConversationState(t,null),R.setConversationId(t,null)}};var nt=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 ke(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.#o()}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 pr(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=qs(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:()=>{it.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)=>{it.persist(this.widgetId,e,r)},restoreConversationState:()=>it.restore(this.widgetId)})),this.#n}#o(){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=Ni(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 wr(t,{provider:nt,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,i){if(i==="value")return e.value}})}nt.ConnectedEvent=class extends CustomEvent{static type="mw-context-widget:connected";constructor(e,r={}){super(nt.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-context-widget")||customElements.define("mw-context-widget",nt);var vc=Object.freeze({"lucide:arrow-up":u`
1
+ var El=Object.create;var ps=Object.defineProperty;var Sl=Object.getOwnPropertyDescriptor;var Il=Object.getOwnPropertyNames;var Al=Object.getPrototypeOf,Tl=Object.prototype.hasOwnProperty;var Je=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Dl=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Il(e))!Tl.call(t,n)&&n!==r&&ps(t,n,{get:()=>e[n],enumerable:!(i=Sl(e,n))||i.enumerable});return t};var di=(t,e,r)=>(r=t!=null?El(Al(t)):{},Dl(e||!t||!t.__esModule?ps(r,"default",{value:t,enumerable:!0}):r,t));var zi=Je(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.parseCookie=to;le.parse=to;le.stringifyCookie=bc;le.stringifySetCookie=vr;le.serialize=vr;le.parseSetCookie=vc;le.stringifySetCookie=vr;le.serialize=vr;var Zs=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,eo=/^[\u0021-\u003A\u003C-\u007E]*$/,hc=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,fc=/^[\u0020-\u003A\u003D-\u007E]*$/,mc=/^-?\d+$/,gc=Object.prototype.toString,yc=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function to(t,e){let r=new yc,i=t.length;if(i<2)return r;let n=e?.decode||ro,s=0;do{let o=Ni(t,s,i);if(o===-1)break;let a=Bi(t,s,i);if(o>a){s=t.lastIndexOf(";",o-1)+1;continue}let l=_e(t,s,o);r[l]===void 0&&(r[l]=n(_e(t,o+1,a))),s=a+1}while(s<i);return r}function bc(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(!Zs.test(n))throw new TypeError(`cookie name is invalid: ${n}`);let o=r(s);if(!eo.test(o))throw new TypeError(`cookie val is invalid: ${s}`);i.push(`${n}=${o}`)}return i.join("; ")}function vr(t,e,r){let i=typeof t=="object"?t:{...r,name:t,value:String(e)},s=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!Zs.test(i.name))throw new TypeError(`argument name is invalid: ${i.name}`);let o=i.value?s(i.value):"";if(!eo.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(!hc.test(i.domain))throw new TypeError(`option domain is invalid: ${i.domain}`);a+="; Domain="+i.domain}if(i.path){if(!fc.test(i.path))throw new TypeError(`option path is invalid: ${i.path}`);a+="; Path="+i.path}if(i.expires){if(!wc(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 vc(t,e){let r=e?.decode||ro,i=t.length,n=Bi(t,0,i),s=Ni(t,0,n),o=s===-1?{name:"",value:r(_e(t,0,n))}:{name:_e(t,0,s),value:r(_e(t,s+1,n))},a=n+1;for(;a<i;){let l=Bi(t,a,i),c=Ni(t,a,l),d=c===-1?_e(t,a,l):_e(t,a,c),p=c===-1?void 0:_e(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&&mc.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 Bi(t,e,r){let i=t.indexOf(";",e);return i===-1?r:i}function Ni(t,e,r){let i=t.indexOf("=",e);return i<r?i:-1}function _e(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 ro(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function wc(t){return gc.call(t)==="[object Date]"}});var ra=Je(Fe=>{"use strict";var ou=Fe&&Fe.__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())})},au=Fe&&Fe.__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(Fe,"__esModule",{value:!0});Fe.base64ToBlob=lu;function lu(t){return ou(this,void 0,void 0,function(){var e,r,i;return au(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=uu(t),i&&(r=r.slice(0,r.size,i)),[2,r]}})})}var cu=/^data:(.+);base64,/;function uu(t){var e;return(e=t.match(cu))===null||e===void 0?void 0:e.slice(1,2).pop()}});var ia=Je(qe=>{"use strict";var du=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())})},pu=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.base64ToFile=hu;function hu(t,e,r){return du(this,void 0,void 0,function(){var i,n;return pu(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 yn=Je(Be=>{"use strict";var mn=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())})},gn=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.blobToBase64=fu;function fu(t){return mn(this,void 0,void 0,function(){return gn(this,function(e){return[2,typeof FileReader=="function"?mu(t):yu(t)]})})}var lt;(function(t){t.error="error",t.loadend="loadend"})(lt||(lt={}));function mu(t){return mn(this,void 0,void 0,function(){return gn(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 gu="application/octet-stream";function yu(t){return mn(this,void 0,void 0,function(){var e,r,i,n;return gn(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||gu,[2,"data:".concat(n,";base64,").concat(e.toString("base64"))]}})})}});var na=Je(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.fileToBase64=void 0;var bu=yn();Object.defineProperty(Mr,"fileToBase64",{enumerable:!0,get:function(){return bu.blobToBase64}})});var sa=Je(ue=>{"use strict";var vu=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]})),Or=ue&&ue.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vu(e,t,r)};Object.defineProperty(ue,"__esModule",{value:!0});Or(ra(),ue);Or(ia(),ue);Or(yn(),ue);Or(na(),ue)});var Qt=globalThis,Zt=Qt.ShadowRoot&&(Qt.ShadyCSS===void 0||Qt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pi=Symbol(),hs=new WeakMap,xt=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==pi)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(Zt&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=hs.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&hs.set(r,e))}return e}toString(){return this.cssText}},fs=t=>new xt(typeof t=="string"?t:t+"",void 0,pi),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,pi)},ms=(t,e)=>{if(Zt)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=Qt.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},hi=Zt?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return fs(r)})(t):t;var{is:Ml,defineProperty:Ol,getOwnPropertyDescriptor:Pl,getOwnPropertyNames:Ul,getOwnPropertySymbols:Ll,getPrototypeOf:jl}=Object,er=globalThis,gs=er.trustedTypes,Rl=gs?gs.emptyScript:"",Fl=er.reactiveElementPolyfillSupport,kt=(t,e)=>t,fi={toAttribute(t,e){switch(e){case Boolean:t=t?Rl: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}},bs=(t,e)=>!Ml(t,e),ys={attribute:!0,type:String,converter:fi,reflect:!1,useDefault:!1,hasChanged:bs};Symbol.metadata??=Symbol("metadata"),er.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=ys){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&&Ol(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){let{get:n,set:s}=Pl(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)??ys}static _$Ei(){if(this.hasOwnProperty(kt("elementProperties")))return;let e=jl(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=[...Ul(r),...Ll(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(hi(n))}else e!==void 0&&r.push(hi(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 ms(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:fi).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:fi;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??bs)(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,Fl?.({ReactiveElement:me}),(er.reactiveElementVersions??=[]).push("2.1.2");var gi=globalThis,vs=t=>t,tr=gi.trustedTypes,ws=tr?tr.createPolicy("lit-html",{createHTML:t=>t}):void 0,yi="$lit$",ge=`lit$${Math.random().toFixed(9).slice(2)}$`,bi="?"+ge,ql=`<${bi}>`,Pe=document,Ct=()=>Pe.createComment(""),$t=t=>t===null||typeof t!="object"&&typeof t!="function",vi=Array.isArray,Es=t=>vi(t)||typeof t?.[Symbol.iterator]=="function",mi=`[
2
+ \f\r]`,_t=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xs=/-->/g,ks=/>/g,Me=RegExp(`>|${mi}(?:([^\\s"'>=/]+)(${mi}*=${mi}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),_s=/'/g,Cs=/"/g,Ss=/^(?:script|style|textarea|title)$/i,wi=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),u=wi(1),Td=wi(2),Dd=wi(3),ne=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),$s=new WeakMap,Oe=Pe.createTreeWalker(Pe,129);function Is(t,e){if(!vi(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ws!==void 0?ws.createHTML(e):e}var As=(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=xs:d[1]!==void 0?o=ks:d[2]!==void 0?(Ss.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Me):d[3]!==void 0&&(o=Me):o===Me?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?Me:d[3]==='"'?Cs:_s):o===Cs||o===_s?o=Me:o===xs||o===ks?o=_t:(o=Me,n=void 0);let y=o===Me&&t[a+1].startsWith("/>")?" ":"";s+=o===_t?l+ql:p>=0?(i.push(c),l.slice(0,p)+yi+l.slice(p)+ge+y):l+ge+(p===-2?a:y)}return[Is(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},Et=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]=As(e,r);if(this.el=t.createElement(c,i),Oe.currentNode=this.el.content,r===2||r===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=Oe.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let p of n.getAttributeNames())if(p.endsWith(yi)){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]==="."?ir:f[1]==="?"?nr:f[1]==="@"?sr:Le}),n.removeAttribute(p)}else p.startsWith(ge)&&(l.push({type:6,index:s}),n.removeAttribute(p));if(Ss.test(n.tagName)){let p=n.textContent.split(ge),h=p.length-1;if(h>0){n.textContent=tr?tr.emptyScript:"";for(let y=0;y<h;y++)n.append(p[y],Ct()),Oe.nextNode(),l.push({type:2,index:++s});n.append(p[h],Ct())}}}else if(n.nodeType===8)if(n.data===bi)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=Pe.createElement("template");return i.innerHTML=e,i}};function Ue(t,e,r=t,i){if(e===ne)return e;let n=i!==void 0?r._$Co?.[i]:r._$Cl,s=$t(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=Ue(t,n._$AS(t,e.values),n,i)),e}var rr=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??Pe).importNode(r,!0);Oe.currentNode=n;let s=Oe.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Ye(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new or(s,this,e)),this._$AV.push(c),l=i[++a]}o!==l?.index&&(s=Oe.nextNode(),o++)}return Oe.currentNode=Pe,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++}},Ye=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=Ue(this,e,r),$t(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):Es(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&&$t(this._$AH)?this._$AA.nextSibling.data=e:this.T(Pe.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=Et.createElement(Is(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(r);else{let s=new rr(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 Et(e)),r}k(e){vi(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=vs(e).nextSibling;vs(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Le=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=Ue(this,e,r,0),o=!$t(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=Ue(this,a[i+l],r,l),c===ne&&(c=this._$AH[l]),o||=!$t(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??"")}},ir=class extends Le{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}},nr=class extends Le{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==U)}},sr=class extends Le{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){if((e=Ue(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)}},or=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){Ue(this,e)}},Ts={M:yi,P:ge,A:bi,C:1,L:As,R:rr,D:Es,V:Ue,I:Ye,H:Le,N:nr,U:sr,B:ir,F:or},Bl=gi.litHtmlPolyfillSupport;Bl?.(Et,Ye),(gi.litHtmlVersions??=[]).push("3.3.2");var Ds=(t,e,r)=>{let i=r?.renderBefore??e,n=i._$litPart$;if(n===void 0){let s=r?.renderBefore??null;i._$litPart$=n=new Ye(e.insertBefore(Ct(),s),s,void 0,r??{})}return n._$AI(t),n};var xi=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=Ds(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,xi.litElementHydrateSupport?.({LitElement:v});var Nl=xi.litElementPolyfillSupport;Nl?.({LitElement:v});(xi.litElementVersions??=[]).push("4.2.2");var ar=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 ki(t){await new Promise(e=>setTimeout(e,t))}async function lr({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 ki(e);else if(typeof e=="function")await ki(e(n+1));else throw new TypeError("Invalid backoff option")}throw new Error("unreachable")}var zl=!0,_i="Invariant failed";function D(t,e){if(!t){if(zl)throw new Error(_i);var r=typeof e=="function"?e():e,i=r?"".concat(_i,": ").concat(r):_i;throw new Error(i)}}function Ci(t,e,r){return t.slice(0,r)+e}function Wl({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=Ci(n,o,a);let l=i[s]&&"text"in i[s]?i[s].text:"";i[s]={text:l?Ci(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?Ci(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 cr=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=Wl({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 ur=class{#e;#t;#r=null;#n=new cr;isStreaming=!1;typingIndicator;toolCallIndicator;ranOutOfCredits=!1;get messages(){return this.#n.messages}set messages(e){this.#n.messages=e}conversationId="";#i=0;#o;isLiveMode=!1;get hasQueuedMessages(){return this.#s.length>0}constructor(e,r){this.#e=e,this.#t=r,this.#t.autoConnect!==!1&&(this.#r=this.initWS()),e.addController(this)}#s=[];#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.#s.length>0){let i=this.#s[this.#s.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.#s.push({message:e,options:{expectStreaming:r}}),this.#e.requestUpdate(),this.#r&&!this.#r.isConnecting&&!this.#r.isConnected&&this.retry(),await lr({times:5,backoff:2e3},async()=>{if(this.#r?.isConnected){let i=[...this.#s];this.#s=[],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.#s=[],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.#o),this.#o=setTimeout(()=>{this.#t.onReconnect?.(),this.#r=this.initWS()},1e3*this.#i),this.#i++}initWS(){return new ar(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.#s=[],this.#e.requestUpdate()}hostDisconnected(){clearTimeout(this.#o)}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 Os(t){return{lang:t?.lang??$i?.lang,message:t?.message,abortEarly:t?.abortEarly??$i?.abortEarly,abortPipeEarly:t?.abortPipeEarly??$i?.abortPipeEarly}}var Vl;function Hl(t){return Vl?.get(t)}var Gl;function Xl(t){return Gl?.get(t)}var Jl;function Yl(t,e){return Jl?.get(t)?.get(e)}function Ps(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??Ps(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?Xl(l.lang):null)??i.message??Hl(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},Os())}}}function Kl(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Us(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var Ql=/^\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 Ei(t){return{kind:"validation",type:"iso_timestamp",reference:Ei,async:!1,expects:null,requirement:Ql,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&H(this,"timestamp",e,r),e}}}function Si(t,e){return{kind:"validation",type:"max_length",reference:Si,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 Ii(t,e){return{kind:"validation",type:"min_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){return{kind:"transformation",type:"to_date",reference:Ai,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 Ti(t){return{kind:"transformation",type:"transform",reference:Ti,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function Ls(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:Ls(this,n,i)}:n}}}function Di(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 Ke(t,e){return{kind:"schema",type:"array",reference:Ke,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 Mi(t){return{kind:"schema",type:"boolean",reference:Mi,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 Oi(t){return{kind:"schema",type:"null",reference:Oi,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 dr(t,e){return{kind:"schema",type:"nullish",reference:dr,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=Di(this,r,i)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function pr(t){return{kind:"schema",type:"number",reference:pr,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]:Di(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]=Ls(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=Di(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:Us(t.map(Ps),"|"),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(Kl(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 Ms(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function hr(t,e){return{kind:"schema",type:"union",reference:hr,expects:Us(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:Ms(s)}),r.typed=!0}else{if(o?.length===1)return o[0];H(this,"type",r,i,{issues:Ms(o)})}return r}}}function js(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},Os(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var fr=js(B({url:C(),name:C(),description:C(),price:C()}));function Rs(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(fr,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 Zl=Symbol();var Fs=Object.getPrototypeOf,Pi=new WeakMap,ec=t=>t&&(Pi.has(t)?Pi.get(t):Fs(t)===Object.prototype||Fs(t)===Array.prototype);var qs=t=>ec(t)&&t[Zl]||null,Ui=(t,e=!0)=>{Pi.set(t,e)};var ji=t=>typeof t=="object"&&t!==null,tc=t=>ji(t)&&!Ri.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),zs=(t,e)=>{let r=Bs.get(t);if(r?.[0]===e)return r[1];let i=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return Ui(i,!0),Bs.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(Ri.has(s))Ui(s,!1);else if(je.has(s)){let[l,c]=je.get(s);a.value=zs(l,c())}Object.defineProperty(i,n,a)}),Object.preventExtensions(i)},rc=(t,e,r,i)=>({deleteProperty(n,s){let o=Reflect.get(n,s);r(s);let a=Reflect.deleteProperty(n,s);return a&&i(mr?.("delete",s,o)),a},set(n,s,o,a){let l=!t()&&Reflect.has(n,s),c=Reflect.get(n,s,a);if(l&&(Ns(c,o)||gr.has(o)&&Ns(c,gr.get(o))))return!0;r(s),ji(o)&&(o=qs(o)||o);let d=!je.has(o)&&nc(o)?Fi(o):o;return e(s,d),Reflect.set(n,s,d,a),i(mr?.("set",s,o,c)),!0}});var je=new WeakMap,Ri=new WeakSet,Bs=new WeakMap,Li=[1],gr=new WeakMap,Ns=Object.is,ic=(t,e)=>new Proxy(t,e),nc=tc,sc=zs,oc=rc,mr;function Fi(t={}){if(!ji(t))throw new Error("object required");let e=gr.get(t);if(e)return e;let r=Li[0],i=new Set,n=(x,$=++Li[0])=>{r!==$&&(s=r=$,i.forEach(b=>b(x,$)))},s=r,o=(x=Li[0])=>(s!==x&&(s=x,l.forEach(([$])=>{let b=$[1](x);b>r&&(r=b)})),r),a=x=>($,b)=>{let k;$&&(k=[...$],k[1]=[x,...k[1]]),n(k,b)},l=new Map,c=(x,$)=>{let b=!Ri.has($)&&je.get($);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 $;let b=l.get(x);b&&(l.delete(x),($=b[1])==null||$.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=oc(()=>h,c,d,n),f=ic(t,y);gr.set(t,f);let E=[t,o,p];return je.set(f,E),Reflect.ownKeys(t).forEach(x=>{let $=Object.getOwnPropertyDescriptor(t,x);"value"in $&&$.writable&&(f[x]=t[x])}),h=!1,f}function yr(t,e,r){let i=je.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=je.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,i]=e;return sc(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=yr(this.#t,()=>{this.#r=Ze(this.#t),this.#e.requestUpdate()})}hostDisconnected(){this.#n()}};var ke=class{#e;#t;proxyObject;#r;#n=()=>{};constructor(e,r,i){this.#e=e,this.#t=i,this.proxyObject=Fi(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=yr(this.proxyObject,()=>{this.#r=Ze(this.proxyObject),this.#e.requestUpdate()}))}hostDisconnected(){this.#n()}};var br=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=ac(this.#e,this.#t),!this.#n))return;let e=this.#n[this.#r]instanceof ke?this.#n[this.#r]:null;e&&(this.#i=new et(this.#e,e.proxyObject))}hostDisconnected(){}};function ac(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 qi(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 Ws=()=>{if(window.Shopify)try{return{customerId:lc()}}catch{return null}return null},lc=()=>{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},Vs=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 Hs(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 Gs(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 Xs(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 Js=()=>{if(window.ShopRenter)try{let t=uc();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},uc=()=>{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=Gs(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 Ks=()=>{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},Qs=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=di(zi(),1);var wr=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 xr=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=di(zi(),1);function Wi({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 Vi=class{#e;#t;#r;#n;constructor({window:e}){this.#e=e,this.#t=new wr({document:e.document}),this.#r=new xr({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:Wi({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:Wi({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_"))}},io;function j(){return io??=new Vi({window}),io}var no=At(C(),hr([C(),pr(),Mi(),Oi()])),so=Qe(C(),Ii(1),Si(5e3)),oo=()=>{try{return window.UNAS?Ks():window.Shopify?Ws():window.ShopRenter?Js():null}catch{return null}},ao=async()=>{try{return window.UNAS?await Qs():window.Shopify?await Vs():window.ShopRenter?await Ys():[]}catch{return[]}},rt={schema:B({conversationId:A(C()),messages:A(Ke(B({id:C(),timestamp:pr(),role:It(["user","assistant","support"]),content:C(),parts:A(Ke(hr([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 ke(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.#o()}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 ur(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=Rs(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=oo();this.#i.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),ao().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}#o(){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(no,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(so,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=qi(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 lo(t){let e=new br(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 xc=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" />
@@ -113,7 +113,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
113
113
  <path d="M18 6 6 18" />
114
114
  <path d="m6 6 12 12" />
115
115
  </svg>
116
- `}),Gi=class extends v{static properties={name:{type:String},fill:{type:Boolean,reflect:!0}};static styles=O`
116
+ `}),Hi=class extends v{static properties={name:{type:String},fill:{type:Boolean,reflect:!0}};static styles=O`
117
117
  :host {
118
118
  display: inline-block;
119
119
  line-height: 0;
@@ -125,7 +125,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
125
125
  :host([fill]) svg {
126
126
  fill: currentColor;
127
127
  }
128
- `;constructor(){super(),this.name,this.fill=!1}render(){if(!this.name)return null;let e=vc[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 wc(t,e=","){return t.map(nn).join(e)}var yo=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Cr(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 Ir(){}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 xc=["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)&&~xc.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 Yi(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(${[Yi(t.substr(1,s),o),Yi(t.substr(1+s,s),o),Yi(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,S=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,Sr(""+k),p,l,c,d,!0));continue}if(b[1]=="l"){for(let $ of M(k))h.push(...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($=>({p:-1,o:0,r:[],d:b+" "+$})));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($=>({p:F.d,o:0,r:[b],d:s($,{p:F.d},p).map(Zi).join("")})));continue}}if(typeof k!="object"||Array.isArray(k))b=="label"&&k?a=k+Cr(JSON.stringify([l,d,o])):(k||k===0)&&(b=b.replace(/[A-Z]/g,$=>"-"+$.toLowerCase()),S+=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($=>p.s(b,on(""+$,p.theme)+(d?" !important":""))).join(";"));else if(b[0]=="@"||b.includes("&")){let $=l;b[0]=="@"&&(b=b.replace(/\bscreen\(([^)]+)\)/g,(P,j)=>{let z=p.theme("screens",j);return z?($|=67108864,$r(z,"")):P}),$|=Qi(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-S)+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 Er(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,S){let x=vo.get(f.n);return x?x(f,S):S.r(f.n,f.v[0]=="dark")})(l,c);return y?typeof y=="string"?({r:p,p:d}=sn(l,c,d,p),_o(Er(Sr(y),c,d,p,l.i),l.n)):Array.isArray(y)?y.map(f=>{var S,x;return{o:0,...f,r:[...M(p),...M(f.r)],p:(S=d,x=f.p??d,S&~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=>Er([l],i,n,s,o)):Er(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 kc(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 Ki(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 Sr(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&&Ki(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,Ki([...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);Ki([...r,kc(p.length>1?p.slice(0,-1)+Cr(JSON.stringify([p,h])):p+"("+wc(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,Cc(e,r)]}function Cc(t={},e){return(r,i)=>{let{section:n=Co(r[0]).replace("-","")+"Color"}=t,[s,o]=Ec(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||(({_:S})=>{let x=Ot(d,S);return p?{[p]:x}:x});r._={value:te(a,{opacityVariable:l||void 0,opacityValue:h||void 0}),color:S=>te(a,S),opacityVariable:l||void 0,opacityValue:h||void 0};let f=y(r,i);if(!r.dark){let S=i.d(n,s,a);S&&S!==a&&(r._={value:te(S,{opacityVariable:l||void 0,opacityValue:h||"1"}),color:x=>te(S,x),opacityVariable:l||void 0,opacityValue:h||void 0},f={"&":f,[i.v("dark")]:y(r,i)})}return f}}function Ec(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Ot(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=st(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 st(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",i,n="")=>st(r)+i+st(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 Sc(t){var e;return rn(t[0],typeof(e=t[1])=="function"?e:()=>e)}function $c(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(Ic);return(i,n,s)=>{for(let o of r){let a=e(i,o,n,s);if(a)return a}}}function Ic(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function So(t,e){let r=cn(t),i=(function({theme:l,darkMode:c,darkColor:d=Ir,variants:p,rules:h,hash:y,stringify:f,ignorelist:S,finalize:x}){let E=new Map,b=new Map,k=new Map,$=new Map,P=Eo(S,(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 j=typeof y=="function"?T=>y(T,Cr):y?Cr:uo;j!==uo&&x.push(T=>({...T,n:T.n&&j(T.n),d:T.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(W,Y)=>"--"+j(Y).replace("#",""))}));let z={theme:(function({extend:T={},...W}){let Y={},di={get colors(){return Ae("colors")},theme:Ae,negative(){return{}},breakpoints(L){let V={};for(let K in L)typeof L[K]=="string"&&(V["screen-"+K]=L[K]);return V}};return Ae;function Ae(L,V,K,vt){if(L){if({1:L,2:vt}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(L)||[,L],/[.[]/.test(L)){let fe=[];L.replace(/\[([^\]]+)\]|([^.[]+)/g,(De,xt,_l=xt)=>fe.push(_l)),L=fe.shift(),K=V,V=fe.join("-")}let ae=Y[L]||Object.assign(Object.assign(Y[L]={},Zt(W,L)),Zt(T,L));if(V==null)return ae;V||(V="DEFAULT");let Te=ae[V]??V.split("-").reduce((fe,De)=>fe?.[De],ae)??K;return vt?te(Te,{opacityValue:on(vt,Ae)}):Te}let wt={};for(let ae of[...Object.keys(W),...Object.keys(T)])wt[ae]=Ae(ae);return wt}function Zt(L,V){let K=L[V];return typeof K=="function"&&(K=K(di)),K&&/color|fill|stroke/i.test(V)?(function vt(wt,ae=[]){let Te={};for(let fe in wt){let De=wt[fe],xt=[...ae,fe];Te[xt.join("-")]=De,fe=="DEFAULT"&&(xt=ae,Te[ae.join("-")]=De),typeof De=="object"&&Object.assign(Te,vt(De,xt))}return Te})(K):K}})(l),e:yo,h:j,s(T,W){return f(T,W,z)},d(T,W,Y){return d(T,W,z,Y)},v(T){return E.has(T)||E.set(T,go(T,p,b,Sc,z)||"&:"+T),E.get(T)},r(T,W){let Y=JSON.stringify([T,W]);return k.has(Y)||k.set(Y,!P(T,z)&&go(T,h,$,$c,z,W)),k.get(Y)},f(T){return x.reduce((W,Y)=>Y(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,Sr(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 Er(Sr(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 Ac(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function $o(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&&Ac(o,s=t(o))&&n.setAttribute("class",s)}}function Tc(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 Ar(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:Tc(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:Ir}}var Dc=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 Dc.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 Mc=[["-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 Mc)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 Ut={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"),...Pt(2,6),...Pt(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"),...Pt(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...Pt(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"),...Pt(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 Pt(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, ${Ut.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, ${Ut.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",Tr),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",jo),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",jo),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=>Tr(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",ot("padding")),g("-?m([xytrbl])?(?:$|-)","margin",ot("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)",...Ce({"--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 ${je(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",Tr),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-${je(r[0])}-radius`]:e,[`border-${je(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})=>({...Ce({"--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"},ot("border","Color")),q("border-"),g("border-([xytrbl])(?:$|-)","borderWidth",ot("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-${je(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${je(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})=>({...Ce({"--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})=>({...Ce({"--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"),...Ro(),...Ro("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":No(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",Tr),"(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})=>({...Ce({"--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",ot("scroll-padding")),g("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",ot("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})=>({...Ce({"--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 Tr(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 je(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 ot(t,e=""){return({1:r,_:i})=>{let n={x:"lr",y:"tb"}[r]||r+r;return n?{...Ot(t+"-"+je(n[0])+e,i),...Ot(t+"-"+je(n[1])+e,i)}:Ot(t+e,i)}}function Ro(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={...Ce(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{...Ce({"--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":No()}),transform:"var(--tw-transform)"}}function No(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 jo({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function Fo({1:t}){return`repeat(${t},minmax(0,1fr))`}function Ce(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var Bo=[["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=st(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)&&st(t).replace(/[}]+$/,"").split("{")]];function zo({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:Po,theme:{...Ut,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:Bo,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 Oc={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Pc={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Uc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Lc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Rc={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},jc={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Fc={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},qc={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Nc={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Bc={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},zc={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Wc={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Vc={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Hc={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Gc={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Xc={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Jc={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Yc={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},Kc={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},Qc={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},Zc={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},eu={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Wo={__proto__:null,slate:Oc,gray:Pc,zinc:Uc,neutral:Lc,stone:Rc,red:jc,orange:Fc,amber:qc,yellow:Nc,lime:Bc,green:zc,emerald:Wc,teal:Vc,cyan:Hc,sky:Gc,blue:Xc,indigo:Jc,violet:Yc,purple:Kc,fuchsia:Qc,pink:Zc,rose:eu};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 Yo(t,e=!0){let r=(function(){if(tu)try{let l=Ar(new CSSStyleSheet);return l.connect=c=>{let d=hn(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,l.target]},l.disconnect=Ir,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Ar(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=Ar(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=So({...t,hash:t.hash??e},r),n=$o(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 tu=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=>Yo(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`
128
+ `;constructor(){super(),this.name,this.fill=!1}render(){if(!this.name)return null;let e=xc[this.name];return e||(console.warn(`mw-icon: '${this.name}' not found`),null)}};customElements.get("mw-icon")||customElements.define("mw-icon",Hi);function rn(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function kc(t,e=","){return t.map(rn).join(e)}var go=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function kr(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 co(t){return t}function Er(){}var F={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function yo(t){return t.match(/[-=:;]/g)?.length||0}function Ki(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(yo(t),15)<<18}var _c=["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 nn({n:t,i:e,v:r=[]},i,n,s){t&&(t=rn({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|Ki(c):a=="dark"?1073741824:c[0]=="@"?Ki(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~_c.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:n,r:s,i:e}}var bo=new Map;function Qi(t){if(t.d){let e=[],r=Gi(t.r.reduce((i,n)=>n[0]=="@"?(e.push(n),i):n?Gi(i,s=>Gi(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):Xi(s,o)}return Xi(o,s)})):i,"&"),i=>Xi(i,t.n?"."+go(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,n)=>n+"{"+i+"}",t.d)}}function Gi(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,i,n)=>e(i)+n)}function Xi(t,e){return t.replace(/&/g,e)}var uo=new Intl.Collator("en",{numeric:!0});function vo(t,e){for(var r=0,i=t.length;r<i;){let n=i+r>>1;0>=wo(t[n],e)?r=n+1:i=n}return i}function wo(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||uo.compare(po(t.n),po(e.n))||uo.compare(ho(t.n),ho(e.n))}function po(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function ho(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Ji(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(${[Ji(t.substr(1,s),o),Ji(t.substr(1+s,s),o),Ji(t.substr(1+2*s,s),o),n]})`}return n=="1"?t:n=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function xo(t,e,r,i,n=[]){return(function s(o,{n:a,p:l,r:c=[],i:d},p){let h=[],y="",f=0,E=0;for(let b in o||{}){var x,$;let k=o[b];if(b[0]=="@"){if(!k)continue;if(b[1]=="a"){h.push(...on(a,l,Cr(""+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(Qi).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(Qi).join("")})));continue}}if(typeof k!="object"||Array.isArray(k))b=="label"&&k?a=k+kr(JSON.stringify([l,d,o])):(k||k===0)&&(b=b.replace(/[A-Z]/g,S=>"-"+S.toLowerCase()),E+=1,f=Math.max(f,($=b)[0]=="-"?0:yo($)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test($)?+!!RegExp.$1||-!!RegExp.$2:0)+1),y+=(y?";":"")+M(k).map(S=>p.s(b,sn(""+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|=Ki(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-E)+1.5*Math.min(f||15,15),r:c,d:y}),h.sort(wo)})(t,nn(e,r,i,n),r)}function sn(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 ko(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 _r(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,E){let x=bo.get(f.n);return x?x(f,E):E.r(f.n,f.v[0]=="dark")})(l,c);return y?typeof y=="string"?({r:p,p:d}=nn(l,c,d,p),ko(_r(Cr(y),c,d,p,l.i),l.n)):Array.isArray(y)?y.map(f=>{var E,x;return{o:0,...f,r:[...M(p),...M(f.r)],p:(E=d,x=f.p??d,E&~F.o|x)}}):xo(y,l,c,d,p):[{c:rn(l),p:0,o:0,r:[]}]})(o,e,r,i,n))s.splice(vo(s,a),0,a);return s}function on(t,e,r,i,n,s,o,a){return ko((a?r.flatMap(l=>_r([l],i,n,s,o)):_r(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 Cc(t,e,r,i){var n;return n=(s,o)=>{let{n:a,p:l,r:c,i:d}=nn(s,o,e);return r&&on(a,e,r,o,l,c,d,i)},bo.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 fo=new Map;function Cr(t){let e=fo.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,Cc(p.length>1?p.slice(0,-1)+kr(JSON.stringify([p,h])):p+"("+kc(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),fo.set(t,e=i[0])}return e}function m(t,e,r){return[t,Zi(e,r)]}function Zi(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,i)=>({[t]:e?e(r,i):en(r,1)}):r=>t||{[r[1]]:en(r,2)}}function en(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,an(e,r,i)]}function an(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=_o(t||n[1]),a=s.theme(o,n.$$)??ce(n.$$,o,s);if(a!=null)return n._=en(n,0,a),i(n,s,o)}}function q(t,e={},r){return[t,Ec(e,r)]}function Ec(t={},e){return(r,i)=>{let{section:n=_o(r[0]).replace("-","")+"Color"}=t,[s,o]=Sc(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||(({_:E})=>{let x=Mt(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=y(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")]:y(r,i)})}return f}}function Sc(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(sn(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 _o(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 ln({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 mo(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 Ic(t){var e;return tn(t[0],typeof(e=t[1])=="function"?e:()=>e)}function Ac(t){var e,r;return Array.isArray(t)?tn(t[0],Zi(t[1],t[2])):tn(t,Zi(e,r))}function tn(t,e){return Co(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 Co(t,e){let r=M(t).map(Tc);return(i,n,s)=>{for(let o of r){let a=e(i,o,n,s);if(a)return a}}}function Tc(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function $o(t,e){let r=ln(t),i=(function({theme:l,darkMode:c,darkColor:d=Er,variants:p,rules:h,hash:y,stringify:f,ignorelist:E,finalize:x}){let $=new Map,b=new Map,k=new Map,S=new Map,P=Co(E,(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,kr):y?kr:co;R!==co&&x.push(T=>({...T,n:T.n&&R(T.n),d:T.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(W,Y)=>"--"+R(Y).replace("#",""))}));let z={theme:(function({extend:T={},...W}){let Y={},ui={get colors(){return Ae("colors")},theme:Ae,negative(){return{}},breakpoints(L){let V={};for(let K in L)typeof L[K]=="string"&&(V["screen-"+K]=L[K]);return V}};return Ae;function Ae(L,V,K,bt){if(L){if({1:L,2:bt}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(L)||[,L],/[.[]/.test(L)){let fe=[];L.replace(/\[([^\]]+)\]|([^.[]+)/g,(De,wt,$l=wt)=>fe.push($l)),L=fe.shift(),K=V,V=fe.join("-")}let ae=Y[L]||Object.assign(Object.assign(Y[L]={},Kt(W,L)),Kt(T,L));if(V==null)return ae;V||(V="DEFAULT");let Te=ae[V]??V.split("-").reduce((fe,De)=>fe?.[De],ae)??K;return bt?te(Te,{opacityValue:sn(bt,Ae)}):Te}let vt={};for(let ae of[...Object.keys(W),...Object.keys(T)])vt[ae]=Ae(ae);return vt}function Kt(L,V){let K=L[V];return typeof K=="function"&&(K=K(ui)),K&&/color|fill|stroke/i.test(V)?(function bt(vt,ae=[]){let Te={};for(let fe in vt){let De=vt[fe],wt=[...ae,fe];Te[wt.join("-")]=De,fe=="DEFAULT"&&(wt=ae,Te[ae.join("-")]=De),typeof De=="object"&&Object.assign(Te,bt(De,wt))}return Te})(K):K}})(l),e:go,h:R,s(T,W){return f(T,W,z)},d(T,W,Y){return d(T,W,z,Y)},v(T){return $.has(T)||$.set(T,mo(T,p,b,Ic,z)||"&:"+T),$.get(T)},r(T,W){let Y=JSON.stringify([T,W]);return k.has(Y)||k.set(Y,!P(T,z)&&mo(T,h,S,Ac,z,W)),k.get(Y)},f(T){return x.reduce((W,Y)=>Y(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=Qi(c);if(d&&!o.has(d)){o.add(d);let p=vo(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"?on("",F.b,Cr(p),i,F.b,[],!1,!0):xo(p,{},i,F.b)).forEach(a);c=""+c;let d=n.get(c);if(!d){let p=new Set;for(let h of _r(Cr(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 Dc(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function Eo(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&&Dc(o,s=t(o))&&n.setAttribute("class",s)}}function Mc(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 Sr(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:Mc(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:Er}}var Oc=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 So(t){return Oc.get(t)}function Io(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 Ao(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 Pc=[["-webkit-",1],["-moz-",2],["-ms-",4]];function To(){return({stringify:t})=>({stringify(e,r,i){let n="",s=So(e);s&&(n+=t(s,r,i)+";");let o=Io(e),a=Ao(e,r);for(let l of Pc)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 Mo(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",an("lineClamp",({_:t})=>Do(t))],["line-clamp-(\\d+)",({1:t})=>Do(t)]]}}function Do(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 Oo={"*,::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 Fo=[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",Ir),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",Po),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",Ro),g("col-","gridColumn"),m("col-(span)-(\\d+)","gridColumn",jo),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",Ro),g("row-","gridRow"),m("row-(span)-(\\d+)","gridRow",jo),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=>Ir(Po(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",Uo),m("(content|items|self)-",t=>({["align-"+t[1]]:Uo(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)",...Ce({"--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 ${Re(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",Ir),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-${Re(r[0])}-radius`]:e,[`border-${Re(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})=>({...Ce({"--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-${Re(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${Re(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})=>({...Ce({"--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})=>({...Ce({"--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"),...Lo(),...Lo("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",un),m("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":qo(t=="gpu")})),g("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...un()})),g("-?(rotate)-","rotate",cn),g("-?(translate-[xy])-","translate",cn),g("-?(skew-[xy])-","skew",cn),m("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Ir),"(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})=>({...Ce({"--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})=>({...Ce({"--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 Ir(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function Po(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function Re(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 Uo({$$: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+"-"+Re(n[0])+e,i),...Mt(t+"-"+Re(n[1])+e,i)}:Mt(t+e,i)}}function Lo(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={...Ce(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 cn({1:t,_:e}){return{["--tw-"+t]:e,...un()}}function un(){return{...Ce({"--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":qo()}),transform:"var(--tw-transform)"}}function qo(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 jo({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function Ro({1:t}){return`repeat(${t},minmax(0,1fr))`}function Ce(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var Bo=[["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 No({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:Oo,theme:{...Pt,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:Bo,rules:Fo,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 Uc={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Lc={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},jc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Rc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Fc={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},qc={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Bc={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Nc={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},zc={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Wc={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Vc={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Hc={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Gc={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Xc={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Jc={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"},Kc={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Qc={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},Zc={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},eu={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},tu={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},ru={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},zo={__proto__:null,slate:Uc,gray:Lc,zinc:jc,neutral:Rc,stone:Fc,red:qc,orange:Bc,amber:Nc,yellow:zc,lime:Wc,green:Vc,emerald:Hc,teal:Gc,cyan:Xc,sky:Jc,blue:Yc,indigo:Kc,violet:Qc,purple:Zc,fuchsia:eu,pink:tu,rose:ru};function Wo({disablePreflight:t}={}){return No({colors:zo,disablePreflight:t})}function Go({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)=>Xo(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=Ho(o.theme("fontSize",s));return a&&{"@layer components":a}}],[t+"-",({$$:s},o)=>n(s,o)],[t,(s,o)=>({...n(e,o),"@layer base":[Vo(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"}}),Vo(t,o,r)],"@layer components":{...Ho(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 Vo(t,e,r){let i={};for(let n in r)i[Xo(t,n,e,s=>`.${e.e(e.h(t))}${s}`)]=r[n];return i}function Xo(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 Ho(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 dn=ln({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:[Wo(),To(),Mo(),Go()]});function Jo(t,e=!0){let r=(function(){if(iu)try{let l=Sr(new CSSStyleSheet);return l.connect=c=>{let d=pn(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,l.target]},l.disconnect=Er,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Sr(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");pn(l).appendChild(c);let d=Sr(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=Eo(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),n.observe(pn(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var iu=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function pn(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var w=t=>Jo(dn)(t);var hn=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
129
  :host {
130
130
  display: block;
131
131
  }
@@ -165,7 +165,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
165
165
  <slot></slot>
166
166
  </div>
167
167
  </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`
168
+ `}};customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",hn);var fn=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
169
  .shadow-button {
170
170
  box-shadow:
171
171
  -58.9194px 74.8436px 38.218px rgba(0, 0, 0, 0.01),
@@ -228,7 +228,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
228
228
  </button>
229
229
  </mw-spinning-border>
230
230
  </div>
231
- `};customElements.get("mw-bubble")||customElements.define("mw-bubble",mn);var Dr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Mr=t=>(...e)=>({_$litDirective$:t,values:e}),at=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:ru}=Ms,Ko=t=>t;var Qo=()=>document.createComment(""),lt=(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 ru(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=Ko(l).nextSibling;Ko(i).insertBefore(l,n),l=c}}}return r},Ee=(t,e,r=t)=>(t._$AI(e,r),t),iu={},Zo=(t,e=iu)=>t._$AH=e,ea=t=>t._$AH,Or=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=Mr(class extends at{constructor(t){if(super(t),t.type!==Dr.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]=Ee(n[p],s[y]),p++,y++;else if(a[h]===o[f])l[f]=Ee(n[h],s[f]),h--,f--;else if(a[p]===o[f])l[f]=Ee(n[p],s[f]),lt(t,l[f+1],n[p]),p++,f--;else if(a[h]===o[y])l[y]=Ee(n[h],s[y]),lt(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 S=d.get(o[y]),x=S!==void 0?n[S]:null;if(x===null){let E=lt(t,n[p]);Ee(E,s[y]),l[y]=E}else l[y]=Ee(x,s[y]),lt(t,n[p],x),n[S]=null;y++}else Or(n[h]),h--;else Or(n[p]),p++;for(;y<=f;){let S=lt(t,l[f+1]);Ee(S,s[y]),l[y++]=S}for(;p<=h;){let S=n[p++];S!==null&&Or(S)}return this.ut=o,Zo(t,l),ne}});var Lt=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`
231
+ `};customElements.get("mw-bubble")||customElements.define("mw-bubble",fn);var Ar={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Tr=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:nu}=Ts,Yo=t=>t;var Ko=()=>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(Ko(),n),o=i.insertBefore(Ko(),n);r=new nu(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),su={},Qo=(t,e=su)=>t._$AH=e,Zo=t=>t._$AH,Dr=t=>{t._$AR(),t._$AA.remove()};var ea=(t,e,r)=>{let i=new Map;for(let n=e;n<=r;n++)i.set(t[n],n);return i},X=Tr(class extends ot{constructor(t){if(super(t),t.type!==Ar.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=Zo(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=ea(o,y,f),d=ea(a,p,h)),c.has(a[p]))if(c.has(a[h])){let E=d.get(o[y]),x=E!==void 0?n[E]:null;if(x===null){let $=at(t,n[p]);$e($,s[y]),l[y]=$}else l[y]=$e(x,s[y]),at(t,n[p],x),n[E]=null;y++}else Dr(n[h]),h--;else Dr(n[p]),p++;for(;y<=f;){let E=at(t,l[f+1]);$e(E,s[y]),l[y++]=E}for(;p<=h;){let E=n[p++];E!==null&&Dr(E)}return this.ut=o,Qo(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`
232
232
  <div class="${this.darkMode?"dark":""} flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pt-6 pb-2">
233
233
  ${this.examples.title?u`
234
234
  <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 +247,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
247
247
  </ul>
248
248
  `:null}
249
249
  </div>
250
- `}#e(e){this.dispatchEvent(new t.ExampleClickEvent({example:e}))}};Lt.ExampleClickEvent=class extends CustomEvent{static type="mw:example-click";constructor(e,r={}){super(Lt.ExampleClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-background")||customElements.define("mw-chat-background",Lt);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`
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`
251
251
  /* blurred background */
252
252
 
253
253
  [part='gradient-blur'] {
@@ -310,7 +310,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
310
310
  </div>
311
311
  </div>
312
312
  </div>
313
- `}#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"}),Lr=class{#e;#t;#r=!1;#n=!1;#i=null;#o=null;#s=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.#s&&(clearTimeout(this.#s),this.#s=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.#o=e,this.#t.onError?.(e),this.#e.requestUpdate(),this.#s&&clearTimeout(this.#s),this.#s=setTimeout(()=>{this.#b()},6e3)}#b(){this.#s&&(clearTimeout(this.#s),this.#s=null),this.#o=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.#S(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.#$(l))),a=vn(o,l=>l.dataUrl);this.#a=[...this.#a,...a],this.#e.requestUpdate(),await ra(3,a,l=>ur({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")}}#S(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#$(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.#o}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 Rr={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`
313
+ `}#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 ta(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 oa=di(sa(),1);var bn=(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 vn=({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"}),Pr=class{#e;#t;#r=!1;#n=!1;#i=null;#o=null;#s=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.#s&&(clearTimeout(this.#s),this.#s=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.#o=e,this.#t.onError?.(e),this.#e.requestUpdate(),this.#s&&clearTimeout(this.#s),this.#s=setTimeout(()=>{this.#b()},6e3)}#b(){this.#s&&(clearTimeout(this.#s),this.#s=null),this.#o=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.#E(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=bn(o,l=>l.dataUrl);this.#a=[...this.#a,...a],this.#e.requestUpdate(),await ta(3,a,l=>lr({times:5,backoff:c=>c*3e3},()=>this.#$(l))),this.#e.requestUpdate()}catch(o){console.error("Failed to process and upload files:",o),this.#y("Upload failed")}}#E(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,oa.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){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.#o}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 Ur={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`
314
314
  <div
315
315
  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}]">
316
316
  <!-- File preview area -->
@@ -371,7 +371,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
371
371
  ?disabled="${this.disabled}"
372
372
  maxlength="1000"
373
373
  placeholder="${this.placeholder}"
374
- class="${this.enableFileUpload?"px-1":"pl-3 pr-1"} box-content h-[${Rr.initialHeight}px] w-full resize-none place-content-center rounded bg-transparent py-[${Rr.paddingY}px] text-base text-gray-800 outline-none placeholder:text-[14px] placeholder:font-light disabled:content-baseline disabled:leading-[${Rr.initialHeight}px] dark:text-gray-200"></textarea>
374
+ class="${this.enableFileUpload?"px-1":"pl-3 pr-1"} box-content h-[${Ur.initialHeight}px] w-full resize-none place-content-center rounded bg-transparent py-[${Ur.paddingY}px] text-base text-gray-800 outline-none placeholder:text-[14px] placeholder:font-light disabled:content-baseline disabled:leading-[${Ur.initialHeight}px] dark:text-gray-200"></textarea>
375
375
 
376
376
  <button
377
377
  type="submit"
@@ -389,7 +389,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
389
389
  <div class="h-5 w-full"></div>
390
390
  </slot>
391
391
  </div>
392
- `}get#t(){return this.renderRoot.querySelector('textarea[name="input"]')??null}get#r(){return this.renderRoot.querySelector('button[type="submit"]')??null}#n(e){bu(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.#s(),this.focus()}#o(e){this.dispatchEvent(new t.ChangeEvent({delta:e.data,full:e.target instanceof HTMLTextAreaElement?e.target.value:""})),this.#s()}#s(){let e=this.#t;if(!e)return;let{maxHeight:r,initialHeight:i,paddingY:n}=Rr;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.#s(),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 bu(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`
392
+ `}get#t(){return this.renderRoot.querySelector('textarea[name="input"]')??null}get#r(){return this.renderRoot.querySelector('button[type="submit"]')??null}#n(e){wu(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.#s(),this.focus()}#o(e){this.dispatchEvent(new t.ChangeEvent({delta:e.data,full:e.target instanceof HTMLTextAreaElement?e.target.value:""})),this.#s()}#s(){let e=this.#t;if(!e)return;let{maxHeight:r,initialHeight:i,paddingY:n}=Ur;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.#s(),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 wu(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 aa({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 wn=class{#e;constructor(e,{delay:r},i){this.#e=aa({delay:r},i),e.addController(this)}get call(){return this.#e}hostDisconnected(){this.#e.cancel()}};function la(t,e,r){return new wn(t,e,r)}function ua(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?`${ca(e)} hr ${r} min`:`${ca(e)} hr`:r>0?t>0?`${r} min ${t} sec`:`${r} min`:`${t} sec`}function da(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 ca(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}var xn=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`
393
393
  @keyframes ellipsis {
394
394
  0% {
395
395
  content: '';
@@ -409,7 +409,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
409
409
  content: '';
410
410
  animation: ellipsis 1.5s infinite;
411
411
  }
412
- `;#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())}#o=()=>{this.expanded=!this.expanded};render(){return u`
412
+ `;#e=la(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 ${ua(e)}`:"Thought"}updated(e){e.has("content")&&(!this.#t&&this.content&&(this.#t=Date.now()),this._inProgress=!0,this.#e.call())}#o=()=>{this.expanded=!this.expanded};render(){return u`
413
413
  <div class="${this.darkMode?"dark":""} w-full">
414
414
  <button
415
415
  @click="${this.#o}"
@@ -427,7 +427,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
427
427
  </div>
428
428
  `:null}
429
429
  </div>
430
- `}};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`
430
+ `}};customElements.get("mw-thought-block")||customElements.define("mw-thought-block",xn);var kn=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`
431
431
  <div class="${this.darkMode?"dark":""} ml-20 flex justify-end font-sans text-base">
432
432
  <div class="max-w-full">
433
433
  <!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
@@ -461,7 +461,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
461
461
  </div>
462
462
  </div>
463
463
  </div>
464
- `;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 vu=Math.pow(10,8)*24*60*60*1e3,Jm=-vu;var wu=3600;var fa=wu*24,Ym=fa*7,xu=fa*365.2425,ku=xu/12,Km=ku*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 Sn(t,e,r){let i=ga(t,e)/1e3;return ha(r?.roundingMethod)(i)}var $n=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
+ `;default:throw new Error(`Unknown side: ${this.side}`)}}};customElements.get("mw-chat-message")||customElements.define("mw-chat-message",kn);function pa(t){return e=>{let i=(t?Math[t]:Math.trunc)(e);return i===0?0:i}}var xu=Math.pow(10,8)*24*60*60*1e3,Xm=-xu;var ku=3600;var ha=ku*24,Jm=ha*7,_u=ha*365.2425,Cu=_u/12,Ym=Cu*3,_n=Symbol.for("constructDateFrom");function fa(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&_n in t?t[_n](e):t instanceof Date?new t.constructor(e):new Date(e)}function Cn(t,e){return fa(e||t,t)}function ma(t,e){return+Cn(t)-+Cn(e)}function $n(t,e,r){let i=ma(t,e)/1e3;return pa(r?.roundingMethod)(i)}var En=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`
465
465
  :host {
466
466
  display: block;
467
467
  }
@@ -545,11 +545,11 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
545
545
 
546
546
  ${this.#o()}
547
547
  </div>
548
- `: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",$n);var In=class extends w(v){static styles=O`
548
+ `: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",En);var Sn=class extends w(v){static styles=O`
549
549
  :host {
550
550
  display: block;
551
551
  }
552
- `;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.#o()}disconnectedCallback(){super.disconnectedCallback(),this.#s()}#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(Sn(this.#t,new Date),0),this.#i()}#i(){if(this.#t===null)return;let e=new Date,r=Sn(this.#t,e);r>=0?(this._remainingSeconds=r,this._isComplete=!1):(this._remainingSeconds=Math.abs(r),this._isComplete=!0)}#o(){this.#s(),this.#e=setInterval(()=>{this.#i()},1e3)}#s(){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`
552
+ `;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.#o()}disconnectedCallback(){super.disconnectedCallback(),this.#s()}#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)}#o(){this.#s(),this.#e=setInterval(()=>{this.#i()},1e3)}#s(){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`
553
553
  <mw-chat-wait-game
554
554
  .question="${this.data?.game_first_question}"
555
555
  .options="${[this.data?.game_button_answer_negative||"No",this.data?.game_button_answer_affirmative||"Yes"]}"
@@ -586,7 +586,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
586
586
  </button>
587
587
  </div>
588
588
  </div>
589
- `}};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)}#o(){document.addEventListener("keydown",this.#a)}#s(){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`
589
+ `}};customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",Sn);var In=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 Ee(t){return new In(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=Ee(this);#t=!1;#r=!1;#n=!1;#i=!1;updated(e){e.has("src")&&(this.#t=!1,this.#r=!1)}#o(){document.addEventListener("keydown",this.#a)}#s(){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`
590
590
  <div class="${this.#l} mb-2 min-h-[100px]">
591
591
  <div class="${this.#c} relative">
592
592
  <!-- Placeholder background that's only shown when loading or error -->
@@ -638,7 +638,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
638
638
  </div>
639
639
  </div>
640
640
  `:null}
641
- `:(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.#o(),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.#s(),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 B=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"],Rt=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:R.disclaimerDismissed}#t(){this.ephemeral||(R.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="${B(o)}" target="_blank" rel="noopener noreferrer" @click="${this.#i}" class="underline" style="color: ${this.color}"
641
+ `:(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.#o(),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.#s(),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}"
642
642
  >${s}</a
643
643
  >${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`
644
644
  <div class="${this.darkMode?"dark":""} flex items-center justify-between">
@@ -656,7 +656,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
656
656
  </button>
657
657
  `:null}
658
658
  </div>
659
- `}};Rt.DismissEvent=class extends CustomEvent{static type="mw-disclaimer:dismiss";constructor(e={}){super(Rt.DismissEvent.type,{...e})}};customElements.get("mw-disclaimer")||customElements.define("mw-disclaimer",Rt);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`
659
+ `}};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 An=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=Ee(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`
660
660
  <div
661
661
  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">
662
662
  <div class="${e.bg} mb-2 flex max-w-[70%] items-center justify-center rounded-full px-3 py-2 select-none">
@@ -666,7 +666,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
666
666
  <span class="${e.text} ml-1 text-xs">${this.text}</span>
667
667
  </div>
668
668
  </div>
669
- `}};customElements.get("mw-info-banner")||customElements.define("mw-info-banner",Tn);var Dn=class extends w(v){render=()=>u`
669
+ `}};customElements.get("mw-info-banner")||customElements.define("mw-info-banner",An);var Tn=class extends w(v){render=()=>u`
670
670
  <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">
671
671
  <circle fill="currentColor" stroke="none" cx="27" cy="50" r="6">
672
672
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
@@ -678,11 +678,11 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
678
678
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
679
679
  </circle>
680
680
  </svg>
681
- `};customElements.get("mw-loading")||customElements.define("mw-loading",Dn);var Cu="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`
681
+ `};customElements.get("mw-loading")||customElements.define("mw-loading",Tn);var Eu="https://molin.ai/?utm_source=molin.ai&utm_medium=widget&utm_campaign=poweredby",Dn=class extends w(v){static properties={darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.darkMode=!1}render(){return u`
682
682
  <p class="${this.darkMode?"text-gray-300":"text-gray-600"} flex items-center justify-center text-xs whitespace-nowrap">
683
683
  <span>Powered by</span>
684
684
 
685
- <a href="${Cu}" target="_blank" class="inline-flex items-center underline">
685
+ <a href="${Eu}" target="_blank" class="inline-flex items-center underline">
686
686
  <svg class="mx-1 inline-block h-4 w-4" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
687
687
  <circle cx="10.0361" cy="10.0361" r="10.0361" fill="#242038" />
688
688
  <path
@@ -701,7 +701,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
701
701
  <span>Molin AI</span>
702
702
  </a>
703
703
  </p>
704
- `}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",Mn);var ut=(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`
704
+ `}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",Dn);var ct=(t,e,r)=>{for(let i of e)if(i[0]===t)return(0,i[1])();return r?.()};var Mn=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`
705
705
  <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">
706
706
  <div class="mb-2">
707
707
  <div class="h-7 w-full animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
@@ -722,7 +722,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
722
722
  ${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>`}
723
723
 
724
724
  <div class="group relative flex items-start">
725
- ${ut(i.status,[["completed",()=>u`
725
+ ${ct(i.status,[["completed",()=>u`
726
726
  <span class="flex h-6 items-center">
727
727
  <span class="flex h-4 w-4 items-center justify-center rounded-full bg-[${this.color}]">
728
728
  <mw-icon class="h-3 w-3 text-white dark:text-gray-800" name="lucide:check"></mw-icon>
@@ -791,7 +791,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
791
791
  `)}
792
792
  `:X(r,i=>i.name,i=>u`
793
793
  <div class="flex items-center gap-2 py-1.5">
794
- <img src="${B(i.image)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
794
+ <img src="${N(i.image)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
795
795
 
796
796
  <div class="min-w-0 flex-1">
797
797
  ${!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>`}
@@ -882,10 +882,10 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
882
882
 
883
883
  <!-- Action buttons section -->
884
884
  <div class="flex w-full flex-col gap-2 overflow-hidden">
885
- ${this.streaming&&!this.orderDetails.order_tracking_label&&!rt(this.orderDetails.order_tracking_url||"")?u`
885
+ ${this.streaming&&!this.orderDetails.order_tracking_label&&!tt(this.orderDetails.order_tracking_url||"")?u`
886
886
  <!-- Loading shimmer for buttons -->
887
887
  <div class="h-10 w-full min-w-[250px] animate-pulse overflow-hidden rounded-xl bg-gray-200 dark:bg-gray-600"></div>
888
- `:this.orderDetails.order_tracking_url&&rt(this.orderDetails.order_tracking_url)?u`
888
+ `:this.orderDetails.order_tracking_url&&tt(this.orderDetails.order_tracking_url)?u`
889
889
  <a
890
890
  target="${this.linksNewTab?"_blank":"_self"}"
891
891
  href="${this.orderDetails.order_tracking_url}"
@@ -895,7 +895,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
895
895
  `:null}
896
896
  </div>
897
897
  </div>
898
- `}};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 Fr=function(){},dt=function(){};var jt=(t,e,r)=>Math.min(Math.max(r,t),e);var Pn=.001,Eu=.01,ya=10,Su=.05,$u=1;function ba({duration:t=800,bounce:e=.25,velocity:r=0,mass:i=1}){let n,s;Fr(t<=ya*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=jt(Su,$u,o),t=jt(Eu,ya,t/1e3),o<1?(n=c=>{let d=c*o,p=d*t,h=d-r,y=qr(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),S=qr(Math.pow(c,2),o);return(-n(c)+Pn>0?-1:1)*((h-y)*f)/S}):(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=Au(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 Iu=12;function Au(t,e,r){let i=r;for(let n=1;n<Iu;n++)i=i-t(i)/e(i);return i}function qr(t,e){return t*Math.sqrt(1-e*e)}var Tu=["duration","bounce"],Du=["stiffness","damping","mass"];function va(t,e){return e.some(r=>t[r]!==void 0)}function Mu(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!va(t,Du)&&va(t,Tu)){let r=ba(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Nr(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}=Mu(s),y=wa,f=wa;function S(){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 $=qr(k,b);y=P=>{let j=Math.exp(-b*k*P);return r-j*((x+b*k*E)/$*Math.sin($*P)+E*Math.cos($*P))},f=P=>{let j=Math.exp(-b*k*P);return b*k*j*(Math.sin($*P)*(x+b*k*E)/$+E*Math.cos($*P))-j*(Math.cos($*P)*(x+b*k*E)-$*E*Math.sin($*P))}}else if(b===1)y=$=>r-Math.exp(-k*$)*(E+(x+k*E)*$);else{let $=k*Math.sqrt(b*b-1);y=P=>{let j=Math.exp(-b*k*P),z=Math.min($*P,300);return r-j*((x+b*k*E)*Math.sinh(z)+$*E*Math.cosh(z))/$}}}return S(),{next:x=>{let E=y(x);if(h)o.done=x>=p;else{let b=f(x)*1e3,k=Math.abs(b)<=i,$=Math.abs(r-E)<=n;o.done=k&&$}return o.value=o.done?r:E,o},flipTarget:()=>{d=-d,[e,r]=[r,e],S()}}}Nr.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 pt=(t,e,r)=>-r*t+r*e+t;var Br=(t,e)=>r=>Math.max(Math.min(r,e),t),$e=t=>t%1?Number(t.toFixed(5)):t,ht=/(-)?([\d]*\.?[\d])+/g,zr=/(#[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 ft={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Wr=Object.assign(Object.assign({},ft),{transform:Br(0,1)}),w0=Object.assign(Object.assign({},ft),{default:1});var Ft=t=>({test:e=>ve(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),_0=Ft("deg"),mt=Ft("%"),C0=Ft("px"),E0=Ft("vh"),S0=Ft("vw"),$0=Object.assign(Object.assign({},mt),{parse:t=>mt.parse(t)/100,transform:t=>mt.transform(t*100)});var gt=(t,e)=>r=>!!(ve(r)&&xa.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Vr=(t,e,r)=>i=>{if(!ve(i))return i;let[n,s,o,a]=i.match(ht);return{[t]:parseFloat(n),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var pe={test:gt("hsl","hue"),parse:Vr("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:i=1})=>"hsla("+Math.round(t)+", "+mt.transform($e(e))+", "+mt.transform($e(r))+", "+$e(Wr.transform(i))+")"};var Ou=Br(0,255),Hr=Object.assign(Object.assign({},ft),{transform:t=>Math.round(Ou(t))}),ie={test:gt("rgb","red"),parse:Vr("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:i=1})=>"rgba("+Hr.transform(t)+", "+Hr.transform(e)+", "+Hr.transform(r)+", "+$e(Wr.transform(i))+")"};function Pu(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 yt={test:gt("#"),parse:Pu,transform:ie.transform};var Ie={test:t=>ie.test(t)||yt.test(t)||pe.test(t),parse:t=>ie.test(t)?ie.parse(t):pe.test(t)?pe.parse(t):yt.parse(t),transform:t=>ve(t)?t:t.hasOwnProperty("red")?ie.transform(t):pe.transform(t)};var ka="${c}",_a="${n}";function Uu(t){var e,r,i,n;return isNaN(t)&&ve(t)&&((r=(e=t.match(ht))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((n=(i=t.match(zr))===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(zr);i&&(r=i.length,t=t.replace(zr,ka),e.push(...i.map(Ie.parse)));let n=t.match(ht);return n&&(t=t.replace(ht,_a),e.push(...n.map(ft.parse))),{values:e,numColors:r,tokenised:t}}function Ea(t){return Ca(t).values}function Sa(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?Ie.transform(s[a]):$e(s[a]));return o}}var Lu=t=>typeof t=="number"?0:t;function Ru(t){let e=Ea(t);return Sa(t)(e.map(Lu))}var Gr={test:Uu,parse:Ea,createTransformer:Sa,getAnimatableNone:Ru};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 Rn({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 ju=(t,e,r)=>{let i=t*t,n=e*e;return Math.sqrt(Math.max(0,r*(n-i)+i))},Fu=[yt,ie,pe],$a=t=>Fu.find(e=>e.test(t)),Ia=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,Xr=(t,e)=>{let r=$a(t),i=$a(e);dt(!!r,Ia(t)),dt(!!i,Ia(e));let n=r.parse(t),s=i.parse(e);r===pe&&(n=Rn(n),r=ie),i===pe&&(s=Rn(s),i=ie);let o=Object.assign({},n);return a=>{for(let l in o)l!=="alpha"&&(o[l]=ju(n[l],s[l],a));return o.alpha=pt(n.alpha,s.alpha,a),r.transform(o)}};var Aa=t=>typeof t=="number";var qu=(t,e)=>r=>e(t(r)),Jr=(...t)=>t.reduce(qu);function Da(t,e){return Aa(t)?r=>pt(t,e,r):Ie.test(t)?Xr(t,e):Fn(t,e)}var jn=(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=Gr.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=Gr.createTransformer(e),i=Ta(t),n=Ta(e);return i.numHSL===n.numHSL&&i.numRGB===n.numRGB&&i.numNumbers>=n.numNumbers?Jr(jn(i.parsed,n.parsed),r):(Fr(!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 Nu=(t,e)=>r=>pt(t,e,r);function Bu(t){if(typeof t=="number")return Nu;if(typeof t=="string")return Ie.test(t)?Xr:Fn;if(Array.isArray(t))return jn;if(typeof t=="object")return Ma}function zu(t,e,r){let i=[],n=r||Bu(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=Jr(l,a)}i.push(a)}return i}function Wu([t,e],[r]){return i=>r(Un(t,e,i))}function Vu(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 Yr(t,e,{clamp:r=!0,ease:i,mixer:n}={}){let s=t.length;dt(s===e.length,"Both input and output ranges must be the same length"),dt(!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=zu(e,i,n),a=s===2?Wu(t,o):Vu(t,o);return r?l=>a(jt(t[0],t[s-1],l)):a}var qt=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,Hu=4/11,Gu=8/11,Xu=9/10;var La=Oa(2),Ty=qt(La),Ra=Kr(La),Ju=t=>1-Math.sin(Math.acos(t)),Yu=qt(Ju),Dy=Kr(Yu),ja=qn(Ua),My=qt(ja),Oy=Kr(ja),Py=Pa(Ua),Ku=4356/361,Qu=35442/1805,Zu=16061/1805,ed=t=>{if(t===1||t===0)return t;let e=t*t;return t<Hu?7.5625*e:t<Gu?9.075*e-9.9*t+3.4:t<Xu?Ku*e-Qu*t+Zu:10.8*t*t-20.52*t+10.72},Uy=qt(ed);function td(t,e){return t.map(()=>e||Ra).splice(0,t.length-1)}function rd(t){let e=t.length;return t.map((r,i)=>i!==0?i/(e-1):0)}function id(t,e){return t.map(r=>r*e)}function Nt({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=id(i&&i.length===o.length?i:rd(o),n);function l(){return Yr(a,o,{ease:Array.isArray(r)?r:td(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:Nt,spring:Nr,decay:Fa};function Na(t){if(Array.isArray(t.to))return Nt;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")?Nt:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Nr:Nt}var Nn=16.666666666666668,nd=typeof performance<"u"?()=>performance.now():()=>Date.now(),Bn=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(nd()),Nn);function Ba(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 sd=40,zn=!0,zt=!1,Wn=!1,Bt={delta:0,timestamp:0},Wt=["read","update","preRender","render","postRender"],Qr=Wt.reduce((t,e)=>(t[e]=Ba(()=>zt=!0),t),{}),od=Wt.reduce((t,e)=>{let r=Qr[e];return t[e]=(i,n=!1,s=!1)=>(zt||ld(),r.schedule(i,n,s)),t},{}),za=Wt.reduce((t,e)=>(t[e]=Qr[e].cancel,t),{}),Jy=Wt.reduce((t,e)=>(t[e]=()=>Qr[e].process(Bt),t),{}),ad=t=>Qr[t].process(Bt),Wa=t=>{zt=!1,Bt.delta=zn?Nn:Math.max(Math.min(t-Bt.timestamp,sd),1),Bt.timestamp=t,Wn=!0,Wt.forEach(ad),Wn=!1,zt&&(zn=!1,Bn(Wa))},ld=()=>{zt=!0,zn=!0,Wn||Bn(Wa)};var Va=od;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 cd=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=cd,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:d,onStop:p,onComplete:h,onRepeat:y,onUpdate:f}=t,S=jr(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:x}=S,E,b=0,k=S.duration,$,P=!1,j=!0,z,T=Na(S);!((r=(e=T).needsInterpolation)===null||r===void 0)&&r.call(e,i,x)&&(z=Yr([0,100],[i,x],{clamp:!1}),i=0,x=100);let W=T(Object.assign(Object.assign({},S),{from:i,to:x}));function Y(){b++,l==="reverse"?(j=b%2===0,o=Ha(o,k,c,j)):(o=Vn(o,k,c),l==="mirror"&&W.flipTarget()),P=!1,y&&y()}function di(){E.stop(),h&&h()}function Ae(L){if(j||(L=-L),o+=L,!P){let V=W.next(Math.max(0,o));$=V.value,z&&($=z($)),P=j?V.done:o<=0}f?.($),P&&(b===0&&(k??(k=o)),b<a?Ga(o,k,c,j)&&Y():di())}function Zt(){d?.(),E=s(Ae),E.start()}return n&&Zt(),{stop:()=>{p?.(),E.stop()}}}var Be=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
+ `}};customElements.get("mw-order-card")||customElements.define("mw-order-card",Mn);function Lr(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 jr=function(){},ut=function(){};var jt=(t,e,r)=>Math.min(Math.max(r,t),e);var On=.001,Su=.01,ga=10,Iu=.05,Au=1;function ya({duration:t=800,bounce:e=.25,velocity:r=0,mass:i=1}){let n,s;jr(t<=ga*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=jt(Iu,Au,o),t=jt(Su,ga,t/1e3),o<1?(n=c=>{let d=c*o,p=d*t,h=d-r,y=Rr(c,o),f=Math.exp(-p);return On-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),E=Rr(Math.pow(c,2),o);return(-n(c)+On>0?-1:1)*((h-y)*f)/E}):(n=c=>{let d=Math.exp(-c*t),p=(c-r)*t+1;return-On+d*p},s=c=>{let d=Math.exp(-c*t),p=(r-c)*(t*t);return d*p});let a=5/t,l=Du(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 Tu=12;function Du(t,e,r){let i=r;for(let n=1;n<Tu;n++)i=i-t(i)/e(i);return i}function Rr(t,e){return t*Math.sqrt(1-e*e)}var Mu=["duration","bounce"],Ou=["stiffness","damping","mass"];function ba(t,e){return e.some(r=>t[r]!==void 0)}function Pu(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!ba(t,Ou)&&ba(t,Mu)){let r=ya(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Fr(t){var{from:e=0,to:r=1,restSpeed:i=2,restDelta:n}=t,s=Lr(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:a,damping:l,mass:c,velocity:d,duration:p,isResolvedFromDuration:h}=Pu(s),y=va,f=va;function E(){let x=d?-(d/1e3):0,$=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=Rr(k,b);y=P=>{let R=Math.exp(-b*k*P);return r-R*((x+b*k*$)/S*Math.sin(S*P)+$*Math.cos(S*P))},f=P=>{let R=Math.exp(-b*k*P);return b*k*R*(Math.sin(S*P)*(x+b*k*$)/S+$*Math.cos(S*P))-R*(Math.cos(S*P)*(x+b*k*$)-S*$*Math.sin(S*P))}}else if(b===1)y=S=>r-Math.exp(-k*S)*($+(x+k*$)*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*$)*Math.sinh(z)+S*$*Math.cosh(z))/S}}}return E(),{next:x=>{let $=y(x);if(h)o.done=x>=p;else{let b=f(x)*1e3,k=Math.abs(b)<=i,S=Math.abs(r-$)<=n;o.done=k&&S}return o.value=o.done?r:$,o},flipTarget:()=>{d=-d,[e,r]=[r,e],E()}}}Fr.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var va=t=>0;var Pn=(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 qr=(t,e)=>r=>Math.max(Math.min(r,e),t),Se=t=>t%1?Number(t.toFixed(5)):t,pt=/(-)?([\d]*\.?[\d])+/g,Br=/(#[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,wa=/^(#[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},Nr=Object.assign(Object.assign({},ht),{transform:qr(0,1)}),v0=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}`}),k0=Rt("deg"),ft=Rt("%"),_0=Rt("px"),C0=Rt("vh"),$0=Rt("vw"),E0=Object.assign(Object.assign({},ft),{parse:t=>ft.parse(t)/100,transform:t=>ft.transform(t*100)});var mt=(t,e)=>r=>!!(ve(r)&&wa.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),zr=(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:zr("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:i=1})=>"hsla("+Math.round(t)+", "+ft.transform(Se(e))+", "+ft.transform(Se(r))+", "+Se(Nr.transform(i))+")"};var Uu=qr(0,255),Wr=Object.assign(Object.assign({},ht),{transform:t=>Math.round(Uu(t))}),ie={test:mt("rgb","red"),parse:zr("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:i=1})=>"rgba("+Wr.transform(t)+", "+Wr.transform(e)+", "+Wr.transform(r)+", "+Se(Nr.transform(i))+")"};function Lu(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:Lu,transform:ie.transform};var Ie={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 xa="${c}",ka="${n}";function ju(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(Br))===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0)>0}function _a(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,i=t.match(Br);i&&(r=i.length,t=t.replace(Br,xa),e.push(...i.map(Ie.parse)));let n=t.match(pt);return n&&(t=t.replace(pt,ka),e.push(...n.map(ht.parse))),{values:e,numColors:r,tokenised:t}}function Ca(t){return _a(t).values}function $a(t){let{values:e,numColors:r,tokenised:i}=_a(t),n=e.length;return s=>{let o=i;for(let a=0;a<n;a++)o=o.replace(a<r?xa:ka,a<r?Ie.transform(s[a]):Se(s[a]));return o}}var Ru=t=>typeof t=="number"?0:t;function Fu(t){let e=Ca(t);return $a(t)(e.map(Ru))}var Vr={test:ju,parse:Ca,createTransformer:$a,getAnimatableNone:Fu};function Un(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 Ln({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=Un(l,a,t+1/3),s=Un(l,a,t),o=Un(l,a,t-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}var qu=(t,e,r)=>{let i=t*t,n=e*e;return Math.sqrt(Math.max(0,r*(n-i)+i))},Bu=[gt,ie,pe],Ea=t=>Bu.find(e=>e.test(t)),Sa=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,Hr=(t,e)=>{let r=Ea(t),i=Ea(e);ut(!!r,Sa(t)),ut(!!i,Sa(e));let n=r.parse(t),s=i.parse(e);r===pe&&(n=Ln(n),r=ie),i===pe&&(s=Ln(s),i=ie);let o=Object.assign({},n);return a=>{for(let l in o)l!=="alpha"&&(o[l]=qu(n[l],s[l],a));return o.alpha=dt(n.alpha,s.alpha,a),r.transform(o)}};var Ia=t=>typeof t=="number";var Nu=(t,e)=>r=>e(t(r)),Gr=(...t)=>t.reduce(Nu);function Ta(t,e){return Ia(t)?r=>dt(t,e,r):Ie.test(t)?Hr(t,e):Rn(t,e)}var jn=(t,e)=>{let r=[...t],i=r.length,n=t.map((s,o)=>Ta(s,e[o]));return s=>{for(let o=0;o<i;o++)r[o]=n[o](s);return r}},Da=(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]=Ta(t[n],e[n]));return n=>{for(let s in i)r[s]=i[s](n);return r}};function Aa(t){let e=Vr.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 Rn=(t,e)=>{let r=Vr.createTransformer(e),i=Aa(t),n=Aa(e);return i.numHSL===n.numHSL&&i.numRGB===n.numRGB&&i.numNumbers>=n.numNumbers?Gr(jn(i.parsed,n.parsed),r):(jr(!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 zu=(t,e)=>r=>dt(t,e,r);function Wu(t){if(typeof t=="number")return zu;if(typeof t=="string")return Ie.test(t)?Hr:Rn;if(Array.isArray(t))return jn;if(typeof t=="object")return Da}function Vu(t,e,r){let i=[],n=r||Wu(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=Gr(l,a)}i.push(a)}return i}function Hu([t,e],[r]){return i=>r(Pn(t,e,i))}function Gu(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=Pn(t[s],t[s+1],n);return e[s](a)}}function Xr(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=Vu(e,i,n),a=s===2?Hu(t,o):Gu(t,o);return r?l=>a(jt(t[0],t[s-1],l)):a}var Ft=t=>e=>1-t(1-e),Jr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ma=t=>e=>Math.pow(e,t),Fn=t=>e=>e*e*((t+1)*e-t),Oa=t=>{let e=Fn(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var Pa=1.525,Xu=4/11,Ju=8/11,Yu=9/10;var Ua=Ma(2),Ay=Ft(Ua),La=Jr(Ua),Ku=t=>1-Math.sin(Math.acos(t)),Qu=Ft(Ku),Ty=Jr(Qu),ja=Fn(Pa),Dy=Ft(ja),My=Jr(ja),Oy=Oa(Pa),Zu=4356/361,ed=35442/1805,td=16061/1805,rd=t=>{if(t===1||t===0)return t;let e=t*t;return t<Xu?7.5625*e:t<Ju?9.075*e-9.9*t+3.4:t<Yu?Zu*e-ed*t+td:10.8*t*t-20.52*t+10.72},Py=Ft(rd);function id(t,e){return t.map(()=>e||La).splice(0,t.length-1)}function nd(t){let e=t.length;return t.map((r,i)=>i!==0?i/(e-1):0)}function sd(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=sd(i&&i.length===o.length?i:nd(o),n);function l(){return Xr(a,o,{ease:Array.isArray(r)?r:id(o,r)})}let c=l();return{next:d=>(s.value=c(d),s.done=d>=n,s),flipTarget:()=>{o.reverse(),c=l()}}}function Ra({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 Fa={keyframes:qt,spring:Fr,decay:Ra};function qa(t){if(Array.isArray(t.to))return qt;if(Fa[t.type])return Fa[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")?Fr:qt}var qn=16.666666666666668,od=typeof performance<"u"?()=>performance.now():()=>Date.now(),Bn=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(od()),qn);function Ba(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 ad=40,Nn=!0,Nt=!1,zn=!1,Bt={delta:0,timestamp:0},zt=["read","update","preRender","render","postRender"],Yr=zt.reduce((t,e)=>(t[e]=Ba(()=>Nt=!0),t),{}),ld=zt.reduce((t,e)=>{let r=Yr[e];return t[e]=(i,n=!1,s=!1)=>(Nt||ud(),r.schedule(i,n,s)),t},{}),Na=zt.reduce((t,e)=>(t[e]=Yr[e].cancel,t),{}),Xy=zt.reduce((t,e)=>(t[e]=()=>Yr[e].process(Bt),t),{}),cd=t=>Yr[t].process(Bt),za=t=>{Nt=!1,Bt.delta=Nn?qn:Math.max(Math.min(t-Bt.timestamp,ad),1),Bt.timestamp=t,zn=!0,zt.forEach(cd),zn=!1,Nt&&(Nn=!1,Bn(za))},ud=()=>{Nt=!0,Nn=!0,zn||Bn(za)};var Wa=ld;function Wn(t,e,r=0){return t-e-r}function Va(t,e,r=0,i=!0){return i?Wn(e+-t,e,r):e-(t-e)+r}function Ha(t,e,r,i){return i?t>=e+r:t<=-r}var dd=t=>{let e=({delta:r})=>t(r);return{start:()=>Wa.update(e,!0),stop:()=>Na.update(e)}};function Vn(t){var e,r,{from:i,autoplay:n=!0,driver:s=dd,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:d,onStop:p,onComplete:h,onRepeat:y,onUpdate:f}=t,E=Lr(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:x}=E,$,b=0,k=E.duration,S,P=!1,R=!0,z,T=qa(E);!((r=(e=T).needsInterpolation)===null||r===void 0)&&r.call(e,i,x)&&(z=Xr([0,100],[i,x],{clamp:!1}),i=0,x=100);let W=T(Object.assign(Object.assign({},E),{from:i,to:x}));function Y(){b++,l==="reverse"?(R=b%2===0,o=Va(o,k,c,R)):(o=Wn(o,k,c),l==="mirror"&&W.flipTarget()),P=!1,y&&y()}function ui(){$.stop(),h&&h()}function Ae(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?Ha(o,k,c,R)&&Y():ui())}function Kt(){d?.(),$=s(Ae),$.start()}return n&&Kt(),{stop:()=>{p?.(),$.stop()}}}var Ne=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`
899
899
  <div class="${this.darkMode?"dark border-gray-600 bg-[#1E1F23]":"border-[#5e5d59]/25 bg-white"} my-2 w-full rounded-3xl border p-4">
900
900
  <div class="relative mx-auto mb-4 max-w-[240px]">
901
901
  <div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200 dark:bg-gray-700"></div>
@@ -984,10 +984,10 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
984
984
  </button> -->
985
985
  </div>
986
986
  </div>
987
- `}#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}#o(){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}#s(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")}};Be.AddToCartEvent=class extends CustomEvent{static type="mw-product-card:add-to-cart";constructor(e,r={}){super(Be.AddToCartEvent.type,{detail:{product:e},...r})}};customElements.get("mw-product-card")||customElements.define("mw-product-card",Be);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 Vt=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 eo(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
+ `}#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&&Vn({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}#o(){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}#s(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")}};Ne.AddToCartEvent=class extends CustomEvent{static type="mw-product-card:add-to-cart";constructor(e,r={}){super(Ne.AddToCartEvent.type,{detail:{product:e},...r})}};customElements.get("mw-product-card")||customElements.define("mw-product-card",Ne);var Hn=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 Ga(t){return new Hn(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=Ga(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 Xs(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`
988
988
  <a
989
- href="${B(this.trackedProductUrl)}"
990
- title="${B(e)}"
989
+ href="${N(this.trackedProductUrl)}"
990
+ title="${N(e)}"
991
991
  class="${this.darkMode?"dark":""} group flex w-full max-w-md cursor-pointer gap-2.5 overflow-hidden rounded-lg"
992
992
  target="${this.linksNewTab?"_blank":"_self"}"
993
993
  ?disabled="${this.streaming}">
@@ -1030,7 +1030,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1030
1030
  ${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>`}
1031
1031
  </div>
1032
1032
  </a>
1033
- `}};customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",Vt);function Zr(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=Zr(this.orderDetails?.order_status?.step||[]),r=Zr(this.orderDetails?.items?.item||[]),i=Zr(this.orderDetails?.actions||[]);return u`
1033
+ `}};customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",Wt);function Kr(t){return Array.isArray(t)?t:t?[t]:[]}function Xa(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 Gn=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=Kr(this.orderDetails?.order_status?.step||[]),r=Kr(this.orderDetails?.items?.item||[]),i=Kr(this.orderDetails?.actions||[]);return u`
1034
1034
  <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">
1035
1035
  <!-- Header with order ID -->
1036
1036
  <div class="mb-2">
@@ -1060,7 +1060,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1060
1060
  ${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>`}
1061
1061
 
1062
1062
  <div class="group relative flex items-start">
1063
- ${ut(n.status,[["pending",()=>u`
1063
+ ${ct(n.status,[["pending",()=>u`
1064
1064
  <span class="flex h-6 items-center">
1065
1065
  <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]">
1066
1066
  <span class="h-1.5 w-1.5 rounded-full bg-transparent"></span>
@@ -1129,7 +1129,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1129
1129
  `)}
1130
1130
  `:r?.map(n=>{let s=n?.image_url;return u`
1131
1131
  <div class="flex items-center gap-2 py-1.5">
1132
- <img src="${B(s)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
1132
+ <img src="${N(s)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
1133
1133
 
1134
1134
  <div class="min-w-0 flex-1">
1135
1135
  ${!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>`}
@@ -1212,11 +1212,11 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1212
1212
 
1213
1213
  <!-- Action buttons section -->
1214
1214
  <div class="flex w-full flex-col gap-2 overflow-hidden">
1215
- ${this.streaming&&!i[0]?.track_order?.label&&!rt(i[0]?.track_order?.tracking_url||"")?u`
1215
+ ${this.streaming&&!i[0]?.track_order?.label&&!tt(i[0]?.track_order?.tracking_url||"")?u`
1216
1216
  <!-- Loading shimmer for buttons -->
1217
1217
  <div class="h-10 w-full min-w-[250px] animate-pulse overflow-hidden rounded-xl bg-gray-200 dark:bg-gray-600"></div>
1218
1218
  `:X(i,(n,s)=>`action-${s}`,n=>{if(n?.track_order?.label)return u`
1219
- ${rt(n.track_order?.tracking_url||"")?u` <a
1219
+ ${tt(n.track_order?.tracking_url||"")?u` <a
1220
1220
  target="${this.linksNewTab?"_blank":"_self"}"
1221
1221
  href="${n.track_order?.tracking_url}"
1222
1222
  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"
@@ -1225,11 +1225,11 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1225
1225
  `})}
1226
1226
  </div>
1227
1227
  </div>
1228
- `}};customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",Xn);var Ht=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
+ `}};customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",Gn);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`
1229
1229
  <div
1230
1230
  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}]">
1231
1231
  <div class="flex flex-col gap-2 p-4">
1232
- ${ut(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
+ ${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>`)}
1233
1233
  </div>
1234
1234
  </div>
1235
1235
  `}#e(){return u`
@@ -1275,13 +1275,13 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1275
1275
  <mw-icon class="${r?"text-green-500":"text-gray-400 dark:text-gray-300"} h-6 w-6" name="lucide:thumbs-up"></mw-icon>
1276
1276
  </button>
1277
1277
  </div>
1278
- `}#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})))}#o(e){this._selectedRating>0||(this._hoverRating=e)}#s(){this._selectedRating>0||(this._hoverRating=0)}#a(e){this._selectedVote||(this._selectedVote=e,this.dispatchEvent(new t.SubmitEvent({type:"binary-vote",vote:e})))}};Ht.SubmitEvent=class extends CustomEvent{static type="mw-request-input:submit";constructor(e,r={}){super(Ht.SubmitEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-request-input")||customElements.define("mw-request-input",Ht);var Jn=class{#e;#t=0;#r;#n;#i;#o;#s=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.#o=o,e.addController(this)}start(e){this.cancel(),this.#a=e,this.#r&&(this.#t=this.#r(e)),this.#s=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.#s)/this.#t,1),i=this.#n(r);this.#i(i,this.#a),r<1?this.#e=requestAnimationFrame(this.#l):(this.#e=void 0,this.#o?.(this.#a))};hostDisconnected(){this.cancel()}};function Ya(t,e){return new Jn(t,e)}var Yn=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=Ya(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
+ `}#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})))}#o(e){this._selectedRating>0||(this._hoverRating=e)}#s(){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 Xn=class{#e;#t=0;#r;#n;#i;#o;#s=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.#o=o,e.addController(this)}start(e){this.cancel(),this.#a=e,this.#r&&(this.#t=this.#r(e)),this.#s=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.#s)/this.#t,1),i=this.#n(r);this.#i(i,this.#a),r<1?this.#e=requestAnimationFrame(this.#l):(this.#e=void 0,this.#o?.(this.#a))};hostDisconnected(){this.cancel()}};function Ja(t,e){return new Xn(t,e)}var Jn=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=Ee(this);#t=Ja(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`
1279
1279
  <div id="text-spotlight-container" class="${this.className} relative inline-block overflow-hidden whitespace-nowrap">
1280
1280
  <div class="text-[${this.textColor}]">
1281
1281
  ${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>`})}
1282
1282
  </div>
1283
1283
  </div>
1284
- `}get#r(){return this.renderRoot.querySelector("#text-spotlight-container")}};customElements.define("mw-text-spotlight",Yn);var Kn=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
+ `}get#r(){return this.renderRoot.querySelector("#text-spotlight-container")}};customElements.define("mw-text-spotlight",Jn);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`
1285
1285
  <mw-text-spotlight
1286
1286
  text="${`${this.text||"Working"}\u2026`}"
1287
1287
  .speed="${3}"
@@ -1289,7 +1289,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1289
1289
  .highlightColor="${this.color||(this.darkMode?"#FFFFFF":"#000000")}"
1290
1290
  class="block h-6 leading-6">
1291
1291
  </mw-text-spotlight>
1292
- `}};customElements.get("mw-tool-call-indicator")||customElements.define("mw-tool-call-indicator",Kn);var Ka=["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/heic"];var Gt=class extends at{constructor(e){if(super(e),this.it=U,e.type!==Dr.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:[]}}};Gt.directiveName="unsafeHTML",Gt.resultType=1;var Qa=Mr(Gt);var Za=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:hr(Ze(C(),$i(),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=>Ze(It(),Di(e=>Array.isArray(e)?e:[e]),Qe(t));var el=N({order_id_label:A(C()),order_id_value:A(C()),timeline:A(N({step:Qn(N({label:A(C()),status:A(At(["completed","in_progress","pending"]))}))})),items:A(N({item:Qn(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 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(gr,t.data);if(f.success)return u`
1292
+ `}};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!==Ar.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 Ka=Tr(Ht);var Qa=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:dr(Qe(C(),Ei(),Ai())),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 Kn=t=>Qe(St(),Ti(e=>Array.isArray(e)?e:[e]),Ke(t));var Za=B({order_id_label:A(C()),order_id_value:A(C()),timeline:A(B({step:Kn(B({label:A(C()),status:A(It(["completed","in_progress","pending"]))}))})),items:A(B({item:Kn(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 el(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`${Ka(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(fr,t.data);if(f.success)return u`
1293
1293
  ${h?u`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
1294
1294
  <mw-product-card-horizontal
1295
1295
  .product="${f.output}"
@@ -1305,9 +1305,9 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1305
1305
  ?links-new-tab="${n}"
1306
1306
  ?dark-mode="${c}"
1307
1307
  color="${l}"></mw-product-order-status-card>
1308
- `;case"order-card-v2":{let f=se(el,t.data);f.success||console.warn("cannot parse order-card-v2",f.issues);let S=f.success?f.output:t.data;return u`
1308
+ `;case"order-card-v2":{let f=se(Za,t.data);f.success||console.warn("cannot parse order-card-v2",f.issues);let E=f.success?f.output:t.data;return u`
1309
1309
  <!-- -->
1310
- <mw-order-card .orderDetails="${S}" ?streaming="${!y}" ?links-new-tab="${n}" ?dark-mode="${c}" color="${l}"></mw-order-card>
1310
+ <mw-order-card .orderDetails="${E}" ?streaming="${!y}" ?links-new-tab="${n}" ?dark-mode="${c}" color="${l}"></mw-order-card>
1311
1311
  `}case"live-chat-wait-card-v1":{let f=t.data||{};return a?u`<p><i>${f.message}</i></p>`:u`
1312
1312
  <mw-chat-wait-timer
1313
1313
  heading="${f.title||""}"
@@ -1326,20 +1326,20 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1326
1326
  cdnBaseUrl="${p}"
1327
1327
  sound="${p?`${p}/assets/game-intro.aac`:""}"
1328
1328
  ?dark-mode="${c}"></mw-chat-wait-timer>
1329
- `}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 S=f.success?f.output:t.data||{};return a?u`<p><i>${S.subtitle}</i></p>`:u`
1329
+ `}case"live-chat-wait-card-v2":{let f=se(Qa,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`
1330
1330
  <mw-chat-wait-timer
1331
- .data="${S}"
1331
+ .data="${E}"
1332
1332
  color="${l}"
1333
1333
  apiBaseUrl="${d}"
1334
1334
  cdnBaseUrl="${p}"
1335
1335
  sound="${p?`${p}/assets/game-intro.aac`:""}"
1336
1336
  ?dark-mode="${c}"></mw-chat-wait-timer>
1337
- `}case"request-input-v1":return u``}return console.warn("could not render part:",t),u`<p><i>data type not supported</i></p>`}var ei=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 ti=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=Qs(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 ti(p,"HTTP",d.status)}if(d.status!==204){if(d.headers.get("Content-Type")?.startsWith("application/json"))return d.json();throw new ti("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";var ud=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"}),dd=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"}),pd=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"}),ze=new URL(import.meta.url).hostname,Xt=ud[ze],is=dd[ze],ns=pd[ze];if(!ze)throw new Error("Could not determine JS bundle hostname. Please make sure this code is running in an environment with a valid hostname.");if(!Xt)throw new Error(`Unknown JS bundle hostname: ${ze}. Please make sure to add it to the MOLIN_API_BASE_URL_MAP.`);if(!is)throw new Error(`Unknown JS bundle hostname: ${ze}. Please make sure to add it to the MOLIN_UPLOADS_BASE_URL_MAP.`);if(!ns)throw new Error(`Unknown JS bundle hostname: ${ze}. Please make sure to add it to the MOLIN_CDN_BASE_URL_MAP.`);var fd=["star-rating","binary-vote","new-conversation-button"],We=class t extends w(v){static styles=O`
1337
+ `}case"request-input-v1":return u``}return console.warn("could not render part:",t),u`<p><i>data type not supported</i></p>`}var Qr=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 Qn({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 tl(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 Zr=class extends Error{constructor(e,r,i){super(),this.name=this.constructor.name,this.message=e,this.type=r,this.code=i}},Zn=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=Hs(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?tl(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 Zr(p,"HTTP",d.status)}if(d.status!==204){if(d.headers.get("Content-Type")?.startsWith("application/json"))return d.json();throw new Zr("Response content type is not JSON and we do not handle others yet","HTTP",d.status)}}};function rl(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 Zn(s.baseUrl,a,{fetch:e,headers:r})}})}var es=class{#e;uploadsAPI;constructor(e,r){this.#e=e,this.uploadsAPI=rl(r),e.addController(this)}hostDisconnected(){}};function il(t,e){return new es(t,e).uploadsAPI}var ts="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 rs(){return new URL(import.meta.url).hostname}function ei(){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=rs(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinApiBaseUrl.`);return r}function nl(){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=rs(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinUploadsBaseUrl.`);return r}function sl(){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=rs(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinCdnBaseUrl.`);return r}var hd=["star-rating","binary-vote","new-conversation-button"],ze=class t extends w(v){static styles=O`
1338
1338
  div.dark::before {
1339
1339
  opacity: 0.8;
1340
1340
  background-color: rgba(20, 22, 26, var(--tw-bg-opacity));
1341
1341
  }
1342
- `;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,is);#r=new Map;constructor(){super(),this.showClose=!1,this.showExpand=!1,this.expanded=!1,this.open=!1,this._currentRequestInputIndex=0}#n=new ei(this,{typingStarted:()=>this.#e.value?.sendUserTypingStart(),typingStopped:()=>this.#e.value?.sendUserTypingStop()});#i=new Lr(this,{acceptedTypes:Ka,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}#o="single";#s=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.#s&&(this.#s=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`
1342
+ `;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=lo(this);#t=il(this,nl());#r=new Map;constructor(){super(),this.showClose=!1,this.showExpand=!1,this.expanded=!1,this.open=!1,this._currentRequestInputIndex=0}#n=new Qr(this,{typingStarted:()=>this.#e.value?.sendUserTypingStart(),typingStopped:()=>this.#e.value?.sendUserTypingStop()});#i=new Pr(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}#o="single";#s=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.#s&&(this.#s=r,this._currentRequestInputIndex=0),this.#i.setEnabled(!!this.#e.value?.widgetId)}render(){D(this.config,"config is required");let e=Xa(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`
1343
1343
  <div
1344
1344
  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]">
1345
1345
  <div
@@ -1347,7 +1347,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1347
1347
  <mw-chat-header
1348
1348
  class="absolute top-1.5 right-1.5 left-1.5"
1349
1349
  .content="${{logoUrl:this.config.logoUrl,title:this.config.title,color:this.config.color}}"
1350
- ?show-new-chat="${!this.isLiveMode&&this.messages.length>0&&!this.#S}"
1350
+ ?show-new-chat="${!this.isLiveMode&&this.messages.length>0&&!this.#E}"
1351
1351
  ?show-close="${this.showClose}"
1352
1352
  ?show-expand="${this.showExpand}"
1353
1353
  ?expanded="${this.expanded}"
@@ -1385,8 +1385,8 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1385
1385
  <!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
1386
1386
  <div class="${this.messages.length>0?"pt-20":""}">
1387
1387
  ${X(Array.from(e),([s])=>s,([s,o])=>u`
1388
- <div class="my-2 text-center text-xs text-gray-500 dark:text-gray-400">${pa(new Date(Number(s)),window.navigator.language)}</div>
1389
- ${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,S=()=>f&&!h&&!d?"single-current":!h&&!d?"single":!h&&d?"first":f&&h&&!d?"last-current":h&&!d?"last":h&&d?"middle":"single";this.#o=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`
1388
+ <div class="my-2 text-center text-xs text-gray-500 dark:text-gray-400">${da(new Date(Number(s)),window.navigator.language)}</div>
1389
+ ${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.#o=E();let x=this.isLiveMode&&a.role==="user"&&a.id===this.lastMsg?.id?"sent":"",$=(a.content.includes("<request-input-v1>")||!a.content)&&a.parts?.every(b=>"data"in b&&b.tag==="request-input-v1");return u`
1390
1390
  ${a.images?X(a.images,b=>b,b=>u`
1391
1391
  <div data-id="${a.id}" class="${d?"mb-[1px]":"mb-3"} mr-2 ml-[15px] flex-row">
1392
1392
  <mw-chat-image
@@ -1397,7 +1397,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1397
1397
  width="300px"></mw-chat-image>
1398
1398
  </div>
1399
1399
  `):null}
1400
- ${(a.content||a.parts)&&!E?u`
1400
+ ${(a.content||a.parts)&&!$?u`
1401
1401
  <div data-id="${a.id}" class="${d?"mb-[1px]":"mb-3"} mx-2 flex-row">
1402
1402
  <mw-chat-message
1403
1403
  .color="${this.config?.color}"
@@ -1407,8 +1407,8 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1407
1407
  position=${this.#o}
1408
1408
  ?dark-mode="${n}"
1409
1409
  @click="${this.#u}">
1410
- <div class="${rs} break-words text-inherit">
1411
- ${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:Xt,cdnBaseUrl:ns})):u`<p>${a.content}</p>`}
1410
+ <div class="${ts} break-words text-inherit">
1411
+ ${a.parts?.length?X(a.parts,(b,k)=>k,(b,k)=>el(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:ei(),cdnBaseUrl:sl()})):u`<p>${a.content}</p>`}
1412
1412
  </div>
1413
1413
  </mw-chat-message>
1414
1414
  </div>
@@ -1418,7 +1418,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1418
1418
 
1419
1419
  <!-- show tool call indicator when a tool is being executed -->
1420
1420
  ${this.toolCallIndicator?u`
1421
- <mw-chat-message class="mx-2 mb-3 block" color="${this.config?.color}" logo="${B(this.config?.logoUrl)}" side="assistant" ?dark-mode="${n}">
1421
+ <mw-chat-message class="mx-2 mb-3 block" color="${this.config?.color}" logo="${N(this.config?.logoUrl)}" side="assistant" ?dark-mode="${n}">
1422
1422
  <mw-tool-call-indicator text="${this.toolCallIndicator}" color="${this.config?.color}" ?dark-mode="${n}"></mw-tool-call-indicator>
1423
1423
  </mw-chat-message>
1424
1424
  `:null}
@@ -1431,7 +1431,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1431
1431
  logo="${this.typingIndicator?.metadata?.avatar||this.config?.logoUrl}"
1432
1432
  side="${this.typingIndicator.role}"
1433
1433
  ?dark-mode="${n}">
1434
- <div class="${rs} break-words text-inherit">
1434
+ <div class="${ts} break-words text-inherit">
1435
1435
  <mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}] text-[${this.config.color}]"></mw-loading>
1436
1436
  </div>
1437
1437
  </mw-chat-message>
@@ -1498,7 +1498,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1498
1498
  </div>
1499
1499
  </div>
1500
1500
  </div>
1501
- `}#u(e){let r=e.composedPath(),i=r.find(n=>n instanceof HTMLAnchorElement);if(i){e.preventDefault();let n=r.find(c=>c instanceof Be||c instanceof Vt),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#S(){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#$(){return this.renderRoot.querySelector("#scrollable-content")}#E(){this.#$?.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`
1501
+ `}#u(e){let r=e.composedPath(),i=r.find(n=>n instanceof HTMLAnchorElement);if(i){e.preventDefault();let n=r.find(c=>c instanceof Ne||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=Qn({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.#$(),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.#$(),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"||!hd.includes(n.data.type)?null:{title:String(n.data.title),type:n.data.type,key:String(n.data.key)}).filter(n=>n!==null)}get#E(){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")}#$(){this.#S?.scrollTo({top:0,behavior:"instant"})}get#k(){return this.renderRoot.querySelector("mw-chat-input")}reloadConfig(){this.#e.value?.reloadConfig(),this.requestUpdate()}sendMessage=Qn({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()}};ze.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(ze.ExpandClickEvent.type,{...e})}};ze.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(ze.CloseClickEvent.type,{...e})}};customElements.get("mw-chat")||customElements.define("mw-chat",ze);var We=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`
1502
1502
  <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">
1503
1503
  <mw-spinning-border .size=${"420px"} .color=${this.color||"#8B5CF6"} .radius=${"18px"} ?dark-mode="${this.dark}">
1504
1504
  <form
@@ -1529,7 +1529,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1529
1529
  </form>
1530
1530
  </mw-spinning-border>
1531
1531
  </div>
1532
- `}#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`
1532
+ `}#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){fd(e)&&(e.preventDefault(),this.disabled||this.#n?.click())}};We.SubmitInputEvent=class extends CustomEvent{static type="mw-floating-ask-ai:submit";constructor(e,r={}){super(We.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};We.ChangeEvent=class extends CustomEvent{static type="mw-floating-ask-ai:change";constructor(e,r={}){super(We.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};function fd(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",We);var Ve=class t extends w(v){static properties={text:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
1533
1533
  .popup-desktop:hover button {
1534
1534
  transition-delay: 0s !important;
1535
1535
  }
@@ -1557,7 +1557,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1557
1557
  ×
1558
1558
  </button>
1559
1559
  </div>
1560
- `;#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`
1560
+ `;#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};Ve.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(Ve.CloseEvent.type,{...e})}};Ve.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Ve.ClickEvent.type,{...e})}};customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",Ve);var He=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`
1561
1561
  <!-- wrapper -->
1562
1562
  <div
1563
1563
  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">
@@ -1582,7 +1582,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1582
1582
  <!-- can append any other content -->
1583
1583
  <slot name="footer"></slot>
1584
1584
  </div>
1585
- `}#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;#o=!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})}}#s(){let e=this.#t.getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&this.#r.now()-e.userDismissedAt<gd||this.show({sound:!r})}hide(){this.#o=!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.#o||(this.#n=setTimeout(()=>this.#s(),this.#t.getDelayMs()))}};var Jt=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=>{R.popupState=e},getPersistedState:()=>R.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`
1585
+ `}#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-mobile")||customElements.define("mw-popup-mobile",He);var ti=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 md=1440*60*1e3,ri=class{#e;#t;#r;#n;#i=!1;#o=!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})}}#s(){let e=this.#t.getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&this.#r.now()-e.userDismissedAt<md||this.show({sound:!r})}hide(){this.#o=!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.#o||(this.#n=setTimeout(()=>this.#s(),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 ri(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 ti(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`
1586
1586
  <!-- mobile shadow backdrop -->
1587
1587
  <div @click="${this.#r}" class="${e} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
1588
1588
 
@@ -1603,7 +1603,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1603
1603
  <div class="${e} ${this.positionClasses} fixed z-[2147483647] transition-[opacity,translate,visibility] max-sm:hidden">
1604
1604
  <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>
1605
1605
  </div>
1606
- `}#r(){this.#e.onCloseClick()}#n(){this.dispatchEvent(new t.ClickEvent),this.#e.onContentClick()}hide(){this.#e.hide()}};Jt.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Jt.ClickEvent.type,{...e})}};customElements.get("mw-popup")||customElements.define("mw-popup",Jt);var ss=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
+ `}#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 is=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`
1607
1607
  <span class="relative inline-flex">
1608
1608
  <slot></slot>
1609
1609
  <span class="${this.#e} pointer-events-none absolute z-10 flex h-3 w-3">
@@ -1611,7 +1611,7 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1611
1611
  <span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
1612
1612
  </span>
1613
1613
  </span>
1614
- `;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",ss);var os=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
+ `;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",is);var ns=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`
1615
1615
  <div class="${this.positionClasses} fixed right-6 bottom-24 z-10 flex animate-bounce flex-col items-center justify-center font-sans text-base">
1616
1616
  <p class="mb-2 -translate-x-4 -rotate-12 transform text-lg leading-normal font-bold text-gray-800">${this.text}</p>
1617
1617
 
@@ -1624,22 +1624,22 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1624
1624
  stroke-linecap="round"></path>
1625
1625
  </svg>
1626
1626
  </div>
1627
- `};customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",os);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 as=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=sl();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})}},bt=(t,e)=>new as(t,{onError:e?.onError||console.error,...e});var si=class{#e=[];#t;#r=!1;#n;#i;#o;#s;#a;constructor({send:e,sendBeacon:r,maxBufferSize:i=10,flushIntervalMs:n=5*1e3,sendTimeoutMs:s=10*1e3}){this.#n=e,this.#i=r,this.#o=i,this.#s=n,this.#a=s}async add(e){if(this.#e.push(e),this.#e.length>=this.#o)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.#s)))}};function ol(t){t?.body?.cancel().catch(console.warn)}var al=new URL("/widgets/data/collect",Xt).href,yd=new si({send:async(t,e)=>bd(t,{signal:e}),sendBeacon:t=>navigator.sendBeacon(al,ll(t))});function J(t,e,{flush:r=!1,now:i=new Date,buffer:n=yd,storage:s=R,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 ll(t){let e=new FormData;return e.set("events",JSON.stringify(t)),e}async function bd(t,{signal:e}={}){let r=await fetch(al,{method:"POST",body:ll(t),signal:e});if(ol(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 Yt(t,e){oi(r=>{r.push(t)},e)}function cl(t,e){t.items.length&&oi(r=>{r.push({ecommerce:null}),r.push({event:"view_item_list",ecommerce:t})},e)}function ul(t,e){oi(r=>{r.push({ecommerce:null}),r.push({event:"select_item",ecommerce:t})},e)}function dl(t,e){oi(r=>{r.push({ecommerce:null}),r.push({event:"view_item",ecommerce:t})},e)}function ls(t,e=globalThis){try{"clarity"in e&&typeof e.clarity=="function"&&t(e.clarity)}catch(r){console.error(r)}}var pl=!1;function Kt(t,e){pl||ls(r=>{r("set","molin_widget_id",t),pl=!0},e)}function Qt(t,e){ls(r=>{r("event",t)},e)}function hl(t,e){ls(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&&cl({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),Yt({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"};ul({item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",items:[e]}),dl({items:[e]})}Kt(t.widgetId),Qt("molin_link_click"),Xe("molin:link-click",{widgetId:t.widgetId,url:t.url})},onUserSentInput:t=>{J("ShopAssistant: user sent input",t),Yt({event:"molin_message_sent",widget_id:t.widgetId}),Kt(t.widgetId),Qt("molin_message_sent"),hl("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 fl(){return{onPageview:t=>{J("ShopAssistant: pageview",t)},onChatOpen:({widgetId:t,source:e})=>{J("ShopAssistant: user toggled window",{widgetId:t,source:e,state:"open"}),Yt({event:"molin_chat_open",widget_id:t}),Kt(t),Qt("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"}),Yt({event:"molin_chat_close",widget_id:t}),Kt(t),Qt("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 Je=class t extends w(v){static styles=O`
1627
+ `};customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",ns);function he(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}function Ge(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 ii=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 ss=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=ol();e&&e.widgetId===this.#e.widgetId?this.#n=e.config:this.#r=new ii(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 ss(t,{onError:e?.onError||console.error,...e});var ni=class{#e=[];#t;#r=!1;#n;#i;#o;#s;#a;constructor({send:e,sendBeacon:r,maxBufferSize:i=10,flushIntervalMs:n=5*1e3,sendTimeoutMs:s=10*1e3}){this.#n=e,this.#i=r,this.#o=i,this.#s=n,this.#a=s}async add(e){if(this.#e.push(e),this.#e.length>=this.#o)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.#s)))}};function al(t){t?.body?.cancel().catch(console.warn)}function cl(){return new URL("/widgets/data/collect",ei())}var ll;function gd(){return ll??=new ni({send:async(t,e)=>yd(t,{signal:e}),sendBeacon:t=>navigator.sendBeacon(cl(),ul(t))}),ll}function J(t,e,{flush:r=!1,now:i=new Date,buffer:n=gd(),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=bd(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 ul(t){let e=new FormData;return e.set("events",JSON.stringify(t)),e}async function yd(t,{signal:e}={}){let r=await fetch(cl(),{method:"POST",body:ul(t),signal:e});if(al(r),!r.ok)throw new Error(`HTTP error! status: ${r.status}`)}function bd(t,e,{storage:r,window:i,now:n}){return{event:t,widget_id:e.widgetId,properties:Object.assign({},e,wd({window:i,now:n})),distinct_id:vd({storage:r,window:i}),timestamp:n.toISOString()}}function vd({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 wd({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 si(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){si(r=>{r.push(t)},e)}function dl(t,e){t.items.length&&si(r=>{r.push({ecommerce:null}),r.push({event:"view_item_list",ecommerce:t})},e)}function pl(t,e){si(r=>{r.push({ecommerce:null}),r.push({event:"select_item",ecommerce:t})},e)}function hl(t,e){si(r=>{r.push({ecommerce:null}),r.push({event:"view_item",ecommerce:t})},e)}function os(t,e=globalThis){try{"clarity"in e&&typeof e.clarity=="function"&&t(e.clarity)}catch(r){console.error(r)}}var fl=!1;function Jt(t,e){fl||os(r=>{r("set","molin_widget_id",t),fl=!0},e)}function Yt(t,e){os(r=>{r("event",t)},e)}function ml(t,e){os(r=>{r("upgrade",t)},e)}function oi(){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&&dl({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"};pl({item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",items:[e]}),hl({items:[e]})}Jt(t.widgetId),Yt("molin_link_click"),Ge("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}),Jt(t.widgetId),Yt("molin_message_sent"),ml("molin_message_sent"),Ge("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 gl(){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}),Jt(t),Yt("molin_chat_open"),Ge("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}),Jt(t),Yt("molin_chat_close"),Ge("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`
1628
1628
  :host {
1629
1629
  all: initial; /* reset all properties that can pierce the shadow DOM */
1630
1630
  }
1631
- `;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1}};#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.xUserData=he()?.userData,this.xCustomInstructions=he()?.customInstructions,this.#e=bt(this)}render(){return this.config?u`
1631
+ `;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1}};#e;get config(){return this.#t||this.#e.data}#t;#r=oi();constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData=he()?.userData,this.xCustomInstructions=he()?.customInstructions,this.#e=yt(this)}render(){return this.config?u`
1632
1632
  <mw-context-widget .widgetId="${this.widgetId}" .config="${this.config}" .callbacks="${this.#r}" .xUserData="${this.xUserData}" .xCustomInstructions="${this.xCustomInstructions}">
1633
1633
  <!-- embed our chat component forwarding props -->
1634
1634
  <mw-chat ?show-close="${this.showClose}" @mw:close-click="${this.#n}">
1635
1635
  <slot name="banner" slot="banner"></slot>
1636
1636
  </mw-chat>
1637
1637
  </mw-context-widget>
1638
- `:null}#n(){this.dispatchEvent(new t.CloseClickEvent)}injectConfig(e){this.#t=e,this.requestUpdate()}reloadConfig(){this.#i?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",this.#i?.reset(),this.requestUpdate()}get#i(){return this.renderRoot.querySelector("mw-chat")}get conversationId(){return this.#i?.conversationId??""}get messages(){return this.#i?.messages??[]}};Je.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(Je.CloseClickEvent.type,{...e})}};customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",Je);var cs=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 we&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof we&&e.hideLauncher()}openChat(e){let{message:r,autoSend:i}=e||{};for(let n of document.querySelectorAll("molin-shop-ai"))n instanceof we&&n.openChat({message:r,autoSend:i})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof we&&e.closeChat()}reset(){R.resetAll();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof we&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof Je&&e.reset()}};function ml({hidden:t,version:e}){let r=new cs({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){_d(e);let r=he(),i=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(ml({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 _d(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function sl(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var us=class extends w(v){static styles=O`
1638
+ `:null}#n(){this.dispatchEvent(new t.CloseClickEvent)}injectConfig(e){this.#t=e,this.requestUpdate()}reloadConfig(){this.#i?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",this.#i?.reset(),this.requestUpdate()}get#i(){return this.renderRoot.querySelector("mw-chat")}get conversationId(){return this.#i?.conversationId??""}get messages(){return this.#i?.messages??[]}};Xe.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(Xe.CloseClickEvent.type,{...e})}};customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",Xe);var as=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 we&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof we&&e.hideLauncher()}openChat(e){let{message:r,autoSend:i}=e||{};for(let n of document.querySelectorAll("molin-shop-ai"))n instanceof we&&n.openChat({message:r,autoSend:i})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof we&&e.closeChat()}reset(){j().resetAll();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof we&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof Xe&&e.reset()}};function yl({hidden:t,version:e}){let r=new as({hidden:t,version:e});return window.Molin=r,r}function ai(){let t=window.Molin;if(!t)throw new Error("window.Molin global not initialized");return t}window.__INIT_MOLIN_SHOP_AI=function(e){kd(e);let r=he(),i=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(yl({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)}Ge("molin:ready",{widgetId:e.widgetId})};function kd(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function ol(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var ls=class extends w(v){static styles=O`
1639
1639
  :host {
1640
1640
  all: initial; /* reset all properties that can pierce the shadow DOM */
1641
1641
  }
1642
- `;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=bt(this);get config(){return this.#e.data}render(){return this.config?u`
1642
+ `;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`
1643
1643
  <!-- embed our bubble component forwarding props -->
1644
1644
  <!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
1645
1645
  <mw-bubble
@@ -1647,13 +1647,13 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1647
1647
  .color="${this.config?.bubble?.color||this.config?.color}"
1648
1648
  .bubbleStyle="${this.config?.bubble?.style}"
1649
1649
  .src="${this.config?.bubble?.bubbleUrl}"
1650
- width="${B(this.config?.bubble?.size?.width)}"
1651
- height="${B(this.config?.bubble?.size?.height)}"></mw-bubble>
1652
- `:null}};customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",us);var S1="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),$1="navigator"in globalThis&&"share"in navigator,Cd=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function Ed(t){if(typeof window>"u")return!1;let e=Cd[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function ds(){return Ed("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.#o();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}#o=()=>{this.#t.test(window.location.pathname)&&this.#r.navigated()}};var ps=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 gl(t,e){return new ps(t,e)}function yl({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 bl(t,e={}){return[ui(t),ui(e,"max-sm:")].join(" ")}function vl(t){return ui(t)}function wl(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 xl(t){let e=ui(t),i=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,i].filter(Boolean).join(" ")}var hs=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.#o))};#o=()=>{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 kl(t,e,r){return new hs(t,e,r)}var we=class extends w(v){static styles=O`
1650
+ width="${N(this.config?.bubble?.size?.width)}"
1651
+ height="${N(this.config?.bubble?.size?.height)}"></mw-bubble>
1652
+ `:null}};customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",ls);var $1="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),E1="navigator"in globalThis&&"share"in navigator,_d=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function Cd(t){if(typeof window>"u")return!1;let e=_d[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function cs(){return Cd("sm")}var li=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.#o();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}#o=()=>{this.#t.test(window.location.pathname)&&this.#r.navigated()}};var us=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 bl(t,e){return new us(t,e)}function vl({minMs:t,maxMs:e}){return Math.random()*(e-t)+t}function ci(t,e=""){return Object.entries(t).filter(([r,i])=>i).map(([r,i])=>`${e}${r}-[${i}]`).join(" ")}function wl(t,e={}){return[ci(t),ci(e,"max-sm:")].join(" ")}function xl(t){return ci(t)}function kl(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 _l(t){let e=ci(t),i=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,i].filter(Boolean).join(" ")}var ds=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.#o))};#o=()=>{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 Cl(t,e,r){return new ds(t,e,r)}var we=class extends w(v){static styles=O`
1653
1653
  :host {
1654
1654
  all: initial; /* reset all properties that can pierce the shadow DOM */
1655
1655
  }
1656
- `;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=bt(this);#t=kl(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=it.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;#o=gl(this,()=>{this._dialogShown=!0});#s=ai();#a=fl();#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=bl(this.config.bubble.position,this.config.bubble.mobilePosition),r=vl(this.config.bubble.position),i=wl(this.config.bubble.position),n=xl(this.config.bubble.position);return this.config.hidden||li().hidden||this.#u?null:u`
1656
+ `;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=Cl(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 li(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;#o=bl(this,()=>{this._dialogShown=!0});#s=oi();#a=gl();#l=Ee(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=wl(this.config.bubble.position,this.config.bubble.mobilePosition),r=xl(this.config.bubble.position),i=kl(this.config.bubble.position),n=_l(this.config.bubble.position);return this.config.hidden||ai().hidden||this.#u?null:u`
1657
1657
  <mw-bubble
1658
1658
  class="${e} ${this._dialogShown?"opacity-0":"opacity-100"} fixed z-[${this.#c}] transition-opacity"
1659
1659
  @click="${this.#w}"
@@ -1661,14 +1661,14 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1661
1661
  .color="${this.config?.bubble?.color||this.config?.color}"
1662
1662
  .bubbleStyle="${this.config?.bubble?.style}"
1663
1663
  .src="${this.config?.bubble?.bubbleUrl}"
1664
- width="${B(this.config?.bubble?.size?.width)}"
1665
- height="${B(this.config?.bubble?.size?.height)}"></mw-bubble>
1664
+ width="${N(this.config?.bubble?.size?.width)}"
1665
+ height="${N(this.config?.bubble?.size?.height)}"></mw-bubble>
1666
1666
 
1667
1667
  <!-- only load the component if enabled on any platform -->
1668
1668
  ${this.isPopupEnabled?u`
1669
1669
  <mw-popup
1670
1670
  position="${n}"
1671
- delay="${this.config.popup?.delayMs||yl({minMs:2e3,maxMs:5e3})}"
1671
+ delay="${this.config.popup?.delayMs||vl({minMs:2e3,maxMs:5e3})}"
1672
1672
  sound="${this.config.popup?.muteSounds?"":this.config.popup?.soundUrl||""}"
1673
1673
  ?dark-mode="${this.config?.darkMode}"
1674
1674
  .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}}}"
@@ -1707,12 +1707,12 @@ var Cl=Object.create;var fs=Object.defineProperty;var El=Object.getOwnPropertyDe
1707
1707
  <mw-floating-ask-ai
1708
1708
  ?dark="${this.config?.floatingAskAI?.darkMode}"
1709
1709
  .color="${this.config.color||this.config?.bubble?.color}"
1710
- placeholder="${B(this.config?.floatingAskAI?.placeholder)}"
1710
+ placeholder="${N(this.config?.floatingAskAI?.placeholder)}"
1711
1711
  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"
1712
1712
  style="bottom: ${this.config.bubble.position.bottom||"1.5rem"}"
1713
1713
  @mw-floating-ask-ai:submit="${this.#x}"></mw-floating-ask-ai>
1714
1714
  `:null}
1715
- `}#p({source:e}){this.#i?this._dialogShown=!0:(this.#i=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.#o.request()})),R.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,R.widgetState={isOpen:!1},this.#a.onChatClose({widgetId:this.widgetId,source:e})}get isPopupEnabled(){return ds()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){this._dialogShown&&this.#g?.hide(),this._dialogShown&&this.#l.setTimeout(()=>this.#m?.focusInput(),0)}firstUpdated(){ds()&&R.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.#s.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",we);export{we as MolinShopAI};
1715
+ `}#p({source:e}){this.#i?this._dialogShown=!0:(this.#i=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.#o.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 cs()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){this._dialogShown&&this.#g?.hide(),this._dialogShown&&this.#l.setTimeout(()=>this.#m?.focusInput(),0)}firstUpdated(){cs()&&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.#s.onUserSentInput({widgetId:this.widgetId,text:r,example:!1,conversationId:this.#m?.conversationId||""})};#y=vn({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(){ai().setHidden(!1),this.requestUpdate(),this.#a.onShowLauncher({widgetId:this.widgetId,source:"programmatic-method"})}hideLauncher(){ai().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",we);export{we as MolinShopAI};
1716
1716
  /*! Bundled license information:
1717
1717
 
1718
1718
  @lit/reactive-element/css-tag.js: