@molin.ai/shop-ai 0.9.64 → 0.9.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDescriptor;var al=Object.getOwnPropertyNames;var ll=Object.getPrototypeOf,cl=Object.prototype.hasOwnProperty;var ze=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ul=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of al(e))!cl.call(t,i)&&i!==r&&os(t,i,{get:()=>e[i],enumerable:!(n=ol(e,i))||n.enumerable});return t};var cn=(t,e,r)=>(r=t!=null?sl(ll(t)):{},ul(e||!t||!t.__esModule?os(r,"default",{value:t,enumerable:!0}):r,t));var Tn=ze(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.parseCookie=Os;ae.parse=Os;ae.stringifyCookie=Bl;ae.stringifySetCookie=dr;ae.serialize=dr;ae.parseSetCookie=Fl;ae.stringifySetCookie=dr;ae.serialize=dr;var Ts=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,js=/^[\u0021-\u003A\u003C-\u007E]*$/,jl=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Ol=/^[\u0020-\u003A\u003D-\u007E]*$/,Pl=/^-?\d+$/,Ul=Object.prototype.toString,Rl=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function Os(t,e){let r=new Rl,n=t.length;if(n<2)return r;let i=e?.decode||Ps,s=0;do{let o=Dn(t,s,n);if(o===-1)break;let a=Ln(t,s,n);if(o>a){s=t.lastIndexOf(";",o-1)+1;continue}let l=be(t,s,o);r[l]===void 0&&(r[l]=i(be(t,o+1,a))),s=a+1}while(s<n);return r}function Bl(t,e){let r=e?.encode||encodeURIComponent,n=[];for(let i of Object.keys(t)){let s=t[i];if(s===void 0)continue;if(!Ts.test(i))throw new TypeError(`cookie name is invalid: ${i}`);let o=r(s);if(!js.test(o))throw new TypeError(`cookie val is invalid: ${s}`);n.push(`${i}=${o}`)}return n.join("; ")}function dr(t,e,r){let n=typeof t=="object"?t:{...r,name:t,value:String(e)},s=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!Ts.test(n.name))throw new TypeError(`argument name is invalid: ${n.name}`);let o=n.value?s(n.value):"";if(!js.test(o))throw new TypeError(`argument val is invalid: ${n.value}`);let a=n.name+"="+o;if(n.maxAge!==void 0){if(!Number.isInteger(n.maxAge))throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);a+="; Max-Age="+n.maxAge}if(n.domain){if(!jl.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);a+="; Domain="+n.domain}if(n.path){if(!Ol.test(n.path))throw new TypeError(`option path is invalid: ${n.path}`);a+="; Path="+n.path}if(n.expires){if(!ql(n.expires)||!Number.isFinite(n.expires.valueOf()))throw new TypeError(`option expires is invalid: ${n.expires}`);a+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(a+="; HttpOnly"),n.secure&&(a+="; Secure"),n.partitioned&&(a+="; Partitioned"),n.priority)switch(typeof n.priority=="string"?n.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: ${n.priority}`)}if(n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.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: ${n.sameSite}`)}return a}function Fl(t,e){let r=e?.decode||Ps,n=t.length,i=Ln(t,0,n),s=Dn(t,0,i),o=s===-1?{name:"",value:r(be(t,0,i))}:{name:be(t,0,s),value:r(be(t,s+1,i))},a=i+1;for(;a<n;){let l=Ln(t,a,n),c=Dn(t,a,l),d=c===-1?be(t,a,l):be(t,a,c),h=c===-1?void 0:be(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=h;break;case"path":o.path=h;break;case"max-age":h&&Pl.test(h)&&(o.maxAge=Number(h));break;case"expires":if(!h)break;let f=new Date(h);Number.isFinite(f.valueOf())&&(o.expires=f);break;case"priority":if(!h)break;let w=h.toLowerCase();(w==="low"||w==="medium"||w==="high")&&(o.priority=w);break;case"samesite":if(!h)break;let p=h.toLowerCase();(p==="lax"||p==="strict"||p==="none")&&(o.sameSite=p);break}a=l+1}return o}function Ln(t,e,r){let n=t.indexOf(";",e);return n===-1?r:n}function Dn(t,e,r){let n=t.indexOf("=",e);return n<r?n:-1}function be(t,e,r){let n=e,i=r;do{let s=t.charCodeAt(n);if(s!==32&&s!==9)break}while(++n<i);for(;i>n;){let s=t.charCodeAt(i-1);if(s!==32&&s!==9)break;i--}return t.slice(n,i)}function Ps(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function ql(t){return Ul.call(t)==="[object Date]"}});var zo=ze(Re=>{"use strict";var Fc=Re&&Re.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(n.next(d))}catch(h){o(h)}}function l(d){try{c(n.throw(d))}catch(h){o(h)}}function c(d){d.done?s(d.value):i(d.value).then(a,l)}c((n=n.apply(t,e||[])).next())})},qc=Re&&Re.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=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(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Re,"__esModule",{value:!0});Re.base64ToBlob=Vc;function Vc(t){return Fc(this,void 0,void 0,function(){var e,r,n;return qc(this,function(i){switch(i.label){case 0:return[4,fetch(t)];case 1:return e=i.sent(),[4,e.blob()];case 2:return r=i.sent(),n=Hc(t),n&&(r=r.slice(0,r.size,n)),[2,r]}})})}var Nc=/^data:(.+);base64,/;function Hc(t){var e;return(e=t.match(Nc))===null||e===void 0?void 0:e.slice(1,2).pop()}});var Wo=ze(Be=>{"use strict";var zc=Be&&Be.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(n.next(d))}catch(h){o(h)}}function l(d){try{c(n.throw(d))}catch(h){o(h)}}function c(d){d.done?s(d.value):i(d.value).then(a,l)}c((n=n.apply(t,e||[])).next())})},Wc=Be&&Be.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=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(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Be,"__esModule",{value:!0});Be.base64ToFile=Gc;function Gc(t,e,r){return zc(this,void 0,void 0,function(){var n,i;return Wc(this,function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:return n=s.sent(),[4,n.blob()];case 2:return i=s.sent(),[2,new File([i],e,r)]}})})}});var fi=ze(Fe=>{"use strict";var hi=Fe&&Fe.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(n.next(d))}catch(h){o(h)}}function l(d){try{c(n.throw(d))}catch(h){o(h)}}function c(d){d.done?s(d.value):i(d.value).then(a,l)}c((n=n.apply(t,e||[])).next())})},pi=Fe&&Fe.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=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(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.blobToBase64=Zc;function Zc(t){return hi(this,void 0,void 0,function(){return pi(this,function(e){return[2,typeof FileReader=="function"?Xc(t):Yc(t)]})})}var it;(function(t){t.error="error",t.loadend="loadend"})(it||(it={}));function Xc(t){return hi(this,void 0,void 0,function(){return pi(this,function(e){return[2,new Promise(function(r,n){try{var i=new FileReader,s=function(){r(i.result),i.removeEventListener(it.loadend,s)};i.addEventListener(it.loadend,s);var o=function(){n(i.error),i.removeEventListener(it.error,o)};i.addEventListener(it.error,o),i.readAsDataURL(t)}catch(a){n(a)}})]})})}var Jc="application/octet-stream";function Yc(t){return hi(this,void 0,void 0,function(){var e,r,n,i;return pi(this,function(s){switch(s.label){case 0:return n=(r=Buffer).from,[4,t.text()];case 1:return e=n.apply(r,[s.sent()]),i=t.type||Jc,[2,"data:".concat(i,";base64,").concat(e.toString("base64"))]}})})}});var Go=ze(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.fileToBase64=void 0;var Kc=fi();Object.defineProperty(Tr,"fileToBase64",{enumerable:!0,get:function(){return Kc.blobToBase64}})});var Zo=ze(ce=>{"use strict";var Qc=ce&&ce.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jr=ce&&ce.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Qc(e,t,r)};Object.defineProperty(ce,"__esModule",{value:!0});jr(zo(),ce);jr(Wo(),ce);jr(fi(),ce);jr(Go(),ce)});var Zt=globalThis,Xt=Zt.ShadowRoot&&(Zt.ShadyCSS===void 0||Zt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,un=Symbol(),as=new WeakMap,yt=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==un)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(Xt&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=as.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&as.set(r,e))}return e}toString(){return this.cssText}},ls=t=>new yt(typeof t=="string"?t:t+"",void 0,un),j=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((n,i,s)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1],t[0]);return new yt(r,t,un)},cs=(t,e)=>{if(Xt)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let n=document.createElement("style"),i=Zt.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}},dn=Xt?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return ls(r)})(t):t;var{is:dl,defineProperty:hl,getOwnPropertyDescriptor:pl,getOwnPropertyNames:fl,getOwnPropertySymbols:ml,getPrototypeOf:gl}=Object,Jt=globalThis,us=Jt.trustedTypes,wl=us?us.emptyScript:"",yl=Jt.reactiveElementPolyfillSupport,vt=(t,e)=>t,hn={toAttribute(t,e){switch(e){case Boolean:t=t?wl: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}},hs=(t,e)=>!dl(t,e),ds={attribute:!0,type:String,converter:hn,reflect:!1,useDefault:!1,hasChanged:hs};Symbol.metadata??=Symbol("metadata"),Jt.litPropertyMetadata??=new WeakMap;var pe=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=ds){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(e,n,r);i!==void 0&&hl(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){let{get:i,set:s}=pl(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get:i,set(o){let a=i?.call(this);s?.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ds}static _$Ei(){if(this.hasOwnProperty(vt("elementProperties")))return;let e=gl(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(vt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(vt("properties"))){let r=this.properties,n=[...fl(r),...ml(r)];for(let i of n)this.createProperty(i,r[i])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(let[r,n]of this.elementProperties){let i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(dn(i))}else e!==void 0&&r.push(dn(e));return r}static _$Eu(e,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,r=this.constructor.elementProperties;for(let n of r.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return cs(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$ET(e,r){let n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){let s=(n.converter?.toAttribute!==void 0?n.converter:hn).toAttribute(r,n.type);this._$Em=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,r){let n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let s=n.getPropertyOptions(i),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:hn;this._$Em=i;let a=o.fromAttribute(r,s.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,r,n,i=!1,s){if(e!==void 0){let o=this.constructor;if(i===!1&&(s=this[e]),n??=o.getPropertyOptions(e),!((n.hasChanged??hs)(s,r)||n.useDefault&&n.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,n))))return;this.C(e,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:n,reflect:i,wrapped:s},o){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??r??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(r=void 0),this._$AL.set(e,r)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[i,s]of n){let{wrapped:o}=s,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,s,a)}}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(r)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$EO?.forEach(r=>r.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(r=>this._$ET(r,this[r])),this._$EM()}updated(e){}firstUpdated(e){}};pe.elementStyles=[],pe.shadowRootOptions={mode:"open"},pe[vt("elementProperties")]=new Map,pe[vt("finalized")]=new Map,yl?.({ReactiveElement:pe}),(Jt.reactiveElementVersions??=[]).push("2.1.2");var fn=globalThis,ps=t=>t,Yt=fn.trustedTypes,fs=Yt?Yt.createPolicy("lit-html",{createHTML:t=>t}):void 0,mn="$lit$",fe=`lit$${Math.random().toFixed(9).slice(2)}$`,gn="?"+fe,vl=`<${gn}>`,Le=document,xt=()=>Le.createComment(""),kt=t=>t===null||typeof t!="object"&&typeof t!="function",wn=Array.isArray,bs=t=>wn(t)||typeof t?.[Symbol.iterator]=="function",pn=`[
2
- \f\r]`,bt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ms=/-->/g,gs=/>/g,Ae=RegExp(`>|${pn}(?:([^\\s"'>=/]+)(${pn}*=${pn}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),ws=/'/g,ys=/"/g,xs=/^(?:script|style|textarea|title)$/i,yn=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),u=yn(1),cd=yn(2),ud=yn(3),ie=Symbol.for("lit-noChange"),P=Symbol.for("lit-nothing"),vs=new WeakMap,Ie=Le.createTreeWalker(Le,129);function ks(t,e){if(!wn(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return fs!==void 0?fs.createHTML(e):e}var Cs=(t,e)=>{let r=t.length-1,n=[],i,s=e===2?"<svg>":e===3?"<math>":"",o=bt;for(let a=0;a<r;a++){let l=t[a],c,d,h=-1,f=0;for(;f<l.length&&(o.lastIndex=f,d=o.exec(l),d!==null);)f=o.lastIndex,o===bt?d[1]==="!--"?o=ms:d[1]!==void 0?o=gs:d[2]!==void 0?(xs.test(d[2])&&(i=RegExp("</"+d[2],"g")),o=Ae):d[3]!==void 0&&(o=Ae):o===Ae?d[0]===">"?(o=i??bt,h=-1):d[1]===void 0?h=-2:(h=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Ae:d[3]==='"'?ys:ws):o===ys||o===ws?o=Ae:o===ms||o===gs?o=bt:(o=Ae,i=void 0);let w=o===Ae&&t[a+1].startsWith("/>")?" ":"";s+=o===bt?l+vl:h>=0?(n.push(c),l.slice(0,h)+mn+l.slice(h)+fe+w):l+fe+(h===-2?a:w)}return[ks(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},Ct=class t{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let s=0,o=0,a=e.length-1,l=this.parts,[c,d]=Cs(e,r);if(this.el=t.createElement(c,n),Ie.currentNode=this.el.content,r===2||r===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=Ie.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith(mn)){let f=d[o++],w=i.getAttribute(h).split(fe),p=/([.?@])?(.*)/.exec(f);l.push({type:1,index:s,name:p[2],strings:w,ctor:p[1]==="."?Qt:p[1]==="?"?er:p[1]==="@"?tr:Te}),i.removeAttribute(h)}else h.startsWith(fe)&&(l.push({type:6,index:s}),i.removeAttribute(h));if(xs.test(i.tagName)){let h=i.textContent.split(fe),f=h.length-1;if(f>0){i.textContent=Yt?Yt.emptyScript:"";for(let w=0;w<f;w++)i.append(h[w],xt()),Ie.nextNode(),l.push({type:2,index:++s});i.append(h[f],xt())}}}else if(i.nodeType===8)if(i.data===gn)l.push({type:2,index:s});else{let h=-1;for(;(h=i.data.indexOf(fe,h+1))!==-1;)l.push({type:7,index:s}),h+=fe.length-1}s++}}static createElement(e,r){let n=Le.createElement("template");return n.innerHTML=e,n}};function De(t,e,r=t,n){if(e===ie)return e;let i=n!==void 0?r._$Co?.[n]:r._$Cl,s=kt(e)?void 0:e._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(t),i._$AT(t,r,n)),n!==void 0?(r._$Co??=[])[n]=i:r._$Cl=i),i!==void 0&&(e=De(t,i._$AS(t,e.values),i,n)),e}var Kt=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:r},parts:n}=this._$AD,i=(e?.creationScope??Le).importNode(r,!0);Ie.currentNode=i;let s=Ie.nextNode(),o=0,a=0,l=n[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new We(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new rr(s,this,e)),this._$AV.push(c),l=n[++a]}o!==l?.index&&(s=Ie.nextNode(),o++)}return Ie.currentNode=Le,i}p(e){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},We=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,n,i){this.type=2,this._$AH=P,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=De(this,e,r),kt(e)?e===P||e==null||e===""?(this._$AH!==P&&this._$AR(),this._$AH=P):e!==this._$AH&&e!==ie&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):bs(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!==P&&kt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Le.createTextNode(e)),this._$AH=e}$(e){let{values:r,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Ct.createElement(ks(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(r);else{let s=new Kt(i,this),o=s.u(this.options);s.p(r),this.T(o),this._$AH=s}}_$AC(e){let r=vs.get(e.strings);return r===void 0&&vs.set(e.strings,r=new Ct(e)),r}k(e){wn(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let s of e)i===r.length?r.push(n=new t(this.O(xt()),this.O(xt()),this,this.options)):n=r[i],n._$AI(s),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e!==this._$AB;){let n=ps(e).nextSibling;ps(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Te=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,n,i,s){this.type=1,this._$AH=P,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=P}_$AI(e,r=this,n,i){let s=this.strings,o=!1;if(s===void 0)e=De(this,e,r,0),o=!kt(e)||e!==this._$AH&&e!==ie,o&&(this._$AH=e);else{let a=e,l,c;for(e=s[0],l=0;l<s.length-1;l++)c=De(this,a[n+l],r,l),c===ie&&(c=this._$AH[l]),o||=!kt(c)||c!==this._$AH[l],c===P?e=P:e!==P&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!i&&this.j(e)}j(e){e===P?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Qt=class extends Te{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===P?void 0:e}},er=class extends Te{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==P)}},tr=class extends Te{constructor(e,r,n,i,s){super(e,r,n,i,s),this.type=5}_$AI(e,r=this){if((e=De(this,e,r,0)??P)===ie)return;let n=this._$AH,i=e===P&&n!==P||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==P&&(n===P||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},rr=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){De(this,e)}},_s={M:mn,P:fe,A:gn,C:1,L:Cs,R:Kt,D:bs,V:De,I:We,H:Te,N:er,U:tr,B:Qt,F:rr},bl=fn.litHtmlPolyfillSupport;bl?.(Ct,We),(fn.litHtmlVersions??=[]).push("3.3.2");var $s=(t,e,r)=>{let n=r?.renderBefore??e,i=n._$litPart$;if(i===void 0){let s=r?.renderBefore??null;n._$litPart$=i=new We(e.insertBefore(xt(),s),s,void 0,r??{})}return i._$AI(t),i};var vn=globalThis,v=class extends pe{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=$s(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ie}};v._$litElement$=!0,v.finalized=!0,vn.litElementHydrateSupport?.({LitElement:v});var xl=vn.litElementPolyfillSupport;xl?.({LitElement:v});(vn.litElementVersions??=[]).push("4.2.2");var nr=class t extends HTMLElement{static observedAttributes=["name"];constructor(){super(),this.attachShadow({mode:"open"})}attributeChangedCallback(e,r,n){r!==n&&t.observedAttributes.includes(e)&&(e==="name"&&(this.name=n||""),this.render())}resolveIcon(e){throw new Error("Not implemented")}render(){let e=document.createElement("style");for(e.textContent=`
1
+ var dl=Object.create;var us=Object.defineProperty;var hl=Object.getOwnPropertyDescriptor;var pl=Object.getOwnPropertyNames;var fl=Object.getPrototypeOf,ml=Object.prototype.hasOwnProperty;var ze=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var gl=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of pl(e))!ml.call(t,n)&&n!==r&&us(t,n,{get:()=>e[n],enumerable:!(i=hl(e,n))||i.enumerable});return t};var ui=(t,e,r)=>(r=t!=null?dl(fl(t)):{},gl(e||!t||!t.__esModule?us(r,"default",{value:t,enumerable:!0}):r,t));var ji=ze(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.parseCookie=Bs;ae.parse=Bs;ae.stringifyCookie=zl;ae.stringifySetCookie=pr;ae.serialize=pr;ae.parseSetCookie=Wl;ae.stringifySetCookie=pr;ae.serialize=pr;var Us=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,Rs=/^[\u0021-\u003A\u003C-\u007E]*$/,Fl=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,ql=/^[\u0020-\u003A\u003D-\u007E]*$/,Vl=/^-?\d+$/,Nl=Object.prototype.toString,Hl=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function Bs(t,e){let r=new Hl,i=t.length;if(i<2)return r;let n=e?.decode||Fs,s=0;do{let o=Ti(t,s,i);if(o===-1)break;let a=Di(t,s,i);if(o>a){s=t.lastIndexOf(";",o-1)+1;continue}let l=be(t,s,o);r[l]===void 0&&(r[l]=n(be(t,o+1,a))),s=a+1}while(s<i);return r}function zl(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(!Us.test(n))throw new TypeError(`cookie name is invalid: ${n}`);let o=r(s);if(!Rs.test(o))throw new TypeError(`cookie val is invalid: ${s}`);i.push(`${n}=${o}`)}return i.join("; ")}function pr(t,e,r){let i=typeof t=="object"?t:{...r,name:t,value:String(e)},s=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!Us.test(i.name))throw new TypeError(`argument name is invalid: ${i.name}`);let o=i.value?s(i.value):"";if(!Rs.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(!Fl.test(i.domain))throw new TypeError(`option domain is invalid: ${i.domain}`);a+="; Domain="+i.domain}if(i.path){if(!ql.test(i.path))throw new TypeError(`option path is invalid: ${i.path}`);a+="; Path="+i.path}if(i.expires){if(!Gl(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 Wl(t,e){let r=e?.decode||Fs,i=t.length,n=Di(t,0,i),s=Ti(t,0,n),o=s===-1?{name:"",value:r(be(t,0,n))}:{name:be(t,0,s),value:r(be(t,s+1,n))},a=n+1;for(;a<i;){let l=Di(t,a,i),c=Ti(t,a,l),d=c===-1?be(t,a,l):be(t,a,c),h=c===-1?void 0:be(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=h;break;case"path":o.path=h;break;case"max-age":h&&Vl.test(h)&&(o.maxAge=Number(h));break;case"expires":if(!h)break;let f=new Date(h);Number.isFinite(f.valueOf())&&(o.expires=f);break;case"priority":if(!h)break;let w=h.toLowerCase();(w==="low"||w==="medium"||w==="high")&&(o.priority=w);break;case"samesite":if(!h)break;let p=h.toLowerCase();(p==="lax"||p==="strict"||p==="none")&&(o.sameSite=p);break}a=l+1}return o}function Di(t,e,r){let i=t.indexOf(";",e);return i===-1?r:i}function Ti(t,e,r){let i=t.indexOf("=",e);return i<r?i:-1}function be(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 Fs(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function Gl(t){return Nl.call(t)==="[object Date]"}});var Xo=ze(Re=>{"use strict";var Wc=Re&&Re.__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(h){o(h)}}function l(d){try{c(i.throw(d))}catch(h){o(h)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},Gc=Re&&Re.__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(Re,"__esModule",{value:!0});Re.base64ToBlob=Zc;function Zc(t){return Wc(this,void 0,void 0,function(){var e,r,i;return Gc(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=Jc(t),i&&(r=r.slice(0,r.size,i)),[2,r]}})})}var Xc=/^data:(.+);base64,/;function Jc(t){var e;return(e=t.match(Xc))===null||e===void 0?void 0:e.slice(1,2).pop()}});var Jo=ze(Be=>{"use strict";var Yc=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(h){o(h)}}function l(d){try{c(i.throw(d))}catch(h){o(h)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},Kc=Be&&Be.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Be,"__esModule",{value:!0});Be.base64ToFile=Qc;function Qc(t,e,r){return Yc(this,void 0,void 0,function(){var i,n;return Kc(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 gn=ze(Fe=>{"use strict";var fn=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(h){o(h)}}function l(d){try{c(i.throw(d))}catch(h){o(h)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},mn=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.blobToBase64=eu;function eu(t){return fn(this,void 0,void 0,function(){return mn(this,function(e){return[2,typeof FileReader=="function"?tu(t):iu(t)]})})}var nt;(function(t){t.error="error",t.loadend="loadend"})(nt||(nt={}));function tu(t){return fn(this,void 0,void 0,function(){return mn(this,function(e){return[2,new Promise(function(r,i){try{var n=new FileReader,s=function(){r(n.result),n.removeEventListener(nt.loadend,s)};n.addEventListener(nt.loadend,s);var o=function(){i(n.error),n.removeEventListener(nt.error,o)};n.addEventListener(nt.error,o),n.readAsDataURL(t)}catch(a){i(a)}})]})})}var ru="application/octet-stream";function iu(t){return fn(this,void 0,void 0,function(){var e,r,i,n;return mn(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||ru,[2,"data:".concat(n,";base64,").concat(e.toString("base64"))]}})})}});var Yo=ze(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.fileToBase64=void 0;var nu=gn();Object.defineProperty(Or,"fileToBase64",{enumerable:!0,get:function(){return nu.blobToBase64}})});var Ko=ze(ce=>{"use strict";var su=ce&&ce.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),Pr=ce&&ce.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&su(e,t,r)};Object.defineProperty(ce,"__esModule",{value:!0});Pr(Xo(),ce);Pr(Jo(),ce);Pr(gn(),ce);Pr(Yo(),ce)});var Jt=globalThis,Yt=Jt.ShadowRoot&&(Jt.ShadyCSS===void 0||Jt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,di=Symbol(),ds=new WeakMap,yt=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==di)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(Yt&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=ds.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&ds.set(r,e))}return e}toString(){return this.cssText}},hs=t=>new yt(typeof t=="string"?t:t+"",void 0,di),j=(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 yt(r,t,di)},ps=(t,e)=>{if(Yt)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=Jt.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},hi=Yt?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return hs(r)})(t):t;var{is:wl,defineProperty:yl,getOwnPropertyDescriptor:vl,getOwnPropertyNames:bl,getOwnPropertySymbols:xl,getPrototypeOf:kl}=Object,Kt=globalThis,fs=Kt.trustedTypes,Cl=fs?fs.emptyScript:"",_l=Kt.reactiveElementPolyfillSupport,vt=(t,e)=>t,pi={toAttribute(t,e){switch(e){case Boolean:t=t?Cl: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}},gs=(t,e)=>!wl(t,e),ms={attribute:!0,type:String,converter:pi,reflect:!1,useDefault:!1,hasChanged:gs};Symbol.metadata??=Symbol("metadata"),Kt.litPropertyMetadata??=new WeakMap;var pe=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=ms){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&&yl(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){let{get:n,set:s}=vl(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)??ms}static _$Ei(){if(this.hasOwnProperty(vt("elementProperties")))return;let e=kl(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(vt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(vt("properties"))){let r=this.properties,i=[...bl(r),...xl(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 ps(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:pi).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:pi;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??gs)(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){}};pe.elementStyles=[],pe.shadowRootOptions={mode:"open"},pe[vt("elementProperties")]=new Map,pe[vt("finalized")]=new Map,_l?.({ReactiveElement:pe}),(Kt.reactiveElementVersions??=[]).push("2.1.2");var mi=globalThis,ws=t=>t,Qt=mi.trustedTypes,ys=Qt?Qt.createPolicy("lit-html",{createHTML:t=>t}):void 0,gi="$lit$",fe=`lit$${Math.random().toFixed(9).slice(2)}$`,wi="?"+fe,$l=`<${wi}>`,Le=document,xt=()=>Le.createComment(""),kt=t=>t===null||typeof t!="object"&&typeof t!="function",yi=Array.isArray,_s=t=>yi(t)||typeof t?.[Symbol.iterator]=="function",fi=`[
2
+ \f\r]`,bt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,vs=/-->/g,bs=/>/g,Ae=RegExp(`>|${fi}(?:([^\\s"'>=/]+)(${fi}*=${fi}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),xs=/'/g,ks=/"/g,$s=/^(?:script|style|textarea|title)$/i,vi=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),u=vi(1),md=vi(2),gd=vi(3),ne=Symbol.for("lit-noChange"),P=Symbol.for("lit-nothing"),Cs=new WeakMap,Ie=Le.createTreeWalker(Le,129);function Ss(t,e){if(!yi(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ys!==void 0?ys.createHTML(e):e}var Es=(t,e)=>{let r=t.length-1,i=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=bt;for(let a=0;a<r;a++){let l=t[a],c,d,h=-1,f=0;for(;f<l.length&&(o.lastIndex=f,d=o.exec(l),d!==null);)f=o.lastIndex,o===bt?d[1]==="!--"?o=vs:d[1]!==void 0?o=bs:d[2]!==void 0?($s.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Ae):d[3]!==void 0&&(o=Ae):o===Ae?d[0]===">"?(o=n??bt,h=-1):d[1]===void 0?h=-2:(h=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Ae:d[3]==='"'?ks:xs):o===ks||o===xs?o=Ae:o===vs||o===bs?o=bt:(o=Ae,n=void 0);let w=o===Ae&&t[a+1].startsWith("/>")?" ":"";s+=o===bt?l+$l:h>=0?(i.push(c),l.slice(0,h)+gi+l.slice(h)+fe+w):l+fe+(h===-2?a:w)}return[Ss(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},Ct=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]=Es(e,r);if(this.el=t.createElement(c,i),Ie.currentNode=this.el.content,r===2||r===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=Ie.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let h of n.getAttributeNames())if(h.endsWith(gi)){let f=d[o++],w=n.getAttribute(h).split(fe),p=/([.?@])?(.*)/.exec(f);l.push({type:1,index:s,name:p[2],strings:w,ctor:p[1]==="."?tr:p[1]==="?"?rr:p[1]==="@"?ir:Te}),n.removeAttribute(h)}else h.startsWith(fe)&&(l.push({type:6,index:s}),n.removeAttribute(h));if($s.test(n.tagName)){let h=n.textContent.split(fe),f=h.length-1;if(f>0){n.textContent=Qt?Qt.emptyScript:"";for(let w=0;w<f;w++)n.append(h[w],xt()),Ie.nextNode(),l.push({type:2,index:++s});n.append(h[f],xt())}}}else if(n.nodeType===8)if(n.data===wi)l.push({type:2,index:s});else{let h=-1;for(;(h=n.data.indexOf(fe,h+1))!==-1;)l.push({type:7,index:s}),h+=fe.length-1}s++}}static createElement(e,r){let i=Le.createElement("template");return i.innerHTML=e,i}};function De(t,e,r=t,i){if(e===ne)return e;let n=i!==void 0?r._$Co?.[i]:r._$Cl,s=kt(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=De(t,n._$AS(t,e.values),n,i)),e}var er=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??Le).importNode(r,!0);Ie.currentNode=n;let s=Ie.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new We(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new nr(s,this,e)),this._$AV.push(c),l=i[++a]}o!==l?.index&&(s=Ie.nextNode(),o++)}return Ie.currentNode=Le,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++}},We=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,i,n){this.type=2,this._$AH=P,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=De(this,e,r),kt(e)?e===P||e==null||e===""?(this._$AH!==P&&this._$AR(),this._$AH=P):e!==this._$AH&&e!==ne&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):_s(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!==P&&kt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Le.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=Ct.createElement(Ss(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(r);else{let s=new er(n,this),o=s.u(this.options);s.p(r),this.T(o),this._$AH=s}}_$AC(e){let r=Cs.get(e.strings);return r===void 0&&Cs.set(e.strings,r=new Ct(e)),r}k(e){yi(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(xt()),this.O(xt()),this,this.options)):i=r[n],i._$AI(s),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e!==this._$AB;){let i=ws(e).nextSibling;ws(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Te=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,i,n,s){this.type=1,this._$AH=P,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=P}_$AI(e,r=this,i,n){let s=this.strings,o=!1;if(s===void 0)e=De(this,e,r,0),o=!kt(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=De(this,a[i+l],r,l),c===ne&&(c=this._$AH[l]),o||=!kt(c)||c!==this._$AH[l],c===P?e=P:e!==P&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!n&&this.j(e)}j(e){e===P?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},tr=class extends Te{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===P?void 0:e}},rr=class extends Te{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==P)}},ir=class extends Te{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){if((e=De(this,e,r,0)??P)===ne)return;let i=this._$AH,n=e===P&&i!==P||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==P&&(i===P||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)}},nr=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){De(this,e)}},Ms={M:gi,P:fe,A:wi,C:1,L:Es,R:er,D:_s,V:De,I:We,H:Te,N:rr,U:ir,B:tr,F:nr},Sl=mi.litHtmlPolyfillSupport;Sl?.(Ct,We),(mi.litHtmlVersions??=[]).push("3.3.2");var As=(t,e,r)=>{let i=r?.renderBefore??e,n=i._$litPart$;if(n===void 0){let s=r?.renderBefore??null;i._$litPart$=n=new We(e.insertBefore(xt(),s),s,void 0,r??{})}return n._$AI(t),n};var bi=globalThis,v=class extends pe{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=As(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,bi.litElementHydrateSupport?.({LitElement:v});var El=bi.litElementPolyfillSupport;El?.({LitElement:v});(bi.litElementVersions??=[]).push("4.2.2");var sr=class t extends HTMLElement{static observedAttributes=["name"];constructor(){super(),this.attachShadow({mode:"open"})}attributeChangedCallback(e,r,i){r!==i&&t.observedAttributes.includes(e)&&(e==="name"&&(this.name=i||""),this.render())}resolveIcon(e){throw new Error("Not implemented")}render(){let e=document.createElement("style");for(e.textContent=`
4
4
  :host {
5
5
  display: inline-block;
6
6
  line-height: 0;
7
7
  }
8
- `;this.shadowRoot?.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild),this.shadowRoot.appendChild(e);if(!this.name)return;let r=this.resolveIcon(this.name);if(!r){console.warn(`'${this.name}' not found, please add it to ${t.name}`);return}let s=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;s.setAttribute("fill","currentColor"),s.removeAttribute("width"),s.removeAttribute("height"),s.style.width="100%",s.style.height="100%",this.shadowRoot?.appendChild(s)}name=""};var Ss={"arrow-left":`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
8
+ `;this.shadowRoot?.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild),this.shadowRoot.appendChild(e);if(!this.name)return;let r=this.resolveIcon(this.name);if(!r){console.warn(`'${this.name}' not found, please add it to ${t.name}`);return}let s=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;s.setAttribute("fill","currentColor"),s.removeAttribute("width"),s.removeAttribute("height"),s.style.width="100%",s.style.height="100%",this.shadowRoot?.appendChild(s)}name=""};var Is={"arrow-left":`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
9
9
  <path d="M10.5 19.5L3 12M3 12L10.5 4.5M3 12H21" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
10
10
  </svg>`,"check-circle":`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
11
11
  <path d="M9 12.75L11.25 15L15 9.75M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -141,7 +141,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
141
141
  <path d="M11.4806 3.4987C11.6728 3.03673 12.3272 3.03673 12.5193 3.4987L14.6453 8.61016C14.7263 8.80492 14.9095 8.93799 15.1197 8.95485L20.638 9.39724C21.1367 9.43722 21.339 10.0596 20.959 10.3851L16.7546 13.9866C16.5945 14.1238 16.5245 14.3391 16.5734 14.5443L17.8579 19.9292C17.974 20.4159 17.4446 20.8005 17.0176 20.5397L12.2932 17.6541C12.1132 17.5441 11.8868 17.5441 11.7068 17.6541L6.98238 20.5397C6.55539 20.8005 6.02594 20.4159 6.14203 19.9292L7.42652 14.5443C7.47546 14.3391 7.4055 14.1238 7.24531 13.9866L3.04099 10.3851C2.661 10.0596 2.86323 9.43722 3.36197 9.39724L8.88022 8.95485C9.09048 8.93799 9.27363 8.80492 9.35464 8.61016L11.4806 3.4987Z" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
142
142
  </svg>`,"user-circle":`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
143
143
  <path d="M17.9815 18.7248C16.6121 16.9175 14.4424 15.75 12 15.75C9.55761 15.75 7.38789 16.9175 6.01846 18.7248M17.9815 18.7248C19.8335 17.0763 21 14.6744 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 14.6744 4.1665 17.0763 6.01846 18.7248M17.9815 18.7248C16.3915 20.1401 14.2962 21 12 21C9.70383 21 7.60851 20.1401 6.01846 18.7248M15 9.75C15 11.4069 13.6569 12.75 12 12.75C10.3431 12.75 9 11.4069 9 9.75C9 8.09315 10.3431 6.75 12 6.75C13.6569 6.75 15 8.09315 15 9.75Z" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
144
- </svg>`};var kl=Ss,bn=class extends nr{resolveIcon(e){let r=kl[e];if(!r)throw console.warn("hi-outline: icon not found",e),new Error(`Icon ${e} not found`);return r}render(){super.render();let e=this.shadowRoot?.querySelector("svg");if(!e)throw new Error("svgEl not found "+this.name);e.setAttribute("fill","none"),e.querySelectorAll("[stroke]").forEach(r=>{r.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",bn);var ir=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 xn(t){await new Promise(e=>setTimeout(e,t))}async function Es(t,e){let r=t?.times??3,n=t?.delay,i=t?.backoff??null,s=o=>{throw{_bailed:o}};for(let o=0;o<r;o++)try{return await e(s,o)}catch(a){if(a&&typeof a=="object"&&"_bailed"in a)throw a._bailed;if(o===r-1)throw a;n&&await xn(n),i&&await xn(i(o+1))}throw new Error("unreachable")}var Cl=!0,kn="Invariant failed";function L(t,e){if(!t){if(Cl)throw new Error(kn);var r=typeof e=="function"?e():e,n=r?"".concat(kn,": ").concat(r):kn;throw new Error(n)}}function Cn(t,e,r){return t.slice(0,r)+e}function _l({content:t,parts:e,appendMessage:r}){let n=[...e],i=t,s=r.part??0;switch(r.content_type){case"text":{let{delta:o,position:a}=r;i=Cn(i,o,a);let l=n[s]&&"text"in n[s]?n[s].text:"";n[s]={text:l?Cn(l,o,a):o};break}case"html":{let{delta:o,position:a}=r,l=n[s]&&"html"in n[s]?n[s].html:"";n[s]={html:l?Cn(l,o,a):o};break}case"data":{let o=n[s]&&"data"in n[s]?n[s].data:{};n[s]={tag:r.tag,data:Object.assign({},o,r.data)};break}}return{content:i,parts:n}}var sr=class{messages=[];onEvent(e){switch(e.type){case"NEW_MESSAGE":{let r={...e.message,streaming:!0,parts:e.message.parts};return this.messages=[...this.messages.filter(n=>n.id!==r.id),r],r}case"APPEND_MESSAGE":{let r=this.messages.find(i=>i.id===e.message.id);if(!r)return;let n=_l({content:r.content,parts:r.parts||[],appendMessage:e.message});return r.content=n.content,r.parts=n.parts,e.metadata&&(r.metadata=e.metadata),r}case"MESSAGE_DONE":{let r=this.messages.find(n=>n.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=[]}};var or=class{#e;#t;#r=null;#n=new sr;isStreaming=!1;typingIndicator;ranOutOfCredits=!1;get messages(){return this.#n.messages}set messages(e){this.#n.messages=e}conversationId="";#i=0;#s;isLiveMode=!1;get hasQueuedMessages(){return this.#o.length>0}constructor(e,r){this.#e=e,this.#t=r,this.#t.autoConnect!==!1&&(this.#r=this.initWS()),e.addController(this)}#o=[];#a(e,{expectStreaming:r=!1}={}){return this.ranOutOfCredits?!1:this.#r?this.#r.isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):this.#r.isConnected?(r&&!this.isLiveMode&&(this.isStreaming=!0,this.#e.requestUpdate()),this.#r.send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent",e),this.retry(),!1):(console.warn("WebSocket not initialized, message not sent",e),this.connect(),!1)}async enqueueMessage(e,{expectStreaming:r=!1}={}){if(this.#o.length>0){let n=this.#o[this.#o.length-1];if(e.type==="USER_INPUT"&&n.message.type==="USER_INPUT"&&e.value===n.message.value)return!0}return this.#r||this.connect(),this.#r?.isConnected?this.#a(e,{expectStreaming:r}):(this.#o.push({message:e,options:{expectStreaming:r}}),this.#e.requestUpdate(),this.#r&&!this.#r.isConnecting&&!this.#r.isConnected&&this.retry(),await Es({times:5,delay:2e3},async()=>{if(this.#r?.isConnected){let n=[...this.#o];this.#o=[],this.#e.requestUpdate();let i=!1;for(let{message:s,options:o}of n){let a=this.#a(s,o);s===e&&(i=a)}return i}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),this.#o=[],this.#e.requestUpdate(),!1)))}async sendUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n},{expectStreaming:s})}async sendUserFeedback(e){return this.enqueueMessage({type:"USER_FEEDBACK",responses:e},{expectStreaming:!0})}sendFileDelete(e){L(e,"fileId is required"),this.enqueueMessage({type:"USER_FILE_DELETE",fileId:e}).catch(console.warn)}sendUserCancel(){this.enqueueMessage({type:"USER_CANCEL"}).catch(console.warn)}sendUserTypingStart(){this.#a({type:"USER_TYPING_START"})}sendUserTypingStop(){this.enqueueMessage({type:"USER_TYPING_STOP"}).catch(console.warn)}sendNewChat(){this.enqueueMessage({type:"NEW_CHAT"})}sendUserMeta(e){this.enqueueMessage({type:"USER_META",metadata:e}).catch(console.warn)}reloadConfig(){this.enqueueMessage({type:"RELOAD_CONFIG"}).catch(console.warn)}close(){this.#r?.close(1e3,"closed by user")}retry(){clearTimeout(this.#s),this.#s=setTimeout(()=>{this.#t.onReconnect?.(),this.#r=this.initWS()},1e3*this.#i),this.#i++}initWS(){return new ir(this.#e,{url:()=>this.#t.url(this.conversationId,{}),onOpen:e=>this.#u(e),onMessage:e=>this.#d(JSON.parse(e.data)),onError:e=>this.#l(e),onClose:e=>this.#h(e)})}#u(e){this.#i=0}#d(e){switch(e.type){case"NEW_MESSAGE":{this.#n.onEvent(e),this.typingIndicator=void 0,this.#e.requestUpdate(),this.#t.onNewMessage?.(e.message),this.#t.persistConversationState?.(this.conversationId,this.messages);break}case"APPEND_MESSAGE":{if(this.#n.onEvent(e))this.#t.onMessageAppend?.(e),this.#e.requestUpdate();else throw new Error(`Message with id ${e.message.id} not found`);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.typingIndicator={role:e.role,metadata:e.metadata},this.#e.requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,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)}`)}}#l(e){console.error("onError",e),this.#t.onError?.(e)}#h(e){this.#e.isConnected&&this.#r&&!this.#r.isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate(),this.#t.onClose?.()}hostConnected(){this.conversationId=this.#t.restoreConversationState?.()?.conversationId||"",this.#n.messages=this.#t.restoreConversationState?.()?.messages||[]}reset(){this.#t.onReset?.(),this.#n.reset(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.conversationId="",this.isLiveMode=!1,this.#o=[],this.#e.requestUpdate()}hostDisconnected(){clearTimeout(this.#s)}connect(){this.#r||(this.#r=this.initWS())}reconnectSocket(){this.#r?.close(1e3,"destroy"),this.#r=this.initWS()}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}get isConnected(){return this.#r?.isConnected??!1}};var $l=Symbol();var Ms=Object.getPrototypeOf,_n=new WeakMap,Sl=t=>t&&(_n.has(t)?_n.get(t):Ms(t)===Object.prototype||Ms(t)===Array.prototype);var As=t=>Sl(t)&&t[$l]||null,$n=(t,e=!0)=>{_n.set(t,e)};var En=t=>typeof t=="object"&&t!==null,El=t=>En(t)&&!Mn.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),Ds=(t,e)=>{let r=Is.get(t);if(r?.[0]===e)return r[1];let n=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return $n(n,!0),Is.set(t,[e,n]),Reflect.ownKeys(t).forEach(i=>{if(Object.getOwnPropertyDescriptor(n,i))return;let s=Reflect.get(t,i),{enumerable:o}=Reflect.getOwnPropertyDescriptor(t,i),a={value:s,enumerable:o,configurable:!0};if(Mn.has(s))$n(s,!1);else if(je.has(s)){let[l,c]=je.get(s);a.value=Ds(l,c())}Object.defineProperty(n,i,a)}),Object.preventExtensions(n)},Ml=(t,e,r,n)=>({deleteProperty(i,s){let o=Reflect.get(i,s);r(s);let a=Reflect.deleteProperty(i,s);return a&&n(ar?.("delete",s,o)),a},set(i,s,o,a){let l=!t()&&Reflect.has(i,s),c=Reflect.get(i,s,a);if(l&&(Ls(c,o)||lr.has(o)&&Ls(c,lr.get(o))))return!0;r(s),En(o)&&(o=As(o)||o);let d=!je.has(o)&&Il(o)?An(o):o;return e(s,d),Reflect.set(i,s,d,a),n(ar?.("set",s,o,c)),!0}});var je=new WeakMap,Mn=new WeakSet,Is=new WeakMap,Sn=[1],lr=new WeakMap,Ls=Object.is,Al=(t,e)=>new Proxy(t,e),Il=El,Ll=Ds,Dl=Ml,ar;function An(t={}){if(!En(t))throw new Error("object required");let e=lr.get(t);if(e)return e;let r=Sn[0],n=new Set,i=(b,$=++Sn[0])=>{r!==$&&(s=r=$,n.forEach(y=>y(b,$)))},s=r,o=(b=Sn[0])=>(s!==b&&(s=b,l.forEach(([$])=>{let y=$[1](b);y>r&&(r=y)})),r),a=b=>($,y)=>{let k;$&&(k=[...$],k[1]=[b,...k[1]]),i(k,y)},l=new Map,c=(b,$)=>{let y=!Mn.has($)&&je.get($);if(y){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(b))throw new Error("prop listener already exists");if(n.size){let k=y[2](a(b));l.set(b,[y,k])}else l.set(b,[y])}},d=b=>{var $;let y=l.get(b);y&&(l.delete(b),($=y[1])==null||$.call(y))},h=b=>(n.add(b),n.size===1&&l.forEach(([y,k],E)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&k)throw new Error("remove already exists");let O=y[2](a(E));l.set(E,[y,O])}),()=>{n.delete(b),n.size===0&&l.forEach(([y,k],E)=>{k&&(k(),l.set(E,[y]))})}),f=!0,w=Dl(()=>f,c,d,i),p=Al(t,w);lr.set(t,p);let S=[t,o,h];return je.set(p,S),Reflect.ownKeys(t).forEach(b=>{let $=Object.getOwnPropertyDescriptor(t,b);"value"in $&&$.writable&&(p[b]=t[b])}),f=!1,p}function cr(t,e,r){let n=je.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i,s=[],o=n[2],a=!1,c=o(d=>{if(d&&s.push(d),r){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,c()}}function Ge(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,n]=e;return Ll(r,n())}var Ze=class{#e;#t;#r;#n=()=>{};constructor(e,r){this.#e=e,this.#t=r,this.#r=Ge(r),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#n(),this.#n=cr(this.#t,()=>{this.#r=Ge(this.#t),this.#e.requestUpdate()})}hostDisconnected(){this.#n()}};var ve=class{#e;#t;proxyObject;#r;#n=()=>{};constructor(e,r,n){this.#e=e,this.#t=n,this.proxyObject=An(r),this.#r=Ge(this.proxyObject),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#n(),this.#t?.subscribe&&(this.#n=cr(this.proxyObject,()=>{this.#r=Ge(this.proxyObject),this.#e.requestUpdate()}))}hostDisconnected(){this.#n()}};var ur=class{#e;#t;#r;#n=null;#i=null;constructor(e,{provider:r,tag:n,key:i}){this.#e=e,this.#t=n,this.#r=i,e.addController(this)}get value(){return this.#i?this.#i.value:null}hostConnected(){if(this.#i||(this.#n=Tl(this.#e,this.#t),!this.#n))return;let e=this.#n[this.#r]instanceof ve?this.#n[this.#r]:null;e&&(this.#i=new Ze(this.#e,e.proxyObject))}hostDisconnected(){}};function Tl(t,e){let r=t;for(;r;){let n=r.closest(e);if(n)return n;let i=r.getRootNode();if(i instanceof ShadowRoot)r=i.host;else break}return null}function In(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 _t=cn(Tn(),1);var hr=class{#e;constructor({document:e}){this.#e=e}getCookies(){return(0,_t.parseCookie)(this.#e.cookie)||{}}getCookie(e){return this.getCookies()[e]||null}setCookie(e,r,n){if(L(typeof e=="string",`cookie name must be a string, got: ${typeof e}`),L(e,"cookie name must not be empty"),r==null){this.#e.cookie=(0,_t.stringifySetCookie)(e,"",{expires:new Date(0)});return}L(typeof r=="string",`value of cookie \`${e}\` must be a string, got: ${typeof r}`),this.#e.cookie=(0,_t.stringifySetCookie)(e,r,n)}deleteCookie(e){this.setCookie(e,null)}deleteCookies(e){let r=this.getCookies();for(let n in r)e(n)&&this.deleteCookie(n)}};var pr=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 n=JSON.stringify(r);this.#e.setItem(e,n)}catch(n){console.error(`Failed to store ${e} in localStorage:`,n)}}removeItem(e){this.#e.removeItem(e)}removeItems(e){let r=[];for(let n=0;n<this.#e.length;n++){let i=this.#e.key(n);i&&e(i)&&r.push(i)}for(let n of r)this.#e.removeItem(n)}};var $t=cn(Tn(),1);function jn({window:t}){let e=t.location.hostname,r=t.document;if(e==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(e)||/^\[.*\]$/.test(e))return;let n=e.split(".");if(n.length<2)return;let i="__molin_domain_test__";for(let s=2;s<=n.length;s++){let o=`.${n.slice(-s).join(".")}`;try{if(r.cookie=(0,$t.stringifySetCookie)(i,"1",{domain:o,path:"/"}),(0,$t.parseCookie)(r.cookie)[i]==="1")return r.cookie=(0,$t.stringifySetCookie)(i,"",{domain:o,path:"/",expires:new Date(0)}),o}catch{continue}}return`.${n.slice(-2).join(".")}`}var On=class{#e;#t;#r;#n;constructor({window:e}){this.#e=e,this.#t=new hr({document:e.document}),this.#r=new pr({localStorage:e.localStorage}),this.#n=e.localStorage}get distinctID(){return this.#t.getCookie("molin_distinct_id")||this.#n.getItem("molin_distinct_id")||this.#r.getItem("molin_shop_assistant_distinct_id")}set distinctID(e){if(this.#r.removeItem("molin_shop_assistant_distinct_id"),this.#t.deleteCookie("molin_shop_assistant_distinct_id"),!e){this.#t.deleteCookie("molin_distinct_id"),this.#n.removeItem("molin_distinct_id");return}L(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:jn({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")||this.#r.getItem("_molin_widget_open_state")}set widgetState(e){this.#r.setItem("molin_widget",e),this.#r.removeItem("_molin_widget_open_state")}get popupState(){return this.#r.getItem("molin_popup")||this.#r.getItem("_molin_popup")}set popupState(e){this.#r.setItem("molin_popup",e),this.#r.removeItem("_molin_popup")}get disclaimerDismissed(){return this.#r.getItem("molin_disclaimer_dismissed")??!1}set disclaimerDismissed(e){this.#r.setItem("molin_disclaimer_dismissed",e)}getConversationId(e){L(typeof e=="string","widgetId must be a string"),L(e,"widgetId must not be empty");let r=`molin_${e}_conversation_id`;return this.#t.getCookie(r)||this.#n.getItem(r)||this.#r.getItem(`_molin_${e}`)?.conversationId}setConversationId(e,r){L(typeof e=="string","widgetId must be a string"),L(e,"widgetId must not be empty");let n=`molin_${e}_conversation_id`;if(!r){this.#t.deleteCookie(n),this.#n.removeItem(n);return}L(typeof r=="string",`conversation ID for widget ${e} must be a string`);try{this.#t.setCookie(n,r,{path:"/",sameSite:"lax",expires:new Date(Date.now()+1e3*60*60*24*365),domain:jn({window:this.#e})})}catch(i){console.warn(`Could not write ${n} to cookie:`,i)}try{this.#n.setItem(n,r)}catch(i){console.warn(`Could not write ${n} to localStorage:`,i)}}getConversationState(e){L(typeof e=="string","widgetId must be a string"),L(e,"widgetId must not be empty");let r=`molin_${e}_conversation`;return this.#r.getItem(r)||this.#r.getItem(`_molin_${e}`)}setConversationState(e,r){this.#r.removeItem(`_molin_${e}`),L(typeof e=="string","widgetId must be a string"),L(e,"widgetId must not be empty");let n=`molin_${e}_conversation`;this.#r.setItem(n,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 On({window});var Us=()=>{if(window.Shopify)try{return{customerId:Vl()}}catch{return null}return null},Vl=()=>{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},Rs=async()=>{try{return(await(await fetch(window.Shopify.routes.root+"cart.js")).json()).items.map(n=>({id:n.id,name:n.title,quantity:n.quantity,price:n.price,variantId:n.variant_id,sku:n.sku,url:n.url,description:n.product_description,image:n.featured_image?.url}))}catch{return[]}};function Bs(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function Xe(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 Fs(t,e){let r=t instanceof URL?t:new URL(t);if(e)for(let[n,i]of e)r.searchParams.set(n,i);return r}var qs=()=>{if(window.ShopRenter)try{let t=Hl();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},Hl=()=>{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}}},Vs=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=Bs(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 Ns=()=>{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},Hs=async()=>new Promise((t,e)=>{try{window.UNAS.getCart(r=>{let i=r.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));t(i)})}catch(r){console.error("Error fetching cart information:",r),e(r)}});var Pn;function Ws(t){return{lang:t?.lang??Pn?.lang,message:t?.message,abortEarly:t?.abortEarly??Pn?.abortEarly,abortPipeEarly:t?.abortPipeEarly??Pn?.abortPipeEarly}}var Gl;function Zl(t){return Gl?.get(t)}var Xl;function Jl(t){return Xl?.get(t)}var Yl;function Kl(t,e){return Yl?.get(t)?.get(e)}function Gs(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 W(t,e,r,n,i){let s=i&&"input"in i?i.input:r.value,o=i?.expected??t.expects??null,a=i?.received??Gs(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:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=t.kind==="schema",d=i?.message??t.message??Kl(t.reference,l.lang)??(c?Jl(l.lang):null)??n.message??Zl(l.lang);d!==void 0&&(l.message=typeof d=="function"?d(l):d),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function Z(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Ws())}}}function Ql(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Zs(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var ec=/^\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 Un(t){return{kind:"validation",type:"iso_timestamp",reference:Un,async:!1,expects:null,requirement:ec,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&W(this,"timestamp",e,r),e}}}function Rn(t,e){return{kind:"validation",type:"max_length",reference:Rn,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length>this.requirement&&W(this,"length",r,n,{received:`${r.value.length}`}),r}}}function Bn(t,e){return{kind:"validation",type:"min_length",reference:Bn,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length<this.requirement&&W(this,"length",r,n,{received:`${r.value.length}`}),r}}}function Fn(t){return{kind:"transformation",type:"to_date",reference:Fn,async:!1,message:t,"~run"(e,r){try{e.value=new Date(e.value),isNaN(e.value)&&(W(this,"date",e,r,{received:'"Invalid Date"'}),e.typed=!1)}catch{W(this,"date",e,r),e.typed=!1}return e}}}function qn(t){return{kind:"transformation",type:"transform",reference:qn,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function Xs(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function K(t,e){return{...t,fallback:e,get"~standard"(){return Z(this)},"~run"(r,n){let i=t["~run"](r,n);return i.issues?{typed:!0,value:Xs(this,i,n)}:i}}}function Vn(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 Z(this)},"~run"(t){return t.typed=!0,t}}}function Je(t,e){return{kind:"schema",type:"array",reference:Je,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return Z(this)},"~run"(r,n){let i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<i.length;s++){let o=i[s],a=this.item["~run"]({value:o},n);if(a.issues){let l={type:"array",origin:"value",input:i,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),n.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value.push(a.value)}}else W(this,"type",r,n);return r}}}function Nn(t){return{kind:"schema",type:"boolean",reference:Nn,expects:"boolean",async:!1,message:t,get"~standard"(){return Z(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:W(this,"type",e,r),e}}}function Hn(t){return{kind:"schema",type:"null",reference:Hn,expects:"null",async:!1,message:t,get"~standard"(){return Z(this)},"~run"(e,r){return e.value===null?e.typed=!0:W(this,"type",e,r),e}}}function fr(t,e){return{kind:"schema",type:"nullish",reference:fr,expects:`(${t.expects} | null | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return Z(this)},"~run"(r,n){return(r.value===null||r.value===void 0)&&(this.default!==void 0&&(r.value=Vn(this,r,n)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function mr(t){return{kind:"schema",type:"number",reference:mr,expects:"number",async:!1,message:t,get"~standard"(){return Z(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:W(this,"type",e,r),e}}}function V(t,e){return{kind:"schema",type:"object",reference:V,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return Z(this)},"~run"(r,n){let i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(let s in this.entries){let o=this.entries[s];if(s in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){let a=s in i?i[s]:Vn(o),l=o["~run"]({value:a},n);if(l.issues){let c={type:"object",origin:"value",input:i,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),n.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value[s]=l.value}else if(o.fallback!==void 0)r.value[s]=Xs(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(W(this,"key",r,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else W(this,"type",r,n);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 Z(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=Vn(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function Et(t,e){return{kind:"schema",type:"picklist",reference:Et,expects:Zs(t.map(Gs),"|"),async:!1,options:t,message:e,get"~standard"(){return Z(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:W(this,"type",r,n),r}}}function Mt(t,e,r){return{kind:"schema",type:"record",reference:Mt,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return Z(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let o in s)if(Ql(s,o)){let a=s[o],l=this.key["~run"]({value:o},i);if(l.issues){let d={type:"object",origin:"key",input:s,key:o,value:a};for(let h of l.issues)h.path=[d],n.issues?.push(h);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}let c=this.value["~run"]({value:a},i);if(c.issues){let d={type:"object",origin:"value",input:s,key:o,value:a};for(let h of c.issues)h.path?h.path.unshift(d):h.path=[d],n.issues?.push(h);if(n.issues||(n.issues=c.issues),i.abortEarly){n.typed=!1;break}}(!l.typed||!c.typed)&&(n.typed=!1),l.typed&&(n.value[l.value]=c.value)}}else W(this,"type",n,i);return n}}}function _(t){return{kind:"schema",type:"string",reference:_,expects:"string",async:!1,message:t,get"~standard"(){return Z(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:W(this,"type",e,r),e}}}function zs(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function gr(t,e){return{kind:"schema",type:"union",reference:gr,expects:Zs(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return Z(this)},"~run"(r,n){let i,s,o;for(let a of this.options){let l=a["~run"]({value:r.value},n);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{i=l;break}else o?o.push(l):o=[l]}if(i)return i;if(s){if(s.length===1)return s[0];W(this,"type",r,n,{issues:zs(s)}),r.typed=!0}else{if(o?.length===1)return o[0];W(this,"type",r,n,{issues:zs(o)})}return r}}}function Js(t,e){let r={};for(let n in t.entries)r[n]=!e||e.includes(n)?A(t.entries[n]):t.entries[n];return{...t,entries:r,get"~standard"(){return Z(this)}}}function Ye(...t){return{...t[0],pipe:t,get"~standard"(){return Z(this)},"~run"(e,r){for(let n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=n["~run"](e,r))}return e}}}function me(t,e,r){let n=t["~run"]({value:e},Ws(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var Ys=Mt(_(),gr([_(),mr(),Nn(),Hn()])),Ks=Ye(_(),Bn(1),Rn(5e3)),Qs=()=>{try{return window.UNAS?Ns():window.Shopify?Us():window.ShopRenter?qs():null}catch{return null}},eo=async()=>{try{return window.UNAS?await Hs():window.Shopify?await Rs():window.ShopRenter?await Vs():[]}catch{return[]}},Ke={schema:V({conversationId:A(_()),messages:A(Je(V({id:_(),timestamp:mr(),role:Et(["user","assistant","support"]),content:_(),parts:A(Je(gr([V({text:_()}),V({html:_()}),V({tag:_(),data:Mt(_(),St())})])))})))}),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?me(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 Qe=class t extends v{static properties={widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object},autoConnect:{type:Boolean}};contextCtrl;constructor(){super(),this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.autoConnect=!1,this.contextCtrl=new ve(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,ranOutOfCredits:!1,isLiveMode:!1,lastMsg:void 0,hasQueuedMessages:!1,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),connect:this.connect.bind(this),sendFileDelete:this.#i.sendFileDelete.bind(this.#i)})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.autoConnect&&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,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),connect:this.connect.bind(this),sendFileDelete:this.#i.sendFileDelete.bind(this.#i)}),this.#s()}get#e(){return this.#i?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:this.#i?.messages||[]}#t;#r;#n=null;get#i(){return this.#n||(this.#n=new or(this,{autoConnect:this.autoConnect,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)=>{r.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,conversationId:this.#i.conversationId})},onMessageError:e=>{console.error("ws message error",e),e.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+e.message})},onReset:()=>{Ke.reset(this.widgetId)},onConnect:(e,r)=>{let n=Qs();this.#i.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:n,language:window.navigator.language,cart:[]}),eo().then(i=>{i?.length>0&&this.#i.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:n,cart:i,language:window.navigator.language})}).catch(i=>{console.error(i)}),this.dispatchEvent(new t.ConnectedEvent({conversationId:e,metadata:r,widgetId:this.widgetId,pendingImages:r?.pendingImages||[]}))},persistConversationState:(e,r)=>{Ke.persist(this.widgetId,e,r)},restoreConversationState:()=>Ke.restore(this.widgetId)})),this.#n}#s(){function e(n){if(!n)return;let i;try{i=typeof n=="object"?n:JSON.parse(n)}catch(o){console.error("Molin: user-data is not valid JSON",o);return}if(!i||typeof i!="object"||Object.keys(i).length===0)return;let s=me(Ys,i);if(!s.success){console.error("Molin: user-data does not pass schema validation",s.issues);return}return s.output}function r(n){if(!n)return;let i=me(Ks,n);if(!i.success){console.error("Molin: custom-instructions does not pass schema validation",i.issues);return}return i.output}this.#t=e(this.xUserData),this.#r=r(this.xCustomInstructions)}async sendUserInput(e,r={}){let n={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...r},i=await this.#i.sendUserInput(e,n);return i&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!1,conversationId:this.#i.conversationId}),i}async enqueueUserInput(e,r={}){e.length>1e3&&(console.error("Message exceeds max length of 1000 characters, trimming"),e=In(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()}connect(){this.#i.connect()}render(){return u`<slot></slot>`}};function to(t){let e=new ur(t,{provider:Qe,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,n){if(n==="value")return e.value}})}Qe.ConnectedEvent=class extends CustomEvent{static type="mw-context-widget:connected";constructor(e,r={}){super(Qe.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-context-widget")||customElements.define("mw-context-widget",Qe);function ei(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function tc(t,e=","){return t.map(ei).join(e)}var lo=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function wr(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 br(t,e="@media "){return e+D(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(n=>`(${n}-width:${r[n]})`).join(" and "))).join(",")}function D(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function ro(t){return t}function xr(){}var F={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function co(t){return t.match(/[-=:;]/g)?.length||0}function Xn(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(co(t),15)<<18}var rc=["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 ti({n:t,i:e,v:r=[]},n,i,s){t&&(t=ei({n:t,i:e,v:r})),s=[...D(s)];for(let a of r){let l=n.theme("screens",a);for(let c of D(l&&br(l)||n.v(a))){var o;s.push(c),i|=l?67108864|Xn(c):a=="dark"?1073741824:c[0]=="@"?Xn(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~rc.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:i,r:s,i:e}}var uo=new Map;function Jn(t){if(t.d){let e=[],r=zn(t.r.reduce((n,i)=>i[0]=="@"?(e.push(i),n):i?zn(n,s=>zn(i,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):Wn(s,o)}return Wn(o,s)})):n,"&"),n=>Wn(n,t.n?"."+lo(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((n,i)=>i+"{"+n+"}",t.d)}}function zn(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,n,i)=>e(n)+i)}function Wn(t,e){return t.replace(/&/g,e)}var no=new Intl.Collator("en",{numeric:!0});function ho(t,e){for(var r=0,n=t.length;r<n;){let i=n+r>>1;0>=po(t[i],e)?r=i+1:n=i}return n}function po(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||no.compare(io(t.n),io(e.n))||no.compare(so(t.n),so(e.n))}function io(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function so(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Gn(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:n}=e,i=n?`var(${n})`:r;if(t.includes("<alpha-value>"))return t.replace("<alpha-value>",i);if(t[0]=="#"&&(t.length==4||t.length==7)){let s=(t.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Gn(t.substr(1,s),o),Gn(t.substr(1+s,s),o),Gn(t.substr(1+2*s,s),o),i]})`}return i=="1"?t:i=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function fo(t,e,r,n,i=[]){return(function s(o,{n:a,p:l,r:c=[],i:d},h){let f=[],w="",p=0,S=0;for(let y in o||{}){var b,$;let k=o[y];if(y[0]=="@"){if(!k)continue;if(y[1]=="a"){f.push(...ni(a,l,vr(""+k),h,l,c,d,!0));continue}if(y[1]=="l"){for(let E of D(k))f.push(...s(E,{n:a,p:(b=F[y[7]],l&~F.o|b),r:y[7]=="d"?[]:c,i:d},h));continue}if(y[1]=="i"){f.push(...D(k).map(E=>({p:-1,o:0,r:[],d:y+" "+E})));continue}if(y[1]=="k"){f.push({p:F.d,o:0,r:[y],d:s(k,{p:F.d},h).map(Jn).join("")});continue}if(y[1]=="f"){f.push(...D(k).map(E=>({p:F.d,o:0,r:[y],d:s(E,{p:F.d},h).map(Jn).join("")})));continue}}if(typeof k!="object"||Array.isArray(k))y=="label"&&k?a=k+wr(JSON.stringify([l,d,o])):(k||k===0)&&(y=y.replace(/[A-Z]/g,E=>"-"+E.toLowerCase()),S+=1,p=Math.max(p,($=y)[0]=="-"?0:co($)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test($)?+!!RegExp.$1||-!!RegExp.$2:0)+1),w+=(w?";":"")+D(k).map(E=>h.s(y,ri(""+E,h.theme)+(d?" !important":""))).join(";"));else if(y[0]=="@"||y.includes("&")){let E=l;y[0]=="@"&&(y=y.replace(/\bscreen\(([^)]+)\)/g,(O,B)=>{let N=h.theme("screens",B);return N?(E|=67108864,br(N,"")):O}),E|=Xn(y)),f.push(...s(k,{n:a,p:E,r:[...c,y],i:d},h))}else f.push(...s(k,{p:l,r:[...c,y]},h))}return f.unshift({n:a,p:l,o:Math.max(0,15-S)+1.5*Math.min(p||15,15),r:c,d:w}),f.sort(po)})(t,ti(e,r,n,i),r)}function ri(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,n,i,s,o="")=>{let a=e(i,o);return typeof a=="function"&&/color|fill|stroke/i.test(i)?te(a):""+D(a).filter(l=>Object(l)!==l)})}function mo(t,e){let r,n=[];for(let i of t)i.d&&i.n?r?.p==i.p&&""+r.r==""+i.r?(r.c=[r.c,i.c].filter(Boolean).join(" "),r.d=r.d+";"+i.d):n.push(r={...i,n:i.n&&e}):n.push({...i,n:i.n&&e});return n}function yr(t,e,r=F.u,n,i){let s=[];for(let o of t)for(let a of(function(l,c,d,h,f){l={...l,i:l.i||f};let w=(function(p,S){let b=uo.get(p.n);return b?b(p,S):S.r(p.n,p.v[0]=="dark")})(l,c);return w?typeof w=="string"?({r:h,p:d}=ti(l,c,d,h),mo(yr(vr(w),c,d,h,l.i),l.n)):Array.isArray(w)?w.map(p=>{var S,b;return{o:0,...p,r:[...D(h),...D(p.r)],p:(S=d,b=p.p??d,S&~F.o|b)}}):fo(w,l,c,d,h):[{c:ei(l),p:0,o:0,r:[]}]})(o,e,r,n,i))s.splice(ho(s,a),0,a);return s}function ni(t,e,r,n,i,s,o,a){return mo((a?r.flatMap(l=>yr([l],n,i,s,o)):yr(r,n,i,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 nc(t,e,r,n){var i;return i=(s,o)=>{let{n:a,p:l,r:c,i:d}=ti(s,o,e);return r&&ni(a,e,r,o,l,c,d,n)},uo.set(t,i),t}function Zn(t,e,r){if(t[t.length-1]!="("){let n=[],i=!1,s=!1,o="";for(let a of t)if(!(a=="("||/[~@]$/.test(a))){if(a[0]=="!"&&(a=a.slice(1),i=!i),a.endsWith(":")){n[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:n.filter(ic),i}))}}function ic(t,e,r){return r.indexOf(t)==e}var oo=new Map;function vr(t){let e=oo.get(t);if(!e){let r=[],n=[[]],i=0,s=0,o=null,a=0,l=(c,d=0)=>{i!=a&&(r.push(t.slice(i,a+d)),c&&Zn(r,n)),i=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,i=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 h=r[d-1];if(/[~@]$/.test(h)){let f=n.shift();r.length=d,Zn([...r,"#"],n);let{v:w}=n[0].pop();for(let p of f)p.v.splice(+(p.v[0]=="dark")-+(w[0]=="dark"),w.length);Zn([...r,nc(h.length>1?h.slice(0,-1)+wr(JSON.stringify([h,f])):h+"("+tc(f)+")",F.a,f,/@$/.test(h))],n)}d=r.lastIndexOf("(",d-1)}r.length=d+1}else/[~@]/.test(c)&&t[a+1]=="("&&n.unshift([])}l(!0),oo.set(t,e=n[0])}return e}function m(t,e,r){return[t,Yn(e,r)]}function Yn(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,n)=>({[t]:e?e(r,n):Kn(r,1)}):r=>t||{[r[1]]:Kn(r,2)}}function Kn(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function g(t,e,r,n){return[t,ii(e,r,n)]}function ii(t,e,r){let n=typeof e=="string"?(i,s)=>({[e]:r?r(i,s):i._}):e||(({1:i,_:s},o,a)=>({[i||a]:s}));return(i,s)=>{let o=go(t||i[1]),a=s.theme(o,i.$$)??le(i.$$,o,s);if(a!=null)return i._=Kn(i,0,a),n(i,s,o)}}function q(t,e={},r){return[t,sc(e,r)]}function sc(t={},e){return(r,n)=>{let{section:i=go(r[0]).replace("-","")+"Color"}=t,[s,o]=oc(r.$$);if(!s)return;let a=n.theme(i,s)||le(s,i,n);if(!a||typeof a=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:c=i.replace("Color","Opacity"),property:d=i,selector:h}=t,f=n.theme(c,o||"DEFAULT")||o&&le(o,c,n),w=e||(({_:S})=>{let b=At(d,S);return h?{[h]:b}:b});r._={value:te(a,{opacityVariable:l||void 0,opacityValue:f||void 0}),color:S=>te(a,S),opacityVariable:l||void 0,opacityValue:f||void 0};let p=w(r,n);if(!r.dark){let S=n.d(i,s,a);S&&S!==a&&(r._={value:te(S,{opacityVariable:l||void 0,opacityValue:f||"1"}),color:b=>te(S,b),opacityVariable:l||void 0,opacityValue:f||void 0},p={"&":p,[n.v("dark")]:w(r,n)})}return p}}function oc(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function At(t,e){let r={};return typeof e=="string"?r[t]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(r[e.opacityVariable]=e.opacityValue||"1"),r[t]=e.value),r}function le(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=et(ri(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 go(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function et(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",n,i="")=>et(r)+n+et(i)):t.replace(/(^|[^\\])_+/g,(e,r)=>r+" ".repeat(e.length-r.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function It({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:D(e.variants),rules:D(e.rules),ignorelist:D(e.ignorelist),hash:void 0,stringify:(n,i)=>n+":"+i,finalize:[]};for(let n of D([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&D(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:i,darkMode:s=r.darkMode,darkColor:o=r.darkColor,theme:a,variants:l,rules:c,ignorelist:d,hash:h=r.hash,stringify:f=r.stringify,finalize:w}=typeof n=="function"?n(r):n;r={preflight:r.preflight!==!1&&i!==!1&&[...r.preflight,...D(i)],darkMode:s,darkColor:o,theme:{...r.theme,...a,extend:{...r.theme.extend,...a?.extend}},variants:[...r.variants,...D(l)],rules:[...r.rules,...D(c)],ignorelist:[...r.ignorelist,...D(d)],hash:h,stringify:f,finalize:[...r.finalize,...D(w)]}}return r}function ao(t,e,r,n,i,s){for(let o of e){let a=r.get(o);a||r.set(o,a=n(o));let l=a(t,i,s);if(l)return l}}function ac(t){var e;return Qn(t[0],typeof(e=t[1])=="function"?e:()=>e)}function lc(t){var e,r;return Array.isArray(t)?Qn(t[0],Yn(t[1],t[2])):Qn(t,Yn(e,r))}function Qn(t,e){return wo(t,(r,n,i,s)=>{let o=n.exec(r);if(o)return o.$$=r.slice(o[0].length),o.dark=s,e(o,i)})}function wo(t,e){let r=D(t).map(cc);return(n,i,s)=>{for(let o of r){let a=e(n,o,i,s);if(a)return a}}}function cc(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function yo(t,e){let r=It(t),n=(function({theme:l,darkMode:c,darkColor:d=xr,variants:h,rules:f,hash:w,stringify:p,ignorelist:S,finalize:b}){let $=new Map,y=new Map,k=new Map,E=new Map,O=wo(S,(I,H)=>H.test(I));h.push(["dark",Array.isArray(c)||c=="class"?`${D(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let B=typeof w=="function"?I=>w(I,wr):w?wr:ro;B!==ro&&b.push(I=>({...I,n:I.n&&B(I.n),d:I.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(H,J)=>"--"+B(J).replace("#",""))}));let N={theme:(function({extend:I={},...H}){let J={},ln={get colors(){return Se("colors")},theme:Se,negative(){return{}},breakpoints(U){let z={};for(let Y in U)typeof U[Y]=="string"&&(z["screen-"+Y]=U[Y]);return z}};return Se;function Se(U,z,Y,mt){if(U){if({1:U,2:mt}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(U)||[,U],/[.[]/.test(U)){let he=[];U.replace(/\[([^\]]+)\]|([^.[]+)/g,(Me,wt,il=wt)=>he.push(il)),U=he.shift(),Y=z,z=he.join("-")}let oe=J[U]||Object.assign(Object.assign(J[U]={},Gt(H,U)),Gt(I,U));if(z==null)return oe;z||(z="DEFAULT");let Ee=oe[z]??z.split("-").reduce((he,Me)=>he?.[Me],oe)??Y;return mt?te(Ee,{opacityValue:ri(mt,Se)}):Ee}let gt={};for(let oe of[...Object.keys(H),...Object.keys(I)])gt[oe]=Se(oe);return gt}function Gt(U,z){let Y=U[z];return typeof Y=="function"&&(Y=Y(ln)),Y&&/color|fill|stroke/i.test(z)?(function mt(gt,oe=[]){let Ee={};for(let he in gt){let Me=gt[he],wt=[...oe,he];Ee[wt.join("-")]=Me,he=="DEFAULT"&&(wt=oe,Ee[oe.join("-")]=Me),typeof Me=="object"&&Object.assign(Ee,mt(Me,wt))}return Ee})(Y):Y}})(l),e:lo,h:B,s(I,H){return p(I,H,N)},d(I,H,J){return d(I,H,N,J)},v(I){return $.has(I)||$.set(I,ao(I,h,y,ac,N)||"&:"+I),$.get(I)},r(I,H){let J=JSON.stringify([I,H]);return k.has(J)||k.set(J,!O(I,N)&&ao(I,f,E,lc,N,H)),k.get(J)},f(I){return b.reduce((H,J)=>J(H,N),I)}};return N})(r),i=new Map,s=[],o=new Set;e.resume(l=>i.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),o.add(l)});function a(l){let c=n.f(l),d=Jn(c);if(d&&!o.has(d)){o.add(d);let h=ho(s,l);e.insert(d,h,l),s.splice(h,0,l)}return c.n}return Object.defineProperties(function(c){if(!i.size)for(let h of D(r.preflight))typeof h=="function"&&(h=h(n)),h&&(typeof h=="string"?ni("",F.b,vr(h),n,F.b,[],!1,!0):fo(h,{},n,F.b)).forEach(a);c=""+c;let d=i.get(c);if(!d){let h=new Set;for(let f of yr(vr(c),n))h.add(f.c).add(a(f));d=[...h].filter(Boolean).join(" "),i.set(c,d).set(d,d)}return d},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:n.theme,config:r,snapshot(){let l=e.snapshot(),c=new Set(o),d=new Map(i),h=[...s];return()=>{l(),o=c,i=d,s=h}},clear(){e.clear(),o=new Set,i=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function uc(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function vo(t){let e=new MutationObserver(r);return{observe(i){e.observe(i,{attributeFilter:["class"],subtree:!0,childList:!0}),n(i),r([{target:i,type:""}])},disconnect(){e.disconnect()}};function r(i){for(let{type:s,target:o}of i)if(s[0]=="a")n(o);else for(let a of o.querySelectorAll("[class]"))n(a);e.takeRecords()}function n(i){let s,o=i.getAttribute?.("class");o&&uc(o,s=t(o))&&i.setAttribute("class",s)}}function dc(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 kr(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:dc(t)).sheet;return{target:e,snapshot(){let r=Array.from(e.cssRules,n=>n.cssText);return()=>{this.clear(),r.forEach(this.insert)}},clear(){for(let r=e.cssRules.length;r--;)e.deleteRule(r)},destroy(){e.ownerNode?.remove()},insert(r,n){try{e.insertRule(r,n)}catch{e.insertRule(":root{}",n)}},resume:xr}}var hc=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 bo(t){return hc.get(t)}function xo(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 ko(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 Cr(){return({stringify:t})=>({stringify(e,r,n){let i="",s=bo(e);s&&(i+=t(s,r,n)+";");let o=xo(e),a=ko(e,r);for(let l of pc)o&l[1]&&(i+=t(l[0]+e,r,n)+";"),a&l[1]&&(i+=t(e,l[0]+r,n)+";");return i+t(e,r,n)}})}function _r(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",ii("lineClamp",({_:t})=>Co(t))],["line-clamp-(\\d+)",({1:t})=>Co(t)]]}}function Co(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var Dt={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",...Q(4,"rem",4,.5,.5),...Q(12,"rem",4,5),14:"3.5rem",...Q(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:M("blur"),backdropBrightness:M("brightness"),backdropContrast:M("contrast"),backdropGrayscale:M("grayscale"),backdropHueRotate:M("hueRotate"),backdropInvert:M("invert"),backdropOpacity:M("opacity"),backdropSaturate:M("saturate"),backdropSepia:M("sepia"),backgroundColor:M("colors"),backgroundImage:{none:"none"},backgroundOpacity:M("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:{...Q(200,"",100,0,50),...Q(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:M("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:M("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:M("colors"),caretColor:M("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...Q(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:M("borderColor"),divideOpacity:M("borderOpacity"),divideWidth:M("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"),...Lt(2,6),...Lt(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:M("spacing"),gradientColorStops:M("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"),...Lt(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...Lt(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:{...Q(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:{...Q(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:M("spacing"),placeholderColor:M("colors"),placeholderOpacity:M("opacity"),outlineColor:M("colors"),outlineOffset:re(8,"px"),outlineWidth:re(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:M("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:Q(200,"",100,0,50),scale:{...Q(150,"",100,0,50),...Q(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:M("spacing"),scrollPadding:M("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...re(2,"deg"),...re(12,"deg",3)},space:M("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:Q(2),textColor:M("colors"),textDecorationColor:M("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...re(8,"px")},textUnderlineOffset:{auto:"auto",...re(8,"px")},textIndent:M("spacing"),textOpacity:M("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:M("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"),...Lt(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:{...Q(50,"",1,0,10),auto:"auto"}};function Lt(t,e){let r={};do for(var n=1;n<t;n++)r[`${n}/${t}`]=Number((n/t*100).toFixed(6))+"%";while(++t<=e);return r}function re(t,e,r=0){let n={};for(;r<=t;r=2*r||1)n[r]=r+e;return n}function Q(t,e="",r=1,n=0,i=1,s={}){for(;n<=t;n+=i)s[n]=n/r+e;return s}function M(t){return({theme:e})=>e(t)}var _o={"*,::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, ${Dt.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, ${Dt.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 Io=[m("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:le(`[${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:n,padding:i}=e("container"),s={width:"100%",marginRight:n&&"auto",marginLeft:n&&"auto",...o("xs")};for(let a in r){let l=r[a];typeof l=="string"&&(s[br(l)]={"&":{maxWidth:l,...o(a)}})}return s;function o(a){let l=i&&(typeof i=="string"?i:i[a]||i.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",$r),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",$o),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",Ao),g("col-","gridColumn"),m("col-(span)-(\\d+)","gridColumn",Mo),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",Ao),g("row-","gridRow"),m("row-(span)-(\\d+)","gridRow",Mo),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=>$r($o(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",So),m("(content|items|self)-",t=>({["align-"+t[1]]:So(t)})),m("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),g("p([xytrbl])?(?:$|-)","padding",tt("padding")),g("-?m([xytrbl])?(?:$|-)","margin",tt("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=D(t))[1]=="string"?{fontFamily:se(t)}:{fontFamily:se(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)",...xe({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),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 ${Pe(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",$r),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-${Pe(r[0])}-radius`]:e,[`border-${Pe(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})=>({...xe({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(t||"-x")]:e,["--tw-border-spacing"+(t||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),q("border-([xytrbl])-",{section:"borderColor"},tt("border","Color")),q("border-"),g("border-([xytrbl])(?:$|-)","borderWidth",tt("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-${Pe(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${Pe(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})=>({...xe({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":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})=>({...xe({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":se(t),"--tw-shadow-colored":se(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"),...Eo(),...Eo("backdrop-"),g("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:se(t),transitionTimingFunction:t._=="none"?void 0:se(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:se(e("transitionDuration",""))})),g("duration(?:$|-)","transitionDuration","transitionDuration",se),g("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",se),g("delay(?:$|-)","transitionDelay","transitionDelay",se),g("animate(?:$|-)","animation",(t,{theme:e,h:r,e:n})=>{let i=se(t),s=i.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=n(r(s[0])))]:o,animation:s.join(" ")}:{animation:i}}),"(transform)-(none)",m("transform",oi),m("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":Lo(t=="gpu")})),g("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...oi()})),g("-?(rotate)-","rotate",si),g("-?(translate-[xy])-","translate",si),g("-?(skew-[xy])-","skew",si),m("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",$r),"(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})=>({...xe({"--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",tt("scroll-padding")),g("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",tt("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})=>({...xe({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":r?"pan-y":t}`]:t,"touch-action":"var(--tw-touch-action)"})),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 $r(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function $o(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function Pe(t,e="-"){let r=[];for(let n of t)r.push({t:"top",r:"right",b:"bottom",l:"left"}[n]);return r.join(e)}function se(t){return t&&""+(t._||t)}function So({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function tt(t,e=""){return({1:r,_:n})=>{let i={x:"lr",y:"tb"}[r]||r+r;return i?{...At(t+"-"+Pe(i[0])+e,n),...At(t+"-"+Pe(i[1])+e,n)}:At(t+e,n)}}function Eo(t=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",t&&"opacity","saturate","sepia",!t&&"drop-shadow"].filter(Boolean),r={};for(let n of e)r[`--tw-${t}${n}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...xe(r),[`${t}filter`]:e.map(n=>`var(--tw-${t}${n})`).join(" ")},[`(${t}filter)-(none)`,m(`${t}filter`,r),...e.map(n=>g(`${n[0]=="h"?"-?":""}(${t}${n})(?:$|-)`,n,({1:i,_:s})=>({[`--tw-${i}`]:D(s).map(o=>`${n}(${o})`).join(" "),...r})))]}function si({1:t,_:e}){return{["--tw-"+t]:e,...oi()}}function oi(){return{...xe({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":Lo()}),transform:"var(--tw-transform)"}}function Lo(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 Mo({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function Ao({1:t}){return`repeat(${t},minmax(0,1fr))`}function xe(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var Do=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:t})=>`@media (orientation:${t})`],["contrast-(more|less)",({1:t})=>`@media (prefers-contrast:${t})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:t})=>`&::${t}`],["(marker|selection)",({1:t})=>`& *::${t},&::${t}`],["file","&::file-selector-button"],["(first|last|only)",({1:t})=>`&:${t}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:t,$$:e},r)=>e&&`&[${t}-${r.theme(t,e)||le(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:n="",6:i=e},{e:s,h:o,v:a})=>{let l=et(n)||(r[0]=="["?r:a(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(t+i))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||le(t,"",e)),t)return t.includes(":")||(t+=":var(--tw)"),/^\w*\s*\(/.test(t)||(t=`(${t})`),`@supports ${t.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:t},e)=>{if(t&&(t=e.theme("screens",t)||le(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=le(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&et(t).replace(/[}]+$/,"").split("{")]];function To({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:_o,theme:{...Dt,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:Do,rules:Io,finalize(r){return r.n&&r.d&&r.r.some(n=>/^&::(before|after)$/.test(n))&&!/(^|;)content:/.test(r.d)?{...r,d:"content:var(--tw-content);"+r.d}:r}}}var fc={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},mc={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},gc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},wc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},yc={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},vc={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"},xc={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},kc={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Cc={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},_c={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},$c={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Sc={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Ec={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Mc={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Ac={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Ic={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Lc={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},Dc={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},Tc={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},jc={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},Oc={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},jo={__proto__:null,slate:fc,gray:mc,zinc:gc,neutral:wc,stone:yc,red:vc,orange:bc,amber:xc,yellow:kc,lime:Cc,green:_c,emerald:$c,teal:Sc,cyan:Ec,sky:Mc,blue:Ac,indigo:Ic,violet:Lc,purple:Dc,fuchsia:Tc,pink:jc,rose:Oc};function Sr({disablePreflight:t}={}){return To({colors:jo,disablePreflight:t})}function Er({className:t="prose",defaultColor:e="gray",extend:r={},colors:n={}}={}){return n={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...n,dark:n.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...n.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${t}-${s}`,(a,l)=>Uo(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=Po(o.theme("fontSize",s));return a&&{"@layer components":a}}],[t+"-",({$$:s},o)=>i(s,o)],[t,(s,o)=>({...i(e,o),"@layer base":[Oo(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:C(20,16),marginBottom:C(20,16),paddingLeft:C(26,16)},li:{marginTop:C(8,16),marginBottom:C(8,16)},"ol>li,ul>li":{paddingLeft:C(6,16)},">ul>li p":{marginTop:C(12,16),marginBottom:C(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:C(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:C(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:C(12,16),marginBottom:C(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:C(48,16),marginBottom:C(48,16)},blockquote:{marginTop:C(32,20),marginBottom:C(32,20),paddingLeft:C(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:C(20,16),marginBottom:C(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:C(36,16),marginTop:"0",marginBottom:C(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:C(24,16),marginTop:C(48,24),marginBottom:C(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:C(20,16),marginTop:C(32,20),marginBottom:C(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:C(24,16),marginBottom:C(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:C(32,16),marginBottom:C(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:C(14,16),lineHeight:"1.4",marginTop:C(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:C(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:C(21,24)},"h3 code":{fontSize:C(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:C(14,16),lineHeight:"1.7",marginTop:C(24,14),marginBottom:C(24,14),borderRadius:"0.375rem",paddingTop:C(12,14),paddingRight:C(16,14),paddingBottom:C(12,14),paddingLeft:C(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:C(32,16),marginBottom:C(32,16),fontSize:C(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:C(8,14),paddingBottom:C(8,14),paddingLeft:C(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:C(8,14),paddingRight:C(8,14),paddingBottom:C(8,14),paddingLeft:C(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:C(20,16),lineHeight:"1.6",marginTop:C(24,20),marginBottom:C(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Oo(t,o,r)],"@layer components":{...Po(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function i(s,o){let a={},l={},c=(d,h,f)=>{let w=o.theme(`colors.${s}.${h}`,h);f["--tw-prose-"+d]=te(w);let p=f!=l&&o.d("colors",`${s}-${h}`,w);p&&(l["--tw-prose-"+d]=te(p))};for(let d in n){let h=n[d];d!="dark"&&h&&c(d,h,a)}for(let d in n.dark||{}){let h=n.dark[d];h&&(n.dark?c("invert-"+d,h,a):c(d,h,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function Oo(t,e,r){let n={};for(let i in r)n[Uo(t,i,e,s=>`.${e.e(e.h(t))}${s}`)]=r[i];return n}function Uo(t,e,{e:r,h:n},i){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",a=s,l="")=>i(`${o}:where(${a}):not(:where(.${r(n("not-"+t))} *))${l}`))}function Po(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function C(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var ai=It({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:[Sr(),Cr(),_r(),Er()]});function Mr(t,e=!0){let r=(function(){if(Pc)try{let l=kr(new CSSStyleSheet);return l.connect=c=>{let d=li(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,l.target]},l.disconnect=xr,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[kr(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 h=this.target.cssRules[c];o.forEach((f,w)=>w&&f.target.insertRule(h.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");li(l).appendChild(c);let d=kr(c),{cssRules:h}=this.target;for(let f=0;f<h.length;f++)d.target.insertRule(h[f].cssText,f);o.push(d),a.set(l,d)},disconnect(l){let c=o.indexOf(a.get(l));c>=0&&o.splice(c,1)}}})(),n=yo({...t,hash:t.hash??e},r),i=vo(n);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),i.observe(li(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=n}}}}var Pc=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function li(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var x=t=>Mr(ai)(t);var ci=class extends x(v){static properties={color:{type:String},radius:{type:String},size:{type:String},border:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=j`
144
+ </svg>`};var Ml=Is,xi=class extends sr{resolveIcon(e){let r=Ml[e];if(!r)throw console.warn("hi-outline: icon not found",e),new Error(`Icon ${e} not found`);return r}render(){super.render();let e=this.shadowRoot?.querySelector("svg");if(!e)throw new Error("svgEl not found "+this.name);e.setAttribute("fill","none"),e.querySelectorAll("[stroke]").forEach(r=>{r.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",xi);var or=class{#e;#t;#r;constructor(e,r){if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");this.#e=e,this.#e.addController(this),this.#t=r}connect(e){this.#t=e,this.#r=this.#i()}hostConnected(){this.#r||setTimeout(()=>{this.#r||(this.#r=this.#i())},0)}hostDisconnected(){this.#r?.close(1e3,"lit_host_disconnected"),this.#r=void 0}send(e){this.#r?.send(e)}close(e,r){this.#r?.close(e,r)}get isConnected(){return this.#r?.readyState===WebSocket.OPEN}get isConnecting(){return this.#r?.readyState===WebSocket.CONNECTING}#i(){let e=new WebSocket(this.#t.url());return this.#t.onClose&&(e.onclose=this.#t.onClose),this.#t.onOpen&&(e.onopen=this.#t.onOpen),this.#t.onError&&(e.onerror=this.#t.onError),this.#t.onMessage&&(e.onmessage=this.#t.onMessage),e}};async function ki(t){await new Promise(e=>setTimeout(e,t))}async function Ls(t,e){let r=t?.times??3,i=t?.delay,n=t?.backoff??null,s=o=>{throw{_bailed:o}};for(let o=0;o<r;o++)try{return await e(s,o)}catch(a){if(a&&typeof a=="object"&&"_bailed"in a)throw a._bailed;if(o===r-1)throw a;i&&await ki(i),n&&await ki(n(o+1))}throw new Error("unreachable")}var Al=!0,Ci="Invariant failed";function L(t,e){if(!t){if(Al)throw new Error(Ci);var r=typeof e=="function"?e():e,i=r?"".concat(Ci,": ").concat(r):Ci;throw new Error(i)}}function _i(t,e,r){return t.slice(0,r)+e}function Il({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=_i(n,o,a);let l=i[s]&&"text"in i[s]?i[s].text:"";i[s]={text:l?_i(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?_i(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 ar=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=Il({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 lr=class{#e;#t;#r=null;#i=new ar;isStreaming=!1;typingIndicator;toolCallIndicator;ranOutOfCredits=!1;get messages(){return this.#i.messages}set messages(e){this.#i.messages=e}conversationId="";#n=0;#s;isLiveMode=!1;get hasQueuedMessages(){return this.#o.length>0}constructor(e,r){this.#e=e,this.#t=r,this.#t.autoConnect!==!1&&(this.#r=this.initWS()),e.addController(this)}#o=[];#a(e,{expectStreaming:r=!1}={}){return this.ranOutOfCredits?!1:this.#r?this.#r.isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):this.#r.isConnected?(r&&!this.isLiveMode&&(this.isStreaming=!0,this.#e.requestUpdate()),this.#r.send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent",e),this.retry(),!1):(console.warn("WebSocket not initialized, message not sent",e),this.connect(),!1)}async enqueueMessage(e,{expectStreaming:r=!1}={}){if(this.#o.length>0){let i=this.#o[this.#o.length-1];if(e.type==="USER_INPUT"&&i.message.type==="USER_INPUT"&&e.value===i.message.value)return!0}return this.#r||this.connect(),this.#r?.isConnected?this.#a(e,{expectStreaming:r}):(this.#o.push({message:e,options:{expectStreaming:r}}),this.#e.requestUpdate(),this.#r&&!this.#r.isConnecting&&!this.#r.isConnected&&this.retry(),await Ls({times:5,delay:2e3},async()=>{if(this.#r?.isConnected){let i=[...this.#o];this.#o=[],this.#e.requestUpdate();let n=!1;for(let{message:s,options:o}of i){let a=this.#a(s,o);s===e&&(n=a)}return n}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),this.#o=[],this.#e.requestUpdate(),!1)))}async sendUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i},{expectStreaming:s})}async sendUserFeedback(e){return this.enqueueMessage({type:"USER_FEEDBACK",responses:e},{expectStreaming:!0})}sendFileDelete(e){L(e,"fileId is required"),this.enqueueMessage({type:"USER_FILE_DELETE",fileId:e}).catch(console.warn)}sendUserCancel(){this.enqueueMessage({type:"USER_CANCEL"}).catch(console.warn)}sendUserTypingStart(){this.#a({type:"USER_TYPING_START"})}sendUserTypingStop(){this.enqueueMessage({type:"USER_TYPING_STOP"}).catch(console.warn)}sendNewChat(){this.enqueueMessage({type:"NEW_CHAT"})}sendUserMeta(e){this.enqueueMessage({type:"USER_META",metadata:e}).catch(console.warn)}reloadConfig(){this.enqueueMessage({type:"RELOAD_CONFIG"}).catch(console.warn)}close(){this.#r?.close(1e3,"closed by user")}retry(){clearTimeout(this.#s),this.#s=setTimeout(()=>{this.#t.onReconnect?.(),this.#r=this.initWS()},1e3*this.#n),this.#n++}initWS(){return new or(this.#e,{url:()=>this.#t.url(this.conversationId,{}),onOpen:e=>this.#l(e),onMessage:e=>this.#d(JSON.parse(e.data)),onError:e=>this.#c(e),onClose:e=>this.#h(e)})}#l(e){this.#n=0}#d(e){switch(e.type){case"NEW_MESSAGE":{this.#i.onEvent(e),this.typingIndicator=void 0,this.toolCallIndicator=void 0,this.#t.onNewMessage?.(e.message),this.#t.persistConversationState?.(this.conversationId,this.messages),this.#e.requestUpdate();break}case"APPEND_MESSAGE":{let r=!this.#i.getMessage(e.message.id),i=this.#i.onEvent(e);i&&(this.typingIndicator=void 0,this.toolCallIndicator=void 0,r&&(this.#t.onNewMessage?.({id:i.id,timestamp:i.timestamp,role:i.role,content:i.content}),this.#t.persistConversationState?.(this.conversationId,this.messages)),this.#t.onMessageAppend?.(e),this.#e.requestUpdate());break}case"MESSAGE_DONE":{let r=this.#i.onEvent(e);if(!r)throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,this.#e.requestUpdate(),this.#t.onMessageDone?.(e,r),this.#t.persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate();break}case"ERROR":{this.#t.onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.#i.messages=e.messages,this.#t.onConnect?.(e.conversationId,e.metadata),this.#t.persistConversationState?.(e.conversationId,e.messages),this.isLiveMode=e.metadata.isLiveMode,this.#e.requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.toolCallIndicator=void 0,this.typingIndicator={role:e.role,metadata:e.metadata},this.#e.requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,this.#e.requestUpdate();break}case"TOOL_CALL_START":{this.typingIndicator=void 0,this.toolCallIndicator=e.text,this.#e.requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,this.#e.requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),this.#e.requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}}#c(e){console.error("onError",e),this.#t.onError?.(e)}#h(e){this.#e.isConnected&&this.#r&&!this.#r.isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate(),this.#t.onClose?.()}hostConnected(){this.conversationId=this.#t.restoreConversationState?.()?.conversationId||"",this.#i.messages=this.#t.restoreConversationState?.()?.messages||[]}reset(){this.#t.onReset?.(),this.#i.reset(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.conversationId="",this.isLiveMode=!1,this.#o=[],this.#e.requestUpdate()}hostDisconnected(){clearTimeout(this.#s)}connect(){this.#r||(this.#r=this.initWS())}reconnectSocket(){this.#r?.close(1e3,"destroy"),this.#r=this.initWS()}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}get isConnected(){return this.#r?.isConnected??!1}};var Ll=Symbol();var Ds=Object.getPrototypeOf,$i=new WeakMap,Dl=t=>t&&($i.has(t)?$i.get(t):Ds(t)===Object.prototype||Ds(t)===Array.prototype);var Ts=t=>Dl(t)&&t[Ll]||null,Si=(t,e=!0)=>{$i.set(t,e)};var Mi=t=>typeof t=="object"&&t!==null,Tl=t=>Mi(t)&&!Ai.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),Ps=(t,e)=>{let r=js.get(t);if(r?.[0]===e)return r[1];let i=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return Si(i,!0),js.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(Ai.has(s))Si(s,!1);else if(je.has(s)){let[l,c]=je.get(s);a.value=Ps(l,c())}Object.defineProperty(i,n,a)}),Object.preventExtensions(i)},jl=(t,e,r,i)=>({deleteProperty(n,s){let o=Reflect.get(n,s);r(s);let a=Reflect.deleteProperty(n,s);return a&&i(cr?.("delete",s,o)),a},set(n,s,o,a){let l=!t()&&Reflect.has(n,s),c=Reflect.get(n,s,a);if(l&&(Os(c,o)||ur.has(o)&&Os(c,ur.get(o))))return!0;r(s),Mi(o)&&(o=Ts(o)||o);let d=!je.has(o)&&Pl(o)?Ii(o):o;return e(s,d),Reflect.set(n,s,d,a),i(cr?.("set",s,o,c)),!0}});var je=new WeakMap,Ai=new WeakSet,js=new WeakMap,Ei=[1],ur=new WeakMap,Os=Object.is,Ol=(t,e)=>new Proxy(t,e),Pl=Tl,Ul=Ps,Rl=jl,cr;function Ii(t={}){if(!Mi(t))throw new Error("object required");let e=ur.get(t);if(e)return e;let r=Ei[0],i=new Set,n=(b,$=++Ei[0])=>{r!==$&&(s=r=$,i.forEach(y=>y(b,$)))},s=r,o=(b=Ei[0])=>(s!==b&&(s=b,l.forEach(([$])=>{let y=$[1](b);y>r&&(r=y)})),r),a=b=>($,y)=>{let k;$&&(k=[...$],k[1]=[b,...k[1]]),n(k,y)},l=new Map,c=(b,$)=>{let y=!Ai.has($)&&je.get($);if(y){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(b))throw new Error("prop listener already exists");if(i.size){let k=y[2](a(b));l.set(b,[y,k])}else l.set(b,[y])}},d=b=>{var $;let y=l.get(b);y&&(l.delete(b),($=y[1])==null||$.call(y))},h=b=>(i.add(b),i.size===1&&l.forEach(([y,k],E)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&k)throw new Error("remove already exists");let O=y[2](a(E));l.set(E,[y,O])}),()=>{i.delete(b),i.size===0&&l.forEach(([y,k],E)=>{k&&(k(),l.set(E,[y]))})}),f=!0,w=Rl(()=>f,c,d,n),p=Ol(t,w);ur.set(t,p);let S=[t,o,h];return je.set(p,S),Reflect.ownKeys(t).forEach(b=>{let $=Object.getOwnPropertyDescriptor(t,b);"value"in $&&$.writable&&(p[b]=t[b])}),f=!1,p}function dr(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 Ge(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 Ul(r,i())}var Ze=class{#e;#t;#r;#i=()=>{};constructor(e,r){this.#e=e,this.#t=r,this.#r=Ge(r),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#i(),this.#i=dr(this.#t,()=>{this.#r=Ge(this.#t),this.#e.requestUpdate()})}hostDisconnected(){this.#i()}};var ve=class{#e;#t;proxyObject;#r;#i=()=>{};constructor(e,r,i){this.#e=e,this.#t=i,this.proxyObject=Ii(r),this.#r=Ge(this.proxyObject),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#i(),this.#t?.subscribe&&(this.#i=dr(this.proxyObject,()=>{this.#r=Ge(this.proxyObject),this.#e.requestUpdate()}))}hostDisconnected(){this.#i()}};var hr=class{#e;#t;#r;#i=null;#n=null;constructor(e,{provider:r,tag:i,key:n}){this.#e=e,this.#t=i,this.#r=n,e.addController(this)}get value(){return this.#n?this.#n.value:null}hostConnected(){if(this.#n||(this.#i=Bl(this.#e,this.#t),!this.#i))return;let e=this.#i[this.#r]instanceof ve?this.#i[this.#r]:null;e&&(this.#n=new Ze(this.#e,e.proxyObject))}hostDisconnected(){}};function Bl(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 Li(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 _t=ui(ji(),1);var fr=class{#e;constructor({document:e}){this.#e=e}getCookies(){return(0,_t.parseCookie)(this.#e.cookie)||{}}getCookie(e){return this.getCookies()[e]||null}setCookie(e,r,i){if(L(typeof e=="string",`cookie name must be a string, got: ${typeof e}`),L(e,"cookie name must not be empty"),r==null){this.#e.cookie=(0,_t.stringifySetCookie)(e,"",{expires:new Date(0)});return}L(typeof r=="string",`value of cookie \`${e}\` must be a string, got: ${typeof r}`),this.#e.cookie=(0,_t.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 mr=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 $t=ui(ji(),1);function Oi({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,$t.stringifySetCookie)(n,"1",{domain:o,path:"/"}),(0,$t.parseCookie)(r.cookie)[n]==="1")return r.cookie=(0,$t.stringifySetCookie)(n,"",{domain:o,path:"/",expires:new Date(0)}),o}catch{continue}}return`.${i.slice(-2).join(".")}`}var Pi=class{#e;#t;#r;#i;constructor({window:e}){this.#e=e,this.#t=new fr({document:e.document}),this.#r=new mr({localStorage:e.localStorage}),this.#i=e.localStorage}get distinctID(){return this.#t.getCookie("molin_distinct_id")||this.#i.getItem("molin_distinct_id")}set distinctID(e){if(!e){this.#t.deleteCookie("molin_distinct_id"),this.#i.removeItem("molin_distinct_id");return}L(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:Oi({window:this.#e})})}catch(r){console.warn("Could not write distinct_id to cookie:",r)}try{this.#i.setItem("molin_distinct_id",e)}catch(r){console.warn("Could not write distinct_id to localStorage:",r)}}get widgetState(){return this.#r.getItem("molin_widget")}set widgetState(e){this.#r.setItem("molin_widget",e)}get popupState(){return this.#r.getItem("molin_popup")}set popupState(e){this.#r.setItem("molin_popup",e)}get disclaimerDismissed(){return this.#r.getItem("molin_disclaimer_dismissed")??!1}set disclaimerDismissed(e){this.#r.setItem("molin_disclaimer_dismissed",e)}getConversationId(e){L(typeof e=="string","widgetId must be a string"),L(e,"widgetId must not be empty");let r=`molin_${e}_conversation_id`;return this.#t.getCookie(r)||this.#i.getItem(r)}setConversationId(e,r){L(typeof e=="string","widgetId must be a string"),L(e,"widgetId must not be empty");let i=`molin_${e}_conversation_id`;if(!r){this.#t.deleteCookie(i),this.#i.removeItem(i);return}L(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:Oi({window:this.#e})})}catch(n){console.warn(`Could not write ${i} to cookie:`,n)}try{this.#i.setItem(i,r)}catch(n){console.warn(`Could not write ${i} to localStorage:`,n)}}getConversationState(e){L(typeof e=="string","widgetId must be a string"),L(e,"widgetId must not be empty");let r=`molin_${e}_conversation`;return this.#r.getItem(r)}setConversationState(e,r){L(typeof e=="string","widgetId must be a string"),L(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 Pi({window});var qs=()=>{if(window.Shopify)try{return{customerId:Zl()}}catch{return null}return null},Zl=()=>{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 Ns(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function Xe(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 Hs(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 zs=()=>{if(window.ShopRenter)try{let t=Jl();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},Jl=()=>{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}}},Ws=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=Ns(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 Gs=()=>{if(window.UNAS)try{let t=window.UNAS.customer;return{customerEmail:t?.email,customerId:t?.id}}catch(t){return console.error("Error fetching customer information:",t),null}return null},Zs=async()=>new Promise((t,e)=>{try{window.UNAS.getCart(r=>{let n=r.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));t(n)})}catch(r){console.error("Error fetching cart information:",r),e(r)}});var Ui;function Js(t){return{lang:t?.lang??Ui?.lang,message:t?.message,abortEarly:t?.abortEarly??Ui?.abortEarly,abortPipeEarly:t?.abortPipeEarly??Ui?.abortPipeEarly}}var Ql;function ec(t){return Ql?.get(t)}var tc;function rc(t){return tc?.get(t)}var ic;function nc(t,e){return ic?.get(t)?.get(e)}function Ys(t){let e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function G(t,e,r,i,n){let s=n&&"input"in n?n.input:r.value,o=n?.expected??t.expects??null,a=n?.received??Ys(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??nc(t.reference,l.lang)??(c?rc(l.lang):null)??i.message??ec(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 Z(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Js())}}}function sc(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Ks(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var oc=/^\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 Ri(t){return{kind:"validation",type:"iso_timestamp",reference:Ri,async:!1,expects:null,requirement:oc,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&G(this,"timestamp",e,r),e}}}function Bi(t,e){return{kind:"validation",type:"max_length",reference:Bi,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(r,i){return r.typed&&r.value.length>this.requirement&&G(this,"length",r,i,{received:`${r.value.length}`}),r}}}function Fi(t,e){return{kind:"validation",type:"min_length",reference:Fi,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,i){return r.typed&&r.value.length<this.requirement&&G(this,"length",r,i,{received:`${r.value.length}`}),r}}}function qi(t){return{kind:"transformation",type:"to_date",reference:qi,async:!1,message:t,"~run"(e,r){try{e.value=new Date(e.value),isNaN(e.value)&&(G(this,"date",e,r,{received:'"Invalid Date"'}),e.typed=!1)}catch{G(this,"date",e,r),e.typed=!1}return e}}}function Vi(t){return{kind:"transformation",type:"transform",reference:Vi,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function Qs(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function K(t,e){return{...t,fallback:e,get"~standard"(){return Z(this)},"~run"(r,i){let n=t["~run"](r,i);return n.issues?{typed:!0,value:Qs(this,n,i)}:n}}}function Ni(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 Z(this)},"~run"(t){return t.typed=!0,t}}}function Je(t,e){return{kind:"schema",type:"array",reference:Je,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return Z(this)},"~run"(r,i){let n=r.value;if(Array.isArray(n)){r.typed=!0,r.value=[];for(let s=0;s<n.length;s++){let o=n[s],a=this.item["~run"]({value:o},i);if(a.issues){let l={type:"array",origin:"value",input:n,key:s,value:o};for(let c of a.issues)c.path?c.path.unshift(l):c.path=[l],r.issues?.push(c);if(r.issues||(r.issues=a.issues),i.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value.push(a.value)}}else G(this,"type",r,i);return r}}}function Hi(t){return{kind:"schema",type:"boolean",reference:Hi,expects:"boolean",async:!1,message:t,get"~standard"(){return Z(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:G(this,"type",e,r),e}}}function zi(t){return{kind:"schema",type:"null",reference:zi,expects:"null",async:!1,message:t,get"~standard"(){return Z(this)},"~run"(e,r){return e.value===null?e.typed=!0:G(this,"type",e,r),e}}}function gr(t,e){return{kind:"schema",type:"nullish",reference:gr,expects:`(${t.expects} | null | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return Z(this)},"~run"(r,i){return(r.value===null||r.value===void 0)&&(this.default!==void 0&&(r.value=Ni(this,r,i)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function wr(t){return{kind:"schema",type:"number",reference:wr,expects:"number",async:!1,message:t,get"~standard"(){return Z(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:G(this,"type",e,r),e}}}function V(t,e){return{kind:"schema",type:"object",reference:V,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return Z(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]:Ni(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]=Qs(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(G(this,"key",r,i,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:n,key:s,value:n[s]}]}),i.abortEarly))break}}else G(this,"type",r,i);return r}}}function A(t,e){return{kind:"schema",type:"optional",reference:A,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return Z(this)},"~run"(r,i){return r.value===void 0&&(this.default!==void 0&&(r.value=Ni(this,r,i)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function Et(t,e){return{kind:"schema",type:"picklist",reference:Et,expects:Ks(t.map(Ys),"|"),async:!1,options:t,message:e,get"~standard"(){return Z(this)},"~run"(r,i){return this.options.includes(r.value)?r.typed=!0:G(this,"type",r,i),r}}}function Mt(t,e,r){return{kind:"schema",type:"record",reference:Mt,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return Z(this)},"~run"(i,n){let s=i.value;if(s&&typeof s=="object"){i.typed=!0,i.value={};for(let o in s)if(sc(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 h of l.issues)h.path=[d],i.issues?.push(h);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 h of c.issues)h.path?h.path.unshift(d):h.path=[d],i.issues?.push(h);if(i.issues||(i.issues=c.issues),n.abortEarly){i.typed=!1;break}}(!l.typed||!c.typed)&&(i.typed=!1),l.typed&&(i.value[l.value]=c.value)}}else G(this,"type",i,n);return i}}}function _(t){return{kind:"schema",type:"string",reference:_,expects:"string",async:!1,message:t,get"~standard"(){return Z(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:G(this,"type",e,r),e}}}function Xs(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function yr(t,e){return{kind:"schema",type:"union",reference:yr,expects:Ks(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return Z(this)},"~run"(r,i){let n,s,o;for(let a of this.options){let l=a["~run"]({value:r.value},i);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{n=l;break}else o?o.push(l):o=[l]}if(n)return n;if(s){if(s.length===1)return s[0];G(this,"type",r,i,{issues:Xs(s)}),r.typed=!0}else{if(o?.length===1)return o[0];G(this,"type",r,i,{issues:Xs(o)})}return r}}}function eo(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 Z(this)}}}function Ye(...t){return{...t[0],pipe:t,get"~standard"(){return Z(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 me(t,e,r){let i=t["~run"]({value:e},Js(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var to=Mt(_(),yr([_(),wr(),Hi(),zi()])),ro=Ye(_(),Fi(1),Bi(5e3)),io=()=>{try{return window.UNAS?Gs():window.Shopify?qs():window.ShopRenter?zs():null}catch{return null}},no=async()=>{try{return window.UNAS?await Zs():window.Shopify?await Vs():window.ShopRenter?await Ws():[]}catch{return[]}},Ke={schema:V({conversationId:A(_()),messages:A(Je(V({id:_(),timestamp:wr(),role:Et(["user","assistant","support"]),content:_(),parts:A(Je(yr([V({text:_()}),V({html:_()}),V({tag:_(),data:Mt(_(),St())})])))})))}),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?me(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 Qe=class t extends v{static properties={widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object},autoConnect:{type:Boolean}};contextCtrl;constructor(){super(),this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.autoConnect=!1,this.contextCtrl=new ve(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,toolCallIndicator:void 0,ranOutOfCredits:!1,isLiveMode:!1,lastMsg:void 0,hasQueuedMessages:!1,isConnected:()=>this.#n.isConnected,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),sendNewChat:this.sendNewChat.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),sendUserFeedback:this.sendUserFeedback.bind(this),connect:this.connect.bind(this),sendFileDelete:this.#n.sendFileDelete.bind(this.#n)})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.autoConnect&&this.#n.connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:this.#t,xCustomInstructions:this.#r,conversationId:this.#n.conversationId,messages:this.#e,isStreaming:this.#n.isStreaming,typingIndicator:this.#n.typingIndicator,toolCallIndicator:this.#n.toolCallIndicator,ranOutOfCredits:this.#n.ranOutOfCredits,isLiveMode:this.#n.isLiveMode,lastMsg:this.#n.lastMsg,hasQueuedMessages:this.#n.hasQueuedMessages,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),sendUserFeedback:this.sendUserFeedback.bind(this),connect:this.connect.bind(this),sendFileDelete:this.#n.sendFileDelete.bind(this.#n)}),this.#s()}get#e(){return this.#n?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:this.#n?.messages||[]}#t;#r;#i=null;get#n(){return this.#i||(this.#i=new lr(this,{autoConnect:this.autoConnect,url:e=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("conversationId",e),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:e=>{console.error("ws error",e)},onClose:()=>{},onNewMessage:e=>{e.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:e,conversationId:this.#n.conversationId})},onMessageAppend:e=>{},onMessageDone:(e,r)=>{r.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,conversationId:this.#n.conversationId})},onMessageError:e=>{console.error("ws message error",e),e.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+e.message})},onReset:()=>{Ke.reset(this.widgetId)},onConnect:(e,r)=>{let i=io();this.#n.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),no().then(n=>{n?.length>0&&this.#n.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,cart:n,language:window.navigator.language})}).catch(n=>{console.error(n)}),this.dispatchEvent(new t.ConnectedEvent({conversationId:e,metadata:r,widgetId:this.widgetId,pendingImages:r?.pendingImages||[]}))},persistConversationState:(e,r)=>{Ke.persist(this.widgetId,e,r)},restoreConversationState:()=>Ke.restore(this.widgetId)})),this.#i}#s(){function e(i){if(!i)return;let n;try{n=typeof i=="object"?i:JSON.parse(i)}catch(o){console.error("Molin: user-data is not valid JSON",o);return}if(!n||typeof n!="object"||Object.keys(n).length===0)return;let s=me(to,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=me(ro,i);if(!n.success){console.error("Molin: custom-instructions does not pass schema validation",n.issues);return}return n.output}this.#t=e(this.xUserData),this.#r=r(this.xCustomInstructions)}async sendUserInput(e,r={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...r},n=await this.#n.sendUserInput(e,i);return n&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!1,conversationId:this.#n.conversationId}),n}async enqueueUserInput(e,r={}){e.length>1e3&&(console.error("Message exceeds max length of 1000 characters, trimming"),e=Li(e,1e3)),this.#e.some(o=>o.role==="assistant"&&o.parts?.some(a=>"tag"in a&&a.tag==="request-input-v1"&&"data"in a&&a.data.type==="new-conversation-button"))&&(this.sendNewChat(),this.reset());let s={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...r};return this.#n.enqueueUserInput(e,s)}async sendUserFeedback(e){return this.#n.sendUserFeedback(e)}sendUserCancel(){this.#n.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){this.#n.sendUserTypingStart()}sendUserTypingStop(){this.#n.sendUserTypingStop()}sendNewChat(){this.#n.sendNewChat()}reset(){this.#n.reset()}reloadConfig(){this.#n.reloadConfig()}connect(){this.#n.connect()}render(){return u`<slot></slot>`}};function so(t){let e=new hr(t,{provider:Qe,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,i){if(i==="value")return e.value}})}Qe.ConnectedEvent=class extends CustomEvent{static type="mw-context-widget:connected";constructor(e,r={}){super(Qe.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-context-widget")||customElements.define("mw-context-widget",Qe);function tn(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function ac(t,e=","){return t.map(tn).join(e)}var po=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function vr(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 kr(t,e="@media "){return e+D(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(i=>`(${i}-width:${r[i]})`).join(" and "))).join(",")}function D(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function oo(t){return t}function Cr(){}var F={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function fo(t){return t.match(/[-=:;]/g)?.length||0}function Ji(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(fo(t),15)<<18}var lc=["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 rn({n:t,i:e,v:r=[]},i,n,s){t&&(t=tn({n:t,i:e,v:r})),s=[...D(s)];for(let a of r){let l=i.theme("screens",a);for(let c of D(l&&kr(l)||i.v(a))){var o;s.push(c),n|=l?67108864|Ji(c):a=="dark"?1073741824:c[0]=="@"?Ji(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~lc.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:n,r:s,i:e}}var mo=new Map;function Yi(t){if(t.d){let e=[],r=Wi(t.r.reduce((i,n)=>n[0]=="@"?(e.push(n),i):n?Wi(i,s=>Wi(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):Gi(s,o)}return Gi(o,s)})):i,"&"),i=>Gi(i,t.n?"."+po(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,n)=>n+"{"+i+"}",t.d)}}function Wi(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,i,n)=>e(i)+n)}function Gi(t,e){return t.replace(/&/g,e)}var ao=new Intl.Collator("en",{numeric:!0});function go(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||ao.compare(lo(t.n),lo(e.n))||ao.compare(co(t.n),co(e.n))}function lo(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function co(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Zi(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(${[Zi(t.substr(1,s),o),Zi(t.substr(1+s,s),o),Zi(t.substr(1+2*s,s),o),n]})`}return n=="1"?t:n=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function yo(t,e,r,i,n=[]){return(function s(o,{n:a,p:l,r:c=[],i:d},h){let f=[],w="",p=0,S=0;for(let y in o||{}){var b,$;let k=o[y];if(y[0]=="@"){if(!k)continue;if(y[1]=="a"){f.push(...sn(a,l,xr(""+k),h,l,c,d,!0));continue}if(y[1]=="l"){for(let E of D(k))f.push(...s(E,{n:a,p:(b=F[y[7]],l&~F.o|b),r:y[7]=="d"?[]:c,i:d},h));continue}if(y[1]=="i"){f.push(...D(k).map(E=>({p:-1,o:0,r:[],d:y+" "+E})));continue}if(y[1]=="k"){f.push({p:F.d,o:0,r:[y],d:s(k,{p:F.d},h).map(Yi).join("")});continue}if(y[1]=="f"){f.push(...D(k).map(E=>({p:F.d,o:0,r:[y],d:s(E,{p:F.d},h).map(Yi).join("")})));continue}}if(typeof k!="object"||Array.isArray(k))y=="label"&&k?a=k+vr(JSON.stringify([l,d,o])):(k||k===0)&&(y=y.replace(/[A-Z]/g,E=>"-"+E.toLowerCase()),S+=1,p=Math.max(p,($=y)[0]=="-"?0:fo($)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test($)?+!!RegExp.$1||-!!RegExp.$2:0)+1),w+=(w?";":"")+D(k).map(E=>h.s(y,nn(""+E,h.theme)+(d?" !important":""))).join(";"));else if(y[0]=="@"||y.includes("&")){let E=l;y[0]=="@"&&(y=y.replace(/\bscreen\(([^)]+)\)/g,(O,B)=>{let H=h.theme("screens",B);return H?(E|=67108864,kr(H,"")):O}),E|=Ji(y)),f.push(...s(k,{n:a,p:E,r:[...c,y],i:d},h))}else f.push(...s(k,{p:l,r:[...c,y]},h))}return f.unshift({n:a,p:l,o:Math.max(0,15-S)+1.5*Math.min(p||15,15),r:c,d:w}),f.sort(wo)})(t,rn(e,r,i,n),r)}function nn(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,i,n,s,o="")=>{let a=e(n,o);return typeof a=="function"&&/color|fill|stroke/i.test(n)?te(a):""+D(a).filter(l=>Object(l)!==l)})}function vo(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 br(t,e,r=F.u,i,n){let s=[];for(let o of t)for(let a of(function(l,c,d,h,f){l={...l,i:l.i||f};let w=(function(p,S){let b=mo.get(p.n);return b?b(p,S):S.r(p.n,p.v[0]=="dark")})(l,c);return w?typeof w=="string"?({r:h,p:d}=rn(l,c,d,h),vo(br(xr(w),c,d,h,l.i),l.n)):Array.isArray(w)?w.map(p=>{var S,b;return{o:0,...p,r:[...D(h),...D(p.r)],p:(S=d,b=p.p??d,S&~F.o|b)}}):yo(w,l,c,d,h):[{c:tn(l),p:0,o:0,r:[]}]})(o,e,r,i,n))s.splice(go(s,a),0,a);return s}function sn(t,e,r,i,n,s,o,a){return vo((a?r.flatMap(l=>br([l],i,n,s,o)):br(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}=rn(s,o,e);return r&&sn(a,e,r,o,l,c,d,i)},mo.set(t,n),t}function Xi(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(uc),i:n}))}}function uc(t,e,r){return r.indexOf(t)==e}var uo=new Map;function xr(t){let e=uo.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&&Xi(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 h=r[d-1];if(/[~@]$/.test(h)){let f=i.shift();r.length=d,Xi([...r,"#"],i);let{v:w}=i[0].pop();for(let p of f)p.v.splice(+(p.v[0]=="dark")-+(w[0]=="dark"),w.length);Xi([...r,cc(h.length>1?h.slice(0,-1)+vr(JSON.stringify([h,f])):h+"("+ac(f)+")",F.a,f,/@$/.test(h))],i)}d=r.lastIndexOf("(",d-1)}r.length=d+1}else/[~@]/.test(c)&&t[a+1]=="("&&i.unshift([])}l(!0),uo.set(t,e=i[0])}return e}function m(t,e,r){return[t,Ki(e,r)]}function Ki(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,i)=>({[t]:e?e(r,i):Qi(r,1)}):r=>t||{[r[1]]:Qi(r,2)}}function Qi(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,on(e,r,i)]}function on(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=bo(t||n[1]),a=s.theme(o,n.$$)??le(n.$$,o,s);if(a!=null)return n._=Qi(n,0,a),i(n,s,o)}}function q(t,e={},r){return[t,dc(e,r)]}function dc(t={},e){return(r,i)=>{let{section:n=bo(r[0]).replace("-","")+"Color"}=t,[s,o]=hc(r.$$);if(!s)return;let a=i.theme(n,s)||le(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:h}=t,f=i.theme(c,o||"DEFAULT")||o&&le(o,c,i),w=e||(({_:S})=>{let b=At(d,S);return h?{[h]:b}:b});r._={value:te(a,{opacityVariable:l||void 0,opacityValue:f||void 0}),color:S=>te(a,S),opacityVariable:l||void 0,opacityValue:f||void 0};let p=w(r,i);if(!r.dark){let S=i.d(n,s,a);S&&S!==a&&(r._={value:te(S,{opacityVariable:l||void 0,opacityValue:f||"1"}),color:b=>te(S,b),opacityVariable:l||void 0,opacityValue:f||void 0},p={"&":p,[i.v("dark")]:w(r,i)})}return p}}function hc(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function At(t,e){let r={};return typeof e=="string"?r[t]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(r[e.opacityVariable]=e.opacityValue||"1"),r[t]=e.value),r}function le(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=et(nn(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 bo(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function et(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",i,n="")=>et(r)+i+et(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 It({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:D(e.variants),rules:D(e.rules),ignorelist:D(e.ignorelist),hash:void 0,stringify:(i,n)=>i+":"+n,finalize:[]};for(let i of D([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&D(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:n,darkMode:s=r.darkMode,darkColor:o=r.darkColor,theme:a,variants:l,rules:c,ignorelist:d,hash:h=r.hash,stringify:f=r.stringify,finalize:w}=typeof i=="function"?i(r):i;r={preflight:r.preflight!==!1&&n!==!1&&[...r.preflight,...D(n)],darkMode:s,darkColor:o,theme:{...r.theme,...a,extend:{...r.theme.extend,...a?.extend}},variants:[...r.variants,...D(l)],rules:[...r.rules,...D(c)],ignorelist:[...r.ignorelist,...D(d)],hash:h,stringify:f,finalize:[...r.finalize,...D(w)]}}return r}function ho(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 pc(t){var e;return en(t[0],typeof(e=t[1])=="function"?e:()=>e)}function fc(t){var e,r;return Array.isArray(t)?en(t[0],Ki(t[1],t[2])):en(t,Ki(e,r))}function en(t,e){return xo(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 xo(t,e){let r=D(t).map(mc);return(i,n,s)=>{for(let o of r){let a=e(i,o,n,s);if(a)return a}}}function mc(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function ko(t,e){let r=It(t),i=(function({theme:l,darkMode:c,darkColor:d=Cr,variants:h,rules:f,hash:w,stringify:p,ignorelist:S,finalize:b}){let $=new Map,y=new Map,k=new Map,E=new Map,O=xo(S,(I,z)=>z.test(I));h.push(["dark",Array.isArray(c)||c=="class"?`${D(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let B=typeof w=="function"?I=>w(I,vr):w?vr:oo;B!==oo&&b.push(I=>({...I,n:I.n&&B(I.n),d:I.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(z,J)=>"--"+B(J).replace("#",""))}));let H={theme:(function({extend:I={},...z}){let J={},ci={get colors(){return Se("colors")},theme:Se,negative(){return{}},breakpoints(U){let W={};for(let Y in U)typeof U[Y]=="string"&&(W["screen-"+Y]=U[Y]);return W}};return Se;function Se(U,W,Y,mt){if(U){if({1:U,2:mt}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(U)||[,U],/[.[]/.test(U)){let he=[];U.replace(/\[([^\]]+)\]|([^.[]+)/g,(Me,wt,ul=wt)=>he.push(ul)),U=he.shift(),Y=W,W=he.join("-")}let oe=J[U]||Object.assign(Object.assign(J[U]={},Xt(z,U)),Xt(I,U));if(W==null)return oe;W||(W="DEFAULT");let Ee=oe[W]??W.split("-").reduce((he,Me)=>he?.[Me],oe)??Y;return mt?te(Ee,{opacityValue:nn(mt,Se)}):Ee}let gt={};for(let oe of[...Object.keys(z),...Object.keys(I)])gt[oe]=Se(oe);return gt}function Xt(U,W){let Y=U[W];return typeof Y=="function"&&(Y=Y(ci)),Y&&/color|fill|stroke/i.test(W)?(function mt(gt,oe=[]){let Ee={};for(let he in gt){let Me=gt[he],wt=[...oe,he];Ee[wt.join("-")]=Me,he=="DEFAULT"&&(wt=oe,Ee[oe.join("-")]=Me),typeof Me=="object"&&Object.assign(Ee,mt(Me,wt))}return Ee})(Y):Y}})(l),e:po,h:B,s(I,z){return p(I,z,H)},d(I,z,J){return d(I,z,H,J)},v(I){return $.has(I)||$.set(I,ho(I,h,y,pc,H)||"&:"+I),$.get(I)},r(I,z){let J=JSON.stringify([I,z]);return k.has(J)||k.set(J,!O(I,H)&&ho(I,f,E,fc,H,z)),k.get(J)},f(I){return b.reduce((z,J)=>J(z,H),I)}};return H})(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=Yi(c);if(d&&!o.has(d)){o.add(d);let h=go(s,l);e.insert(d,h,l),s.splice(h,0,l)}return c.n}return Object.defineProperties(function(c){if(!n.size)for(let h of D(r.preflight))typeof h=="function"&&(h=h(i)),h&&(typeof h=="string"?sn("",F.b,xr(h),i,F.b,[],!1,!0):yo(h,{},i,F.b)).forEach(a);c=""+c;let d=n.get(c);if(!d){let h=new Set;for(let f of br(xr(c),i))h.add(f.c).add(a(f));d=[...h].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),h=[...s];return()=>{l(),o=c,n=d,s=h}},clear(){e.clear(),o=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function gc(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function Co(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&&gc(o,s=t(o))&&n.setAttribute("class",s)}}function wc(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 _r(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:wc(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:Cr}}var yc=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 _o(t){return yc.get(t)}function $o(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 So(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 vc=[["-webkit-",1],["-moz-",2],["-ms-",4]];function $r(){return({stringify:t})=>({stringify(e,r,i){let n="",s=_o(e);s&&(n+=t(s,r,i)+";");let o=$o(e),a=So(e,r);for(let l of vc)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 Sr(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",on("lineClamp",({_:t})=>Eo(t))],["line-clamp-(\\d+)",({1:t})=>Eo(t)]]}}function Eo(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var Dt={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",...Q(4,"rem",4,.5,.5),...Q(12,"rem",4,5),14:"3.5rem",...Q(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:M("blur"),backdropBrightness:M("brightness"),backdropContrast:M("contrast"),backdropGrayscale:M("grayscale"),backdropHueRotate:M("hueRotate"),backdropInvert:M("invert"),backdropOpacity:M("opacity"),backdropSaturate:M("saturate"),backdropSepia:M("sepia"),backgroundColor:M("colors"),backgroundImage:{none:"none"},backgroundOpacity:M("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:{...Q(200,"",100,0,50),...Q(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:M("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:M("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:M("colors"),caretColor:M("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...Q(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:M("borderColor"),divideOpacity:M("borderOpacity"),divideWidth:M("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"),...Lt(2,6),...Lt(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:M("spacing"),gradientColorStops:M("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"),...Lt(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...Lt(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:{...Q(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:{...Q(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:M("spacing"),placeholderColor:M("colors"),placeholderOpacity:M("opacity"),outlineColor:M("colors"),outlineOffset:re(8,"px"),outlineWidth:re(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:M("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:Q(200,"",100,0,50),scale:{...Q(150,"",100,0,50),...Q(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:M("spacing"),scrollPadding:M("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...re(2,"deg"),...re(12,"deg",3)},space:M("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:Q(2),textColor:M("colors"),textDecorationColor:M("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...re(8,"px")},textUnderlineOffset:{auto:"auto",...re(8,"px")},textIndent:M("spacing"),textOpacity:M("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:M("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"),...Lt(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:{...Q(50,"",1,0,10),auto:"auto"}};function Lt(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 Q(t,e="",r=1,i=0,n=1,s={}){for(;i<=t;i+=n)s[i]=i/r+e;return s}function M(t){return({theme:e})=>e(t)}var Mo={"*,::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, ${Dt.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, ${Dt.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 jo=[m("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:le(`[${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[kr(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",Er),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",Ao),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",To),g("col-","gridColumn"),m("col-(span)-(\\d+)","gridColumn",Do),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",To),g("row-","gridRow"),m("row-(span)-(\\d+)","gridRow",Do),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=>Er(Ao(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",Io),m("(content|items|self)-",t=>({["align-"+t[1]]:Io(t)})),m("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),g("p([xytrbl])?(?:$|-)","padding",tt("padding")),g("-?m([xytrbl])?(?:$|-)","margin",tt("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=D(t))[1]=="string"?{fontFamily:se(t)}:{fontFamily:se(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)",...xe({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),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 ${Pe(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",Er),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-${Pe(r[0])}-radius`]:e,[`border-${Pe(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})=>({...xe({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(t||"-x")]:e,["--tw-border-spacing"+(t||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),q("border-([xytrbl])-",{section:"borderColor"},tt("border","Color")),q("border-"),g("border-([xytrbl])(?:$|-)","borderWidth",tt("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-${Pe(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${Pe(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})=>({...xe({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":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})=>({...xe({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":se(t),"--tw-shadow-colored":se(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:se(t),transitionTimingFunction:t._=="none"?void 0:se(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:se(e("transitionDuration",""))})),g("duration(?:$|-)","transitionDuration","transitionDuration",se),g("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",se),g("delay(?:$|-)","transitionDelay","transitionDelay",se),g("animate(?:$|-)","animation",(t,{theme:e,h:r,e:i})=>{let n=se(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",ln),m("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":Oo(t=="gpu")})),g("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...ln()})),g("-?(rotate)-","rotate",an),g("-?(translate-[xy])-","translate",an),g("-?(skew-[xy])-","skew",an),m("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Er),"(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})=>({...xe({"--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",tt("scroll-padding")),g("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",tt("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})=>({...xe({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":r?"pan-y":t}`]:t,"touch-action":"var(--tw-touch-action)"})),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 Er(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function Ao(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function Pe(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 se(t){return t&&""+(t._||t)}function Io({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function tt(t,e=""){return({1:r,_:i})=>{let n={x:"lr",y:"tb"}[r]||r+r;return n?{...At(t+"-"+Pe(n[0])+e,i),...At(t+"-"+Pe(n[1])+e,i)}:At(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={...xe(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}`]:D(s).map(o=>`${i}(${o})`).join(" "),...r})))]}function an({1:t,_:e}){return{["--tw-"+t]:e,...ln()}}function ln(){return{...xe({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":Oo()}),transform:"var(--tw-transform)"}}function Oo(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 Do({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function To({1:t}){return`repeat(${t},minmax(0,1fr))`}function xe(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var Po=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:t})=>`@media (orientation:${t})`],["contrast-(more|less)",({1:t})=>`@media (prefers-contrast:${t})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:t})=>`&::${t}`],["(marker|selection)",({1:t})=>`& *::${t},&::${t}`],["file","&::file-selector-button"],["(first|last|only)",({1:t})=>`&:${t}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:t,$$:e},r)=>e&&`&[${t}-${r.theme(t,e)||le(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:i="",6:n=e},{e:s,h:o,v:a})=>{let l=et(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)||le(t,"",e)),t)return t.includes(":")||(t+=":var(--tw)"),/^\w*\s*\(/.test(t)||(t=`(${t})`),`@supports ${t.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:t},e)=>{if(t&&(t=e.theme("screens",t)||le(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=le(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&et(t).replace(/[}]+$/,"").split("{")]];function Uo({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:Mo,theme:{...Dt,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:Po,rules:jo,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 bc={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},xc={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},kc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Cc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},_c={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},$c={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Sc={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Ec={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Mc={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Ac={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Ic={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Lc={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Dc={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Tc={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"},Oc={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Pc={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Uc={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},Rc={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},Bc={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},Fc={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},qc={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Ro={__proto__:null,slate:bc,gray:xc,zinc:kc,neutral:Cc,stone:_c,red:$c,orange:Sc,amber:Ec,yellow:Mc,lime:Ac,green:Ic,emerald:Lc,teal:Dc,cyan:Tc,sky:jc,blue:Oc,indigo:Pc,violet:Uc,purple:Rc,fuchsia:Bc,pink:Fc,rose:qc};function Mr({disablePreflight:t}={}){return Uo({colors:Ro,disablePreflight:t})}function Ar({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)=>qo(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=Fo(o.theme("fontSize",s));return a&&{"@layer components":a}}],[t+"-",({$$:s},o)=>n(s,o)],[t,(s,o)=>({...n(e,o),"@layer base":[Bo(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:C(20,16),marginBottom:C(20,16),paddingLeft:C(26,16)},li:{marginTop:C(8,16),marginBottom:C(8,16)},"ol>li,ul>li":{paddingLeft:C(6,16)},">ul>li p":{marginTop:C(12,16),marginBottom:C(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:C(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:C(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:C(12,16),marginBottom:C(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:C(48,16),marginBottom:C(48,16)},blockquote:{marginTop:C(32,20),marginBottom:C(32,20),paddingLeft:C(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:C(20,16),marginBottom:C(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:C(36,16),marginTop:"0",marginBottom:C(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:C(24,16),marginTop:C(48,24),marginBottom:C(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:C(20,16),marginTop:C(32,20),marginBottom:C(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:C(24,16),marginBottom:C(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:C(32,16),marginBottom:C(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:C(14,16),lineHeight:"1.4",marginTop:C(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:C(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:C(21,24)},"h3 code":{fontSize:C(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:C(14,16),lineHeight:"1.7",marginTop:C(24,14),marginBottom:C(24,14),borderRadius:"0.375rem",paddingTop:C(12,14),paddingRight:C(16,14),paddingBottom:C(12,14),paddingLeft:C(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:C(32,16),marginBottom:C(32,16),fontSize:C(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:C(8,14),paddingBottom:C(8,14),paddingLeft:C(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:C(8,14),paddingRight:C(8,14),paddingBottom:C(8,14),paddingLeft:C(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:C(20,16),lineHeight:"1.6",marginTop:C(24,20),marginBottom:C(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Bo(t,o,r)],"@layer components":{...Fo(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,o){let a={},l={},c=(d,h,f)=>{let w=o.theme(`colors.${s}.${h}`,h);f["--tw-prose-"+d]=te(w);let p=f!=l&&o.d("colors",`${s}-${h}`,w);p&&(l["--tw-prose-"+d]=te(p))};for(let d in i){let h=i[d];d!="dark"&&h&&c(d,h,a)}for(let d in i.dark||{}){let h=i.dark[d];h&&(i.dark?c("invert-"+d,h,a):c(d,h,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function Bo(t,e,r){let i={};for(let n in r)i[qo(t,n,e,s=>`.${e.e(e.h(t))}${s}`)]=r[n];return i}function qo(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 Fo(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function C(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var cn=It({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:[Mr(),$r(),Sr(),Ar()]});function Ir(t,e=!0){let r=(function(){if(Vc)try{let l=_r(new CSSStyleSheet);return l.connect=c=>{let d=un(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,l.target]},l.disconnect=Cr,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[_r(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 h=this.target.cssRules[c];o.forEach((f,w)=>w&&f.target.insertRule(h.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");un(l).appendChild(c);let d=_r(c),{cssRules:h}=this.target;for(let f=0;f<h.length;f++)d.target.insertRule(h[f].cssText,f);o.push(d),a.set(l,d)},disconnect(l){let c=o.indexOf(a.get(l));c>=0&&o.splice(c,1)}}})(),i=ko({...t,hash:t.hash??e},r),n=Co(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),n.observe(un(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var Vc=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function un(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var x=t=>Ir(cn)(t);var dn=class extends x(v){static properties={color:{type:String},radius:{type:String},size:{type:String},border:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=j`
145
145
  :host {
146
146
  display: block;
147
147
  }
@@ -181,7 +181,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
181
181
  <slot></slot>
182
182
  </div>
183
183
  </div>
184
- `}};customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",ci);var ui=class extends x(v){static properties={state:{type:String},color:{type:String},bubbleStyle:{type:String},src:{type:String},width:{type:String},height:{type:String}};static styles=j`
184
+ `}};customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",dn);var hn=class extends x(v){static properties={state:{type:String},color:{type:String},bubbleStyle:{type:String},src:{type:String},width:{type:String},height:{type:String}};static styles=j`
185
185
  .shadow-button {
186
186
  box-shadow:
187
187
  -58.9194px 74.8436px 38.218px rgba(0, 0, 0, 0.01),
@@ -189,7 +189,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
189
189
  -14.3318px 19.109px 23.8863px rgba(0, 0, 0, 0.09),
190
190
  -3.18483px 4.77725px 12.7393px rgba(0, 0, 0, 0.1);
191
191
  }
192
- `;constructor(){super(),this.state="open",this.color="#601feb",this.bubbleStyle="solid",this.src="",this.width="64px",this.height="64px"}get iconColor(){return this.bubbleStyle==="solid"?"#ffffff":this.color}get backgroundColor(){return this.bubbleStyle==="solid"?this.color:"#ffffff"}get svgSize(){let e=parseFloat(this.width),r=parseFloat(this.height),i=Math.min(e,r)*.55,s=i,o=i/1.65;return{width:s,height:o}}get dynamicRadius(){let e=parseFloat(this.width),r=parseFloat(this.height);return`${Math.min(e,r)*.265}px`}render=()=>u`
192
+ `;constructor(){super(),this.state="open",this.color="#601feb",this.bubbleStyle="solid",this.src="",this.width="64px",this.height="64px"}get iconColor(){return this.bubbleStyle==="solid"?"#ffffff":this.color}get backgroundColor(){return this.bubbleStyle==="solid"?this.color:"#ffffff"}get svgSize(){let e=parseFloat(this.width),r=parseFloat(this.height),n=Math.min(e,r)*.55,s=n,o=n/1.65;return{width:s,height:o}}get dynamicRadius(){let e=parseFloat(this.width),r=parseFloat(this.height);return`${Math.min(e,r)*.265}px`}render=()=>u`
193
193
  <div class="shadow-button inline-block transition-transform hover:scale-105 active:scale-90" style="border-radius: ${this.dynamicRadius};">
194
194
  <mw-spinning-border .color="${this.color}" .border="${"#f9fafb"}" .radius="${this.dynamicRadius}">
195
195
  <!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
@@ -246,7 +246,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
246
246
  </button>
247
247
  </mw-spinning-border>
248
248
  </div>
249
- `};customElements.get("mw-bubble")||customElements.define("mw-bubble",ui);var Ar={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ir=t=>(...e)=>({_$litDirective$:t,values:e}),rt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var{I:Uc}=_s,Ro=t=>t;var Bo=()=>document.createComment(""),nt=(t,e,r)=>{let n=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=n.insertBefore(Bo(),i),o=n.insertBefore(Bo(),i);r=new Uc(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!==i||a){let l=r._$AA;for(;l!==s;){let c=Ro(l).nextSibling;Ro(n).insertBefore(l,i),l=c}}}return r},ke=(t,e,r=t)=>(t._$AI(e,r),t),Rc={},Fo=(t,e=Rc)=>t._$AH=e,qo=t=>t._$AH,Lr=t=>{t._$AR(),t._$AA.remove()};var Vo=(t,e,r)=>{let n=new Map;for(let i=e;i<=r;i++)n.set(t[i],i);return n},X=Ir(class extends rt{constructor(t){if(super(t),t.type!==Ar.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,r){let n;r===void 0?r=e:e!==void 0&&(n=e);let i=[],s=[],o=0;for(let a of t)i[o]=n?n(a,o):o,s[o]=r(a,o),o++;return{values:s,keys:i}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,n]){let i=qo(t),{values:s,keys:o}=this.dt(e,r,n);if(!Array.isArray(i))return this.ut=o,s;let a=this.ut??=[],l=[],c,d,h=0,f=i.length-1,w=0,p=s.length-1;for(;h<=f&&w<=p;)if(i[h]===null)h++;else if(i[f]===null)f--;else if(a[h]===o[w])l[w]=ke(i[h],s[w]),h++,w++;else if(a[f]===o[p])l[p]=ke(i[f],s[p]),f--,p--;else if(a[h]===o[p])l[p]=ke(i[h],s[p]),nt(t,l[p+1],i[h]),h++,p--;else if(a[f]===o[w])l[w]=ke(i[f],s[w]),nt(t,i[h],i[f]),f--,w++;else if(c===void 0&&(c=Vo(o,w,p),d=Vo(a,h,f)),c.has(a[h]))if(c.has(a[f])){let S=d.get(o[w]),b=S!==void 0?i[S]:null;if(b===null){let $=nt(t,i[h]);ke($,s[w]),l[w]=$}else l[w]=ke(b,s[w]),nt(t,i[h],b),i[S]=null;w++}else Lr(i[f]),f--;else Lr(i[h]),h++;for(;w<=p;){let S=nt(t,l[p+1]);ke(S,s[w]),l[w++]=S}for(;h<=f;){let S=i[h++];S!==null&&Lr(S)}return this.ut=o,Fo(t,l),ie}});var Tt=class t extends x(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`
249
+ `};customElements.get("mw-bubble")||customElements.define("mw-bubble",hn);var Lr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Dr=t=>(...e)=>({_$litDirective$:t,values:e}),rt=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:Nc}=Ms,Vo=t=>t;var No=()=>document.createComment(""),it=(t,e,r)=>{let i=t._$AA.parentNode,n=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=i.insertBefore(No(),n),o=i.insertBefore(No(),n);r=new Nc(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=Vo(l).nextSibling;Vo(i).insertBefore(l,n),l=c}}}return r},ke=(t,e,r=t)=>(t._$AI(e,r),t),Hc={},Ho=(t,e=Hc)=>t._$AH=e,zo=t=>t._$AH,Tr=t=>{t._$AR(),t._$AA.remove()};var Wo=(t,e,r)=>{let i=new Map;for(let n=e;n<=r;n++)i.set(t[n],n);return i},X=Dr(class extends rt{constructor(t){if(super(t),t.type!==Lr.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,h=0,f=n.length-1,w=0,p=s.length-1;for(;h<=f&&w<=p;)if(n[h]===null)h++;else if(n[f]===null)f--;else if(a[h]===o[w])l[w]=ke(n[h],s[w]),h++,w++;else if(a[f]===o[p])l[p]=ke(n[f],s[p]),f--,p--;else if(a[h]===o[p])l[p]=ke(n[h],s[p]),it(t,l[p+1],n[h]),h++,p--;else if(a[f]===o[w])l[w]=ke(n[f],s[w]),it(t,n[h],n[f]),f--,w++;else if(c===void 0&&(c=Wo(o,w,p),d=Wo(a,h,f)),c.has(a[h]))if(c.has(a[f])){let S=d.get(o[w]),b=S!==void 0?n[S]:null;if(b===null){let $=it(t,n[h]);ke($,s[w]),l[w]=$}else l[w]=ke(b,s[w]),it(t,n[h],b),n[S]=null;w++}else Tr(n[f]),f--;else Tr(n[h]),h++;for(;w<=p;){let S=it(t,l[p+1]);ke(S,s[w]),l[w++]=S}for(;h<=f;){let S=n[h++];S!==null&&Tr(S)}return this.ut=o,Ho(t,l),ne}});var Tt=class t extends x(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`
250
250
  <div class="${this.darkMode?"dark":""} flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pt-6 pb-2">
251
251
  ${this.examples.title?u`
252
252
  <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">
@@ -331,7 +331,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
331
331
  </div>
332
332
  </div>
333
333
  </div>
334
- `}#e(){this.dispatchEvent(new t.NewChatClickEvent)}#t(){this.dispatchEvent(new t.CloseClickEvent)}};Ue.NewChatClickEvent=class extends CustomEvent{static type="mw:new-chat-click";constructor(e={}){super(Ue.NewChatClickEvent.type,{...e})}};Ue.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(Ue.CloseClickEvent.type,{...e})}};customElements.get("mw-chat-header")||customElements.define("mw-chat-header",Ue);var No={airplay:`<svg
334
+ `}#e(){this.dispatchEvent(new t.NewChatClickEvent)}#t(){this.dispatchEvent(new t.CloseClickEvent)}};Ue.NewChatClickEvent=class extends CustomEvent{static type="mw:new-chat-click";constructor(e={}){super(Ue.NewChatClickEvent.type,{...e})}};Ue.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(Ue.CloseClickEvent.type,{...e})}};customElements.get("mw-chat-header")||customElements.define("mw-chat-header",Ue);var Go={airplay:`<svg
335
335
  xmlns="http://www.w3.org/2000/svg"
336
336
  width="24"
337
337
  height="24"
@@ -547,6 +547,18 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
547
547
  stroke-linejoin="round"
548
548
  >
549
549
  <path d="m6 9 6 6 6-6" />
550
+ </svg>`,"chevron-left":`<svg
551
+ xmlns="http://www.w3.org/2000/svg"
552
+ width="24"
553
+ height="24"
554
+ viewBox="0 0 24 24"
555
+ fill="none"
556
+ stroke="currentColor"
557
+ stroke-width="2"
558
+ stroke-linecap="round"
559
+ stroke-linejoin="round"
560
+ >
561
+ <path d="m15 18-6-6 6-6" />
550
562
  </svg>`,"chevron-right":`<svg
551
563
  xmlns="http://www.w3.org/2000/svg"
552
564
  width="24"
@@ -1655,20 +1667,20 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1655
1667
  stroke-linejoin="round"
1656
1668
  >
1657
1669
  <path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z" />
1658
- </svg>`};var Dr=class t extends HTMLElement{static observedAttributes=["name","fill","stroke"];constructor(){super(),this.attachShadow({mode:"open"})}attributeChangedCallback(e,r,n){if(r!==n&&t.observedAttributes.includes(e)){switch(e){case"name":this.name=n||"";break;case"fill":this.fill=n||"none";break;case"stroke":this.stroke=n||"currentColor";break}this.render()}}resolveIcon(e){throw new Error("Not implemented")}render(){let e=document.createElement("style");if(e.textContent=`
1670
+ </svg>`};var jr=class t extends HTMLElement{static observedAttributes=["name","fill","stroke"];constructor(){super(),this.attachShadow({mode:"open"})}attributeChangedCallback(e,r,i){if(r!==i&&t.observedAttributes.includes(e)){switch(e){case"name":this.name=i||"";break;case"fill":this.fill=i||"none";break;case"stroke":this.stroke=i||"currentColor";break}this.render()}}resolveIcon(e){throw new Error("Not implemented")}render(){let e=document.createElement("style");if(e.textContent=`
1659
1671
  :host {
1660
1672
  display: inline-block;
1661
1673
  line-height: 0;
1662
1674
  }
1663
- `,this.shadowRoot){for(;this.shadowRoot.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild);this.shadowRoot.appendChild(e)}if(!this.name)return;let r=this.resolveIcon(this.name);if(!r){console.warn(`'${this.name}' not found, please add it to ${t.name}`);return}let s=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;s.setAttribute("fill",this.fill),s.setAttribute("stroke",this.stroke),s.style.width="100%",s.style.height="100%",this.shadowRoot?.appendChild(s)}name="";fill="none";stroke="currentColor"};var Bc=No,di=class extends Dr{resolveIcon(e){return Bc[e]}};customElements.get("lucide-icon")||customElements.define("lucide-icon",di);async function Ho(t,e,r){let n=e.map((c,d)=>({index:d,item:c})),i=async c=>{let d=[];for(;;){let h=n.pop();if(!h)return c(d);try{let f=await r(h.item);d.push({error:null,result:f,index:h.index})}catch(f){d.push({error:f,result:void 0,index:h.index})}}},s=Array.from({length:t},()=>new Promise(i)),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 Yo=cn(Zo(),1);var mi=t=>!!(t&&t.constructor&&t.call&&t.apply);var Xo=t=>!(!t||!t.then||!mi(t.then));function*Jo(t,e,r=i=>i,n=1){let i=mi(r)?r:()=>r,s=e?t:0,o=e??t;for(let a=s;a<=o&&(yield i(a),!(a+n>o));a+=n);}var wi=async(t,e)=>{let r=t?.times??3,n=t?.delay,i=t?.backoff??null;for(let s of Jo(1,r)){let[o,a]=await yi(e)(l=>{throw{_exited:l}});if(!o)return a;if(o._exited)throw o._exited;if(s===r)throw o;n&&await gi(n),i&&await gi(i(s))}},gi=t=>new Promise(e=>setTimeout(e,t)),yi=t=>(...e)=>{try{let r=t(...e);return Xo(r)?r.then(n=>[void 0,n]).catch(n=>[n,void 0]):[void 0,r]}catch(r){return[r,void 0]}};var vi=({delay:t},e)=>{let r,n=!0,i=(...s)=>{n?(clearTimeout(r),r=setTimeout(()=>{n&&e(...s),r=void 0},t)):e(...s)};return i.isPending=()=>r!==void 0,i.cancel=()=>{n=!1},i.flush=(...s)=>e(...s),i},st=({interval:t},e)=>{let r=!0,n,i=(...s)=>{r&&(e(...s),r=!1,n=setTimeout(()=>{r=!0,n=void 0},t))};return i.isThrottled=()=>n!==void 0,i};var ue=Object.freeze({PENDING:"pending",READY:"ready",ERROR:"error"}),Or=class{#e;#t;#r=null;#n=!1;#i=null;#s=[];constructor(e,r){this.#e=e,this.#t={acceptedTypes:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/heic"],maxFileSize:10*1024*1024,maxFiles:3,onError:()=>{},onFilesAdded:()=>{},isConnected:()=>!1,onConnect:()=>{},...r},e.addController(this),this.#l()}hostDisconnected(){this.#a(),this.#d(),this.#r&&this.#r.parentNode&&this.#r.parentNode.removeChild(this.#r)}#o(){this.#e.addEventListener("dragover",this.#p),this.#e.addEventListener("dragenter",this.#f),this.#e.addEventListener("dragleave",this.#g),this.#e.addEventListener("drop",this.#x)}#a(){this.#e.removeEventListener("dragover",this.#p),this.#e.removeEventListener("dragenter",this.#f),this.#e.removeEventListener("dragleave",this.#g),this.#e.removeEventListener("drop",this.#x)}#u(){this.#e.addEventListener("paste",this.#y)}#d(){this.#e.removeEventListener("paste",this.#y)}#l(){this.#r=document.createElement("input"),this.#r.type="file",this.#r.accept=this.#t.acceptedTypes?.join(",")??"",this.#r.multiple=this.#t.maxFiles>1,this.#r.style.display="none",this.#r.addEventListener("change",this.#h),document.body.appendChild(this.#r)}#h=e=>{let r=e.target,n=Array.from(r.files||[]);this.#t.isConnected()||this.#t.onConnect?.(),this.#m(n),r.value=""};#p=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")};#f=e=>{e.preventDefault(),e.dataTransfer&&this.#v(e.dataTransfer)&&this.#w(!0)};#g=e=>{e.preventDefault();let r=e.relatedTarget;this.#e.contains(r)||this.#w(!1)};#x=e=>{if(e.preventDefault(),this.#w(!1),e.dataTransfer){let r=Array.from(e.dataTransfer.files||[]);this.#m(r)}};#y=e=>{if(!e.clipboardData)return;let n=Array.from(e.clipboardData.items||[]).filter(s=>s.kind==="file");if(n.length===0)return;e.preventDefault();let i=n.map(s=>s.getAsFile()).flatMap(s=>s?[s]:[]);this.#m(i)};#v(e){return e.types&&e.types.includes("Files")}#w(e){this.#n!==e&&(this.#n=e,this.#e.requestUpdate())}#c(e){this.#i=e,this.#t.onError(e),this.#e.requestUpdate(),setTimeout(()=>{this.#k()},6e3)}#k(){this.#i=null,this.#e.requestUpdate()}async#m(e){if(e.length===0)return;this.#t.onFilesAdded?.(),this.#k();let r=e.filter(o=>this.#_(o));if(r.length===0)return;let n=this.#s.length,i=this.#t.maxFiles??1/0,s=r.length;if(n+s>i){this.#c(`You can upload a maximum of ${i} files`);return}try{let a=(await Promise.all(r.map(l=>this.#$(l)))).filter(l=>!this.#s.some(c=>c.dataUrl===l.dataUrl));this.#s=[...this.#s,...a],this.#e.requestUpdate(),await wi({times:5,delay:2e3},async()=>{if(this.#t.isConnected())await Ho(3,a,async l=>{await this.#C(l)});else throw new Error("Not connected yet")}),this.#e.requestUpdate()}catch(o){console.error("Failed to process and upload files:",o),this.#c("Upload failed")}}#_(e){return this.#t.acceptedTypes&&!this.#t.acceptedTypes.includes(e.type)?(this.#c("Invalid file type"),!1):e.size>this.#t.maxFileSize?(this.#c(`Max file size: ${this.#t.maxFileSize/(1024*1024)}MB`),!1):!0}async#$(e){try{let r=await(0,Yo.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:r,file:e,processingState:ue.PENDING}}catch(r){let n=r instanceof Error?r:new Error(String(r));throw new Error(`Failed to read file: ${e.name} - ${n.message}`)}}async#C(e){if(!e){console.error("No file provided to upload"),this.#c("No file provided");return}if(!this.#t?.uploadUrl){console.error("Missing uploadUrl in options"),this.#c("Upload URL not configured");return}e.processingState=ue.PENDING,this.#e.requestUpdate();let r=new FormData;r.append("file",e.file),r.append("fileId",e.id),r.append("role",this.#t.role||"user"),this.#t.conversationId&&r.append("conversationId",this.#t.conversationId),this.#t.widgetId&&r.append("widgetId",this.#t.widgetId),this.#t.taskId&&r.append("taskId",this.#t.taskId);try{let n=await fetch(this.#t.uploadUrl,{method:"POST",body:r});if(!n.ok)throw new Error(`Upload failed with status: ${n.status}`);let i=await n.json();if(!!!i?.success){let o=i?.error||"Upload failed";throw new Error(o)}i.fileUrl&&i.fileId?(e.fileUrl=i.fileUrl,e.id=i.fileId,e.processingState=ue.READY):e.processingState=ue.PENDING,this.#e.requestUpdate()}catch(n){let i=n instanceof Error?n:new Error(String(n));console.error("Upload error:",i.message),this.#c(i.message),e.processingState=ue.ERROR,this.#e.requestUpdate()}}get isDragging(){return this.#n}get error(){return this.#i}get selectedFiles(){return this.#s}get hasPendingFiles(){return this.#s.some(e=>e.processingState===ue.PENDING)}openFilePicker=()=>{if(!this.#t.widgetId&&!this.#t.taskId){console.warn("File uploads are disabled");return}this.#r&&this.#r.click()};clearError(){this.#k()}updateUploadOptions(e){e.conversationId!==void 0&&(this.#t.conversationId=e.conversationId),e.widgetId!==void 0&&(this.#t.widgetId=e.widgetId),e.taskId!==void 0&&(this.#t.taskId=e.taskId),e.isConnected!==void 0&&(this.#t.isConnected=e.isConnected),e.onConnect!==void 0&&(this.#t.onConnect=e.onConnect),this.#o(),this.#u()}restoreFiles(e){if(!Array.isArray(e)||e.length===0){this.#s=[],this.#e.requestUpdate();return}let r=e.map(n=>{let i=new File([],n.name,{type:n.type});return{id:n.id,name:n.name,type:n.type,size:n.size,dataUrl:n.url,file:i,processingState:ue.READY,fileUrl:n.url}});this.#s=r,this.#e.requestUpdate()}clearFiles(){this.#s=[],this.clearError(),this.#e.requestUpdate()}onFileDelete=e=>{this.#t.onFileDelete&&this.#t.onFileDelete(e),this.#s=this.#s.filter(r=>r.id!==e),this.#k(),this.#e.requestUpdate()}};var Pr={maxHeight:120,initialHeight:32,paddingY:12},ee=class t extends x(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`
1675
+ `,this.shadowRoot){for(;this.shadowRoot.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild);this.shadowRoot.appendChild(e)}if(!this.name)return;let r=this.resolveIcon(this.name);if(!r){console.warn(`'${this.name}' not found, please add it to ${t.name}`);return}let s=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;s.setAttribute("fill",this.fill),s.setAttribute("stroke",this.stroke),s.style.width="100%",s.style.height="100%",this.shadowRoot?.appendChild(s)}name="";fill="none";stroke="currentColor"};var zc=Go,pn=class extends jr{resolveIcon(e){return zc[e]}};customElements.get("lucide-icon")||customElements.define("lucide-icon",pn);async function Zo(t,e,r){let i=e.map((c,d)=>({index:d,item:c})),n=async c=>{let d=[];for(;;){let h=i.pop();if(!h)return c(d);try{let f=await r(h.item);d.push({error:null,result:f,index:h.index})}catch(f){d.push({error:f,result:void 0,index:h.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 ta=ui(Ko(),1);var wn=t=>!!(t&&t.constructor&&t.call&&t.apply);var Qo=t=>!(!t||!t.then||!wn(t.then));function*ea(t,e,r=n=>n,i=1){let n=wn(r)?r:()=>r,s=e?t:0,o=e??t;for(let a=s;a<=o&&(yield n(a),!(a+i>o));a+=i);}var vn=async(t,e)=>{let r=t?.times??3,i=t?.delay,n=t?.backoff??null;for(let s of ea(1,r)){let[o,a]=await bn(e)(l=>{throw{_exited:l}});if(!o)return a;if(o._exited)throw o._exited;if(s===r)throw o;i&&await yn(i),n&&await yn(n(s))}},yn=t=>new Promise(e=>setTimeout(e,t)),bn=t=>(...e)=>{try{let r=t(...e);return Qo(r)?r.then(i=>[void 0,i]).catch(i=>[i,void 0]):[void 0,r]}catch(r){return[r,void 0]}};var xn=({delay:t},e)=>{let r,i=!0,n=(...s)=>{i?(clearTimeout(r),r=setTimeout(()=>{i&&e(...s),r=void 0},t)):e(...s)};return n.isPending=()=>r!==void 0,n.cancel=()=>{i=!1},n.flush=(...s)=>e(...s),n},st=({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 ue=Object.freeze({PENDING:"pending",READY:"ready",ERROR:"error"}),Ur=class{#e;#t;#r=null;#i=!1;#n=null;#s=[];constructor(e,r){this.#e=e,this.#t={acceptedTypes:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/heic"],maxFileSize:10*1024*1024,maxFiles:3,onError:()=>{},onFilesAdded:()=>{},isConnected:()=>!1,onConnect:()=>{},...r},e.addController(this),this.#c()}hostDisconnected(){this.#a(),this.#d(),this.#r&&this.#r.parentNode&&this.#r.parentNode.removeChild(this.#r)}#o(){this.#e.addEventListener("dragover",this.#p),this.#e.addEventListener("dragenter",this.#f),this.#e.addEventListener("dragleave",this.#g),this.#e.addEventListener("drop",this.#x)}#a(){this.#e.removeEventListener("dragover",this.#p),this.#e.removeEventListener("dragenter",this.#f),this.#e.removeEventListener("dragleave",this.#g),this.#e.removeEventListener("drop",this.#x)}#l(){this.#e.addEventListener("paste",this.#y)}#d(){this.#e.removeEventListener("paste",this.#y)}#c(){this.#r=document.createElement("input"),this.#r.type="file",this.#r.accept=this.#t.acceptedTypes?.join(",")??"",this.#r.multiple=this.#t.maxFiles>1,this.#r.style.display="none",this.#r.addEventListener("change",this.#h),document.body.appendChild(this.#r)}#h=e=>{let r=e.target,i=Array.from(r.files||[]);this.#t.isConnected()||this.#t.onConnect?.(),this.#m(i),r.value=""};#p=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")};#f=e=>{e.preventDefault(),e.dataTransfer&&this.#v(e.dataTransfer)&&this.#w(!0)};#g=e=>{e.preventDefault();let r=e.relatedTarget;this.#e.contains(r)||this.#w(!1)};#x=e=>{if(e.preventDefault(),this.#w(!1),e.dataTransfer){let r=Array.from(e.dataTransfer.files||[]);this.#m(r)}};#y=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.#m(n)};#v(e){return e.types&&e.types.includes("Files")}#w(e){this.#i!==e&&(this.#i=e,this.#e.requestUpdate())}#u(e){this.#n=e,this.#t.onError(e),this.#e.requestUpdate(),setTimeout(()=>{this.#k()},6e3)}#k(){this.#n=null,this.#e.requestUpdate()}async#m(e){if(e.length===0)return;this.#t.onFilesAdded?.(),this.#k();let r=e.filter(o=>this.#_(o));if(r.length===0)return;let i=this.#s.length,n=this.#t.maxFiles??1/0,s=r.length;if(i+s>n){this.#u(`You can upload a maximum of ${n} files`);return}try{let a=(await Promise.all(r.map(l=>this.#$(l)))).filter(l=>!this.#s.some(c=>c.dataUrl===l.dataUrl));this.#s=[...this.#s,...a],this.#e.requestUpdate(),await vn({times:5,delay:2e3},async()=>{if(this.#t.isConnected())await Zo(3,a,async l=>{await this.#C(l)});else throw new Error("Not connected yet")}),this.#e.requestUpdate()}catch(o){console.error("Failed to process and upload files:",o),this.#u("Upload failed")}}#_(e){return this.#t.acceptedTypes&&!this.#t.acceptedTypes.includes(e.type)?(this.#u("Invalid file type"),!1):e.size>this.#t.maxFileSize?(this.#u(`Max file size: ${this.#t.maxFileSize/(1024*1024)}MB`),!1):!0}async#$(e){try{let r=await(0,ta.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:r,file:e,processingState:ue.PENDING}}catch(r){let i=r instanceof Error?r:new Error(String(r));throw new Error(`Failed to read file: ${e.name} - ${i.message}`)}}async#C(e){if(!e){console.error("No file provided to upload"),this.#u("No file provided");return}if(!this.#t?.uploadUrl){console.error("Missing uploadUrl in options"),this.#u("Upload URL not configured");return}e.processingState=ue.PENDING,this.#e.requestUpdate();let r=new FormData;r.append("file",e.file),r.append("fileId",e.id),r.append("role",this.#t.role||"user"),this.#t.conversationId&&r.append("conversationId",this.#t.conversationId),this.#t.widgetId&&r.append("widgetId",this.#t.widgetId),this.#t.taskId&&r.append("taskId",this.#t.taskId);try{let i=await fetch(this.#t.uploadUrl,{method:"POST",body:r});if(!i.ok)throw new Error(`Upload failed with status: ${i.status}`);let n=await i.json();if(!!!n?.success){let o=n?.error||"Upload failed";throw new Error(o)}n.fileUrl&&n.fileId?(e.fileUrl=n.fileUrl,e.id=n.fileId,e.processingState=ue.READY):e.processingState=ue.PENDING,this.#e.requestUpdate()}catch(i){let n=i instanceof Error?i:new Error(String(i));console.error("Upload error:",n.message),this.#u(n.message),e.processingState=ue.ERROR,this.#e.requestUpdate()}}get isDragging(){return this.#i}get error(){return this.#n}get selectedFiles(){return this.#s}get hasPendingFiles(){return this.#s.some(e=>e.processingState===ue.PENDING)}openFilePicker=()=>{if(!this.#t.widgetId&&!this.#t.taskId){console.warn("File uploads are disabled");return}this.#r&&this.#r.click()};clearError(){this.#k()}updateUploadOptions(e){e.conversationId!==void 0&&(this.#t.conversationId=e.conversationId),e.widgetId!==void 0&&(this.#t.widgetId=e.widgetId),e.taskId!==void 0&&(this.#t.taskId=e.taskId),e.isConnected!==void 0&&(this.#t.isConnected=e.isConnected),e.onConnect!==void 0&&(this.#t.onConnect=e.onConnect),this.#o(),this.#l()}restoreFiles(e){if(!Array.isArray(e)||e.length===0){this.#s=[],this.#e.requestUpdate();return}let r=e.map(i=>{let n=new File([],i.name,{type:i.type});return{id:i.id,name:i.name,type:i.type,size:i.size,dataUrl:i.url,file:n,processingState:ue.READY,fileUrl:i.url}});this.#s=r,this.#e.requestUpdate()}clearFiles(){this.#s=[],this.clearError(),this.#e.requestUpdate()}onFileDelete=e=>{this.#t.onFileDelete&&this.#t.onFileDelete(e),this.#s=this.#s.filter(r=>r.id!==e),this.#k(),this.#e.requestUpdate()}};var Rr={maxHeight:120,initialHeight:32,paddingY:12},ee=class t extends x(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`
1664
1676
  <div
1665
1677
  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}]">
1666
1678
  <!-- File preview area -->
1667
1679
  ${this.enableFileUpload&&this.files&&this.files.length>0?u`
1668
1680
  <div class="mb-2 flex flex-wrap gap-2 rounded-t-[18px] p-2">
1669
- ${this.files.map(r=>{let n=r.type.startsWith("image/");return u`
1681
+ ${this.files.map(r=>{let i=r.type.startsWith("image/");return u`
1670
1682
  <div class="relative inline-block">
1671
- ${n?u`<img src="${r.dataUrl}" alt="${r.name}" class="h-[60px] w-[60px] rounded-xl object-cover" />`:u`
1683
+ ${i?u`<img src="${r.dataUrl}" alt="${r.name}" class="h-[60px] w-[60px] rounded-xl object-cover" />`:u`
1672
1684
  <div class="flex h-[60px] w-[60px] items-center justify-center rounded-xl bg-gray-100 dark:bg-gray-700">
1673
1685
  <lucide-icon name="file" class="h-6 w-6 text-gray-500 dark:text-gray-300"></lucide-icon>
1674
1686
  </div>
@@ -1689,7 +1701,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1689
1701
  <button
1690
1702
  data-testid="file-delete-btn"
1691
1703
  type="button"
1692
- @click="${()=>this.#u(r.id)}"
1704
+ @click="${()=>this.#l(r.id)}"
1693
1705
  class="absolute -top-1 -right-1 flex h-5 w-5 items-center justify-center rounded-full bg-[#eeedf1] text-white hover:bg-[#eeedf195] dark:bg-gray-700 dark:hover:bg-gray-600">
1694
1706
  <lucide-icon name="x" class="h-3 w-3 text-[#14161a] dark:text-gray-200"></lucide-icon>
1695
1707
  </button>
@@ -1699,7 +1711,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1699
1711
  `:null}
1700
1712
 
1701
1713
  <!-- Input form -->
1702
- <form @submit="${this.#i}" class="flex w-full items-center">
1714
+ <form @submit="${this.#n}" class="flex w-full items-center">
1703
1715
  ${this.enableFileUpload?u`
1704
1716
  <button
1705
1717
  data-testid="file-upload-btn"
@@ -1707,7 +1719,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1707
1719
  @click="${this.#a}"
1708
1720
  ?disabled="${this.disabled||this.loading}"
1709
1721
  class="mx-1 px-2 transition-opacity duration-200 hover:opacity-80">
1710
- <lucide-icon name="paperclip" class="block h-6 w-6 text-[#312E30] dark:text-gray-300"></lucide-icon>
1722
+ <lucide-icon name="image-plus" class="block h-6 w-6 text-[#312E30] dark:text-gray-300"></lucide-icon>
1711
1723
  </button>
1712
1724
  `:null}
1713
1725
 
@@ -1716,12 +1728,12 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1716
1728
  data-testid="mw-chat-input-textarea"
1717
1729
  name="input"
1718
1730
  @input="${this.#s}"
1719
- @keydown="${this.#n}"
1731
+ @keydown="${this.#i}"
1720
1732
  autofocus
1721
1733
  ?disabled="${this.disabled}"
1722
1734
  maxlength="1000"
1723
1735
  placeholder="${this.placeholder}"
1724
- class="${this.enableFileUpload?"px-1":"pl-3 pr-1"} box-content h-[${Pr.initialHeight}px] w-full resize-none place-content-center rounded bg-transparent py-[${Pr.paddingY}px] text-base text-gray-800 outline-none placeholder:text-[14px] placeholder:font-light disabled:content-baseline disabled:leading-[${Pr.initialHeight}px] dark:text-gray-200"></textarea>
1736
+ 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>
1725
1737
 
1726
1738
  <button
1727
1739
  type="submit"
@@ -1739,7 +1751,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1739
1751
  <div class="h-5 w-full"></div>
1740
1752
  </slot>
1741
1753
  </div>
1742
- `}get#t(){return this.renderRoot.querySelector('textarea[name="input"]')??null}get#r(){return this.renderRoot.querySelector('button[type="submit"]')??null}#n(e){tu(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 i=this.#t;if(!i)throw new Error("Expected input element to be present");let s=i.value.trim();(s||this.enableFileUpload&&this.files.length>0)&&this.dispatchEvent(new t.SubmitEvent(s))&&(i.value=""),this.#o(),this.focus()}#s(e){this.dispatchEvent(new t.ChangeEvent({delta:e.data,full:e.target instanceof HTMLTextAreaElement?e.target.value:""})),this.#o()}#o(){let e=this.#t;if(!e)return;let{maxHeight:r,initialHeight:n,paddingY:i}=Pr;e.style.height=`${n}px`;let s=e.scrollHeight,o=i*2,a=Math.min(s-o,r);e.style.height=`${a}px`,this.requestUpdate()}#a(){this.dispatchEvent(new t.FileUploadClickEvent)}#u(e){this.dispatchEvent(new t.FileDeleteEvent(e))}setValue(e){let r=this.#t;if(!r){console.warn("input element not found, cannot set value");return}r.value=e,this.#o(),this.dispatchEvent(new t.ChangeEvent({delta:null,full:e}))}focus(){window.requestAnimationFrame(()=>{this.#t?.focus()})}};ee.ChangeEvent=class extends CustomEvent{static type="mw:change";constructor(e,r={}){super(ee.ChangeEvent.type,{detail:e,...r})}};ee.SubmitEvent=class extends CustomEvent{static type="mw:submit";constructor(e,r={}){super(ee.SubmitEvent.type,{detail:e,...r,cancelable:!0})}};ee.CancelEvent=class extends CustomEvent{static type="mw:cancel";constructor(e={}){super(ee.CancelEvent.type,{...e})}};ee.FileUploadClickEvent=class extends CustomEvent{static type="mw:file-upload-click";constructor(e={}){super(ee.FileUploadClickEvent.type,{...e})}};ee.FileDeleteEvent=class extends CustomEvent{static type="mw:file-delete";constructor(e,r={}){super(ee.FileDeleteEvent.type,{detail:e,...r})}};function tu(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 Qo(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?`${Ko(e)} hr ${r} min`:`${Ko(e)} hr`:r>0?t>0?`${r} min ${t} sec`:`${r} min`:`${t} sec`}function ea(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 Ko(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}var bi=class extends x(v){static properties={content:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},expanded:{type:Boolean,state:!0},_inProgress:{type:Boolean,state:!0}};static styles=j`
1754
+ `}get#t(){return this.renderRoot.querySelector('textarea[name="input"]')??null}get#r(){return this.renderRoot.querySelector('button[type="submit"]')??null}#i(e){au(e)&&(e.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&this.#r?.click())}#n(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;if(this.#e=r,this.streaming){this.dispatchEvent(new t.CancelEvent);return}let n=this.#t;if(!n)throw new Error("Expected input element to be present");let s=n.value.trim();(s||this.enableFileUpload&&this.files.length>0)&&this.dispatchEvent(new t.SubmitEvent(s))&&(n.value=""),this.#o(),this.focus()}#s(e){this.dispatchEvent(new t.ChangeEvent({delta:e.data,full:e.target instanceof HTMLTextAreaElement?e.target.value:""})),this.#o()}#o(){let e=this.#t;if(!e)return;let{maxHeight:r,initialHeight:i,paddingY:n}=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.#o(),this.dispatchEvent(new t.ChangeEvent({delta:null,full:e}))}focus(){window.requestAnimationFrame(()=>{this.#t?.focus()})}};ee.ChangeEvent=class extends CustomEvent{static type="mw:change";constructor(e,r={}){super(ee.ChangeEvent.type,{detail:e,...r})}};ee.SubmitEvent=class extends CustomEvent{static type="mw:submit";constructor(e,r={}){super(ee.SubmitEvent.type,{detail:e,...r,cancelable:!0})}};ee.CancelEvent=class extends CustomEvent{static type="mw:cancel";constructor(e={}){super(ee.CancelEvent.type,{...e})}};ee.FileUploadClickEvent=class extends CustomEvent{static type="mw:file-upload-click";constructor(e={}){super(ee.FileUploadClickEvent.type,{...e})}};ee.FileDeleteEvent=class extends CustomEvent{static type="mw:file-delete";constructor(e,r={}){super(ee.FileDeleteEvent.type,{detail:e,...r})}};function au(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);var kn=class{#e;constructor(e,{delay:r},i){this.#e=xn({delay:r},i),e.addController(this)}get call(){return this.#e}hostDisconnected(){this.#e.cancel()}};function ra(t,e,r){return new kn(t,e,r)}function na(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?`${ia(e)} hr ${r} min`:`${ia(e)} hr`:r>0?t>0?`${r} min ${t} sec`:`${r} min`:`${t} sec`}function sa(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 ia(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}var Cn=class extends x(v){static properties={content:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},expanded:{type:Boolean,state:!0},_inProgress:{type:Boolean,state:!0}};static styles=j`
1743
1755
  @keyframes ellipsis {
1744
1756
  0% {
1745
1757
  content: '';
@@ -1759,7 +1771,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1759
1771
  content: '';
1760
1772
  animation: ellipsis 1.5s infinite;
1761
1773
  }
1762
- `;#e=vi({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 ${Qo(e)}`:"Thought"}updated(e){e.has("content")&&(!this.#t&&this.content&&(this.#t=Date.now()),this._inProgress=!0,this.#e())}#s=()=>{this.expanded=!this.expanded};render(){return u`
1774
+ `;#e=ra(this,{delay:1200},()=>{this._inProgress=!1,this.#t&&(this.#r=Date.now()),this.requestUpdate()});#t=null;#r=null;constructor(){super(),this.content="",this.darkMode=!1,this.expanded=!1,this._inProgress=!1}getStreamDuration(){return this.#t?Date.now()-this.#t:null}#i(){if(!this.#t||!this.#r)return null;let e=this.#r-this.#t,r=Math.round(e/1e3);return Math.max(1,r)}#n(){if(this._inProgress)return"Thinking";let e=this.#i();return e?`Thought for ${na(e)}`:"Thought"}updated(e){e.has("content")&&(!this.#t&&this.content&&(this.#t=Date.now()),this._inProgress=!0,this.#e.call())}#s=()=>{this.expanded=!this.expanded};render(){return u`
1763
1775
  <div class="${this.darkMode?"dark":""} w-full">
1764
1776
  <button
1765
1777
  @click="${this.#s}"
@@ -1768,7 +1780,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1768
1780
  <svg class="${this.expanded?"rotate-90":""} h-3 w-3 shrink-0 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1769
1781
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
1770
1782
  </svg>
1771
- <span class="thinking-text ${this._inProgress?"in-progress":""}">${this.#i()}</span>
1783
+ <span class="thinking-text ${this._inProgress?"in-progress":""}">${this.#n()}</span>
1772
1784
  </button>
1773
1785
 
1774
1786
  ${this.expanded?u`
@@ -1779,7 +1791,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1779
1791
  </div>
1780
1792
  `:null}
1781
1793
  </div>
1782
- `}};customElements.get("mw-thought-block")||customElements.define("mw-thought-block",bi);var xi=class extends x(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`
1794
+ `}};customElements.get("mw-thought-block")||customElements.define("mw-thought-block",Cn);var _n=class extends x(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`
1783
1795
  <div class="${this.darkMode?"dark":""} ml-20 flex justify-end font-sans text-base">
1784
1796
  <div class="max-w-full">
1785
1797
  <!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
@@ -1815,9 +1827,9 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1815
1827
  </div>
1816
1828
  </div>
1817
1829
  </div>
1818
- `;default:throw new Error(`Unknown side: ${this.side}`)}}};customElements.get("mw-chat-message")||customElements.define("mw-chat-message",xi);var ge=class extends x(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=!1;#t=!1;#r=!1;#n=!1;updated(e){e.has("src")&&(this.#e=!1,this.#t=!1)}#i(){document.addEventListener("keydown",this.#o)}#s(){document.removeEventListener("keydown",this.#o)}#o=e=>{e.key==="Escape"&&this.#f(e)};get#a(){return this.side==="left"||this.side==="assistant"?"flex justify-start ml-[25px]":"flex justify-end"}get#u(){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`
1830
+ `;default:throw new Error(`Unknown side: ${this.side}`)}}};customElements.get("mw-chat-message")||customElements.define("mw-chat-message",_n);var ge=class extends x(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=!1;#t=!1;#r=!1;#i=!1;updated(e){e.has("src")&&(this.#e=!1,this.#t=!1)}#n(){document.addEventListener("keydown",this.#o)}#s(){document.removeEventListener("keydown",this.#o)}#o=e=>{e.key==="Escape"&&this.#f(e)};get#a(){return this.side==="left"||this.side==="assistant"?"flex justify-start ml-[25px]":"flex justify-end"}get#l(){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`
1819
1831
  <div class="${this.#a} mb-2 min-h-[100px]">
1820
- <div class="${this.#u} relative">
1832
+ <div class="${this.#l} relative">
1821
1833
  <!-- Placeholder background that's only shown when loading or error -->
1822
1834
  ${this.#e?null:u`
1823
1835
  <div class="flex items-center justify-center bg-gray-100" style="width: ${this.width}; height: 200px;">
@@ -1842,7 +1854,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1842
1854
  alt="${this.alt}"
1843
1855
  style="width: ${this.width}; height: ${this.height}; display: block;"
1844
1856
  class="${this.#e?"opacity-100":"opacity-0 hidden"} ${this.clickable?"cursor-pointer hover:scale-[105%]":""} h-full w-full max-w-full transition-all duration-200"
1845
- @error="${this.#l}"
1857
+ @error="${this.#c}"
1846
1858
  @load="${this.#h}"
1847
1859
  @click="${this.clickable?this.#p:void 0}"
1848
1860
  loading="lazy" />
@@ -1852,12 +1864,12 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1852
1864
  <!-- Full image modal -->
1853
1865
  ${this.#r?u`
1854
1866
  <div
1855
- class="${this.#n?"bg-opacity-0":"bg-opacity-75"} fixed inset-0 z-50 flex items-center justify-center bg-black p-4 transition-opacity duration-300"
1867
+ class="${this.#i?"bg-opacity-0":"bg-opacity-75"} fixed inset-0 z-50 flex items-center justify-center bg-black p-4 transition-opacity duration-300"
1856
1868
  @click="${this.#f}">
1857
1869
  <!-- Close button -->
1858
1870
  <button
1859
1871
  type="button"
1860
- class="bg-opacity-50 ${this.#n?"opacity-0":"opacity-75"} hover:bg-opacity-75 absolute top-8 right-8 z-10 rounded-full bg-black p-2 text-white transition-[colors,opacity] delay-300 focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-transparent focus:outline-none"
1872
+ class="bg-opacity-50 ${this.#i?"opacity-0":"opacity-75"} hover:bg-opacity-75 absolute top-8 right-8 z-10 rounded-full bg-black p-2 text-white transition-[colors,opacity] delay-300 focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-transparent focus:outline-none"
1861
1873
  @click="${this.#f}"
1862
1874
  aria-label="Close full image">
1863
1875
  <!-- X mark icon -->
@@ -1869,14 +1881,14 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1869
1881
  <img
1870
1882
  src="${this.#d()}"
1871
1883
  alt="${this.alt}"
1872
- class="${this.#n?"scale-75 opacity-0":"scale-100 opacity-100"} max-h-full max-w-full transform rounded-lg shadow-2xl transition-all duration-100 ease-out"
1884
+ class="${this.#i?"scale-75 opacity-0":"scale-100 opacity-100"} max-h-full max-w-full transform rounded-lg shadow-2xl transition-all duration-100 ease-out"
1873
1885
  @click="${this.#g}" />
1874
1886
  </div>
1875
1887
  </div>
1876
1888
  `:null}
1877
- `:(console.warn("MwChatImage: No src provided"),null)}#l=e=>{console.error("Failed to load chat image:",this.src),this.#t=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:e},bubbles:!0}))};#h=e=>{this.#e=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:e},bubbles:!0}))};#p=e=>{this.clickable&&(e.preventDefault(),e.stopPropagation(),this.#r=!0,this.#i(),this.requestUpdate(),this.#n=!0,this.requestUpdate(),setTimeout(()=>{this.#n=!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.#r=!1,this.requestUpdate()};#g=e=>{e.preventDefault(),e.stopPropagation()}};ge.ErrorEvent=class extends CustomEvent{static type="mw-chat-image:error";constructor(e,r={}){super(ge.ErrorEvent.type,{detail:e,...r})}};ge.LoadEvent=class extends CustomEvent{static type="mw-chat-image:load";constructor(e,r={}){super(ge.LoadEvent.type,{detail:e,...r})}};ge.ClickEvent=class extends CustomEvent{static type="mw-chat-image:click";constructor(e,r={}){super(ge.ClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-image")||customElements.define("mw-chat-image",ge);var G=t=>t??P;var ru=["javascript:","data:text/html","vbscript:","data:text/javascript","data:text/vbscript","data:text/css","data:text/plain","data:text/xml"],jt=class t extends x(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 n=/\[([^\]]+)\]\(([^)]+)\)/g.exec(e);if(n){let i=n[0],s=n[1],o=n[2],a=n.index;return ru.some(l=>o.toLowerCase().startsWith(l))||!o||!s?e:u`${e.slice(0,a)}<a href="${G(o)}" target="_blank" rel="noopener noreferrer" @click="${this.#i}" class="underline" style="color: ${this.color}"
1889
+ `:(console.warn("MwChatImage: No src provided"),null)}#c=e=>{console.error("Failed to load chat image:",this.src),this.#t=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:e},bubbles:!0}))};#h=e=>{this.#e=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:e},bubbles:!0}))};#p=e=>{this.clickable&&(e.preventDefault(),e.stopPropagation(),this.#r=!0,this.#n(),this.requestUpdate(),this.#i=!0,this.requestUpdate(),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.#r=!1,this.requestUpdate()};#g=e=>{e.preventDefault(),e.stopPropagation()}};ge.ErrorEvent=class extends CustomEvent{static type="mw-chat-image:error";constructor(e,r={}){super(ge.ErrorEvent.type,{detail:e,...r})}};ge.LoadEvent=class extends CustomEvent{static type="mw-chat-image:load";constructor(e,r={}){super(ge.LoadEvent.type,{detail:e,...r})}};ge.ClickEvent=class extends CustomEvent{static type="mw-chat-image:click";constructor(e,r={}){super(ge.ClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-image")||customElements.define("mw-chat-image",ge);var N=t=>t??P;var lu=["javascript:","data:text/html","vbscript:","data:text/javascript","data:text/vbscript","data:text/css","data:text/plain","data:text/xml"],jt=class t extends x(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)};#i(e){let i=/\[([^\]]+)\]\(([^)]+)\)/g.exec(e);if(i){let n=i[0],s=i[1],o=i[2],a=i.index;return lu.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.#n}" class="underline" style="color: ${this.color}"
1878
1890
  >${s}</a
1879
- >${e.slice(a+i.length)}`}return e}#i=e=>{e.stopPropagation()};render(){if(this._dismissed)return null;let e=this.#n(this.text);return u`
1891
+ >${e.slice(a+n.length)}`}return e}#n=e=>{e.stopPropagation()};render(){if(this._dismissed)return null;let e=this.#i(this.text);return u`
1880
1892
  <div class="${this.darkMode?"dark":""} flex items-center justify-between">
1881
1893
  <div class="flex flex-1 items-center justify-center">
1882
1894
  <span class="px-3 text-center text-xs font-light text-gray-500 dark:text-gray-400">${e}</span>
@@ -1892,7 +1904,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1892
1904
  </button>
1893
1905
  `:null}
1894
1906
  </div>
1895
- `}};jt.DismissEvent=class extends CustomEvent{static type="mw-disclaimer:dismiss";constructor(e={}){super(jt.DismissEvent.type,{...e})}};customElements.get("mw-disclaimer")||customElements.define("mw-disclaimer",jt);var ki=class extends x(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}connectedCallback(){super.connectedCallback(),this.autoDismissable&&this.#e()}#e(){setTimeout(()=>{this._isVisible=!1,this.requestUpdate()},this.dismissDelay)}#t(){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.#t();return u`
1907
+ `}};jt.DismissEvent=class extends CustomEvent{static type="mw-disclaimer:dismiss";constructor(e={}){super(jt.DismissEvent.type,{...e})}};customElements.get("mw-disclaimer")||customElements.define("mw-disclaimer",jt);var $n=class extends x(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}connectedCallback(){super.connectedCallback(),this.autoDismissable&&this.#e()}#e(){setTimeout(()=>{this._isVisible=!1,this.requestUpdate()},this.dismissDelay)}#t(){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.#t();return u`
1896
1908
  <div
1897
1909
  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">
1898
1910
  <div class="${e.bg} mb-2 flex max-w-[70%] items-center justify-center rounded-full px-3 py-2 select-none">
@@ -1931,7 +1943,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1931
1943
  <span class="${e.text} ml-1 text-xs">${this.text}</span>
1932
1944
  </div>
1933
1945
  </div>
1934
- `}};customElements.get("mw-info-banner")||customElements.define("mw-info-banner",ki);var Ci=class extends x(v){render=()=>u`
1946
+ `}};customElements.get("mw-info-banner")||customElements.define("mw-info-banner",$n);var Sn=class extends x(v){render=()=>u`
1935
1947
  <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">
1936
1948
  <circle fill="currentColor" stroke="none" cx="27" cy="50" r="6">
1937
1949
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
@@ -1943,11 +1955,11 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1943
1955
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
1944
1956
  </circle>
1945
1957
  </svg>
1946
- `};customElements.get("mw-loading")||customElements.define("mw-loading",Ci);var nu="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",_i=class extends x(v){static properties={darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.darkMode=!1}render(){return u`
1958
+ `};customElements.get("mw-loading")||customElements.define("mw-loading",Sn);var cu="https://molin.ai/?utm_source=molin.ai&utm_medium=widget&utm_campaign=poweredby",En=class extends x(v){static properties={darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.darkMode=!1}render(){return u`
1947
1959
  <p class="${this.darkMode?"text-gray-300":"text-gray-600"} flex items-center justify-center text-xs whitespace-nowrap">
1948
1960
  <span>Powered by</span>
1949
1961
 
1950
- <a href="${nu}" target="_blank" class="inline-flex items-center underline">
1962
+ <a href="${cu}" target="_blank" class="inline-flex items-center underline">
1951
1963
  <svg class="mx-1 inline-block h-4 w-4" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
1952
1964
  <circle cx="10.0361" cy="10.0361" r="10.0361" fill="#242038" />
1953
1965
  <path
@@ -1966,16 +1978,16 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1966
1978
  <span>Molin AI</span>
1967
1979
  </a>
1968
1980
  </p>
1969
- `}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",_i);function ta(t){return e=>{let n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}var iu=Math.pow(10,8)*24*60*60*1e3,T1=-iu;var su=3600;var ra=su*24,j1=ra*7,ou=ra*365.2425,au=ou/12,O1=au*3,$i=Symbol.for("constructDateFrom");function na(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&$i in t?t[$i](e):t instanceof Date?new t.constructor(e):new Date(e)}function Si(t,e){return na(e||t,t)}function ia(t,e){return+Si(t)-+Si(e)}function Ei(t,e,r){let n=ia(t,e)/1e3;return ta(r?.roundingMethod)(n)}var Mi=class extends x(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=j`
1981
+ `}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",En);function oa(t){return e=>{let i=(t?Math[t]:Math.trunc)(e);return i===0?0:i}}var uu=Math.pow(10,8)*24*60*60*1e3,V1=-uu;var du=3600;var aa=du*24,N1=aa*7,hu=aa*365.2425,pu=hu/12,H1=pu*3,Mn=Symbol.for("constructDateFrom");function la(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Mn in t?t[Mn](e):t instanceof Date?new t.constructor(e):new Date(e)}function An(t,e){return la(e||t,t)}function ca(t,e){return+An(t)-+An(e)}function In(t,e,r){let i=ca(t,e)/1e3;return oa(r?.roundingMethod)(i)}var Ln=class extends x(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=j`
1970
1982
  :host {
1971
1983
  display: block;
1972
1984
  }
1973
- `;#e=7;constructor(){super(),this.question="",this.options=["No","Yes"],this.heading="",this.gameTitle="",this.resultPrefix="",this.correctButtonText="Correct",this.wrongButtonText="Wrong",this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.minutes="00",this.seconds="00",this.darkMode=!1,this._currentQuestion="",this._questionHistory=[],this._guessedJob="",this._isLoadingNextQuestion=!1,this._loadingAnswer="",this._guessValidated=!1,this._validatingButton="",this._currentAttemptQuestionCount=0}firstUpdated(){this._currentQuestion=this.question}async#t(){if(!this.apiBaseUrl)return console.warn("API base URL not configured, cannot fetch next question"),null;this._isLoadingNextQuestion=!0;try{let e=await fetch(`${this.apiBaseUrl}/preview/wait-game/next-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({questionAnswers:this._questionHistory,takeGuess:this._currentAttemptQuestionCount>=this.#e})});return e.ok?await e.json():(console.error("failed to fetch next question",e.status),null)}catch(e){return console.error("error fetching next question",e),null}finally{this._isLoadingNextQuestion=!1}}#r=async e=>{this._loadingAnswer=e,this._questionHistory.push({question:this._currentQuestion,answer:e}),this._currentAttemptQuestionCount++,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:question-answered",{bubbles:!0,composed:!0,detail:{questionIndex:this._questionHistory.length-1,question:this._currentQuestion,answer:e,totalQuestions:this.#e,allAnswers:this._questionHistory.map(n=>n.answer)}}));let r=await this.#t();r&&(r.isComplete&&r.guessedJob?(this._guessedJob=r.guessedJob,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:game-completed",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(n=>n.answer)}}))):r.nextQuestion&&(this._currentQuestion=r.nextQuestion)),this._loadingAnswer=""};#n=async e=>{if(this._validatingButton=e?"correct":"wrong",this.dispatchEvent(new CustomEvent("mw-chat-wait-game:guess-validated",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,isCorrect:e,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(r=>r.answer)}})),e)this._guessValidated=!0,this._validatingButton="";else{let r=await this.#t();r?.nextQuestion&&(this._currentQuestion=r.nextQuestion),this._guessedJob="",this._currentAttemptQuestionCount=0,this._validatingButton=""}};#i(){return Math.round(this._currentAttemptQuestionCount/this.#e*100)}#s(){let e=new URL("/assets/career-ladder.png",this.cdnBaseUrl||"https://widget.molin.ai");return u`
1985
+ `;#e=7;constructor(){super(),this.question="",this.options=["No","Yes"],this.heading="",this.gameTitle="",this.resultPrefix="",this.correctButtonText="Correct",this.wrongButtonText="Wrong",this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.minutes="00",this.seconds="00",this.darkMode=!1,this._currentQuestion="",this._questionHistory=[],this._guessedJob="",this._isLoadingNextQuestion=!1,this._loadingAnswer="",this._guessValidated=!1,this._validatingButton="",this._currentAttemptQuestionCount=0}firstUpdated(){this._currentQuestion=this.question}async#t(){if(!this.apiBaseUrl)return console.warn("API base URL not configured, cannot fetch next question"),null;this._isLoadingNextQuestion=!0;try{let e=await fetch(`${this.apiBaseUrl}/preview/wait-game/next-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({questionAnswers:this._questionHistory,takeGuess:this._currentAttemptQuestionCount>=this.#e})});return e.ok?await e.json():(console.error("failed to fetch next question",e.status),null)}catch(e){return console.error("error fetching next question",e),null}finally{this._isLoadingNextQuestion=!1}}#r=async e=>{this._loadingAnswer=e,this._questionHistory.push({question:this._currentQuestion,answer:e}),this._currentAttemptQuestionCount++,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:question-answered",{bubbles:!0,composed:!0,detail:{questionIndex:this._questionHistory.length-1,question:this._currentQuestion,answer:e,totalQuestions:this.#e,allAnswers:this._questionHistory.map(i=>i.answer)}}));let r=await this.#t();r&&(r.isComplete&&r.guessedJob?(this._guessedJob=r.guessedJob,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:game-completed",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(i=>i.answer)}}))):r.nextQuestion&&(this._currentQuestion=r.nextQuestion)),this._loadingAnswer=""};#i=async e=>{if(this._validatingButton=e?"correct":"wrong",this.dispatchEvent(new CustomEvent("mw-chat-wait-game:guess-validated",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,isCorrect:e,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(r=>r.answer)}})),e)this._guessValidated=!0,this._validatingButton="";else{let r=await this.#t();r?.nextQuestion&&(this._currentQuestion=r.nextQuestion),this._guessedJob="",this._currentAttemptQuestionCount=0,this._validatingButton=""}};#n(){return Math.round(this._currentAttemptQuestionCount/this.#e*100)}#s(){let e=new URL("/assets/career-ladder.png",this.cdnBaseUrl||"https://widget.molin.ai");return u`
1974
1986
  <div class="mt-3 flex items-center justify-center gap-1">
1975
1987
  <span class="text-[11px] text-black/40 dark:text-gray-500">Inspired by</span>
1976
1988
  <img src="${e.href}" alt="Career Ladder" class="h-6" />
1977
1989
  </div>
1978
- `}render(){let e=this.#i(),r=this.heading||"Agent joining in",n=this.gameTitle||"\u{1F9E0} I'll guess your job",i=this.resultPrefix||"I'm pretty confident:";return this._guessedJob?u`
1990
+ `}render(){let e=this.#n(),r=this.heading||"Agent joining in",i=this.gameTitle||"\u{1F9E0} I'll guess your job",n=this.resultPrefix||"I'm pretty confident:";return this._guessedJob?u`
1979
1991
  <div class="${this.darkMode?"dark bg-[#1E1F23] ring-white/10":"bg-white/70 ring-black/10"} mx-auto w-full rounded-2xl p-4 shadow-sm ring-1 backdrop-blur">
1980
1992
  <div class="flex items-center justify-between">
1981
1993
  <div class="text-[13px] text-black/60 dark:text-gray-300">${r}</div>
@@ -1988,19 +2000,19 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
1988
2000
  </div>
1989
2001
 
1990
2002
  <div class="mt-3 space-y-1.5 text-[13px] text-black dark:text-white">
1991
- <div class="rounded-xl bg-black/[0.04] px-3 py-2 dark:bg-white/10">${i} ${this._guessedJob}.</div>
2003
+ <div class="rounded-xl bg-black/[0.04] px-3 py-2 dark:bg-white/10">${n} ${this._guessedJob}.</div>
1992
2004
  </div>
1993
2005
 
1994
2006
  ${this._guessValidated?"":u`
1995
2007
  <div class="mt-3 grid grid-cols-2 gap-2">
1996
2008
  <button
1997
- @click="${()=>this.#n(!1)}"
2009
+ @click="${()=>this.#i(!1)}"
1998
2010
  ?disabled="${!!this._validatingButton}"
1999
2011
  class="flex items-center justify-center gap-1 rounded-xl border border-[${this.color}] bg-white px-4 py-2 text-sm font-medium text-black transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[#2B2D31] dark:text-white">
2000
2012
  ${this._validatingButton==="wrong"?u`<lucide-icon class="h-4 w-4 animate-spin" name="loader-circle"></lucide-icon>`:this.wrongButtonText}
2001
2013
  </button>
2002
2014
  <button
2003
- @click="${()=>this.#n(!0)}"
2015
+ @click="${()=>this.#i(!0)}"
2004
2016
  ?disabled="${!!this._validatingButton}"
2005
2017
  class="flex items-center justify-center gap-1 rounded-xl bg-[${this.color}] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50 dark:text-black">
2006
2018
  ${this._validatingButton==="correct"?u`<lucide-icon class="h-4 w-4 animate-spin" name="loader-circle"></lucide-icon>`:this.correctButtonText}
@@ -2027,7 +2039,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2027
2039
  </div>
2028
2040
 
2029
2041
  <div class="mt-2 flex items-center justify-between">
2030
- <h3 class="text-sm font-semibold text-black dark:text-white">${n}</h3>
2042
+ <h3 class="text-sm font-semibold text-black dark:text-white">${i}</h3>
2031
2043
  <div class="text-xs text-black/60 dark:text-gray-300"><span>${this._currentAttemptQuestionCount+1}</span>/${this.#e}</div>
2032
2044
  </div>
2033
2045
 
@@ -2050,11 +2062,11 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2050
2062
 
2051
2063
  ${this.#s()}
2052
2064
  </div>
2053
- `: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",Mi);var Ai=class extends x(v){static styles=j`
2065
+ `: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",Ln);var Dn=class extends x(v){static styles=j`
2054
2066
  :host {
2055
2067
  display: block;
2056
2068
  }
2057
- `;static properties={data:{type:Object},color:{type:String},apiBaseUrl:{type:String},cdnBaseUrl:{type:String},soundUrl:{type:String,attribute:"sound"},darkMode:{type:Boolean,attribute:"dark-mode"},_remainingSeconds:{type:Number,state:!0},_isComplete:{type:Boolean,state:!0},_showGame:{type:Boolean,state:!0}};#e=null;#t=null;#r=0;constructor(){super(),this.data,this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.soundUrl="",this.darkMode=!1,this._remainingSeconds=480,this._isComplete=!1,this._showGame=!1}connectedCallback(){super.connectedCallback(),this.#n(),this.#s()}disconnectedCallback(){super.disconnectedCallback(),this.#o()}#n(){this.data?.expected_join_time?this.#t=new Date(this.data.expected_join_time):this.#t=new Date(Date.now()+this._remainingSeconds*1e3),this.#r=Math.max(Ei(this.#t,new Date),0),this.#i()}#i(){if(this.#t===null)return;let e=new Date,r=Ei(this.#t,e);r>=0?(this._remainingSeconds=r,this._isComplete=!1):(this._remainingSeconds=Math.abs(r),this._isComplete=!0)}#s(){this.#o(),this.#e=setInterval(()=>{this.#i()},1e3)}#o(){this.#e!==null&&(clearInterval(this.#e),this.#e=null)}#a=()=>{this.#l(),this._showGame=!0,this.dispatchEvent(new CustomEvent("mw-chat-wait-timer:game-click",{bubbles:!0,composed:!0}))};#u(){if(!this.data?.game_first_question)return!1;try{return localStorage.getItem("_molin_timer_sound_question")===this.data.game_first_question}catch{return!1}}#d(){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,{})}}#l(){if(!this.soundUrl||!this.data?.game_first_question||this.#u())return;let e=new Audio(this.soundUrl);e.volume=.5,e.play().then(()=>{this.#d()}).catch(r=>{console.error("Error playing audio:",r,{})})}#h(){let e=Math.floor(this._remainingSeconds/60),r=this._remainingSeconds%60,n=i=>String(i).padStart(2,"0");return{minutes:n(e),seconds:n(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.#h();if(this._showGame)return u`
2069
+ `;static properties={data:{type:Object},color:{type:String},apiBaseUrl:{type:String},cdnBaseUrl:{type:String},soundUrl:{type:String,attribute:"sound"},darkMode:{type:Boolean,attribute:"dark-mode"},_remainingSeconds:{type:Number,state:!0},_isComplete:{type:Boolean,state:!0},_showGame:{type:Boolean,state:!0}};#e=null;#t=null;#r=0;constructor(){super(),this.data,this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.soundUrl="",this.darkMode=!1,this._remainingSeconds=480,this._isComplete=!1,this._showGame=!1}connectedCallback(){super.connectedCallback(),this.#i(),this.#s()}disconnectedCallback(){super.disconnectedCallback(),this.#o()}#i(){this.data?.expected_join_time?this.#t=new Date(this.data.expected_join_time):this.#t=new Date(Date.now()+this._remainingSeconds*1e3),this.#r=Math.max(In(this.#t,new Date),0),this.#n()}#n(){if(this.#t===null)return;let e=new Date,r=In(this.#t,e);r>=0?(this._remainingSeconds=r,this._isComplete=!1):(this._remainingSeconds=Math.abs(r),this._isComplete=!0)}#s(){this.#o(),this.#e=setInterval(()=>{this.#n()},1e3)}#o(){this.#e!==null&&(clearInterval(this.#e),this.#e=null)}#a=()=>{this.#c(),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}}#d(){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,{})}}#c(){if(!this.soundUrl||!this.data?.game_first_question||this.#l())return;let e=new Audio(this.soundUrl);e.volume=.5,e.play().then(()=>{this.#d()}).catch(r=>{console.error("Error playing audio:",r,{})})}#h(){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.#h();if(this._showGame)return u`
2058
2070
  <mw-chat-wait-game
2059
2071
  .question="${this.data?.game_first_question}"
2060
2072
  .options="${[this.data?.game_button_answer_negative||"No",this.data?.game_button_answer_affirmative||"Yes"]}"
@@ -2069,7 +2081,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2069
2081
  .minutes="${e}"
2070
2082
  .seconds="${r}"
2071
2083
  ?dark-mode="${this.darkMode}"></mw-chat-wait-game>
2072
- `;let n=this.#p();return u`
2084
+ `;let i=this.#p();return u`
2073
2085
  <div class="${this.darkMode?"dark bg-[#1E1F23] ring-white/10":"bg-white/70 ring-black/10"} mx-auto w-full max-w-xs rounded-2xl p-4 shadow-sm ring-1 backdrop-blur">
2074
2086
  <!-- Time -->
2075
2087
  <div class="font-[ui-monospace,Menlo,Monaco,Consolas] text-4xl tracking-tight text-black tabular-nums dark:text-white" aria-live="polite">
@@ -2078,7 +2090,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2078
2090
 
2079
2091
  <!-- Progress bar -->
2080
2092
  <div class="mt-3 h-1.5 overflow-hidden rounded-full bg-black/5 dark:bg-white/10">
2081
- <div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: ${n}%"></div>
2093
+ <div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: ${i}%"></div>
2082
2094
  </div>
2083
2095
 
2084
2096
  <!-- Message -->
@@ -2091,13 +2103,13 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2091
2103
  </button>
2092
2104
  </div>
2093
2105
  </div>
2094
- `}};customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",Ai);var ot=(t,e,r)=>{for(let n of e)if(n[0]===t)return(0,n[1])();return r?.()};var Ii=class extends x(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`
2106
+ `}};customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",Dn);var ot=(t,e,r)=>{for(let i of e)if(i[0]===t)return(0,i[1])();return r?.()};var Tn=class extends x(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`
2095
2107
  <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">
2096
2108
  <div class="mb-2">
2097
2109
  <div class="h-7 w-full animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2098
2110
  </div>
2099
2111
  </div>
2100
- `;let e=this.orderDetails.timeline?.step?.flatMap(n=>n.label?[{...n,label:n.label}]:[])||[],r=this.orderDetails.items?.item?.flatMap(n=>n.name?[{...n,name:n.name}]:[])||[];return u`
2112
+ `;let e=this.orderDetails.timeline?.step?.flatMap(i=>i.label?[{...i,label:i.label}]:[])||[],r=this.orderDetails.items?.item?.flatMap(i=>i.name?[{...i,name:i.name}]:[])||[];return u`
2101
2113
  <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">
2102
2114
  <!-- Header with order ID -->
2103
2115
  <div class="mb-2">
@@ -2107,12 +2119,12 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2107
2119
  <!-- Progress timeline -->
2108
2120
  <div>
2109
2121
  <ol role="list" class="w-full overflow-hidden">
2110
- ${X(e,n=>n.label,(n,i)=>{let s=n.status==="completed",o=n.status==="in_progress",a=i===e.length-1;return u`
2122
+ ${X(e,i=>i.label,(i,n)=>{let s=i.status==="completed",o=i.status==="in_progress",a=n===e.length-1;return u`
2111
2123
  <li class="relative pb-4">
2112
2124
  ${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>`}
2113
2125
 
2114
2126
  <div class="group relative flex items-start">
2115
- ${ot(n.status,[["completed",()=>u`
2127
+ ${ot(i.status,[["completed",()=>u`
2116
2128
  <span class="flex h-6 items-center">
2117
2129
  <span class="flex h-4 w-4 items-center justify-center rounded-full bg-[${this.color}]">
2118
2130
  <hi-outline class="mb-3 block h-3 w-3 text-white dark:text-gray-800" name="check"></hi-outline>
@@ -2140,7 +2152,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2140
2152
 
2141
2153
  <span class="ml-3 flex min-w-0 flex-col">
2142
2154
  <span class="${`text-sm font-medium ${o?`text-[${this.color}]`:s?"text-gray-900 dark:text-gray-100":"text-gray-500 dark:text-gray-400"}`}">
2143
- ${n.label}
2155
+ ${i.label}
2144
2156
  </span>
2145
2157
  </span>
2146
2158
  </div>
@@ -2179,15 +2191,15 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2179
2191
  <div class="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2180
2192
  </div>
2181
2193
  `)}
2182
- `:X(r,n=>n.name,n=>u`
2194
+ `:X(r,i=>i.name,i=>u`
2183
2195
  <div class="flex items-center gap-2 py-1.5">
2184
- <img src="${G(n.image)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
2196
+ <img src="${N(i.image)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
2185
2197
 
2186
2198
  <div class="min-w-0 flex-1">
2187
- ${!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>`}
2199
+ ${!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>`}
2188
2200
  </div>
2189
2201
 
2190
- ${!n.price&&this.streaming?u`<div class="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`:u`<span class="text-sm text-gray-500 dark:text-gray-400">${n.quantity&&Number(n.quantity)>1?"x":""} ${n.price}</span>`}
2202
+ ${!i.price&&this.streaming?u`<div class="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`:u`<span class="text-sm text-gray-500 dark:text-gray-400">${i.quantity&&Number(i.quantity)>1?"x":""} ${i.price}</span>`}
2191
2203
  </div>
2192
2204
  `)}
2193
2205
  </div>
@@ -2285,10 +2297,10 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2285
2297
  `:null}
2286
2298
  </div>
2287
2299
  </div>
2288
- `}};customElements.get("mw-order-card")||customElements.define("mw-order-card",Ii);var Li=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 sa(t){return new Li(t)}var Di=class extends x(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=sa(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 Fs(e,r).href}catch{}return e}render(){let{name:e,description:r,price:n,url:i}=this.product||{},s=i?this.imagesByProductUrl?.[i]:void 0;return u`
2300
+ `}};customElements.get("mw-order-card")||customElements.define("mw-order-card",Tn);var jn=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 ua(t){return new jn(t)}var On=class extends x(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=ua(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 Hs(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`
2289
2301
  <a
2290
- href="${G(this.trackedProductUrl)}"
2291
- title="${G(e)}"
2302
+ href="${N(this.trackedProductUrl)}"
2303
+ title="${N(e)}"
2292
2304
  class="${this.darkMode?"dark":""} group flex w-full max-w-md cursor-pointer gap-2.5 overflow-hidden rounded-lg"
2293
2305
  target="${this.linksNewTab?"_blank":"_self"}"
2294
2306
  ?disabled="${this.streaming}">
@@ -2328,10 +2340,10 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2328
2340
 
2329
2341
  <!-- flexbox filled space -->
2330
2342
 
2331
- ${n||!this.streaming?u`<span class="text-xs text-gray-900 dark:text-white">${n}</span>`:u`<div class="h-4 w-14 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></div>`}
2343
+ ${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>`}
2332
2344
  </div>
2333
2345
  </a>
2334
- `}};customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",Di);function Ur(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}var Rr=function(){},at=function(){};var Ot=(t,e,r)=>Math.min(Math.max(r,t),e);var Ti=.001,lu=.01,oa=10,cu=.05,uu=1;function aa({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s;Rr(t<=oa*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=Ot(cu,uu,o),t=Ot(lu,oa,t/1e3),o<1?(i=c=>{let d=c*o,h=d*t,f=d-r,w=Br(c,o),p=Math.exp(-h);return Ti-f/w*p},s=c=>{let h=c*o*t,f=h*r+r,w=Math.pow(o,2)*Math.pow(c,2)*t,p=Math.exp(-h),S=Br(Math.pow(c,2),o);return(-i(c)+Ti>0?-1:1)*((f-w)*p)/S}):(i=c=>{let d=Math.exp(-c*t),h=(c-r)*t+1;return-Ti+d*h},s=c=>{let d=Math.exp(-c*t),h=(r-c)*(t*t);return d*h});let a=5/t,l=hu(i,s,a);if(t=t*1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{let c=Math.pow(l,2)*n;return{stiffness:c,damping:o*2*Math.sqrt(n*c),duration:t}}}var du=12;function hu(t,e,r){let n=r;for(let i=1;i<du;i++)n=n-t(n)/e(n);return n}function Br(t,e){return t*Math.sqrt(1-e*e)}var pu=["duration","bounce"],fu=["stiffness","damping","mass"];function la(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(!la(t,fu)&&la(t,pu)){let r=aa(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:n=2,restDelta:i}=t,s=Ur(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:a,damping:l,mass:c,velocity:d,duration:h,isResolvedFromDuration:f}=mu(s),w=ca,p=ca;function S(){let b=d?-(d/1e3):0,$=r-e,y=l/(2*Math.sqrt(a*c)),k=Math.sqrt(a/c)/1e3;if(i===void 0&&(i=Math.min(Math.abs(r-e)/100,.4)),y<1){let E=Br(k,y);w=O=>{let B=Math.exp(-y*k*O);return r-B*((b+y*k*$)/E*Math.sin(E*O)+$*Math.cos(E*O))},p=O=>{let B=Math.exp(-y*k*O);return y*k*B*(Math.sin(E*O)*(b+y*k*$)/E+$*Math.cos(E*O))-B*(Math.cos(E*O)*(b+y*k*$)-E*$*Math.sin(E*O))}}else if(y===1)w=E=>r-Math.exp(-k*E)*($+(b+k*$)*E);else{let E=k*Math.sqrt(y*y-1);w=O=>{let B=Math.exp(-y*k*O),N=Math.min(E*O,300);return r-B*((b+y*k*$)*Math.sinh(N)+E*$*Math.cosh(N))/E}}}return S(),{next:b=>{let $=w(b);if(f)o.done=b>=h;else{let y=p(b)*1e3,k=Math.abs(y)<=n,E=Math.abs(r-$)<=i;o.done=k&&E}return o.value=o.done?r:$,o},flipTarget:()=>{d=-d,[e,r]=[r,e],S()}}}Fr.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var ca=t=>0;var ji=(t,e,r)=>{let n=e-t;return n===0?1:(r-t)/n};var lt=(t,e,r)=>-r*t+r*e+t;var qr=(t,e)=>r=>Math.max(Math.min(r,e),t),Ce=t=>t%1?Number(t.toFixed(5)):t,ct=/(-)?([\d]*\.?[\d])+/g,Vr=/(#[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,ua=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function we(t){return typeof t=="string"}var ut={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Nr=Object.assign(Object.assign({},ut),{transform:qr(0,1)}),Tf=Object.assign(Object.assign({},ut),{default:1});var Pt=t=>({test:e=>we(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Pf=Pt("deg"),dt=Pt("%"),Uf=Pt("px"),Rf=Pt("vh"),Bf=Pt("vw"),Ff=Object.assign(Object.assign({},dt),{parse:t=>dt.parse(t)/100,transform:t=>dt.transform(t*100)});var ht=(t,e)=>r=>!!(we(r)&&ua.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Hr=(t,e,r)=>n=>{if(!we(n))return n;let[i,s,o,a]=n.match(ct);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var de={test:ht("hsl","hue"),parse:Hr("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+dt.transform(Ce(e))+", "+dt.transform(Ce(r))+", "+Ce(Nr.transform(n))+")"};var gu=qr(0,255),zr=Object.assign(Object.assign({},ut),{transform:t=>Math.round(gu(t))}),ne={test:ht("rgb","red"),parse:Hr("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+zr.transform(t)+", "+zr.transform(e)+", "+zr.transform(r)+", "+Ce(Nr.transform(n))+")"};function wu(t){let e="",r="",n="",i="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),n=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),n=t.substr(3,1),i=t.substr(4,1),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}var pt={test:ht("#"),parse:wu,transform:ne.transform};var _e={test:t=>ne.test(t)||pt.test(t)||de.test(t),parse:t=>ne.test(t)?ne.parse(t):de.test(t)?de.parse(t):pt.parse(t),transform:t=>we(t)?t:t.hasOwnProperty("red")?ne.transform(t):de.transform(t)};var da="${c}",ha="${n}";function yu(t){var e,r,n,i;return isNaN(t)&&we(t)&&((r=(e=t.match(ct))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((i=(n=t.match(Vr))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0)>0}function pa(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,n=t.match(Vr);n&&(r=n.length,t=t.replace(Vr,da),e.push(...n.map(_e.parse)));let i=t.match(ct);return i&&(t=t.replace(ct,ha),e.push(...i.map(ut.parse))),{values:e,numColors:r,tokenised:t}}function fa(t){return pa(t).values}function ma(t){let{values:e,numColors:r,tokenised:n}=pa(t),i=e.length;return s=>{let o=n;for(let a=0;a<i;a++)o=o.replace(a<r?da:ha,a<r?_e.transform(s[a]):Ce(s[a]));return o}}var vu=t=>typeof t=="number"?0:t;function bu(t){let e=fa(t);return ma(t)(e.map(vu))}var Wr={test:yu,parse:fa,createTransformer:ma,getAnimatableNone:bu};function Oi(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 Pi({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{let a=r<.5?r*(1+e):r+e-r*e,l=2*r-a;i=Oi(l,a,t+1/3),s=Oi(l,a,t),o=Oi(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}var xu=(t,e,r)=>{let n=t*t,i=e*e;return Math.sqrt(Math.max(0,r*(i-n)+n))},ku=[pt,ne,de],ga=t=>ku.find(e=>e.test(t)),wa=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,Gr=(t,e)=>{let r=ga(t),n=ga(e);at(!!r,wa(t)),at(!!n,wa(e));let i=r.parse(t),s=n.parse(e);r===de&&(i=Pi(i),r=ne),n===de&&(s=Pi(s),n=ne);let o=Object.assign({},i);return a=>{for(let l in o)l!=="alpha"&&(o[l]=xu(i[l],s[l],a));return o.alpha=lt(i.alpha,s.alpha,a),r.transform(o)}};var ya=t=>typeof t=="number";var Cu=(t,e)=>r=>e(t(r)),Zr=(...t)=>t.reduce(Cu);function ba(t,e){return ya(t)?r=>lt(t,e,r):_e.test(t)?Gr(t,e):Ri(t,e)}var Ui=(t,e)=>{let r=[...t],n=r.length,i=t.map((s,o)=>ba(s,e[o]));return s=>{for(let o=0;o<n;o++)r[o]=i[o](s);return r}},xa=(t,e)=>{let r=Object.assign(Object.assign({},t),e),n={};for(let i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=ba(t[i],e[i]));return i=>{for(let s in n)r[s]=n[s](i);return r}};function va(t){let e=Wr.parse(t),r=e.length,n=0,i=0,s=0;for(let o=0;o<r;o++)n||typeof e[o]=="number"?n++:e[o].hue!==void 0?s++:i++;return{parsed:e,numNumbers:n,numRGB:i,numHSL:s}}var Ri=(t,e)=>{let r=Wr.createTransformer(e),n=va(t),i=va(e);return n.numHSL===i.numHSL&&n.numRGB===i.numRGB&&n.numNumbers>=i.numNumbers?Zr(Ui(n.parsed,i.parsed),r):(Rr(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),o=>`${o>0?e:t}`)};var _u=(t,e)=>r=>lt(t,e,r);function $u(t){if(typeof t=="number")return _u;if(typeof t=="string")return _e.test(t)?Gr:Ri;if(Array.isArray(t))return Ui;if(typeof t=="object")return xa}function Su(t,e,r){let n=[],i=r||$u(t[0]),s=t.length-1;for(let o=0;o<s;o++){let a=i(t[o],t[o+1]);if(e){let l=Array.isArray(e)?e[o]:e;a=Zr(l,a)}n.push(a)}return n}function Eu([t,e],[r]){return n=>r(ji(t,e,n))}function Mu(t,e){let r=t.length,n=r-1;return i=>{let s=0,o=!1;if(i<=t[0]?o=!0:i>=t[n]&&(s=n-1,o=!0),!o){let l=1;for(;l<r&&!(t[l]>i||l===n);l++);s=l-1}let a=ji(t[s],t[s+1],i);return e[s](a)}}function Xr(t,e,{clamp:r=!0,ease:n,mixer:i}={}){let s=t.length;at(s===e.length,"Both input and output ranges must be the same length"),at(!n||!Array.isArray(n)||n.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());let o=Su(e,n,i),a=s===2?Eu(t,o):Mu(t,o);return r?l=>a(Ot(t[0],t[s-1],l)):a}var Ut=t=>e=>1-t(1-e),Jr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ka=t=>e=>Math.pow(e,t),Bi=t=>e=>e*e*((t+1)*e-t),Ca=t=>{let e=Bi(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var _a=1.525,Au=4/11,Iu=8/11,Lu=9/10;var $a=ka(2),N2=Ut($a),Sa=Jr($a),Du=t=>1-Math.sin(Math.acos(t)),Tu=Ut(Du),H2=Jr(Tu),Ea=Bi(_a),z2=Ut(Ea),W2=Jr(Ea),G2=Ca(_a),ju=4356/361,Ou=35442/1805,Pu=16061/1805,Uu=t=>{if(t===1||t===0)return t;let e=t*t;return t<Au?7.5625*e:t<Iu?9.075*e-9.9*t+3.4:t<Lu?ju*e-Ou*t+Pu:10.8*t*t-20.52*t+10.72},Z2=Ut(Uu);function Ru(t,e){return t.map(()=>e||Sa).splice(0,t.length-1)}function Bu(t){let e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function Fu(t,e){return t.map(r=>r*e)}function Rt({from:t=0,to:e=1,ease:r,offset:n,duration:i=300}){let s={done:!1,value:t},o=Array.isArray(e)?e:[t,e],a=Fu(n&&n.length===o.length?n:Bu(o),i);function l(){return Xr(a,o,{ease:Array.isArray(r)?r:Ru(o,r)})}let c=l();return{next:d=>(s.value=c(d),s.done=d>=i,s),flipTarget:()=>{o.reverse(),c=l()}}}function Ma({velocity:t=0,from:e=0,power:r=.8,timeConstant:n=350,restDelta:i=.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 h=-a*Math.exp(-d/n);return o.done=!(h>i||h<-i),o.value=o.done?c:c+h,o},flipTarget:()=>{}}}var Aa={keyframes:Rt,spring:Fr,decay:Ma};function Ia(t){if(Array.isArray(t.to))return Rt;if(Aa[t.type])return Aa[t.type];let e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Rt:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Fr:Rt}var Fi=16.666666666666668,qu=typeof performance<"u"?()=>performance.now():()=>Date.now(),qi=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(qu()),Fi);function La(t){let e=[],r=[],n=0,i=!1,s=!1,o=new WeakSet,a={schedule:(l,c=!1,d=!1)=>{let h=d&&i,f=h?e:r;return c&&o.add(l),f.indexOf(l)===-1&&(f.push(l),h&&i&&(n=e.length)),l},cancel:l=>{let c=r.indexOf(l);c!==-1&&r.splice(c,1),o.delete(l)},process:l=>{if(i){s=!0;return}if(i=!0,[e,r]=[r,e],r.length=0,n=e.length,n)for(let c=0;c<n;c++){let d=e[c];d(l),o.has(d)&&(a.schedule(d),t())}i=!1,s&&(s=!1,a.process(l))}};return a}var Vu=40,Vi=!0,Ft=!1,Ni=!1,Bt={delta:0,timestamp:0},qt=["read","update","preRender","render","postRender"],Yr=qt.reduce((t,e)=>(t[e]=La(()=>Ft=!0),t),{}),Nu=qt.reduce((t,e)=>{let r=Yr[e];return t[e]=(n,i=!1,s=!1)=>(Ft||zu(),r.schedule(n,i,s)),t},{}),Da=qt.reduce((t,e)=>(t[e]=Yr[e].cancel,t),{}),lm=qt.reduce((t,e)=>(t[e]=()=>Yr[e].process(Bt),t),{}),Hu=t=>Yr[t].process(Bt),Ta=t=>{Ft=!1,Bt.delta=Vi?Fi:Math.max(Math.min(t-Bt.timestamp,Vu),1),Bt.timestamp=t,Ni=!0,qt.forEach(Hu),Ni=!1,Ft&&(Vi=!1,qi(Ta))},zu=()=>{Ft=!0,Vi=!0,Ni||qi(Ta)};var ja=Nu;function Hi(t,e,r=0){return t-e-r}function Oa(t,e,r=0,n=!0){return n?Hi(e+-t,e,r):e-(t-e)+r}function Pa(t,e,r,n){return n?t>=e+r:t<=-r}var Wu=t=>{let e=({delta:r})=>t(r);return{start:()=>ja.update(e,!0),stop:()=>Da.update(e)}};function zi(t){var e,r,{from:n,autoplay:i=!0,driver:s=Wu,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:d,onStop:h,onComplete:f,onRepeat:w,onUpdate:p}=t,S=Ur(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:b}=S,$,y=0,k=S.duration,E,O=!1,B=!0,N,I=Ia(S);!((r=(e=I).needsInterpolation)===null||r===void 0)&&r.call(e,n,b)&&(N=Xr([0,100],[n,b],{clamp:!1}),n=0,b=100);let H=I(Object.assign(Object.assign({},S),{from:n,to:b}));function J(){y++,l==="reverse"?(B=y%2===0,o=Oa(o,k,c,B)):(o=Hi(o,k,c),l==="mirror"&&H.flipTarget()),O=!1,w&&w()}function ln(){$.stop(),f&&f()}function Se(U){if(B||(U=-U),o+=U,!O){let z=H.next(Math.max(0,o));E=z.value,N&&(E=N(E)),O=B?z.done:o<=0}p?.(E),O&&(y===0&&(k??(k=o)),y<a?Pa(o,k,c,B)&&J():ln())}function Gt(){d?.(),$=s(Se),$.start()}return i&&Gt(),{stop:()=>{h?.(),$.stop()}}}var Vt=class t extends x(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`
2346
+ `}};customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",On);function Br(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(){},at=function(){};var Ot=(t,e,r)=>Math.min(Math.max(r,t),e);var Pn=.001,fu=.01,da=10,mu=.05,gu=1;function ha({duration:t=800,bounce:e=.25,velocity:r=0,mass:i=1}){let n,s;Fr(t<=da*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=Ot(mu,gu,o),t=Ot(fu,da,t/1e3),o<1?(n=c=>{let d=c*o,h=d*t,f=d-r,w=qr(c,o),p=Math.exp(-h);return Pn-f/w*p},s=c=>{let h=c*o*t,f=h*r+r,w=Math.pow(o,2)*Math.pow(c,2)*t,p=Math.exp(-h),S=qr(Math.pow(c,2),o);return(-n(c)+Pn>0?-1:1)*((f-w)*p)/S}):(n=c=>{let d=Math.exp(-c*t),h=(c-r)*t+1;return-Pn+d*h},s=c=>{let d=Math.exp(-c*t),h=(r-c)*(t*t);return d*h});let a=5/t,l=yu(n,s,a);if(t=t*1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{let c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:t}}}var wu=12;function yu(t,e,r){let i=r;for(let n=1;n<wu;n++)i=i-t(i)/e(i);return i}function qr(t,e){return t*Math.sqrt(1-e*e)}var vu=["duration","bounce"],bu=["stiffness","damping","mass"];function pa(t,e){return e.some(r=>t[r]!==void 0)}function xu(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!pa(t,bu)&&pa(t,vu)){let r=ha(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Vr(t){var{from:e=0,to:r=1,restSpeed:i=2,restDelta:n}=t,s=Br(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:a,damping:l,mass:c,velocity:d,duration:h,isResolvedFromDuration:f}=xu(s),w=fa,p=fa;function S(){let b=d?-(d/1e3):0,$=r-e,y=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)),y<1){let E=qr(k,y);w=O=>{let B=Math.exp(-y*k*O);return r-B*((b+y*k*$)/E*Math.sin(E*O)+$*Math.cos(E*O))},p=O=>{let B=Math.exp(-y*k*O);return y*k*B*(Math.sin(E*O)*(b+y*k*$)/E+$*Math.cos(E*O))-B*(Math.cos(E*O)*(b+y*k*$)-E*$*Math.sin(E*O))}}else if(y===1)w=E=>r-Math.exp(-k*E)*($+(b+k*$)*E);else{let E=k*Math.sqrt(y*y-1);w=O=>{let B=Math.exp(-y*k*O),H=Math.min(E*O,300);return r-B*((b+y*k*$)*Math.sinh(H)+E*$*Math.cosh(H))/E}}}return S(),{next:b=>{let $=w(b);if(f)o.done=b>=h;else{let y=p(b)*1e3,k=Math.abs(y)<=i,E=Math.abs(r-$)<=n;o.done=k&&E}return o.value=o.done?r:$,o},flipTarget:()=>{d=-d,[e,r]=[r,e],S()}}}Vr.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var fa=t=>0;var Un=(t,e,r)=>{let i=e-t;return i===0?1:(r-t)/i};var lt=(t,e,r)=>-r*t+r*e+t;var Nr=(t,e)=>r=>Math.max(Math.min(r,e),t),Ce=t=>t%1?Number(t.toFixed(5)):t,ct=/(-)?([\d]*\.?[\d])+/g,Hr=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,ma=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function we(t){return typeof t=="string"}var ut={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},zr=Object.assign(Object.assign({},ut),{transform:Nr(0,1)}),Vf=Object.assign(Object.assign({},ut),{default:1});var Pt=t=>({test:e=>we(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),zf=Pt("deg"),dt=Pt("%"),Wf=Pt("px"),Gf=Pt("vh"),Zf=Pt("vw"),Xf=Object.assign(Object.assign({},dt),{parse:t=>dt.parse(t)/100,transform:t=>dt.transform(t*100)});var ht=(t,e)=>r=>!!(we(r)&&ma.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Wr=(t,e,r)=>i=>{if(!we(i))return i;let[n,s,o,a]=i.match(ct);return{[t]:parseFloat(n),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var de={test:ht("hsl","hue"),parse:Wr("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:i=1})=>"hsla("+Math.round(t)+", "+dt.transform(Ce(e))+", "+dt.transform(Ce(r))+", "+Ce(zr.transform(i))+")"};var ku=Nr(0,255),Gr=Object.assign(Object.assign({},ut),{transform:t=>Math.round(ku(t))}),ie={test:ht("rgb","red"),parse:Wr("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:i=1})=>"rgba("+Gr.transform(t)+", "+Gr.transform(e)+", "+Gr.transform(r)+", "+Ce(zr.transform(i))+")"};function Cu(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 pt={test:ht("#"),parse:Cu,transform:ie.transform};var _e={test:t=>ie.test(t)||pt.test(t)||de.test(t),parse:t=>ie.test(t)?ie.parse(t):de.test(t)?de.parse(t):pt.parse(t),transform:t=>we(t)?t:t.hasOwnProperty("red")?ie.transform(t):de.transform(t)};var ga="${c}",wa="${n}";function _u(t){var e,r,i,n;return isNaN(t)&&we(t)&&((r=(e=t.match(ct))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((n=(i=t.match(Hr))===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0)>0}function ya(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,i=t.match(Hr);i&&(r=i.length,t=t.replace(Hr,ga),e.push(...i.map(_e.parse)));let n=t.match(ct);return n&&(t=t.replace(ct,wa),e.push(...n.map(ut.parse))),{values:e,numColors:r,tokenised:t}}function va(t){return ya(t).values}function ba(t){let{values:e,numColors:r,tokenised:i}=ya(t),n=e.length;return s=>{let o=i;for(let a=0;a<n;a++)o=o.replace(a<r?ga:wa,a<r?_e.transform(s[a]):Ce(s[a]));return o}}var $u=t=>typeof t=="number"?0:t;function Su(t){let e=va(t);return ba(t)(e.map($u))}var Zr={test:_u,parse:va,createTransformer:ba,getAnimatableNone:Su};function Rn(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 Bn({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=Rn(l,a,t+1/3),s=Rn(l,a,t),o=Rn(l,a,t-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}var Eu=(t,e,r)=>{let i=t*t,n=e*e;return Math.sqrt(Math.max(0,r*(n-i)+i))},Mu=[pt,ie,de],xa=t=>Mu.find(e=>e.test(t)),ka=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,Xr=(t,e)=>{let r=xa(t),i=xa(e);at(!!r,ka(t)),at(!!i,ka(e));let n=r.parse(t),s=i.parse(e);r===de&&(n=Bn(n),r=ie),i===de&&(s=Bn(s),i=ie);let o=Object.assign({},n);return a=>{for(let l in o)l!=="alpha"&&(o[l]=Eu(n[l],s[l],a));return o.alpha=lt(n.alpha,s.alpha,a),r.transform(o)}};var Ca=t=>typeof t=="number";var Au=(t,e)=>r=>e(t(r)),Jr=(...t)=>t.reduce(Au);function $a(t,e){return Ca(t)?r=>lt(t,e,r):_e.test(t)?Xr(t,e):qn(t,e)}var Fn=(t,e)=>{let r=[...t],i=r.length,n=t.map((s,o)=>$a(s,e[o]));return s=>{for(let o=0;o<i;o++)r[o]=n[o](s);return r}},Sa=(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]=$a(t[n],e[n]));return n=>{for(let s in i)r[s]=i[s](n);return r}};function _a(t){let e=Zr.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 qn=(t,e)=>{let r=Zr.createTransformer(e),i=_a(t),n=_a(e);return i.numHSL===n.numHSL&&i.numRGB===n.numRGB&&i.numNumbers>=n.numNumbers?Jr(Fn(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 Iu=(t,e)=>r=>lt(t,e,r);function Lu(t){if(typeof t=="number")return Iu;if(typeof t=="string")return _e.test(t)?Xr:qn;if(Array.isArray(t))return Fn;if(typeof t=="object")return Sa}function Du(t,e,r){let i=[],n=r||Lu(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 Tu([t,e],[r]){return i=>r(Un(t,e,i))}function ju(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;at(s===e.length,"Both input and output ranges must be the same length"),at(!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=Du(e,i,n),a=s===2?Tu(t,o):ju(t,o);return r?l=>a(Ot(t[0],t[s-1],l)):a}var Ut=t=>e=>1-t(1-e),Kr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ea=t=>e=>Math.pow(e,t),Vn=t=>e=>e*e*((t+1)*e-t),Ma=t=>{let e=Vn(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var Aa=1.525,Ou=4/11,Pu=8/11,Uu=9/10;var Ia=Ea(2),K2=Ut(Ia),La=Kr(Ia),Ru=t=>1-Math.sin(Math.acos(t)),Bu=Ut(Ru),Q2=Kr(Bu),Da=Vn(Aa),em=Ut(Da),tm=Kr(Da),rm=Ma(Aa),Fu=4356/361,qu=35442/1805,Vu=16061/1805,Nu=t=>{if(t===1||t===0)return t;let e=t*t;return t<Ou?7.5625*e:t<Pu?9.075*e-9.9*t+3.4:t<Uu?Fu*e-qu*t+Vu:10.8*t*t-20.52*t+10.72},im=Ut(Nu);function Hu(t,e){return t.map(()=>e||La).splice(0,t.length-1)}function zu(t){let e=t.length;return t.map((r,i)=>i!==0?i/(e-1):0)}function Wu(t,e){return t.map(r=>r*e)}function Rt({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=Wu(i&&i.length===o.length?i:zu(o),n);function l(){return Yr(a,o,{ease:Array.isArray(r)?r:Hu(o,r)})}let c=l();return{next:d=>(s.value=c(d),s.done=d>=n,s),flipTarget:()=>{o.reverse(),c=l()}}}function Ta({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 h=-a*Math.exp(-d/i);return o.done=!(h>n||h<-n),o.value=o.done?c:c+h,o},flipTarget:()=>{}}}var ja={keyframes:Rt,spring:Vr,decay:Ta};function Oa(t){if(Array.isArray(t.to))return Rt;if(ja[t.type])return ja[t.type];let e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Rt:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Vr:Rt}var Nn=16.666666666666668,Gu=typeof performance<"u"?()=>performance.now():()=>Date.now(),Hn=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Gu()),Nn);function Pa(t){let e=[],r=[],i=0,n=!1,s=!1,o=new WeakSet,a={schedule:(l,c=!1,d=!1)=>{let h=d&&n,f=h?e:r;return c&&o.add(l),f.indexOf(l)===-1&&(f.push(l),h&&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 Zu=40,zn=!0,Ft=!1,Wn=!1,Bt={delta:0,timestamp:0},qt=["read","update","preRender","render","postRender"],Qr=qt.reduce((t,e)=>(t[e]=Pa(()=>Ft=!0),t),{}),Xu=qt.reduce((t,e)=>{let r=Qr[e];return t[e]=(i,n=!1,s=!1)=>(Ft||Yu(),r.schedule(i,n,s)),t},{}),Ua=qt.reduce((t,e)=>(t[e]=Qr[e].cancel,t),{}),wm=qt.reduce((t,e)=>(t[e]=()=>Qr[e].process(Bt),t),{}),Ju=t=>Qr[t].process(Bt),Ra=t=>{Ft=!1,Bt.delta=zn?Nn:Math.max(Math.min(t-Bt.timestamp,Zu),1),Bt.timestamp=t,Wn=!0,qt.forEach(Ju),Wn=!1,Ft&&(zn=!1,Hn(Ra))},Yu=()=>{Ft=!0,zn=!0,Wn||Hn(Ra)};var Ba=Xu;function Gn(t,e,r=0){return t-e-r}function Fa(t,e,r=0,i=!0){return i?Gn(e+-t,e,r):e-(t-e)+r}function qa(t,e,r,i){return i?t>=e+r:t<=-r}var Ku=t=>{let e=({delta:r})=>t(r);return{start:()=>Ba.update(e,!0),stop:()=>Ua.update(e)}};function Zn(t){var e,r,{from:i,autoplay:n=!0,driver:s=Ku,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:d,onStop:h,onComplete:f,onRepeat:w,onUpdate:p}=t,S=Br(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:b}=S,$,y=0,k=S.duration,E,O=!1,B=!0,H,I=Oa(S);!((r=(e=I).needsInterpolation)===null||r===void 0)&&r.call(e,i,b)&&(H=Yr([0,100],[i,b],{clamp:!1}),i=0,b=100);let z=I(Object.assign(Object.assign({},S),{from:i,to:b}));function J(){y++,l==="reverse"?(B=y%2===0,o=Fa(o,k,c,B)):(o=Gn(o,k,c),l==="mirror"&&z.flipTarget()),O=!1,w&&w()}function ci(){$.stop(),f&&f()}function Se(U){if(B||(U=-U),o+=U,!O){let W=z.next(Math.max(0,o));E=W.value,H&&(E=H(E)),O=B?W.done:o<=0}p?.(E),O&&(y===0&&(k??(k=o)),y<a?qa(o,k,c,B)&&J():ci())}function Xt(){d?.(),$=s(Se),$.start()}return n&&Xt(),{stop:()=>{h?.(),$.stop()}}}var Vt=class t extends x(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`
2335
2347
  <div class="${this.darkMode?"dark border-gray-600 bg-[#1E1F23]":"border-[#5e5d59]/25 bg-white"} my-2 w-full rounded-3xl border p-4">
2336
2348
  <div class="relative mx-auto mb-4 max-w-[240px]">
2337
2349
  <div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200 dark:bg-gray-700"></div>
@@ -2350,7 +2362,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2350
2362
  <div class="h-8 flex-auto animate-pulse rounded-xl bg-gray-200 dark:bg-gray-700"></div>
2351
2363
  </div>
2352
2364
  </div>
2353
- `;if(this.product.layout==="horizontal")return u`<mw-product-card-horizontal product="${JSON.stringify(this.product)}" ?dark-mode="${this.darkMode}"></mw-product-card-horizontal>`;let{name:e,description:r,price:n,category:i}=this.product;return u`
2365
+ `;if(this.product.layout==="horizontal")return u`<mw-product-card-horizontal product="${JSON.stringify(this.product)}" ?dark-mode="${this.darkMode}"></mw-product-card-horizontal>`;let{name:e,description:r,price:i,category:n}=this.product;return u`
2354
2366
  <div class="${this.darkMode?"dark border-gray-600 bg-[#1E1F23]":"border-[#5e5d59]/25 bg-white"} my-2 w-full rounded-3xl border-[0.5px] p-4 hover:shadow-sm">
2355
2367
  <div class="pointer-events-auto mx-auto mb-4">
2356
2368
  <div class="group relative overflow-hidden rounded-2xl">
@@ -2378,7 +2390,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2378
2390
  <hi-outline class="block h-6 w-3" name="chevron-left"></hi-outline>
2379
2391
  </button>
2380
2392
  <button
2381
- @click="${this.#i}"
2393
+ @click="${this.#n}"
2382
2394
  class="bg-opacity-80 hover:bg-opacity-100 absolute top-1/2 right-2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white shadow transition-all dark:bg-gray-700">
2383
2395
  <hi-outline class="block h-6 w-3" name="chevron-right"></hi-outline>
2384
2396
  </button>
@@ -2396,9 +2408,9 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2396
2408
  </div>
2397
2409
  </div>
2398
2410
  <div @click="${this.#t}" class="cursor-pointer">
2399
- ${i?u`
2411
+ ${n?u`
2400
2412
  <a @click="${this.#t}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline dark:text-gray-400">
2401
- ${i}
2413
+ ${n}
2402
2414
  </a>
2403
2415
  `:null}
2404
2416
 
@@ -2408,7 +2420,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2408
2420
  ${e||u`<span class="inline-block h-6 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></span>`}
2409
2421
  </h3>
2410
2422
  ${r?u`<p class="mb-2 line-clamp-2 text-sm text-gray-600 dark:text-gray-400">${r}</p>`:u`<div class="mb-2 h-4 w-3/4 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></div>`}
2411
- <span class="text-lg font-bold text-black dark:text-gray-200"> ${n||u`<span class="inline-block h-6 w-16 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></span>`} </span>
2423
+ <span class="text-lg font-bold text-black dark:text-gray-200"> ${i||u`<span class="inline-block h-6 w-16 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></span>`} </span>
2412
2424
 
2413
2425
  <!-- <div class="my-4 border-t border-gray-200"></div> -->
2414
2426
 
@@ -2420,7 +2432,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2420
2432
  </button> -->
2421
2433
  </div>
2422
2434
  </div>
2423
- `}#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&&zi({from:e,to:r,duration:300,onUpdate:n=>{this.#a&&(this.#a.style.transform=`translateX(${n}%)`)}})}#i(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e+1)%this.product.images.length,n=-(e*100),i=-(r*100);this.#n(n,i),this._currentImageIndex=r}#s(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e-1+this.product.images.length)%this.product.images.length,n=-(e*100),i=-(r*100);this.#n(n,i),this._currentImageIndex=r}#o(e){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=Math.max(0,Math.min(e,this.product.images.length-1)),i=-(r*100),s=-(n*100);this.#n(i,s),this._currentImageIndex=n}get#a(){return this.renderRoot.querySelector(".image-slider")}};Vt.AddToCartEvent=class extends CustomEvent{static type="mw-product-card:add-to-cart";constructor(e,r={}){super(Vt.AddToCartEvent.type,{detail:{product:e},...r})}};customElements.get("mw-product-card")||customElements.define("mw-product-card",Vt);function Kr(t){return Array.isArray(t)?t:t?[t]:[]}function Ua(t,e){return Map.groupBy(t,e)}var Wi=class extends x(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||[]),n=Kr(this.orderDetails?.actions||[]);return u`
2435
+ `}#t(e){e.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")}#r(e){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new t.AddToCartEvent(this.product)))}#i(e,r){this.#a&&Zn({from:e,to:r,duration:300,onUpdate:i=>{this.#a&&(this.#a.style.transform=`translateX(${i}%)`)}})}#n(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e+1)%this.product.images.length,i=-(e*100),n=-(r*100);this.#i(i,n),this._currentImageIndex=r}#s(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e-1+this.product.images.length)%this.product.images.length,i=-(e*100),n=-(r*100);this.#i(i,n),this._currentImageIndex=r}#o(e){if(!this.product?.images?.length)return;let r=this._currentImageIndex,i=Math.max(0,Math.min(e,this.product.images.length-1)),n=-(r*100),s=-(i*100);this.#i(n,s),this._currentImageIndex=i}get#a(){return this.renderRoot.querySelector(".image-slider")}};Vt.AddToCartEvent=class extends CustomEvent{static type="mw-product-card:add-to-cart";constructor(e,r={}){super(Vt.AddToCartEvent.type,{detail:{product:e},...r})}};customElements.get("mw-product-card")||customElements.define("mw-product-card",Vt);function ei(t){return Array.isArray(t)?t:t?[t]:[]}function Va(t,e){return Map.groupBy(t,e)}var Xn=class extends x(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=ei(this.orderDetails?.order_status?.step||[]),r=ei(this.orderDetails?.items?.item||[]),i=ei(this.orderDetails?.actions||[]);return u`
2424
2436
  <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">
2425
2437
  <!-- Header with order ID -->
2426
2438
  <div class="mb-2">
@@ -2432,7 +2444,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2432
2444
  <ol role="list" class="w-full overflow-hidden">
2433
2445
  ${this.streaming&&!this.orderDetails?u`
2434
2446
  <!-- Loading for status timeline -->
2435
- ${[1,2,3].map((i,s)=>u`
2447
+ ${[1,2,3].map((n,s)=>u`
2436
2448
  <li class="w-full pb-8">
2437
2449
  ${s<2?u`<div class="absolute top-2 left-2 mt-0.5 -ml-px h-full w-0.5 animate-pulse bg-gray-200 dark:bg-gray-600" aria-hidden="true"></div>`:""}
2438
2450
  <div class="group relative flex items-start">
@@ -2445,12 +2457,12 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2445
2457
  </div>
2446
2458
  </li>
2447
2459
  `)}
2448
- `:X(e,i=>i.label,(i,s)=>{let o=i.status==="completed",a=i.status==="in_progress",l=s===e.length-1;return u`
2460
+ `:X(e,n=>n.label,(n,s)=>{let o=n.status==="completed",a=n.status==="in_progress",l=s===e.length-1;return u`
2449
2461
  <li class="relative pb-4">
2450
2462
  ${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>`}
2451
2463
 
2452
2464
  <div class="group relative flex items-start">
2453
- ${ot(i.status,[["pending",()=>u`
2465
+ ${ot(n.status,[["pending",()=>u`
2454
2466
  <span class="flex h-6 items-center">
2455
2467
  <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]">
2456
2468
  <span class="h-1.5 w-1.5 rounded-full bg-transparent"></span>
@@ -2478,7 +2490,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2478
2490
 
2479
2491
  <span class="ml-3 flex min-w-0 flex-col">
2480
2492
  <span class="${`text-sm font-medium ${a?`text-[${this.color}]`:o?"text-gray-900 dark:text-gray-100":"text-gray-500 dark:text-gray-400"}`}">
2481
- ${i.label}
2493
+ ${n.label}
2482
2494
  </span>
2483
2495
  </span>
2484
2496
  </div>
@@ -2517,14 +2529,14 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2517
2529
  <div class="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2518
2530
  </div>
2519
2531
  `)}
2520
- `:r?.map(i=>{let s=i?.image_url;return u`
2532
+ `:r?.map(n=>{let s=n?.image_url;return u`
2521
2533
  <div class="flex items-center gap-2 py-1.5">
2522
- <img src="${G(s)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
2534
+ <img src="${N(s)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
2523
2535
 
2524
2536
  <div class="min-w-0 flex-1">
2525
- ${!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>`}
2537
+ ${!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>`}
2526
2538
  </div>
2527
- ${!i?.price&&this.streaming?u`<div class="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`:u`<span class="text-sm text-gray-500 dark:text-gray-400">${i?.quantity&&Number(i.quantity)>1?"x":""} ${i?.price}</span>`}
2539
+ ${!n?.price&&this.streaming?u`<div class="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`:u`<span class="text-sm text-gray-500 dark:text-gray-400">${n?.quantity&&Number(n.quantity)>1?"x":""} ${n?.price}</span>`}
2528
2540
  </div>
2529
2541
  `})}
2530
2542
  </div>
@@ -2602,20 +2614,20 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2602
2614
 
2603
2615
  <!-- Action buttons section -->
2604
2616
  <div class="flex w-full flex-col gap-2 overflow-hidden">
2605
- ${this.streaming&&!n[0]?.track_order?.label&&!Xe(n[0]?.track_order?.tracking_url||"")?u`
2617
+ ${this.streaming&&!i[0]?.track_order?.label&&!Xe(i[0]?.track_order?.tracking_url||"")?u`
2606
2618
  <!-- Loading shimmer for buttons -->
2607
2619
  <div class="h-10 w-full min-w-[250px] animate-pulse overflow-hidden rounded-xl bg-gray-200 dark:bg-gray-600"></div>
2608
- `:X(n,(i,s)=>`action-${s}`,i=>{if(i?.track_order?.label)return u`
2609
- ${Xe(i.track_order?.tracking_url||"")?u` <a
2620
+ `:X(i,(n,s)=>`action-${s}`,n=>{if(n?.track_order?.label)return u`
2621
+ ${Xe(n.track_order?.tracking_url||"")?u` <a
2610
2622
  target="${this.linksNewTab?"_blank":"_self"}"
2611
- href="${i.track_order?.tracking_url}"
2623
+ href="${n.track_order?.tracking_url}"
2612
2624
  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"
2613
- >${i.track_order.label}</a
2625
+ >${n.track_order.label}</a
2614
2626
  >`:null}
2615
2627
  `})}
2616
2628
  </div>
2617
2629
  </div>
2618
- `}};customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",Wi);var Gu={".section-spacing":{"@apply":"relative flex justify-center px-[25px] py-16 sm:px-9 sm:py-[45px] lg:px-24 lg:py-[104px]"}},Gi=It({preflight:{...Gu},hash:!1,darkMode:"class",theme:{extend:{fontFamily:{display:["Work Sans","sans-serif"],sans:["Inter","sans-serif"]},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"}}}},presets:[Sr(),Cr(),_r(),Er()],ignorelist:/^(sb-|css-|sbdocs|docblock|innerZoomElementWrapper|docs-|rejt-)/});var Zi=t=>Mr(Gi)(t);var Xi=class extends Zi(v){static styles=j`
2630
+ `}};customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",Xn);var Qu={".section-spacing":{"@apply":"relative flex justify-center px-[25px] py-16 sm:px-9 sm:py-[45px] lg:px-24 lg:py-[104px]"}},Jn=It({preflight:{...Qu},hash:!1,darkMode:"class",theme:{extend:{fontFamily:{display:["Work Sans","sans-serif"],sans:["Inter","sans-serif"]},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"}}}},presets:[Mr(),$r(),Sr(),Ar()],ignorelist:/^(sb-|css-|sbdocs|docblock|innerZoomElementWrapper|docs-|rejt-)/});var Nt=t=>Ir(Jn)(t);var Yn=class extends Nt(v){static styles=j`
2619
2631
  :host {
2620
2632
  --w-hover-arrow--hovered: 0;
2621
2633
  }
@@ -2636,7 +2648,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2636
2648
  <path part="tip" stroke="currentColor" fill="transparent" d="M1 1l4 4-4 4"></path>
2637
2649
  </g>
2638
2650
  </svg>
2639
- `}};customElements.get("w-hover-arrow")||customElements.define("w-hover-arrow",Xi);var Nt=class t extends x(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`
2651
+ `}};customElements.get("w-hover-arrow")||customElements.define("w-hover-arrow",Yn);var Ht=class t extends x(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`
2640
2652
  <div
2641
2653
  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}]">
2642
2654
  <div class="flex flex-col gap-2 p-4">
@@ -2659,12 +2671,12 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2659
2671
  <button
2660
2672
  type="button"
2661
2673
  ?disabled="${this._selectedRating>0}"
2662
- @click="${()=>this.#i(e)}"
2674
+ @click="${()=>this.#n(e)}"
2663
2675
  @mouseenter="${()=>this.#s(e)}"
2664
2676
  @mouseleave="${this.#o}"
2665
2677
  class="p-1 transition-transform hover:scale-110 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:scale-100"
2666
2678
  aria-label="${e} star${e>1?"s":""}">
2667
- ${this.#n(e)}
2679
+ ${this.#i(e)}
2668
2680
  </button>
2669
2681
  `)}
2670
2682
  </div>
@@ -2698,33 +2710,47 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2698
2710
  </svg>
2699
2711
  </button>
2700
2712
  </div>
2701
- `}#n(e){let r=this._selectedRating>0?this._selectedRating:this._hoverRating,n=e<=r;return u`
2702
- <svg class="${n?"text-yellow-400":"text-gray-300"} h-6 w-6" fill="${n?"currentColor":"none"}" stroke="currentColor" viewBox="0 0 24 24">
2713
+ `}#i(e){let r=this._selectedRating>0?this._selectedRating:this._hoverRating,i=e<=r;return u`
2714
+ <svg class="${i?"text-yellow-400":"text-gray-300"} h-6 w-6" fill="${i?"currentColor":"none"}" stroke="currentColor" viewBox="0 0 24 24">
2703
2715
  <path
2704
2716
  stroke-linecap="round"
2705
2717
  stroke-linejoin="round"
2706
2718
  stroke-width="2"
2707
2719
  d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" />
2708
2720
  </svg>
2709
- `}#i(e){this._selectedRating>0||(this._selectedRating=e,this._hoverRating=0,this.dispatchEvent(new t.SubmitEvent({type:"star-rating",rating:e})))}#s(e){this._selectedRating>0||(this._hoverRating=e)}#o(){this._selectedRating>0||(this._hoverRating=0)}#a(e){this._selectedVote||(this._selectedVote=e,this.dispatchEvent(new t.SubmitEvent({type:"binary-vote",vote:e})))}};Nt.SubmitEvent=class extends CustomEvent{static type="mw-request-input:submit";constructor(e,r={}){super(Nt.SubmitEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-request-input")||customElements.define("mw-request-input",Nt);var Ht=class extends rt{constructor(e){if(super(e),this.it=P,e.type!==Ar.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===P||e==null)return this._t=void 0,this.it=e;if(e===ie)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 Ra=Ir(Ht);var Ba=V({title:K(_(),"Agent joining in"),subtitle:K(_(),"We are finding a human agent to help you."),subtitle_past_join_time:K(_(),"It is taking a bit longer. A human agent will join any moment now."),expected_join_time:fr(Ye(_(),Un(),Fn())),game_title:K(_(),"\u{1F9E0} I will guess your job"),game_first_question:K(_(),"Does your job involve computers?"),game_result_prefix:K(_(),"My guess:"),game_button_start:K(_(),"\u{1F3AE} Play a game"),game_button_answer_affirmative:K(_(),"Yes"),game_button_answer_negative:K(_(),"No"),game_button_result_correct:K(_(),"Correct"),game_button_result_wrong:K(_(),"Wrong")});var Ji=t=>Ye(St(),qn(e=>Array.isArray(e)?e:[e]),Je(t));var Fa=V({order_id_label:A(_()),order_id_value:A(_()),timeline:A(V({step:Ji(V({label:A(_()),status:A(Et(["completed","in_progress","pending"]))}))})),items:A(V({item:Ji(V({name:A(_()),quantity:A(_()),price:A(_()),image:A(_())}))})),shipping_cost_label:A(_()),shipping_cost_amount:A(_()),total_label:A(_()),total_amount:A(_()),customer_name:A(_()),shipping_label:A(_()),shipping_method:A(_()),payment_label:A(_()),payment_method_label:A(_()),payment_method_value:A(_()),payment_status_label:A(_()),payment_status_value:A(_()),order_tracking_label:A(_()),order_tracking_url:A(_())});var qa=Js(V({url:_(),name:_(),description:_(),price:_()}));function Va(t,e,r,{imagesByProductUrl:n,linksNewTab:i=!0,searchParams:s,messageIsStreaming:o=!1,isSupportAgent:a,color:l="#601feb",darkMode:c=!1,apiBaseUrl:d="",cdnBaseUrl:h=""}){if(!t)return u``;let f=e>0&&r[e-1]&&"data"in r[e-1],w=e<r.length-1||!o;if("text"in t)return u`<p>${t.text}</p>`;if("html"in t)return u`${Ra(t.html)}`;if("data"in t)switch(t.tag){case"thought":{let p=t.data.__TEXT__?String(t.data.__TEXT__):"";return u`<mw-thought-block .content="${p}" ?dark-mode="${c}"></mw-thought-block>`}case"product-card":case"product-card-v1":case"product-card-horizontal":{let p=me(qa,t.data);if(p.success)return u`
2721
+ `}#n(e){this._selectedRating>0||(this._selectedRating=e,this._hoverRating=0,this.dispatchEvent(new t.SubmitEvent({type:"star-rating",rating:e})))}#s(e){this._selectedRating>0||(this._hoverRating=e)}#o(){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 Kn=class{#e;#t=0;#r;#i;#n;#s;#o=0;#a;constructor(e,{duration:r,initial:i,easing:n,onFrame:s,onComplete:o}){this.#a=i,this.#t=typeof r=="function"?0:r,this.#r=typeof r=="function"?r:void 0,this.#i=n??(a=>a),this.#n=s,this.#s=o,e.addController(this)}start(e){this.cancel(),this.#a=e,this.#r&&(this.#t=this.#r(e)),this.#o=performance.now(),this.#e=requestAnimationFrame(this.#l)}cancel(){this.#e!==void 0&&(cancelAnimationFrame(this.#e),this.#e=void 0)}get running(){return this.#e!==void 0}#l=e=>{let r=Math.min((e-this.#o)/this.#t,1),i=this.#i(r);this.#n(i,this.#a),r<1?this.#e=requestAnimationFrame(this.#l):(this.#e=void 0,this.#s?.(this.#a))};hostDisconnected(){this.cancel()}};function Na(t,e){return new Kn(t,e)}var zt=class t extends Nt(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=Na(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(),setTimeout(()=>this.#e.start({range:e}),this.delay)):this.dispatchEvent(new t.AnimationEndEvent)}});firstUpdated(){setTimeout(()=>{this._containerWidth=this.#t?.offsetWidth||0;let e=this._containerWidth+this.spotlightWidth*3;this.#e.start({range:e})},this.delay)}render(){let e=this.text.split("");return u`
2722
+ <div id="text-spotlight-container" class="${this.className} relative inline-block overflow-hidden whitespace-nowrap">
2723
+ <div class="text-[${this.textColor}]">
2724
+ ${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>`})}
2725
+ </div>
2726
+ </div>
2727
+ `}get#t(){return this.renderRoot.querySelector("#text-spotlight-container")}};zt.AnimationEndEvent=class extends CustomEvent{static type="text-spotlight:animation-end";constructor(e={}){super(zt.AnimationEndEvent.type,e)}};customElements.define("n-text-spotlight",zt);var Qn=class extends x(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`
2728
+ <n-text-spotlight
2729
+ text="${`${this.text||"Working"}\u2026`}"
2730
+ .speed="${3}"
2731
+ .textColor="${this.darkMode?"#9CA3AF":"#6B7280"}"
2732
+ .highlightColor="${this.color||(this.darkMode?"#FFFFFF":"#000000")}"
2733
+ class="block h-6 leading-6">
2734
+ </n-text-spotlight>
2735
+ `}};customElements.get("mw-tool-call-indicator")||customElements.define("mw-tool-call-indicator",Qn);var Wt=class extends rt{constructor(e){if(super(e),this.it=P,e.type!==Lr.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===P||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:[]}}};Wt.directiveName="unsafeHTML",Wt.resultType=1;var Ha=Dr(Wt);var za=V({title:K(_(),"Agent joining in"),subtitle:K(_(),"We are finding a human agent to help you."),subtitle_past_join_time:K(_(),"It is taking a bit longer. A human agent will join any moment now."),expected_join_time:gr(Ye(_(),Ri(),qi())),game_title:K(_(),"\u{1F9E0} I will guess your job"),game_first_question:K(_(),"Does your job involve computers?"),game_result_prefix:K(_(),"My guess:"),game_button_start:K(_(),"\u{1F3AE} Play a game"),game_button_answer_affirmative:K(_(),"Yes"),game_button_answer_negative:K(_(),"No"),game_button_result_correct:K(_(),"Correct"),game_button_result_wrong:K(_(),"Wrong")});var es=t=>Ye(St(),Vi(e=>Array.isArray(e)?e:[e]),Je(t));var Wa=V({order_id_label:A(_()),order_id_value:A(_()),timeline:A(V({step:es(V({label:A(_()),status:A(Et(["completed","in_progress","pending"]))}))})),items:A(V({item:es(V({name:A(_()),quantity:A(_()),price:A(_()),image:A(_())}))})),shipping_cost_label:A(_()),shipping_cost_amount:A(_()),total_label:A(_()),total_amount:A(_()),customer_name:A(_()),shipping_label:A(_()),shipping_method:A(_()),payment_label:A(_()),payment_method_label:A(_()),payment_method_value:A(_()),payment_status_label:A(_()),payment_status_value:A(_()),order_tracking_label:A(_()),order_tracking_url:A(_())});var Ga=eo(V({url:_(),name:_(),description:_(),price:_()}));function Za(t,e,r,{imagesByProductUrl:i,linksNewTab:n=!0,searchParams:s,messageIsStreaming:o=!1,isSupportAgent:a,color:l="#601feb",darkMode:c=!1,apiBaseUrl:d="",cdnBaseUrl:h=""}){if(!t)return u``;let f=e>0&&r[e-1]&&"data"in r[e-1],w=e<r.length-1||!o;if("text"in t)return u`<p>${t.text}</p>`;if("html"in t)return u`${Ha(t.html)}`;if("data"in t)switch(t.tag){case"thought":{let p=t.data.__TEXT__?String(t.data.__TEXT__):"";return u`<mw-thought-block .content="${p}" ?dark-mode="${c}"></mw-thought-block>`}case"product-card":case"product-card-v1":case"product-card-horizontal":{let p=me(Ga,t.data);if(p.success)return u`
2710
2736
  ${f?u`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
2711
2737
  <mw-product-card-horizontal
2712
2738
  .product="${p.output}"
2713
2739
  ?streaming="${!w}"
2714
- ?links-new-tab="${i}"
2740
+ ?links-new-tab="${n}"
2715
2741
  ?dark-mode="${c}"
2716
2742
  .searchParams="${s}"
2717
- .imagesByProductUrl="${n}"></mw-product-card-horizontal>
2743
+ .imagesByProductUrl="${i}"></mw-product-card-horizontal>
2718
2744
  `;console.warn("cannot parse product-card-v1",p.issues);break}case"order-status-card-v1":return u`
2719
2745
  <mw-product-order-status-card
2720
2746
  .orderDetails="${t.data}"
2721
2747
  ?streaming="${!w}"
2722
- ?links-new-tab="${i}"
2748
+ ?links-new-tab="${n}"
2723
2749
  ?dark-mode="${c}"
2724
2750
  color="${l}"></mw-product-order-status-card>
2725
- `;case"order-card-v2":{let p=me(Fa,t.data);p.success||console.warn("cannot parse order-card-v2",p.issues);let S=p.success?p.output:t.data;return u`
2751
+ `;case"order-card-v2":{let p=me(Wa,t.data);p.success||console.warn("cannot parse order-card-v2",p.issues);let S=p.success?p.output:t.data;return u`
2726
2752
  <!-- -->
2727
- <mw-order-card .orderDetails="${S}" ?streaming="${!w}" ?links-new-tab="${i}" ?dark-mode="${c}" color="${l}"></mw-order-card>
2753
+ <mw-order-card .orderDetails="${S}" ?streaming="${!w}" ?links-new-tab="${n}" ?dark-mode="${c}" color="${l}"></mw-order-card>
2728
2754
  `}case"live-chat-wait-card-v1":{let p=t.data||{};return a?u`<p><i>${p.message}</i></p>`:u`
2729
2755
  <mw-chat-wait-timer
2730
2756
  heading="${p.title||""}"
@@ -2743,7 +2769,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2743
2769
  cdnBaseUrl="${h}"
2744
2770
  sound="${h?`${h}/assets/game-intro.aac`:""}"
2745
2771
  ?dark-mode="${c}"></mw-chat-wait-timer>
2746
- `}case"live-chat-wait-card-v2":{let p=me(Ba,t.data||{});p.success||console.warn("cannot parse live-chat-wait-card-v2",p.issues);let S=p.success?p.output:t.data||{};return a?u`<p><i>${S.subtitle}</i></p>`:u`
2772
+ `}case"live-chat-wait-card-v2":{let p=me(za,t.data||{});p.success||console.warn("cannot parse live-chat-wait-card-v2",p.issues);let S=p.success?p.output:t.data||{};return a?u`<p><i>${S.subtitle}</i></p>`:u`
2747
2773
  <mw-chat-wait-timer
2748
2774
  .data="${S}"
2749
2775
  color="${l}"
@@ -2751,14 +2777,14 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2751
2777
  cdnBaseUrl="${h}"
2752
2778
  sound="${h?`${h}/assets/game-intro.aac`:""}"
2753
2779
  ?dark-mode="${c}"></mw-chat-wait-timer>
2754
- `}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:n=2e3}={}){this.#e=e,this.#t=r,this.timeoutMs=n,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()}};var Yi="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 Na(t){t?.body?.cancel().catch(console.warn)}var Ki=class{#e=[];#t;#r=10;#n=5e3;#i=!1;async add(e,r){if(this.#e.push(Wa(e,r)),this.#e.length>=this.#r)return this.flush();this.#t||(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#n))}async flush(){if(this.#i||this.#e.length===0)return;let e=[...this.#e];try{this.#i=!0,clearTimeout(this.#t),this.#t=void 0,this.#e=[];let r=new AbortController,n=setTimeout(()=>r.abort(),5e3);await za(e,{signal:r.signal}),clearTimeout(n)}catch(r){if(r.name==="AbortError")console.error("Request timed out, retrying events"),this.#e=[...e,...this.#e];else{console.error("Failed to send events to backend:",r);let n=e.filter(i=>i.event.includes("error"));this.#e=[...n,...this.#e]}}finally{this.#i=!1,this.#e.length>0&&!this.#t&&(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#n))}}async flushBeforeUnload(){if(this.#e.length>0)try{let e=new FormData;e.set("events",JSON.stringify(this.#e)),navigator.sendBeacon(new URL("/widgets/data/collect",en()).href,e)}catch(e){console.error("Failed to send final events:",e)}}},Ha=new Ki;window.addEventListener("beforeunload",()=>{Ha.flushBeforeUnload().catch(console.error)});async function T(t,e,r){if(typeof t!="string")throw new TypeError("Event name must be a string");if(typeof e!="object"||e===null)throw new TypeError("Properties must be an object");try{if(t==="ShopAssistant: user clicked link"&&Ju("molin_link_click",e),r?.immediate){await za([Wa(t,e)]);return}else return Ha.add(t,e)}catch(n){console.error("Failed to send event:",n)}}async function za(t,{signal:e}={}){let r=new FormData;r.set("events",JSON.stringify(t));let n=await fetch(new URL("/widgets/data/collect",en()),{method:"POST",body:r,signal:e});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);Na(n)}function Wa(t,e){return{event:t,widget_id:e.widgetId,properties:Object.assign({},e,Xu()),distinct_id:Zu(),timestamp:new Date().toISOString()}}function Zu(){let t=R.distinctID;if(t&&typeof t=="string")return t;let e=crypto.randomUUID();try{R.distinctID=e}catch(r){console.error("Failed to store distinct_id:",r)}return e}function Xu(){return{referrer:document.referrer,userAgent:navigator.userAgent,language:navigator.language,screenWidth:window.innerWidth,screenHeight:window.innerHeight,timestamp:new Date().toISOString(),timezoneOffset:new Date().getTimezoneOffset(),doNotTrack:navigator.doNotTrack??void 0}}function en(){let t=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8787","molin.localhost":"http://molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://molin.ai","molin.foo":"https://molin.foo"}[t]||"https://molin.ai"}function Ju(t,e){try{window.dataLayer=window.dataLayer||[];let r={event:t,link_url:e.url};window.dataLayer.push(r)}catch(r){console.error("Failed to send event to dataLayer:",r)}}function Za(){let t=new URL(import.meta.url).hostname;return{localhost:"http://uploads.molin.localhost:8787","molin.localhost":"http://uploads.molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo"}[t]||"https://widget.molin.ai"}function Xa(){let t=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8702","molin.localhost":"http://localhost:8702","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo"}[t]||"https://widget.molin.ai"}var Yu="\xB7 \xB7 \xB7",Ku=["star-rating","binary-vote","new-conversation-button"],zt=class t extends x(v){static styles=j`
2780
+ `}case"request-input-v1":return u``}return console.warn("could not render part:",t),u`<p><i>data type not supported</i></p>`}var ti=class{#e;#t;#r;#i=!1;timeoutMs;get isTyping(){return this.#i}constructor(e,r,{timeoutMs:i=2e3}={}){this.#e=e,this.#t=r,this.timeoutMs=i,e.addController(this)}hostDisconnected(){clearTimeout(this.#r),this.#r=void 0}onInput(e){if(this.#e.isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(this.#r),this.#r=setTimeout(()=>this.typingStopped(),this.timeoutMs),this.#i||this.#n()}}#n(){this.#i=!0,this.#t.typingStarted()}typingStopped(){clearTimeout(this.#r),this.#i=!1,this.#t.typingStopped()}};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 Xa(t){t?.body?.cancel().catch(console.warn)}var rs=class{#e=[];#t;#r=10;#i=5e3;#n=!1;async add(e,r){if(this.#e.push(Ka(e,r)),this.#e.length>=this.#r)return this.flush();this.#t||(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#i))}async flush(){if(this.#n||this.#e.length===0)return;let e=[...this.#e];try{this.#n=!0,clearTimeout(this.#t),this.#t=void 0,this.#e=[];let r=new AbortController,i=setTimeout(()=>r.abort(),5e3);await Ya(e,{signal:r.signal}),clearTimeout(i)}catch(r){if(r.name==="AbortError")console.error("Request timed out, retrying events"),this.#e=[...e,...this.#e];else{console.error("Failed to send events to backend:",r);let i=e.filter(n=>n.event.includes("error"));this.#e=[...i,...this.#e]}}finally{this.#n=!1,this.#e.length>0&&!this.#t&&(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#i))}}async flushBeforeUnload(){if(this.#e.length>0)try{let e=new FormData;e.set("events",JSON.stringify(this.#e)),navigator.sendBeacon(new URL("/widgets/data/collect",ri()).href,e)}catch(e){console.error("Failed to send final events:",e)}}},Ja=new rs;window.addEventListener("beforeunload",()=>{Ja.flushBeforeUnload().catch(console.error)});async function T(t,e,r){if(typeof t!="string")throw new TypeError("Event name must be a string");if(typeof e!="object"||e===null)throw new TypeError("Properties must be an object");try{if(t==="ShopAssistant: user clicked link"&&rd("molin_link_click",e),r?.immediate){await Ya([Ka(t,e)]);return}else return Ja.add(t,e)}catch(i){console.error("Failed to send event:",i)}}async function Ya(t,{signal:e}={}){let r=new FormData;r.set("events",JSON.stringify(t));let i=await fetch(new URL("/widgets/data/collect",ri()),{method:"POST",body:r,signal:e});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);Xa(i)}function Ka(t,e){return{event:t,widget_id:e.widgetId,properties:Object.assign({},e,td()),distinct_id:ed(),timestamp:new Date().toISOString()}}function ed(){let t=R.distinctID;if(t&&typeof t=="string")return t;let e=crypto.randomUUID();try{R.distinctID=e}catch(r){console.error("Failed to store distinct_id:",r)}return e}function td(){return{referrer:document.referrer,userAgent:navigator.userAgent,language:navigator.language,screenWidth:window.innerWidth,screenHeight:window.innerHeight,timestamp:new Date().toISOString(),timezoneOffset:new Date().getTimezoneOffset(),doNotTrack:navigator.doNotTrack??void 0}}function ri(){let t=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8787","molin.localhost":"http://molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://molin.ai","molin.foo":"https://molin.foo"}[t]||"https://molin.ai"}function rd(t,e){try{window.dataLayer=window.dataLayer||[];let r={event:t,link_url:e.url};window.dataLayer.push(r)}catch(r){console.error("Failed to send event to dataLayer:",r)}}function el(){let t=new URL(import.meta.url).hostname;return{localhost:"http://uploads.molin.localhost:8787","molin.localhost":"http://uploads.molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo"}[t]||"https://widget.molin.ai"}function tl(){let t=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8702","molin.localhost":"http://localhost:8702","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo"}[t]||"https://widget.molin.ai"}var id="\xB7 \xB7 \xB7",nd=["star-rating","binary-vote","new-conversation-button"],Gt=class t extends x(v){static styles=j`
2755
2781
  div.dark::before {
2756
2782
  opacity: 0.8;
2757
2783
  background-color: rgba(20, 22, 26, var(--tw-bg-opacity));
2758
2784
  }
2759
- `;static properties={showClose:{type:Boolean,attribute:"show-close"},open:{type:Boolean},_currentRequestInputIndex:{type:Number,state:!0}};#e=to(this);#t=new Map;constructor(){super(),this.showClose=!1,this.open=!1,this._currentRequestInputIndex=0}#r=new Qr(this,{typingStarted:()=>this.#e.value?.sendUserTypingStart(),typingStopped:()=>this.#e.value?.sendUserTypingStop()});#n=new Or(this,{onFileDelete:e=>{if(!this.#e.value){console.warn("widget context not available, cannot delete file");return}this.#e.value.sendFileDelete(e),this.#b?.focus()},onFilesAdded:()=>{this.focusInput()},uploadUrl:new URL("/v1/uploads",Za()).href,onConnect:()=>{this.#e.value?.connect()}});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 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}#i="single";#s=null;firstUpdated(){document.addEventListener("mw-context-widget:connected",this.#o,{once:!0}),this.addEventListener("mw-chat-wait-game:question-answered",this.#a),this.addEventListener("mw-chat-wait-game:game-completed",this.#u),this.addEventListener("mw-chat-wait-game:guess-validated",this.#d)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mw-chat-wait-game:question-answered",this.#a),this.removeEventListener("mw-chat-wait-game:game-completed",this.#u),this.removeEventListener("mw-chat-wait-game:guess-validated",this.#d)}#o=e=>{let r=e,{pendingImages:n}=r.detail;Array.isArray(n)&&this.#n.restoreFiles(n)};#a=e=>{let r=e,{questionIndex:n,question:i,answer:s,totalQuestions:o}=r.detail;this.callbacks.onWaitGameQuestionAnswered?.({widgetId:this.widgetId,conversationId:this.conversationId,questionIndex:n,question:i,answer:s,totalQuestions:o})};#u=e=>{let r=e,{guessedProfession:n,questionCount:i}=r.detail;this.callbacks.onWaitGameCompleted?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:n,questionCount:i})};#d=e=>{let r=e,{guessedProfession:n,isCorrect:i,questionCount:s}=r.detail;this.callbacks.onWaitGameGuessValidated?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:n,isCorrect:i,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.#e.value?.widgetId&&this.#n.updateUploadOptions({conversationId:this.conversationId,widgetId:this.#e.value?.widgetId,isConnected:()=>this.#e.value?.isConnected()??!1,onConnect:()=>{this.#e.value?.connect()}})}render(){L(this.config,"config is required");let e=Ua(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.#m.length-1)),n=this.#m[r],i=this.config.darkMode;return u`
2785
+ `;static properties={showClose:{type:Boolean,attribute:"show-close"},open:{type:Boolean},_currentRequestInputIndex:{type:Number,state:!0}};#e=so(this);#t=new Map;constructor(){super(),this.showClose=!1,this.open=!1,this._currentRequestInputIndex=0}#r=new ti(this,{typingStarted:()=>this.#e.value?.sendUserTypingStart(),typingStopped:()=>this.#e.value?.sendUserTypingStop()});#i=new Ur(this,{onFileDelete:e=>{if(!this.#e.value){console.warn("widget context not available, cannot delete file");return}this.#e.value.sendFileDelete(e),this.#b?.focus()},onFilesAdded:()=>{this.focusInput()},uploadUrl:new URL("/v1/uploads",el()).href,onConnect:()=>{this.#e.value?.connect()}});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}#n="single";#s=null;firstUpdated(){document.addEventListener("mw-context-widget:connected",this.#o,{once:!0}),this.addEventListener("mw-chat-wait-game:question-answered",this.#a),this.addEventListener("mw-chat-wait-game:game-completed",this.#l),this.addEventListener("mw-chat-wait-game:guess-validated",this.#d)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mw-chat-wait-game:question-answered",this.#a),this.removeEventListener("mw-chat-wait-game:game-completed",this.#l),this.removeEventListener("mw-chat-wait-game:guess-validated",this.#d)}#o=e=>{let r=e,{pendingImages:i}=r.detail;Array.isArray(i)&&this.#i.restoreFiles(i)};#a=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})};#l=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.#e.value?.widgetId&&this.#i.updateUploadOptions({conversationId:this.conversationId,widgetId:this.#e.value?.widgetId,isConnected:()=>this.#e.value?.isConnected()??!1,onConnect:()=>{this.#e.value?.connect()}})}render(){L(this.config,"config is required");let e=Va(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.#m.length-1)),i=this.#m[r],n=this.config.darkMode;return u`
2760
2786
  <div
2761
- class="${i?"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]">
2787
+ 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]">
2762
2788
  <div
2763
2789
  class="relative flex h-full flex-col bg-white shadow-[0px_4px_4px_0px_rgba(0,0,0,0.25),-116px_177px_59px_0px_rgba(0,0,0,0.00),-74px_113px_54px_0px_rgba(0,0,0,0.01),-42px_64px_46px_0px_rgba(0,0,0,0.03),-19px_28px_34px_0px_rgba(0,0,0,0.06)] sm:rounded-[30px] dark:bg-[#2B2D31]">
2764
2790
  <mw-chat-header
@@ -2766,7 +2792,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2766
2792
  .content="${{logoUrl:this.config.logoUrl,title:this.config.title,color:this.config.color}}"
2767
2793
  ?show-new-chat="${!this.isLiveMode&&this.messages.length>0&&!this.#_}"
2768
2794
  ?show-close="${this.showClose}"
2769
- ?dark-mode="${i}"
2795
+ ?dark-mode="${n}"
2770
2796
  @mw:new-chat-click="${this.#v}"
2771
2797
  @mw:close-click="${this.#w}">
2772
2798
  </mw-chat-header>
@@ -2777,7 +2803,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2777
2803
  </div>
2778
2804
 
2779
2805
  <!-- drag overlay -->
2780
- ${this.#n.isDragging?u`
2806
+ ${this.#i.isDragging?u`
2781
2807
  <div class="bg-opacity-90 absolute inset-0 z-50 flex items-center justify-center bg-white sm:rounded-[30px] dark:bg-[#2B2D31]">
2782
2808
  <div class="p-8 text-center">
2783
2809
  <lucide-icon name="image-plus" class="mx-auto mb-4 h-12 w-12 text-blue-500"></lucide-icon>
@@ -2789,7 +2815,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2789
2815
 
2790
2816
  <!-- this structure of 2 divs is required for the browser native stick/scroll to bottom -->
2791
2817
  <div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto">
2792
- ${this.#n.error?u`<mw-info-banner variant="error" text="${this.#n.error}" auto-dismissable></mw-info-banner> `:null}
2818
+ ${this.#i.error?u`<mw-info-banner variant="error" text="${this.#i.error}" auto-dismissable></mw-info-banner> `:null}
2793
2819
  ${this.config?.showStillLearningBanner?u`<mw-info-banner variant="info" text="I'm still learning!"></mw-info-banner>`:u`
2794
2820
  <!-- this makes the chat stick to bottom when the banner is hidden -->
2795
2821
  <div class="flex p-1"></div>
@@ -2799,15 +2825,15 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2799
2825
  <!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
2800
2826
  <div class="${this.messages.length>0?"pt-20":""}">
2801
2827
  ${X(Array.from(e),([s])=>s,([s,o])=>u`
2802
- <div class="my-2 text-center text-xs text-gray-500 dark:text-gray-400">${ea(new Date(Number(s)),window.navigator.language)}</div>
2803
- ${X(o??[],a=>a.id,(a,l)=>{let d=o[l+1]?.role===a.role,f=(l>0?o[l-1]:void 0)?.role===a.role,p=(o.length>0?o[o.length-1]:void 0)?.id===a.id,S=()=>p&&!f&&!d?"single-current":!f&&!d?"single":!f&&d?"first":p&&f&&!d?"last-current":f&&!d?"last":f&&d?"middle":"single";this.#i=S();let b=this.isLiveMode&&a.role==="user"&&a.id===this.lastMsg?.id?"sent":"",$=(a.content.includes("<request-input-v1>")||!a.content)&&a.parts?.every(y=>"data"in y&&y.tag==="request-input-v1");return u`
2828
+ <div class="my-2 text-center text-xs text-gray-500 dark:text-gray-400">${sa(new Date(Number(s)),window.navigator.language)}</div>
2829
+ ${X(o??[],a=>a.id,(a,l)=>{let d=o[l+1]?.role===a.role,f=(l>0?o[l-1]:void 0)?.role===a.role,p=(o.length>0?o[o.length-1]:void 0)?.id===a.id,S=()=>p&&!f&&!d?"single-current":!f&&!d?"single":!f&&d?"first":p&&f&&!d?"last-current":f&&!d?"last":f&&d?"middle":"single";this.#n=S();let b=this.isLiveMode&&a.role==="user"&&a.id===this.lastMsg?.id?"sent":"",$=(a.content.includes("<request-input-v1>")||!a.content)&&a.parts?.every(y=>"data"in y&&y.tag==="request-input-v1");return u`
2804
2830
  ${a.images?X(a.images,y=>y,y=>u`
2805
2831
  <div data-id="${a.id}" class="${d?"mb-[1px]":"mb-3"} mr-2 ml-[15px] flex-row">
2806
2832
  <mw-chat-image
2807
2833
  src="${y}"
2808
2834
  alt="User uploaded image"
2809
2835
  .side="${a.role==="user"?"right":"left"}"
2810
- position=${this.#i}
2836
+ position=${this.#n}
2811
2837
  width="300px"></mw-chat-image>
2812
2838
  </div>
2813
2839
  `):null}
@@ -2818,11 +2844,11 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2818
2844
  status="${b}"
2819
2845
  logo="${a.role==="support"&&a.metadata&&"avatar"in a.metadata&&a.metadata.avatar||this.config?.logoUrl||""}"
2820
2846
  side="${a.role}"
2821
- position=${this.#i}
2822
- ?dark-mode="${i}"
2823
- @click="${this.#l}">
2824
- <div class="${Yi} break-words text-inherit">
2825
- ${a.content===Yu?u`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config?.color}]"></mw-loading>`:a.parts?.length?X(a.parts,(y,k)=>k,(y,k)=>Va(y,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",utm_medium:"chat",utm_campaign:"general"}),messageIsStreaming:a.streaming,color:this.config?.color,darkMode:i,apiBaseUrl:en(),cdnBaseUrl:Xa()})):u`<p>${a.content}</p>`}
2847
+ position=${this.#n}
2848
+ ?dark-mode="${n}"
2849
+ @click="${this.#c}">
2850
+ <div class="${ts} break-words text-inherit">
2851
+ ${a.content===id?u`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config?.color}]"></mw-loading>`:a.parts?.length?X(a.parts,(y,k)=>k,(y,k)=>Za(y,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:ri(),cdnBaseUrl:tl()})):u`<p>${a.content}</p>`}
2826
2852
  </div>
2827
2853
  </mw-chat-message>
2828
2854
  </div>
@@ -2830,6 +2856,13 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2830
2856
  `})}
2831
2857
  `)}
2832
2858
 
2859
+ <!-- show tool call indicator when a tool is being executed -->
2860
+ ${this.toolCallIndicator?u`
2861
+ <mw-chat-message class="mx-2 mb-3 block" color="${this.config?.color}" logo="${N(this.config?.logoUrl)}" side="assistant" ?dark-mode="${n}">
2862
+ <mw-tool-call-indicator text="${this.toolCallIndicator}" color="${this.config?.color}" ?dark-mode="${n}"></mw-tool-call-indicator>
2863
+ </mw-chat-message>
2864
+ `:null}
2865
+
2833
2866
  <!-- show typing indicator if the non-user side is typing -->
2834
2867
  ${["assistant","support"].includes(this.typingIndicator?.role??"")&&this.typingIndicator?.role?u`
2835
2868
  <mw-chat-message
@@ -2837,8 +2870,8 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2837
2870
  color="${this.config?.color}"
2838
2871
  logo="${this.typingIndicator?.metadata?.avatar||this.config?.logoUrl}"
2839
2872
  side="${this.typingIndicator.role}"
2840
- ?dark-mode="${i}">
2841
- <div class="${Yi} break-words text-inherit">
2873
+ ?dark-mode="${n}">
2874
+ <div class="${ts} break-words text-inherit">
2842
2875
  <mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}] text-[${this.config.color}]"></mw-loading>
2843
2876
  </div>
2844
2877
  </mw-chat-message>
@@ -2849,13 +2882,13 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2849
2882
  class="flex-grow"
2850
2883
  .examples="${this.messages.length>0?[]:this.config.examples}"
2851
2884
  color="${this.config.color}"
2852
- ?dark-mode="${i}"
2885
+ ?dark-mode="${n}"
2853
2886
  @mw:example-click="${this.#h}"></mw-chat-background>
2854
2887
  </div>
2855
2888
 
2856
2889
  ${this.messages.length===0&&this.config.disclaimerFloating?u`
2857
2890
  <div class="mx-4 mb-2 rounded-xl bg-[#eeedf1] px-3 py-2 dark:bg-[#1E1F23]">
2858
- <mw-disclaimer .text="${this.config.disclaimerFloating}" .color="${this.config.color}" ?dark-mode="${i}"></mw-disclaimer>
2891
+ <mw-disclaimer .text="${this.config.disclaimerFloating}" .color="${this.config.color}" ?dark-mode="${n}"></mw-disclaimer>
2859
2892
  </div>
2860
2893
  `:null}
2861
2894
 
@@ -2863,7 +2896,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2863
2896
  ${this.config.disclaimer&&!this.config.removePoweredBy?u`
2864
2897
  <!-- spacing between input box and disclaimer or bottom -->
2865
2898
  <div class="mb-1.5">
2866
- <mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}" ?dark-mode="${i}"></mw-disclaimer>
2899
+ <mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}" ?dark-mode="${n}"></mw-disclaimer>
2867
2900
  </div>
2868
2901
  `:null}
2869
2902
  ${this.#m.length===0?u`
@@ -2871,41 +2904,41 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2871
2904
  @mw:change="${this.#g}"
2872
2905
  @mw:submit="${this.#f}"
2873
2906
  @mw:cancel="${this.#x}"
2874
- @mw:file-upload-click="${this.#n.openFilePicker}"
2907
+ @mw:file-upload-click="${this.#i.openFilePicker}"
2875
2908
  @mw:file-delete="${this.#y}"
2876
2909
  placeholder="${this.config?.input?.placeholder??""}"
2877
2910
  ?disabled="${this.ranOutOfCredits||this.hasQueuedMessages}"
2878
2911
  ?streaming="${this.isStreaming??!0}"
2879
- ?loading="${this.hasQueuedMessages||this.#n.hasPendingFiles}"
2912
+ ?loading="${this.hasQueuedMessages||this.#i.hasPendingFiles}"
2880
2913
  ?enableFileUpload="${!this.ranOutOfCredits}"
2881
- ?dark-mode="${i}"
2914
+ ?dark-mode="${n}"
2882
2915
  color="${this.config?.color??""}"
2883
- .files="${this.#n.selectedFiles}">
2916
+ .files="${this.#i.selectedFiles}">
2884
2917
  </mw-chat-input>
2885
2918
  `:u`
2886
2919
  <mw-request-input
2887
- .heading="${n?.title}"
2888
- .type="${n?.type}"
2920
+ .heading="${i?.title}"
2921
+ .type="${i?.type}"
2889
2922
  .color="${this.config?.color??"#8B5CF6"}"
2890
- ?dark-mode="${i}"
2891
- @mw-request-input:submit="${this.#c}">
2923
+ ?dark-mode="${n}"
2924
+ @mw-request-input:submit="${this.#u}">
2892
2925
  </mw-request-input>
2893
2926
  `}
2894
2927
  ${this.config.removePoweredBy?this.config.disclaimer?u`
2895
2928
  <!-- spacing between input box and disclaimer or bottom -->
2896
2929
  <div class="mt-1.5">
2897
- <mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}" ?dark-mode="${i}"></mw-disclaimer>
2930
+ <mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}" ?dark-mode="${n}"></mw-disclaimer>
2898
2931
  </div>
2899
2932
  `:null:u`
2900
2933
  <!-- spacing between input box and powered-by or bottom -->
2901
2934
  <div class="h-4">
2902
- <mw-powered-by ?dark-mode="${i}"></mw-powered-by>
2935
+ <mw-powered-by ?dark-mode="${n}"></mw-powered-by>
2903
2936
  </div>
2904
2937
  `}
2905
2938
  </div>
2906
2939
  </div>
2907
2940
  </div>
2908
- `}#l(e){let n=e.composedPath().find(i=>i instanceof HTMLAnchorElement);if(n){if(e.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:n.href,conversationId:this.conversationId}),window.self!==window.top){window.open(n.href,"_blank");return}let s=this.config?.linksNewTab?"_blank":"_self";window.open(n.href,n.target||s)}}#h(e){if(this.isStreaming)return;e.preventDefault();let r=e.detail.example;this.#p(r)}#p=st({interval:200},async e=>{L(this.#e.value,"widget context is required"),await this.#e.value.enqueueUserInput(e,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions})&&(this.#b?.setValue(""),this.#C(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!0,conversationId:this.conversationId}))});#f(e){if(L(this.#e.value,"widget context is required"),e.preventDefault(),this.#n.hasPendingFiles)return;let r=e.detail;this.#e.value.enqueueUserInput(r,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions}).then(n=>{n&&(this.#b?.setValue(""),this.#n.clearFiles(),this.#r.typingStopped(),this.#C(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:this.conversationId}),window.requestAnimationFrame(()=>{this.#b?.focus()}))}).catch(console.warn)}#g(e){this.#r.onInput(e.detail.full)}#x(){L(this.#e.value,"widget context is required"),this.#e.value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}#y(e){this.#n.onFileDelete(e.detail)}#v(){L(this.#e.value,"widget context is required"),this.#e.value.sendNewChat(),this.reset()}#w(){this.dispatchEvent(new t.CloseClickEvent)}#c(e){L(this.#e.value,"widget context is required");let r=this.#m,n=r[this._currentRequestInputIndex];if(!n){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.#t.set(n.key||n.title,{type:o,rating:s,key:n.key,title:n.title});break}case"binary-vote":{let{vote:s,type:o}=e.detail;this.#t.set(n.key||n.title,{type:o,vote:s,key:n.key,title:n.title});break}case"new-conversation-button":{this.#v(),this.requestUpdate();return}default:console.warn("unknown request input type",e.detail);return}this._currentRequestInputIndex+=1;let i=r.filter(s=>s.type==="star-rating"||s.type==="binary-vote").length;this.#t.size>=i&&this.#k(),this.requestUpdate()}async#k(){if(L(this.#e.value,"widget context is required"),this.#t.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.#t.values()])&&this.#t.clear(),this.requestUpdate()}get#m(){L(this.#e.value,"widget context is required");let e=this.messages.findLast(i=>i.role==="assistant"&&i.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 i=e?.parts?.find(s=>"tag"in s&&s.tag==="request-input-v1"&&"data"in s&&s.data.type==="new-conversation-button");if(i&&"data"in i&&(i.data.type==="new-conversation-button"||i.data.type==="binary-vote"||i.data.type==="star-rating"))return[{title:String(i.data.title),type:i.data.type,key:String(i.data.key)}]}if(r?.role!=="assistant")return[];let n=r.parts?.filter(i=>"tag"in i&&i.tag==="request-input-v1");return!n||n.length===0?[]:n.map(i=>!("data"in i)||i.data.type!=="star-rating"&&i.data.type!=="binary-vote"&&i.data.type!=="new-conversation-button"||!Ku.includes(i.data.type)?null:{title:String(i.data.title),type:i.data.type,key:String(i.data.key)}).filter(i=>i!==null)}get#_(){if(this.#m.length===0)return!1;let r=this.#m.filter(n=>n.type==="star-rating"||n.type==="binary-vote").length;return this.#t.size<r}get#$(){return this.renderRoot.querySelector("#scrollable-content")}#C(){this.#$?.scrollTo({top:0,behavior:"instant"})}get#b(){return this.renderRoot.querySelector("mw-chat-input")}reloadConfig(){this.#e.value?.reloadConfig(),this.requestUpdate()}sendMessage=st({interval:200},async e=>{if(!e?.trim())return console.warn("sendMessage: Message must be a non-empty string"),!1;L(this.#e.value,"Widget context is required");let{value:r}=this.#e,n=await r.enqueueUserInput(e,{xUserData:r.xUserData,xCustomInstructions:r.xCustomInstructions,role:"user",expectStreaming:!0});return n&&this.#b?.setValue(""),n??!1});setInputValue(e){if(!e||typeof e!="string"){console.warn("setInputValue requires a valid string value");return}let r=this.#b;if(!r){console.warn("input element not found, cannot set value");return}r.setValue?r.setValue(e):console.warn("input element does not have setValue method")}focusInput(){window.requestAnimationFrame(()=>{this.#b?.focus()})}reset(){this.#n.clearFiles(),this._currentRequestInputIndex=0,this.#t.clear(),this.#e.value?.reset()}};zt.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(zt.CloseClickEvent.type,{...e})}};customElements.get("mw-chat")||customElements.define("mw-chat",zt);var qe=class t extends x(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`
2941
+ `}#c(e){let i=e.composedPath().find(n=>n instanceof HTMLAnchorElement);if(i){if(e.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}let s=this.config?.linksNewTab?"_blank":"_self";window.open(i.href,i.target||s)}}#h(e){if(this.isStreaming)return;e.preventDefault();let r=e.detail.example;this.#p(r)}#p=st({interval:200},async e=>{L(this.#e.value,"widget context is required"),await this.#e.value.enqueueUserInput(e,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions})&&(this.#b?.setValue(""),this.#C(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!0,conversationId:this.conversationId}))});#f(e){if(L(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.#b?.setValue(""),this.#i.clearFiles(),this.#r.typingStopped(),this.#C(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:this.conversationId}),window.requestAnimationFrame(()=>{this.#b?.focus()}))}).catch(console.warn)}#g(e){this.#r.onInput(e.detail.full)}#x(){L(this.#e.value,"widget context is required"),this.#e.value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}#y(e){this.#i.onFileDelete(e.detail)}#v(){L(this.#e.value,"widget context is required"),this.#e.value.sendNewChat(),this.reset()}#w(){this.dispatchEvent(new t.CloseClickEvent)}#u(e){L(this.#e.value,"widget context is required");let r=this.#m,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.#t.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.#t.set(i.key||i.title,{type:o,vote:s,key:i.key,title:i.title});break}case"new-conversation-button":{this.#v(),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.#t.size>=n&&this.#k(),this.requestUpdate()}async#k(){if(L(this.#e.value,"widget context is required"),this.#t.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.#t.values()])&&this.#t.clear(),this.requestUpdate()}get#m(){L(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"||!nd.includes(n.data.type)?null:{title:String(n.data.title),type:n.data.type,key:String(n.data.key)}).filter(n=>n!==null)}get#_(){if(this.#m.length===0)return!1;let r=this.#m.filter(i=>i.type==="star-rating"||i.type==="binary-vote").length;return this.#t.size<r}get#$(){return this.renderRoot.querySelector("#scrollable-content")}#C(){this.#$?.scrollTo({top:0,behavior:"instant"})}get#b(){return this.renderRoot.querySelector("mw-chat-input")}reloadConfig(){this.#e.value?.reloadConfig(),this.requestUpdate()}sendMessage=st({interval:200},async e=>{if(!e?.trim())return console.warn("sendMessage: Message must be a non-empty string"),!1;L(this.#e.value,"Widget context is required");let{value:r}=this.#e,i=await r.enqueueUserInput(e,{xUserData:r.xUserData,xCustomInstructions:r.xCustomInstructions,role:"user",expectStreaming:!0});return i&&this.#b?.setValue(""),i??!1});setInputValue(e){if(!e||typeof e!="string"){console.warn("setInputValue requires a valid string value");return}let r=this.#b;if(!r){console.warn("input element not found, cannot set value");return}r.setValue?r.setValue(e):console.warn("input element does not have setValue method")}focusInput(){window.requestAnimationFrame(()=>{this.#b?.focus()})}reset(){this.#i.clearFiles(),this._currentRequestInputIndex=0,this.#t.clear(),this.#e.value?.reset()}};Gt.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(Gt.CloseClickEvent.type,{...e})}};customElements.get("mw-chat")||customElements.define("mw-chat",Gt);var qe=class t extends x(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`
2909
2942
  <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">
2910
2943
  <mw-spinning-border .size=${"420px"} .color=${this.color||"#8B5CF6"} .radius=${"18px"} ?dark-mode="${this.dark}">
2911
2944
  <form
@@ -2915,7 +2948,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2915
2948
 
2916
2949
  <input
2917
2950
  ?disabled="${this.disabled}"
2918
- @keydown="${this.#i}"
2951
+ @keydown="${this.#n}"
2919
2952
  @input="${this.#t}"
2920
2953
  .value="${this._inputValue}"
2921
2954
  placeholder="${this.placeholder}"
@@ -2936,7 +2969,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2936
2969
  </form>
2937
2970
  </mw-spinning-border>
2938
2971
  </div>
2939
- `}#r(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;this.#e=r;let i=this._inputValue.trim();i&&this.dispatchEvent(new t.SubmitInputEvent({text:i}))&&(this._inputValue="")}get#n(){return this.renderRoot.querySelector('button[type="submit"]')??null}#i(e){Qu(e)&&(e.preventDefault(),this.disabled||this.#n?.click())}};qe.SubmitInputEvent=class extends CustomEvent{static type="mw-floating-ask-ai:submit";constructor(e,r={}){super(qe.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};qe.ChangeEvent=class extends CustomEvent{static type="mw-floating-ask-ai:change";constructor(e,r={}){super(qe.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};function Qu(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",qe);var Ve=class t extends x(v){static properties={text:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=j`
2972
+ `}#r(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;this.#e=r;let n=this._inputValue.trim();n&&this.dispatchEvent(new t.SubmitInputEvent({text:n}))&&(this._inputValue="")}get#i(){return this.renderRoot.querySelector('button[type="submit"]')??null}#n(e){sd(e)&&(e.preventDefault(),this.disabled||this.#i?.click())}};qe.SubmitInputEvent=class extends CustomEvent{static type="mw-floating-ask-ai:submit";constructor(e,r={}){super(qe.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};qe.ChangeEvent=class extends CustomEvent{static type="mw-floating-ask-ai:change";constructor(e,r={}){super(qe.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};function sd(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",qe);var Ve=class t extends x(v){static properties={text:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=j`
2940
2973
  .popup-desktop:hover button {
2941
2974
  transition-delay: 0s !important;
2942
2975
  }
@@ -2989,7 +3022,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
2989
3022
  <!-- can append any other content -->
2990
3023
  <slot name="footer"></slot>
2991
3024
  </div>
2992
- `}#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};Ne.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(Ne.CloseEvent.type,{...e})}};Ne.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Ne.ClickEvent.type,{...e})}};customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Ne);var tn=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 ed=1440*60*1e3,rn=class{#e;#t;#r;#n;#i=!1;#s=!1;get showing(){return this.#i}constructor(e,r,n=Date){this.#e=e,this.#t=r,this.#r=n,e.addController(this)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!this.#i&&(this.#i=!0,this.#e.requestUpdate(),e)){this.#t.playPopupSound();let r=this.#t.getPersistedState();this.#t.setPersistedState({...r,playedSoundOnce:!0})}}#o(){let e=this.#t.getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&this.#r.now()-e.userDismissedAt<ed||this.show({sound:!r})}hide(){this.#s=!0,this.abortAutoShowTimer(),this.#i=!1,this.#e.requestUpdate()}abortAutoShowTimer(){clearTimeout(this.#n)}onCloseClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}onContentClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),this.#s||(this.#n=setTimeout(()=>this.#o(),this.#t.getDelayMs()))}};var Wt=class t extends x(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 rn(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 tn(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`
3025
+ `}#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};Ne.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(Ne.CloseEvent.type,{...e})}};Ne.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Ne.ClickEvent.type,{...e})}};customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Ne);var ii=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 od=1440*60*1e3,ni=class{#e;#t;#r;#i;#n=!1;#s=!1;get showing(){return this.#n}constructor(e,r,i=Date){this.#e=e,this.#t=r,this.#r=i,e.addController(this)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!this.#n&&(this.#n=!0,this.#e.requestUpdate(),e)){this.#t.playPopupSound();let r=this.#t.getPersistedState();this.#t.setPersistedState({...r,playedSoundOnce:!0})}}#o(){let e=this.#t.getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&this.#r.now()-e.userDismissedAt<od||this.show({sound:!r})}hide(){this.#s=!0,this.abortAutoShowTimer(),this.#n=!1,this.#e.requestUpdate()}abortAutoShowTimer(){clearTimeout(this.#i)}onCloseClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}onContentClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),this.#s||(this.#i=setTimeout(()=>this.#o(),this.#t.getDelayMs()))}};var Zt=class t extends x(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 ni(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 ii(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`
2993
3026
  <!-- mobile shadow backdrop -->
2994
3027
  <div @click="${this.#r}" class="${e} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
2995
3028
 
@@ -3000,7 +3033,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
3000
3033
  button="${r.mobile.button}"
3001
3034
  color="${r.mobile.color}"
3002
3035
  ?dark-mode="${this.darkMode}"
3003
- @mw:click="${this.#n}"
3036
+ @mw:click="${this.#i}"
3004
3037
  @mw:close="${this.#r}">
3005
3038
  ${r.mobile.poweredBy?u`<mw-powered-by class="block p-4" slot="footer" ?dark-mode="${this.darkMode}"></mw-powered-by>`:null}
3006
3039
  </mw-popup-mobile>
@@ -3008,9 +3041,9 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
3008
3041
 
3009
3042
  <!-- desktop -->
3010
3043
  <div class="${e} ${this.positionClasses} fixed z-[2147483647] transition-[opacity,translate,visibility] max-sm:hidden">
3011
- <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>
3044
+ <mw-popup-desktop color="${r.desktop.color}" text="${r.desktop.text}" ?dark-mode="${this.darkMode}" @mw:click="${this.#i}" @mw:close="${this.#r}"></mw-popup-desktop>
3012
3045
  </div>
3013
- `}#r(){this.#e.onCloseClick()}#n(){this.dispatchEvent(new t.ClickEvent),this.#e.onContentClick()}hide(){this.#e.hide()}};Wt.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Wt.ClickEvent.type,{...e})}};customElements.get("mw-popup")||customElements.define("mw-popup",Wt);var Qi=class extends x(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`
3046
+ `}#r(){this.#e.onCloseClick()}#i(){this.dispatchEvent(new t.ClickEvent),this.#e.onContentClick()}hide(){this.#e.hide()}};Zt.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Zt.ClickEvent.type,{...e})}};customElements.get("mw-popup")||customElements.define("mw-popup",Zt);var is=class extends x(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`
3014
3047
  <span class="relative inline-flex">
3015
3048
  <slot></slot>
3016
3049
  <span class="${this.#e} pointer-events-none absolute z-10 flex h-3 w-3">
@@ -3018,7 +3051,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
3018
3051
  <span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
3019
3052
  </span>
3020
3053
  </span>
3021
- `;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",Qi);var es=class extends x(v){static properties={positionClasses:{type:String,attribute:"position"},text:{type:String}};constructor(){super(),this.positionClasses="",this.text="Try it out"}render=()=>u`
3054
+ `;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 x(v){static properties={positionClasses:{type:String,attribute:"position"},text:{type:String}};constructor(){super(),this.positionClasses="",this.text="Try it out"}render=()=>u`
3022
3055
  <div class="${this.positionClasses} fixed right-6 bottom-24 z-10 flex animate-bounce flex-col items-center justify-center font-sans text-base">
3023
3056
  <p class="mb-2 -translate-x-4 -rotate-12 transform text-lg leading-normal font-bold text-gray-800">${this.text}</p>
3024
3057
 
@@ -3031,7 +3064,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
3031
3064
  stroke-linecap="round"></path>
3032
3065
  </svg>
3033
3066
  </div>
3034
- `};customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",es);function $e(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}var nn=class{#e;#t;#r;#n;isLoading=!1;data=void 0;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n,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 ts=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=Ja();e&&e.widgetId===this.#e.widgetId?this.#n=e.config:this.#r=new nn(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 n=await r.json();return n&&!e&&window.__INIT_MOLIN_SHOP_AI({cdn:this.#e.cdn,widgetId:this.#e.widgetId,config:n}),n},onError:this.#t?.onError})}},ft=(t,e)=>new ts(t,{onError:e?.onError||console.error,...e});var He=class t extends x(v){static styles=j`
3067
+ `};customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",ns);function $e(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}var si=class{#e;#t;#r;#i;isLoading=!1;data=void 0;constructor(e,r,i){this.#e=e,this.#t=r,this.#r=i,e.addController(this)}fetch(){if(this.isLoading)return;this.#i?.abort();let e=new AbortController;this.#i=e,this.isLoading=!0,this.data=void 0,this.#e.requestUpdate(),(async()=>{let r=this.#n();return r.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(r,{signal:e.signal})})().then(async r=>{if(!r.ok)throw new Error(`${r.statusText}: ${await r.text()}`);this.isLoading=!1,this.data=typeof this.#r?.transform=="function"?await this.#r.transform(r):r,this.#e.requestUpdate()}).catch(r=>{this.#r?.onError?.(r),this.isLoading=!1,this.data=void 0,this.#e.requestUpdate()}).finally(()=>{e.abort()})}#n(){let e=this.#t;if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)}hostConnected(){this.isLoading||this.#r?.fetchWhenConnected&&this.fetch()}hostDisconnected(){this.#i?.abort(),this.#i=void 0}};var ss=class{#e;#t;#r;#i;get data(){return this.#i||this.#r?.data}constructor(e,r){this.#e=e,this.#t=r,e.addController(this)}hostConnected(){if(this.#r||this.#i)return;let e=rl();e&&e.widgetId===this.#e.widgetId?this.#i=e.config:this.#r=new si(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})}},ft=(t,e)=>new ss(t,{onError:e?.onError||console.error,...e});var He=class t extends x(v){static styles=j`
3035
3068
  :host {
3036
3069
  all: initial; /* reset all properties that can pierce the shadow DOM */
3037
3070
  }
@@ -3044,11 +3077,11 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
3044
3077
  .xCustomInstructions="${this.xCustomInstructions}"
3045
3078
  autoConnect>
3046
3079
  <!-- embed our chat component forwarding props -->
3047
- <mw-chat ?show-close="${this.showClose}" @mw:close-click="${this.#n}">
3080
+ <mw-chat ?show-close="${this.showClose}" @mw:close-click="${this.#i}">
3048
3081
  <slot name="banner" slot="banner"></slot>
3049
3082
  </mw-chat>
3050
3083
  </mw-context-widget>
3051
- `: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??[]}};customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",He);He.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(He.CloseClickEvent.type,{...e})}};var rs=class{hidden;constructor({hidden:e=!1}){this.hidden=e}setUserData(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data")}setCustomInstructions(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions")}showLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ye&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ye&&e.hideLauncher()}openChat(e){let{message:r,autoSend:n}=e||{};for(let i of document.querySelectorAll("molin-shop-ai"))i instanceof ye&&i.openChat({message:r,autoSend:n})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ye&&e.closeChat()}reset(){R.resetAll();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ye&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof He&&e.reset()}};function Ya({hidden:t}){let e=new rs({hidden:t});return window.Molin=e,e}function sn(){let t=window.Molin;if(!t)throw new Error("window.Molin global not initialized");return t}window.__INIT_MOLIN_SHOP_AI=function(e){td(e);let r=$e(),n=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(Ya({hidden:n}),e.auto){let i=document.createElement("molin-shop-ai");i.setAttribute("cdn",e.cdn),i.setAttribute("widget",e.widgetId),document.body.appendChild(i)}};function td(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function Ja(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var ns=class extends x(v){static styles=j`
3084
+ `:null}#i(){this.dispatchEvent(new t.CloseClickEvent)}injectConfig(e){this.#t=e,this.requestUpdate()}reloadConfig(){this.#n?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",this.#n?.reset(),this.requestUpdate()}get#n(){return this.renderRoot.querySelector("mw-chat")}get conversationId(){return this.#n?.conversationId??""}get messages(){return this.#n?.messages??[]}};customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",He);He.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(He.CloseClickEvent.type,{...e})}};var os=class{hidden;constructor({hidden:e=!1}){this.hidden=e}setUserData(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data")}setCustomInstructions(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions")}showLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ye&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ye&&e.hideLauncher()}openChat(e){let{message:r,autoSend:i}=e||{};for(let n of document.querySelectorAll("molin-shop-ai"))n instanceof ye&&n.openChat({message:r,autoSend:i})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ye&&e.closeChat()}reset(){R.resetAll();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ye&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof He&&e.reset()}};function il({hidden:t}){let e=new os({hidden:t});return window.Molin=e,e}function oi(){let t=window.Molin;if(!t)throw new Error("window.Molin global not initialized");return t}window.__INIT_MOLIN_SHOP_AI=function(e){ad(e);let r=$e(),i=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(il({hidden:i}),e.auto){let n=document.createElement("molin-shop-ai");n.setAttribute("cdn",e.cdn),n.setAttribute("widget",e.widgetId),document.body.appendChild(n)}};function ad(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function rl(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var as=class extends x(v){static styles=j`
3052
3085
  :host {
3053
3086
  all: initial; /* reset all properties that can pierce the shadow DOM */
3054
3087
  }
@@ -3060,20 +3093,20 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
3060
3093
  .color="${this.config?.bubble?.color||this.config?.color}"
3061
3094
  .bubbleStyle="${this.config?.bubble?.style}"
3062
3095
  .src="${this.config?.bubble?.bubbleUrl}"
3063
- width="${G(this.config?.bubble?.size?.width)}"
3064
- height="${G(this.config?.bubble?.size?.height)}"></mw-bubble>
3065
- `:null}};customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",ns);var dy="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),hy="navigator"in globalThis&&"share"in navigator,rd=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function nd(t){if(typeof window>"u")return!1;let e=rd[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function is(){return nd("sm")}var on=class{#e;#t;#r;#n;#i=!1;constructor(e,r,n,i=window.history){this.#e=e,this.#t=r,this.#r=n,this.#n=i,e.addController(this)}hostConnected(){this.#s();let e=this.#n.pushState;this.#n.pushState=(...r)=>{if(e.call(this.#n,...r),!this.#i)try{let n=new URL(r[2],window.location.origin);this.#t.test(n.pathname)&&this.#r.navigated()}catch{}}}hostDisconnected(){this.#i=!0}#s=()=>{this.#t.test(window.location.pathname)&&this.#r.navigated()}};function Ka({minMs:t,maxMs:e}){return Math.random()*(e-t)+t}function an(t,e=""){return Object.entries(t).filter(([r,n])=>n).map(([r,n])=>`${e}${r}-[${n}]`).join(" ")}function Qa(t,e={}){return[an(t),an(e,"max-sm:")].join(" ")}function el(t){return an(t)}function tl(t){return Object.entries(t).filter(([e,r])=>r).filter(([e])=>e==="left"||e==="right").map(([e,r])=>{let n=`sm:${e}-[${r}]`;return e==="left"&&(n+=" sm:right-auto"),e==="right"&&(n+=" sm:left-auto"),n}).join(" ")}function rl(t){let e=an(t),n=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,n].filter(Boolean).join(" ")}var ss=class{#e=0;#t=!1;#r;#n;constructor(e,r,{threshold:n=5}={}){this.#r=r,this.#n=n,e.addController(this)}hostConnected(){this.#e=window.scrollY,window.addEventListener("scroll",this.#i,{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",this.#i)}#i=()=>{this.#t||(requestAnimationFrame(this.#s),this.#t=!0)};#s=()=>{let e=window.scrollY,r=e-this.#e;if(Math.abs(r)>=this.#n){let n=r>0?"down":"up";this.#r({scrollY:e,direction:n,deltaY:Math.abs(r)}),this.#e=e}this.#t=!1}};function nl(t,e,r){return new ss(t,e,r)}var ye=class extends x(v){static styles=j`
3096
+ width="${N(this.config?.bubble?.size?.width)}"
3097
+ height="${N(this.config?.bubble?.size?.height)}"></mw-bubble>
3098
+ `:null}};customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",as);var jy="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),Oy="navigator"in globalThis&&"share"in navigator,ld=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function cd(t){if(typeof window>"u")return!1;let e=ld[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function ls(){return cd("sm")}var ai=class{#e;#t;#r;#i;#n=!1;constructor(e,r,i,n=window.history){this.#e=e,this.#t=r,this.#r=i,this.#i=n,e.addController(this)}hostConnected(){this.#s();let e=this.#i.pushState;this.#i.pushState=(...r)=>{if(e.call(this.#i,...r),!this.#n)try{let i=new URL(r[2],window.location.origin);this.#t.test(i.pathname)&&this.#r.navigated()}catch{}}}hostDisconnected(){this.#n=!0}#s=()=>{this.#t.test(window.location.pathname)&&this.#r.navigated()}};function nl({minMs:t,maxMs:e}){return Math.random()*(e-t)+t}function li(t,e=""){return Object.entries(t).filter(([r,i])=>i).map(([r,i])=>`${e}${r}-[${i}]`).join(" ")}function sl(t,e={}){return[li(t),li(e,"max-sm:")].join(" ")}function ol(t){return li(t)}function al(t){return Object.entries(t).filter(([e,r])=>r).filter(([e])=>e==="left"||e==="right").map(([e,r])=>{let i=`sm:${e}-[${r}]`;return e==="left"&&(i+=" sm:right-auto"),e==="right"&&(i+=" sm:left-auto"),i}).join(" ")}function ll(t){let e=li(t),i=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,i].filter(Boolean).join(" ")}var cs=class{#e=0;#t;#r;#i;constructor(e,r,{threshold:i=5}={}){this.#t=r,this.#r=i,e.addController(this)}hostConnected(){this.#e=window.scrollY,window.removeEventListener("scroll",this.#n),window.addEventListener("scroll",this.#n,{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",this.#n),this.#i!==void 0&&(cancelAnimationFrame(this.#i),this.#i=void 0)}#n=()=>{this.#i===void 0&&(this.#i=requestAnimationFrame(this.#s))};#s=()=>{this.#i=void 0;let e=window.scrollY,r=e-this.#e;if(Math.abs(r)>=this.#r){let i=r>0?"down":"up";this.#t({scrollY:e,direction:i,deltaY:Math.abs(r)}),this.#e=e}}};function cl(t,e,r){return new cs(t,e,r)}var ye=class extends x(v){static styles=j`
3066
3099
  :host {
3067
3100
  all: initial; /* reset all properties that can pierce the shadow DOM */
3068
3101
  }
3069
- `;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}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.xUserData=$e()?.userData,this.xCustomInstructions=$e()?.customInstructions,this._floatingInputVisible=!0,this._dialogShown=!1}#e=ft(this);#t=nl(this,e=>{this.#a&&!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 on(this,/.*/i,{navigated:()=>{if(this.requestUpdate(),!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let e=this.#l?.conversationId,r=Ke.restore(this.widgetId)?.conversationId,n=e||r;n&&T("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:n,url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0,shouldHideForCurrentUrl:this.#u})}});#i=!1;#s={onError:e=>{alert(e.error),console.error(e.widgetId,e.error),T("ShopAssistant: error",{...e},{immediate:!0})},onNewMessageStartedStreaming:e=>{T("ShopAssistant: user received bot message (streaming started)",e)},onMessageEndedStreaming:e=>{T("ShopAssistant: user received bot message (streaming ended)",e)},onUserCanceledStreaming:e=>{T("ShopAssistant: user canceled streaming",e)},onUserClickedLink:e=>{T("ShopAssistant: user clicked link",e)},onUserSentInput:e=>{T("ShopAssistant: user sent input",e)},onWaitGameQuestionAnswered:e=>{T("ShopAssistant: wait game question answered",e)},onWaitGameCompleted:e=>{T("ShopAssistant: wait game completed",e)},onWaitGameGuessValidated:e=>{T("ShopAssistant: wait game guess validated",e)}};get#o(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647}get#a(){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(n=>{if(!n||typeof n!="string")return!1;let i=n.endsWith("*"),s=i?n.slice(0,-1):n;return n.startsWith("http")?i?e.startsWith(s):e===s:i?r.startsWith(s):r===s})}render(){if(!this.config)return null;let e=Qa(this.config.bubble.position,this.config.bubble.mobilePosition),r=el(this.config.bubble.position),n=tl(this.config.bubble.position),i=rl(this.config.bubble.position);return this.config.hidden||sn().hidden||this.#u?null:u`
3102
+ `;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}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.xUserData=$e()?.userData,this.xCustomInstructions=$e()?.customInstructions,this._floatingInputVisible=!0,this._dialogShown=!1}#e=ft(this);#t=cl(this,e=>{this.#a&&!this._dialogShown&&(e.direction==="down"?this._floatingInputVisible=!1:e.direction==="up"&&(this._floatingInputVisible=!0),this.requestUpdate())},{threshold:20});get config(){return this.#r||this.#e.data}#r;#i=new ai(this,/.*/i,{navigated:()=>{if(this.requestUpdate(),!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let e=this.#c?.conversationId,r=Ke.restore(this.widgetId)?.conversationId,i=e||r;i&&T("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:i,url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0,shouldHideForCurrentUrl:this.#l})}});#n=!1;#s={onError:e=>{alert(e.error),console.error(e.widgetId,e.error),T("ShopAssistant: error",{...e},{immediate:!0})},onNewMessageStartedStreaming:e=>{T("ShopAssistant: user received bot message (streaming started)",e)},onMessageEndedStreaming:e=>{T("ShopAssistant: user received bot message (streaming ended)",e)},onUserCanceledStreaming:e=>{T("ShopAssistant: user canceled streaming",e)},onUserClickedLink:e=>{T("ShopAssistant: user clicked link",e)},onUserSentInput:e=>{T("ShopAssistant: user sent input",e)},onWaitGameQuestionAnswered:e=>{T("ShopAssistant: wait game question answered",e)},onWaitGameCompleted:e=>{T("ShopAssistant: wait game completed",e)},onWaitGameGuessValidated:e=>{T("ShopAssistant: wait game guess validated",e)}};get#o(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647}get#a(){return this.config?.floatingAskAI?.enabled||!0}get#l(){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=sl(this.config.bubble.position,this.config.bubble.mobilePosition),r=ol(this.config.bubble.position),i=al(this.config.bubble.position),n=ll(this.config.bubble.position);return this.config.hidden||oi().hidden||this.#l?null:u`
3070
3103
  <mw-context-widget
3071
3104
  .widgetId="${this.widgetId}"
3072
3105
  .config="${this.config}"
3073
3106
  .callbacks="${this.#s}"
3074
3107
  .xUserData="${this.xUserData}"
3075
3108
  .xCustomInstructions="${this.xCustomInstructions}"
3076
- .autoConnect="${this.#i}">
3109
+ .autoConnect="${this.#n}">
3077
3110
  <mw-bubble
3078
3111
  class="${e} ${this._dialogShown?"opacity-0":"opacity-100"} fixed z-[${this.#o}] transition-opacity"
3079
3112
  @click="${this.#f}"
@@ -3081,14 +3114,14 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
3081
3114
  .color="${this.config?.bubble?.color||this.config?.color}"
3082
3115
  .bubbleStyle="${this.config?.bubble?.style}"
3083
3116
  .src="${this.config?.bubble?.bubbleUrl}"
3084
- width="${G(this.config?.bubble?.size?.width)}"
3085
- height="${G(this.config?.bubble?.size?.height)}"></mw-bubble>
3117
+ width="${N(this.config?.bubble?.size?.width)}"
3118
+ height="${N(this.config?.bubble?.size?.height)}"></mw-bubble>
3086
3119
 
3087
3120
  <!-- only load the component if enabled on any platform -->
3088
3121
  ${this.isPopupEnabled?u`
3089
3122
  <mw-popup
3090
- position="${i}"
3091
- delay="${this.config.popup?.delayMs||Ka({minMs:2e3,maxMs:5e3})}"
3123
+ position="${n}"
3124
+ delay="${this.config.popup?.delayMs||nl({minMs:2e3,maxMs:5e3})}"
3092
3125
  sound="${this.config.popup?.muteSounds?"":this.config.popup?.soundUrl||""}"
3093
3126
  ?dark-mode="${this.config?.darkMode}"
3094
3127
  .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}}}"
@@ -3105,7 +3138,7 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
3105
3138
 
3106
3139
  <!-- On first render, do not render the dialog, so it does not connect to backend. Once it's rendered once, it's never removed from the DOM. -->
3107
3140
  <div
3108
- class="${this._dialogShown?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${n} ${this.config?.darkMode?"bg-[#14161A]":"bg-white"} fixed inset-0 z-[2147483647] font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:top-auto sm:bottom-6 sm:h-[92%] sm:max-h-[800px] sm:w-[calc(100dvh*0.50)] sm:max-w-[400px] sm:min-w-[300px] sm:rounded-[36px] 2xl:max-w-[420px]">
3141
+ class="${this._dialogShown?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${i} ${this.config?.darkMode?"bg-[#14161A]":"bg-white"} fixed inset-0 z-[2147483647] font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:top-auto sm:bottom-6 sm:h-[92%] sm:max-h-[800px] sm:w-[calc(100dvh*0.50)] sm:max-w-[400px] sm:min-w-[300px] sm:rounded-[36px] 2xl:max-w-[420px]">
3109
3142
  <mw-chat ?show-close="${!0}" @mw:close-click="${this.#g}" ?open="${this._dialogShown}">
3110
3143
  <slot name="banner" slot="banner"></slot>
3111
3144
  </mw-chat>
@@ -3116,13 +3149,13 @@ var sl=Object.create;var os=Object.defineProperty;var ol=Object.getOwnPropertyDe
3116
3149
  <mw-floating-ask-ai
3117
3150
  ?dark="${this.config?.floatingAskAI?.darkMode}"
3118
3151
  .color="${this.config.color||this.config?.bubble?.color}"
3119
- placeholder="${G(this.config?.floatingAskAI?.placeholder)}"
3152
+ placeholder="${N(this.config?.floatingAskAI?.placeholder)}"
3120
3153
  class="${!this._dialogShown&&this._floatingInputVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-full"} fixed left-1/2 z-[${this.#o}] hidden -translate-x-1/2 transition-all duration-300 ease-in-out max-md:hidden sm:block"
3121
3154
  style="bottom: ${this.config.bubble.position.bottom||"1.5rem"}"
3122
3155
  @mw-floating-ask-ai:submit="${this.#x}"></mw-floating-ask-ai>
3123
3156
  `:null}
3124
3157
  </mw-context-widget>
3125
- `}get isPopupEnabled(){return is()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){this._dialogShown&&this.#d?.hide(),this._dialogShown&&setTimeout(()=>{this.#l?.focusInput()},0)}firstUpdated(){is()&&R.widgetState?.isOpen&&!this._dialogShown&&(this._dialogShown=!0,this.#i=!0,this.requestUpdate())}get#d(){return this.renderRoot.querySelector("mw-popup")}get#l(){return this.renderRoot.querySelector("mw-chat")}get#h(){return this.renderRoot.querySelector("mw-context-widget")}#p(){this._dialogShown=!0,this.#i=!0,this.requestUpdate(),this.#c(!0),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:this._dialogShown?"open":"close"})}#f(){this._dialogShown=!this._dialogShown,this.#i=!0,this.requestUpdate(),this.#c(this._dialogShown),this.#d?.hide(),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:this._dialogShown?"open":"close"})}#g(){this._dialogShown=!1,this._floatingInputVisible=!0,this.requestUpdate(),this.#c(!1),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:this._dialogShown?"open":"close"})}#x=e=>{let r=e.detail.text,n=this.#h;n&&typeof n.connect=="function"&&n.connect(),this._dialogShown=!0,this.#i=!0,this.requestUpdate(),this.#c(!0),setTimeout(()=>{this.#w(r),this.#v(r).catch(console.warn)},100),T("ShopAssistant: user sent input",{widgetId:this.widgetId,text:r,example:!1,conversationId:this.#l?.conversationId||"",source:"ask-ai"})};#y=st({interval:200},({message:e,autoSend:r=!1}={})=>{if(!e)return;this.#w(e);let n=this.#l?.isLiveMode;n||this.reset(),r&&!n&&this.#v(e).catch(console.warn)});openChat(e){let{message:r,autoSend:n}=e||{};if(this._dialogShown){this.#y({message:r,autoSend:n});return}let i=this.#h;i&&typeof i.connect=="function"&&i.connect(),this._dialogShown=!0,this.#i=!0,this.requestUpdate(),this.#c(!0),this.#d?.hide(),setTimeout(()=>{this.#y({message:r,autoSend:n})},100),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:this._dialogShown?"open":"close"})}closeChat(){this._dialogShown&&(this._dialogShown=!1,this._floatingInputVisible=!0,this.requestUpdate(),this.#c(!1),this.#d?.hide(),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:this._dialogShown?"open":"close"}))}showLauncher(){let e=sn();e.hidden=!1,this.requestUpdate(),T("ShopAssistant: called show launcher",{widgetId:this.widgetId,source:"programmatic-method"})}hideLauncher(){let e=sn();e.hidden=!0,this.requestUpdate(),T("ShopAssistant: called hide launcher",{widgetId:this.widgetId,source:"programmatic-method"})}injectConfig(e){this.#r=e,this.requestUpdate()}reset(){this.xUserData={},this.xCustomInstructions="",this.#l?.reset(),this.requestUpdate()}async#v(e){let r=this.#l;if(!r){console.warn("Chat element not found, cannot send message");return}r.sendMessage?await r.sendMessage(e):console.warn("Chat element does not have sendMessage method")}#w(e){let r=this.#l;if(!r){console.warn("Chat element not found, cannot set input value");return}r.setInputValue?r.setInputValue(e):console.warn("Chat element does not have setInputValue method")}#c(e){R.widgetState={isOpen:e}}};customElements.get("molin-shop-ai")||customElements.define("molin-shop-ai",ye);export{ye as MolinShopAI};
3158
+ `}get isPopupEnabled(){return ls()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){this._dialogShown&&this.#d?.hide(),this._dialogShown&&setTimeout(()=>{this.#c?.focusInput()},0)}firstUpdated(){ls()&&R.widgetState?.isOpen&&!this._dialogShown&&(this._dialogShown=!0,this.#n=!0,this.requestUpdate())}get#d(){return this.renderRoot.querySelector("mw-popup")}get#c(){return this.renderRoot.querySelector("mw-chat")}get#h(){return this.renderRoot.querySelector("mw-context-widget")}#p(){this._dialogShown=!0,this.#n=!0,this.requestUpdate(),this.#u(!0),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:this._dialogShown?"open":"close"})}#f(){this._dialogShown=!this._dialogShown,this.#n=!0,this.requestUpdate(),this.#u(this._dialogShown),this.#d?.hide(),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:this._dialogShown?"open":"close"})}#g(){this._dialogShown=!1,this._floatingInputVisible=!0,this.requestUpdate(),this.#u(!1),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:this._dialogShown?"open":"close"})}#x=e=>{let r=e.detail.text,i=this.#h;i&&typeof i.connect=="function"&&i.connect(),this._dialogShown=!0,this.#n=!0,this.requestUpdate(),this.#u(!0),setTimeout(()=>{this.#w(r),this.#v(r).catch(console.warn)},100),T("ShopAssistant: user sent input",{widgetId:this.widgetId,text:r,example:!1,conversationId:this.#c?.conversationId||"",source:"ask-ai"})};#y=st({interval:200},({message:e,autoSend:r=!1}={})=>{if(!e)return;this.#w(e);let i=this.#c?.isLiveMode;i||this.reset(),r&&!i&&this.#v(e).catch(console.warn)});openChat(e){let{message:r,autoSend:i}=e||{};if(this._dialogShown){this.#y({message:r,autoSend:i});return}let n=this.#h;n&&typeof n.connect=="function"&&n.connect(),this._dialogShown=!0,this.#n=!0,this.requestUpdate(),this.#u(!0),this.#d?.hide(),setTimeout(()=>{this.#y({message:r,autoSend:i})},100),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:this._dialogShown?"open":"close"})}closeChat(){this._dialogShown&&(this._dialogShown=!1,this._floatingInputVisible=!0,this.requestUpdate(),this.#u(!1),this.#d?.hide(),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:this._dialogShown?"open":"close"}))}showLauncher(){let e=oi();e.hidden=!1,this.requestUpdate(),T("ShopAssistant: called show launcher",{widgetId:this.widgetId,source:"programmatic-method"})}hideLauncher(){let e=oi();e.hidden=!0,this.requestUpdate(),T("ShopAssistant: called hide launcher",{widgetId:this.widgetId,source:"programmatic-method"})}injectConfig(e){this.#r=e,this.requestUpdate()}reset(){this.xUserData={},this.xCustomInstructions="",this.#c?.reset(),this.requestUpdate()}async#v(e){let r=this.#c;if(!r){console.warn("Chat element not found, cannot send message");return}r.sendMessage?await r.sendMessage(e):console.warn("Chat element does not have sendMessage method")}#w(e){let r=this.#c;if(!r){console.warn("Chat element not found, cannot set input value");return}r.setInputValue?r.setInputValue(e):console.warn("Chat element does not have setInputValue method")}#u(e){R.widgetState={isOpen:e}}};customElements.get("molin-shop-ai")||customElements.define("molin-shop-ai",ye);export{ye as MolinShopAI};
3126
3159
  /*! Bundled license information:
3127
3160
 
3128
3161
  @lit/reactive-element/css-tag.js: