@molin.ai/shop-ai 0.9.72 → 0.9.74
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.
- package/dist/molin-shop-ai.min.js +51 -48
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDescriptor;var Al=Object.getOwnPropertyNames;var Tl=Object.getPrototypeOf,Dl=Object.prototype.hasOwnProperty;var Je=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ml=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Al(e))!Dl.call(t,n)&&n!==r&&hs(t,n,{get:()=>e[n],enumerable:!(i=Il(e,n))||i.enumerable});return t};var pi=(t,e,r)=>(r=t!=null?Sl(Tl(t)):{},Ml(e||!t||!t.__esModule?hs(r,"default",{value:t,enumerable:!0}):r,t));var Wi=Je(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.parseCookie=ro;le.parse=ro;le.stringifyCookie=vc;le.stringifySetCookie=wr;le.serialize=wr;le.parseSetCookie=wc;le.stringifySetCookie=wr;le.serialize=wr;var eo=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,to=/^[\u0021-\u003A\u003C-\u007E]*$/,fc=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,mc=/^[\u0020-\u003A\u003D-\u007E]*$/,gc=/^-?\d+$/,yc=Object.prototype.toString,bc=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function ro(t,e){let r=new bc,i=t.length;if(i<2)return r;let n=e?.decode||io,s=0;do{let o=zi(t,s,i);if(o===-1)break;let a=Ni(t,s,i);if(o>a){s=t.lastIndexOf(";",o-1)+1;continue}let l=_e(t,s,o);r[l]===void 0&&(r[l]=n(_e(t,o+1,a))),s=a+1}while(s<i);return r}function vc(t,e){let r=e?.encode||encodeURIComponent,i=[];for(let n of Object.keys(t)){let s=t[n];if(s===void 0)continue;if(!eo.test(n))throw new TypeError(`cookie name is invalid: ${n}`);let o=r(s);if(!to.test(o))throw new TypeError(`cookie val is invalid: ${s}`);i.push(`${n}=${o}`)}return i.join("; ")}function wr(t,e,r){let i=typeof t=="object"?t:{...r,name:t,value:String(e)},s=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!eo.test(i.name))throw new TypeError(`argument name is invalid: ${i.name}`);let o=i.value?s(i.value):"";if(!to.test(o))throw new TypeError(`argument val is invalid: ${i.value}`);let a=i.name+"="+o;if(i.maxAge!==void 0){if(!Number.isInteger(i.maxAge))throw new TypeError(`option maxAge is invalid: ${i.maxAge}`);a+="; Max-Age="+i.maxAge}if(i.domain){if(!fc.test(i.domain))throw new TypeError(`option domain is invalid: ${i.domain}`);a+="; Domain="+i.domain}if(i.path){if(!mc.test(i.path))throw new TypeError(`option path is invalid: ${i.path}`);a+="; Path="+i.path}if(i.expires){if(!xc(i.expires)||!Number.isFinite(i.expires.valueOf()))throw new TypeError(`option expires is invalid: ${i.expires}`);a+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.partitioned&&(a+="; Partitioned"),i.priority)switch(typeof i.priority=="string"?i.priority.toLowerCase():void 0){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${i.priority}`)}if(i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:case"strict":a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"none":a+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${i.sameSite}`)}return a}function wc(t,e){let r=e?.decode||io,i=t.length,n=Ni(t,0,i),s=zi(t,0,n),o=s===-1?{name:"",value:r(_e(t,0,n))}:{name:_e(t,0,s),value:r(_e(t,s+1,n))},a=n+1;for(;a<i;){let l=Ni(t,a,i),c=zi(t,a,l),d=c===-1?_e(t,a,l):_e(t,a,c),p=c===-1?void 0:_e(t,c+1,l);switch(d.toLowerCase()){case"httponly":o.httpOnly=!0;break;case"secure":o.secure=!0;break;case"partitioned":o.partitioned=!0;break;case"domain":o.domain=p;break;case"path":o.path=p;break;case"max-age":p&&gc.test(p)&&(o.maxAge=Number(p));break;case"expires":if(!p)break;let h=new Date(p);Number.isFinite(h.valueOf())&&(o.expires=h);break;case"priority":if(!p)break;let y=p.toLowerCase();(y==="low"||y==="medium"||y==="high")&&(o.priority=y);break;case"samesite":if(!p)break;let f=p.toLowerCase();(f==="lax"||f==="strict"||f==="none")&&(o.sameSite=f);break}a=l+1}return o}function Ni(t,e,r){let i=t.indexOf(";",e);return i===-1?r:i}function zi(t,e,r){let i=t.indexOf("=",e);return i<r?i:-1}function _e(t,e,r){let i=e,n=r;do{let s=t.charCodeAt(i);if(s!==32&&s!==9)break}while(++i<n);for(;n>i;){let s=t.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}return t.slice(i,n)}function io(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function xc(t){return yc.call(t)==="[object Date]"}});var ia=Je(Fe=>{"use strict";var au=Fe&&Fe.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},lu=Fe&&Fe.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.base64ToBlob=cu;function cu(t){return au(this,void 0,void 0,function(){var e,r,i;return lu(this,function(n){switch(n.label){case 0:return[4,fetch(t)];case 1:return e=n.sent(),[4,e.blob()];case 2:return r=n.sent(),i=du(t),i&&(r=r.slice(0,r.size,i)),[2,r]}})})}var uu=/^data:(.+);base64,/;function du(t){var e;return(e=t.match(uu))===null||e===void 0?void 0:e.slice(1,2).pop()}});var na=Je(qe=>{"use strict";var pu=qe&&qe.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},hu=qe&&qe.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(qe,"__esModule",{value:!0});qe.base64ToFile=fu;function fu(t,e,r){return pu(this,void 0,void 0,function(){var i,n;return hu(this,function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:return i=s.sent(),[4,i.blob()];case 2:return n=s.sent(),[2,new File([n],e,r)]}})})}});var bn=Je(Be=>{"use strict";var gn=Be&&Be.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},yn=Be&&Be.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Be,"__esModule",{value:!0});Be.blobToBase64=mu;function mu(t){return gn(this,void 0,void 0,function(){return yn(this,function(e){return[2,typeof FileReader=="function"?gu(t):bu(t)]})})}var lt;(function(t){t.error="error",t.loadend="loadend"})(lt||(lt={}));function gu(t){return gn(this,void 0,void 0,function(){return yn(this,function(e){return[2,new Promise(function(r,i){try{var n=new FileReader,s=function(){r(n.result),n.removeEventListener(lt.loadend,s)};n.addEventListener(lt.loadend,s);var o=function(){i(n.error),n.removeEventListener(lt.error,o)};n.addEventListener(lt.error,o),n.readAsDataURL(t)}catch(a){i(a)}})]})})}var yu="application/octet-stream";function bu(t){return gn(this,void 0,void 0,function(){var e,r,i,n;return yn(this,function(s){switch(s.label){case 0:return i=(r=Buffer).from,[4,t.text()];case 1:return e=i.apply(r,[s.sent()]),n=t.type||yu,[2,"data:".concat(n,";base64,").concat(e.toString("base64"))]}})})}});var sa=Je(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.fileToBase64=void 0;var vu=bn();Object.defineProperty(Or,"fileToBase64",{enumerable:!0,get:function(){return vu.blobToBase64}})});var oa=Je(ue=>{"use strict";var wu=ue&&ue.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),Pr=ue&&ue.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wu(e,t,r)};Object.defineProperty(ue,"__esModule",{value:!0});Pr(ia(),ue);Pr(na(),ue);Pr(bn(),ue);Pr(sa(),ue)});var Zt=globalThis,er=Zt.ShadowRoot&&(Zt.ShadyCSS===void 0||Zt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,hi=Symbol(),fs=new WeakMap,xt=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==hi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(er&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=fs.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&fs.set(r,e))}return e}toString(){return this.cssText}},ms=t=>new xt(typeof t=="string"?t:t+"",void 0,hi),O=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((i,n,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new xt(r,t,hi)},gs=(t,e)=>{if(er)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=Zt.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},fi=er?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return ms(r)})(t):t;var{is:Ol,defineProperty:Pl,getOwnPropertyDescriptor:Ul,getOwnPropertyNames:Ll,getOwnPropertySymbols:jl,getPrototypeOf:Rl}=Object,tr=globalThis,ys=tr.trustedTypes,Fl=ys?ys.emptyScript:"",ql=tr.reactiveElementPolyfillSupport,kt=(t,e)=>t,mi={toAttribute(t,e){switch(e){case Boolean:t=t?Fl:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},vs=(t,e)=>!Ol(t,e),bs={attribute:!0,type:String,converter:mi,reflect:!1,useDefault:!1,hasChanged:vs};Symbol.metadata??=Symbol("metadata"),tr.litPropertyMetadata??=new WeakMap;var me=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=bs){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Pl(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){let{get:n,set:s}=Ul(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get:n,set(o){let a=n?.call(this);s?.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??bs}static _$Ei(){if(this.hasOwnProperty(kt("elementProperties")))return;let e=Rl(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(kt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(kt("properties"))){let r=this.properties,i=[...Ll(r),...jl(r)];for(let n of i)this.createProperty(n,r[n])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[i,n]of r)this.elementProperties.set(i,n)}this._$Eh=new Map;for(let[r,i]of this.elementProperties){let n=this._$Eu(r,i);n!==void 0&&this._$Eh.set(n,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)r.unshift(fi(n))}else e!==void 0&&r.push(fi(e));return r}static _$Eu(e,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,r=this.constructor.elementProperties;for(let i of r.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return gs(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$ET(e,r){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:mi).toAttribute(r,i.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,r){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=i.getPropertyOptions(n),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:mi;this._$Em=n;let a=o.fromAttribute(r,s.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(e,r,i,n=!1,s){if(e!==void 0){let o=this.constructor;if(n===!1&&(s=this[e]),i??=o.getPropertyOptions(e),!((i.hasChanged??vs)(s,r)||i.useDefault&&i.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,r,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:i,reflect:n,wrapped:s},o){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??r??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(r=void 0),this._$AL.set(e,r)),n===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[n,s]of i){let{wrapped:o}=s,a=this[n];o!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,s,a)}}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(r)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$EO?.forEach(r=>r.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(r=>this._$ET(r,this[r])),this._$EM()}updated(e){}firstUpdated(e){}};me.elementStyles=[],me.shadowRootOptions={mode:"open"},me[kt("elementProperties")]=new Map,me[kt("finalized")]=new Map,ql?.({ReactiveElement:me}),(tr.reactiveElementVersions??=[]).push("2.1.2");var yi=globalThis,ws=t=>t,rr=yi.trustedTypes,xs=rr?rr.createPolicy("lit-html",{createHTML:t=>t}):void 0,bi="$lit$",ge=`lit$${Math.random().toFixed(9).slice(2)}$`,vi="?"+ge,Bl=`<${vi}>`,Pe=document,Ct=()=>Pe.createComment(""),$t=t=>t===null||typeof t!="object"&&typeof t!="function",wi=Array.isArray,Ss=t=>wi(t)||typeof t?.[Symbol.iterator]=="function",gi=`[
|
|
2
|
-
\f\r]`,_t=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ks=/-->/g,_s=/>/g,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Cs=/'/g,$s=/"/g,Is=/^(?:script|style|textarea|title)$/i,xi=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),u=xi(1),Md=xi(2),Od=xi(3),ne=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),Es=new WeakMap,Oe=Pe.createTreeWalker(Pe,129);function As(t,e){if(!wi(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return xs!==void 0?xs.createHTML(e):e}var Ts=(t,e)=>{let r=t.length-1,i=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=_t;for(let a=0;a<r;a++){let l=t[a],c,d,p=-1,h=0;for(;h<l.length&&(o.lastIndex=h,d=o.exec(l),d!==null);)h=o.lastIndex,o===_t?d[1]==="!--"?o=ks:d[1]!==void 0?o=_s:d[2]!==void 0?(Is.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Me):d[3]!==void 0&&(o=Me):o===Me?d[0]===">"?(o=n??_t,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Me:d[3]==='"'?$s:Cs):o===$s||o===Cs?o=Me:o===ks||o===_s?o=_t:(o=Me,n=void 0);let y=o===Me&&t[a+1].startsWith("/>")?" ":"";s+=o===_t?l+Bl:p>=0?(i.push(c),l.slice(0,p)+bi+l.slice(p)+ge+y):l+ge+(p===-2?a:y)}return[As(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},Et=class t{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,o=0,a=e.length-1,l=this.parts,[c,d]=Ts(e,r);if(this.el=t.createElement(c,i),Oe.currentNode=this.el.content,r===2||r===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=Oe.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let p of n.getAttributeNames())if(p.endsWith(bi)){let h=d[o++],y=n.getAttribute(p).split(ge),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:s,name:f[2],strings:y,ctor:f[1]==="."?nr:f[1]==="?"?sr:f[1]==="@"?or:Le}),n.removeAttribute(p)}else p.startsWith(ge)&&(l.push({type:6,index:s}),n.removeAttribute(p));if(Is.test(n.tagName)){let p=n.textContent.split(ge),h=p.length-1;if(h>0){n.textContent=rr?rr.emptyScript:"";for(let y=0;y<h;y++)n.append(p[y],Ct()),Oe.nextNode(),l.push({type:2,index:++s});n.append(p[h],Ct())}}}else if(n.nodeType===8)if(n.data===vi)l.push({type:2,index:s});else{let p=-1;for(;(p=n.data.indexOf(ge,p+1))!==-1;)l.push({type:7,index:s}),p+=ge.length-1}s++}}static createElement(e,r){let i=Pe.createElement("template");return i.innerHTML=e,i}};function Ue(t,e,r=t,i){if(e===ne)return e;let n=i!==void 0?r._$Co?.[i]:r._$Cl,s=$t(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(t),n._$AT(t,r,i)),i!==void 0?(r._$Co??=[])[i]=n:r._$Cl=n),n!==void 0&&(e=Ue(t,n._$AS(t,e.values),n,i)),e}var ir=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:r},parts:i}=this._$AD,n=(e?.creationScope??Pe).importNode(r,!0);Oe.currentNode=n;let s=Oe.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Ke(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new ar(s,this,e)),this._$AV.push(c),l=i[++a]}o!==l?.index&&(s=Oe.nextNode(),o++)}return Oe.currentNode=Pe,n}p(e){let r=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}},Ke=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,i,n){this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Ue(this,e,r),$t(e)?e===U||e==null||e===""?(this._$AH!==U&&this._$AR(),this._$AH=U):e!==this._$AH&&e!==ne&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ss(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==U&&$t(this._$AH)?this._$AA.nextSibling.data=e:this.T(Pe.createTextNode(e)),this._$AH=e}$(e){let{values:r,_$litType$:i}=e,n=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Et.createElement(As(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(r);else{let s=new ir(n,this),o=s.u(this.options);s.p(r),this.T(o),this._$AH=s}}_$AC(e){let r=Es.get(e.strings);return r===void 0&&Es.set(e.strings,r=new Et(e)),r}k(e){wi(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,i,n=0;for(let s of e)n===r.length?r.push(i=new t(this.O(Ct()),this.O(Ct()),this,this.options)):i=r[n],i._$AI(s),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e!==this._$AB;){let i=ws(e).nextSibling;ws(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Le=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,i,n,s){this.type=1,this._$AH=U,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=U}_$AI(e,r=this,i,n){let s=this.strings,o=!1;if(s===void 0)e=Ue(this,e,r,0),o=!$t(e)||e!==this._$AH&&e!==ne,o&&(this._$AH=e);else{let a=e,l,c;for(e=s[0],l=0;l<s.length-1;l++)c=Ue(this,a[i+l],r,l),c===ne&&(c=this._$AH[l]),o||=!$t(c)||c!==this._$AH[l],c===U?e=U:e!==U&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!n&&this.j(e)}j(e){e===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},nr=class extends Le{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}},sr=class extends Le{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==U)}},or=class extends Le{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){if((e=Ue(this,e,r,0)??U)===ne)return;let i=this._$AH,n=e===U&&i!==U||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==U&&(i===U||n);n&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ar=class{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Ue(this,e)}},Ds={M:bi,P:ge,A:vi,C:1,L:Ts,R:ir,D:Ss,V:Ue,I:Ke,H:Le,N:sr,U:or,B:nr,F:ar},Nl=yi.litHtmlPolyfillSupport;Nl?.(Et,Ke),(yi.litHtmlVersions??=[]).push("3.3.2");var Ms=(t,e,r)=>{let i=r?.renderBefore??e,n=i._$litPart$;if(n===void 0){let s=r?.renderBefore??null;i._$litPart$=n=new Ke(e.insertBefore(Ct(),s),s,void 0,r??{})}return n._$AI(t),n};var ki=globalThis,v=class extends me{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ms(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ne}};v._$litElement$=!0,v.finalized=!0,ki.litElementHydrateSupport?.({LitElement:v});var zl=ki.litElementPolyfillSupport;zl?.({LitElement:v});(ki.litElementVersions??=[]).push("4.2.2");var lr=class{#e;#t;#r;constructor(e,r){if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");this.#e=e,this.#e.addController(this),this.#t=r}connect(e){this.#t=e,this.#r=this.#n()}hostConnected(){this.#r||setTimeout(()=>{this.#r||(this.#r=this.#n())},0)}hostDisconnected(){this.#r?.close(1e3,"lit_host_disconnected"),this.#r=void 0}send(e){this.#r?.send(e)}close(e,r){this.#r?.close(e,r)}get isConnected(){return this.#r?.readyState===WebSocket.OPEN}get isConnecting(){return this.#r?.readyState===WebSocket.CONNECTING}#n(){let e=new WebSocket(this.#t.url());return this.#t.onClose&&(e.onclose=this.#t.onClose),this.#t.onOpen&&(e.onopen=this.#t.onOpen),this.#t.onError&&(e.onerror=this.#t.onError),this.#t.onMessage&&(e.onmessage=this.#t.onMessage),e}};async function _i(t){await new Promise(e=>setTimeout(e,t))}async function cr({times:t=3,backoff:e=0},r){let i=n=>{throw{_bailed:n}};for(let n=0;n<t;n++)try{return await r(i,n)}catch(s){if(s&&typeof s=="object"&&"_bailed"in s)throw s._bailed;if(n===t-1)throw s;if(typeof e=="number")await _i(e);else if(typeof e=="function")await _i(e(n+1));else throw new TypeError("Invalid backoff option")}throw new Error("unreachable")}var Wl=!0,Ci="Invariant failed";function D(t,e){if(!t){if(Wl)throw new Error(Ci);var r=typeof e=="function"?e():e,i=r?"".concat(Ci,": ").concat(r):Ci;throw new Error(i)}}function $i(t,e,r){return t.slice(0,r)+e}function Vl({content:t,parts:e,appendMessage:r}){let i=[...e],n=t,s=r.part??0;switch(r.content_type){case"text":{let{delta:o,position:a}=r;n=$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 ur=class{messages=Object.freeze([]);onEvent(e){switch(e.type){case"NEW_MESSAGE":{let r={...e.message,streaming:!0,parts:e.message.parts};return this.messages=Object.freeze([...this.messages.filter(i=>i.id!==r.id),r]),r}case"APPEND_MESSAGE":{let i=this.messages.find(s=>s.id===e.message.id)??(()=>{let s={id:e.message.id,timestamp:Date.now(),role:"assistant",content:"",streaming:!0,parts:[]};return this.messages=Object.freeze([...this.messages,s]),s})(),n=Vl({content:i.content,parts:i.parts||[],appendMessage:e.message});return i.content=n.content,i.parts=n.parts,e.metadata&&(i.metadata=e.metadata),i}case"MESSAGE_DONE":{let r=this.messages.find(i=>i.id===e.message.id);return r?(Object.assign(r,e.message),r.streaming=!1,r):void 0}default:return}}onEvents(e){for(let r of e)this.onEvent(r)}getMessage(e){return this.messages.find(r=>r.id===e)}get lastMessage(){return this.messages.at(-1)}reset(){this.messages=Object.freeze([])}};var dr=class{#e;#t;#r=null;#n=new ur;isStreaming=!1;typingIndicator;toolCallIndicator;ranOutOfCredits=!1;get messages(){return this.#n.messages}set messages(e){this.#n.messages=e}conversationId="";#i=0;#o;isLiveMode=!1;get hasQueuedMessages(){return this.#s.length>0}constructor(e,r){this.#e=e,this.#t=r,this.#t.autoConnect!==!1&&(this.#r=this.initWS()),e.addController(this)}#s=[];#a(e,{expectStreaming:r=!1}={}){return this.ranOutOfCredits?!1:this.#r?this.#r.isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):this.#r.isConnected?(r&&!this.isLiveMode&&(this.isStreaming=!0,this.#e.requestUpdate()),this.#r.send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent",e),this.retry(),!1):(console.warn("WebSocket not initialized, message not sent",e),this.connect(),!1)}async enqueueMessage(e,{expectStreaming:r=!1}={}){if(this.#s.length>0){let i=this.#s[this.#s.length-1];if(e.type==="USER_INPUT"&&i.message.type==="USER_INPUT"&&e.value===i.message.value)return!0}return this.#r||this.connect(),this.#r?.isConnected?this.#a(e,{expectStreaming:r}):(this.#s.push({message:e,options:{expectStreaming:r}}),this.#e.requestUpdate(),this.#r&&!this.#r.isConnecting&&!this.#r.isConnected&&this.retry(),await cr({times:5,backoff:2e3},async()=>{if(this.#r?.isConnected){let i=[...this.#s];this.#s=[],this.#e.requestUpdate();let n=!1;for(let{message:s,options:o}of i){let a=this.#a(s,o);s===e&&(n=a)}return n}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),this.#s=[],this.#e.requestUpdate(),!1)))}async sendUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i},{expectStreaming:s})}async sendUserFeedback(e){return this.enqueueMessage({type:"USER_FEEDBACK",responses:e},{expectStreaming:!0})}sendFileDelete(e){D(e,"fileId is required"),this.enqueueMessage({type:"USER_FILE_DELETE",fileId:e}).catch(console.warn)}sendUserCancel(){this.enqueueMessage({type:"USER_CANCEL"}).catch(console.warn)}sendUserTypingStart(){this.#a({type:"USER_TYPING_START"})}sendUserTypingStop(){this.enqueueMessage({type:"USER_TYPING_STOP"}).catch(console.warn)}sendNewChat(){this.enqueueMessage({type:"NEW_CHAT"})}sendUserMeta(e){this.enqueueMessage({type:"USER_META",metadata:e}).catch(console.warn)}reloadConfig(){this.enqueueMessage({type:"RELOAD_CONFIG"}).catch(console.warn)}close(){this.#r?.close(1e3,"closed by user")}retry(){clearTimeout(this.#o),this.#o=setTimeout(()=>{this.#t.onReconnect?.(),this.#r=this.initWS()},1e3*this.#i),this.#i++}initWS(){return new lr(this.#e,{url:()=>this.#t.url(this.conversationId,{}),onOpen:e=>this.#l(e),onMessage:e=>this.#c(JSON.parse(e.data)),onError:e=>this.#d(e),onClose:e=>this.#u(e)})}#l(e){this.#i=0}#c(e){switch(e.type){case"NEW_MESSAGE":{this.#n.onEvent(e),this.typingIndicator=void 0,this.toolCallIndicator=void 0,this.#t.onNewMessage?.(e.message),this.#t.persistConversationState?.(this.conversationId,this.messages),this.#e.requestUpdate();break}case"APPEND_MESSAGE":{let r=!this.#n.getMessage(e.message.id),i=this.#n.onEvent(e);i&&(this.typingIndicator=void 0,this.toolCallIndicator=void 0,r&&(this.#t.onNewMessage?.({id:i.id,timestamp:i.timestamp,role:i.role,content:i.content}),this.#t.persistConversationState?.(this.conversationId,this.messages)),this.#t.onMessageAppend?.(e),this.#e.requestUpdate());break}case"MESSAGE_DONE":{let r=this.#n.onEvent(e);if(!r)throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,this.#e.requestUpdate(),this.#t.onMessageDone?.(e,r),this.#t.persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate();break}case"ERROR":{this.#t.onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.#n.messages=e.messages,this.#t.onConnect?.(e.conversationId,e.metadata),this.#t.persistConversationState?.(e.conversationId,e.messages),this.isLiveMode=e.metadata.isLiveMode,this.#e.requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.toolCallIndicator=void 0,this.typingIndicator={role:e.role,metadata:e.metadata},this.#e.requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,this.#e.requestUpdate();break}case"TOOL_CALL_START":{this.typingIndicator=void 0,this.toolCallIndicator=e.text,this.#e.requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,this.#e.requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),this.#e.requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}}#d(e){console.error("onError",e),this.#t.onError?.(e)}#u(e){this.#e.isConnected&&this.#r&&!this.#r.isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate(),this.#t.onClose?.()}hostConnected(){this.conversationId=this.#t.restoreConversationState?.()?.conversationId||"",this.#n.messages=this.#t.restoreConversationState?.()?.messages||[]}reset(){this.#t.onReset?.(),this.#n.reset(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.conversationId="",this.isLiveMode=!1,this.#s=[],this.#e.requestUpdate()}hostDisconnected(){clearTimeout(this.#o)}connect(){this.#r||(this.#r=this.initWS())}reconnectSocket(){this.#r?.close(1e3,"destroy"),this.#r=this.initWS()}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}get isConnected(){return this.#r?.isConnected??!1}};var Ei;function Ps(t){return{lang:t?.lang??Ei?.lang,message:t?.message,abortEarly:t?.abortEarly??Ei?.abortEarly,abortPipeEarly:t?.abortPipeEarly??Ei?.abortPipeEarly}}var Hl;function Gl(t){return Hl?.get(t)}var Xl;function Jl(t){return Xl?.get(t)}var Kl;function Yl(t,e){return Kl?.get(t)?.get(e)}function Us(t){let e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function H(t,e,r,i,n){let s=n&&"input"in n?n.input:r.value,o=n?.expected??t.expects??null,a=n?.received??Us(s),l={kind:t.kind,type:t.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:n?.path,issues:n?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},c=t.kind==="schema",d=n?.message??t.message??Yl(t.reference,l.lang)??(c?Jl(l.lang):null)??i.message??Gl(l.lang);d!==void 0&&(l.message=typeof d=="function"?d(l):d),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function G(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Ps())}}}function Ql(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Ls(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var Zl=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z|[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;function Si(t){return{kind:"validation",type:"iso_timestamp",reference:Si,async:!1,expects:null,requirement:Zl,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&H(this,"timestamp",e,r),e}}}function Ii(t,e){return{kind:"validation",type:"max_length",reference:Ii,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(r,i){return r.typed&&r.value.length>this.requirement&&H(this,"length",r,i,{received:`${r.value.length}`}),r}}}function Ai(t,e){return{kind:"validation",type:"min_length",reference:Ai,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,i){return r.typed&&r.value.length<this.requirement&&H(this,"length",r,i,{received:`${r.value.length}`}),r}}}function Ti(t){return{kind:"transformation",type:"to_date",reference:Ti,async:!1,message:t,"~run"(e,r){try{e.value=new Date(e.value),isNaN(e.value)&&(H(this,"date",e,r,{received:'"Invalid Date"'}),e.typed=!1)}catch{H(this,"date",e,r),e.typed=!1}return e}}}function Di(t){return{kind:"transformation",type:"transform",reference:Di,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function js(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function Q(t,e){return{...t,fallback:e,get"~standard"(){return G(this)},"~run"(r,i){let n=t["~run"](r,i);return n.issues?{typed:!0,value:js(this,n,i)}:n}}}function Mi(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function St(){return{kind:"schema",type:"any",reference:St,expects:"any",async:!1,get"~standard"(){return G(this)},"~run"(t){return t.typed=!0,t}}}function Ye(t,e){return{kind:"schema",type:"array",reference:Ye,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return G(this)},"~run"(r,i){let n=r.value;if(Array.isArray(n)){r.typed=!0,r.value=[];for(let s=0;s<n.length;s++){let o=n[s],a=this.item["~run"]({value:o},i);if(a.issues){let l={type:"array",origin:"value",input:n,key:s,value:o};for(let c of a.issues)c.path?c.path.unshift(l):c.path=[l],r.issues?.push(c);if(r.issues||(r.issues=a.issues),i.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value.push(a.value)}}else H(this,"type",r,i);return r}}}function Oi(t){return{kind:"schema",type:"boolean",reference:Oi,expects:"boolean",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:H(this,"type",e,r),e}}}function Pi(t){return{kind:"schema",type:"null",reference:Pi,expects:"null",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return e.value===null?e.typed=!0:H(this,"type",e,r),e}}}function pr(t,e){return{kind:"schema",type:"nullish",reference:pr,expects:`(${t.expects} | null | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return G(this)},"~run"(r,i){return(r.value===null||r.value===void 0)&&(this.default!==void 0&&(r.value=Mi(this,r,i)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function hr(t){return{kind:"schema",type:"number",reference:hr,expects:"number",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:H(this,"type",e,r),e}}}function B(t,e){return{kind:"schema",type:"object",reference:B,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return G(this)},"~run"(r,i){let n=r.value;if(n&&typeof n=="object"){r.typed=!0,r.value={};for(let s in this.entries){let o=this.entries[s];if(s in n||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){let a=s in n?n[s]:Mi(o),l=o["~run"]({value:a},i);if(l.issues){let c={type:"object",origin:"value",input:n,key:s,value:a};for(let d of l.issues)d.path?d.path.unshift(c):d.path=[c],r.issues?.push(d);if(r.issues||(r.issues=l.issues),i.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value[s]=l.value}else if(o.fallback!==void 0)r.value[s]=js(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(H(this,"key",r,i,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:n,key:s,value:n[s]}]}),i.abortEarly))break}}else H(this,"type",r,i);return r}}}function A(t,e){return{kind:"schema",type:"optional",reference:A,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return G(this)},"~run"(r,i){return r.value===void 0&&(this.default!==void 0&&(r.value=Mi(this,r,i)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function It(t,e){return{kind:"schema",type:"picklist",reference:It,expects:Ls(t.map(Us),"|"),async:!1,options:t,message:e,get"~standard"(){return G(this)},"~run"(r,i){return this.options.includes(r.value)?r.typed=!0:H(this,"type",r,i),r}}}function At(t,e,r){return{kind:"schema",type:"record",reference:At,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return G(this)},"~run"(i,n){let s=i.value;if(s&&typeof s=="object"){i.typed=!0,i.value={};for(let o in s)if(Ql(s,o)){let a=s[o],l=this.key["~run"]({value:o},n);if(l.issues){let d={type:"object",origin:"key",input:s,key:o,value:a};for(let p of l.issues)p.path=[d],i.issues?.push(p);if(i.issues||(i.issues=l.issues),n.abortEarly){i.typed=!1;break}}let c=this.value["~run"]({value:a},n);if(c.issues){let d={type:"object",origin:"value",input:s,key:o,value:a};for(let p of c.issues)p.path?p.path.unshift(d):p.path=[d],i.issues?.push(p);if(i.issues||(i.issues=c.issues),n.abortEarly){i.typed=!1;break}}(!l.typed||!c.typed)&&(i.typed=!1),l.typed&&(i.value[l.value]=c.value)}}else H(this,"type",i,n);return i}}}function C(t){return{kind:"schema",type:"string",reference:C,expects:"string",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:H(this,"type",e,r),e}}}function Os(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function fr(t,e){return{kind:"schema",type:"union",reference:fr,expects:Ls(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return G(this)},"~run"(r,i){let n,s,o;for(let a of this.options){let l=a["~run"]({value:r.value},i);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{n=l;break}else o?o.push(l):o=[l]}if(n)return n;if(s){if(s.length===1)return s[0];H(this,"type",r,i,{issues:Os(s)}),r.typed=!0}else{if(o?.length===1)return o[0];H(this,"type",r,i,{issues:Os(o)})}return r}}}function Rs(t,e){let r={};for(let i in t.entries)r[i]=!e||e.includes(i)?A(t.entries[i]):t.entries[i];return{...t,entries:r,get"~standard"(){return G(this)}}}function Qe(...t){return{...t[0],pipe:t,get"~standard"(){return G(this)},"~run"(e,r){for(let i of t)if(i.kind!=="metadata"){if(e.issues&&(i.kind==="schema"||i.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=i["~run"](e,r))}return e}}}function se(t,e,r){let i=t["~run"]({value:e},Ps(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var mr=Rs(B({url:C(),name:C(),description:C(),price:C()}));function Fs(t){return t.flatMap(e=>{if(!("tag"in e))return[];switch(e.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let r=se(mr,e.data);if(r.success)return[{name:r.output.name??"",price:r.output.price??"0"}];break}case"thought":case"order-status-card-v1":case"order-card-v2":case"live-chat-wait-card-v1":case"live-chat-wait-card-v2":case"request-input-v1":break}return[]})}var ec=Symbol();var qs=Object.getPrototypeOf,Ui=new WeakMap,tc=t=>t&&(Ui.has(t)?Ui.get(t):qs(t)===Object.prototype||qs(t)===Array.prototype);var Bs=t=>tc(t)&&t[ec]||null,Li=(t,e=!0)=>{Ui.set(t,e)};var Ri=t=>typeof t=="object"&&t!==null,rc=t=>Ri(t)&&!Fi.has(t)&&(Array.isArray(t)||!(Symbol.iterator in t))&&!(t instanceof WeakMap)&&!(t instanceof WeakSet)&&!(t instanceof Error)&&!(t instanceof Number)&&!(t instanceof Date)&&!(t instanceof String)&&!(t instanceof RegExp)&&!(t instanceof ArrayBuffer)&&!(t instanceof Promise),Ws=(t,e)=>{let r=Ns.get(t);if(r?.[0]===e)return r[1];let i=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return Li(i,!0),Ns.set(t,[e,i]),Reflect.ownKeys(t).forEach(n=>{if(Object.getOwnPropertyDescriptor(i,n))return;let s=Reflect.get(t,n),{enumerable:o}=Reflect.getOwnPropertyDescriptor(t,n),a={value:s,enumerable:o,configurable:!0};if(Fi.has(s))Li(s,!1);else if(je.has(s)){let[l,c]=je.get(s);a.value=Ws(l,c())}Object.defineProperty(i,n,a)}),Object.preventExtensions(i)},ic=(t,e,r,i)=>({deleteProperty(n,s){let o=Reflect.get(n,s);r(s);let a=Reflect.deleteProperty(n,s);return a&&i(gr?.("delete",s,o)),a},set(n,s,o,a){let l=!t()&&Reflect.has(n,s),c=Reflect.get(n,s,a);if(l&&(zs(c,o)||yr.has(o)&&zs(c,yr.get(o))))return!0;r(s),Ri(o)&&(o=Bs(o)||o);let d=!je.has(o)&&sc(o)?qi(o):o;return e(s,d),Reflect.set(n,s,d,a),i(gr?.("set",s,o,c)),!0}});var je=new WeakMap,Fi=new WeakSet,Ns=new WeakMap,ji=[1],yr=new WeakMap,zs=Object.is,nc=(t,e)=>new Proxy(t,e),sc=rc,oc=Ws,ac=ic,gr;function qi(t={}){if(!Ri(t))throw new Error("object required");let e=yr.get(t);if(e)return e;let r=ji[0],i=new Set,n=(x,$=++ji[0])=>{r!==$&&(s=r=$,i.forEach(b=>b(x,$)))},s=r,o=(x=ji[0])=>(s!==x&&(s=x,l.forEach(([$])=>{let b=$[1](x);b>r&&(r=b)})),r),a=x=>($,b)=>{let k;$&&(k=[...$],k[1]=[x,...k[1]]),n(k,b)},l=new Map,c=(x,$)=>{let b=!Fi.has($)&&je.get($);if(b){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(x))throw new Error("prop listener already exists");if(i.size){let k=b[2](a(x));l.set(x,[b,k])}else l.set(x,[b])}},d=x=>{var $;let b=l.get(x);b&&(l.delete(x),($=b[1])==null||$.call(b))},p=x=>(i.add(x),i.size===1&&l.forEach(([b,k],S)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&k)throw new Error("remove already exists");let P=b[2](a(S));l.set(S,[b,P])}),()=>{i.delete(x),i.size===0&&l.forEach(([b,k],S)=>{k&&(k(),l.set(S,[b]))})}),h=!0,y=ac(()=>h,c,d,n),f=nc(t,y);yr.set(t,f);let E=[t,o,p];return je.set(f,E),Reflect.ownKeys(t).forEach(x=>{let $=Object.getOwnPropertyDescriptor(t,x);"value"in $&&$.writable&&(f[x]=t[x])}),h=!1,f}function br(t,e,r){let i=je.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!i&&console.warn("Please use proxy object");let n,s=[],o=i[2],a=!1,c=o(d=>{if(d&&s.push(d),r){e(s.splice(0));return}n||(n=Promise.resolve().then(()=>{n=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,c()}}function Ze(t){let e=je.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,i]=e;return oc(r,i())}var et=class{#e;#t;#r;#n=()=>{};constructor(e,r){this.#e=e,this.#t=r,this.#r=Ze(r),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#n(),this.#n=br(this.#t,()=>{this.#r=Ze(this.#t),this.#e.requestUpdate()})}hostDisconnected(){this.#n()}};var ke=class{#e;#t;proxyObject;#r;#n=()=>{};constructor(e,r,i){this.#e=e,this.#t=i,this.proxyObject=qi(r),this.#r=Ze(this.proxyObject),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#n(),this.#t?.subscribe&&(this.#n=br(this.proxyObject,()=>{this.#r=Ze(this.proxyObject),this.#e.requestUpdate()}))}hostDisconnected(){this.#n()}};var vr=class{#e;#t;#r;#n=null;#i=null;constructor(e,{provider:r,tag:i,key:n}){this.#e=e,this.#t=i,this.#r=n,e.addController(this)}get value(){return this.#i?this.#i.value:null}hostConnected(){if(this.#i||(this.#n=lc(this.#e,this.#t),!this.#n))return;let e=this.#n[this.#r]instanceof ke?this.#n[this.#r]:null;e&&(this.#i=new et(this.#e,e.proxyObject))}hostDisconnected(){}};function lc(t,e){let r=t;for(;r;){let i=r.closest(e);if(i)return i;let n=r.getRootNode();if(n instanceof ShadowRoot)r=n.host;else break}return null}function Bi(t,e){if(e<=0)return"";if(t=t??"",t.length>e){let r=e-1;return r>0&&t.charCodeAt(r-1)>=55296&&t.charCodeAt(r-1)<=56319&&r--,t.slice(0,r)+"\u2026"}return t}var Vs=()=>{if(window.Shopify)try{return{customerId:cc()}}catch{return null}return null},cc=()=>{try{let t=[()=>window.ShopifyAnalytics?.meta?.page?.customerId,()=>window.meta?.page?.customerId,()=>window._st?.cid,()=>window.ShopifyAnalytics?.lib?.user()?.traits()?.uniqToken];for(let e of t)try{let r=e();if(/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i.test(r))continue;if(r)return r}catch{}}catch{return null}return null},Hs=async()=>{try{return(await(await fetch(window.Shopify.routes.root+"cart.js")).json()).items.map(i=>({id:i.id,name:i.title,quantity:i.quantity,price:i.price,variantId:i.variant_id,sku:i.sku,url:i.url,description:i.product_description,image:i.featured_image?.url}))}catch{return[]}};function Gs(t){if(t instanceof URLSearchParams)return new URLSearchParams(t);let e=new URLSearchParams;for(let[r,i]of Object.entries(t))i!=null&&e.set(r,String(i));return e}function Xs(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function tt(t){let e="[-a-z\\d%_.~!$&'()*+,;=:@]",r="[-a-z\\d%_.~!$&'()*+,;=:@/?]";return new RegExp(`^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/${e}*)*(\\?${r}*)?(\\#${r}*)?$`,"i").test(t)}function Js(t,e){let r=t instanceof URL?t:new URL(t);if(e)for(let[i,n]of e)r.searchParams.set(i,n);return r}var Ks=()=>{if(window.ShopRenter)try{let t=dc();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},dc=()=>{try{if(window.ShopRenter){let t=window.ShopRenter.customer;return{customerEmail:t?.email,customerId:t?.userId,customerName:[t?.name?.firstName,t?.name?.lastName].filter(Boolean).join(" ")}}return{customerEmail:null,customerId:null,customerName:null}}catch{return{customerEmail:null,customerId:null,customerName:null}}},Ys=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=Xs(t,"https")+"/cart.json";return(await(await fetch(e)).json()).items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku,image:s.image,url:s.href}))}catch{return[]}};var Qs=()=>{if(window.UNAS)try{let t=window.UNAS.customer;return{customerEmail:t?.email,customerId:t?.id}}catch(t){return console.error("Error fetching customer information:",t),null}return null},Zs=async()=>new Promise((t,e)=>{try{window.UNAS.getCart(r=>{let n=r.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));t(n)})}catch(r){console.error("Error fetching cart information:",r),e(r)}});var Tt=pi(Wi(),1);var xr=class{#e;constructor({document:e}){this.#e=e}getCookies(){return(0,Tt.parseCookie)(this.#e.cookie)||{}}getCookie(e){return this.getCookies()[e]||null}setCookie(e,r,i){if(D(typeof e=="string",`cookie name must be a string, got: ${typeof e}`),D(e,"cookie name must not be empty"),r==null){this.#e.cookie=(0,Tt.stringifySetCookie)(e,"",{expires:new Date(0)});return}D(typeof r=="string",`value of cookie \`${e}\` must be a string, got: ${typeof r}`),this.#e.cookie=(0,Tt.stringifySetCookie)(e,r,i)}deleteCookie(e){this.setCookie(e,null)}deleteCookies(e){let r=this.getCookies();for(let i in r)e(i)&&this.deleteCookie(i)}};var kr=class{#e;constructor({localStorage:e}){this.#e=e}getItem(e){try{let r=this.#e.getItem(e);return r?JSON.parse(r):null}catch{return null}}setItem(e,r){if(r==null){this.#e.removeItem(e);return}try{let i=JSON.stringify(r);this.#e.setItem(e,i)}catch(i){console.error(`Failed to store ${e} in localStorage:`,i)}}removeItem(e){this.#e.removeItem(e)}removeItems(e){let r=[];for(let i=0;i<this.#e.length;i++){let n=this.#e.key(i);n&&e(n)&&r.push(n)}for(let i of r)this.#e.removeItem(i)}};var Dt=pi(Wi(),1);function Vi({window:t}){let e=t.location.hostname,r=t.document;if(e==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(e)||/^\[.*\]$/.test(e))return;let i=e.split(".");if(i.length<2)return;let n="__molin_domain_test__";for(let s=2;s<=i.length;s++){let o=`.${i.slice(-s).join(".")}`;try{if(r.cookie=(0,Dt.stringifySetCookie)(n,"1",{domain:o,path:"/"}),(0,Dt.parseCookie)(r.cookie)[n]==="1")return r.cookie=(0,Dt.stringifySetCookie)(n,"",{domain:o,path:"/",expires:new Date(0)}),o}catch{continue}}return`.${i.slice(-2).join(".")}`}var Hi=class{#e;#t;#r;#n;constructor({window:e}){this.#e=e,this.#t=new xr({document:e.document}),this.#r=new kr({localStorage:e.localStorage}),this.#n=e.localStorage}get distinctID(){return this.#t.getCookie("molin_distinct_id")||this.#n.getItem("molin_distinct_id")}set distinctID(e){if(!e){this.#t.deleteCookie("molin_distinct_id"),this.#n.removeItem("molin_distinct_id");return}D(typeof e=="string","distinct_id must be a string");try{this.#t.setCookie("molin_distinct_id",e,{path:"/",sameSite:"lax",expires:new Date(Date.now()+1e3*60*60*24*365),domain:Vi({window:this.#e})})}catch(r){console.warn("Could not write distinct_id to cookie:",r)}try{this.#n.setItem("molin_distinct_id",e)}catch(r){console.warn("Could not write distinct_id to localStorage:",r)}}get widgetState(){return this.#r.getItem("molin_widget")}set widgetState(e){this.#r.setItem("molin_widget",e)}get popupState(){return this.#r.getItem("molin_popup")}set popupState(e){this.#r.setItem("molin_popup",e)}get disclaimerDismissed(){return this.#r.getItem("molin_disclaimer_dismissed")??!1}set disclaimerDismissed(e){this.#r.setItem("molin_disclaimer_dismissed",e)}getConversationId(e){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let r=`molin_${e}_conversation_id`;return this.#t.getCookie(r)||this.#n.getItem(r)}setConversationId(e,r){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let i=`molin_${e}_conversation_id`;if(!r){this.#t.deleteCookie(i),this.#n.removeItem(i);return}D(typeof r=="string",`conversation ID for widget ${e} must be a string`);try{this.#t.setCookie(i,r,{path:"/",sameSite:"lax",expires:new Date(Date.now()+1e3*60*60*24*365),domain:Vi({window:this.#e})})}catch(n){console.warn(`Could not write ${i} to cookie:`,n)}try{this.#n.setItem(i,r)}catch(n){console.warn(`Could not write ${i} to localStorage:`,n)}}getConversationState(e){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let r=`molin_${e}_conversation`;return this.#r.getItem(r)}setConversationState(e,r){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let i=`molin_${e}_conversation`;this.#r.setItem(i,r)}resetAll(){this.distinctID=null,this.widgetState=null,this.popupState=null,this.disclaimerDismissed=!1,this.#r.removeItems(e=>e.startsWith("_molin_")),this.#t.deleteCookies(e=>e.startsWith("_molin_"))}},no;function j(){return no??=new Hi({window}),no}var so=At(C(),fr([C(),hr(),Oi(),Pi()])),oo=Qe(C(),Ai(1),Ii(5e3)),ao=()=>{try{return window.UNAS?Qs():window.Shopify?Vs():window.ShopRenter?Ks():null}catch{return null}},lo=async()=>{try{return window.UNAS?await Zs():window.Shopify?await Hs():window.ShopRenter?await Ys():[]}catch{return[]}},rt={schema:B({conversationId:A(C()),messages:A(Ye(B({id:C(),timestamp:hr(),role:It(["user","assistant","support"]),content:C(),parts:A(Ye(fr([B({text:C()}),B({html:C()}),B({tag:C(),data:At(C(),St())})])))})))}),persist(t,e,r){j().setConversationState(t,{conversationId:e,messages:r}),j().setConversationId(t,e)},restore(t){try{let e=j().getConversationState(t),r=e?se(this.schema,e):void 0;return r?.success&&r.output.conversationId?{conversationId:r.output.conversationId,messages:r.output.messages||[]}:{conversationId:j().getConversationId(t)||"",messages:[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(t){j().setConversationState(t,null),j().setConversationId(t,null)}};var it=class t extends v{static properties={widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object}};contextCtrl;constructor(){super(),this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.contextCtrl=new ke(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,toolCallIndicator:void 0,ranOutOfCredits:!1,isLiveMode:!1,lastMsg:void 0,hasQueuedMessages:!1,isConnected:()=>this.#i.isConnected,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),sendNewChat:this.sendNewChat.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),sendUserFeedback:this.sendUserFeedback.bind(this),sendFileDelete:this.#i.sendFileDelete.bind(this.#i)})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.#i.connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:this.#t,xCustomInstructions:this.#r,conversationId:this.#i.conversationId,messages:this.#e,isStreaming:this.#i.isStreaming,typingIndicator:this.#i.typingIndicator,toolCallIndicator:this.#i.toolCallIndicator,ranOutOfCredits:this.#i.ranOutOfCredits,isLiveMode:this.#i.isLiveMode,lastMsg:this.#i.lastMsg,hasQueuedMessages:this.#i.hasQueuedMessages,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),sendUserFeedback:this.sendUserFeedback.bind(this),sendFileDelete:this.#i.sendFileDelete.bind(this.#i)}),this.#o()}get#e(){return this.#i?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:this.#i?.messages||[]}#t;#r;#n=null;get#i(){return this.#n||(this.#n=new dr(this,{url:e=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("conversationId",e),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:e=>{console.error("ws error",e)},onClose:()=>{},onNewMessage:e=>{e.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:e,conversationId:this.#i.conversationId})},onMessageAppend:e=>{},onMessageDone:(e,r)=>{if(r.role==="assistant"){let i=Fs(r.parts??[]);this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,conversationId:this.#i.conversationId,products:i})}},onMessageError:e=>{console.error("ws message error",e),e.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+e.message})},onReset:()=>{rt.reset(this.widgetId)},onConnect:(e,r)=>{let i=ao();this.#i.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),lo().then(n=>{n?.length>0&&this.#i.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,cart:n,language:window.navigator.language})}).catch(n=>{console.error(n)}),this.dispatchEvent(new t.ConnectedEvent({conversationId:e,metadata:r,widgetId:this.widgetId,pendingImages:r?.pendingImages||[]}))},persistConversationState:(e,r)=>{rt.persist(this.widgetId,e,r)},restoreConversationState:()=>rt.restore(this.widgetId)})),this.#n}#o(){function e(i){if(!i)return;let n;try{n=typeof i=="object"?i:JSON.parse(i)}catch(o){console.error("Molin: user-data is not valid JSON",o);return}if(!n||typeof n!="object"||Object.keys(n).length===0)return;let s=se(so,n);if(!s.success){console.error("Molin: user-data does not pass schema validation",s.issues);return}return s.output}function r(i){if(!i)return;let n=se(oo,i);if(!n.success){console.error("Molin: custom-instructions does not pass schema validation",n.issues);return}return n.output}this.#t=e(this.xUserData),this.#r=r(this.xCustomInstructions)}async sendUserInput(e,r={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...r},n=await this.#i.sendUserInput(e,i);return n&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!1,conversationId:this.#i.conversationId}),n}async enqueueUserInput(e,r={}){e.length>1e3&&(console.error("Message exceeds max length of 1000 characters, trimming"),e=Bi(e,1e3)),this.#e.some(o=>o.role==="assistant"&&o.parts?.some(a=>"tag"in a&&a.tag==="request-input-v1"&&"data"in a&&a.data.type==="new-conversation-button"))&&(this.sendNewChat(),this.reset());let s={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...r};return this.#i.enqueueUserInput(e,s)}async sendUserFeedback(e){return this.#i.sendUserFeedback(e)}sendUserCancel(){this.#i.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){this.#i.sendUserTypingStart()}sendUserTypingStop(){this.#i.sendUserTypingStop()}sendNewChat(){this.#i.sendNewChat()}reset(){this.#i.reset()}reloadConfig(){this.#i.reloadConfig()}render(){return u`<slot></slot>`}};function co(t){let e=new vr(t,{provider:it,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,i){if(i==="value")return e.value}})}it.ConnectedEvent=class extends CustomEvent{static type="mw-context-widget:connected";constructor(e,r={}){super(it.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-context-widget")||customElements.define("mw-context-widget",it);var kc=Object.freeze({"lucide:arrow-up":u`
|
|
1
|
+
var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDescriptor;var Al=Object.getOwnPropertyNames;var Tl=Object.getPrototypeOf,Dl=Object.prototype.hasOwnProperty;var Je=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ml=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Al(e))!Dl.call(t,n)&&n!==r&&hs(t,n,{get:()=>e[n],enumerable:!(i=Il(e,n))||i.enumerable});return t};var pi=(t,e,r)=>(r=t!=null?Sl(Tl(t)):{},Ml(e||!t||!t.__esModule?hs(r,"default",{value:t,enumerable:!0}):r,t));var Wi=Je(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.parseCookie=ro;le.parse=ro;le.stringifyCookie=vc;le.stringifySetCookie=wr;le.serialize=wr;le.parseSetCookie=wc;le.stringifySetCookie=wr;le.serialize=wr;var eo=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,to=/^[\u0021-\u003A\u003C-\u007E]*$/,fc=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,mc=/^[\u0020-\u003A\u003D-\u007E]*$/,gc=/^-?\d+$/,yc=Object.prototype.toString,bc=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function ro(t,e){let r=new bc,i=t.length;if(i<2)return r;let n=e?.decode||io,s=0;do{let o=zi(t,s,i);if(o===-1)break;let a=Ni(t,s,i);if(o>a){s=t.lastIndexOf(";",o-1)+1;continue}let l=Ce(t,s,o);r[l]===void 0&&(r[l]=n(Ce(t,o+1,a))),s=a+1}while(s<i);return r}function vc(t,e){let r=e?.encode||encodeURIComponent,i=[];for(let n of Object.keys(t)){let s=t[n];if(s===void 0)continue;if(!eo.test(n))throw new TypeError(`cookie name is invalid: ${n}`);let o=r(s);if(!to.test(o))throw new TypeError(`cookie val is invalid: ${s}`);i.push(`${n}=${o}`)}return i.join("; ")}function wr(t,e,r){let i=typeof t=="object"?t:{...r,name:t,value:String(e)},s=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!eo.test(i.name))throw new TypeError(`argument name is invalid: ${i.name}`);let o=i.value?s(i.value):"";if(!to.test(o))throw new TypeError(`argument val is invalid: ${i.value}`);let a=i.name+"="+o;if(i.maxAge!==void 0){if(!Number.isInteger(i.maxAge))throw new TypeError(`option maxAge is invalid: ${i.maxAge}`);a+="; Max-Age="+i.maxAge}if(i.domain){if(!fc.test(i.domain))throw new TypeError(`option domain is invalid: ${i.domain}`);a+="; Domain="+i.domain}if(i.path){if(!mc.test(i.path))throw new TypeError(`option path is invalid: ${i.path}`);a+="; Path="+i.path}if(i.expires){if(!xc(i.expires)||!Number.isFinite(i.expires.valueOf()))throw new TypeError(`option expires is invalid: ${i.expires}`);a+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.partitioned&&(a+="; Partitioned"),i.priority)switch(typeof i.priority=="string"?i.priority.toLowerCase():void 0){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${i.priority}`)}if(i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:case"strict":a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"none":a+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${i.sameSite}`)}return a}function wc(t,e){let r=e?.decode||io,i=t.length,n=Ni(t,0,i),s=zi(t,0,n),o=s===-1?{name:"",value:r(Ce(t,0,n))}:{name:Ce(t,0,s),value:r(Ce(t,s+1,n))},a=n+1;for(;a<i;){let l=Ni(t,a,i),c=zi(t,a,l),d=c===-1?Ce(t,a,l):Ce(t,a,c),p=c===-1?void 0:Ce(t,c+1,l);switch(d.toLowerCase()){case"httponly":o.httpOnly=!0;break;case"secure":o.secure=!0;break;case"partitioned":o.partitioned=!0;break;case"domain":o.domain=p;break;case"path":o.path=p;break;case"max-age":p&&gc.test(p)&&(o.maxAge=Number(p));break;case"expires":if(!p)break;let h=new Date(p);Number.isFinite(h.valueOf())&&(o.expires=h);break;case"priority":if(!p)break;let y=p.toLowerCase();(y==="low"||y==="medium"||y==="high")&&(o.priority=y);break;case"samesite":if(!p)break;let f=p.toLowerCase();(f==="lax"||f==="strict"||f==="none")&&(o.sameSite=f);break}a=l+1}return o}function Ni(t,e,r){let i=t.indexOf(";",e);return i===-1?r:i}function zi(t,e,r){let i=t.indexOf("=",e);return i<r?i:-1}function Ce(t,e,r){let i=e,n=r;do{let s=t.charCodeAt(i);if(s!==32&&s!==9)break}while(++i<n);for(;n>i;){let s=t.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}return t.slice(i,n)}function io(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function xc(t){return yc.call(t)==="[object Date]"}});var ia=Je(qe=>{"use strict";var au=qe&&qe.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},lu=qe&&qe.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(qe,"__esModule",{value:!0});qe.base64ToBlob=cu;function cu(t){return au(this,void 0,void 0,function(){var e,r,i;return lu(this,function(n){switch(n.label){case 0:return[4,fetch(t)];case 1:return e=n.sent(),[4,e.blob()];case 2:return r=n.sent(),i=du(t),i&&(r=r.slice(0,r.size,i)),[2,r]}})})}var uu=/^data:(.+);base64,/;function du(t){var e;return(e=t.match(uu))===null||e===void 0?void 0:e.slice(1,2).pop()}});var na=Je(Be=>{"use strict";var pu=Be&&Be.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},hu=Be&&Be.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Be,"__esModule",{value:!0});Be.base64ToFile=fu;function fu(t,e,r){return pu(this,void 0,void 0,function(){var i,n;return hu(this,function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:return i=s.sent(),[4,i.blob()];case 2:return n=s.sent(),[2,new File([n],e,r)]}})})}});var bn=Je(Ne=>{"use strict";var gn=Ne&&Ne.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},yn=Ne&&Ne.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.blobToBase64=mu;function mu(t){return gn(this,void 0,void 0,function(){return yn(this,function(e){return[2,typeof FileReader=="function"?gu(t):bu(t)]})})}var lt;(function(t){t.error="error",t.loadend="loadend"})(lt||(lt={}));function gu(t){return gn(this,void 0,void 0,function(){return yn(this,function(e){return[2,new Promise(function(r,i){try{var n=new FileReader,s=function(){r(n.result),n.removeEventListener(lt.loadend,s)};n.addEventListener(lt.loadend,s);var o=function(){i(n.error),n.removeEventListener(lt.error,o)};n.addEventListener(lt.error,o),n.readAsDataURL(t)}catch(a){i(a)}})]})})}var yu="application/octet-stream";function bu(t){return gn(this,void 0,void 0,function(){var e,r,i,n;return yn(this,function(s){switch(s.label){case 0:return i=(r=Buffer).from,[4,t.text()];case 1:return e=i.apply(r,[s.sent()]),n=t.type||yu,[2,"data:".concat(n,";base64,").concat(e.toString("base64"))]}})})}});var sa=Je(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.fileToBase64=void 0;var vu=bn();Object.defineProperty(Or,"fileToBase64",{enumerable:!0,get:function(){return vu.blobToBase64}})});var oa=Je(ue=>{"use strict";var wu=ue&&ue.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),Pr=ue&&ue.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wu(e,t,r)};Object.defineProperty(ue,"__esModule",{value:!0});Pr(ia(),ue);Pr(na(),ue);Pr(bn(),ue);Pr(sa(),ue)});var Zt=globalThis,er=Zt.ShadowRoot&&(Zt.ShadyCSS===void 0||Zt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,hi=Symbol(),fs=new WeakMap,xt=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==hi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(er&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=fs.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&fs.set(r,e))}return e}toString(){return this.cssText}},ms=t=>new xt(typeof t=="string"?t:t+"",void 0,hi),O=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((i,n,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new xt(r,t,hi)},gs=(t,e)=>{if(er)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=Zt.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},fi=er?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return ms(r)})(t):t;var{is:Ol,defineProperty:Pl,getOwnPropertyDescriptor:Ul,getOwnPropertyNames:Ll,getOwnPropertySymbols:jl,getPrototypeOf:Rl}=Object,tr=globalThis,ys=tr.trustedTypes,Fl=ys?ys.emptyScript:"",ql=tr.reactiveElementPolyfillSupport,kt=(t,e)=>t,mi={toAttribute(t,e){switch(e){case Boolean:t=t?Fl:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},vs=(t,e)=>!Ol(t,e),bs={attribute:!0,type:String,converter:mi,reflect:!1,useDefault:!1,hasChanged:vs};Symbol.metadata??=Symbol("metadata"),tr.litPropertyMetadata??=new WeakMap;var me=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=bs){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Pl(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){let{get:n,set:s}=Ul(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get:n,set(o){let a=n?.call(this);s?.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??bs}static _$Ei(){if(this.hasOwnProperty(kt("elementProperties")))return;let e=Rl(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(kt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(kt("properties"))){let r=this.properties,i=[...Ll(r),...jl(r)];for(let n of i)this.createProperty(n,r[n])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[i,n]of r)this.elementProperties.set(i,n)}this._$Eh=new Map;for(let[r,i]of this.elementProperties){let n=this._$Eu(r,i);n!==void 0&&this._$Eh.set(n,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)r.unshift(fi(n))}else e!==void 0&&r.push(fi(e));return r}static _$Eu(e,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,r=this.constructor.elementProperties;for(let i of r.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return gs(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$ET(e,r){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:mi).toAttribute(r,i.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,r){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=i.getPropertyOptions(n),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:mi;this._$Em=n;let a=o.fromAttribute(r,s.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(e,r,i,n=!1,s){if(e!==void 0){let o=this.constructor;if(n===!1&&(s=this[e]),i??=o.getPropertyOptions(e),!((i.hasChanged??vs)(s,r)||i.useDefault&&i.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,r,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:i,reflect:n,wrapped:s},o){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??r??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(r=void 0),this._$AL.set(e,r)),n===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[n,s]of i){let{wrapped:o}=s,a=this[n];o!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,s,a)}}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(r)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$EO?.forEach(r=>r.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(r=>this._$ET(r,this[r])),this._$EM()}updated(e){}firstUpdated(e){}};me.elementStyles=[],me.shadowRootOptions={mode:"open"},me[kt("elementProperties")]=new Map,me[kt("finalized")]=new Map,ql?.({ReactiveElement:me}),(tr.reactiveElementVersions??=[]).push("2.1.2");var yi=globalThis,ws=t=>t,rr=yi.trustedTypes,xs=rr?rr.createPolicy("lit-html",{createHTML:t=>t}):void 0,bi="$lit$",ge=`lit$${Math.random().toFixed(9).slice(2)}$`,vi="?"+ge,Bl=`<${vi}>`,Ue=document,Ct=()=>Ue.createComment(""),Et=t=>t===null||typeof t!="object"&&typeof t!="function",wi=Array.isArray,Ss=t=>wi(t)||typeof t?.[Symbol.iterator]=="function",gi=`[
|
|
2
|
+
\f\r]`,_t=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ks=/-->/g,_s=/>/g,Oe=RegExp(`>|${gi}(?:([^\\s"'>=/]+)(${gi}*=${gi}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Cs=/'/g,Es=/"/g,Is=/^(?:script|style|textarea|title)$/i,xi=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),u=xi(1),Md=xi(2),Od=xi(3),ne=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),$s=new WeakMap,Pe=Ue.createTreeWalker(Ue,129);function As(t,e){if(!wi(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return xs!==void 0?xs.createHTML(e):e}var Ts=(t,e)=>{let r=t.length-1,i=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=_t;for(let a=0;a<r;a++){let l=t[a],c,d,p=-1,h=0;for(;h<l.length&&(o.lastIndex=h,d=o.exec(l),d!==null);)h=o.lastIndex,o===_t?d[1]==="!--"?o=ks:d[1]!==void 0?o=_s:d[2]!==void 0?(Is.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Oe):d[3]!==void 0&&(o=Oe):o===Oe?d[0]===">"?(o=n??_t,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Oe:d[3]==='"'?Es:Cs):o===Es||o===Cs?o=Oe:o===ks||o===_s?o=_t:(o=Oe,n=void 0);let y=o===Oe&&t[a+1].startsWith("/>")?" ":"";s+=o===_t?l+Bl:p>=0?(i.push(c),l.slice(0,p)+bi+l.slice(p)+ge+y):l+ge+(p===-2?a:y)}return[As(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},$t=class t{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,o=0,a=e.length-1,l=this.parts,[c,d]=Ts(e,r);if(this.el=t.createElement(c,i),Pe.currentNode=this.el.content,r===2||r===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=Pe.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let p of n.getAttributeNames())if(p.endsWith(bi)){let h=d[o++],y=n.getAttribute(p).split(ge),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:s,name:f[2],strings:y,ctor:f[1]==="."?nr:f[1]==="?"?sr:f[1]==="@"?or:je}),n.removeAttribute(p)}else p.startsWith(ge)&&(l.push({type:6,index:s}),n.removeAttribute(p));if(Is.test(n.tagName)){let p=n.textContent.split(ge),h=p.length-1;if(h>0){n.textContent=rr?rr.emptyScript:"";for(let y=0;y<h;y++)n.append(p[y],Ct()),Pe.nextNode(),l.push({type:2,index:++s});n.append(p[h],Ct())}}}else if(n.nodeType===8)if(n.data===vi)l.push({type:2,index:s});else{let p=-1;for(;(p=n.data.indexOf(ge,p+1))!==-1;)l.push({type:7,index:s}),p+=ge.length-1}s++}}static createElement(e,r){let i=Ue.createElement("template");return i.innerHTML=e,i}};function Le(t,e,r=t,i){if(e===ne)return e;let n=i!==void 0?r._$Co?.[i]:r._$Cl,s=Et(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(t),n._$AT(t,r,i)),i!==void 0?(r._$Co??=[])[i]=n:r._$Cl=n),n!==void 0&&(e=Le(t,n._$AS(t,e.values),n,i)),e}var ir=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:r},parts:i}=this._$AD,n=(e?.creationScope??Ue).importNode(r,!0);Pe.currentNode=n;let s=Pe.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Ke(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new ar(s,this,e)),this._$AV.push(c),l=i[++a]}o!==l?.index&&(s=Pe.nextNode(),o++)}return Pe.currentNode=Ue,n}p(e){let r=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}},Ke=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,i,n){this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Le(this,e,r),Et(e)?e===U||e==null||e===""?(this._$AH!==U&&this._$AR(),this._$AH=U):e!==this._$AH&&e!==ne&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ss(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==U&&Et(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ue.createTextNode(e)),this._$AH=e}$(e){let{values:r,_$litType$:i}=e,n=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=$t.createElement(As(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(r);else{let s=new ir(n,this),o=s.u(this.options);s.p(r),this.T(o),this._$AH=s}}_$AC(e){let r=$s.get(e.strings);return r===void 0&&$s.set(e.strings,r=new $t(e)),r}k(e){wi(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,i,n=0;for(let s of e)n===r.length?r.push(i=new t(this.O(Ct()),this.O(Ct()),this,this.options)):i=r[n],i._$AI(s),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e!==this._$AB;){let i=ws(e).nextSibling;ws(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},je=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,i,n,s){this.type=1,this._$AH=U,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=U}_$AI(e,r=this,i,n){let s=this.strings,o=!1;if(s===void 0)e=Le(this,e,r,0),o=!Et(e)||e!==this._$AH&&e!==ne,o&&(this._$AH=e);else{let a=e,l,c;for(e=s[0],l=0;l<s.length-1;l++)c=Le(this,a[i+l],r,l),c===ne&&(c=this._$AH[l]),o||=!Et(c)||c!==this._$AH[l],c===U?e=U:e!==U&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!n&&this.j(e)}j(e){e===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},nr=class extends je{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}},sr=class extends je{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==U)}},or=class extends je{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){if((e=Le(this,e,r,0)??U)===ne)return;let i=this._$AH,n=e===U&&i!==U||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==U&&(i===U||n);n&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ar=class{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Le(this,e)}},Ds={M:bi,P:ge,A:vi,C:1,L:Ts,R:ir,D:Ss,V:Le,I:Ke,H:je,N:sr,U:or,B:nr,F:ar},Nl=yi.litHtmlPolyfillSupport;Nl?.($t,Ke),(yi.litHtmlVersions??=[]).push("3.3.2");var Ms=(t,e,r)=>{let i=r?.renderBefore??e,n=i._$litPart$;if(n===void 0){let s=r?.renderBefore??null;i._$litPart$=n=new Ke(e.insertBefore(Ct(),s),s,void 0,r??{})}return n._$AI(t),n};var ki=globalThis,v=class extends me{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ms(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ne}};v._$litElement$=!0,v.finalized=!0,ki.litElementHydrateSupport?.({LitElement:v});var zl=ki.litElementPolyfillSupport;zl?.({LitElement:v});(ki.litElementVersions??=[]).push("4.2.2");var lr=class{#e;#t;#r;constructor(e,r){if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");this.#e=e,this.#e.addController(this),this.#t=r}connect(e){this.#t=e,this.#r=this.#n()}hostConnected(){this.#r||setTimeout(()=>{this.#r||(this.#r=this.#n())},0)}hostDisconnected(){this.#r?.close(1e3,"lit_host_disconnected"),this.#r=void 0}send(e){this.#r?.send(e)}close(e,r){this.#r?.close(e,r)}get isConnected(){return this.#r?.readyState===WebSocket.OPEN}get isConnecting(){return this.#r?.readyState===WebSocket.CONNECTING}#n(){let e=new WebSocket(this.#t.url());return this.#t.onClose&&(e.onclose=this.#t.onClose),this.#t.onOpen&&(e.onopen=this.#t.onOpen),this.#t.onError&&(e.onerror=this.#t.onError),this.#t.onMessage&&(e.onmessage=this.#t.onMessage),e}};async function _i(t){await new Promise(e=>setTimeout(e,t))}async function cr({times:t=3,backoff:e=0},r){let i=n=>{throw{_bailed:n}};for(let n=0;n<t;n++)try{return await r(i,n)}catch(s){if(s&&typeof s=="object"&&"_bailed"in s)throw s._bailed;if(n===t-1)throw s;if(typeof e=="number")await _i(e);else if(typeof e=="function")await _i(e(n+1));else throw new TypeError("Invalid backoff option")}throw new Error("unreachable")}var Wl=!0,Ci="Invariant failed";function D(t,e){if(!t){if(Wl)throw new Error(Ci);var r=typeof e=="function"?e():e,i=r?"".concat(Ci,": ").concat(r):Ci;throw new Error(i)}}function Ei(t,e,r){return t.slice(0,r)+e}function Vl({content:t,parts:e,appendMessage:r}){let i=[...e],n=t,s=r.part??0;switch(r.content_type){case"text":{let{delta:o,position:a}=r;n=Ei(n,o,a);let l=i[s]&&"text"in i[s]?i[s].text:"";i[s]={text:l?Ei(l,o,a):o};break}case"html":{let{delta:o,position:a}=r,l=i[s]&&"html"in i[s]?i[s].html:"";i[s]={html:l?Ei(l,o,a):o};break}case"data":{let o=i[s]&&"data"in i[s]?i[s].data:{};i[s]={tag:r.tag,data:Object.assign({},o,r.data)};break}}return{content:n,parts:i}}var ur=class{messages=Object.freeze([]);onEvent(e){switch(e.type){case"NEW_MESSAGE":{let r={...e.message,streaming:!0,parts:e.message.parts};return this.messages=Object.freeze([...this.messages.filter(i=>i.id!==r.id),r]),r}case"APPEND_MESSAGE":{let i=this.messages.find(s=>s.id===e.message.id)??(()=>{let s={id:e.message.id,timestamp:Date.now(),role:"assistant",content:"",streaming:!0,parts:[]};return this.messages=Object.freeze([...this.messages,s]),s})(),n=Vl({content:i.content,parts:i.parts||[],appendMessage:e.message});return i.content=n.content,i.parts=n.parts,e.metadata&&(i.metadata=e.metadata),i}case"MESSAGE_DONE":{let r=this.messages.find(i=>i.id===e.message.id);return r?(Object.assign(r,e.message),r.streaming=!1,r):void 0}default:return}}onEvents(e){for(let r of e)this.onEvent(r)}getMessage(e){return this.messages.find(r=>r.id===e)}get lastMessage(){return this.messages.at(-1)}reset(){this.messages=Object.freeze([])}};var dr=class{#e;#t;#r=null;#n=new ur;isStreaming=!1;typingIndicator;toolCallIndicator;ranOutOfCredits=!1;get messages(){return this.#n.messages}set messages(e){this.#n.messages=e}conversationId="";#i=0;#s;isLiveMode=!1;get hasQueuedMessages(){return this.#o.length>0}constructor(e,r){this.#e=e,this.#t=r,this.#t.autoConnect!==!1&&(this.#r=this.initWS()),e.addController(this)}#o=[];#a(e,{expectStreaming:r=!1}={}){return this.ranOutOfCredits?!1:this.#r?this.#r.isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):this.#r.isConnected?(r&&!this.isLiveMode&&(this.isStreaming=!0,this.#e.requestUpdate()),this.#r.send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent",e),this.retry(),!1):(console.warn("WebSocket not initialized, message not sent",e),this.connect(),!1)}async enqueueMessage(e,{expectStreaming:r=!1}={}){if(this.#o.length>0){let i=this.#o[this.#o.length-1];if(e.type==="USER_INPUT"&&i.message.type==="USER_INPUT"&&e.value===i.message.value)return!0}return this.#r||this.connect(),this.#r?.isConnected?this.#a(e,{expectStreaming:r}):(this.#o.push({message:e,options:{expectStreaming:r}}),this.#e.requestUpdate(),this.#r&&!this.#r.isConnecting&&!this.#r.isConnected&&this.retry(),await cr({times:5,backoff:2e3},async()=>{if(this.#r?.isConnected){let i=[...this.#o];this.#o=[],this.#e.requestUpdate();let n=!1;for(let{message:s,options:o}of i){let a=this.#a(s,o);s===e&&(n=a)}return n}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),this.#o=[],this.#e.requestUpdate(),!1)))}async sendUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i},{expectStreaming:s})}async sendUserFeedback(e){return this.enqueueMessage({type:"USER_FEEDBACK",responses:e},{expectStreaming:!0})}sendFileDelete(e){D(e,"fileId is required"),this.enqueueMessage({type:"USER_FILE_DELETE",fileId:e}).catch(console.warn)}sendUserCancel(){this.enqueueMessage({type:"USER_CANCEL"}).catch(console.warn)}sendUserTypingStart(){this.#a({type:"USER_TYPING_START"})}sendUserTypingStop(){this.enqueueMessage({type:"USER_TYPING_STOP"}).catch(console.warn)}sendNewChat(){this.enqueueMessage({type:"NEW_CHAT"})}sendUserMeta(e){this.enqueueMessage({type:"USER_META",metadata:e}).catch(console.warn)}reloadConfig(){this.enqueueMessage({type:"RELOAD_CONFIG"}).catch(console.warn)}close(){this.#r?.close(1e3,"closed by user")}retry(){clearTimeout(this.#s),this.#s=setTimeout(()=>{this.#t.onReconnect?.(),this.#r=this.initWS()},1e3*this.#i),this.#i++}initWS(){return new lr(this.#e,{url:()=>this.#t.url(this.conversationId,{}),onOpen:e=>this.#l(e),onMessage:e=>this.#c(JSON.parse(e.data)),onError:e=>this.#d(e),onClose:e=>this.#u(e)})}#l(e){this.#i=0}#c(e){switch(e.type){case"NEW_MESSAGE":{this.#n.onEvent(e),this.typingIndicator=void 0,this.toolCallIndicator=void 0,this.#t.onNewMessage?.(e.message),this.#t.persistConversationState?.(this.conversationId,this.messages),this.#e.requestUpdate();break}case"APPEND_MESSAGE":{let r=!this.#n.getMessage(e.message.id),i=this.#n.onEvent(e);i&&(this.typingIndicator=void 0,this.toolCallIndicator=void 0,r&&(this.#t.onNewMessage?.({id:i.id,timestamp:i.timestamp,role:i.role,content:i.content}),this.#t.persistConversationState?.(this.conversationId,this.messages)),this.#t.onMessageAppend?.(e),this.#e.requestUpdate());break}case"MESSAGE_DONE":{let r=this.#n.onEvent(e);if(!r)throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,this.#e.requestUpdate(),this.#t.onMessageDone?.(e,r),this.#t.persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate();break}case"ERROR":{this.#t.onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.#n.messages=e.messages,this.#t.onConnect?.(e.conversationId,e.metadata),this.#t.persistConversationState?.(e.conversationId,e.messages),this.isLiveMode=e.metadata.isLiveMode,this.#e.requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.toolCallIndicator=void 0,this.typingIndicator={role:e.role,metadata:e.metadata},this.#e.requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,this.#e.requestUpdate();break}case"TOOL_CALL_START":{this.typingIndicator=void 0,this.toolCallIndicator=e.text,this.#e.requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,this.#e.requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),this.#e.requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}}#d(e){console.error("onError",e),this.#t.onError?.(e)}#u(e){this.#e.isConnected&&this.#r&&!this.#r.isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate(),this.#t.onClose?.()}hostConnected(){this.conversationId=this.#t.restoreConversationState?.()?.conversationId||"",this.#n.messages=this.#t.restoreConversationState?.()?.messages||[]}reset(){this.#t.onReset?.(),this.#n.reset(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.conversationId="",this.isLiveMode=!1,this.#o=[],this.#e.requestUpdate()}hostDisconnected(){clearTimeout(this.#s)}connect(){this.#r||(this.#r=this.initWS())}reconnectSocket(){this.#r?.close(1e3,"destroy"),this.#r=this.initWS()}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}get isConnected(){return this.#r?.isConnected??!1}};var $i;function Ps(t){return{lang:t?.lang??$i?.lang,message:t?.message,abortEarly:t?.abortEarly??$i?.abortEarly,abortPipeEarly:t?.abortPipeEarly??$i?.abortPipeEarly}}var Hl;function Gl(t){return Hl?.get(t)}var Xl;function Jl(t){return Xl?.get(t)}var Kl;function Yl(t,e){return Kl?.get(t)?.get(e)}function Us(t){let e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function H(t,e,r,i,n){let s=n&&"input"in n?n.input:r.value,o=n?.expected??t.expects??null,a=n?.received??Us(s),l={kind:t.kind,type:t.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:n?.path,issues:n?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},c=t.kind==="schema",d=n?.message??t.message??Yl(t.reference,l.lang)??(c?Jl(l.lang):null)??i.message??Gl(l.lang);d!==void 0&&(l.message=typeof d=="function"?d(l):d),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function G(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Ps())}}}function Ql(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Ls(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var Zl=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z|[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;function Si(t){return{kind:"validation",type:"iso_timestamp",reference:Si,async:!1,expects:null,requirement:Zl,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&H(this,"timestamp",e,r),e}}}function Ii(t,e){return{kind:"validation",type:"max_length",reference:Ii,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(r,i){return r.typed&&r.value.length>this.requirement&&H(this,"length",r,i,{received:`${r.value.length}`}),r}}}function Ai(t,e){return{kind:"validation",type:"min_length",reference:Ai,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,i){return r.typed&&r.value.length<this.requirement&&H(this,"length",r,i,{received:`${r.value.length}`}),r}}}function Ti(t){return{kind:"transformation",type:"to_date",reference:Ti,async:!1,message:t,"~run"(e,r){try{e.value=new Date(e.value),isNaN(e.value)&&(H(this,"date",e,r,{received:'"Invalid Date"'}),e.typed=!1)}catch{H(this,"date",e,r),e.typed=!1}return e}}}function Di(t){return{kind:"transformation",type:"transform",reference:Di,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function js(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function Q(t,e){return{...t,fallback:e,get"~standard"(){return G(this)},"~run"(r,i){let n=t["~run"](r,i);return n.issues?{typed:!0,value:js(this,n,i)}:n}}}function Mi(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function St(){return{kind:"schema",type:"any",reference:St,expects:"any",async:!1,get"~standard"(){return G(this)},"~run"(t){return t.typed=!0,t}}}function Ye(t,e){return{kind:"schema",type:"array",reference:Ye,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return G(this)},"~run"(r,i){let n=r.value;if(Array.isArray(n)){r.typed=!0,r.value=[];for(let s=0;s<n.length;s++){let o=n[s],a=this.item["~run"]({value:o},i);if(a.issues){let l={type:"array",origin:"value",input:n,key:s,value:o};for(let c of a.issues)c.path?c.path.unshift(l):c.path=[l],r.issues?.push(c);if(r.issues||(r.issues=a.issues),i.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value.push(a.value)}}else H(this,"type",r,i);return r}}}function Oi(t){return{kind:"schema",type:"boolean",reference:Oi,expects:"boolean",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:H(this,"type",e,r),e}}}function Pi(t){return{kind:"schema",type:"null",reference:Pi,expects:"null",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return e.value===null?e.typed=!0:H(this,"type",e,r),e}}}function pr(t,e){return{kind:"schema",type:"nullish",reference:pr,expects:`(${t.expects} | null | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return G(this)},"~run"(r,i){return(r.value===null||r.value===void 0)&&(this.default!==void 0&&(r.value=Mi(this,r,i)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function hr(t){return{kind:"schema",type:"number",reference:hr,expects:"number",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:H(this,"type",e,r),e}}}function B(t,e){return{kind:"schema",type:"object",reference:B,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return G(this)},"~run"(r,i){let n=r.value;if(n&&typeof n=="object"){r.typed=!0,r.value={};for(let s in this.entries){let o=this.entries[s];if(s in n||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){let a=s in n?n[s]:Mi(o),l=o["~run"]({value:a},i);if(l.issues){let c={type:"object",origin:"value",input:n,key:s,value:a};for(let d of l.issues)d.path?d.path.unshift(c):d.path=[c],r.issues?.push(d);if(r.issues||(r.issues=l.issues),i.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value[s]=l.value}else if(o.fallback!==void 0)r.value[s]=js(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(H(this,"key",r,i,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:n,key:s,value:n[s]}]}),i.abortEarly))break}}else H(this,"type",r,i);return r}}}function A(t,e){return{kind:"schema",type:"optional",reference:A,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return G(this)},"~run"(r,i){return r.value===void 0&&(this.default!==void 0&&(r.value=Mi(this,r,i)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function It(t,e){return{kind:"schema",type:"picklist",reference:It,expects:Ls(t.map(Us),"|"),async:!1,options:t,message:e,get"~standard"(){return G(this)},"~run"(r,i){return this.options.includes(r.value)?r.typed=!0:H(this,"type",r,i),r}}}function At(t,e,r){return{kind:"schema",type:"record",reference:At,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return G(this)},"~run"(i,n){let s=i.value;if(s&&typeof s=="object"){i.typed=!0,i.value={};for(let o in s)if(Ql(s,o)){let a=s[o],l=this.key["~run"]({value:o},n);if(l.issues){let d={type:"object",origin:"key",input:s,key:o,value:a};for(let p of l.issues)p.path=[d],i.issues?.push(p);if(i.issues||(i.issues=l.issues),n.abortEarly){i.typed=!1;break}}let c=this.value["~run"]({value:a},n);if(c.issues){let d={type:"object",origin:"value",input:s,key:o,value:a};for(let p of c.issues)p.path?p.path.unshift(d):p.path=[d],i.issues?.push(p);if(i.issues||(i.issues=c.issues),n.abortEarly){i.typed=!1;break}}(!l.typed||!c.typed)&&(i.typed=!1),l.typed&&(i.value[l.value]=c.value)}}else H(this,"type",i,n);return i}}}function C(t){return{kind:"schema",type:"string",reference:C,expects:"string",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:H(this,"type",e,r),e}}}function Os(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function fr(t,e){return{kind:"schema",type:"union",reference:fr,expects:Ls(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return G(this)},"~run"(r,i){let n,s,o;for(let a of this.options){let l=a["~run"]({value:r.value},i);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{n=l;break}else o?o.push(l):o=[l]}if(n)return n;if(s){if(s.length===1)return s[0];H(this,"type",r,i,{issues:Os(s)}),r.typed=!0}else{if(o?.length===1)return o[0];H(this,"type",r,i,{issues:Os(o)})}return r}}}function Rs(t,e){let r={};for(let i in t.entries)r[i]=!e||e.includes(i)?A(t.entries[i]):t.entries[i];return{...t,entries:r,get"~standard"(){return G(this)}}}function Qe(...t){return{...t[0],pipe:t,get"~standard"(){return G(this)},"~run"(e,r){for(let i of t)if(i.kind!=="metadata"){if(e.issues&&(i.kind==="schema"||i.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=i["~run"](e,r))}return e}}}function se(t,e,r){let i=t["~run"]({value:e},Ps(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var mr=Rs(B({url:C(),name:C(),description:C(),price:C()}));function Fs(t){return t.flatMap(e=>{if(!("tag"in e))return[];switch(e.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let r=se(mr,e.data);if(r.success)return[{name:r.output.name??"",price:r.output.price??"0"}];break}case"thought":case"order-status-card-v1":case"order-card-v2":case"live-chat-wait-card-v1":case"live-chat-wait-card-v2":case"request-input-v1":break}return[]})}var ec=Symbol();var qs=Object.getPrototypeOf,Ui=new WeakMap,tc=t=>t&&(Ui.has(t)?Ui.get(t):qs(t)===Object.prototype||qs(t)===Array.prototype);var Bs=t=>tc(t)&&t[ec]||null,Li=(t,e=!0)=>{Ui.set(t,e)};var Ri=t=>typeof t=="object"&&t!==null,rc=t=>Ri(t)&&!Fi.has(t)&&(Array.isArray(t)||!(Symbol.iterator in t))&&!(t instanceof WeakMap)&&!(t instanceof WeakSet)&&!(t instanceof Error)&&!(t instanceof Number)&&!(t instanceof Date)&&!(t instanceof String)&&!(t instanceof RegExp)&&!(t instanceof ArrayBuffer)&&!(t instanceof Promise),Ws=(t,e)=>{let r=Ns.get(t);if(r?.[0]===e)return r[1];let i=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return Li(i,!0),Ns.set(t,[e,i]),Reflect.ownKeys(t).forEach(n=>{if(Object.getOwnPropertyDescriptor(i,n))return;let s=Reflect.get(t,n),{enumerable:o}=Reflect.getOwnPropertyDescriptor(t,n),a={value:s,enumerable:o,configurable:!0};if(Fi.has(s))Li(s,!1);else if(Re.has(s)){let[l,c]=Re.get(s);a.value=Ws(l,c())}Object.defineProperty(i,n,a)}),Object.preventExtensions(i)},ic=(t,e,r,i)=>({deleteProperty(n,s){let o=Reflect.get(n,s);r(s);let a=Reflect.deleteProperty(n,s);return a&&i(gr?.("delete",s,o)),a},set(n,s,o,a){let l=!t()&&Reflect.has(n,s),c=Reflect.get(n,s,a);if(l&&(zs(c,o)||yr.has(o)&&zs(c,yr.get(o))))return!0;r(s),Ri(o)&&(o=Bs(o)||o);let d=!Re.has(o)&&sc(o)?qi(o):o;return e(s,d),Reflect.set(n,s,d,a),i(gr?.("set",s,o,c)),!0}});var Re=new WeakMap,Fi=new WeakSet,Ns=new WeakMap,ji=[1],yr=new WeakMap,zs=Object.is,nc=(t,e)=>new Proxy(t,e),sc=rc,oc=Ws,ac=ic,gr;function qi(t={}){if(!Ri(t))throw new Error("object required");let e=yr.get(t);if(e)return e;let r=ji[0],i=new Set,n=(x,E=++ji[0])=>{r!==E&&(s=r=E,i.forEach(b=>b(x,E)))},s=r,o=(x=ji[0])=>(s!==x&&(s=x,l.forEach(([E])=>{let b=E[1](x);b>r&&(r=b)})),r),a=x=>(E,b)=>{let k;E&&(k=[...E],k[1]=[x,...k[1]]),n(k,b)},l=new Map,c=(x,E)=>{let b=!Fi.has(E)&&Re.get(E);if(b){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(x))throw new Error("prop listener already exists");if(i.size){let k=b[2](a(x));l.set(x,[b,k])}else l.set(x,[b])}},d=x=>{var E;let b=l.get(x);b&&(l.delete(x),(E=b[1])==null||E.call(b))},p=x=>(i.add(x),i.size===1&&l.forEach(([b,k],S)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&k)throw new Error("remove already exists");let P=b[2](a(S));l.set(S,[b,P])}),()=>{i.delete(x),i.size===0&&l.forEach(([b,k],S)=>{k&&(k(),l.set(S,[b]))})}),h=!0,y=ac(()=>h,c,d,n),f=nc(t,y);yr.set(t,f);let $=[t,o,p];return Re.set(f,$),Reflect.ownKeys(t).forEach(x=>{let E=Object.getOwnPropertyDescriptor(t,x);"value"in E&&E.writable&&(f[x]=t[x])}),h=!1,f}function br(t,e,r){let i=Re.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!i&&console.warn("Please use proxy object");let n,s=[],o=i[2],a=!1,c=o(d=>{if(d&&s.push(d),r){e(s.splice(0));return}n||(n=Promise.resolve().then(()=>{n=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,c()}}function Ze(t){let e=Re.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,i]=e;return oc(r,i())}var et=class{#e;#t;#r;#n=()=>{};constructor(e,r){this.#e=e,this.#t=r,this.#r=Ze(r),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#n(),this.#n=br(this.#t,()=>{this.#r=Ze(this.#t),this.#e.requestUpdate()})}hostDisconnected(){this.#n()}};var _e=class{#e;#t;proxyObject;#r;#n=()=>{};constructor(e,r,i){this.#e=e,this.#t=i,this.proxyObject=qi(r),this.#r=Ze(this.proxyObject),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#n(),this.#t?.subscribe&&(this.#n=br(this.proxyObject,()=>{this.#r=Ze(this.proxyObject),this.#e.requestUpdate()}))}hostDisconnected(){this.#n()}};var vr=class{#e;#t;#r;#n=null;#i=null;constructor(e,{provider:r,tag:i,key:n}){this.#e=e,this.#t=i,this.#r=n,e.addController(this)}get value(){return this.#i?this.#i.value:null}hostConnected(){if(this.#i||(this.#n=lc(this.#e,this.#t),!this.#n))return;let e=this.#n[this.#r]instanceof _e?this.#n[this.#r]:null;e&&(this.#i=new et(this.#e,e.proxyObject))}hostDisconnected(){}};function lc(t,e){let r=t;for(;r;){let i=r.closest(e);if(i)return i;let n=r.getRootNode();if(n instanceof ShadowRoot)r=n.host;else break}return null}function Bi(t,e){if(e<=0)return"";if(t=t??"",t.length>e){let r=e-1;return r>0&&t.charCodeAt(r-1)>=55296&&t.charCodeAt(r-1)<=56319&&r--,t.slice(0,r)+"\u2026"}return t}var Vs=()=>{if(window.Shopify)try{return{customerId:cc()}}catch{return null}return null},cc=()=>{try{let t=[()=>window.ShopifyAnalytics?.meta?.page?.customerId,()=>window.meta?.page?.customerId,()=>window._st?.cid,()=>window.ShopifyAnalytics?.lib?.user()?.traits()?.uniqToken];for(let e of t)try{let r=e();if(/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i.test(r))continue;if(r)return r}catch{}}catch{return null}return null},Hs=async()=>{try{return(await(await fetch(window.Shopify.routes.root+"cart.js")).json()).items.map(i=>({id:i.id,name:i.title,quantity:i.quantity,price:i.price,variantId:i.variant_id,sku:i.sku,url:i.url,description:i.product_description,image:i.featured_image?.url}))}catch{return[]}};function Gs(t){if(t instanceof URLSearchParams)return new URLSearchParams(t);let e=new URLSearchParams;for(let[r,i]of Object.entries(t))i!=null&&e.set(r,String(i));return e}function Xs(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function tt(t){let e="[-a-z\\d%_.~!$&'()*+,;=:@]",r="[-a-z\\d%_.~!$&'()*+,;=:@/?]";return new RegExp(`^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/${e}*)*(\\?${r}*)?(\\#${r}*)?$`,"i").test(t)}function Js(t,e){let r=t instanceof URL?t:new URL(t);if(e)for(let[i,n]of e)r.searchParams.set(i,n);return r}var Ks=()=>{if(window.ShopRenter)try{let t=dc();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},dc=()=>{try{if(window.ShopRenter){let t=window.ShopRenter.customer;return{customerEmail:t?.email,customerId:t?.userId,customerName:[t?.name?.firstName,t?.name?.lastName].filter(Boolean).join(" ")}}return{customerEmail:null,customerId:null,customerName:null}}catch{return{customerEmail:null,customerId:null,customerName:null}}},Ys=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=Xs(t,"https")+"/cart.json";return(await(await fetch(e)).json()).items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku,image:s.image,url:s.href}))}catch{return[]}};var Qs=()=>{if(window.UNAS)try{let t=window.UNAS.customer;return{customerEmail:t?.email,customerId:t?.id}}catch(t){return console.error("Error fetching customer information:",t),null}return null},Zs=async()=>new Promise((t,e)=>{try{window.UNAS.getCart(r=>{let n=r.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));t(n)})}catch(r){console.error("Error fetching cart information:",r),e(r)}});var Tt=pi(Wi(),1);var xr=class{#e;constructor({document:e}){this.#e=e}getCookies(){return(0,Tt.parseCookie)(this.#e.cookie)||{}}getCookie(e){return this.getCookies()[e]||null}setCookie(e,r,i){if(D(typeof e=="string",`cookie name must be a string, got: ${typeof e}`),D(e,"cookie name must not be empty"),r==null){this.#e.cookie=(0,Tt.stringifySetCookie)(e,"",{expires:new Date(0)});return}D(typeof r=="string",`value of cookie \`${e}\` must be a string, got: ${typeof r}`),this.#e.cookie=(0,Tt.stringifySetCookie)(e,r,i)}deleteCookie(e){this.setCookie(e,null)}deleteCookies(e){let r=this.getCookies();for(let i in r)e(i)&&this.deleteCookie(i)}};var kr=class{#e;constructor({localStorage:e}){this.#e=e}getItem(e){try{let r=this.#e.getItem(e);return r?JSON.parse(r):null}catch{return null}}setItem(e,r){if(r==null){this.#e.removeItem(e);return}try{let i=JSON.stringify(r);this.#e.setItem(e,i)}catch(i){console.error(`Failed to store ${e} in localStorage:`,i)}}removeItem(e){this.#e.removeItem(e)}removeItems(e){let r=[];for(let i=0;i<this.#e.length;i++){let n=this.#e.key(i);n&&e(n)&&r.push(n)}for(let i of r)this.#e.removeItem(i)}};var Dt=pi(Wi(),1);function Vi({window:t}){let e=t.location.hostname,r=t.document;if(e==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(e)||/^\[.*\]$/.test(e))return;let i=e.split(".");if(i.length<2)return;let n="__molin_domain_test__";for(let s=2;s<=i.length;s++){let o=`.${i.slice(-s).join(".")}`;try{if(r.cookie=(0,Dt.stringifySetCookie)(n,"1",{domain:o,path:"/"}),(0,Dt.parseCookie)(r.cookie)[n]==="1")return r.cookie=(0,Dt.stringifySetCookie)(n,"",{domain:o,path:"/",expires:new Date(0)}),o}catch{continue}}return`.${i.slice(-2).join(".")}`}var Hi=class{#e;#t;#r;#n;constructor({window:e}){this.#e=e,this.#t=new xr({document:e.document}),this.#r=new kr({localStorage:e.localStorage}),this.#n=e.localStorage}get distinctID(){return this.#t.getCookie("molin_distinct_id")||this.#n.getItem("molin_distinct_id")}set distinctID(e){if(!e){this.#t.deleteCookie("molin_distinct_id"),this.#n.removeItem("molin_distinct_id");return}D(typeof e=="string","distinct_id must be a string");try{this.#t.setCookie("molin_distinct_id",e,{path:"/",sameSite:"lax",expires:new Date(Date.now()+1e3*60*60*24*365),domain:Vi({window:this.#e})})}catch(r){console.warn("Could not write distinct_id to cookie:",r)}try{this.#n.setItem("molin_distinct_id",e)}catch(r){console.warn("Could not write distinct_id to localStorage:",r)}}get widgetState(){return this.#r.getItem("molin_widget")}set widgetState(e){this.#r.setItem("molin_widget",e)}get popupState(){return this.#r.getItem("molin_popup")}set popupState(e){this.#r.setItem("molin_popup",e)}get disclaimerDismissed(){return this.#r.getItem("molin_disclaimer_dismissed")??!1}set disclaimerDismissed(e){this.#r.setItem("molin_disclaimer_dismissed",e)}getConversationId(e){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let r=`molin_${e}_conversation_id`;return this.#t.getCookie(r)||this.#n.getItem(r)}setConversationId(e,r){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let i=`molin_${e}_conversation_id`;if(!r){this.#t.deleteCookie(i),this.#n.removeItem(i);return}D(typeof r=="string",`conversation ID for widget ${e} must be a string`);try{this.#t.setCookie(i,r,{path:"/",sameSite:"lax",expires:new Date(Date.now()+1e3*60*60*24*365),domain:Vi({window:this.#e})})}catch(n){console.warn(`Could not write ${i} to cookie:`,n)}try{this.#n.setItem(i,r)}catch(n){console.warn(`Could not write ${i} to localStorage:`,n)}}getConversationState(e){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let r=`molin_${e}_conversation`;return this.#r.getItem(r)}setConversationState(e,r){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let i=`molin_${e}_conversation`;this.#r.setItem(i,r)}resetAll(){this.distinctID=null,this.widgetState=null,this.popupState=null,this.disclaimerDismissed=!1,this.#r.removeItems(e=>e.startsWith("_molin_")),this.#t.deleteCookies(e=>e.startsWith("_molin_"))}},no;function j(){return no??=new Hi({window}),no}var so=At(C(),fr([C(),hr(),Oi(),Pi()])),oo=Qe(C(),Ai(1),Ii(5e3)),ao=()=>{try{return window.UNAS?Qs():window.Shopify?Vs():window.ShopRenter?Ks():null}catch{return null}},lo=async()=>{try{return window.UNAS?await Zs():window.Shopify?await Hs():window.ShopRenter?await Ys():[]}catch{return[]}},rt={schema:B({conversationId:A(C()),messages:A(Ye(B({id:C(),timestamp:hr(),role:It(["user","assistant","support"]),content:C(),parts:A(Ye(fr([B({text:C()}),B({html:C()}),B({tag:C(),data:At(C(),St())})])))})))}),persist(t,e,r){j().setConversationState(t,{conversationId:e,messages:r}),j().setConversationId(t,e)},restore(t){try{let e=j().getConversationState(t),r=e?se(this.schema,e):void 0;return r?.success&&r.output.conversationId?{conversationId:r.output.conversationId,messages:r.output.messages||[]}:{conversationId:j().getConversationId(t)||"",messages:[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(t){j().setConversationState(t,null),j().setConversationId(t,null)}};var it=class t extends v{static properties={widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object}};contextCtrl;constructor(){super(),this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.contextCtrl=new _e(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,toolCallIndicator:void 0,ranOutOfCredits:!1,isLiveMode:!1,lastMsg:void 0,hasQueuedMessages:!1,isConnected:()=>this.#i.isConnected,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),sendNewChat:this.sendNewChat.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),sendUserFeedback:this.sendUserFeedback.bind(this),sendFileDelete:this.#i.sendFileDelete.bind(this.#i)})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.#i.connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:this.#t,xCustomInstructions:this.#r,conversationId:this.#i.conversationId,messages:this.#e,isStreaming:this.#i.isStreaming,typingIndicator:this.#i.typingIndicator,toolCallIndicator:this.#i.toolCallIndicator,ranOutOfCredits:this.#i.ranOutOfCredits,isLiveMode:this.#i.isLiveMode,lastMsg:this.#i.lastMsg,hasQueuedMessages:this.#i.hasQueuedMessages,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),sendUserFeedback:this.sendUserFeedback.bind(this),sendFileDelete:this.#i.sendFileDelete.bind(this.#i)}),this.#s()}get#e(){return this.#i?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:this.#i?.messages||[]}#t;#r;#n=null;get#i(){return this.#n||(this.#n=new dr(this,{url:e=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("conversationId",e),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:e=>{console.error("ws error",e)},onClose:()=>{},onNewMessage:e=>{e.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:e,conversationId:this.#i.conversationId})},onMessageAppend:e=>{},onMessageDone:(e,r)=>{if(r.role==="assistant"){let i=Fs(r.parts??[]);this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,conversationId:this.#i.conversationId,products:i})}},onMessageError:e=>{console.error("ws message error",e),e.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+e.message})},onReset:()=>{rt.reset(this.widgetId)},onConnect:(e,r)=>{let i=ao();this.#i.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),lo().then(n=>{n?.length>0&&this.#i.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,cart:n,language:window.navigator.language})}).catch(n=>{console.error(n)}),this.dispatchEvent(new t.ConnectedEvent({conversationId:e,metadata:r,widgetId:this.widgetId,pendingImages:r?.pendingImages||[]}))},persistConversationState:(e,r)=>{rt.persist(this.widgetId,e,r)},restoreConversationState:()=>rt.restore(this.widgetId)})),this.#n}#s(){function e(i){if(!i)return;let n;try{n=typeof i=="object"?i:JSON.parse(i)}catch(o){console.error("Molin: user-data is not valid JSON",o);return}if(!n||typeof n!="object"||Object.keys(n).length===0)return;let s=se(so,n);if(!s.success){console.error("Molin: user-data does not pass schema validation",s.issues);return}return s.output}function r(i){if(!i)return;let n=se(oo,i);if(!n.success){console.error("Molin: custom-instructions does not pass schema validation",n.issues);return}return n.output}this.#t=e(this.xUserData),this.#r=r(this.xCustomInstructions)}async sendUserInput(e,r={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...r},n=await this.#i.sendUserInput(e,i);return n&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!1,conversationId:this.#i.conversationId}),n}async enqueueUserInput(e,r={}){e.length>1e3&&(console.error("Message exceeds max length of 1000 characters, trimming"),e=Bi(e,1e3)),this.#e.some(o=>o.role==="assistant"&&o.parts?.some(a=>"tag"in a&&a.tag==="request-input-v1"&&"data"in a&&a.data.type==="new-conversation-button"))&&(this.sendNewChat(),this.reset());let s={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...r};return this.#i.enqueueUserInput(e,s)}async sendUserFeedback(e){return this.#i.sendUserFeedback(e)}sendUserCancel(){this.#i.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){this.#i.sendUserTypingStart()}sendUserTypingStop(){this.#i.sendUserTypingStop()}sendNewChat(){this.#i.sendNewChat()}reset(){this.#i.reset()}reloadConfig(){this.#i.reloadConfig()}render(){return u`<slot></slot>`}};function co(t){let e=new vr(t,{provider:it,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,i){if(i==="value")return e.value}})}it.ConnectedEvent=class extends CustomEvent{static type="mw-context-widget:connected";constructor(e,r={}){super(it.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-context-widget")||customElements.define("mw-context-widget",it);var kc=Object.freeze({"lucide:arrow-up":u`
|
|
4
4
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
5
5
|
<path d="m5 12 7-7 7 7" />
|
|
6
6
|
<path d="M12 19V5" />
|
|
@@ -125,7 +125,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
125
125
|
:host([fill]) svg {
|
|
126
126
|
fill: currentColor;
|
|
127
127
|
}
|
|
128
|
-
`;constructor(){super(),this.name,this.fill=!1}render(){if(!this.name)return null;let e=kc[this.name];return e||(console.warn(`mw-icon: '${this.name}' not found`),null)}};customElements.get("mw-icon")||customElements.define("mw-icon",Gi);function nn(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function _c(t,e=","){return t.map(nn).join(e)}var yo=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function _r(t){for(var e=9,r=t.length;r--;)e=Math.imul(e^t.charCodeAt(r),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function Er(t,e="@media "){return e+M(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(i=>`(${i}-width:${r[i]})`).join(" and "))).join(",")}function M(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function uo(t){return t}function Sr(){}var F={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function bo(t){return t.match(/[-=:;]/g)?.length||0}function Qi(t){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(t)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(bo(t),15)<<18}var Cc=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function sn({n:t,i:e,v:r=[]},i,n,s){t&&(t=nn({n:t,i:e,v:r})),s=[...M(s)];for(let a of r){let l=i.theme("screens",a);for(let c of M(l&&Er(l)||i.v(a))){var o;s.push(c),n|=l?67108864|Qi(c):a=="dark"?1073741824:c[0]=="@"?Qi(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~Cc.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:n,r:s,i:e}}var vo=new Map;function Zi(t){if(t.d){let e=[],r=Xi(t.r.reduce((i,n)=>n[0]=="@"?(e.push(n),i):n?Xi(i,s=>Xi(n,o=>{let a=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(a){let l=s.indexOf(a[1]);return~l?s.slice(0,l)+a[0]+s.slice(l+a[1].length):Ji(s,o)}return Ji(o,s)})):i,"&"),i=>Ji(i,t.n?"."+yo(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,n)=>n+"{"+i+"}",t.d)}}function Xi(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,i,n)=>e(i)+n)}function Ji(t,e){return t.replace(/&/g,e)}var po=new Intl.Collator("en",{numeric:!0});function wo(t,e){for(var r=0,i=t.length;r<i;){let n=i+r>>1;0>=xo(t[n],e)?r=n+1:i=n}return i}function xo(t,e){let r=t.p&F.o;return r==(e.p&F.o)&&(r==F.b||r==F.o)?0:t.p-e.p||t.o-e.o||po.compare(ho(t.n),ho(e.n))||po.compare(fo(t.n),fo(e.n))}function ho(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function fo(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Ki(t,e){return Math.round(parseInt(t,16)*e)}function te(t,e={}){if(typeof t=="function")return t(e);let{opacityValue:r="1",opacityVariable:i}=e,n=i?`var(${i})`:r;if(t.includes("<alpha-value>"))return t.replace("<alpha-value>",n);if(t[0]=="#"&&(t.length==4||t.length==7)){let s=(t.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Ki(t.substr(1,s),o),Ki(t.substr(1+s,s),o),Ki(t.substr(1+2*s,s),o),n]})`}return n=="1"?t:n=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function ko(t,e,r,i,n=[]){return(function s(o,{n:a,p:l,r:c=[],i:d},p){let h=[],y="",f=0,E=0;for(let b in o||{}){var x,$;let k=o[b];if(b[0]=="@"){if(!k)continue;if(b[1]=="a"){h.push(...an(a,l,$r(""+k),p,l,c,d,!0));continue}if(b[1]=="l"){for(let S of M(k))h.push(...s(S,{n:a,p:(x=F[b[7]],l&~F.o|x),r:b[7]=="d"?[]:c,i:d},p));continue}if(b[1]=="i"){h.push(...M(k).map(S=>({p:-1,o:0,r:[],d:b+" "+S})));continue}if(b[1]=="k"){h.push({p:F.d,o:0,r:[b],d:s(k,{p:F.d},p).map(Zi).join("")});continue}if(b[1]=="f"){h.push(...M(k).map(S=>({p:F.d,o:0,r:[b],d:s(S,{p:F.d},p).map(Zi).join("")})));continue}}if(typeof k!="object"||Array.isArray(k))b=="label"&&k?a=k+_r(JSON.stringify([l,d,o])):(k||k===0)&&(b=b.replace(/[A-Z]/g,S=>"-"+S.toLowerCase()),E+=1,f=Math.max(f,($=b)[0]=="-"?0:bo($)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test($)?+!!RegExp.$1||-!!RegExp.$2:0)+1),y+=(y?";":"")+M(k).map(S=>p.s(b,on(""+S,p.theme)+(d?" !important":""))).join(";"));else if(b[0]=="@"||b.includes("&")){let S=l;b[0]=="@"&&(b=b.replace(/\bscreen\(([^)]+)\)/g,(P,R)=>{let z=p.theme("screens",R);return z?(S|=67108864,Er(z,"")):P}),S|=Qi(b)),h.push(...s(k,{n:a,p:S,r:[...c,b],i:d},p))}else h.push(...s(k,{p:l,r:[...c,b]},p))}return h.unshift({n:a,p:l,o:Math.max(0,15-E)+1.5*Math.min(f||15,15),r:c,d:y}),h.sort(xo)})(t,sn(e,r,i,n),r)}function on(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,i,n,s,o="")=>{let a=e(n,o);return typeof a=="function"&&/color|fill|stroke/i.test(n)?te(a):""+M(a).filter(l=>Object(l)!==l)})}function _o(t,e){let r,i=[];for(let n of t)n.d&&n.n?r?.p==n.p&&""+r.r==""+n.r?(r.c=[r.c,n.c].filter(Boolean).join(" "),r.d=r.d+";"+n.d):i.push(r={...n,n:n.n&&e}):i.push({...n,n:n.n&&e});return i}function Cr(t,e,r=F.u,i,n){let s=[];for(let o of t)for(let a of(function(l,c,d,p,h){l={...l,i:l.i||h};let y=(function(f,E){let x=vo.get(f.n);return x?x(f,E):E.r(f.n,f.v[0]=="dark")})(l,c);return y?typeof y=="string"?({r:p,p:d}=sn(l,c,d,p),_o(Cr($r(y),c,d,p,l.i),l.n)):Array.isArray(y)?y.map(f=>{var E,x;return{o:0,...f,r:[...M(p),...M(f.r)],p:(E=d,x=f.p??d,E&~F.o|x)}}):ko(y,l,c,d,p):[{c:nn(l),p:0,o:0,r:[]}]})(o,e,r,i,n))s.splice(wo(s,a),0,a);return s}function an(t,e,r,i,n,s,o,a){return _o((a?r.flatMap(l=>Cr([l],i,n,s,o)):Cr(r,i,n,s,o)).map(l=>l.p&F.o&&(l.n||e==F.b)?{...l,p:l.p&~F.o|e,o:0}:l),t)}function $c(t,e,r,i){var n;return n=(s,o)=>{let{n:a,p:l,r:c,i:d}=sn(s,o,e);return r&&an(a,e,r,o,l,c,d,i)},vo.set(t,n),t}function Yi(t,e,r){if(t[t.length-1]!="("){let i=[],n=!1,s=!1,o="";for(let a of t)if(!(a=="("||/[~@]$/.test(a))){if(a[0]=="!"&&(a=a.slice(1),n=!n),a.endsWith(":")){i[a=="dark:"?"unshift":"push"](a.slice(0,-1));continue}a[0]=="-"&&(a=a.slice(1),s=!s),a.endsWith("-")&&(a=a.slice(0,-1)),a&&a!="&"&&(o+=(o&&"-")+a)}o&&(s&&(o="-"+o),e[0].push({n:o,v:i.filter(Ec),i:n}))}}function Ec(t,e,r){return r.indexOf(t)==e}var mo=new Map;function $r(t){let e=mo.get(t);if(!e){let r=[],i=[[]],n=0,s=0,o=null,a=0,l=(c,d=0)=>{n!=a&&(r.push(t.slice(n,a+d)),c&&Yi(r,i)),n=a+1};for(;a<t.length;a++){let c=t[a];if(s)t[a-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)t[a-1]!="\\"&&o.test(t.slice(a))&&(o=null,n=a+RegExp.lastMatch.length);else if(c=="/"&&t[a-1]!="\\"&&(t[a+1]=="*"||t[a+1]=="/"))o=t[a+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),r.push(c);else if(c==":")t[a+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let d=r.lastIndexOf("(");if(c==")"){let p=r[d-1];if(/[~@]$/.test(p)){let h=i.shift();r.length=d,Yi([...r,"#"],i);let{v:y}=i[0].pop();for(let f of h)f.v.splice(+(f.v[0]=="dark")-+(y[0]=="dark"),y.length);Yi([...r,$c(p.length>1?p.slice(0,-1)+_r(JSON.stringify([p,h])):p+"("+_c(h)+")",F.a,h,/@$/.test(p))],i)}d=r.lastIndexOf("(",d-1)}r.length=d+1}else/[~@]/.test(c)&&t[a+1]=="("&&i.unshift([])}l(!0),mo.set(t,e=i[0])}return e}function m(t,e,r){return[t,en(e,r)]}function en(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,i)=>({[t]:e?e(r,i):tn(r,1)}):r=>t||{[r[1]]:tn(r,2)}}function tn(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function g(t,e,r,i){return[t,ln(e,r,i)]}function ln(t,e,r){let i=typeof e=="string"?(n,s)=>({[e]:r?r(n,s):n._}):e||(({1:n,_:s},o,a)=>({[n||a]:s}));return(n,s)=>{let o=Co(t||n[1]),a=s.theme(o,n.$$)??ce(n.$$,o,s);if(a!=null)return n._=tn(n,0,a),i(n,s,o)}}function q(t,e={},r){return[t,Sc(e,r)]}function Sc(t={},e){return(r,i)=>{let{section:n=Co(r[0]).replace("-","")+"Color"}=t,[s,o]=Ic(r.$$);if(!s)return;let a=i.theme(n,s)||ce(s,n,i);if(!a||typeof a=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:c=n.replace("Color","Opacity"),property:d=n,selector:p}=t,h=i.theme(c,o||"DEFAULT")||o&&ce(o,c,i),y=e||(({_:E})=>{let x=Mt(d,E);return p?{[p]:x}:x});r._={value:te(a,{opacityVariable:l||void 0,opacityValue:h||void 0}),color:E=>te(a,E),opacityVariable:l||void 0,opacityValue:h||void 0};let f=y(r,i);if(!r.dark){let E=i.d(n,s,a);E&&E!==a&&(r._={value:te(E,{opacityVariable:l||void 0,opacityValue:h||"1"}),color:x=>te(E,x),opacityVariable:l||void 0,opacityValue:h||void 0},f={"&":f,[i.v("dark")]:y(r,i)})}return f}}function Ic(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Mt(t,e){let r={};return typeof e=="string"?r[t]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(r[e.opacityVariable]=e.opacityValue||"1"),r[t]=e.value),r}function ce(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=nt(on(t.slice(1,-1),r.theme)),!e)return t;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(t)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(t))||/image/i.test(e)&&!(/^image:/.test(t)||/^[a-z-]+\(/.test(t))||/weight/i.test(e)&&!(/^(number|any):/.test(t)||/^\d+$/.test(t))||/position/i.test(e)&&/^(length|size):/.test(t)))return t.replace(/^[a-z-]+:/,"")}}function Co(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function nt(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",i,n="")=>nt(r)+i+nt(n)):t.replace(/(^|[^\\])_+/g,(e,r)=>r+" ".repeat(e.length-r.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function cn({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:M(e.variants),rules:M(e.rules),ignorelist:M(e.ignorelist),hash:void 0,stringify:(i,n)=>i+":"+n,finalize:[]};for(let i of M([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&M(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:n,darkMode:s=r.darkMode,darkColor:o=r.darkColor,theme:a,variants:l,rules:c,ignorelist:d,hash:p=r.hash,stringify:h=r.stringify,finalize:y}=typeof i=="function"?i(r):i;r={preflight:r.preflight!==!1&&n!==!1&&[...r.preflight,...M(n)],darkMode:s,darkColor:o,theme:{...r.theme,...a,extend:{...r.theme.extend,...a?.extend}},variants:[...r.variants,...M(l)],rules:[...r.rules,...M(c)],ignorelist:[...r.ignorelist,...M(d)],hash:p,stringify:h,finalize:[...r.finalize,...M(y)]}}return r}function go(t,e,r,i,n,s){for(let o of e){let a=r.get(o);a||r.set(o,a=i(o));let l=a(t,n,s);if(l)return l}}function Ac(t){var e;return rn(t[0],typeof(e=t[1])=="function"?e:()=>e)}function Tc(t){var e,r;return Array.isArray(t)?rn(t[0],en(t[1],t[2])):rn(t,en(e,r))}function rn(t,e){return $o(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 $o(t,e){let r=M(t).map(Dc);return(i,n,s)=>{for(let o of r){let a=e(i,o,n,s);if(a)return a}}}function Dc(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function Eo(t,e){let r=cn(t),i=(function({theme:l,darkMode:c,darkColor:d=Sr,variants:p,rules:h,hash:y,stringify:f,ignorelist:E,finalize:x}){let $=new Map,b=new Map,k=new Map,S=new Map,P=$o(E,(T,W)=>W.test(T));p.push(["dark",Array.isArray(c)||c=="class"?`${M(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let R=typeof y=="function"?T=>y(T,_r):y?_r:uo;R!==uo&&x.push(T=>({...T,n:T.n&&R(T.n),d:T.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(W,K)=>"--"+R(K).replace("#",""))}));let z={theme:(function({extend:T={},...W}){let K={},di={get colors(){return Ae("colors")},theme:Ae,negative(){return{}},breakpoints(L){let V={};for(let Y in L)typeof L[Y]=="string"&&(V["screen-"+Y]=L[Y]);return V}};return Ae;function Ae(L,V,Y,bt){if(L){if({1:L,2:bt}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(L)||[,L],/[.[]/.test(L)){let fe=[];L.replace(/\[([^\]]+)\]|([^.[]+)/g,(De,wt,El=wt)=>fe.push(El)),L=fe.shift(),Y=V,V=fe.join("-")}let ae=K[L]||Object.assign(Object.assign(K[L]={},Qt(W,L)),Qt(T,L));if(V==null)return ae;V||(V="DEFAULT");let Te=ae[V]??V.split("-").reduce((fe,De)=>fe?.[De],ae)??Y;return bt?te(Te,{opacityValue:on(bt,Ae)}):Te}let vt={};for(let ae of[...Object.keys(W),...Object.keys(T)])vt[ae]=Ae(ae);return vt}function Qt(L,V){let Y=L[V];return typeof Y=="function"&&(Y=Y(di)),Y&&/color|fill|stroke/i.test(V)?(function bt(vt,ae=[]){let Te={};for(let fe in vt){let De=vt[fe],wt=[...ae,fe];Te[wt.join("-")]=De,fe=="DEFAULT"&&(wt=ae,Te[ae.join("-")]=De),typeof De=="object"&&Object.assign(Te,bt(De,wt))}return Te})(Y):Y}})(l),e:yo,h:R,s(T,W){return f(T,W,z)},d(T,W,K){return d(T,W,z,K)},v(T){return $.has(T)||$.set(T,go(T,p,b,Ac,z)||"&:"+T),$.get(T)},r(T,W){let K=JSON.stringify([T,W]);return k.has(K)||k.set(K,!P(T,z)&&go(T,h,S,Tc,z,W)),k.get(K)},f(T){return x.reduce((W,K)=>K(W,z),T)}};return z})(r),n=new Map,s=[],o=new Set;e.resume(l=>n.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),o.add(l)});function a(l){let c=i.f(l),d=Zi(c);if(d&&!o.has(d)){o.add(d);let p=wo(s,l);e.insert(d,p,l),s.splice(p,0,l)}return c.n}return Object.defineProperties(function(c){if(!n.size)for(let p of M(r.preflight))typeof p=="function"&&(p=p(i)),p&&(typeof p=="string"?an("",F.b,$r(p),i,F.b,[],!1,!0):ko(p,{},i,F.b)).forEach(a);c=""+c;let d=n.get(c);if(!d){let p=new Set;for(let h of Cr($r(c),i))p.add(h.c).add(a(h));d=[...p].filter(Boolean).join(" "),n.set(c,d).set(d,d)}return d},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:r,snapshot(){let l=e.snapshot(),c=new Set(o),d=new Map(n),p=[...s];return()=>{l(),o=c,n=d,s=p}},clear(){e.clear(),o=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Mc(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function So(t){let e=new MutationObserver(r);return{observe(n){e.observe(n,{attributeFilter:["class"],subtree:!0,childList:!0}),i(n),r([{target:n,type:""}])},disconnect(){e.disconnect()}};function r(n){for(let{type:s,target:o}of n)if(s[0]=="a")i(o);else for(let a of o.querySelectorAll("[class]"))i(a);e.takeRecords()}function i(n){let s,o=n.getAttribute?.("class");o&&Mc(o,s=t(o))&&n.setAttribute("class",s)}}function Oc(t){let e=document.querySelector(t||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function Ir(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:Oc(t)).sheet;return{target:e,snapshot(){let r=Array.from(e.cssRules,i=>i.cssText);return()=>{this.clear(),r.forEach(this.insert)}},clear(){for(let r=e.cssRules.length;r--;)e.deleteRule(r)},destroy(){e.ownerNode?.remove()},insert(r,i){try{e.insertRule(r,i)}catch{e.insertRule(":root{}",i)}},resume:Sr}}var Pc=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function Io(t){return Pc.get(t)}function Ao(t){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(t);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function To(t,e){var r=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(t);return r?r[1]?/^sti/i.test(e)?1:0:r[2]?/^pat/i.test(e)?1:0:r[3]?/^image-/i.test(e)?1:0:r[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var Uc=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Do(){return({stringify:t})=>({stringify(e,r,i){let n="",s=Io(e);s&&(n+=t(s,r,i)+";");let o=Ao(e),a=To(e,r);for(let l of Uc)o&l[1]&&(n+=t(l[0]+e,r,i)+";"),a&l[1]&&(n+=t(e,l[0]+r,i)+";");return n+t(e,r,i)}})}function Oo(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",ln("lineClamp",({_:t})=>Mo(t))],["line-clamp-(\\d+)",({1:t})=>Mo(t)]]}}function Mo(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var Pt={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...Z(4,"rem",4,.5,.5),...Z(12,"rem",4,5),14:"3.5rem",...Z(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:I("blur"),backdropBrightness:I("brightness"),backdropContrast:I("contrast"),backdropGrayscale:I("grayscale"),backdropHueRotate:I("hueRotate"),backdropInvert:I("invert"),backdropOpacity:I("opacity"),backdropSaturate:I("saturate"),backdropSepia:I("sepia"),backgroundColor:I("colors"),backgroundImage:{none:"none"},backgroundOpacity:I("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...Z(200,"",100,0,50),...Z(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:I("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:I("spacing"),borderWidth:{DEFAULT:"1px",...re(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:I("colors"),caretColor:I("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...Z(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:I("borderColor"),divideOpacity:I("borderOpacity"),divideWidth:I("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:t})=>({...t("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:t})=>({...t("spacing"),...Ot(2,6),...Ot(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:I("spacing"),gradientColorStops:I("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:t})=>({...t("spacing"),...Ot(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...Ot(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...Z(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:t})=>({auto:"auto",...t("spacing")}),maxHeight:({theme:t})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...t("spacing")}),maxWidth:({theme:t,breakpoints:e})=>({...e(t("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...Z(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:I("spacing"),placeholderColor:I("colors"),placeholderOpacity:I("opacity"),outlineColor:I("colors"),outlineOffset:re(8,"px"),outlineWidth:re(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:I("colors"),ringOffsetWidth:re(8,"px"),ringOpacity:({theme:t})=>({...t("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...re(8,"px")},rotate:{...re(2,"deg"),...re(12,"deg",3),...re(180,"deg",45)},saturate:Z(200,"",100,0,50),scale:{...Z(150,"",100,0,50),...Z(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:I("spacing"),scrollPadding:I("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...re(2,"deg"),...re(12,"deg",3)},space:I("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:Z(2),textColor:I("colors"),textDecorationColor:I("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...re(8,"px")},textUnderlineOffset:{auto:"auto",...re(8,"px")},textIndent:I("spacing"),textOpacity:I("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:I("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:t})=>({...t("spacing"),...Ot(2,4),full:"100%"}),width:({theme:t})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...t("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...Z(50,"",1,0,10),auto:"auto"}};function Ot(t,e){let r={};do for(var i=1;i<t;i++)r[`${i}/${t}`]=Number((i/t*100).toFixed(6))+"%";while(++t<=e);return r}function re(t,e,r=0){let i={};for(;r<=t;r=2*r||1)i[r]=r+e;return i}function Z(t,e="",r=1,i=0,n=1,s={}){for(;i<=t;i+=n)s[i]=i/r+e;return s}function I(t){return({theme:e})=>e(t)}var Po={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${Pt.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${Pt.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var qo=[m("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:ce(`[${e}]`,"",r)}}})),m("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),g("aspect-","aspectRatio"),m("container",(t,{theme:e})=>{let{screens:r=e("screens"),center:i,padding:n}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...o("xs")};for(let a in r){let l=r[a];typeof l=="string"&&(s[Er(l)]={"&":{maxWidth:l,...o(a)}})}return s;function o(a){let l=n&&(typeof n=="string"?n:n[a]||n.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),g("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),m("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),m("box-(border|content)","boxSizing",({1:t})=>t+"-box"),m("hidden",{display:"none"}),m("table-(auto|fixed)","tableLayout"),m(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",m("isolate","isolation"),m("object-(contain|cover|fill|none|scale-down)","objectFit"),g("object-","objectPosition"),m("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Ar),m("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),m("(static|fixed|absolute|relative|sticky)","position"),g("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),g("-?(top|bottom|left|right)(?:$|-)","inset"),m("(visible|collapse)","visibility"),m("invisible",{visibility:"hidden"}),g("-?z-","zIndex"),m("flex-((row|col)(-reverse)?)","flexDirection",Uo),m("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),g("(flex-(?:grow|shrink))(?:$|-)"),g("(flex)-"),g("grow(?:$|-)","flexGrow"),g("shrink(?:$|-)","flexShrink"),g("basis-","flexBasis"),g("-?(order)-"),"-?(order)-(\\d+)",g("grid-cols-","gridTemplateColumns"),m("grid-cols-(\\d+)","gridTemplateColumns",Fo),g("col-","gridColumn"),m("col-(span)-(\\d+)","gridColumn",Ro),g("col-start-","gridColumnStart"),m("col-start-(auto|\\d+)","gridColumnStart"),g("col-end-","gridColumnEnd"),m("col-end-(auto|\\d+)","gridColumnEnd"),g("grid-rows-","gridTemplateRows"),m("grid-rows-(\\d+)","gridTemplateRows",Fo),g("row-","gridRow"),m("row-(span)-(\\d+)","gridRow",Ro),g("row-start-","gridRowStart"),m("row-start-(auto|\\d+)","gridRowStart"),g("row-end-","gridRowEnd"),m("row-end-(auto|\\d+)","gridRowEnd"),m("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>Ar(Uo(t))),m("grid-flow-(dense)","gridAutoFlow"),g("auto-cols-","gridAutoColumns"),g("auto-rows-","gridAutoRows"),g("gap-x(?:$|-)","gap","columnGap"),g("gap-y(?:$|-)","gap","rowGap"),g("gap(?:$|-)","gap"),"(justify-(?:items|self))-",m("justify-","justifyContent",Lo),m("(content|items|self)-",t=>({["align-"+t[1]]:Lo(t)})),m("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),g("p([xytrbl])?(?:$|-)","padding",st("padding")),g("-?m([xytrbl])?(?:$|-)","margin",st("margin")),g("-?space-(x|y)(?:$|-)","space",({1:t,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[t]]:`calc(${e} * calc(1 - var(--tw-space-${t}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[t]]:`calc(${e} * var(--tw-space-${t}-reverse))`}})),m("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),g("w-","width"),g("min-w-","minWidth"),g("max-w-","maxWidth"),g("h-","height"),g("min-h-","minHeight"),g("max-h-","maxHeight"),g("font-","fontWeight"),g("font-","fontFamily",({_:t})=>typeof(t=M(t))[1]=="string"?{fontFamily:oe(t)}:{fontFamily:oe(t[0]),...t[1]}),m("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),m("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),m("italic","fontStyle"),m("not-italic",{fontStyle:"normal"}),m("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:t,2:e="",3:r})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(r?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":t)]:t,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...Ce({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),g("tracking-","letterSpacing"),g("leading-","lineHeight"),m("list-(inside|outside)","listStylePosition"),g("list-","listStyleType"),m("list-","listStyleType"),g("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),q("placeholder-",{property:"color",selector:"&::placeholder"}),m("text-(left|center|right|justify|start|end)","textAlign"),m("text-(ellipsis|clip)","textOverflow"),g("text-opacity-","textOpacity","--tw-text-opacity"),q("text-",{property:"color"}),g("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),g("indent-","textIndent"),m("(overline|underline|line-through)","textDecorationLine"),m("no-underline",{textDecorationLine:"none"}),g("underline-offset-","textUnderlineOffset"),q("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),g("decoration-","textDecorationThickness"),m("decoration-","textDecorationStyle"),m("(uppercase|lowercase|capitalize)","textTransform"),m("normal-case",{textTransform:"none"}),m("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),m("align-","verticalAlign"),m("whitespace-","whiteSpace"),m("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),m("break-words",{overflowWrap:"break-word"}),m("break-all",{wordBreak:"break-all"}),m("break-keep",{wordBreak:"keep-all"}),q("caret-",{opacityVariable:!1,opacitySection:"opacity"}),q("accent-",{opacityVariable:!1,opacitySection:"opacity"}),m("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${Re(t," ")},var(--tw-gradient-stops))`),q("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-from":t.value,"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),q("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${t.value},var(--tw-gradient-to)`})),q("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),m("bg-(fixed|local|scroll)","backgroundAttachment"),m("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),m(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),m("bg-blend-","backgroundBlendMode"),m("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),g("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),q("bg-",{section:"backgroundColor"}),g("bg-","backgroundImage"),g("bg-","backgroundPosition"),m("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Ar),g("bg-","backgroundSize"),g("rounded(?:$|-)","borderRadius"),g("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:t,_:e})=>{let r={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[t]||[t,t];return{[`border-${Re(r[0])}-radius`]:e,[`border-${Re(r[1])}-radius`]:e}}),m("border-(collapse|separate)","borderCollapse"),g("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),m("border-(solid|dashed|dotted|double|none)","borderStyle"),g("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...Ce({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(t||"-x")]:e,["--tw-border-spacing"+(t||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),q("border-([xytrbl])-",{section:"borderColor"},st("border","Color")),q("border-"),g("border-([xytrbl])(?:$|-)","borderWidth",st("border","Width")),g("border(?:$|-)","borderWidth"),g("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),m("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),m("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),g("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${Re(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${Re(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),q("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),g("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),q("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),g("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),m("ring-inset",{"--tw-ring-inset":"inset"}),q("ring-",{property:"--tw-ring-color"}),g("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...Ce({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":te(e("ringOffsetColor","","#fff")),"--tw-ring-color":te(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${t} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),q("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),g("shadow(?:$|-)","boxShadow",({_:t})=>({...Ce({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":oe(t),"--tw-shadow-colored":oe(t).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),g("(opacity)-"),m("mix-blend-","mixBlendMode"),...jo(),...jo("backdrop-"),g("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:oe(t),transitionTimingFunction:t._=="none"?void 0:oe(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:oe(e("transitionDuration",""))})),g("duration(?:$|-)","transitionDuration","transitionDuration",oe),g("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",oe),g("delay(?:$|-)","transitionDelay","transitionDelay",oe),g("animate(?:$|-)","animation",(t,{theme:e,h:r,e:i})=>{let n=oe(t),s=n.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=i(r(s[0])))]:o,animation:s.join(" ")}:{animation:n}}),"(transform)-(none)",m("transform",dn),m("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":Bo(t=="gpu")})),g("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...dn()})),g("-?(rotate)-","rotate",un),g("-?(translate-[xy])-","translate",un),g("-?(skew-[xy])-","skew",un),m("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Ar),"(appearance)-",g("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",g("(cursor)-"),"(cursor)-",m("snap-(none)","scroll-snap-type"),m("snap-(x|y|both)",({1:t})=>({...Ce({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),m("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),m("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),m("snap-(normal|always)","scroll-snap-stop"),m("scroll-(auto|smooth)","scroll-behavior"),g("scroll-p([xytrbl])?(?:$|-)","padding",st("scroll-padding")),g("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",st("scroll-margin")),m("touch-(auto|none|manipulation)","touch-action"),m("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...Ce({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":r?"pan-y":t}`]:t,"touch-action":"var(--tw-touch-action)"})),m("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),m("outline",{outlineStyle:"solid"}),m("outline-(dashed|dotted|double)","outlineStyle"),g("-?(outline-offset)-"),q("outline-",{opacityVariable:!1,opacitySection:"opacity"}),g("outline-","outlineWidth"),"(pointer-events)-",g("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],m("select-(none|text|all|auto)","userSelect"),q("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),q("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),g("stroke-","strokeWidth"),m("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),m("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Ar(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function Uo(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function Re(t,e="-"){let r=[];for(let i of t)r.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return r.join(e)}function oe(t){return t&&""+(t._||t)}function Lo({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function st(t,e=""){return({1:r,_:i})=>{let n={x:"lr",y:"tb"}[r]||r+r;return n?{...Mt(t+"-"+Re(n[0])+e,i),...Mt(t+"-"+Re(n[1])+e,i)}:Mt(t+e,i)}}function jo(t=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",t&&"opacity","saturate","sepia",!t&&"drop-shadow"].filter(Boolean),r={};for(let i of e)r[`--tw-${t}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...Ce(r),[`${t}filter`]:e.map(i=>`var(--tw-${t}${i})`).join(" ")},[`(${t}filter)-(none)`,m(`${t}filter`,r),...e.map(i=>g(`${i[0]=="h"?"-?":""}(${t}${i})(?:$|-)`,i,({1:n,_:s})=>({[`--tw-${n}`]:M(s).map(o=>`${i}(${o})`).join(" "),...r})))]}function un({1:t,_:e}){return{["--tw-"+t]:e,...dn()}}function dn(){return{...Ce({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":Bo()}),transform:"var(--tw-transform)"}}function Bo(t){return[t?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function Ro({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function Fo({1:t}){return`repeat(${t},minmax(0,1fr))`}function Ce(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var No=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:t})=>`@media (orientation:${t})`],["contrast-(more|less)",({1:t})=>`@media (prefers-contrast:${t})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:t})=>`&::${t}`],["(marker|selection)",({1:t})=>`& *::${t},&::${t}`],["file","&::file-selector-button"],["(first|last|only)",({1:t})=>`&:${t}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:t,$$:e},r)=>e&&`&[${t}-${r.theme(t,e)||ce(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:i="",6:n=e},{e:s,h:o,v:a})=>{let l=nt(i)||(r[0]=="["?r:a(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(t+n))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||ce(t,"",e)),t)return t.includes(":")||(t+=":var(--tw)"),/^\w*\s*\(/.test(t)||(t=`(${t})`),`@supports ${t.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:t},e)=>{if(t&&(t=e.theme("screens",t)||ce(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=ce(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&nt(t).replace(/[}]+$/,"").split("{")]];function zo({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:Po,theme:{...Pt,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:No,rules:qo,finalize(r){return r.n&&r.d&&r.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(r.d)?{...r,d:"content:var(--tw-content);"+r.d}:r}}}var Lc={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},jc={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Rc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Fc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},qc={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Bc={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Nc={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},zc={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Wc={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Vc={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Hc={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Gc={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Xc={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Jc={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Kc={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Yc={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Qc={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Zc={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},eu={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},tu={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},ru={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},iu={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Wo={__proto__:null,slate:Lc,gray:jc,zinc:Rc,neutral:Fc,stone:qc,red:Bc,orange:Nc,amber:zc,yellow:Wc,lime:Vc,green:Hc,emerald:Gc,teal:Xc,cyan:Jc,sky:Kc,blue:Yc,indigo:Qc,violet:Zc,purple:eu,fuchsia:tu,pink:ru,rose:iu};function Vo({disablePreflight:t}={}){return zo({colors:Wo,disablePreflight:t})}function Xo({className:t="prose",defaultColor:e="gray",extend:r={},colors:i={}}={}){return i={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...i,dark:i.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...i.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${t}-${s}`,(a,l)=>Jo(t,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${t})`,({1:s},{h:o})=>[{c:o(s)}]],[`${t}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[t+"-",({$$:s},o)=>{let a=Go(o.theme("fontSize",s));return a&&{"@layer components":a}}],[t+"-",({$$:s},o)=>n(s,o)],[t,(s,o)=>({...n(e,o),"@layer base":[Ho(t,o,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:_(20,16),marginBottom:_(20,16),paddingLeft:_(26,16)},li:{marginTop:_(8,16),marginBottom:_(8,16)},"ol>li,ul>li":{paddingLeft:_(6,16)},">ul>li p":{marginTop:_(12,16),marginBottom:_(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:_(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:_(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:_(12,16),marginBottom:_(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:_(48,16),marginBottom:_(48,16)},blockquote:{marginTop:_(32,20),marginBottom:_(32,20),paddingLeft:_(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:_(20,16),marginBottom:_(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:_(36,16),marginTop:"0",marginBottom:_(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:_(24,16),marginTop:_(48,24),marginBottom:_(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:_(20,16),marginTop:_(32,20),marginBottom:_(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:_(24,16),marginBottom:_(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:_(32,16),marginBottom:_(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:_(14,16),lineHeight:"1.4",marginTop:_(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:_(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:_(21,24)},"h3 code":{fontSize:_(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:_(14,16),lineHeight:"1.7",marginTop:_(24,14),marginBottom:_(24,14),borderRadius:"0.375rem",paddingTop:_(12,14),paddingRight:_(16,14),paddingBottom:_(12,14),paddingLeft:_(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:_(32,16),marginBottom:_(32,16),fontSize:_(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:_(8,14),paddingBottom:_(8,14),paddingLeft:_(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:_(8,14),paddingRight:_(8,14),paddingBottom:_(8,14),paddingLeft:_(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${o.e(o.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:_(20,16),lineHeight:"1.6",marginTop:_(24,20),marginBottom:_(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Ho(t,o,r)],"@layer components":{...Go(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,o){let a={},l={},c=(d,p,h)=>{let y=o.theme(`colors.${s}.${p}`,p);h["--tw-prose-"+d]=te(y);let f=h!=l&&o.d("colors",`${s}-${p}`,y);f&&(l["--tw-prose-"+d]=te(f))};for(let d in i){let p=i[d];d!="dark"&&p&&c(d,p,a)}for(let d in i.dark||{}){let p=i.dark[d];p&&(i.dark?c("invert-"+d,p,a):c(d,p,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function Ho(t,e,r){let i={};for(let n in r)i[Jo(t,n,e,s=>`.${e.e(e.h(t))}${s}`)]=r[n];return i}function Jo(t,e,{e:r,h:i},n){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",a=s,l="")=>n(`${o}:where(${a}):not(:where(.${r(i("not-"+t))} *))${l}`))}function Go(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function _(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var pn=cn({hash:!1,darkMode:"class",theme:{extend:{colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}},spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]}}},presets:[Vo(),Do(),Oo(),Xo()]});function Ko(t,e=!0){let r=(function(){if(nu)try{let l=Ir(new CSSStyleSheet);return l.connect=c=>{let d=hn(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,l.target]},l.disconnect=Sr,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Ir(s)],a=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(c=>c.snapshot());return()=>l.forEach(c=>c())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,c,d){o[0].insert(l,c,d);let p=this.target.cssRules[c];o.forEach((h,y)=>y&&h.target.insertRule(p.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");hn(l).appendChild(c);let d=Ir(c),{cssRules:p}=this.target;for(let h=0;h<p.length;h++)d.target.insertRule(p[h].cssText,h);o.push(d),a.set(l,d)},disconnect(l){let c=o.indexOf(a.get(l));c>=0&&o.splice(c,1)}}})(),i=Eo({...t,hash:t.hash??e},r),n=So(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),n.observe(hn(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var nu=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function hn(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var w=t=>Ko(pn)(t);var fn=class extends w(v){static properties={color:{type:String},radius:{type:String},size:{type:String},border:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
|
|
128
|
+
`;constructor(){super(),this.name,this.fill=!1}render(){if(!this.name)return null;let e=kc[this.name];return e||(console.warn(`mw-icon: '${this.name}' not found`),null)}};customElements.get("mw-icon")||customElements.define("mw-icon",Gi);function nn(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function _c(t,e=","){return t.map(nn).join(e)}var yo=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function _r(t){for(var e=9,r=t.length;r--;)e=Math.imul(e^t.charCodeAt(r),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function $r(t,e="@media "){return e+M(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(i=>`(${i}-width:${r[i]})`).join(" and "))).join(",")}function M(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function uo(t){return t}function Sr(){}var F={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function bo(t){return t.match(/[-=:;]/g)?.length||0}function Qi(t){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(t)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(bo(t),15)<<18}var Cc=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function sn({n:t,i:e,v:r=[]},i,n,s){t&&(t=nn({n:t,i:e,v:r})),s=[...M(s)];for(let a of r){let l=i.theme("screens",a);for(let c of M(l&&$r(l)||i.v(a))){var o;s.push(c),n|=l?67108864|Qi(c):a=="dark"?1073741824:c[0]=="@"?Qi(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~Cc.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:n,r:s,i:e}}var vo=new Map;function Zi(t){if(t.d){let e=[],r=Xi(t.r.reduce((i,n)=>n[0]=="@"?(e.push(n),i):n?Xi(i,s=>Xi(n,o=>{let a=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(a){let l=s.indexOf(a[1]);return~l?s.slice(0,l)+a[0]+s.slice(l+a[1].length):Ji(s,o)}return Ji(o,s)})):i,"&"),i=>Ji(i,t.n?"."+yo(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,n)=>n+"{"+i+"}",t.d)}}function Xi(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,i,n)=>e(i)+n)}function Ji(t,e){return t.replace(/&/g,e)}var po=new Intl.Collator("en",{numeric:!0});function wo(t,e){for(var r=0,i=t.length;r<i;){let n=i+r>>1;0>=xo(t[n],e)?r=n+1:i=n}return i}function xo(t,e){let r=t.p&F.o;return r==(e.p&F.o)&&(r==F.b||r==F.o)?0:t.p-e.p||t.o-e.o||po.compare(ho(t.n),ho(e.n))||po.compare(fo(t.n),fo(e.n))}function ho(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function fo(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Ki(t,e){return Math.round(parseInt(t,16)*e)}function te(t,e={}){if(typeof t=="function")return t(e);let{opacityValue:r="1",opacityVariable:i}=e,n=i?`var(${i})`:r;if(t.includes("<alpha-value>"))return t.replace("<alpha-value>",n);if(t[0]=="#"&&(t.length==4||t.length==7)){let s=(t.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Ki(t.substr(1,s),o),Ki(t.substr(1+s,s),o),Ki(t.substr(1+2*s,s),o),n]})`}return n=="1"?t:n=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function ko(t,e,r,i,n=[]){return(function s(o,{n:a,p:l,r:c=[],i:d},p){let h=[],y="",f=0,$=0;for(let b in o||{}){var x,E;let k=o[b];if(b[0]=="@"){if(!k)continue;if(b[1]=="a"){h.push(...an(a,l,Er(""+k),p,l,c,d,!0));continue}if(b[1]=="l"){for(let S of M(k))h.push(...s(S,{n:a,p:(x=F[b[7]],l&~F.o|x),r:b[7]=="d"?[]:c,i:d},p));continue}if(b[1]=="i"){h.push(...M(k).map(S=>({p:-1,o:0,r:[],d:b+" "+S})));continue}if(b[1]=="k"){h.push({p:F.d,o:0,r:[b],d:s(k,{p:F.d},p).map(Zi).join("")});continue}if(b[1]=="f"){h.push(...M(k).map(S=>({p:F.d,o:0,r:[b],d:s(S,{p:F.d},p).map(Zi).join("")})));continue}}if(typeof k!="object"||Array.isArray(k))b=="label"&&k?a=k+_r(JSON.stringify([l,d,o])):(k||k===0)&&(b=b.replace(/[A-Z]/g,S=>"-"+S.toLowerCase()),$+=1,f=Math.max(f,(E=b)[0]=="-"?0:bo(E)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(E)?+!!RegExp.$1||-!!RegExp.$2:0)+1),y+=(y?";":"")+M(k).map(S=>p.s(b,on(""+S,p.theme)+(d?" !important":""))).join(";"));else if(b[0]=="@"||b.includes("&")){let S=l;b[0]=="@"&&(b=b.replace(/\bscreen\(([^)]+)\)/g,(P,R)=>{let z=p.theme("screens",R);return z?(S|=67108864,$r(z,"")):P}),S|=Qi(b)),h.push(...s(k,{n:a,p:S,r:[...c,b],i:d},p))}else h.push(...s(k,{p:l,r:[...c,b]},p))}return h.unshift({n:a,p:l,o:Math.max(0,15-$)+1.5*Math.min(f||15,15),r:c,d:y}),h.sort(xo)})(t,sn(e,r,i,n),r)}function on(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,i,n,s,o="")=>{let a=e(n,o);return typeof a=="function"&&/color|fill|stroke/i.test(n)?te(a):""+M(a).filter(l=>Object(l)!==l)})}function _o(t,e){let r,i=[];for(let n of t)n.d&&n.n?r?.p==n.p&&""+r.r==""+n.r?(r.c=[r.c,n.c].filter(Boolean).join(" "),r.d=r.d+";"+n.d):i.push(r={...n,n:n.n&&e}):i.push({...n,n:n.n&&e});return i}function Cr(t,e,r=F.u,i,n){let s=[];for(let o of t)for(let a of(function(l,c,d,p,h){l={...l,i:l.i||h};let y=(function(f,$){let x=vo.get(f.n);return x?x(f,$):$.r(f.n,f.v[0]=="dark")})(l,c);return y?typeof y=="string"?({r:p,p:d}=sn(l,c,d,p),_o(Cr(Er(y),c,d,p,l.i),l.n)):Array.isArray(y)?y.map(f=>{var $,x;return{o:0,...f,r:[...M(p),...M(f.r)],p:($=d,x=f.p??d,$&~F.o|x)}}):ko(y,l,c,d,p):[{c:nn(l),p:0,o:0,r:[]}]})(o,e,r,i,n))s.splice(wo(s,a),0,a);return s}function an(t,e,r,i,n,s,o,a){return _o((a?r.flatMap(l=>Cr([l],i,n,s,o)):Cr(r,i,n,s,o)).map(l=>l.p&F.o&&(l.n||e==F.b)?{...l,p:l.p&~F.o|e,o:0}:l),t)}function Ec(t,e,r,i){var n;return n=(s,o)=>{let{n:a,p:l,r:c,i:d}=sn(s,o,e);return r&&an(a,e,r,o,l,c,d,i)},vo.set(t,n),t}function Yi(t,e,r){if(t[t.length-1]!="("){let i=[],n=!1,s=!1,o="";for(let a of t)if(!(a=="("||/[~@]$/.test(a))){if(a[0]=="!"&&(a=a.slice(1),n=!n),a.endsWith(":")){i[a=="dark:"?"unshift":"push"](a.slice(0,-1));continue}a[0]=="-"&&(a=a.slice(1),s=!s),a.endsWith("-")&&(a=a.slice(0,-1)),a&&a!="&"&&(o+=(o&&"-")+a)}o&&(s&&(o="-"+o),e[0].push({n:o,v:i.filter($c),i:n}))}}function $c(t,e,r){return r.indexOf(t)==e}var mo=new Map;function Er(t){let e=mo.get(t);if(!e){let r=[],i=[[]],n=0,s=0,o=null,a=0,l=(c,d=0)=>{n!=a&&(r.push(t.slice(n,a+d)),c&&Yi(r,i)),n=a+1};for(;a<t.length;a++){let c=t[a];if(s)t[a-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)t[a-1]!="\\"&&o.test(t.slice(a))&&(o=null,n=a+RegExp.lastMatch.length);else if(c=="/"&&t[a-1]!="\\"&&(t[a+1]=="*"||t[a+1]=="/"))o=t[a+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),r.push(c);else if(c==":")t[a+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let d=r.lastIndexOf("(");if(c==")"){let p=r[d-1];if(/[~@]$/.test(p)){let h=i.shift();r.length=d,Yi([...r,"#"],i);let{v:y}=i[0].pop();for(let f of h)f.v.splice(+(f.v[0]=="dark")-+(y[0]=="dark"),y.length);Yi([...r,Ec(p.length>1?p.slice(0,-1)+_r(JSON.stringify([p,h])):p+"("+_c(h)+")",F.a,h,/@$/.test(p))],i)}d=r.lastIndexOf("(",d-1)}r.length=d+1}else/[~@]/.test(c)&&t[a+1]=="("&&i.unshift([])}l(!0),mo.set(t,e=i[0])}return e}function m(t,e,r){return[t,en(e,r)]}function en(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,i)=>({[t]:e?e(r,i):tn(r,1)}):r=>t||{[r[1]]:tn(r,2)}}function tn(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function g(t,e,r,i){return[t,ln(e,r,i)]}function ln(t,e,r){let i=typeof e=="string"?(n,s)=>({[e]:r?r(n,s):n._}):e||(({1:n,_:s},o,a)=>({[n||a]:s}));return(n,s)=>{let o=Co(t||n[1]),a=s.theme(o,n.$$)??ce(n.$$,o,s);if(a!=null)return n._=tn(n,0,a),i(n,s,o)}}function q(t,e={},r){return[t,Sc(e,r)]}function Sc(t={},e){return(r,i)=>{let{section:n=Co(r[0]).replace("-","")+"Color"}=t,[s,o]=Ic(r.$$);if(!s)return;let a=i.theme(n,s)||ce(s,n,i);if(!a||typeof a=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:c=n.replace("Color","Opacity"),property:d=n,selector:p}=t,h=i.theme(c,o||"DEFAULT")||o&&ce(o,c,i),y=e||(({_:$})=>{let x=Mt(d,$);return p?{[p]:x}:x});r._={value:te(a,{opacityVariable:l||void 0,opacityValue:h||void 0}),color:$=>te(a,$),opacityVariable:l||void 0,opacityValue:h||void 0};let f=y(r,i);if(!r.dark){let $=i.d(n,s,a);$&&$!==a&&(r._={value:te($,{opacityVariable:l||void 0,opacityValue:h||"1"}),color:x=>te($,x),opacityVariable:l||void 0,opacityValue:h||void 0},f={"&":f,[i.v("dark")]:y(r,i)})}return f}}function Ic(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Mt(t,e){let r={};return typeof e=="string"?r[t]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(r[e.opacityVariable]=e.opacityValue||"1"),r[t]=e.value),r}function ce(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=nt(on(t.slice(1,-1),r.theme)),!e)return t;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(t)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(t))||/image/i.test(e)&&!(/^image:/.test(t)||/^[a-z-]+\(/.test(t))||/weight/i.test(e)&&!(/^(number|any):/.test(t)||/^\d+$/.test(t))||/position/i.test(e)&&/^(length|size):/.test(t)))return t.replace(/^[a-z-]+:/,"")}}function Co(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function nt(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",i,n="")=>nt(r)+i+nt(n)):t.replace(/(^|[^\\])_+/g,(e,r)=>r+" ".repeat(e.length-r.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function cn({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:M(e.variants),rules:M(e.rules),ignorelist:M(e.ignorelist),hash:void 0,stringify:(i,n)=>i+":"+n,finalize:[]};for(let i of M([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&M(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:n,darkMode:s=r.darkMode,darkColor:o=r.darkColor,theme:a,variants:l,rules:c,ignorelist:d,hash:p=r.hash,stringify:h=r.stringify,finalize:y}=typeof i=="function"?i(r):i;r={preflight:r.preflight!==!1&&n!==!1&&[...r.preflight,...M(n)],darkMode:s,darkColor:o,theme:{...r.theme,...a,extend:{...r.theme.extend,...a?.extend}},variants:[...r.variants,...M(l)],rules:[...r.rules,...M(c)],ignorelist:[...r.ignorelist,...M(d)],hash:p,stringify:h,finalize:[...r.finalize,...M(y)]}}return r}function go(t,e,r,i,n,s){for(let o of e){let a=r.get(o);a||r.set(o,a=i(o));let l=a(t,n,s);if(l)return l}}function Ac(t){var e;return rn(t[0],typeof(e=t[1])=="function"?e:()=>e)}function Tc(t){var e,r;return Array.isArray(t)?rn(t[0],en(t[1],t[2])):rn(t,en(e,r))}function rn(t,e){return Eo(t,(r,i,n,s)=>{let o=i.exec(r);if(o)return o.$$=r.slice(o[0].length),o.dark=s,e(o,n)})}function Eo(t,e){let r=M(t).map(Dc);return(i,n,s)=>{for(let o of r){let a=e(i,o,n,s);if(a)return a}}}function Dc(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function $o(t,e){let r=cn(t),i=(function({theme:l,darkMode:c,darkColor:d=Sr,variants:p,rules:h,hash:y,stringify:f,ignorelist:$,finalize:x}){let E=new Map,b=new Map,k=new Map,S=new Map,P=Eo($,(T,W)=>W.test(T));p.push(["dark",Array.isArray(c)||c=="class"?`${M(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let R=typeof y=="function"?T=>y(T,_r):y?_r:uo;R!==uo&&x.push(T=>({...T,n:T.n&&R(T.n),d:T.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(W,K)=>"--"+R(K).replace("#",""))}));let z={theme:(function({extend:T={},...W}){let K={},di={get colors(){return Te("colors")},theme:Te,negative(){return{}},breakpoints(L){let V={};for(let Y in L)typeof L[Y]=="string"&&(V["screen-"+Y]=L[Y]);return V}};return Te;function Te(L,V,Y,bt){if(L){if({1:L,2:bt}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(L)||[,L],/[.[]/.test(L)){let fe=[];L.replace(/\[([^\]]+)\]|([^.[]+)/g,(Me,wt,$l=wt)=>fe.push($l)),L=fe.shift(),Y=V,V=fe.join("-")}let ae=K[L]||Object.assign(Object.assign(K[L]={},Qt(W,L)),Qt(T,L));if(V==null)return ae;V||(V="DEFAULT");let De=ae[V]??V.split("-").reduce((fe,Me)=>fe?.[Me],ae)??Y;return bt?te(De,{opacityValue:on(bt,Te)}):De}let vt={};for(let ae of[...Object.keys(W),...Object.keys(T)])vt[ae]=Te(ae);return vt}function Qt(L,V){let Y=L[V];return typeof Y=="function"&&(Y=Y(di)),Y&&/color|fill|stroke/i.test(V)?(function bt(vt,ae=[]){let De={};for(let fe in vt){let Me=vt[fe],wt=[...ae,fe];De[wt.join("-")]=Me,fe=="DEFAULT"&&(wt=ae,De[ae.join("-")]=Me),typeof Me=="object"&&Object.assign(De,bt(Me,wt))}return De})(Y):Y}})(l),e:yo,h:R,s(T,W){return f(T,W,z)},d(T,W,K){return d(T,W,z,K)},v(T){return E.has(T)||E.set(T,go(T,p,b,Ac,z)||"&:"+T),E.get(T)},r(T,W){let K=JSON.stringify([T,W]);return k.has(K)||k.set(K,!P(T,z)&&go(T,h,S,Tc,z,W)),k.get(K)},f(T){return x.reduce((W,K)=>K(W,z),T)}};return z})(r),n=new Map,s=[],o=new Set;e.resume(l=>n.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),o.add(l)});function a(l){let c=i.f(l),d=Zi(c);if(d&&!o.has(d)){o.add(d);let p=wo(s,l);e.insert(d,p,l),s.splice(p,0,l)}return c.n}return Object.defineProperties(function(c){if(!n.size)for(let p of M(r.preflight))typeof p=="function"&&(p=p(i)),p&&(typeof p=="string"?an("",F.b,Er(p),i,F.b,[],!1,!0):ko(p,{},i,F.b)).forEach(a);c=""+c;let d=n.get(c);if(!d){let p=new Set;for(let h of Cr(Er(c),i))p.add(h.c).add(a(h));d=[...p].filter(Boolean).join(" "),n.set(c,d).set(d,d)}return d},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:r,snapshot(){let l=e.snapshot(),c=new Set(o),d=new Map(n),p=[...s];return()=>{l(),o=c,n=d,s=p}},clear(){e.clear(),o=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Mc(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function So(t){let e=new MutationObserver(r);return{observe(n){e.observe(n,{attributeFilter:["class"],subtree:!0,childList:!0}),i(n),r([{target:n,type:""}])},disconnect(){e.disconnect()}};function r(n){for(let{type:s,target:o}of n)if(s[0]=="a")i(o);else for(let a of o.querySelectorAll("[class]"))i(a);e.takeRecords()}function i(n){let s,o=n.getAttribute?.("class");o&&Mc(o,s=t(o))&&n.setAttribute("class",s)}}function Oc(t){let e=document.querySelector(t||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function Ir(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:Oc(t)).sheet;return{target:e,snapshot(){let r=Array.from(e.cssRules,i=>i.cssText);return()=>{this.clear(),r.forEach(this.insert)}},clear(){for(let r=e.cssRules.length;r--;)e.deleteRule(r)},destroy(){e.ownerNode?.remove()},insert(r,i){try{e.insertRule(r,i)}catch{e.insertRule(":root{}",i)}},resume:Sr}}var Pc=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function Io(t){return Pc.get(t)}function Ao(t){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(t);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function To(t,e){var r=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(t);return r?r[1]?/^sti/i.test(e)?1:0:r[2]?/^pat/i.test(e)?1:0:r[3]?/^image-/i.test(e)?1:0:r[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var Uc=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Do(){return({stringify:t})=>({stringify(e,r,i){let n="",s=Io(e);s&&(n+=t(s,r,i)+";");let o=Ao(e),a=To(e,r);for(let l of Uc)o&l[1]&&(n+=t(l[0]+e,r,i)+";"),a&l[1]&&(n+=t(e,l[0]+r,i)+";");return n+t(e,r,i)}})}function Oo(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",ln("lineClamp",({_:t})=>Mo(t))],["line-clamp-(\\d+)",({1:t})=>Mo(t)]]}}function Mo(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var Pt={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...Z(4,"rem",4,.5,.5),...Z(12,"rem",4,5),14:"3.5rem",...Z(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:I("blur"),backdropBrightness:I("brightness"),backdropContrast:I("contrast"),backdropGrayscale:I("grayscale"),backdropHueRotate:I("hueRotate"),backdropInvert:I("invert"),backdropOpacity:I("opacity"),backdropSaturate:I("saturate"),backdropSepia:I("sepia"),backgroundColor:I("colors"),backgroundImage:{none:"none"},backgroundOpacity:I("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...Z(200,"",100,0,50),...Z(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:I("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:I("spacing"),borderWidth:{DEFAULT:"1px",...re(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:I("colors"),caretColor:I("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...Z(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:I("borderColor"),divideOpacity:I("borderOpacity"),divideWidth:I("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:t})=>({...t("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:t})=>({...t("spacing"),...Ot(2,6),...Ot(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:I("spacing"),gradientColorStops:I("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:t})=>({...t("spacing"),...Ot(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...Ot(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...Z(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:t})=>({auto:"auto",...t("spacing")}),maxHeight:({theme:t})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...t("spacing")}),maxWidth:({theme:t,breakpoints:e})=>({...e(t("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...Z(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:I("spacing"),placeholderColor:I("colors"),placeholderOpacity:I("opacity"),outlineColor:I("colors"),outlineOffset:re(8,"px"),outlineWidth:re(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:I("colors"),ringOffsetWidth:re(8,"px"),ringOpacity:({theme:t})=>({...t("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...re(8,"px")},rotate:{...re(2,"deg"),...re(12,"deg",3),...re(180,"deg",45)},saturate:Z(200,"",100,0,50),scale:{...Z(150,"",100,0,50),...Z(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:I("spacing"),scrollPadding:I("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...re(2,"deg"),...re(12,"deg",3)},space:I("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:Z(2),textColor:I("colors"),textDecorationColor:I("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...re(8,"px")},textUnderlineOffset:{auto:"auto",...re(8,"px")},textIndent:I("spacing"),textOpacity:I("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:I("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:t})=>({...t("spacing"),...Ot(2,4),full:"100%"}),width:({theme:t})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...t("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...Z(50,"",1,0,10),auto:"auto"}};function Ot(t,e){let r={};do for(var i=1;i<t;i++)r[`${i}/${t}`]=Number((i/t*100).toFixed(6))+"%";while(++t<=e);return r}function re(t,e,r=0){let i={};for(;r<=t;r=2*r||1)i[r]=r+e;return i}function Z(t,e="",r=1,i=0,n=1,s={}){for(;i<=t;i+=n)s[i]=i/r+e;return s}function I(t){return({theme:e})=>e(t)}var Po={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${Pt.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${Pt.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var qo=[m("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:ce(`[${e}]`,"",r)}}})),m("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),g("aspect-","aspectRatio"),m("container",(t,{theme:e})=>{let{screens:r=e("screens"),center:i,padding:n}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...o("xs")};for(let a in r){let l=r[a];typeof l=="string"&&(s[$r(l)]={"&":{maxWidth:l,...o(a)}})}return s;function o(a){let l=n&&(typeof n=="string"?n:n[a]||n.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),g("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),m("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),m("box-(border|content)","boxSizing",({1:t})=>t+"-box"),m("hidden",{display:"none"}),m("table-(auto|fixed)","tableLayout"),m(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",m("isolate","isolation"),m("object-(contain|cover|fill|none|scale-down)","objectFit"),g("object-","objectPosition"),m("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Ar),m("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),m("(static|fixed|absolute|relative|sticky)","position"),g("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),g("-?(top|bottom|left|right)(?:$|-)","inset"),m("(visible|collapse)","visibility"),m("invisible",{visibility:"hidden"}),g("-?z-","zIndex"),m("flex-((row|col)(-reverse)?)","flexDirection",Uo),m("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),g("(flex-(?:grow|shrink))(?:$|-)"),g("(flex)-"),g("grow(?:$|-)","flexGrow"),g("shrink(?:$|-)","flexShrink"),g("basis-","flexBasis"),g("-?(order)-"),"-?(order)-(\\d+)",g("grid-cols-","gridTemplateColumns"),m("grid-cols-(\\d+)","gridTemplateColumns",Fo),g("col-","gridColumn"),m("col-(span)-(\\d+)","gridColumn",Ro),g("col-start-","gridColumnStart"),m("col-start-(auto|\\d+)","gridColumnStart"),g("col-end-","gridColumnEnd"),m("col-end-(auto|\\d+)","gridColumnEnd"),g("grid-rows-","gridTemplateRows"),m("grid-rows-(\\d+)","gridTemplateRows",Fo),g("row-","gridRow"),m("row-(span)-(\\d+)","gridRow",Ro),g("row-start-","gridRowStart"),m("row-start-(auto|\\d+)","gridRowStart"),g("row-end-","gridRowEnd"),m("row-end-(auto|\\d+)","gridRowEnd"),m("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>Ar(Uo(t))),m("grid-flow-(dense)","gridAutoFlow"),g("auto-cols-","gridAutoColumns"),g("auto-rows-","gridAutoRows"),g("gap-x(?:$|-)","gap","columnGap"),g("gap-y(?:$|-)","gap","rowGap"),g("gap(?:$|-)","gap"),"(justify-(?:items|self))-",m("justify-","justifyContent",Lo),m("(content|items|self)-",t=>({["align-"+t[1]]:Lo(t)})),m("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),g("p([xytrbl])?(?:$|-)","padding",st("padding")),g("-?m([xytrbl])?(?:$|-)","margin",st("margin")),g("-?space-(x|y)(?:$|-)","space",({1:t,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[t]]:`calc(${e} * calc(1 - var(--tw-space-${t}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[t]]:`calc(${e} * var(--tw-space-${t}-reverse))`}})),m("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),g("w-","width"),g("min-w-","minWidth"),g("max-w-","maxWidth"),g("h-","height"),g("min-h-","minHeight"),g("max-h-","maxHeight"),g("font-","fontWeight"),g("font-","fontFamily",({_:t})=>typeof(t=M(t))[1]=="string"?{fontFamily:oe(t)}:{fontFamily:oe(t[0]),...t[1]}),m("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),m("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),m("italic","fontStyle"),m("not-italic",{fontStyle:"normal"}),m("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:t,2:e="",3:r})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(r?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":t)]:t,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...Ee({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),g("tracking-","letterSpacing"),g("leading-","lineHeight"),m("list-(inside|outside)","listStylePosition"),g("list-","listStyleType"),m("list-","listStyleType"),g("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),q("placeholder-",{property:"color",selector:"&::placeholder"}),m("text-(left|center|right|justify|start|end)","textAlign"),m("text-(ellipsis|clip)","textOverflow"),g("text-opacity-","textOpacity","--tw-text-opacity"),q("text-",{property:"color"}),g("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),g("indent-","textIndent"),m("(overline|underline|line-through)","textDecorationLine"),m("no-underline",{textDecorationLine:"none"}),g("underline-offset-","textUnderlineOffset"),q("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),g("decoration-","textDecorationThickness"),m("decoration-","textDecorationStyle"),m("(uppercase|lowercase|capitalize)","textTransform"),m("normal-case",{textTransform:"none"}),m("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),m("align-","verticalAlign"),m("whitespace-","whiteSpace"),m("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),m("break-words",{overflowWrap:"break-word"}),m("break-all",{wordBreak:"break-all"}),m("break-keep",{wordBreak:"keep-all"}),q("caret-",{opacityVariable:!1,opacitySection:"opacity"}),q("accent-",{opacityVariable:!1,opacitySection:"opacity"}),m("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${Fe(t," ")},var(--tw-gradient-stops))`),q("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-from":t.value,"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),q("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${t.value},var(--tw-gradient-to)`})),q("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),m("bg-(fixed|local|scroll)","backgroundAttachment"),m("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),m(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),m("bg-blend-","backgroundBlendMode"),m("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),g("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),q("bg-",{section:"backgroundColor"}),g("bg-","backgroundImage"),g("bg-","backgroundPosition"),m("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Ar),g("bg-","backgroundSize"),g("rounded(?:$|-)","borderRadius"),g("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:t,_:e})=>{let r={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[t]||[t,t];return{[`border-${Fe(r[0])}-radius`]:e,[`border-${Fe(r[1])}-radius`]:e}}),m("border-(collapse|separate)","borderCollapse"),g("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),m("border-(solid|dashed|dotted|double|none)","borderStyle"),g("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...Ee({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(t||"-x")]:e,["--tw-border-spacing"+(t||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),q("border-([xytrbl])-",{section:"borderColor"},st("border","Color")),q("border-"),g("border-([xytrbl])(?:$|-)","borderWidth",st("border","Width")),g("border(?:$|-)","borderWidth"),g("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),m("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),m("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),g("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${Fe(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${Fe(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),q("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),g("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),q("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),g("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),m("ring-inset",{"--tw-ring-inset":"inset"}),q("ring-",{property:"--tw-ring-color"}),g("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...Ee({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":te(e("ringOffsetColor","","#fff")),"--tw-ring-color":te(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${t} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),q("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),g("shadow(?:$|-)","boxShadow",({_:t})=>({...Ee({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":oe(t),"--tw-shadow-colored":oe(t).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),g("(opacity)-"),m("mix-blend-","mixBlendMode"),...jo(),...jo("backdrop-"),g("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:oe(t),transitionTimingFunction:t._=="none"?void 0:oe(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:oe(e("transitionDuration",""))})),g("duration(?:$|-)","transitionDuration","transitionDuration",oe),g("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",oe),g("delay(?:$|-)","transitionDelay","transitionDelay",oe),g("animate(?:$|-)","animation",(t,{theme:e,h:r,e:i})=>{let n=oe(t),s=n.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=i(r(s[0])))]:o,animation:s.join(" ")}:{animation:n}}),"(transform)-(none)",m("transform",dn),m("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":Bo(t=="gpu")})),g("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...dn()})),g("-?(rotate)-","rotate",un),g("-?(translate-[xy])-","translate",un),g("-?(skew-[xy])-","skew",un),m("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Ar),"(appearance)-",g("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",g("(cursor)-"),"(cursor)-",m("snap-(none)","scroll-snap-type"),m("snap-(x|y|both)",({1:t})=>({...Ee({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),m("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),m("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),m("snap-(normal|always)","scroll-snap-stop"),m("scroll-(auto|smooth)","scroll-behavior"),g("scroll-p([xytrbl])?(?:$|-)","padding",st("scroll-padding")),g("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",st("scroll-margin")),m("touch-(auto|none|manipulation)","touch-action"),m("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...Ee({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":r?"pan-y":t}`]:t,"touch-action":"var(--tw-touch-action)"})),m("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),m("outline",{outlineStyle:"solid"}),m("outline-(dashed|dotted|double)","outlineStyle"),g("-?(outline-offset)-"),q("outline-",{opacityVariable:!1,opacitySection:"opacity"}),g("outline-","outlineWidth"),"(pointer-events)-",g("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],m("select-(none|text|all|auto)","userSelect"),q("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),q("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),g("stroke-","strokeWidth"),m("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),m("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Ar(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function Uo(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function Fe(t,e="-"){let r=[];for(let i of t)r.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return r.join(e)}function oe(t){return t&&""+(t._||t)}function Lo({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function st(t,e=""){return({1:r,_:i})=>{let n={x:"lr",y:"tb"}[r]||r+r;return n?{...Mt(t+"-"+Fe(n[0])+e,i),...Mt(t+"-"+Fe(n[1])+e,i)}:Mt(t+e,i)}}function jo(t=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",t&&"opacity","saturate","sepia",!t&&"drop-shadow"].filter(Boolean),r={};for(let i of e)r[`--tw-${t}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...Ee(r),[`${t}filter`]:e.map(i=>`var(--tw-${t}${i})`).join(" ")},[`(${t}filter)-(none)`,m(`${t}filter`,r),...e.map(i=>g(`${i[0]=="h"?"-?":""}(${t}${i})(?:$|-)`,i,({1:n,_:s})=>({[`--tw-${n}`]:M(s).map(o=>`${i}(${o})`).join(" "),...r})))]}function un({1:t,_:e}){return{["--tw-"+t]:e,...dn()}}function dn(){return{...Ee({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":Bo()}),transform:"var(--tw-transform)"}}function Bo(t){return[t?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function Ro({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function Fo({1:t}){return`repeat(${t},minmax(0,1fr))`}function Ee(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var No=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:t})=>`@media (orientation:${t})`],["contrast-(more|less)",({1:t})=>`@media (prefers-contrast:${t})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:t})=>`&::${t}`],["(marker|selection)",({1:t})=>`& *::${t},&::${t}`],["file","&::file-selector-button"],["(first|last|only)",({1:t})=>`&:${t}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:t,$$:e},r)=>e&&`&[${t}-${r.theme(t,e)||ce(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:i="",6:n=e},{e:s,h:o,v:a})=>{let l=nt(i)||(r[0]=="["?r:a(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(t+n))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||ce(t,"",e)),t)return t.includes(":")||(t+=":var(--tw)"),/^\w*\s*\(/.test(t)||(t=`(${t})`),`@supports ${t.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:t},e)=>{if(t&&(t=e.theme("screens",t)||ce(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=ce(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&nt(t).replace(/[}]+$/,"").split("{")]];function zo({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:Po,theme:{...Pt,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:No,rules:qo,finalize(r){return r.n&&r.d&&r.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(r.d)?{...r,d:"content:var(--tw-content);"+r.d}:r}}}var Lc={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},jc={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Rc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Fc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},qc={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Bc={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Nc={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},zc={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Wc={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Vc={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Hc={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Gc={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Xc={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Jc={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Kc={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Yc={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Qc={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Zc={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},eu={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},tu={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},ru={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},iu={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Wo={__proto__:null,slate:Lc,gray:jc,zinc:Rc,neutral:Fc,stone:qc,red:Bc,orange:Nc,amber:zc,yellow:Wc,lime:Vc,green:Hc,emerald:Gc,teal:Xc,cyan:Jc,sky:Kc,blue:Yc,indigo:Qc,violet:Zc,purple:eu,fuchsia:tu,pink:ru,rose:iu};function Vo({disablePreflight:t}={}){return zo({colors:Wo,disablePreflight:t})}function Xo({className:t="prose",defaultColor:e="gray",extend:r={},colors:i={}}={}){return i={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...i,dark:i.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...i.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${t}-${s}`,(a,l)=>Jo(t,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${t})`,({1:s},{h:o})=>[{c:o(s)}]],[`${t}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[t+"-",({$$:s},o)=>{let a=Go(o.theme("fontSize",s));return a&&{"@layer components":a}}],[t+"-",({$$:s},o)=>n(s,o)],[t,(s,o)=>({...n(e,o),"@layer base":[Ho(t,o,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:_(20,16),marginBottom:_(20,16),paddingLeft:_(26,16)},li:{marginTop:_(8,16),marginBottom:_(8,16)},"ol>li,ul>li":{paddingLeft:_(6,16)},">ul>li p":{marginTop:_(12,16),marginBottom:_(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:_(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:_(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:_(12,16),marginBottom:_(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:_(48,16),marginBottom:_(48,16)},blockquote:{marginTop:_(32,20),marginBottom:_(32,20),paddingLeft:_(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:_(20,16),marginBottom:_(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:_(36,16),marginTop:"0",marginBottom:_(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:_(24,16),marginTop:_(48,24),marginBottom:_(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:_(20,16),marginTop:_(32,20),marginBottom:_(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:_(24,16),marginBottom:_(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:_(32,16),marginBottom:_(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:_(14,16),lineHeight:"1.4",marginTop:_(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:_(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:_(21,24)},"h3 code":{fontSize:_(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:_(14,16),lineHeight:"1.7",marginTop:_(24,14),marginBottom:_(24,14),borderRadius:"0.375rem",paddingTop:_(12,14),paddingRight:_(16,14),paddingBottom:_(12,14),paddingLeft:_(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:_(32,16),marginBottom:_(32,16),fontSize:_(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:_(8,14),paddingBottom:_(8,14),paddingLeft:_(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:_(8,14),paddingRight:_(8,14),paddingBottom:_(8,14),paddingLeft:_(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${o.e(o.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:_(20,16),lineHeight:"1.6",marginTop:_(24,20),marginBottom:_(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Ho(t,o,r)],"@layer components":{...Go(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,o){let a={},l={},c=(d,p,h)=>{let y=o.theme(`colors.${s}.${p}`,p);h["--tw-prose-"+d]=te(y);let f=h!=l&&o.d("colors",`${s}-${p}`,y);f&&(l["--tw-prose-"+d]=te(f))};for(let d in i){let p=i[d];d!="dark"&&p&&c(d,p,a)}for(let d in i.dark||{}){let p=i.dark[d];p&&(i.dark?c("invert-"+d,p,a):c(d,p,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function Ho(t,e,r){let i={};for(let n in r)i[Jo(t,n,e,s=>`.${e.e(e.h(t))}${s}`)]=r[n];return i}function Jo(t,e,{e:r,h:i},n){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",a=s,l="")=>n(`${o}:where(${a}):not(:where(.${r(i("not-"+t))} *))${l}`))}function Go(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function _(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var pn=cn({hash:!1,darkMode:"class",theme:{extend:{colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}},spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]}}},presets:[Vo(),Do(),Oo(),Xo()]});function Ko(t,e=!0){let r=(function(){if(nu)try{let l=Ir(new CSSStyleSheet);return l.connect=c=>{let d=hn(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,l.target]},l.disconnect=Sr,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Ir(s)],a=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(c=>c.snapshot());return()=>l.forEach(c=>c())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,c,d){o[0].insert(l,c,d);let p=this.target.cssRules[c];o.forEach((h,y)=>y&&h.target.insertRule(p.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");hn(l).appendChild(c);let d=Ir(c),{cssRules:p}=this.target;for(let h=0;h<p.length;h++)d.target.insertRule(p[h].cssText,h);o.push(d),a.set(l,d)},disconnect(l){let c=o.indexOf(a.get(l));c>=0&&o.splice(c,1)}}})(),i=$o({...t,hash:t.hash??e},r),n=So(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),n.observe(hn(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var nu=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function hn(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var w=t=>Ko(pn)(t);var fn=class extends w(v){static properties={color:{type:String},radius:{type:String},size:{type:String},border:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
|
|
129
129
|
:host {
|
|
130
130
|
display: block;
|
|
131
131
|
}
|
|
@@ -228,7 +228,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
228
228
|
</button>
|
|
229
229
|
</mw-spinning-border>
|
|
230
230
|
</div>
|
|
231
|
-
`};customElements.get("mw-bubble")||customElements.define("mw-bubble",mn);var Tr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Dr=t=>(...e)=>({_$litDirective$:t,values:e}),ot=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var{I:su}=Ds,Yo=t=>t;var Qo=()=>document.createComment(""),at=(t,e,r)=>{let i=t._$AA.parentNode,n=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=i.insertBefore(Qo(),n),o=i.insertBefore(Qo(),n);r=new su(s,o,t,t.options)}else{let s=r._$AB.nextSibling,o=r._$AM,a=o!==t;if(a){let l;r._$AQ?.(t),r._$AM=t,r._$AP!==void 0&&(l=t._$AU)!==o._$AU&&r._$AP(l)}if(s!==n||a){let l=r._$AA;for(;l!==s;){let c=Yo(l).nextSibling;Yo(i).insertBefore(l,n),l=c}}}return r},$e=(t,e,r=t)=>(t._$AI(e,r),t),ou={},Zo=(t,e=ou)=>t._$AH=e,ea=t=>t._$AH,Mr=t=>{t._$AR(),t._$AA.remove()};var ta=(t,e,r)=>{let i=new Map;for(let n=e;n<=r;n++)i.set(t[n],n);return i},X=Dr(class extends ot{constructor(t){if(super(t),t.type!==Tr.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,r){let i;r===void 0?r=e:e!==void 0&&(i=e);let n=[],s=[],o=0;for(let a of t)n[o]=i?i(a,o):o,s[o]=r(a,o),o++;return{values:s,keys:n}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,i]){let n=ea(t),{values:s,keys:o}=this.dt(e,r,i);if(!Array.isArray(n))return this.ut=o,s;let a=this.ut??=[],l=[],c,d,p=0,h=n.length-1,y=0,f=s.length-1;for(;p<=h&&y<=f;)if(n[p]===null)p++;else if(n[h]===null)h--;else if(a[p]===o[y])l[y]=$e(n[p],s[y]),p++,y++;else if(a[h]===o[f])l[f]=$e(n[h],s[f]),h--,f--;else if(a[p]===o[f])l[f]=$e(n[p],s[f]),at(t,l[f+1],n[p]),p++,f--;else if(a[h]===o[y])l[y]=$e(n[h],s[y]),at(t,n[p],n[h]),h--,y++;else if(c===void 0&&(c=ta(o,y,f),d=ta(a,p,h)),c.has(a[p]))if(c.has(a[h])){let
|
|
231
|
+
`};customElements.get("mw-bubble")||customElements.define("mw-bubble",mn);var Tr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Dr=t=>(...e)=>({_$litDirective$:t,values:e}),ot=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var{I:su}=Ds,Yo=t=>t;var Qo=()=>document.createComment(""),at=(t,e,r)=>{let i=t._$AA.parentNode,n=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=i.insertBefore(Qo(),n),o=i.insertBefore(Qo(),n);r=new su(s,o,t,t.options)}else{let s=r._$AB.nextSibling,o=r._$AM,a=o!==t;if(a){let l;r._$AQ?.(t),r._$AM=t,r._$AP!==void 0&&(l=t._$AU)!==o._$AU&&r._$AP(l)}if(s!==n||a){let l=r._$AA;for(;l!==s;){let c=Yo(l).nextSibling;Yo(i).insertBefore(l,n),l=c}}}return r},$e=(t,e,r=t)=>(t._$AI(e,r),t),ou={},Zo=(t,e=ou)=>t._$AH=e,ea=t=>t._$AH,Mr=t=>{t._$AR(),t._$AA.remove()};var ta=(t,e,r)=>{let i=new Map;for(let n=e;n<=r;n++)i.set(t[n],n);return i},X=Dr(class extends ot{constructor(t){if(super(t),t.type!==Tr.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,r){let i;r===void 0?r=e:e!==void 0&&(i=e);let n=[],s=[],o=0;for(let a of t)n[o]=i?i(a,o):o,s[o]=r(a,o),o++;return{values:s,keys:n}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,i]){let n=ea(t),{values:s,keys:o}=this.dt(e,r,i);if(!Array.isArray(n))return this.ut=o,s;let a=this.ut??=[],l=[],c,d,p=0,h=n.length-1,y=0,f=s.length-1;for(;p<=h&&y<=f;)if(n[p]===null)p++;else if(n[h]===null)h--;else if(a[p]===o[y])l[y]=$e(n[p],s[y]),p++,y++;else if(a[h]===o[f])l[f]=$e(n[h],s[f]),h--,f--;else if(a[p]===o[f])l[f]=$e(n[p],s[f]),at(t,l[f+1],n[p]),p++,f--;else if(a[h]===o[y])l[y]=$e(n[h],s[y]),at(t,n[p],n[h]),h--,y++;else if(c===void 0&&(c=ta(o,y,f),d=ta(a,p,h)),c.has(a[p]))if(c.has(a[h])){let $=d.get(o[y]),x=$!==void 0?n[$]:null;if(x===null){let E=at(t,n[p]);$e(E,s[y]),l[y]=E}else l[y]=$e(x,s[y]),at(t,n[p],x),n[$]=null;y++}else Mr(n[h]),h--;else Mr(n[p]),p++;for(;y<=f;){let $=at(t,l[f+1]);$e($,s[y]),l[y++]=$}for(;p<=h;){let $=n[p++];$!==null&&Mr($)}return this.ut=o,Zo(t,l),ne}});var Ut=class t extends w(v){static properties={examples:{type:Object},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.examples={title:"",items:[]},this.color="",this.darkMode=!1}render(){return!this.examples?.title&&!this.examples?.items?.length?null:u`
|
|
232
232
|
<div class="${this.darkMode?"dark":""} flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pt-6 pb-2">
|
|
233
233
|
${this.examples.title?u`
|
|
234
234
|
<h2 class="mt-14 px-2 pt-9 pb-2 text-left text-3xl leading-tight font-bold tracking-tight text-black dark:text-white">
|
|
@@ -309,7 +309,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
309
309
|
</div>
|
|
310
310
|
</div>
|
|
311
311
|
</div>
|
|
312
|
-
`}#e(){this.dispatchEvent(new t.NewChatClickEvent)}#t(){this.dispatchEvent(new t.ExpandClickEvent)}#r(){this.dispatchEvent(new t.CloseClickEvent)}};ye.NewChatClickEvent=class extends CustomEvent{static type="mw:new-chat-click";constructor(e={}){super(ye.NewChatClickEvent.type,{...e})}};ye.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(ye.ExpandClickEvent.type,{...e})}};ye.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(ye.CloseClickEvent.type,{...e})}};customElements.get("mw-chat-header")||customElements.define("mw-chat-header",ye);async function ra(t,e,r){let i=e.map((c,d)=>({index:d,item:c})),n=async c=>{let d=[];for(;;){let p=i.pop();if(!p)return c(d);try{let h=await r(p.item);d.push({error:null,result:h,index:p.index})}catch(h){d.push({error:h,result:void 0,index:p.index})}}},s=Array.from({length:t},()=>new Promise(n)),a=(await Promise.all(s)).flat().sort((c,d)=>c.index-d.index),l=a.filter(c=>c.error);if(l.length>0)throw new AggregateError(l.map(c=>c.error));return a.map(c=>c.result)}var aa=pi(oa(),1);var vn=(t,e)=>{let r=t.reduce((i,n)=>{let s=e?e(n):n;return i[s]||(i[s]=n),i},{});return Object.values(r)};var wn=({interval:t},e)=>{let r=!0,i,n=(...s)=>{r&&(e(...s),r=!1,i=setTimeout(()=>{r=!0,i=void 0},t))};return n.isThrottled=()=>i!==void 0,n};var de=Object.freeze({pending_upload:"pending_upload",uploaded:"uploaded",errored:"errored"}),Ur=class{#e;#t;#r=!1;#n=!1;#i=null;#
|
|
312
|
+
`}#e(){this.dispatchEvent(new t.NewChatClickEvent)}#t(){this.dispatchEvent(new t.ExpandClickEvent)}#r(){this.dispatchEvent(new t.CloseClickEvent)}};ye.NewChatClickEvent=class extends CustomEvent{static type="mw:new-chat-click";constructor(e={}){super(ye.NewChatClickEvent.type,{...e})}};ye.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(ye.ExpandClickEvent.type,{...e})}};ye.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(ye.CloseClickEvent.type,{...e})}};customElements.get("mw-chat-header")||customElements.define("mw-chat-header",ye);async function ra(t,e,r){let i=e.map((c,d)=>({index:d,item:c})),n=async c=>{let d=[];for(;;){let p=i.pop();if(!p)return c(d);try{let h=await r(p.item);d.push({error:null,result:h,index:p.index})}catch(h){d.push({error:h,result:void 0,index:p.index})}}},s=Array.from({length:t},()=>new Promise(n)),a=(await Promise.all(s)).flat().sort((c,d)=>c.index-d.index),l=a.filter(c=>c.error);if(l.length>0)throw new AggregateError(l.map(c=>c.error));return a.map(c=>c.result)}var aa=pi(oa(),1);var vn=(t,e)=>{let r=t.reduce((i,n)=>{let s=e?e(n):n;return i[s]||(i[s]=n),i},{});return Object.values(r)};var wn=({interval:t},e)=>{let r=!0,i,n=(...s)=>{r&&(e(...s),r=!1,i=setTimeout(()=>{r=!0,i=void 0},t))};return n.isThrottled=()=>i!==void 0,n};var de=Object.freeze({pending_upload:"pending_upload",uploaded:"uploaded",errored:"errored"}),Ur=class{#e;#t;#r=!1;#n=!1;#i=null;#s=null;#o=null;#a=[];constructor(e,{acceptedTypes:r,maxFileSize:i,maxFileCount:n,canAcceptFiles:s,onFilesAdded:o,onFileDelete:a,onFileUpload:l,onError:c}){this.#e=e,this.#t={acceptedTypes:r,maxFileSize:i,maxFileCount:n,canAcceptFiles:s,onFilesAdded:o,onFileDelete:a,onFileUpload:l,onError:c},e.addController(this)}hostConnected(){this.#p()}hostDisconnected(){this.#c(),this.#u(),this.#o&&(clearTimeout(this.#o),this.#o=null),this.#i&&this.#i.parentNode&&this.#i.parentNode.removeChild(this.#i),this.#i=null}#l(){this.#c(),this.#e.addEventListener("dragover",this.#f),this.#e.addEventListener("dragenter",this.#g),this.#e.addEventListener("dragleave",this.#m),this.#e.addEventListener("drop",this.#_)}#c(){this.#e.removeEventListener("dragover",this.#f),this.#e.removeEventListener("dragenter",this.#g),this.#e.removeEventListener("dragleave",this.#m),this.#e.removeEventListener("drop",this.#_)}#d(){this.#u(),this.#e.addEventListener("paste",this.#w)}#u(){this.#e.removeEventListener("paste",this.#w)}#p(){this.#i||(this.#i=document.createElement("input"),this.#i.type="file",this.#i.accept=this.#t.acceptedTypes?.join(",")??"",this.#i.multiple=this.#t.maxFileCount>1,this.#i.style.display="none",this.#i.addEventListener("change",this.#v),document.body.appendChild(this.#i))}#v=e=>{if(e.target instanceof HTMLInputElement){let r=e.target,i=Array.from(r.files||[]);this.#h(i),r.value=""}};#f=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")};#g=e=>{e.preventDefault(),e.dataTransfer&&this.#C(e.dataTransfer)&&this.#x(!0)};#m=e=>{if(e.preventDefault(),e.relatedTarget instanceof Node){let r=e.relatedTarget;this.#e.contains(r)||this.#x(!1)}};#_=e=>{if(e.preventDefault(),this.#x(!1),e.dataTransfer){let r=Array.from(e.dataTransfer.files||[]);this.#h(r)}};#w=e=>{if(!e.clipboardData)return;let i=Array.from(e.clipboardData.items||[]).filter(s=>s.kind==="file");if(i.length===0)return;e.preventDefault();let n=i.map(s=>s.getAsFile()).flatMap(s=>s?[s]:[]);this.#h(n)};#C(e){return e.types&&e.types.includes("Files")}#x(e){this.#n!==e&&(this.#n=e,this.#e.requestUpdate())}#y(e){this.#s=e,this.#t.onError?.(e),this.#e.requestUpdate(),this.#o&&clearTimeout(this.#o),this.#o=setTimeout(()=>{this.#b()},6e3)}#b(){this.#o&&(clearTimeout(this.#o),this.#o=null),this.#s=null,this.#e.requestUpdate()}async#h(e){if(e.length===0||this.#t.canAcceptFiles?.()===!1)return;this.#t.onFilesAdded?.(),this.#b();let r=e.filter(o=>this.#$(o));if(r.length===0)return;let i=this.#a.length,n=this.#t.maxFileCount??1/0,s=r.length;if(i+s>n){this.#y(`You can upload a maximum of ${n} files`);return}try{let o=await Promise.all(r.map(l=>this.#S(l))),a=vn(o,l=>l.dataUrl);this.#a=[...this.#a,...a],this.#e.requestUpdate(),await ra(3,a,l=>cr({times:5,backoff:c=>c*3e3},()=>this.#E(l))),this.#e.requestUpdate()}catch(o){console.error("Failed to process and upload files:",o),this.#y("Upload failed")}}#$(e){return this.#t.acceptedTypes&&!this.#t.acceptedTypes.includes(e.type)?(this.#y("Invalid file type"),!1):e.size>this.#t.maxFileSize?(this.#y(`Max file size: ${this.#t.maxFileSize/(1024*1024)}MB`),!1):!0}async#S(e){try{let r=await(0,aa.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:r,file:e,processingState:de.pending_upload}}catch(r){let i=r instanceof Error?r:new Error(String(r));throw new Error(`Failed to read file: ${e.name} - ${i.message}`)}}async#E(e){if(!e){console.error("No file provided to upload"),this.#y("No file provided");return}e.processingState=de.pending_upload,this.#e.requestUpdate();try{let r=await this.#t.onFileUpload(e);e.publicUrl=r.publicUrl,e.processingState=de.uploaded,this.#e.requestUpdate()}catch(r){console.error("Upload error:",r);let i=r instanceof Error?r:new Error(String(r));this.#y(i.message),e.processingState=de.errored,this.#e.requestUpdate()}}get isDragging(){return this.#n}get error(){return this.#s}get selectedFiles(){return this.#a}get hasPendingFiles(){return this.#a.some(e=>e.processingState===de.pending_upload)}openFilePicker=()=>{if(!this.#r){console.warn("File uploads are disabled");return}this.#i&&this.#i.click()};clearError(){this.#b()}clearFiles(){this.#a=[],this.clearError(),this.#e.requestUpdate()}setEnabled(e){this.#r!==e&&(this.#r=e,this.#r?(this.#l(),this.#d()):(this.#c(),this.#u()))}restoreFiles(e){this.#a=e,this.#e.requestUpdate()}deleteFile=e=>{this.#t.onFileDelete?.(e),this.#a=this.#a.filter(r=>r.id!==e),this.#b(),this.#e.requestUpdate()}};var Lr={maxHeight:120,initialHeight:32,paddingY:12},ee=class t extends w(v){static properties={disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String},color:{type:String},enableFileUpload:{type:Boolean},darkMode:{type:Boolean,attribute:"dark-mode"},files:{type:Array}};#e=new Date;constructor(){super(),this.disabled=!1,this.streaming=!1,this.loading=!1,this.placeholder="Type a message...",this.color="#8B5CF6",this.enableFileUpload=!1,this.darkMode=!1,this.files=[]}get value(){return this.#t?.value?.trim()??""}render(){let e=this.streaming||this.loading||!this.value&&(!this.enableFileUpload||this.files.length===0);return u`
|
|
313
313
|
<div
|
|
314
314
|
class="${this.darkMode?"dark bg-[#1E1F23]":"bg-white"} ${this.enableFileUpload&&this.files.length>0?`ring-2 ring-[${this.color}] ring-opacity-50`:""} focus-within:ring-opacity-50 w-full overflow-hidden rounded-[18px] shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)] transition-all duration-200 focus-within:ring-2 focus-within:ring-[${this.color}]">
|
|
315
315
|
<!-- File preview area -->
|
|
@@ -364,7 +364,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
364
364
|
<textarea
|
|
365
365
|
data-testid="mw-chat-input-textarea"
|
|
366
366
|
name="input"
|
|
367
|
-
@input="${this.#
|
|
367
|
+
@input="${this.#s}"
|
|
368
368
|
@keydown="${this.#n}"
|
|
369
369
|
autofocus
|
|
370
370
|
?disabled="${this.disabled}"
|
|
@@ -388,7 +388,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
388
388
|
<div class="h-5 w-full"></div>
|
|
389
389
|
</slot>
|
|
390
390
|
</div>
|
|
391
|
-
`}get#t(){return this.renderRoot.querySelector('textarea[name="input"]')??null}get#r(){return this.renderRoot.querySelector('button[type="submit"]')??null}#n(e){xu(e)&&(e.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&this.#r?.click())}#i(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;if(this.#e=r,this.streaming){this.dispatchEvent(new t.CancelEvent);return}let n=this.#t;if(!n)throw new Error("Expected input element to be present");let s=n.value.trim();(s||this.enableFileUpload&&this.files.length>0)&&this.dispatchEvent(new t.SubmitEvent(s))&&(n.value=""),this.#
|
|
391
|
+
`}get#t(){return this.renderRoot.querySelector('textarea[name="input"]')??null}get#r(){return this.renderRoot.querySelector('button[type="submit"]')??null}#n(e){xu(e)&&(e.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&this.#r?.click())}#i(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;if(this.#e=r,this.streaming){this.dispatchEvent(new t.CancelEvent);return}let n=this.#t;if(!n)throw new Error("Expected input element to be present");let s=n.value.trim();(s||this.enableFileUpload&&this.files.length>0)&&this.dispatchEvent(new t.SubmitEvent(s))&&(n.value=""),this.#o(),this.focus()}#s(e){this.dispatchEvent(new t.ChangeEvent({delta:e.data,full:e.target instanceof HTMLTextAreaElement?e.target.value:""})),this.#o()}#o(){let e=this.#t;if(!e)return;let{maxHeight:r,initialHeight:i,paddingY:n}=Lr;e.style.height=`${i}px`;let s=e.scrollHeight,o=n*2,a=Math.min(s-o,r);e.style.height=`${a}px`,this.requestUpdate()}#a(){this.dispatchEvent(new t.FileUploadClickEvent)}#l(e){this.dispatchEvent(new t.FileDeleteEvent(e))}setValue(e){let r=this.#t;if(!r){console.warn("input element not found, cannot set value");return}r.value=e,this.#o(),this.dispatchEvent(new t.ChangeEvent({delta:null,full:e}))}focus(){window.requestAnimationFrame(()=>{this.#t?.focus()})}};ee.ChangeEvent=class extends CustomEvent{static type="mw:change";constructor(e,r={}){super(ee.ChangeEvent.type,{detail:e,...r})}};ee.SubmitEvent=class extends CustomEvent{static type="mw:submit";constructor(e,r={}){super(ee.SubmitEvent.type,{detail:e,...r,cancelable:!0})}};ee.CancelEvent=class extends CustomEvent{static type="mw:cancel";constructor(e={}){super(ee.CancelEvent.type,{...e})}};ee.FileUploadClickEvent=class extends CustomEvent{static type="mw:file-upload-click";constructor(e={}){super(ee.FileUploadClickEvent.type,{...e})}};ee.FileDeleteEvent=class extends CustomEvent{static type="mw:file-delete";constructor(e,r={}){super(ee.FileDeleteEvent.type,{detail:e,...r})}};function xu(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",ee);function la({delay:t},e){let r=!0,i;return Object.assign((...n)=>{r?(clearTimeout(i),i=setTimeout(()=>{r&&e(...n),i=void 0},t)):e(...n)},{isPending:()=>i!==void 0,cancel:()=>{r=!1},flush:(...n)=>e(...n)})}var xn=class{#e;constructor(e,{delay:r},i){this.#e=la({delay:r},i),e.addController(this)}get call(){return this.#e}hostDisconnected(){this.#e.cancel()}};function ca(t,e,r){return new xn(t,e,r)}function da(t){let e=Math.floor(t/3600);t=t%3600;let r=Math.floor(t/60);return t=Math.floor(t%60),e>0?r>0?`${ua(e)} hr ${r} min`:`${ua(e)} hr`:r>0?t>0?`${r} min ${t} sec`:`${r} min`:`${t} sec`}function pa(t,e="en-US"){let r=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(t);return`${t.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${r}`}function ua(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}var kn=class extends w(v){static properties={content:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},expanded:{type:Boolean,state:!0},_inProgress:{type:Boolean,state:!0}};static styles=O`
|
|
392
392
|
@keyframes ellipsis {
|
|
393
393
|
0% {
|
|
394
394
|
content: '';
|
|
@@ -408,10 +408,10 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
408
408
|
content: '';
|
|
409
409
|
animation: ellipsis 1.5s infinite;
|
|
410
410
|
}
|
|
411
|
-
`;#e=ca(this,{delay:1200},()=>{this._inProgress=!1,this.#t&&(this.#r=Date.now()),this.requestUpdate()});#t=null;#r=null;constructor(){super(),this.content="",this.darkMode=!1,this.expanded=!1,this._inProgress=!1}getStreamDuration(){return this.#t?Date.now()-this.#t:null}#n(){if(!this.#t||!this.#r)return null;let e=this.#r-this.#t,r=Math.round(e/1e3);return Math.max(1,r)}#i(){if(this._inProgress)return"Thinking";let e=this.#n();return e?`Thought for ${da(e)}`:"Thought"}updated(e){e.has("content")&&(!this.#t&&this.content&&(this.#t=Date.now()),this._inProgress=!0,this.#e.call())}#
|
|
411
|
+
`;#e=ca(this,{delay:1200},()=>{this._inProgress=!1,this.#t&&(this.#r=Date.now()),this.requestUpdate()});#t=null;#r=null;constructor(){super(),this.content="",this.darkMode=!1,this.expanded=!1,this._inProgress=!1}getStreamDuration(){return this.#t?Date.now()-this.#t:null}#n(){if(!this.#t||!this.#r)return null;let e=this.#r-this.#t,r=Math.round(e/1e3);return Math.max(1,r)}#i(){if(this._inProgress)return"Thinking";let e=this.#n();return e?`Thought for ${da(e)}`:"Thought"}updated(e){e.has("content")&&(!this.#t&&this.content&&(this.#t=Date.now()),this._inProgress=!0,this.#e.call())}#s=()=>{this.expanded=!this.expanded};render(){return u`
|
|
412
412
|
<div class="${this.darkMode?"dark":""} w-full">
|
|
413
413
|
<button
|
|
414
|
-
@click="${this.#
|
|
414
|
+
@click="${this.#s}"
|
|
415
415
|
class="flex items-center gap-1.5 text-left text-xs text-gray-500 transition-colors hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"
|
|
416
416
|
type="button">
|
|
417
417
|
<mw-icon class="${this.expanded?"rotate-90":""} h-3 w-3 shrink-0 transition-transform" name="lucide:chevron-right"></mw-icon>
|
|
@@ -460,11 +460,11 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
460
460
|
</div>
|
|
461
461
|
</div>
|
|
462
462
|
</div>
|
|
463
|
-
`;default:throw new Error(`Unknown side: ${this.side}`)}}};customElements.get("mw-chat-message")||customElements.define("mw-chat-message",_n);function ha(t){return e=>{let i=(t?Math[t]:Math.trunc)(e);return i===0?0:i}}var ku=Math.pow(10,8)*24*60*60*1e3,Km=-ku;var _u=3600;var fa=_u*24,Ym=fa*7,Cu=fa*365.2425
|
|
463
|
+
`;default:throw new Error(`Unknown side: ${this.side}`)}}};customElements.get("mw-chat-message")||customElements.define("mw-chat-message",_n);function ha(t){return e=>{let i=(t?Math[t]:Math.trunc)(e);return i===0?0:i}}var ku=Math.pow(10,8)*24*60*60*1e3,Km=-ku;var _u=3600;var fa=_u*24,Ym=fa*7,Cu=fa*365.2425,Eu=Cu/12,Qm=Eu*3,Cn=Symbol.for("constructDateFrom");function ma(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Cn in t?t[Cn](e):t instanceof Date?new t.constructor(e):new Date(e)}function En(t,e){return ma(e||t,t)}function ga(t,e){return+En(t)-+En(e)}function $n(t,e,r){let i=ga(t,e)/1e3;return ha(r?.roundingMethod)(i)}var Sn=class extends w(v){static properties={question:{type:String},options:{type:Array},heading:{type:String},gameTitle:{type:String},resultPrefix:{type:String},correctButtonText:{type:String},wrongButtonText:{type:String},color:{type:String},apiBaseUrl:{type:String},cdnBaseUrl:{type:String},minutes:{type:String},seconds:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},_currentQuestion:{type:String,state:!0},_questionHistory:{type:Array,state:!0},_guessedJob:{type:String,state:!0},_isLoadingNextQuestion:{type:Boolean,state:!0},_loadingAnswer:{type:String,state:!0},_guessValidated:{type:Boolean,state:!0},_validatingButton:{type:String,state:!0},_currentAttemptQuestionCount:{type:Number,state:!0}};static styles=O`
|
|
464
464
|
:host {
|
|
465
465
|
display: block;
|
|
466
466
|
}
|
|
467
|
-
`;#e=7;constructor(){super(),this.question="",this.options=["No","Yes"],this.heading="",this.gameTitle="",this.resultPrefix="",this.correctButtonText="Correct",this.wrongButtonText="Wrong",this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.minutes="00",this.seconds="00",this.darkMode=!1,this._currentQuestion="",this._questionHistory=[],this._guessedJob="",this._isLoadingNextQuestion=!1,this._loadingAnswer="",this._guessValidated=!1,this._validatingButton="",this._currentAttemptQuestionCount=0}firstUpdated(){this._currentQuestion=this.question}async#t(){if(!this.apiBaseUrl)return console.warn("API base URL not configured, cannot fetch next question"),null;this._isLoadingNextQuestion=!0;try{let e=await fetch(`${this.apiBaseUrl}/preview/wait-game/next-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({questionAnswers:this._questionHistory,takeGuess:this._currentAttemptQuestionCount>=this.#e})});return e.ok?await e.json():(console.error("failed to fetch next question",e.status),null)}catch(e){return console.error("error fetching next question",e),null}finally{this._isLoadingNextQuestion=!1}}#r=async e=>{this._loadingAnswer=e,this._questionHistory.push({question:this._currentQuestion,answer:e}),this._currentAttemptQuestionCount++,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:question-answered",{bubbles:!0,composed:!0,detail:{questionIndex:this._questionHistory.length-1,question:this._currentQuestion,answer:e,totalQuestions:this.#e,allAnswers:this._questionHistory.map(i=>i.answer)}}));let r=await this.#t();r&&(r.isComplete&&r.guessedJob?(this._guessedJob=r.guessedJob,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:game-completed",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(i=>i.answer)}}))):r.nextQuestion&&(this._currentQuestion=r.nextQuestion)),this._loadingAnswer=""};#n=async e=>{if(this._validatingButton=e?"correct":"wrong",this.dispatchEvent(new CustomEvent("mw-chat-wait-game:guess-validated",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,isCorrect:e,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(r=>r.answer)}})),e)this._guessValidated=!0,this._validatingButton="";else{let r=await this.#t();r?.nextQuestion&&(this._currentQuestion=r.nextQuestion),this._guessedJob="",this._currentAttemptQuestionCount=0,this._validatingButton=""}};#i(){return Math.round(this._currentAttemptQuestionCount/this.#e*100)}#
|
|
467
|
+
`;#e=7;constructor(){super(),this.question="",this.options=["No","Yes"],this.heading="",this.gameTitle="",this.resultPrefix="",this.correctButtonText="Correct",this.wrongButtonText="Wrong",this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.minutes="00",this.seconds="00",this.darkMode=!1,this._currentQuestion="",this._questionHistory=[],this._guessedJob="",this._isLoadingNextQuestion=!1,this._loadingAnswer="",this._guessValidated=!1,this._validatingButton="",this._currentAttemptQuestionCount=0}firstUpdated(){this._currentQuestion=this.question}async#t(){if(!this.apiBaseUrl)return console.warn("API base URL not configured, cannot fetch next question"),null;this._isLoadingNextQuestion=!0;try{let e=await fetch(`${this.apiBaseUrl}/preview/wait-game/next-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({questionAnswers:this._questionHistory,takeGuess:this._currentAttemptQuestionCount>=this.#e})});return e.ok?await e.json():(console.error("failed to fetch next question",e.status),null)}catch(e){return console.error("error fetching next question",e),null}finally{this._isLoadingNextQuestion=!1}}#r=async e=>{this._loadingAnswer=e,this._questionHistory.push({question:this._currentQuestion,answer:e}),this._currentAttemptQuestionCount++,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:question-answered",{bubbles:!0,composed:!0,detail:{questionIndex:this._questionHistory.length-1,question:this._currentQuestion,answer:e,totalQuestions:this.#e,allAnswers:this._questionHistory.map(i=>i.answer)}}));let r=await this.#t();r&&(r.isComplete&&r.guessedJob?(this._guessedJob=r.guessedJob,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:game-completed",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(i=>i.answer)}}))):r.nextQuestion&&(this._currentQuestion=r.nextQuestion)),this._loadingAnswer=""};#n=async e=>{if(this._validatingButton=e?"correct":"wrong",this.dispatchEvent(new CustomEvent("mw-chat-wait-game:guess-validated",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,isCorrect:e,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(r=>r.answer)}})),e)this._guessValidated=!0,this._validatingButton="";else{let r=await this.#t();r?.nextQuestion&&(this._currentQuestion=r.nextQuestion),this._guessedJob="",this._currentAttemptQuestionCount=0,this._validatingButton=""}};#i(){return Math.round(this._currentAttemptQuestionCount/this.#e*100)}#s(){let e=new URL("/assets/career-ladder.png",this.cdnBaseUrl||"https://widget.molin.ai");return u`
|
|
468
468
|
<div class="mt-3 flex items-center justify-center gap-1">
|
|
469
469
|
<span class="text-[11px] text-black/40 dark:text-gray-500">Inspired by</span>
|
|
470
470
|
<img src="${e.href}" alt="Career Ladder" class="h-6" />
|
|
@@ -506,7 +506,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
506
506
|
<div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: 100%"></div>
|
|
507
507
|
</div>
|
|
508
508
|
`}
|
|
509
|
-
${this.#
|
|
509
|
+
${this.#s()}
|
|
510
510
|
</div>
|
|
511
511
|
`:this._currentQuestion?u`
|
|
512
512
|
<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">
|
|
@@ -542,13 +542,13 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
542
542
|
<div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: ${e}%"></div>
|
|
543
543
|
</div>
|
|
544
544
|
|
|
545
|
-
${this.#
|
|
545
|
+
${this.#s()}
|
|
546
546
|
</div>
|
|
547
547
|
`:u`<p class="text-sm text-black italic dark:text-white">There was a problem loading the game, please refresh the page.</p>`}};customElements.get("mw-chat-wait-game")||customElements.define("mw-chat-wait-game",Sn);var In=class extends w(v){static styles=O`
|
|
548
548
|
:host {
|
|
549
549
|
display: block;
|
|
550
550
|
}
|
|
551
|
-
`;static properties={data:{type:Object},color:{type:String},apiBaseUrl:{type:String},cdnBaseUrl:{type:String},soundUrl:{type:String,attribute:"sound"},darkMode:{type:Boolean,attribute:"dark-mode"},_remainingSeconds:{type:Number,state:!0},_isComplete:{type:Boolean,state:!0},_showGame:{type:Boolean,state:!0}};#e=null;#t=null;#r=0;constructor(){super(),this.data,this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.soundUrl="",this.darkMode=!1,this._remainingSeconds=480,this._isComplete=!1,this._showGame=!1}connectedCallback(){super.connectedCallback(),this.#n(),this.#
|
|
551
|
+
`;static properties={data:{type:Object},color:{type:String},apiBaseUrl:{type:String},cdnBaseUrl:{type:String},soundUrl:{type:String,attribute:"sound"},darkMode:{type:Boolean,attribute:"dark-mode"},_remainingSeconds:{type:Number,state:!0},_isComplete:{type:Boolean,state:!0},_showGame:{type:Boolean,state:!0}};#e=null;#t=null;#r=0;constructor(){super(),this.data,this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.soundUrl="",this.darkMode=!1,this._remainingSeconds=480,this._isComplete=!1,this._showGame=!1}connectedCallback(){super.connectedCallback(),this.#n(),this.#s()}disconnectedCallback(){super.disconnectedCallback(),this.#o()}#n(){this.data?.expected_join_time?this.#t=new Date(this.data.expected_join_time):this.#t=new Date(Date.now()+this._remainingSeconds*1e3),this.#r=Math.max($n(this.#t,new Date),0),this.#i()}#i(){if(this.#t===null)return;let e=new Date,r=$n(this.#t,e);r>=0?(this._remainingSeconds=r,this._isComplete=!1):(this._remainingSeconds=Math.abs(r),this._isComplete=!0)}#s(){this.#o(),this.#e=setInterval(()=>{this.#i()},1e3)}#o(){this.#e!==null&&(clearInterval(this.#e),this.#e=null)}#a=()=>{this.#d(),this._showGame=!0,this.dispatchEvent(new CustomEvent("mw-chat-wait-timer:game-click",{bubbles:!0,composed:!0}))};#l(){if(!this.data?.game_first_question)return!1;try{return localStorage.getItem("_molin_timer_sound_question")===this.data.game_first_question}catch{return!1}}#c(){if(this.data?.game_first_question)try{localStorage.setItem("_molin_timer_sound_question",this.data.game_first_question)}catch(e){console.error("Error saving sound state to localStorage:",e,{})}}#d(){if(!this.soundUrl||!this.data?.game_first_question||this.#l())return;let e=new Audio(this.soundUrl);e.volume=.5,e.play().then(()=>{this.#c()}).catch(r=>{console.error("Error playing audio:",r,{})})}#u(){let e=Math.floor(this._remainingSeconds/60),r=this._remainingSeconds%60,i=n=>String(n).padStart(2,"0");return{minutes:i(e),seconds:i(r)}}#p(){return this._isComplete?0:this.#t===null||this.#r===0?100:Math.round(this._remainingSeconds/this.#r*100)}render(){let{minutes:e,seconds:r}=this.#u();if(this._showGame)return u`
|
|
552
552
|
<mw-chat-wait-game
|
|
553
553
|
.question="${this.data?.game_first_question}"
|
|
554
554
|
.options="${[this.data?.game_button_answer_negative||"No",this.data?.game_button_answer_affirmative||"Yes"]}"
|
|
@@ -585,7 +585,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
585
585
|
</button>
|
|
586
586
|
</div>
|
|
587
587
|
</div>
|
|
588
|
-
`}};customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",In);var An=class{#e=[];#t=[];#r=[];constructor(e){e.addController(this)}hostDisconnected(){this.clearTimeouts(),this.clearIntervals(),this.clearAnimationFrames()}clearTimeouts(){this.#e.forEach(clearTimeout),this.#e=[]}clearIntervals(){this.#t.forEach(clearInterval),this.#t=[]}clearAnimationFrames(){this.#r.forEach(cancelAnimationFrame),this.#r=[]}setTimeout(e,r,...i){let n=setTimeout(e,r,...i);return this.#e.push(n),n}setInterval(e,r,...i){let n=setInterval(e,r,...i);return this.#t.push(n),n}requestAnimationFrame(e){let r=requestAnimationFrame(e);return this.#r.push(r),r}};function
|
|
588
|
+
`}};customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",In);var An=class{#e=[];#t=[];#r=[];constructor(e){e.addController(this)}hostDisconnected(){this.clearTimeouts(),this.clearIntervals(),this.clearAnimationFrames()}clearTimeouts(){this.#e.forEach(clearTimeout),this.#e=[]}clearIntervals(){this.#t.forEach(clearInterval),this.#t=[]}clearAnimationFrames(){this.#r.forEach(cancelAnimationFrame),this.#r=[]}setTimeout(e,r,...i){let n=setTimeout(e,r,...i);return this.#e.push(n),n}setInterval(e,r,...i){let n=setInterval(e,r,...i);return this.#t.push(n),n}requestAnimationFrame(e){let r=requestAnimationFrame(e);return this.#r.push(r),r}};function Se(t){return new An(t)}var be=class extends w(v){static properties={src:{type:String},alt:{type:String},side:{type:String},position:{type:String},width:{type:String},height:{type:String},clickable:{type:Boolean}};constructor(){super(),this.src="",this.alt="",this.side="right",this.position="single",this.width="300px",this.height="auto",this.clickable=!1}#e=Se(this);#t=!1;#r=!1;#n=!1;#i=!1;updated(e){e.has("src")&&(this.#t=!1,this.#r=!1)}#s(){document.addEventListener("keydown",this.#a)}#o(){document.removeEventListener("keydown",this.#a)}#a=e=>{e.key==="Escape"&&this.#f(e)};get#l(){return this.side==="left"||this.side==="assistant"?"flex justify-start ml-[25px]":"flex justify-end"}get#c(){let e="inline-block overflow-hidden shadow-sm";if(this.side==="right"||this.side==="user")switch(this.position){case"first":e+=" rounded-2xl rounded-br-[4px]";break;case"middle":e+=" rounded-2xl rounded-r-[4px]";break;case"last":case"last-current":e+=" rounded-2xl rounded-tr-[4px]";break;default:e+=" rounded-2xl";break}else switch(this.position){case"first":e+=" rounded-2xl rounded-bl-[4px]";break;case"middle":e+=" rounded-2xl rounded-l-[4px]";break;case"last":case"last-current":e+=" rounded-2xl rounded-tl-[4px]";break;default:e+=" rounded-2xl";break}return e}#d(){if(!this.src)return"";try{let e=new URL(this.src);return e.searchParams.set("for","full"),e.href}catch{return this.src}}render(){return this.src?u`
|
|
589
589
|
<div class="${this.#l} mb-2 min-h-[100px]">
|
|
590
590
|
<div class="${this.#c} relative">
|
|
591
591
|
<!-- Placeholder background that's only shown when loading or error -->
|
|
@@ -637,7 +637,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
637
637
|
</div>
|
|
638
638
|
</div>
|
|
639
639
|
`:null}
|
|
640
|
-
`:(console.warn("MwChatImage: No src provided"),null)}#u=e=>{console.error("Failed to load chat image:",this.src),this.#r=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:e},bubbles:!0}))};#p=e=>{this.#t=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:e},bubbles:!0}))};#v=e=>{this.clickable&&(e.preventDefault(),e.stopPropagation(),this.#n=!0,this.#
|
|
640
|
+
`:(console.warn("MwChatImage: No src provided"),null)}#u=e=>{console.error("Failed to load chat image:",this.src),this.#r=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:e},bubbles:!0}))};#p=e=>{this.#t=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:e},bubbles:!0}))};#v=e=>{this.clickable&&(e.preventDefault(),e.stopPropagation(),this.#n=!0,this.#s(),this.requestUpdate(),this.#i=!0,this.requestUpdate(),this.#e.setTimeout(()=>{this.#i=!1,this.requestUpdate()},500),this.dispatchEvent(new CustomEvent("mw-chat-image:click",{detail:{src:this.src,event:e},bubbles:!0})))};#f=e=>{e.preventDefault(),e.stopPropagation(),this.#o(),this.#n=!1,this.requestUpdate()};#g=e=>{e.preventDefault(),e.stopPropagation()}};be.ErrorEvent=class extends CustomEvent{static type="mw-chat-image:error";constructor(e,r={}){super(be.ErrorEvent.type,{detail:e,...r})}};be.LoadEvent=class extends CustomEvent{static type="mw-chat-image:load";constructor(e,r={}){super(be.LoadEvent.type,{detail:e,...r})}};be.ClickEvent=class extends CustomEvent{static type="mw-chat-image:click";constructor(e,r={}){super(be.ClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-image")||customElements.define("mw-chat-image",be);var N=t=>t??U;var $u=["javascript:","data:text/html","vbscript:","data:text/javascript","data:text/vbscript","data:text/css","data:text/plain","data:text/xml"],Lt=class t extends w(v){static properties={text:{type:String},color:{type:String},dismissible:{type:Boolean},ephemeral:{type:Boolean},darkMode:{type:Boolean,attribute:"dark-mode"},_dismissed:{type:Boolean,state:!0}};constructor(){super(),this.text="By chatting with us, you agree to the monitoring and recording of this chat to deliver our services and processing of your personal data in accordance with our [Privacy Policy](https://docs.molin.ai/legal/privacy-policy).",this.color="#3b82f6",this.dismissible=!1,this.ephemeral=!1,this.darkMode=!1,this._dismissed=!1}connectedCallback(){super.connectedCallback(),this.dismissible&&(this._dismissed=this.#e())}#e(){return this.ephemeral?!1:j().disclaimerDismissed}#t(){this.ephemeral||(j().disclaimerDismissed=!0)}#r=e=>{e.preventDefault(),this._dismissed=!0,this.#t(),this.dispatchEvent(new t.DismissEvent)};#n(e){let i=/\[([^\]]+)\]\(([^)]+)\)/g.exec(e);if(i){let n=i[0],s=i[1],o=i[2],a=i.index;return $u.some(l=>o.toLowerCase().startsWith(l))||!o||!s?e:u`${e.slice(0,a)}<a href="${N(o)}" target="_blank" rel="noopener noreferrer" @click="${this.#i}" class="underline" style="color: ${this.color}"
|
|
641
641
|
>${s}</a
|
|
642
642
|
>${e.slice(a+n.length)}`}return e}#i=e=>{e.stopPropagation()};render(){if(this._dismissed)return null;let e=this.#n(this.text);return u`
|
|
643
643
|
<div class="${this.darkMode?"dark":""} flex items-center justify-between">
|
|
@@ -655,7 +655,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
655
655
|
</button>
|
|
656
656
|
`:null}
|
|
657
657
|
</div>
|
|
658
|
-
`}};Lt.DismissEvent=class extends CustomEvent{static type="mw-disclaimer:dismiss";constructor(e={}){super(Lt.DismissEvent.type,{...e})}};customElements.get("mw-disclaimer")||customElements.define("mw-disclaimer",Lt);var Tn=class extends w(v){static properties={text:{type:String},variant:{type:String},autoDismissable:{type:Boolean,attribute:"auto-dismissable"},dismissDelay:{type:Number,attribute:"dismiss-delay"},_isVisible:{type:Boolean,state:!0}};constructor(){super(),this.text="I'm still learning!",this.variant="info",this.autoDismissable=!1,this.dismissDelay=5e3,this._isVisible=!0}#e=
|
|
658
|
+
`}};Lt.DismissEvent=class extends CustomEvent{static type="mw-disclaimer:dismiss";constructor(e={}){super(Lt.DismissEvent.type,{...e})}};customElements.get("mw-disclaimer")||customElements.define("mw-disclaimer",Lt);var Tn=class extends w(v){static properties={text:{type:String},variant:{type:String},autoDismissable:{type:Boolean,attribute:"auto-dismissable"},dismissDelay:{type:Number,attribute:"dismiss-delay"},_isVisible:{type:Boolean,state:!0}};constructor(){super(),this.text="I'm still learning!",this.variant="info",this.autoDismissable=!1,this.dismissDelay=5e3,this._isVisible=!0}#e=Se(this);connectedCallback(){super.connectedCallback(),this.autoDismissable&&this.#t()}#t(){this.#e.setTimeout(()=>{this._isVisible=!1,this.requestUpdate()},this.dismissDelay)}#r(){switch(this.variant){case"error":return{bg:"bg-red-600",text:"text-white",icon:"badge-alert"};case"warning":return{bg:"bg-yellow-600",text:"text-white",icon:"alert-triangle"};case"success":return{bg:"bg-green-600",text:"text-white",icon:"check-circle"};default:return{bg:"bg-black",text:"text-white",icon:"info"}}}render(){let e=this.#r();return u`
|
|
659
659
|
<div
|
|
660
660
|
class="${this._isVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-[50px] pointer-events-none mt-[-40px]"} flex justify-center transition-all transition-discrete duration-[1s] ease-in-out">
|
|
661
661
|
<div class="${e.bg} mb-2 flex max-w-[70%] items-center justify-center rounded-full px-3 py-2 select-none">
|
|
@@ -894,7 +894,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
894
894
|
`:null}
|
|
895
895
|
</div>
|
|
896
896
|
</div>
|
|
897
|
-
`}};customElements.get("mw-order-card")||customElements.define("mw-order-card",On);function jr(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}var Rr=function(){},ut=function(){};var jt=(t,e,r)=>Math.min(Math.max(r,t),e);var Pn=.001,Iu=.01,ya=10,Au=.05,Tu=1;function ba({duration:t=800,bounce:e=.25,velocity:r=0,mass:i=1}){let n,s;Rr(t<=ya*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=jt(Au,Tu,o),t=jt(Iu,ya,t/1e3),o<1?(n=c=>{let d=c*o,p=d*t,h=d-r,y=Fr(c,o),f=Math.exp(-p);return Pn-h/y*f},s=c=>{let p=c*o*t,h=p*r+r,y=Math.pow(o,2)*Math.pow(c,2)*t,f=Math.exp(-p),E=Fr(Math.pow(c,2),o);return(-n(c)+Pn>0?-1:1)*((h-y)*f)/E}):(n=c=>{let d=Math.exp(-c*t),p=(c-r)*t+1;return-Pn+d*p},s=c=>{let d=Math.exp(-c*t),p=(r-c)*(t*t);return d*p});let a=5/t,l=Mu(n,s,a);if(t=t*1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{let c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:t}}}var Du=12;function Mu(t,e,r){let i=r;for(let n=1;n<Du;n++)i=i-t(i)/e(i);return i}function Fr(t,e){return t*Math.sqrt(1-e*e)}var Ou=["duration","bounce"],Pu=["stiffness","damping","mass"];function va(t,e){return e.some(r=>t[r]!==void 0)}function Uu(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!va(t,Pu)&&va(t,Ou)){let r=ba(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function qr(t){var{from:e=0,to:r=1,restSpeed:i=2,restDelta:n}=t,s=jr(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:a,damping:l,mass:c,velocity:d,duration:p,isResolvedFromDuration:h}=Uu(s),y=wa,f=wa;function E(){let x=d?-(d/1e3):0,$=r-e,b=l/(2*Math.sqrt(a*c)),k=Math.sqrt(a/c)/1e3;if(n===void 0&&(n=Math.min(Math.abs(r-e)/100,.4)),b<1){let S=Fr(k,b);y=P=>{let R=Math.exp(-b*k*P);return r-R*((x+b*k*$)/S*Math.sin(S*P)+$*Math.cos(S*P))},f=P=>{let R=Math.exp(-b*k*P);return b*k*R*(Math.sin(S*P)*(x+b*k*$)/S+$*Math.cos(S*P))-R*(Math.cos(S*P)*(x+b*k*$)-S*$*Math.sin(S*P))}}else if(b===1)y=S=>r-Math.exp(-k*S)*($+(x+k*$)*S);else{let S=k*Math.sqrt(b*b-1);y=P=>{let R=Math.exp(-b*k*P),z=Math.min(S*P,300);return r-R*((x+b*k*$)*Math.sinh(z)+S*$*Math.cosh(z))/S}}}return E(),{next:x=>{let $=y(x);if(h)o.done=x>=p;else{let b=f(x)*1e3,k=Math.abs(b)<=i,S=Math.abs(r-$)<=n;o.done=k&&S}return o.value=o.done?r:$,o},flipTarget:()=>{d=-d,[e,r]=[r,e],E()}}}qr.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var wa=t=>0;var Un=(t,e,r)=>{let i=e-t;return i===0?1:(r-t)/i};var dt=(t,e,r)=>-r*t+r*e+t;var Br=(t,e)=>r=>Math.max(Math.min(r,e),t),Se=t=>t%1?Number(t.toFixed(5)):t,pt=/(-)?([\d]*\.?[\d])+/g,Nr=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,xa=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function ve(t){return typeof t=="string"}var ht={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},zr=Object.assign(Object.assign({},ht),{transform:Br(0,1)}),x0=Object.assign(Object.assign({},ht),{default:1});var Rt=t=>({test:e=>ve(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),C0=Rt("deg"),ft=Rt("%"),$0=Rt("px"),E0=Rt("vh"),S0=Rt("vw"),I0=Object.assign(Object.assign({},ft),{parse:t=>ft.parse(t)/100,transform:t=>ft.transform(t*100)});var mt=(t,e)=>r=>!!(ve(r)&&xa.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Wr=(t,e,r)=>i=>{if(!ve(i))return i;let[n,s,o,a]=i.match(pt);return{[t]:parseFloat(n),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var pe={test:mt("hsl","hue"),parse:Wr("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:i=1})=>"hsla("+Math.round(t)+", "+ft.transform(Se(e))+", "+ft.transform(Se(r))+", "+Se(zr.transform(i))+")"};var Lu=Br(0,255),Vr=Object.assign(Object.assign({},ht),{transform:t=>Math.round(Lu(t))}),ie={test:mt("rgb","red"),parse:Wr("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:i=1})=>"rgba("+Vr.transform(t)+", "+Vr.transform(e)+", "+Vr.transform(r)+", "+Se(zr.transform(i))+")"};function ju(t){let e="",r="",i="",n="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),i=t.substr(5,2),n=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),i=t.substr(3,1),n=t.substr(4,1),e+=e,r+=r,i+=i,n+=n),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(i,16),alpha:n?parseInt(n,16)/255:1}}var gt={test:mt("#"),parse:ju,transform:ie.transform};var Ie={test:t=>ie.test(t)||gt.test(t)||pe.test(t),parse:t=>ie.test(t)?ie.parse(t):pe.test(t)?pe.parse(t):gt.parse(t),transform:t=>ve(t)?t:t.hasOwnProperty("red")?ie.transform(t):pe.transform(t)};var ka="${c}",_a="${n}";function Ru(t){var e,r,i,n;return isNaN(t)&&ve(t)&&((r=(e=t.match(pt))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((n=(i=t.match(Nr))===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0)>0}function Ca(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,i=t.match(Nr);i&&(r=i.length,t=t.replace(Nr,ka),e.push(...i.map(Ie.parse)));let n=t.match(pt);return n&&(t=t.replace(pt,_a),e.push(...n.map(ht.parse))),{values:e,numColors:r,tokenised:t}}function $a(t){return Ca(t).values}function Ea(t){let{values:e,numColors:r,tokenised:i}=Ca(t),n=e.length;return s=>{let o=i;for(let a=0;a<n;a++)o=o.replace(a<r?ka:_a,a<r?Ie.transform(s[a]):Se(s[a]));return o}}var Fu=t=>typeof t=="number"?0:t;function qu(t){let e=$a(t);return Ea(t)(e.map(Fu))}var Hr={test:Ru,parse:$a,createTransformer:Ea,getAnimatableNone:qu};function Ln(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function jn({hue:t,saturation:e,lightness:r,alpha:i}){t/=360,e/=100,r/=100;let n=0,s=0,o=0;if(!e)n=s=o=r;else{let a=r<.5?r*(1+e):r+e-r*e,l=2*r-a;n=Ln(l,a,t+1/3),s=Ln(l,a,t),o=Ln(l,a,t-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}var Bu=(t,e,r)=>{let i=t*t,n=e*e;return Math.sqrt(Math.max(0,r*(n-i)+i))},Nu=[gt,ie,pe],Sa=t=>Nu.find(e=>e.test(t)),Ia=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,Gr=(t,e)=>{let r=Sa(t),i=Sa(e);ut(!!r,Ia(t)),ut(!!i,Ia(e));let n=r.parse(t),s=i.parse(e);r===pe&&(n=jn(n),r=ie),i===pe&&(s=jn(s),i=ie);let o=Object.assign({},n);return a=>{for(let l in o)l!=="alpha"&&(o[l]=Bu(n[l],s[l],a));return o.alpha=dt(n.alpha,s.alpha,a),r.transform(o)}};var Aa=t=>typeof t=="number";var zu=(t,e)=>r=>e(t(r)),Xr=(...t)=>t.reduce(zu);function Da(t,e){return Aa(t)?r=>dt(t,e,r):Ie.test(t)?Gr(t,e):Fn(t,e)}var Rn=(t,e)=>{let r=[...t],i=r.length,n=t.map((s,o)=>Da(s,e[o]));return s=>{for(let o=0;o<i;o++)r[o]=n[o](s);return r}},Ma=(t,e)=>{let r=Object.assign(Object.assign({},t),e),i={};for(let n in r)t[n]!==void 0&&e[n]!==void 0&&(i[n]=Da(t[n],e[n]));return n=>{for(let s in i)r[s]=i[s](n);return r}};function Ta(t){let e=Hr.parse(t),r=e.length,i=0,n=0,s=0;for(let o=0;o<r;o++)i||typeof e[o]=="number"?i++:e[o].hue!==void 0?s++:n++;return{parsed:e,numNumbers:i,numRGB:n,numHSL:s}}var Fn=(t,e)=>{let r=Hr.createTransformer(e),i=Ta(t),n=Ta(e);return i.numHSL===n.numHSL&&i.numRGB===n.numRGB&&i.numNumbers>=n.numNumbers?Xr(Rn(i.parsed,n.parsed),r):(Rr(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),o=>`${o>0?e:t}`)};var Wu=(t,e)=>r=>dt(t,e,r);function Vu(t){if(typeof t=="number")return Wu;if(typeof t=="string")return Ie.test(t)?Gr:Fn;if(Array.isArray(t))return Rn;if(typeof t=="object")return Ma}function Hu(t,e,r){let i=[],n=r||Vu(t[0]),s=t.length-1;for(let o=0;o<s;o++){let a=n(t[o],t[o+1]);if(e){let l=Array.isArray(e)?e[o]:e;a=Xr(l,a)}i.push(a)}return i}function Gu([t,e],[r]){return i=>r(Un(t,e,i))}function Xu(t,e){let r=t.length,i=r-1;return n=>{let s=0,o=!1;if(n<=t[0]?o=!0:n>=t[i]&&(s=i-1,o=!0),!o){let l=1;for(;l<r&&!(t[l]>n||l===i);l++);s=l-1}let a=Un(t[s],t[s+1],n);return e[s](a)}}function Jr(t,e,{clamp:r=!0,ease:i,mixer:n}={}){let s=t.length;ut(s===e.length,"Both input and output ranges must be the same length"),ut(!i||!Array.isArray(i)||i.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());let o=Hu(e,i,n),a=s===2?Gu(t,o):Xu(t,o);return r?l=>a(jt(t[0],t[s-1],l)):a}var Ft=t=>e=>1-t(1-e),Kr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Oa=t=>e=>Math.pow(e,t),qn=t=>e=>e*e*((t+1)*e-t),Pa=t=>{let e=qn(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var Ua=1.525,Ju=4/11,Ku=8/11,Yu=9/10;var La=Oa(2),Dy=Ft(La),ja=Kr(La),Qu=t=>1-Math.sin(Math.acos(t)),Zu=Ft(Qu),My=Kr(Zu),Ra=qn(Ua),Oy=Ft(Ra),Py=Kr(Ra),Uy=Pa(Ua),ed=4356/361,td=35442/1805,rd=16061/1805,id=t=>{if(t===1||t===0)return t;let e=t*t;return t<Ju?7.5625*e:t<Ku?9.075*e-9.9*t+3.4:t<Yu?ed*e-td*t+rd:10.8*t*t-20.52*t+10.72},Ly=Ft(id);function nd(t,e){return t.map(()=>e||ja).splice(0,t.length-1)}function sd(t){let e=t.length;return t.map((r,i)=>i!==0?i/(e-1):0)}function od(t,e){return t.map(r=>r*e)}function qt({from:t=0,to:e=1,ease:r,offset:i,duration:n=300}){let s={done:!1,value:t},o=Array.isArray(e)?e:[t,e],a=od(i&&i.length===o.length?i:sd(o),n);function l(){return Jr(a,o,{ease:Array.isArray(r)?r:nd(o,r)})}let c=l();return{next:d=>(s.value=c(d),s.done=d>=n,s),flipTarget:()=>{o.reverse(),c=l()}}}function Fa({velocity:t=0,from:e=0,power:r=.8,timeConstant:i=350,restDelta:n=.5,modifyTarget:s}){let o={done:!1,value:e},a=r*t,l=e+a,c=s===void 0?l:s(l);return c!==l&&(a=c-e),{next:d=>{let p=-a*Math.exp(-d/i);return o.done=!(p>n||p<-n),o.value=o.done?c:c+p,o},flipTarget:()=>{}}}var qa={keyframes:qt,spring:qr,decay:Fa};function Ba(t){if(Array.isArray(t.to))return qt;if(qa[t.type])return qa[t.type];let e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?qt:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?qr:qt}var Bn=16.666666666666668,ad=typeof performance<"u"?()=>performance.now():()=>Date.now(),Nn=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(ad()),Bn);function Na(t){let e=[],r=[],i=0,n=!1,s=!1,o=new WeakSet,a={schedule:(l,c=!1,d=!1)=>{let p=d&&n,h=p?e:r;return c&&o.add(l),h.indexOf(l)===-1&&(h.push(l),p&&n&&(i=e.length)),l},cancel:l=>{let c=r.indexOf(l);c!==-1&&r.splice(c,1),o.delete(l)},process:l=>{if(n){s=!0;return}if(n=!0,[e,r]=[r,e],r.length=0,i=e.length,i)for(let c=0;c<i;c++){let d=e[c];d(l),o.has(d)&&(a.schedule(d),t())}n=!1,s&&(s=!1,a.process(l))}};return a}var ld=40,zn=!0,Nt=!1,Wn=!1,Bt={delta:0,timestamp:0},zt=["read","update","preRender","render","postRender"],Yr=zt.reduce((t,e)=>(t[e]=Na(()=>Nt=!0),t),{}),cd=zt.reduce((t,e)=>{let r=Yr[e];return t[e]=(i,n=!1,s=!1)=>(Nt||dd(),r.schedule(i,n,s)),t},{}),za=zt.reduce((t,e)=>(t[e]=Yr[e].cancel,t),{}),Ky=zt.reduce((t,e)=>(t[e]=()=>Yr[e].process(Bt),t),{}),ud=t=>Yr[t].process(Bt),Wa=t=>{Nt=!1,Bt.delta=zn?Bn:Math.max(Math.min(t-Bt.timestamp,ld),1),Bt.timestamp=t,Wn=!0,zt.forEach(ud),Wn=!1,Nt&&(zn=!1,Nn(Wa))},dd=()=>{Nt=!0,zn=!0,Wn||Nn(Wa)};var Va=cd;function Vn(t,e,r=0){return t-e-r}function Ha(t,e,r=0,i=!0){return i?Vn(e+-t,e,r):e-(t-e)+r}function Ga(t,e,r,i){return i?t>=e+r:t<=-r}var pd=t=>{let e=({delta:r})=>t(r);return{start:()=>Va.update(e,!0),stop:()=>za.update(e)}};function Hn(t){var e,r,{from:i,autoplay:n=!0,driver:s=pd,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:d,onStop:p,onComplete:h,onRepeat:y,onUpdate:f}=t,E=jr(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:x}=E,$,b=0,k=E.duration,S,P=!1,R=!0,z,T=Ba(E);!((r=(e=T).needsInterpolation)===null||r===void 0)&&r.call(e,i,x)&&(z=Jr([0,100],[i,x],{clamp:!1}),i=0,x=100);let W=T(Object.assign(Object.assign({},E),{from:i,to:x}));function K(){b++,l==="reverse"?(R=b%2===0,o=Ha(o,k,c,R)):(o=Vn(o,k,c),l==="mirror"&&W.flipTarget()),P=!1,y&&y()}function di(){$.stop(),h&&h()}function Ae(L){if(R||(L=-L),o+=L,!P){let V=W.next(Math.max(0,o));S=V.value,z&&(S=z(S)),P=R?V.done:o<=0}f?.(S),P&&(b===0&&(k??(k=o)),b<a?Ga(o,k,c,R)&&K():di())}function Qt(){d?.(),$=s(Ae),$.start()}return n&&Qt(),{stop:()=>{p?.(),$.stop()}}}var Ne=class t extends w(v){static properties={product:{type:Object},labels:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}};constructor(){super(),this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this.darkMode=!1,this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(e){e.has("product")&&this.#e()}#e(){if(!this.product?.url){this._isValidUrl=!1;return}try{let e=new URL(this.product.url);this._isValidUrl=e.protocol==="http:"||e.protocol==="https:"}catch{this._isValidUrl=!1}}get images(){return this.product?.images||[]}render(){if(!this.product)return u`
|
|
897
|
+
`}};customElements.get("mw-order-card")||customElements.define("mw-order-card",On);function jr(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}var Rr=function(){},ut=function(){};var jt=(t,e,r)=>Math.min(Math.max(r,t),e);var Pn=.001,Iu=.01,ya=10,Au=.05,Tu=1;function ba({duration:t=800,bounce:e=.25,velocity:r=0,mass:i=1}){let n,s;Rr(t<=ya*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=jt(Au,Tu,o),t=jt(Iu,ya,t/1e3),o<1?(n=c=>{let d=c*o,p=d*t,h=d-r,y=Fr(c,o),f=Math.exp(-p);return Pn-h/y*f},s=c=>{let p=c*o*t,h=p*r+r,y=Math.pow(o,2)*Math.pow(c,2)*t,f=Math.exp(-p),$=Fr(Math.pow(c,2),o);return(-n(c)+Pn>0?-1:1)*((h-y)*f)/$}):(n=c=>{let d=Math.exp(-c*t),p=(c-r)*t+1;return-Pn+d*p},s=c=>{let d=Math.exp(-c*t),p=(r-c)*(t*t);return d*p});let a=5/t,l=Mu(n,s,a);if(t=t*1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{let c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:t}}}var Du=12;function Mu(t,e,r){let i=r;for(let n=1;n<Du;n++)i=i-t(i)/e(i);return i}function Fr(t,e){return t*Math.sqrt(1-e*e)}var Ou=["duration","bounce"],Pu=["stiffness","damping","mass"];function va(t,e){return e.some(r=>t[r]!==void 0)}function Uu(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!va(t,Pu)&&va(t,Ou)){let r=ba(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function qr(t){var{from:e=0,to:r=1,restSpeed:i=2,restDelta:n}=t,s=jr(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:a,damping:l,mass:c,velocity:d,duration:p,isResolvedFromDuration:h}=Uu(s),y=wa,f=wa;function $(){let x=d?-(d/1e3):0,E=r-e,b=l/(2*Math.sqrt(a*c)),k=Math.sqrt(a/c)/1e3;if(n===void 0&&(n=Math.min(Math.abs(r-e)/100,.4)),b<1){let S=Fr(k,b);y=P=>{let R=Math.exp(-b*k*P);return r-R*((x+b*k*E)/S*Math.sin(S*P)+E*Math.cos(S*P))},f=P=>{let R=Math.exp(-b*k*P);return b*k*R*(Math.sin(S*P)*(x+b*k*E)/S+E*Math.cos(S*P))-R*(Math.cos(S*P)*(x+b*k*E)-S*E*Math.sin(S*P))}}else if(b===1)y=S=>r-Math.exp(-k*S)*(E+(x+k*E)*S);else{let S=k*Math.sqrt(b*b-1);y=P=>{let R=Math.exp(-b*k*P),z=Math.min(S*P,300);return r-R*((x+b*k*E)*Math.sinh(z)+S*E*Math.cosh(z))/S}}}return $(),{next:x=>{let E=y(x);if(h)o.done=x>=p;else{let b=f(x)*1e3,k=Math.abs(b)<=i,S=Math.abs(r-E)<=n;o.done=k&&S}return o.value=o.done?r:E,o},flipTarget:()=>{d=-d,[e,r]=[r,e],$()}}}qr.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var wa=t=>0;var Un=(t,e,r)=>{let i=e-t;return i===0?1:(r-t)/i};var dt=(t,e,r)=>-r*t+r*e+t;var Br=(t,e)=>r=>Math.max(Math.min(r,e),t),Ie=t=>t%1?Number(t.toFixed(5)):t,pt=/(-)?([\d]*\.?[\d])+/g,Nr=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,xa=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function ve(t){return typeof t=="string"}var ht={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},zr=Object.assign(Object.assign({},ht),{transform:Br(0,1)}),x0=Object.assign(Object.assign({},ht),{default:1});var Rt=t=>({test:e=>ve(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),C0=Rt("deg"),ft=Rt("%"),E0=Rt("px"),$0=Rt("vh"),S0=Rt("vw"),I0=Object.assign(Object.assign({},ft),{parse:t=>ft.parse(t)/100,transform:t=>ft.transform(t*100)});var mt=(t,e)=>r=>!!(ve(r)&&xa.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Wr=(t,e,r)=>i=>{if(!ve(i))return i;let[n,s,o,a]=i.match(pt);return{[t]:parseFloat(n),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var pe={test:mt("hsl","hue"),parse:Wr("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:i=1})=>"hsla("+Math.round(t)+", "+ft.transform(Ie(e))+", "+ft.transform(Ie(r))+", "+Ie(zr.transform(i))+")"};var Lu=Br(0,255),Vr=Object.assign(Object.assign({},ht),{transform:t=>Math.round(Lu(t))}),ie={test:mt("rgb","red"),parse:Wr("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:i=1})=>"rgba("+Vr.transform(t)+", "+Vr.transform(e)+", "+Vr.transform(r)+", "+Ie(zr.transform(i))+")"};function ju(t){let e="",r="",i="",n="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),i=t.substr(5,2),n=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),i=t.substr(3,1),n=t.substr(4,1),e+=e,r+=r,i+=i,n+=n),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(i,16),alpha:n?parseInt(n,16)/255:1}}var gt={test:mt("#"),parse:ju,transform:ie.transform};var Ae={test:t=>ie.test(t)||gt.test(t)||pe.test(t),parse:t=>ie.test(t)?ie.parse(t):pe.test(t)?pe.parse(t):gt.parse(t),transform:t=>ve(t)?t:t.hasOwnProperty("red")?ie.transform(t):pe.transform(t)};var ka="${c}",_a="${n}";function Ru(t){var e,r,i,n;return isNaN(t)&&ve(t)&&((r=(e=t.match(pt))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((n=(i=t.match(Nr))===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0)>0}function Ca(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,i=t.match(Nr);i&&(r=i.length,t=t.replace(Nr,ka),e.push(...i.map(Ae.parse)));let n=t.match(pt);return n&&(t=t.replace(pt,_a),e.push(...n.map(ht.parse))),{values:e,numColors:r,tokenised:t}}function Ea(t){return Ca(t).values}function $a(t){let{values:e,numColors:r,tokenised:i}=Ca(t),n=e.length;return s=>{let o=i;for(let a=0;a<n;a++)o=o.replace(a<r?ka:_a,a<r?Ae.transform(s[a]):Ie(s[a]));return o}}var Fu=t=>typeof t=="number"?0:t;function qu(t){let e=Ea(t);return $a(t)(e.map(Fu))}var Hr={test:Ru,parse:Ea,createTransformer:$a,getAnimatableNone:qu};function Ln(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function jn({hue:t,saturation:e,lightness:r,alpha:i}){t/=360,e/=100,r/=100;let n=0,s=0,o=0;if(!e)n=s=o=r;else{let a=r<.5?r*(1+e):r+e-r*e,l=2*r-a;n=Ln(l,a,t+1/3),s=Ln(l,a,t),o=Ln(l,a,t-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}var Bu=(t,e,r)=>{let i=t*t,n=e*e;return Math.sqrt(Math.max(0,r*(n-i)+i))},Nu=[gt,ie,pe],Sa=t=>Nu.find(e=>e.test(t)),Ia=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,Gr=(t,e)=>{let r=Sa(t),i=Sa(e);ut(!!r,Ia(t)),ut(!!i,Ia(e));let n=r.parse(t),s=i.parse(e);r===pe&&(n=jn(n),r=ie),i===pe&&(s=jn(s),i=ie);let o=Object.assign({},n);return a=>{for(let l in o)l!=="alpha"&&(o[l]=Bu(n[l],s[l],a));return o.alpha=dt(n.alpha,s.alpha,a),r.transform(o)}};var Aa=t=>typeof t=="number";var zu=(t,e)=>r=>e(t(r)),Xr=(...t)=>t.reduce(zu);function Da(t,e){return Aa(t)?r=>dt(t,e,r):Ae.test(t)?Gr(t,e):Fn(t,e)}var Rn=(t,e)=>{let r=[...t],i=r.length,n=t.map((s,o)=>Da(s,e[o]));return s=>{for(let o=0;o<i;o++)r[o]=n[o](s);return r}},Ma=(t,e)=>{let r=Object.assign(Object.assign({},t),e),i={};for(let n in r)t[n]!==void 0&&e[n]!==void 0&&(i[n]=Da(t[n],e[n]));return n=>{for(let s in i)r[s]=i[s](n);return r}};function Ta(t){let e=Hr.parse(t),r=e.length,i=0,n=0,s=0;for(let o=0;o<r;o++)i||typeof e[o]=="number"?i++:e[o].hue!==void 0?s++:n++;return{parsed:e,numNumbers:i,numRGB:n,numHSL:s}}var Fn=(t,e)=>{let r=Hr.createTransformer(e),i=Ta(t),n=Ta(e);return i.numHSL===n.numHSL&&i.numRGB===n.numRGB&&i.numNumbers>=n.numNumbers?Xr(Rn(i.parsed,n.parsed),r):(Rr(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),o=>`${o>0?e:t}`)};var Wu=(t,e)=>r=>dt(t,e,r);function Vu(t){if(typeof t=="number")return Wu;if(typeof t=="string")return Ae.test(t)?Gr:Fn;if(Array.isArray(t))return Rn;if(typeof t=="object")return Ma}function Hu(t,e,r){let i=[],n=r||Vu(t[0]),s=t.length-1;for(let o=0;o<s;o++){let a=n(t[o],t[o+1]);if(e){let l=Array.isArray(e)?e[o]:e;a=Xr(l,a)}i.push(a)}return i}function Gu([t,e],[r]){return i=>r(Un(t,e,i))}function Xu(t,e){let r=t.length,i=r-1;return n=>{let s=0,o=!1;if(n<=t[0]?o=!0:n>=t[i]&&(s=i-1,o=!0),!o){let l=1;for(;l<r&&!(t[l]>n||l===i);l++);s=l-1}let a=Un(t[s],t[s+1],n);return e[s](a)}}function Jr(t,e,{clamp:r=!0,ease:i,mixer:n}={}){let s=t.length;ut(s===e.length,"Both input and output ranges must be the same length"),ut(!i||!Array.isArray(i)||i.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());let o=Hu(e,i,n),a=s===2?Gu(t,o):Xu(t,o);return r?l=>a(jt(t[0],t[s-1],l)):a}var Ft=t=>e=>1-t(1-e),Kr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Oa=t=>e=>Math.pow(e,t),qn=t=>e=>e*e*((t+1)*e-t),Pa=t=>{let e=qn(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var Ua=1.525,Ju=4/11,Ku=8/11,Yu=9/10;var La=Oa(2),Dy=Ft(La),ja=Kr(La),Qu=t=>1-Math.sin(Math.acos(t)),Zu=Ft(Qu),My=Kr(Zu),Ra=qn(Ua),Oy=Ft(Ra),Py=Kr(Ra),Uy=Pa(Ua),ed=4356/361,td=35442/1805,rd=16061/1805,id=t=>{if(t===1||t===0)return t;let e=t*t;return t<Ju?7.5625*e:t<Ku?9.075*e-9.9*t+3.4:t<Yu?ed*e-td*t+rd:10.8*t*t-20.52*t+10.72},Ly=Ft(id);function nd(t,e){return t.map(()=>e||ja).splice(0,t.length-1)}function sd(t){let e=t.length;return t.map((r,i)=>i!==0?i/(e-1):0)}function od(t,e){return t.map(r=>r*e)}function qt({from:t=0,to:e=1,ease:r,offset:i,duration:n=300}){let s={done:!1,value:t},o=Array.isArray(e)?e:[t,e],a=od(i&&i.length===o.length?i:sd(o),n);function l(){return Jr(a,o,{ease:Array.isArray(r)?r:nd(o,r)})}let c=l();return{next:d=>(s.value=c(d),s.done=d>=n,s),flipTarget:()=>{o.reverse(),c=l()}}}function Fa({velocity:t=0,from:e=0,power:r=.8,timeConstant:i=350,restDelta:n=.5,modifyTarget:s}){let o={done:!1,value:e},a=r*t,l=e+a,c=s===void 0?l:s(l);return c!==l&&(a=c-e),{next:d=>{let p=-a*Math.exp(-d/i);return o.done=!(p>n||p<-n),o.value=o.done?c:c+p,o},flipTarget:()=>{}}}var qa={keyframes:qt,spring:qr,decay:Fa};function Ba(t){if(Array.isArray(t.to))return qt;if(qa[t.type])return qa[t.type];let e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?qt:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?qr:qt}var Bn=16.666666666666668,ad=typeof performance<"u"?()=>performance.now():()=>Date.now(),Nn=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(ad()),Bn);function Na(t){let e=[],r=[],i=0,n=!1,s=!1,o=new WeakSet,a={schedule:(l,c=!1,d=!1)=>{let p=d&&n,h=p?e:r;return c&&o.add(l),h.indexOf(l)===-1&&(h.push(l),p&&n&&(i=e.length)),l},cancel:l=>{let c=r.indexOf(l);c!==-1&&r.splice(c,1),o.delete(l)},process:l=>{if(n){s=!0;return}if(n=!0,[e,r]=[r,e],r.length=0,i=e.length,i)for(let c=0;c<i;c++){let d=e[c];d(l),o.has(d)&&(a.schedule(d),t())}n=!1,s&&(s=!1,a.process(l))}};return a}var ld=40,zn=!0,Nt=!1,Wn=!1,Bt={delta:0,timestamp:0},zt=["read","update","preRender","render","postRender"],Yr=zt.reduce((t,e)=>(t[e]=Na(()=>Nt=!0),t),{}),cd=zt.reduce((t,e)=>{let r=Yr[e];return t[e]=(i,n=!1,s=!1)=>(Nt||dd(),r.schedule(i,n,s)),t},{}),za=zt.reduce((t,e)=>(t[e]=Yr[e].cancel,t),{}),Ky=zt.reduce((t,e)=>(t[e]=()=>Yr[e].process(Bt),t),{}),ud=t=>Yr[t].process(Bt),Wa=t=>{Nt=!1,Bt.delta=zn?Bn:Math.max(Math.min(t-Bt.timestamp,ld),1),Bt.timestamp=t,Wn=!0,zt.forEach(ud),Wn=!1,Nt&&(zn=!1,Nn(Wa))},dd=()=>{Nt=!0,zn=!0,Wn||Nn(Wa)};var Va=cd;function Vn(t,e,r=0){return t-e-r}function Ha(t,e,r=0,i=!0){return i?Vn(e+-t,e,r):e-(t-e)+r}function Ga(t,e,r,i){return i?t>=e+r:t<=-r}var pd=t=>{let e=({delta:r})=>t(r);return{start:()=>Va.update(e,!0),stop:()=>za.update(e)}};function Hn(t){var e,r,{from:i,autoplay:n=!0,driver:s=pd,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:d,onStop:p,onComplete:h,onRepeat:y,onUpdate:f}=t,$=jr(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:x}=$,E,b=0,k=$.duration,S,P=!1,R=!0,z,T=Ba($);!((r=(e=T).needsInterpolation)===null||r===void 0)&&r.call(e,i,x)&&(z=Jr([0,100],[i,x],{clamp:!1}),i=0,x=100);let W=T(Object.assign(Object.assign({},$),{from:i,to:x}));function K(){b++,l==="reverse"?(R=b%2===0,o=Ha(o,k,c,R)):(o=Vn(o,k,c),l==="mirror"&&W.flipTarget()),P=!1,y&&y()}function di(){E.stop(),h&&h()}function Te(L){if(R||(L=-L),o+=L,!P){let V=W.next(Math.max(0,o));S=V.value,z&&(S=z(S)),P=R?V.done:o<=0}f?.(S),P&&(b===0&&(k??(k=o)),b<a?Ga(o,k,c,R)&&K():di())}function Qt(){d?.(),E=s(Te),E.start()}return n&&Qt(),{stop:()=>{p?.(),E.stop()}}}var ze=class t extends w(v){static properties={product:{type:Object},labels:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}};constructor(){super(),this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this.darkMode=!1,this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(e){e.has("product")&&this.#e()}#e(){if(!this.product?.url){this._isValidUrl=!1;return}try{let e=new URL(this.product.url);this._isValidUrl=e.protocol==="http:"||e.protocol==="https:"}catch{this._isValidUrl=!1}}get images(){return this.product?.images||[]}render(){if(!this.product)return u`
|
|
898
898
|
<div class="${this.darkMode?"dark border-gray-600 bg-[#1E1F23]":"border-[#5e5d59]/25 bg-white"} my-2 w-full rounded-3xl border p-4">
|
|
899
899
|
<div class="relative mx-auto mb-4 max-w-[240px]">
|
|
900
900
|
<div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200 dark:bg-gray-700"></div>
|
|
@@ -936,7 +936,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
936
936
|
${this.images.length>1?u`
|
|
937
937
|
<div class="absolute inset-0 flex items-center justify-between px-4">
|
|
938
938
|
<button
|
|
939
|
-
@click="${this.#
|
|
939
|
+
@click="${this.#s}"
|
|
940
940
|
class="bg-opacity-80 hover:bg-opacity-100 absolute top-1/2 left-2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white shadow transition-all dark:bg-gray-700">
|
|
941
941
|
<mw-icon class="block h-6 w-3" name="lucide:chevron-left"></mw-icon>
|
|
942
942
|
</button>
|
|
@@ -951,7 +951,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
951
951
|
<div class="slider-dots absolute bottom-3 left-1/2 flex -translate-x-1/2 gap-2">
|
|
952
952
|
${this.images.map((s,o)=>u`
|
|
953
953
|
<button
|
|
954
|
-
@click="${()=>this.#
|
|
954
|
+
@click="${()=>this.#o(o)}"
|
|
955
955
|
class="${o===this._currentImageIndex?"bg-opacity-100":"bg-opacity-60"} hover:bg-opacity-80 h-1.5 w-1.5 rounded-full bg-white transition-all dark:bg-gray-400"></button>
|
|
956
956
|
`)}
|
|
957
957
|
</div>
|
|
@@ -983,7 +983,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
983
983
|
</button> -->
|
|
984
984
|
</div>
|
|
985
985
|
</div>
|
|
986
|
-
`}#t(e){e.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")}#r(e){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new t.AddToCartEvent(this.product)))}#n(e,r){this.#a&&Hn({from:e,to:r,duration:300,onUpdate:i=>{this.#a&&(this.#a.style.transform=`translateX(${i}%)`)}})}#i(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e+1)%this.product.images.length,i=-(e*100),n=-(r*100);this.#n(i,n),this._currentImageIndex=r}#
|
|
986
|
+
`}#t(e){e.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")}#r(e){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new t.AddToCartEvent(this.product)))}#n(e,r){this.#a&&Hn({from:e,to:r,duration:300,onUpdate:i=>{this.#a&&(this.#a.style.transform=`translateX(${i}%)`)}})}#i(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e+1)%this.product.images.length,i=-(e*100),n=-(r*100);this.#n(i,n),this._currentImageIndex=r}#s(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e-1+this.product.images.length)%this.product.images.length,i=-(e*100),n=-(r*100);this.#n(i,n),this._currentImageIndex=r}#o(e){if(!this.product?.images?.length)return;let r=this._currentImageIndex,i=Math.max(0,Math.min(e,this.product.images.length-1)),n=-(r*100),s=-(i*100);this.#n(n,s),this._currentImageIndex=i}get#a(){return this.renderRoot.querySelector(".image-slider")}};ze.AddToCartEvent=class extends CustomEvent{static type="mw-product-card:add-to-cart";constructor(e,r={}){super(ze.AddToCartEvent.type,{detail:{product:e},...r})}};customElements.get("mw-product-card")||customElements.define("mw-product-card",ze);var Gn=class{#e;isLoading=!0;hasError=!1;isLoaded=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){}hostDisconnected(){}handleLoad=()=>{this.isLoading=!1,this.isLoaded=!0,this.hasError=!1,this.#e.requestUpdate()};handleError=()=>{this.isLoading=!1,this.hasError=!0,this.isLoaded=!1,this.#e.requestUpdate()}};function Xa(t){return new Gn(t)}var Wt=class extends w(v){static properties={product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"}};#e=Xa(this);constructor(){super(),this.product=void 0,this.streaming=!1,this.linksNewTab=!1,this.searchParams=void 0,this.imagesByProductUrl={},this.darkMode=!1}get trackedProductUrl(){let e=this.product?.url,r=this.searchParams;try{if(e&&r)return Js(e,r).href}catch{}return e}render(){let{name:e,description:r,price:i,url:n}=this.product||{},s=n?this.imagesByProductUrl?.[n]:void 0;return u`
|
|
987
987
|
<a
|
|
988
988
|
href="${N(this.trackedProductUrl)}"
|
|
989
989
|
title="${N(e)}"
|
|
@@ -1248,8 +1248,8 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
1248
1248
|
type="button"
|
|
1249
1249
|
?disabled="${this._selectedRating>0}"
|
|
1250
1250
|
@click="${()=>this.#i(e)}"
|
|
1251
|
-
@mouseenter="${()=>this.#
|
|
1252
|
-
@mouseleave="${this.#
|
|
1251
|
+
@mouseenter="${()=>this.#s(e)}"
|
|
1252
|
+
@mouseleave="${this.#o}"
|
|
1253
1253
|
class="p-1 transition-transform hover:scale-110 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:scale-100"
|
|
1254
1254
|
aria-label="${e} star${e>1?"s":""}">
|
|
1255
1255
|
${this.#n(e)}
|
|
@@ -1274,7 +1274,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
1274
1274
|
<mw-icon class="${r?"text-green-500":"text-gray-400 dark:text-gray-300"} h-6 w-6" name="lucide:thumbs-up"></mw-icon>
|
|
1275
1275
|
</button>
|
|
1276
1276
|
</div>
|
|
1277
|
-
`}#n(e){let r=this._selectedRating>0?this._selectedRating:this._hoverRating,i=e<=r;return u`<mw-icon class="${i?"text-yellow-400":"text-gray-300"} h-6 w-6" name="lucide:star" ?fill="${i}"></mw-icon>`}#i(e){this._selectedRating>0||(this._selectedRating=e,this._hoverRating=0,this.dispatchEvent(new t.SubmitEvent({type:"star-rating",rating:e})))}#
|
|
1277
|
+
`}#n(e){let r=this._selectedRating>0?this._selectedRating:this._hoverRating,i=e<=r;return u`<mw-icon class="${i?"text-yellow-400":"text-gray-300"} h-6 w-6" name="lucide:star" ?fill="${i}"></mw-icon>`}#i(e){this._selectedRating>0||(this._selectedRating=e,this._hoverRating=0,this.dispatchEvent(new t.SubmitEvent({type:"star-rating",rating:e})))}#s(e){this._selectedRating>0||(this._hoverRating=e)}#o(){this._selectedRating>0||(this._hoverRating=0)}#a(e){this._selectedVote||(this._selectedVote=e,this.dispatchEvent(new t.SubmitEvent({type:"binary-vote",vote:e})))}};Vt.SubmitEvent=class extends CustomEvent{static type="mw-request-input:submit";constructor(e,r={}){super(Vt.SubmitEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-request-input")||customElements.define("mw-request-input",Vt);var Jn=class{#e;#t=0;#r;#n;#i;#s;#o=0;#a;constructor(e,{duration:r,initial:i,easing:n,onFrame:s,onComplete:o}){this.#a=i,this.#t=typeof r=="function"?0:r,this.#r=typeof r=="function"?r:void 0,this.#n=n??(a=>a),this.#i=s,this.#s=o,e.addController(this)}start(e){this.cancel(),this.#a=e,this.#r&&(this.#t=this.#r(e)),this.#o=performance.now(),this.#e=requestAnimationFrame(this.#l)}cancel(){this.#e!==void 0&&(cancelAnimationFrame(this.#e),this.#e=void 0)}get running(){return this.#e!==void 0}#l=e=>{let r=Math.min((e-this.#o)/this.#t,1),i=this.#n(r);this.#i(i,this.#a),r<1?this.#e=requestAnimationFrame(this.#l):(this.#e=void 0,this.#s?.(this.#a))};hostDisconnected(){this.cancel()}};function Ka(t,e){return new Jn(t,e)}var Kn=class extends w(v){static properties={text:{type:String},speed:{type:Number},spotlightWidth:{type:Number},loop:{type:Boolean},delay:{type:Number},textColor:{type:String},highlightColor:{type:String},className:{type:String},_position:{type:Number,state:!0},_containerWidth:{type:Number,state:!0}};constructor(){super(),this.text="",this.speed=5,this.spotlightWidth=120,this.loop=!0,this.delay=0,this.textColor="#9CA3AF",this.highlightColor="#000000",this.className="",this._position=-this.spotlightWidth,this._containerWidth=0}#e=Se(this);#t=Ka(this,{duration:({range:e})=>e*10/this.speed,initial:{range:0},onFrame:(e,{range:r})=>{this._position=-this.spotlightWidth+e*r,this.requestUpdate()},onComplete:({range:e})=>{this.loop&&(this._position=-this.spotlightWidth,this.requestUpdate(),this.#e.setTimeout(()=>this.#t.start({range:e}),this.delay))}});firstUpdated(){this.#e.setTimeout(()=>{this._containerWidth=this.#r?.offsetWidth||0;let e=this._containerWidth+this.spotlightWidth*3;this.#t.start({range:e})},this.delay)}render(){let e=this.text.split("");return u`
|
|
1278
1278
|
<div id="text-spotlight-container" class="${this.className} relative inline-block overflow-hidden whitespace-nowrap">
|
|
1279
1279
|
<div class="text-[${this.textColor}]">
|
|
1280
1280
|
${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>`})}
|
|
@@ -1304,9 +1304,9 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
1304
1304
|
?links-new-tab="${n}"
|
|
1305
1305
|
?dark-mode="${c}"
|
|
1306
1306
|
color="${l}"></mw-product-order-status-card>
|
|
1307
|
-
`;case"order-card-v2":{let f=se(el,t.data);f.success||console.warn("cannot parse order-card-v2",f.issues);let
|
|
1307
|
+
`;case"order-card-v2":{let f=se(el,t.data);f.success||console.warn("cannot parse order-card-v2",f.issues);let $=f.success?f.output:t.data;return u`
|
|
1308
1308
|
<!-- -->
|
|
1309
|
-
<mw-order-card .orderDetails="${
|
|
1309
|
+
<mw-order-card .orderDetails="${$}" ?streaming="${!y}" ?links-new-tab="${n}" ?dark-mode="${c}" color="${l}"></mw-order-card>
|
|
1310
1310
|
`}case"live-chat-wait-card-v1":{let f=t.data||{};return a?u`<p><i>${f.message}</i></p>`:u`
|
|
1311
1311
|
<mw-chat-wait-timer
|
|
1312
1312
|
heading="${f.title||""}"
|
|
@@ -1325,20 +1325,20 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
1325
1325
|
cdnBaseUrl="${p}"
|
|
1326
1326
|
sound="${p?`${p}/assets/game-intro.aac`:""}"
|
|
1327
1327
|
?dark-mode="${c}"></mw-chat-wait-timer>
|
|
1328
|
-
`}case"live-chat-wait-card-v2":{let f=se(Za,t.data||{});f.success||console.warn("cannot parse live-chat-wait-card-v2",f.issues);let
|
|
1328
|
+
`}case"live-chat-wait-card-v2":{let f=se(Za,t.data||{});f.success||console.warn("cannot parse live-chat-wait-card-v2",f.issues);let $=f.success?f.output:t.data||{};return a?u`<p><i>${$.subtitle}</i></p>`:u`
|
|
1329
1329
|
<mw-chat-wait-timer
|
|
1330
|
-
.data="${
|
|
1330
|
+
.data="${$}"
|
|
1331
1331
|
color="${l}"
|
|
1332
1332
|
apiBaseUrl="${d}"
|
|
1333
1333
|
cdnBaseUrl="${p}"
|
|
1334
1334
|
sound="${p?`${p}/assets/game-intro.aac`:""}"
|
|
1335
1335
|
?dark-mode="${c}"></mw-chat-wait-timer>
|
|
1336
|
-
`}case"request-input-v1":return u``}return console.warn("could not render part:",t),u`<p><i>data type not supported</i></p>`}var Zr=class{#e;#t;#r;#n=!1;timeoutMs;get isTyping(){return this.#n}constructor(e,r,{timeoutMs:i=2e3}={}){this.#e=e,this.#t=r,this.timeoutMs=i,e.addController(this)}hostDisconnected(){clearTimeout(this.#r),this.#r=void 0}onInput(e){if(this.#e.isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(this.#r),this.#r=setTimeout(()=>this.typingStopped(),this.timeoutMs),this.#n||this.#i()}}#i(){this.#n=!0,this.#t.typingStarted()}typingStopped(){clearTimeout(this.#r),this.#n=!1,this.#t.typingStopped()}};function Zn({interval:t},e){let r=!0,i;return Object.assign((...n)=>{r&&(e(...n),r=!1,i=setTimeout(()=>{r=!0,i=void 0},t))},{isThrottled:()=>i!==void 0})}function rl(t){let e=new FormData;for(let[r,i]of Object.entries(t))i!=null&&(i instanceof Blob?e.append(r,i):e.append(r,String(i)));return e}var ei=class extends Error{constructor(e,r,i){super(),this.name=this.constructor.name,this.message=e,this.type=r,this.code=i}},es=class{#e;#t;constructor(e,r,{fetch:i,headers:n}={}){this.baseUrl=e,this.path=r,this.#e=i,this.#t=n}GET({query:e,params:r,headers:i,signal:n}={}){return this.#n(this.#r(this.path,r),"GET",{query:e,headers:i,signal:n})}POST({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#n(this.#r(this.path,r),"POST",{query:e,body:i,formData:n,headers:s,signal:o})}PUT({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#n(this.#r(this.path,r),"PUT",{query:e,body:i,formData:n,headers:s,signal:o})}PATCH({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#n(this.#r(this.path,r),"PATCH",{query:e,body:i,formData:n,headers:s,signal:o})}DELETE({query:e,params:r,headers:i,signal:n}={}){return this.#n(this.#r(this.path,r),"DELETE",{query:e,headers:i,signal:n})}#r(e,r){if(!r)return e;let i=e;for(let[n,s]of Object.entries(r))i=i.replace(`:${n}`,encodeURIComponent(s.toString()));return i}async#n(e,r,{query:i,body:n,formData:s,headers:o,signal:a}){let l=new URL(e,this.baseUrl);i&&(l.search=Gs(i).toString());let c=new Headers(this.#t);if(o)for(let[p,h]of new Headers(o))c.set(p,h);s||n instanceof URLSearchParams||n instanceof FormData||n instanceof Blob||n instanceof ArrayBuffer||n instanceof ReadableStream||c.set("Content-Type","application/json");let d=await(this.#e??fetch)(l,{method:r,headers:c,body:c.get("Content-Type")==="application/json"?JSON.stringify(n):(s?rl(s):null)||n,signal:a});if(!d.ok){let p="";try{p=await d.text().then(h=>h.substring(0,1e3))}catch(h){p=h?.toString()??""}throw new ei(p,"HTTP",d.status)}if(d.status!==204){if(d.headers.get("Content-Type")?.startsWith("application/json"))return d.json();throw new ei("Response content type is not JSON and we do not handle others yet","HTTP",d.status)}}};function il(t,{fetch:e,headers:r}={}){let i={baseUrl:t};return new Proxy(i,{get(s,o){if(typeof o!="string"||!o.startsWith("/"))return;let a=o;return new es(s.baseUrl,a,{fetch:e,headers:r})}})}var ts=class{#e;uploadsAPI;constructor(e,r){this.#e=e,this.uploadsAPI=il(r),e.addController(this)}hostDisconnected(){}};function nl(t,e){return new ts(t,e).uploadsAPI}var rs="prose prose-h1:first:mt-0 prose-h2:first:mt-0 prose-h3:first:mt-0 prose-h4:first:mt-0 prose-h1:last:mb-0 prose-h2:last:mb-0 prose-h3:last:mb-0 prose-h4:last:mb-0 prose-h1:mt-5 prose-h2:mt-5 prose-h3:mt-5 prose-h4:mt-5 prose-h1:mb-2 prose-h2:mb-2 prose-h3:mb-2 prose-h4:mb-2 prose-h1:text-xl prose-h1:font-bold prose-h2:text-lg prose-h2:font-bold prose-h3:text-base prose-h3:font-bold prose-h4:text-sm prose-h4:font-bold prose-p:whitespace-pre-wrap prose-blockquote:border-l-4 prose-blockquote:border-gray-300 prose-blockquote:pl-4 prose-blockquote:my-4 prose-blockquote:italic prose-blockquote:text-gray-600 prose-blockquote:whitespace-normal prose-blockquote:before:content-none prose-blockquote:after:content-none dark:prose-headings:text-white dark:prose-strong:text-white dark:prose-p:text-inherit dark:prose-a:text-white dark:prose-blockquote:border-gray-500 dark:prose-blockquote:text-gray-300";function is(){return new URL(import.meta.url).hostname}function ti(){let t=Object.freeze({localhost:"http://localhost:8787","molin.localhost":"http://molin.localhost:8787","molin.ai":"https://molin.ai","molin.foo":"https://molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=is(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinApiBaseUrl.`);return r}function sl(){let t=Object.freeze({localhost:"http://uploads.molin.localhost:8787","molin.localhost":"http://uploads.molin.localhost:8787","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=is(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinUploadsBaseUrl.`);return r}function ol(){let t=Object.freeze({localhost:"http://localhost:8702","molin.localhost":"http://localhost:8702","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=is(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinCdnBaseUrl.`);return r}var fd=["star-rating","binary-vote","new-conversation-button"],
|
|
1336
|
+
`}case"request-input-v1":return u``}return console.warn("could not render part:",t),u`<p><i>data type not supported</i></p>`}var Zr=class{#e;#t;#r;#n=!1;timeoutMs;get isTyping(){return this.#n}constructor(e,r,{timeoutMs:i=2e3}={}){this.#e=e,this.#t=r,this.timeoutMs=i,e.addController(this)}hostDisconnected(){clearTimeout(this.#r),this.#r=void 0}onInput(e){if(this.#e.isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(this.#r),this.#r=setTimeout(()=>this.typingStopped(),this.timeoutMs),this.#n||this.#i()}}#i(){this.#n=!0,this.#t.typingStarted()}typingStopped(){clearTimeout(this.#r),this.#n=!1,this.#t.typingStopped()}};function Zn({interval:t},e){let r=!0,i;return Object.assign((...n)=>{r&&(e(...n),r=!1,i=setTimeout(()=>{r=!0,i=void 0},t))},{isThrottled:()=>i!==void 0})}function rl(t){let e=new FormData;for(let[r,i]of Object.entries(t))i!=null&&(i instanceof Blob?e.append(r,i):e.append(r,String(i)));return e}var ei=class extends Error{constructor(e,r,i){super(),this.name=this.constructor.name,this.message=e,this.type=r,this.code=i}},es=class{#e;#t;constructor(e,r,{fetch:i,headers:n}={}){this.baseUrl=e,this.path=r,this.#e=i,this.#t=n}GET({query:e,params:r,headers:i,signal:n}={}){return this.#n(this.#r(this.path,r),"GET",{query:e,headers:i,signal:n})}POST({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#n(this.#r(this.path,r),"POST",{query:e,body:i,formData:n,headers:s,signal:o})}PUT({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#n(this.#r(this.path,r),"PUT",{query:e,body:i,formData:n,headers:s,signal:o})}PATCH({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#n(this.#r(this.path,r),"PATCH",{query:e,body:i,formData:n,headers:s,signal:o})}DELETE({query:e,params:r,headers:i,signal:n}={}){return this.#n(this.#r(this.path,r),"DELETE",{query:e,headers:i,signal:n})}#r(e,r){if(!r)return e;let i=e;for(let[n,s]of Object.entries(r))i=i.replace(`:${n}`,encodeURIComponent(s.toString()));return i}async#n(e,r,{query:i,body:n,formData:s,headers:o,signal:a}){let l=new URL(e,this.baseUrl);i&&(l.search=Gs(i).toString());let c=new Headers(this.#t);if(o)for(let[p,h]of new Headers(o))c.set(p,h);s||n instanceof URLSearchParams||n instanceof FormData||n instanceof Blob||n instanceof ArrayBuffer||n instanceof ReadableStream||c.set("Content-Type","application/json");let d=await(this.#e??fetch)(l,{method:r,headers:c,body:c.get("Content-Type")==="application/json"?JSON.stringify(n):(s?rl(s):null)||n,signal:a});if(!d.ok){let p="";try{p=await d.text().then(h=>h.substring(0,1e3))}catch(h){p=h?.toString()??""}throw new ei(p,"HTTP",d.status)}if(d.status!==204){if(d.headers.get("Content-Type")?.startsWith("application/json"))return d.json();throw new ei("Response content type is not JSON and we do not handle others yet","HTTP",d.status)}}};function il(t,{fetch:e,headers:r}={}){let i={baseUrl:t};return new Proxy(i,{get(s,o){if(typeof o!="string"||!o.startsWith("/"))return;let a=o;return new es(s.baseUrl,a,{fetch:e,headers:r})}})}var ts=class{#e;uploadsAPI;constructor(e,r){this.#e=e,this.uploadsAPI=il(r),e.addController(this)}hostDisconnected(){}};function nl(t,e){return new ts(t,e).uploadsAPI}var rs="prose prose-h1:first:mt-0 prose-h2:first:mt-0 prose-h3:first:mt-0 prose-h4:first:mt-0 prose-h1:last:mb-0 prose-h2:last:mb-0 prose-h3:last:mb-0 prose-h4:last:mb-0 prose-h1:mt-5 prose-h2:mt-5 prose-h3:mt-5 prose-h4:mt-5 prose-h1:mb-2 prose-h2:mb-2 prose-h3:mb-2 prose-h4:mb-2 prose-h1:text-xl prose-h1:font-bold prose-h2:text-lg prose-h2:font-bold prose-h3:text-base prose-h3:font-bold prose-h4:text-sm prose-h4:font-bold prose-p:whitespace-pre-wrap prose-blockquote:border-l-4 prose-blockquote:border-gray-300 prose-blockquote:pl-4 prose-blockquote:my-4 prose-blockquote:italic prose-blockquote:text-gray-600 prose-blockquote:whitespace-normal prose-blockquote:before:content-none prose-blockquote:after:content-none dark:prose-headings:text-white dark:prose-strong:text-white dark:prose-p:text-inherit dark:prose-a:text-white dark:prose-blockquote:border-gray-500 dark:prose-blockquote:text-gray-300";function is(){return new URL(import.meta.url).hostname}function ti(){let t=Object.freeze({localhost:"http://localhost:8787","molin.localhost":"http://molin.localhost:8787","molin.ai":"https://molin.ai","molin.foo":"https://molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=is(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinApiBaseUrl.`);return r}function sl(){let t=Object.freeze({localhost:"http://uploads.molin.localhost:8787","molin.localhost":"http://uploads.molin.localhost:8787","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=is(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinUploadsBaseUrl.`);return r}function ol(){let t=Object.freeze({localhost:"http://localhost:8702","molin.localhost":"http://localhost:8702","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=is(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinCdnBaseUrl.`);return r}var fd=["star-rating","binary-vote","new-conversation-button"],We=class t extends w(v){static styles=O`
|
|
1337
1337
|
div.dark::before {
|
|
1338
1338
|
opacity: 0.8;
|
|
1339
1339
|
background-color: rgba(20, 22, 26, var(--tw-bg-opacity));
|
|
1340
1340
|
}
|
|
1341
|
-
`;static properties={showClose:{type:Boolean,attribute:"show-close"},showExpand:{type:Boolean,attribute:"show-expand"},expanded:{type:Boolean},open:{type:Boolean},_currentRequestInputIndex:{type:Number,state:!0}};#e=co(this);#t=nl(this,sl());#r=new Map;constructor(){super(),this.showClose=!1,this.showExpand=!1,this.expanded=!1,this.open=!1,this._currentRequestInputIndex=0}#n=new Zr(this,{typingStarted:()=>this.#e.value?.sendUserTypingStart(),typingStopped:()=>this.#e.value?.sendUserTypingStop()});#i=new Ur(this,{acceptedTypes:Ya,maxFileSize:10485760,maxFileCount:3,onFileUpload:async e=>{let r=this.#e.value;if(!r?.isConnected())throw new Error("Not connected");return this.#t["/v1/uploads"].POST({formData:{file:e.file,fileId:e.id,conversationId:this.conversationId,widgetId:r.widgetId,role:"user"}})},onFileDelete:e=>{if(!this.#e.value){console.warn("widget context not available, cannot delete file");return}this.#e.value.sendFileDelete(e),this.#k?.focus()},onFilesAdded:()=>{this.focusInput()}});get conversationId(){return this.#e.value?.conversationId||""}get messages(){return this.#e.value?.messages||[]}get config(){return this.#e.value?.config}get callbacks(){return this.#e.value?.callbacks||{}}get widgetId(){return this.#e.value?.widgetId||""}get typingIndicator(){return this.#e.value?.typingIndicator}get toolCallIndicator(){return this.#e.value?.toolCallIndicator}get isStreaming(){return this.#e.value?.isStreaming}get ranOutOfCredits(){return this.#e.value?.ranOutOfCredits}get isLiveMode(){return this.#e.value?.isLiveMode}get lastMsg(){return this.#e.value?.lastMsg}get hasQueuedMessages(){return this.#e.value?.hasQueuedMessages}#
|
|
1341
|
+
`;static properties={showClose:{type:Boolean,attribute:"show-close"},showExpand:{type:Boolean,attribute:"show-expand"},expanded:{type:Boolean},open:{type:Boolean},_currentRequestInputIndex:{type:Number,state:!0}};#e=co(this);#t=nl(this,sl());#r=new Map;constructor(){super(),this.showClose=!1,this.showExpand=!1,this.expanded=!1,this.open=!1,this._currentRequestInputIndex=0}#n=new Zr(this,{typingStarted:()=>this.#e.value?.sendUserTypingStart(),typingStopped:()=>this.#e.value?.sendUserTypingStop()});#i=new Ur(this,{acceptedTypes:Ya,maxFileSize:10485760,maxFileCount:3,onFileUpload:async e=>{let r=this.#e.value;if(!r?.isConnected())throw new Error("Not connected");return this.#t["/v1/uploads"].POST({formData:{file:e.file,fileId:e.id,conversationId:this.conversationId,widgetId:r.widgetId,role:"user"}})},onFileDelete:e=>{if(!this.#e.value){console.warn("widget context not available, cannot delete file");return}this.#e.value.sendFileDelete(e),this.#k?.focus()},onFilesAdded:()=>{this.focusInput()}});get conversationId(){return this.#e.value?.conversationId||""}get messages(){return this.#e.value?.messages||[]}get config(){return this.#e.value?.config}get callbacks(){return this.#e.value?.callbacks||{}}get widgetId(){return this.#e.value?.widgetId||""}get typingIndicator(){return this.#e.value?.typingIndicator}get toolCallIndicator(){return this.#e.value?.toolCallIndicator}get isStreaming(){return this.#e.value?.isStreaming}get ranOutOfCredits(){return this.#e.value?.ranOutOfCredits}get isLiveMode(){return this.#e.value?.isLiveMode}get lastMsg(){return this.#e.value?.lastMsg}get hasQueuedMessages(){return this.#e.value?.hasQueuedMessages}#s="single";#o=null;firstUpdated(){document.addEventListener("mw-context-widget:connected",this.#a,{once:!0}),this.addEventListener("mw-chat-wait-game:question-answered",this.#l),this.addEventListener("mw-chat-wait-game:game-completed",this.#c),this.addEventListener("mw-chat-wait-game:guess-validated",this.#d)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mw-chat-wait-game:question-answered",this.#l),this.removeEventListener("mw-chat-wait-game:game-completed",this.#c),this.removeEventListener("mw-chat-wait-game:guess-validated",this.#d)}#a=e=>{let r=e,{pendingImages:i}=r.detail;Array.isArray(i)&&this.#i.restoreFiles(i.map(n=>({id:n.id,name:n.name,type:n.type,size:n.size,dataUrl:n.url,file:new File([],n.name,{type:n.type}),processingState:de.uploaded,publicUrl:n.url})))};#l=e=>{let r=e,{questionIndex:i,question:n,answer:s,totalQuestions:o}=r.detail;this.callbacks.onWaitGameQuestionAnswered?.({widgetId:this.widgetId,conversationId:this.conversationId,questionIndex:i,question:n,answer:s,totalQuestions:o})};#c=e=>{let r=e,{guessedProfession:i,questionCount:n}=r.detail;this.callbacks.onWaitGameCompleted?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:i,questionCount:n})};#d=e=>{let r=e,{guessedProfession:i,isCorrect:n,questionCount:s}=r.detail;this.callbacks.onWaitGameGuessValidated?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:i,isCorrect:n,questionCount:s})};updated(e){e.has("open")&&this.open&&this.focusInput();let r=this.lastMsg?.id;r&&r!==this.#o&&(this.#o=r,this._currentRequestInputIndex=0),this.#i.setEnabled(!!this.#e.value?.widgetId)}render(){D(this.config,"config is required");let e=Ja(this.messages,s=>{try{let o=new Date(s.timestamp),a=Math.floor(o.getUTCMinutes()/5)*5;return o.setUTCMinutes(a,0,0),o.valueOf().toString()}catch(o){console.error(o)}}),r=Math.max(0,Math.min(this._currentRequestInputIndex,this.#h.length-1)),i=this.#h[r],n=this.config.darkMode;return u`
|
|
1342
1342
|
<div
|
|
1343
1343
|
class="${n?"dark":""} relative mx-auto h-full bg-[#FDFDFD] font-sans text-base before:absolute before:inset-0 before:bg-[#8d8d8d] before:opacity-10 sm:rounded-[36px] sm:p-1.5 sm:before:rounded-[36px] dark:bg-[#14161A]">
|
|
1344
1344
|
<div
|
|
@@ -1346,7 +1346,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
1346
1346
|
<mw-chat-header
|
|
1347
1347
|
class="absolute top-1.5 right-1.5 left-1.5"
|
|
1348
1348
|
.content="${{logoUrl:this.config.logoUrl,title:this.config.title,color:this.config.color}}"
|
|
1349
|
-
?show-new-chat="${!this.isLiveMode&&this.messages.length>0&&!this
|
|
1349
|
+
?show-new-chat="${!this.isLiveMode&&this.messages.length>0&&!this.#$}"
|
|
1350
1350
|
?show-close="${this.showClose}"
|
|
1351
1351
|
?show-expand="${this.showExpand}"
|
|
1352
1352
|
?expanded="${this.expanded}"
|
|
@@ -1385,25 +1385,25 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
1385
1385
|
<div class="${this.messages.length>0?"pt-20":""}">
|
|
1386
1386
|
${X(Array.from(e),([s])=>s,([s,o])=>u`
|
|
1387
1387
|
<div class="my-2 text-center text-xs text-gray-500 dark:text-gray-400">${pa(new Date(Number(s)),window.navigator.language)}</div>
|
|
1388
|
-
${X(o??[],a=>a.id,(a,l)=>{let d=o[l+1]?.role===a.role,h=(l>0?o[l-1]:void 0)?.role===a.role,f=(o.length>0?o[o.length-1]:void 0)?.id===a.id
|
|
1388
|
+
${X(o??[],a=>a.id,(a,l)=>{let d=o[l+1]?.role===a.role,h=(l>0?o[l-1]:void 0)?.role===a.role,f=(o.length>0?o[o.length-1]:void 0)?.id===a.id,$=()=>f&&!h&&!d?"single-current":!h&&!d?"single":!h&&d?"first":f&&h&&!d?"last-current":h&&!d?"last":h&&d?"middle":"single";this.#s=$();let x=this.isLiveMode&&a.role==="user"&&a.id===this.lastMsg?.id?"sent":"",E=(a.content.includes("<request-input-v1>")||!a.content)&&a.parts?.every(b=>"data"in b&&b.tag==="request-input-v1");return u`
|
|
1389
1389
|
${a.images?X(a.images,b=>b,b=>u`
|
|
1390
1390
|
<div data-id="${a.id}" class="${d?"mb-[1px]":"mb-3"} mr-2 ml-[15px] flex-row">
|
|
1391
1391
|
<mw-chat-image
|
|
1392
1392
|
src="${b}"
|
|
1393
1393
|
alt="User uploaded image"
|
|
1394
1394
|
.side="${a.role==="user"?"right":"left"}"
|
|
1395
|
-
position=${this.#
|
|
1395
|
+
position=${this.#s}
|
|
1396
1396
|
width="300px"></mw-chat-image>
|
|
1397
1397
|
</div>
|
|
1398
1398
|
`):null}
|
|
1399
|
-
${(a.content||a.parts)
|
|
1399
|
+
${(a.content||a.parts)&&!E?u`
|
|
1400
1400
|
<div data-id="${a.id}" class="${d?"mb-[1px]":"mb-3"} mx-2 flex-row">
|
|
1401
1401
|
<mw-chat-message
|
|
1402
1402
|
.color="${this.config?.color}"
|
|
1403
1403
|
status="${x}"
|
|
1404
1404
|
logo="${a.role==="support"&&a.metadata&&"avatar"in a.metadata&&a.metadata.avatar||this.config?.logoUrl||""}"
|
|
1405
1405
|
side="${a.role}"
|
|
1406
|
-
position=${this.#
|
|
1406
|
+
position=${this.#s}
|
|
1407
1407
|
?dark-mode="${n}"
|
|
1408
1408
|
@click="${this.#u}">
|
|
1409
1409
|
<div class="${rs} break-words text-inherit">
|
|
@@ -1497,7 +1497,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
1497
1497
|
</div>
|
|
1498
1498
|
</div>
|
|
1499
1499
|
</div>
|
|
1500
|
-
`}#u(e){let r=e.composedPath(),i=r.find(n=>n instanceof HTMLAnchorElement);if(i){e.preventDefault();let n=r.find(c=>c instanceof
|
|
1500
|
+
`}#u(e){let r=e.composedPath(),i=r.find(n=>n instanceof HTMLAnchorElement);if(i){e.preventDefault();let n=r.find(c=>c instanceof ze||c instanceof Wt),s=n?.product,o=0;if(n){let c=n.parentElement?.querySelectorAll("mw-product-card, mw-product-card-horizontal");c&&(o=Array.from(c).indexOf(n))}if(this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId,product:s?.name&&s?.price?{name:s.name,price:s.price,rank:o}:void 0}),window.self!==window.top){window.open(i.href,"_blank");return}let l=this.config?.linksNewTab?"_blank":"_self";window.open(i.href,i.target||l)}}#p(e){if(this.isStreaming)return;e.preventDefault();let r=e.detail.example;this.#v(r)}#v=Zn({interval:200},async e=>{D(this.#e.value,"widget context is required"),await this.#e.value.enqueueUserInput(e,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions})&&(this.#k?.setValue(""),this.#E(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!0,conversationId:this.conversationId}))});#f(e){if(D(this.#e.value,"widget context is required"),e.preventDefault(),this.#i.hasPendingFiles)return;let r=e.detail;this.#e.value.enqueueUserInput(r,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions}).then(i=>{i&&(this.#k?.setValue(""),this.#i.clearFiles(),this.#n.typingStopped(),this.#E(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:this.conversationId}),window.requestAnimationFrame(()=>{this.#k?.focus()}))}).catch(console.warn)}#g(e){this.#n.onInput(e.detail.full)}#m(){D(this.#e.value,"widget context is required"),this.#e.value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}#_(e){this.#i.deleteFile(e.detail)}#w(){D(this.#e.value,"widget context is required"),this.#e.value.sendNewChat(),this.reset()}#C(){this.dispatchEvent(new t.ExpandClickEvent)}#x(){this.dispatchEvent(new t.CloseClickEvent)}#y(e){D(this.#e.value,"widget context is required");let r=this.#h,i=r[this._currentRequestInputIndex];if(!i){console.warn("no current state found for request input");return}switch(e.detail.type){case"star-rating":{let{rating:s,type:o}=e.detail;this.#r.set(i.key||i.title,{type:o,rating:s,key:i.key,title:i.title});break}case"binary-vote":{let{vote:s,type:o}=e.detail;this.#r.set(i.key||i.title,{type:o,vote:s,key:i.key,title:i.title});break}case"new-conversation-button":{this.#w(),this.requestUpdate();return}default:console.warn("unknown request input type",e.detail);return}this._currentRequestInputIndex+=1;let n=r.filter(s=>s.type==="star-rating"||s.type==="binary-vote").length;this.#r.size>=n&&this.#b(),this.requestUpdate()}async#b(){if(D(this.#e.value,"widget context is required"),this.#r.size===0)return;if(!this.#e.value.lastMsg?.id){console.warn("cannot submit request inputs without message ID");return}await this.#e.value.sendUserFeedback([...this.#r.values()])&&this.#r.clear(),this.requestUpdate()}get#h(){D(this.#e.value,"widget context is required");let e=this.messages.findLast(n=>n.role==="assistant"&&n.parts?.some(s=>"tag"in s&&s.tag==="request-input-v1"&&"data"in s&&s.data.type==="new-conversation-button")),r=this.#e.value.lastMsg;if(e&&r?.id!==e.id){let n=e?.parts?.find(s=>"tag"in s&&s.tag==="request-input-v1"&&"data"in s&&s.data.type==="new-conversation-button");if(n&&"data"in n&&(n.data.type==="new-conversation-button"||n.data.type==="binary-vote"||n.data.type==="star-rating"))return[{title:String(n.data.title),type:n.data.type,key:String(n.data.key)}]}if(r?.role!=="assistant")return[];let i=r.parts?.filter(n=>"tag"in n&&n.tag==="request-input-v1");return!i||i.length===0?[]:i.map(n=>!("data"in n)||n.data.type!=="star-rating"&&n.data.type!=="binary-vote"&&n.data.type!=="new-conversation-button"||!fd.includes(n.data.type)?null:{title:String(n.data.title),type:n.data.type,key:String(n.data.key)}).filter(n=>n!==null)}get#$(){if(this.#h.length===0)return!1;let r=this.#h.filter(i=>i.type==="star-rating"||i.type==="binary-vote").length;return this.#r.size<r}get#S(){return this.renderRoot.querySelector("#scrollable-content")}#E(){this.#S?.scrollTo({top:0,behavior:"instant"})}get#k(){return this.renderRoot.querySelector("mw-chat-input")}reloadConfig(){this.#e.value?.reloadConfig(),this.requestUpdate()}sendMessage=Zn({interval:200},async e=>{if(!e?.trim())return console.warn("sendMessage: Message must be a non-empty string"),!1;D(this.#e.value,"Widget context is required");let{value:r}=this.#e,i=await r.enqueueUserInput(e,{xUserData:r.xUserData,xCustomInstructions:r.xCustomInstructions,role:"user",expectStreaming:!0});return i&&this.#k?.setValue(""),i??!1});setInputValue(e){if(!e||typeof e!="string"){console.warn("setInputValue requires a valid string value");return}let r=this.#k;if(!r){console.warn("input element not found, cannot set value");return}r.setValue?r.setValue(e):console.warn("input element does not have setValue method")}focusInput(){window.requestAnimationFrame(()=>{this.#k?.focus()})}reset(){this.#i.clearFiles(),this._currentRequestInputIndex=0,this.#r.clear(),this.#e.value?.reset()}};We.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(We.ExpandClickEvent.type,{...e})}};We.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(We.CloseClickEvent.type,{...e})}};customElements.get("mw-chat")||customElements.define("mw-chat",We);var Ve=class t extends w(v){static properties={color:{type:String},disabled:{type:Boolean},placeholder:{type:String},dark:{type:Boolean},_inputValue:{type:String,state:!0}};constructor(){super(),this.color="#8B5CF6",this.disabled=!1,this.placeholder="Ask AI...",this.dark=!1,this._inputValue=""}#e=new Date;#t(e){let r=e.target;this._inputValue=r.value,this.dispatchEvent(new t.ChangeEvent({value:this._inputValue}))}render(){return u`
|
|
1501
1501
|
<div class="${this.dark?"dark":""} group rounded-[18px] font-sans text-sm shadow-lg transition-transform duration-500 focus-within:scale-100 hover:scale-105">
|
|
1502
1502
|
<mw-spinning-border .size=${"420px"} .color=${this.color||"#8B5CF6"} .radius=${"18px"} ?dark-mode="${this.dark}">
|
|
1503
1503
|
<form
|
|
@@ -1528,7 +1528,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
1528
1528
|
</form>
|
|
1529
1529
|
</mw-spinning-border>
|
|
1530
1530
|
</div>
|
|
1531
|
-
`}#r(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;this.#e=r;let n=this._inputValue.trim();n&&this.dispatchEvent(new t.SubmitInputEvent({text:n}))&&(this._inputValue="")}get#n(){return this.renderRoot.querySelector('button[type="submit"]')??null}#i(e){md(e)&&(e.preventDefault(),this.disabled||this.#n?.click())}};
|
|
1531
|
+
`}#r(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;this.#e=r;let n=this._inputValue.trim();n&&this.dispatchEvent(new t.SubmitInputEvent({text:n}))&&(this._inputValue="")}get#n(){return this.renderRoot.querySelector('button[type="submit"]')??null}#i(e){md(e)&&(e.preventDefault(),this.disabled||this.#n?.click())}};Ve.SubmitInputEvent=class extends CustomEvent{static type="mw-floating-ask-ai:submit";constructor(e,r={}){super(Ve.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};Ve.ChangeEvent=class extends CustomEvent{static type="mw-floating-ask-ai:change";constructor(e,r={}){super(Ve.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};function md(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-floating-ask-ai")||customElements.define("mw-floating-ask-ai",Ve);var He=class t extends w(v){static properties={text:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
|
|
1532
1532
|
.popup-desktop:hover button {
|
|
1533
1533
|
transition-delay: 0s !important;
|
|
1534
1534
|
}
|
|
@@ -1556,7 +1556,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
1556
1556
|
×
|
|
1557
1557
|
</button>
|
|
1558
1558
|
</div>
|
|
1559
|
-
`;#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};
|
|
1559
|
+
`;#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};He.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(He.CloseEvent.type,{...e})}};He.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(He.ClickEvent.type,{...e})}};customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",He);var Ge=class t extends w(v){static properties={text:{type:String},button:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb",this.darkMode=!1}render(){return u`
|
|
1560
1560
|
<!-- wrapper -->
|
|
1561
1561
|
<div
|
|
1562
1562
|
class="${this.darkMode?"dark bg-[#2B2D31] text-gray-200":"bg-white text-gray-800"} group relative z-[2147483647] rounded-t-2xl text-left font-sans text-base text-[16px] leading-normal shadow-2xl transition-all select-none">
|
|
@@ -1581,7 +1581,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
1581
1581
|
<!-- can append any other content -->
|
|
1582
1582
|
<slot name="footer"></slot>
|
|
1583
1583
|
</div>
|
|
1584
|
-
`}#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};
|
|
1584
|
+
`}#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};Ge.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(Ge.CloseEvent.type,{...e})}};Ge.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Ge.ClickEvent.type,{...e})}};customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Ge);var ri=class{#e;#t=!1;constructor(e,r){this.#e=r,e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",this.#r),window.addEventListener("keydown",this.#r)}stopListening(){window.removeEventListener("click",this.#r),window.removeEventListener("keydown",this.#r)}#r=()=>{this.#t||(this.#e.userFirstInteracted?.(),this.#t=!0),this.#e.userInteracted?.()}};var gd=1440*60*1e3,ii=class{#e;#t;#r;#n;#i=!1;#s=!1;get showing(){return this.#i}constructor(e,r,i=Date){this.#e=e,this.#t=r,this.#r=i,e.addController(this)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!this.#i&&(this.#i=!0,this.#e.requestUpdate(),e)){this.#t.playPopupSound();let r=this.#t.getPersistedState();this.#t.setPersistedState({...r,playedSoundOnce:!0})}}#o(){let e=this.#t.getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&this.#r.now()-e.userDismissedAt<gd||this.show({sound:!r})}hide(){this.#s=!0,this.abortAutoShowTimer(),this.#i=!1,this.#e.requestUpdate()}abortAutoShowTimer(){clearTimeout(this.#n)}onCloseClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}onContentClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),this.#s||(this.#n=setTimeout(()=>this.#o(),this.#t.getDelayMs()))}};var Gt=class t extends w(v){static properties={positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"}};#e=new ii(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(e=>{console.error("Error playing audio:",e,{})})},setPersistedState:e=>{j().popupState=e},getPersistedState:()=>j().popupState});#t=new ri(this,this.#e);constructor(){super(),this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:"",color:""},mobile:{text:"",button:"",color:"",poweredBy:!0}},this.darkMode=!1}render(){let e=this.#e.showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",r=this.content;return u`
|
|
1585
1585
|
<!-- mobile shadow backdrop -->
|
|
1586
1586
|
<div @click="${this.#r}" class="${e} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
|
|
1587
1587
|
|
|
@@ -1623,18 +1623,20 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
1623
1623
|
stroke-linecap="round"></path>
|
|
1624
1624
|
</svg>
|
|
1625
1625
|
</div>
|
|
1626
|
-
`};customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",ss);function he(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}function
|
|
1626
|
+
`};customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",ss);function he(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}function Xe(t,e){try{window.dispatchEvent(new CustomEvent(t,{detail:e}))}catch(r){console.error(r)}try{let r=he();if(!r)return;switch(t){case"molin:ready":r.onReady?.(e);break;case"molin:chat-open":r.onChatOpen?.(e);break;case"molin:chat-close":r.onChatClose?.(e);break;case"molin:message-sent":r.onMessageSent?.(e);break;case"molin:link-click":r.onLinkClick?.(e);break}}catch(r){console.error(r)}}var ni=class{#e;#t;#r;#n;isLoading=!1;data=void 0;constructor(e,r,i){this.#e=e,this.#t=r,this.#r=i,e.addController(this)}fetch(){if(this.isLoading)return;this.#n?.abort();let e=new AbortController;this.#n=e,this.isLoading=!0,this.data=void 0,this.#e.requestUpdate(),(async()=>{let r=this.#i();return r.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(r,{signal:e.signal})})().then(async r=>{if(!r.ok)throw new Error(`${r.statusText}: ${await r.text()}`);this.isLoading=!1,this.data=typeof this.#r?.transform=="function"?await this.#r.transform(r):r,this.#e.requestUpdate()}).catch(r=>{this.#r?.onError?.(r),this.isLoading=!1,this.data=void 0,this.#e.requestUpdate()}).finally(()=>{e.abort()})}#i(){let e=this.#t;if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)}hostConnected(){this.isLoading||this.#r?.fetchWhenConnected&&this.fetch()}hostDisconnected(){this.#n?.abort(),this.#n=void 0}};var os=class{#e;#t;#r;#n;get data(){return this.#n||this.#r?.data}constructor(e,r){this.#e=e,this.#t=r,e.addController(this)}hostConnected(){if(this.#r||this.#n)return;let e=al();e&&e.widgetId===this.#e.widgetId?this.#n=e.config:this.#r=new ni(this.#e,()=>{if(this.#e.cdn&&this.#e.widgetId)return`${this.#e.cdn}/config?w=${this.#e.widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:async r=>{let i=await r.json();return i&&!e&&window.__INIT_MOLIN_SHOP_AI({cdn:this.#e.cdn,widgetId:this.#e.widgetId,config:i}),i},onError:this.#t?.onError})}},yt=(t,e)=>new os(t,{onError:e?.onError||console.error,...e});var si=class{#e=[];#t;#r=!1;#n;#i;#s;#o;#a;constructor({send:e,sendBeacon:r,maxBufferSize:i=10,flushIntervalMs:n=5*1e3,sendTimeoutMs:s=10*1e3}){this.#n=e,this.#i=r,this.#s=i,this.#o=n,this.#a=s}async add(e){if(this.#e.push(e),this.#e.length>=this.#s)return this.flush();this.#l()}async flush(){if(this.#r||this.#e.length===0)return;this.#r=!0,clearTimeout(this.#t),this.#t=void 0;let e=[...this.#e];this.#e=[];let r=new AbortController,i=setTimeout(()=>r.abort(),this.#a);try{await this.#n(e,r.signal)}catch(n){console.error("sending events failed",n),this.#e=[...e,...this.#e]}finally{clearTimeout(i),this.#r=!1,this.#l()}}async flushBeacon(){if(this.#e.length>0)try{this.#i(this.#e)}catch(e){console.error("Failed to send final events:",e)}}#l(){this.#e.length!==0&&(this.#t||(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#o)))}};function ll(t){t?.body?.cancel().catch(console.warn)}function ul(){return new URL("/widgets/data/collect",ti())}var cl;function yd(){return cl??=new si({send:async(t,e)=>bd(t,{signal:e}),sendBeacon:t=>navigator.sendBeacon(ul(),dl(t))}),cl}function J(t,e,{flush:r=!1,now:i=new Date,buffer:n=yd(),storage:s=j(),window:o=globalThis}={}){if(typeof t!="string")throw new TypeError("ClickHouse: event name must be a string");if(!e||typeof e!="object")throw new TypeError("ClickHouse: properties must be an object");try{let a=vd(t,e,{storage:s,window:o,now:i});n.add(a).catch(console.error),r&&n.flush().catch(console.error)}catch(a){console.error("Failed to send event:",a)}}function dl(t){let e=new FormData;return e.set("events",JSON.stringify(t)),e}async function bd(t,{signal:e}={}){let r=await fetch(ul(),{method:"POST",body:dl(t),signal:e});if(ll(r),!r.ok)throw new Error(`HTTP error! status: ${r.status}`)}function vd(t,e,{storage:r,window:i,now:n}){return{event:t,widget_id:e.widgetId,properties:Object.assign({},e,xd({window:i,now:n})),distinct_id:wd({storage:r,window:i}),timestamp:n.toISOString()}}function wd({storage:t,window:e}){let r=t.distinctID;if(r&&typeof r=="string")return r;let i=e.crypto.randomUUID();try{t.distinctID=i}catch(n){console.error("Failed to store distinct_id:",n)}return i}function xd({window:t,now:e}){return{referrer:t.document.referrer,userAgent:t.navigator.userAgent,language:t.navigator.language,screenWidth:t.innerWidth,screenHeight:t.innerHeight,timestamp:e.toISOString(),timezoneOffset:e.getTimezoneOffset(),doNotTrack:t.navigator.doNotTrack??void 0}}function oi(t,e=globalThis){try{(!("dataLayer"in e)||!Array.isArray(e.dataLayer))&&(e.dataLayer=[]),t(e.dataLayer)}catch(r){console.error(r)}}function Xt(t,e){oi(r=>{r.push(t)},e)}function pl(t,e){t.items.length&&oi(r=>{r.push({ecommerce:null}),r.push({event:"view_item_list",ecommerce:t})},e)}function hl(t,e){oi(r=>{r.push({ecommerce:null}),r.push({event:"select_item",ecommerce:t})},e)}function fl(t,e){oi(r=>{r.push({ecommerce:null}),r.push({event:"view_item",ecommerce:t})},e)}function _d(t,e=globalThis){try{"klaviyo"in e&&e.klaviyo&&typeof e.klaviyo.push=="function"&&t(e.klaviyo)}catch(r){console.error(r)}}function Jt(t,e){_d(r=>{r.push(["track",t])},e)}function as(t,e=globalThis){try{"clarity"in e&&typeof e.clarity=="function"&&t(e.clarity)}catch(r){console.error(r)}}var ml=!1;function Kt(t,e){ml||as(r=>{r("set","molin_widget_id",t),ml=!0},e)}function Yt(t,e){as(r=>{r("event",t)},e)}function gl(t,e){as(r=>{r("upgrade",t)},e)}function ai(){return{onError:t=>{console.error("Molin","ERROR",t.widgetId,t.error),J("ShopAssistant: error",{...t},{flush:!0}),alert(t.error)},onNewMessageStartedStreaming:t=>{J("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{J("ShopAssistant: user received bot message (streaming ended)",t),t.products.length&&pl({item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",items:t.products.map((e,r)=>({item_name:e.name,price:0,index:r,item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",google_business_vertical:"retail"}))})},onUserCanceledStreaming:t=>{J("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{if(J("ShopAssistant: user clicked link",t),Xt({event:"molin_link_click",widget_id:t.widgetId,url:t.url}),t.product){let e={item_name:t.product.name,price:0,index:t.product.rank,item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",google_business_vertical:"retail"};hl({item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",items:[e]}),fl({items:[e]})}Kt(t.widgetId),Yt("molin_link_click"),Jt("molin_link_click"),Xe("molin:link-click",{widgetId:t.widgetId,url:t.url})},onUserSentInput:t=>{J("ShopAssistant: user sent input",t),Xt({event:"molin_message_sent",widget_id:t.widgetId}),Kt(t.widgetId),Yt("molin_message_sent"),gl("molin_message_sent"),Jt("molin_message_sent"),Xe("molin:message-sent",{widgetId:t.widgetId})},onWaitGameQuestionAnswered:t=>{J("ShopAssistant: wait game question answered",t)},onWaitGameCompleted:t=>{J("ShopAssistant: wait game completed",t)},onWaitGameGuessValidated:t=>{J("ShopAssistant: wait game guess validated",t)}}}function yl(){return{onPageview:t=>{J("ShopAssistant: pageview",t)},onChatOpen:({widgetId:t,source:e})=>{J("ShopAssistant: user toggled window",{widgetId:t,source:e,state:"open"}),Xt({event:"molin_chat_open",widget_id:t}),Kt(t),Yt("molin_chat_open"),Jt("molin_chat_open"),Xe("molin:chat-open",{widgetId:t})},onChatClose:({widgetId:t,source:e})=>{J("ShopAssistant: user toggled window",{widgetId:t,source:e,state:"close"}),Xt({event:"molin_chat_close",widget_id:t}),Kt(t),Yt("molin_chat_close"),Jt("molin_chat_close"),Xe("molin:chat-close",{widgetId:t})},onShowLauncher:({widgetId:t,source:e})=>{J("ShopAssistant: called show launcher",{widgetId:t,source:e})},onHideLauncher:({widgetId:t,source:e})=>{J("ShopAssistant: called hide launcher",{widgetId:t,source:e})}}}var we=class t extends w(v){static styles=O`
|
|
1627
1627
|
:host {
|
|
1628
1628
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
1629
|
+
visibility: inherit; /* re-inherit so parent's invisible class propagates */
|
|
1630
|
+
pointer-events: inherit; /* re-inherit so parent can disable click interception */
|
|
1629
1631
|
}
|
|
1630
|
-
`;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1}};#e;get config(){return this.#t||this.#e.data}#t;#r=ai();constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData=he()?.userData,this.xCustomInstructions=he()?.customInstructions,this.#e=yt(this)}render(){return this.config?u`
|
|
1632
|
+
`;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},showExpand:{type:Boolean,attribute:"show-expand"},expanded:{type:Boolean},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1}};#e;get config(){return this.#t||this.#e.data}#t;#r=ai();constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.showExpand=!1,this.expanded=!1,this.xUserData=he()?.userData,this.xCustomInstructions=he()?.customInstructions,this.#e=yt(this)}render(){return this.config?u`
|
|
1631
1633
|
<mw-context-widget .widgetId="${this.widgetId}" .config="${this.config}" .callbacks="${this.#r}" .xUserData="${this.xUserData}" .xCustomInstructions="${this.xCustomInstructions}">
|
|
1632
1634
|
<!-- embed our chat component forwarding props -->
|
|
1633
|
-
<mw-chat ?show-close="${this.showClose}" @mw:close-click="${this.#n}">
|
|
1635
|
+
<mw-chat ?show-close="${this.showClose}" ?show-expand="${this.showExpand}" ?expanded="${this.expanded}" @mw:close-click="${this.#n}" @mw:expand-click="${this.#i}">
|
|
1634
1636
|
<slot name="banner" slot="banner"></slot>
|
|
1635
1637
|
</mw-chat>
|
|
1636
1638
|
</mw-context-widget>
|
|
1637
|
-
`:null}#n(){this.dispatchEvent(new t.CloseClickEvent)}injectConfig(e){this.#t=e,this.requestUpdate()}reloadConfig(){this.#
|
|
1639
|
+
`:null}#n(){this.dispatchEvent(new t.CloseClickEvent)}#i(){this.dispatchEvent(new t.ExpandClickEvent)}injectConfig(e){this.#t=e,this.requestUpdate()}reloadConfig(){this.#s?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",this.#s?.reset(),this.requestUpdate()}get#s(){return this.renderRoot.querySelector("mw-chat")}get conversationId(){return this.#s?.conversationId??""}get messages(){return this.#s?.messages??[]}};we.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(we.CloseClickEvent.type,{...e})}};we.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(we.ExpandClickEvent.type,{...e})}};customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",we);var ls=class{#e;#t;get hidden(){return this.#e}get version(){return this.#t}constructor({hidden:e,version:r}){this.#e=e,this.#t=r}setHidden(e){this.#e=e}setUserData(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data")}setCustomInstructions(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions")}showLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof xe&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof xe&&e.hideLauncher()}openChat(e){let{message:r,autoSend:i}=e||{};for(let n of document.querySelectorAll("molin-shop-ai"))n instanceof xe&&n.openChat({message:r,autoSend:i})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof xe&&e.closeChat()}reset(){j().resetAll();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof xe&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof we&&e.reset()}};function bl({hidden:t,version:e}){let r=new ls({hidden:t,version:e});return window.Molin=r,r}function li(){let t=window.Molin;if(!t)throw new Error("window.Molin global not initialized");return t}window.__INIT_MOLIN_SHOP_AI=function(e){Cd(e);let r=he(),i=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(bl({hidden:i,version:e.version}),e.auto){let n=document.createElement("molin-shop-ai");n.setAttribute("cdn",e.cdn),n.setAttribute("widget",e.widgetId),document.body.appendChild(n)}Xe("molin:ready",{widgetId:e.widgetId})};function Cd(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function al(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var cs=class extends w(v){static styles=O`
|
|
1638
1640
|
:host {
|
|
1639
1641
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
1640
1642
|
}
|
|
@@ -1648,11 +1650,11 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
1648
1650
|
.src="${this.config?.bubble?.bubbleUrl}"
|
|
1649
1651
|
width="${N(this.config?.bubble?.size?.width)}"
|
|
1650
1652
|
height="${N(this.config?.bubble?.size?.height)}"></mw-bubble>
|
|
1651
|
-
`:null}};customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",cs);var
|
|
1653
|
+
`:null}};customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",cs);var T1="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),D1="navigator"in globalThis&&"share"in navigator,Ed=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function $d(t){if(typeof window>"u")return!1;let e=Ed[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function us(){return $d("sm")}var ci=class{#e;#t;#r;#n;#i=!1;constructor(e,r,i,n=window.history){this.#e=e,this.#t=r,this.#r=i,this.#n=n,e.addController(this)}hostConnected(){this.#s();let e=this.#n.pushState;this.#n.pushState=(...r)=>{if(e.call(this.#n,...r),!this.#i)try{let i=new URL(r[2],window.location.origin);this.#t.test(i.pathname)&&this.#r.navigated()}catch{}}}hostDisconnected(){this.#i=!0}#s=()=>{this.#t.test(window.location.pathname)&&this.#r.navigated()}};var ds=class{#e;#t;constructor(e,r){this.#t=r,e.addController(this)}request(){this.cancel(),this.#e=requestAnimationFrame(this.#t)}cancel(){this.#e!==void 0&&(cancelAnimationFrame(this.#e),this.#e=void 0)}get pending(){return this.#e!==void 0}hostDisconnected(){this.cancel()}};function vl(t,e){return new ds(t,e)}function wl({minMs:t,maxMs:e}){return Math.random()*(e-t)+t}function ui(t,e=""){return Object.entries(t).filter(([r,i])=>i).map(([r,i])=>`${e}${r}-[${i}]`).join(" ")}function xl(t,e={}){return[ui(t),ui(e,"max-sm:")].join(" ")}function kl(t){return ui(t)}function _l(t){return Object.entries(t).filter(([e,r])=>r).filter(([e])=>e==="left"||e==="right").map(([e,r])=>{let i=`sm:${e}-[${r}]`;return e==="left"&&(i+=" sm:right-auto"),e==="right"&&(i+=" sm:left-auto"),i}).join(" ")}function Cl(t){let e=ui(t),i=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,i].filter(Boolean).join(" ")}var ps=class{#e=0;#t;#r;#n;constructor(e,r,{threshold:i=5}={}){this.#t=r,this.#r=i,e.addController(this)}hostConnected(){this.#e=window.scrollY,window.removeEventListener("scroll",this.#i),window.addEventListener("scroll",this.#i,{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",this.#i),this.#n!==void 0&&(cancelAnimationFrame(this.#n),this.#n=void 0)}#i=()=>{this.#n===void 0&&(this.#n=requestAnimationFrame(this.#s))};#s=()=>{this.#n=void 0;let e=window.scrollY,r=e-this.#e;if(Math.abs(r)>=this.#r){let i=r>0?"down":"up";this.#t({scrollY:e,direction:i,deltaY:Math.abs(r)}),this.#e=e}}};function El(t,e,r){return new ps(t,e,r)}var xe=class extends w(v){static styles=O`
|
|
1652
1654
|
:host {
|
|
1653
1655
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
1654
1656
|
}
|
|
1655
|
-
`;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1},_floatingInputVisible:{type:Boolean,state:!0},_dialogShown:{type:Boolean,state:!0},_expanded:{type:Boolean,state:!0}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.xUserData=he()?.userData,this.xCustomInstructions=he()?.customInstructions,this._floatingInputVisible=!0,this._dialogShown=!1,this._expanded=!1}#e=yt(this);#t
|
|
1657
|
+
`;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1},_floatingInputVisible:{type:Boolean,state:!0},_dialogShown:{type:Boolean,state:!0},_expanded:{type:Boolean,state:!0}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.xUserData=he()?.userData,this.xCustomInstructions=he()?.customInstructions,this._floatingInputVisible=!0,this._dialogShown=!1,this._expanded=!1}#e=yt(this);#t=El(this,e=>{this.#d&&!this._dialogShown&&(e.direction==="down"?this._floatingInputVisible=!1:e.direction==="up"&&(this._floatingInputVisible=!0),this.requestUpdate())},{threshold:20});get config(){return this.#r||this.#e.data}#r;#n=new ci(this,/.*/i,{navigated:()=>{if(this.requestUpdate(),!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let e=this.#m?.conversationId,r=rt.restore(this.widgetId)?.conversationId,i=e||r;i&&this.#a.onPageview({widgetId:this.widgetId,conversationId:i,url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0,shouldHideForCurrentUrl:this.#u})}});#i=!1;#s=vl(this,()=>{this._dialogShown=!0});#o=ai();#a=yl();#l=Se(this);get#c(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647}get#d(){return this.config?.floatingAskAI?.enabled||!0}get#u(){if(!this.config?.hideUrls||!Array.isArray(this.config.hideUrls))return!1;let e=window.location.href,r=window.location.pathname;return this.config.hideUrls.some(i=>{if(!i||typeof i!="string")return!1;let n=i.endsWith("*"),s=n?i.slice(0,-1):i;return i.startsWith("http")?n?e.startsWith(s):e===s:n?r.startsWith(s):r===s})}render(){if(!this.config)return null;let e=xl(this.config.bubble.position,this.config.bubble.mobilePosition),r=kl(this.config.bubble.position),i=_l(this.config.bubble.position),n=Cl(this.config.bubble.position);return this.config.hidden||li().hidden||this.#u?null:u`
|
|
1656
1658
|
<mw-bubble
|
|
1657
1659
|
class="${e} ${this._dialogShown?"opacity-0":"opacity-100"} fixed z-[${this.#c}] transition-opacity"
|
|
1658
1660
|
@click="${this.#w}"
|
|
@@ -1685,7 +1687,8 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
1685
1687
|
<!-- 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. -->
|
|
1686
1688
|
${this.#i?u`
|
|
1687
1689
|
<div
|
|
1688
|
-
class="${this._dialogShown?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${i} ${this.config?.darkMode?"bg-[#14161A]":"bg-white"} ${this._expanded?"sm:w-[700px] sm:max-w-[700px] sm:min-w-[300px]":"sm:w-[calc(100dvh*0.50)] sm:max-w-[400px] sm:min-w-[300px] 2xl:max-w-[420px]"} fixed inset-0 z-[2147483647] font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all duration-300 ease-in-out sm:top-auto sm:bottom-6 sm:h-[92%] sm:max-h-[800px] sm:rounded-[36px]">
|
|
1690
|
+
class="${this._dialogShown?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3 pointer-events-none"} ${i} ${this.config?.darkMode?"bg-[#14161A]":"bg-white"} ${this._expanded?"sm:w-[700px] sm:max-w-[700px] sm:min-w-[300px]":"sm:w-[calc(100dvh*0.50)] sm:max-w-[400px] sm:min-w-[300px] 2xl:max-w-[420px]"} fixed inset-0 z-[2147483647] font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all duration-300 ease-in-out sm:top-auto sm:bottom-6 sm:h-[92%] sm:max-h-[800px] sm:rounded-[36px]">
|
|
1691
|
+
<!-- NOTE: molin-shop-ai-chat has all:initial on :host which resets styles -->
|
|
1689
1692
|
<molin-shop-ai-chat
|
|
1690
1693
|
widget="${this.widgetId}"
|
|
1691
1694
|
cdn="${this.cdn}"
|
|
@@ -1711,7 +1714,7 @@ var Sl=Object.create;var hs=Object.defineProperty;var Il=Object.getOwnPropertyDe
|
|
|
1711
1714
|
style="bottom: ${this.config.bubble.position.bottom||"1.5rem"}"
|
|
1712
1715
|
@mw-floating-ask-ai:submit="${this.#x}"></mw-floating-ask-ai>
|
|
1713
1716
|
`:null}
|
|
1714
|
-
`}#p({source:e}){this.#i?this._dialogShown=!0:(this.#i=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.#
|
|
1717
|
+
`}#p({source:e}){this.#i?this._dialogShown=!0:(this.#i=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.#s.request()})),j().widgetState={isOpen:!0},this.#a.onChatOpen({widgetId:this.widgetId,source:e})}#v(){this._expanded=!this._expanded,this.requestUpdate()}#f({source:e}){this._dialogShown=!1,this._expanded=!1,this._floatingInputVisible=!0,j().widgetState={isOpen:!1},this.#a.onChatClose({widgetId:this.widgetId,source:e})}get isPopupEnabled(){return us()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){this._dialogShown&&this.#g?.hide(),this._dialogShown&&this.#l.setTimeout(()=>this.#m?.focusInput(),0)}firstUpdated(){us()&&j().widgetState?.isOpen&&!this._dialogShown&&this.#p({source:"page-navigation-restore"})}get#g(){return this.renderRoot.querySelector("mw-popup")}get#m(){return this.renderRoot.querySelector("molin-shop-ai-chat")?.renderRoot.querySelector("mw-chat")??null}#_(){this.#p({source:"popup-click"})}#w(){this._dialogShown?this.#f({source:"bubble-toggle"}):this.#p({source:"bubble-toggle"}),this.#g?.hide()}#C(){this.#f({source:"top-right-close-button"})}#x=e=>{this.#p({source:"ask-ai"});let r=e.detail.text;this.#l.setTimeout(()=>{this.#h(r),this.#b(r)},100),this.#o.onUserSentInput({widgetId:this.widgetId,text:r,example:!1,conversationId:this.#m?.conversationId||""})};#y=wn({interval:200},({message:e,autoSend:r=!1}={})=>{if(!e)return;this.#h(e);let i=this.#m?.isLiveMode;i||this.reset(),r&&!i&&this.#b(e)});openChat(e){let{message:r,autoSend:i}=e||{};if(this._dialogShown){this.#y({message:r,autoSend:i});return}this.#p({source:"programmatic-method"}),this.#g?.hide(),this.#l.setTimeout(()=>{this.#y({message:r,autoSend:i})},100)}closeChat(){this._dialogShown&&(this.#f({source:"programmatic-method"}),this.#g?.hide())}showLauncher(){li().setHidden(!1),this.requestUpdate(),this.#a.onShowLauncher({widgetId:this.widgetId,source:"programmatic-method"})}hideLauncher(){li().setHidden(!0),this.requestUpdate(),this.#a.onHideLauncher({widgetId:this.widgetId,source:"programmatic-method"})}injectConfig(e){this.#r=e,this.requestUpdate()}reset(){this.xUserData={},this.xCustomInstructions="",this.#m?.reset(),this.requestUpdate()}#b(e){let r=this.#m;if(!r){console.warn("Chat element not found, cannot send message");return}if(!r.sendMessage){console.warn("Chat element does not have sendMessage method, cannot send message");return}r.sendMessage(e)}#h(e){let r=this.#m;if(!r){console.warn("Chat element not found, cannot set input value");return}if(!r.setInputValue){console.warn("Chat element does not have setInputValue method, cannot set input value");return}r.setInputValue(e)}};customElements.get("molin-shop-ai")||customElements.define("molin-shop-ai",xe);export{xe as MolinShopAI};
|
|
1715
1718
|
/*! Bundled license information:
|
|
1716
1719
|
|
|
1717
1720
|
@lit/reactive-element/css-tag.js:
|