@molin.ai/shop-ai 0.9.19 → 0.9.21
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 +119 -113
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDescriptor;var Jp=Object.getOwnPropertyNames;var Xp=Object.getPrototypeOf,Yp=Object.prototype.hasOwnProperty;var il=t=>{throw TypeError(t)};var Qp=(t,e,r)=>e in t?Ks(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var qr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var eh=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Jp(e))!Yp.call(t,i)&&i!==r&&Ks(t,i,{get:()=>e[i],enumerable:!(n=Kp(e,i))||n.enumerable});return t};var th=(t,e,r)=>(r=t!=null?Zp(Xp(t)):{},eh(e||!t||!t.__esModule?Ks(r,"default",{value:t,enumerable:!0}):r,t));var w=(t,e,r)=>Qp(t,typeof e!="symbol"?e+"":e,r),Js=(t,e,r)=>e.has(t)||il("Cannot "+r);var a=(t,e,r)=>(Js(t,e,"read from private field"),r?r.call(t):e.get(t)),h=(t,e,r)=>e.has(t)?il("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),g=(t,e,r,n)=>(Js(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),m=(t,e,r)=>(Js(t,e,"access private method"),r);var sl=(t,e,r,n)=>({set _(i){g(t,e,i,r)},get _(){return a(t,e,n)}});var nu=qr(Mt=>{"use strict";var $d=Mt&&Mt.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function u(p){try{c(n.next(p))}catch(d){o(d)}}function l(p){try{c(n.throw(p))}catch(d){o(d)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},Ed=Mt&&Mt.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.base64ToBlob=_d;function _d(t){return $d(this,void 0,void 0,function(){var e,r,n;return Ed(this,function(i){switch(i.label){case 0:return[4,fetch(t)];case 1:return e=i.sent(),[4,e.blob()];case 2:return r=i.sent(),n=Ad(t),n&&(r=r.slice(0,r.size,n)),[2,r]}})})}var Md=/^data:(.+);base64,/;function Ad(t){var e;return(e=t.match(Md))===null||e===void 0?void 0:e.slice(1,2).pop()}});var iu=qr(At=>{"use strict";var Id=At&&At.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function u(p){try{c(n.next(p))}catch(d){o(d)}}function l(p){try{c(n.throw(p))}catch(d){o(d)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},Td=At&&At.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(At,"__esModule",{value:!0});At.base64ToFile=Ld;function Ld(t,e,r){return Id(this,void 0,void 0,function(){var n,i;return Td(this,function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:return n=s.sent(),[4,n.blob()];case 2:return i=s.sent(),[2,new File([i],e,r)]}})})}});var oa=qr(It=>{"use strict";var ia=It&&It.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function u(p){try{c(n.next(p))}catch(d){o(d)}}function l(p){try{c(n.throw(p))}catch(d){o(d)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},sa=It&&It.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(It,"__esModule",{value:!0});It.blobToBase64=jd;function jd(t){return ia(this,void 0,void 0,function(){return sa(this,function(e){return[2,typeof FileReader=="function"?Od(t):Ud(t)]})})}var dr;(function(t){t.error="error",t.loadend="loadend"})(dr||(dr={}));function Od(t){return ia(this,void 0,void 0,function(){return sa(this,function(e){return[2,new Promise(function(r,n){try{var i=new FileReader,s=function(){r(i.result),i.removeEventListener(dr.loadend,s)};i.addEventListener(dr.loadend,s);var o=function(){n(i.error),i.removeEventListener(dr.error,o)};i.addEventListener(dr.error,o),i.readAsDataURL(t)}catch(u){n(u)}})]})})}var Dd="application/octet-stream";function Ud(t){return ia(this,void 0,void 0,function(){var e,r,n,i;return sa(this,function(s){switch(s.label){case 0:return n=(r=Buffer).from,[4,t.text()];case 1:return e=n.apply(r,[s.sent()]),i=t.type||Dd,[2,"data:".concat(i,";base64,").concat(e.toString("base64"))]}})})}});var su=qr(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.fileToBase64=void 0;var Pd=oa();Object.defineProperty(Bi,"fileToBase64",{enumerable:!0,get:function(){return Pd.blobToBase64}})});var ou=qr(Oe=>{"use strict";var Rd=Oe&&Oe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vi=Oe&&Oe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Rd(e,t,r)};Object.defineProperty(Oe,"__esModule",{value:!0});Vi(nu(),Oe);Vi(iu(),Oe);Vi(oa(),Oe);Vi(su(),Oe)});var oi=globalThis,ai=oi.ShadowRoot&&(oi.ShadyCSS===void 0||oi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Xs=Symbol(),ol=new WeakMap,Wr=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==Xs)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(ai&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=ol.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&ol.set(r,e))}return e}toString(){return this.cssText}},al=t=>new Wr(typeof t=="string"?t:t+"",void 0,Xs),ae=(t,...e)=>{let r=t.length===1?t[0]:e.reduce(((n,i,s)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new Wr(r,t,Xs)},ll=(t,e)=>{if(ai)t.adoptedStyleSheets=e.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(let r of e){let n=document.createElement("style"),i=oi.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}},Ys=ai?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return al(r)})(t):t;var{is:rh,defineProperty:nh,getOwnPropertyDescriptor:ih,getOwnPropertyNames:sh,getOwnPropertySymbols:oh,getPrototypeOf:ah}=Object,li=globalThis,cl=li.trustedTypes,lh=cl?cl.emptyScript:"",ch=li.reactiveElementPolyfillSupport,Gr=(t,e)=>t,Qs={toAttribute(t,e){switch(e){case Boolean:t=t?lh: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}},pl=(t,e)=>!rh(t,e),ul={attribute:!0,type:String,converter:Qs,reflect:!1,useDefault:!1,hasChanged:pl};Symbol.metadata??=Symbol("metadata"),li.litPropertyMetadata??=new WeakMap;var Ve=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=ul){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(e,n,r);i!==void 0&&nh(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){let{get:i,set:s}=ih(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get:i,set(o){let u=i?.call(this);s?.call(this,o),this.requestUpdate(e,u,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ul}static _$Ei(){if(this.hasOwnProperty(Gr("elementProperties")))return;let e=ah(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Gr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Gr("properties"))){let r=this.properties,n=[...sh(r),...oh(r)];for(let i of n)this.createProperty(i,r[i])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(let[r,n]of this.elementProperties){let i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(Ys(i))}else e!==void 0&&r.push(Ys(e));return r}static _$Eu(e,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,r=this.constructor.elementProperties;for(let n of r.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ll(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$ET(e,r){let n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){let s=(n.converter?.toAttribute!==void 0?n.converter:Qs).toAttribute(r,n.type);this._$Em=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,r){let n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let s=n.getPropertyOptions(i),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Qs;this._$Em=i;let u=o.fromAttribute(r,s.type);this[i]=u??this._$Ej?.get(i)??u,this._$Em=null}}requestUpdate(e,r,n){if(e!==void 0){let i=this.constructor,s=this[e];if(n??=i.getPropertyOptions(e),!((n.hasChanged??pl)(s,r)||n.useDefault&&n.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,n))))return;this.C(e,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:n,reflect:i,wrapped:s},o){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??r??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(r=void 0),this._$AL.set(e,r)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[i,s]of n){let{wrapped:o}=s,u=this[i];o!==!0||this._$AL.has(i)||u===void 0||this.C(i,void 0,s,u)}}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach((n=>n.hostUpdate?.())),this.update(r)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$EO?.forEach((r=>r.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((r=>this._$ET(r,this[r]))),this._$EM()}updated(e){}firstUpdated(e){}};Ve.elementStyles=[],Ve.shadowRootOptions={mode:"open"},Ve[Gr("elementProperties")]=new Map,Ve[Gr("finalized")]=new Map,ch?.({ReactiveElement:Ve}),(li.reactiveElementVersions??=[]).push("2.1.1");var to=globalThis,ci=to.trustedTypes,hl=ci?ci.createPolicy("lit-html",{createHTML:t=>t}):void 0,ro="$lit$",Fe=`lit$${Math.random().toFixed(9).slice(2)}$`,no="?"+Fe,uh=`<${no}>`,wt=document,Kr=()=>wt.createComment(""),Jr=t=>t===null||typeof t!="object"&&typeof t!="function",io=Array.isArray,yl=t=>io(t)||typeof t?.[Symbol.iterator]=="function",eo=`[
|
|
1
|
+
var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDescriptor;var Jp=Object.getOwnPropertyNames;var Xp=Object.getPrototypeOf,Yp=Object.prototype.hasOwnProperty;var il=t=>{throw TypeError(t)};var Qp=(t,e,r)=>e in t?Ks(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var qr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var eh=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Jp(e))!Yp.call(t,i)&&i!==r&&Ks(t,i,{get:()=>e[i],enumerable:!(n=Kp(e,i))||n.enumerable});return t};var th=(t,e,r)=>(r=t!=null?Zp(Xp(t)):{},eh(e||!t||!t.__esModule?Ks(r,"default",{value:t,enumerable:!0}):r,t));var w=(t,e,r)=>Qp(t,typeof e!="symbol"?e+"":e,r),Js=(t,e,r)=>e.has(t)||il("Cannot "+r);var a=(t,e,r)=>(Js(t,e,"read from private field"),r?r.call(t):e.get(t)),h=(t,e,r)=>e.has(t)?il("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),g=(t,e,r,n)=>(Js(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),m=(t,e,r)=>(Js(t,e,"access private method"),r);var sl=(t,e,r,n)=>({set _(i){g(t,e,i,r)},get _(){return a(t,e,n)}});var nu=qr(Mt=>{"use strict";var $d=Mt&&Mt.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function u(p){try{c(n.next(p))}catch(f){o(f)}}function l(p){try{c(n.throw(p))}catch(f){o(f)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},Ed=Mt&&Mt.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.base64ToBlob=_d;function _d(t){return $d(this,void 0,void 0,function(){var e,r,n;return Ed(this,function(i){switch(i.label){case 0:return[4,fetch(t)];case 1:return e=i.sent(),[4,e.blob()];case 2:return r=i.sent(),n=Ad(t),n&&(r=r.slice(0,r.size,n)),[2,r]}})})}var Md=/^data:(.+);base64,/;function Ad(t){var e;return(e=t.match(Md))===null||e===void 0?void 0:e.slice(1,2).pop()}});var iu=qr(At=>{"use strict";var Id=At&&At.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function u(p){try{c(n.next(p))}catch(f){o(f)}}function l(p){try{c(n.throw(p))}catch(f){o(f)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},Td=At&&At.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(At,"__esModule",{value:!0});At.base64ToFile=Ld;function Ld(t,e,r){return Id(this,void 0,void 0,function(){var n,i;return Td(this,function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:return n=s.sent(),[4,n.blob()];case 2:return i=s.sent(),[2,new File([i],e,r)]}})})}});var oa=qr(It=>{"use strict";var ia=It&&It.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function u(p){try{c(n.next(p))}catch(f){o(f)}}function l(p){try{c(n.throw(p))}catch(f){o(f)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},sa=It&&It.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(It,"__esModule",{value:!0});It.blobToBase64=jd;function jd(t){return ia(this,void 0,void 0,function(){return sa(this,function(e){return[2,typeof FileReader=="function"?Od(t):Ud(t)]})})}var dr;(function(t){t.error="error",t.loadend="loadend"})(dr||(dr={}));function Od(t){return ia(this,void 0,void 0,function(){return sa(this,function(e){return[2,new Promise(function(r,n){try{var i=new FileReader,s=function(){r(i.result),i.removeEventListener(dr.loadend,s)};i.addEventListener(dr.loadend,s);var o=function(){n(i.error),i.removeEventListener(dr.error,o)};i.addEventListener(dr.error,o),i.readAsDataURL(t)}catch(u){n(u)}})]})})}var Dd="application/octet-stream";function Ud(t){return ia(this,void 0,void 0,function(){var e,r,n,i;return sa(this,function(s){switch(s.label){case 0:return n=(r=Buffer).from,[4,t.text()];case 1:return e=n.apply(r,[s.sent()]),i=t.type||Dd,[2,"data:".concat(i,";base64,").concat(e.toString("base64"))]}})})}});var su=qr(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.fileToBase64=void 0;var Pd=oa();Object.defineProperty(Bi,"fileToBase64",{enumerable:!0,get:function(){return Pd.blobToBase64}})});var ou=qr(Oe=>{"use strict";var Rd=Oe&&Oe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vi=Oe&&Oe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Rd(e,t,r)};Object.defineProperty(Oe,"__esModule",{value:!0});Vi(nu(),Oe);Vi(iu(),Oe);Vi(oa(),Oe);Vi(su(),Oe)});var oi=globalThis,ai=oi.ShadowRoot&&(oi.ShadyCSS===void 0||oi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Xs=Symbol(),ol=new WeakMap,Wr=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==Xs)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(ai&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=ol.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&ol.set(r,e))}return e}toString(){return this.cssText}},al=t=>new Wr(typeof t=="string"?t:t+"",void 0,Xs),ae=(t,...e)=>{let r=t.length===1?t[0]:e.reduce(((n,i,s)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new Wr(r,t,Xs)},ll=(t,e)=>{if(ai)t.adoptedStyleSheets=e.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(let r of e){let n=document.createElement("style"),i=oi.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}},Ys=ai?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return al(r)})(t):t;var{is:rh,defineProperty:nh,getOwnPropertyDescriptor:ih,getOwnPropertyNames:sh,getOwnPropertySymbols:oh,getPrototypeOf:ah}=Object,li=globalThis,cl=li.trustedTypes,lh=cl?cl.emptyScript:"",ch=li.reactiveElementPolyfillSupport,Gr=(t,e)=>t,Qs={toAttribute(t,e){switch(e){case Boolean:t=t?lh: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}},pl=(t,e)=>!rh(t,e),ul={attribute:!0,type:String,converter:Qs,reflect:!1,useDefault:!1,hasChanged:pl};Symbol.metadata??=Symbol("metadata"),li.litPropertyMetadata??=new WeakMap;var Ve=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=ul){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(e,n,r);i!==void 0&&nh(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){let{get:i,set:s}=ih(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get:i,set(o){let u=i?.call(this);s?.call(this,o),this.requestUpdate(e,u,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ul}static _$Ei(){if(this.hasOwnProperty(Gr("elementProperties")))return;let e=ah(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Gr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Gr("properties"))){let r=this.properties,n=[...sh(r),...oh(r)];for(let i of n)this.createProperty(i,r[i])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(let[r,n]of this.elementProperties){let i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(Ys(i))}else e!==void 0&&r.push(Ys(e));return r}static _$Eu(e,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,r=this.constructor.elementProperties;for(let n of r.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ll(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$ET(e,r){let n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){let s=(n.converter?.toAttribute!==void 0?n.converter:Qs).toAttribute(r,n.type);this._$Em=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,r){let n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let s=n.getPropertyOptions(i),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Qs;this._$Em=i;let u=o.fromAttribute(r,s.type);this[i]=u??this._$Ej?.get(i)??u,this._$Em=null}}requestUpdate(e,r,n){if(e!==void 0){let i=this.constructor,s=this[e];if(n??=i.getPropertyOptions(e),!((n.hasChanged??pl)(s,r)||n.useDefault&&n.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,n))))return;this.C(e,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:n,reflect:i,wrapped:s},o){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??r??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(r=void 0),this._$AL.set(e,r)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[i,s]of n){let{wrapped:o}=s,u=this[i];o!==!0||this._$AL.has(i)||u===void 0||this.C(i,void 0,s,u)}}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach((n=>n.hostUpdate?.())),this.update(r)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$EO?.forEach((r=>r.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((r=>this._$ET(r,this[r]))),this._$EM()}updated(e){}firstUpdated(e){}};Ve.elementStyles=[],Ve.shadowRootOptions={mode:"open"},Ve[Gr("elementProperties")]=new Map,Ve[Gr("finalized")]=new Map,ch?.({ReactiveElement:Ve}),(li.reactiveElementVersions??=[]).push("2.1.1");var to=globalThis,ci=to.trustedTypes,hl=ci?ci.createPolicy("lit-html",{createHTML:t=>t}):void 0,ro="$lit$",Fe=`lit$${Math.random().toFixed(9).slice(2)}$`,no="?"+Fe,uh=`<${no}>`,wt=document,Kr=()=>wt.createComment(""),Jr=t=>t===null||typeof t!="object"&&typeof t!="function",io=Array.isArray,yl=t=>io(t)||typeof t?.[Symbol.iterator]=="function",eo=`[
|
|
2
2
|
\f\r]`,Zr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,dl=/-->/g,fl=/>/g,mt=RegExp(`>|${eo}(?:([^\\s"'>=/]+)(${eo}*=${eo}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),ml=/'/g,gl=/"/g,vl=/^(?:script|style|textarea|title)$/i,so=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ml=/'/g,gl=/"/g,vl=/^(?:script|style|textarea|title)$/i,so=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),d=so(1),F1=so(2),N1=so(3),_e=Symbol.for("lit-noChange"),z=Symbol.for("lit-nothing"),wl=new WeakMap,gt=wt.createTreeWalker(wt,129);function bl(t,e){if(!io(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return hl!==void 0?hl.createHTML(e):e}var xl=(t,e)=>{let r=t.length-1,n=[],i,s=e===2?"<svg>":e===3?"<math>":"",o=Zr;for(let u=0;u<r;u++){let l=t[u],c,p,f=-1,y=0;for(;y<l.length&&(o.lastIndex=y,p=o.exec(l),p!==null);)y=o.lastIndex,o===Zr?p[1]==="!--"?o=dl:p[1]!==void 0?o=fl:p[2]!==void 0?(vl.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=mt):p[3]!==void 0&&(o=mt):o===mt?p[0]===">"?(o=i??Zr,f=-1):p[1]===void 0?f=-2:(f=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?mt:p[3]==='"'?gl:ml):o===gl||o===ml?o=mt:o===dl||o===fl?o=Zr:(o=mt,i=void 0);let x=o===mt&&t[u+1].startsWith("/>")?" ":"";s+=o===Zr?l+uh:f>=0?(n.push(c),l.slice(0,f)+ro+l.slice(f)+Fe+x):l+Fe+(f===-2?u:x)}return[bl(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},Xr=class t{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let s=0,o=0,u=e.length-1,l=this.parts,[c,p]=xl(e,r);if(this.el=t.createElement(c,n),gt.currentNode=this.el.content,r===2||r===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=gt.nextNode())!==null&&l.length<u;){if(i.nodeType===1){if(i.hasAttributes())for(let f of i.getAttributeNames())if(f.endsWith(ro)){let y=p[o++],x=i.getAttribute(f).split(Fe),S=/([.?@])?(.*)/.exec(y);l.push({type:1,index:s,name:S[2],strings:x,ctor:S[1]==="."?pi:S[1]==="?"?hi:S[1]==="@"?di:vt}),i.removeAttribute(f)}else f.startsWith(Fe)&&(l.push({type:6,index:s}),i.removeAttribute(f));if(vl.test(i.tagName)){let f=i.textContent.split(Fe),y=f.length-1;if(y>0){i.textContent=ci?ci.emptyScript:"";for(let x=0;x<y;x++)i.append(f[x],Kr()),gt.nextNode(),l.push({type:2,index:++s});i.append(f[y],Kr())}}}else if(i.nodeType===8)if(i.data===no)l.push({type:2,index:s});else{let f=-1;for(;(f=i.data.indexOf(Fe,f+1))!==-1;)l.push({type:7,index:s}),f+=Fe.length-1}s++}}static createElement(e,r){let n=wt.createElement("template");return n.innerHTML=e,n}};function yt(t,e,r=t,n){if(e===_e)return e;let i=n!==void 0?r._$Co?.[n]:r._$Cl,s=Jr(e)?void 0:e._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(t),i._$AT(t,r,n)),n!==void 0?(r._$Co??=[])[n]=i:r._$Cl=i),i!==void 0&&(e=yt(t,i._$AS(t,e.values),i,n)),e}var ui=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:r},parts:n}=this._$AD,i=(e?.creationScope??wt).importNode(r,!0);gt.currentNode=i;let s=gt.nextNode(),o=0,u=0,l=n[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new qt(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new fi(s,this,e)),this._$AV.push(c),l=n[++u]}o!==l?.index&&(s=gt.nextNode(),o++)}return gt.currentNode=wt,i}p(e){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},qt=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,n,i){this.type=2,this._$AH=z,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=yt(this,e,r),Jr(e)?e===z||e==null||e===""?(this._$AH!==z&&this._$AR(),this._$AH=z):e!==this._$AH&&e!==_e&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):yl(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==z&&Jr(this._$AH)?this._$AA.nextSibling.data=e:this.T(wt.createTextNode(e)),this._$AH=e}$(e){let{values:r,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Xr.createElement(bl(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(r);else{let s=new ui(i,this),o=s.u(this.options);s.p(r),this.T(o),this._$AH=s}}_$AC(e){let r=wl.get(e.strings);return r===void 0&&wl.set(e.strings,r=new Xr(e)),r}k(e){io(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let s of e)i===r.length?r.push(n=new t(this.O(Kr()),this.O(Kr()),this,this.options)):n=r[i],n._$AI(s),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},vt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,n,i,s){this.type=1,this._$AH=z,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=z}_$AI(e,r=this,n,i){let s=this.strings,o=!1;if(s===void 0)e=yt(this,e,r,0),o=!Jr(e)||e!==this._$AH&&e!==_e,o&&(this._$AH=e);else{let u=e,l,c;for(e=s[0],l=0;l<s.length-1;l++)c=yt(this,u[n+l],r,l),c===_e&&(c=this._$AH[l]),o||=!Jr(c)||c!==this._$AH[l],c===z?e=z:e!==z&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!i&&this.j(e)}j(e){e===z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},pi=class extends vt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===z?void 0:e}},hi=class extends vt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==z)}},di=class extends vt{constructor(e,r,n,i,s){super(e,r,n,i,s),this.type=5}_$AI(e,r=this){if((e=yt(this,e,r,0)??z)===_e)return;let n=this._$AH,i=e===z&&n!==z||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==z&&(n===z||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},fi=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){yt(this,e)}},kl={M:ro,P:Fe,A:no,C:1,L:xl,R:ui,D:yl,V:yt,I:qt,H:vt,N:hi,U:di,B:pi,F:fi},ph=to.litHtmlPolyfillSupport;ph?.(Xr,qt),(to.litHtmlVersions??=[]).push("3.3.1");var Cl=(t,e,r)=>{let n=r?.renderBefore??e,i=n._$litPart$;if(i===void 0){let s=r?.renderBefore??null;n._$litPart$=i=new qt(e.insertBefore(Kr(),s),s,void 0,r??{})}return i._$AI(t),i};var oo=globalThis,$=class extends Ve{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=Cl(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return _e}};$._$litElement$=!0,$.finalized=!0,oo.litElementHydrateSupport?.({LitElement:$});var hh=oo.litElementPolyfillSupport;hh?.({LitElement:$});(oo.litElementVersions??=[]).push("4.2.1");var Yr=class Yr extends HTMLElement{constructor(){super();w(this,"name","");this.attachShadow({mode:"open"})}attributeChangedCallback(r,n,i){if(n!==i&&Yr.observedAttributes.includes(r)){switch(r){case"name":this.name=i||"";break}this.render()}}resolveIcon(r){throw new Error("Not implemented")}render(){let r=document.createElement("style");for(r.textContent=`
|
|
4
4
|
:host {
|
|
5
5
|
display: inline-block;
|
|
6
6
|
line-height: 0;
|
|
@@ -123,7 +123,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
123
123
|
<path d="M2.25 6.75C2.25 15.0343 8.96573 21.75 17.25 21.75H19.5C20.7426 21.75 21.75 20.7426 21.75 19.5V18.1284C21.75 17.6121 21.3987 17.1622 20.8979 17.037L16.4747 15.9312C16.0355 15.8214 15.5734 15.9855 15.3018 16.3476L14.3316 17.6412C14.05 18.0166 13.563 18.1827 13.1223 18.0212C9.81539 16.8098 7.19015 14.1846 5.97876 10.8777C5.81734 10.437 5.98336 9.94998 6.3588 9.6684L7.65242 8.69818C8.01453 8.4266 8.17861 7.96445 8.06883 7.52533L6.96304 3.10215C6.83783 2.60133 6.38785 2.25 5.87163 2.25H4.5C3.25736 2.25 2.25 3.25736 2.25 4.5V6.75Z" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
124
124
|
</svg>`,"eye-slash":`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
125
125
|
<path d="M3.97993 8.22257C3.05683 9.31382 2.35242 10.596 1.93436 12.0015C3.22565 16.338 7.24311 19.5 11.9991 19.5C12.9917 19.5 13.9521 19.3623 14.8623 19.1049M6.22763 6.22763C7.88389 5.13558 9.86771 4.5 12 4.5C16.756 4.5 20.7734 7.66205 22.0647 11.9985C21.3528 14.3919 19.8106 16.4277 17.772 17.772M6.22763 6.22763L3 3M6.22763 6.22763L9.87868 9.87868M17.772 17.772L21 21M17.772 17.772L14.1213 14.1213M14.1213 14.1213C14.6642 13.5784 15 12.8284 15 12C15 10.3431 13.6569 9 12 9C11.1716 9 10.4216 9.33579 9.87868 9.87868M14.1213 14.1213L9.87868 9.87868" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
126
|
-
</svg>`};var dh=Sl,ao=class extends mi{resolveIcon(e){let r=dh[e];if(!r)throw console.warn("hi-outline: icon not found",e),new Error(`Icon ${e} not found`);return r}render(){super.render();let e=this.shadowRoot?.querySelector("svg");if(!e)throw new Error("svgEl not found "+this.name);e.setAttribute("fill","none"),e.querySelectorAll("[stroke]").forEach(r=>{r.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",ao);var Qr,he,me,en,lo,gi=class{constructor(e,r){h(this,en);h(this,Qr);h(this,he);h(this,me);if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");g(this,Qr,e),a(this,Qr).addController(this),g(this,he,r)}connect(e){g(this,he,e),g(this,me,m(this,en,lo).call(this))}hostConnected(){a(this,me)||setTimeout(()=>{a(this,me)||g(this,me,m(this,en,lo).call(this))},0)}hostDisconnected(){a(this,me)?.close(1e3,"lit_host_disconnected"),g(this,me,void 0)}send(e){a(this,me)?.send(e)}close(e,r){a(this,me)?.close(e,r)}get isConnected(){return a(this,me)?.readyState===WebSocket.OPEN}get isConnecting(){return a(this,me)?.readyState===WebSocket.CONNECTING}};Qr=new WeakMap,he=new WeakMap,me=new WeakMap,en=new WeakSet,lo=function(){let e=new WebSocket(a(this,he).url());return a(this,he).onClose&&(e.onclose=a(this,he).onClose),a(this,he).onOpen&&(e.onopen=a(this,he).onOpen),a(this,he).onError&&(e.onerror=a(this,he).onError),a(this,he).onMessage&&(e.onmessage=a(this,he).onMessage),e};var $l=Array.isArray;var co=t=>!!(t&&t.constructor&&t.call&&t.apply);var El=t=>!(!t||!t.then||!co(t.then));var uo=(t,e,r=!1)=>{if(!t)return[];let n=(s,o)=>e(s)-e(o),i=(s,o)=>e(o)-e(s);return t.slice().sort(r===!0?i:n)};function*tn(t,e,r=i=>i,n=1){let i=co(r)?r:()=>r,s=e?t:0,o=e??t;for(let u=s;u<=o&&(yield i(u),!(u+n>o));u+=n);}var po=(t,e,r,n)=>Array.from(tn(t,e,r,n));var ho=(t,e)=>t?t.reduce((r,n)=>{let[i,s]=r;return e(n)?[[...i,n],s]:[i,[...s,n]]},[[],[]]):[[],[]];var fo=class extends Error{constructor(e=[]){super();let r=e.find(n=>n.name)?.name??"";this.name=`AggregateError(${r}...)`,this.message=`AggregateError with ${e.length} errors`,this.stack=e.find(n=>n.stack)?.stack??this.stack,this.errors=e}},mo=async(t,e,r)=>{let n=e.map((c,p)=>({index:p,item:c})),i=async c=>{let p=[];for(;;){let d=n.pop();if(!d)return c(p);let[y,x]=await rn(r)(d.item);p.push({error:y,result:x,index:d.index})}},s=po(1,t).map(()=>new Promise(i)),o=await Promise.all(s),[u,l]=ho(uo(o.flat(),c=>c.index),c=>!!c.error);if(u.length>0)throw new fo(u.map(c=>c.error));return l.map(c=>c.result)};var wi=t=>new Promise(e=>setTimeout(e,t)),rn=t=>(...e)=>{try{let r=t(...e);return El(r)?r.then(n=>[void 0,n]).catch(n=>[n,void 0]):[void 0,r]}catch(r){return[r,void 0]}};async function _l(t,e){let r=t?.times??3,n=t?.delay,i=t?.backoff??null;for(let s of tn(1,r)){let[o,u]=await rn(e)(l=>{throw{_exited:l}});if(!o)return u;if(o._exited)throw o._exited;if(s===r)throw o;n&&await wi(n),i&&await wi(i(s))}throw new Error("unreachable")}var fh=!0,go="Invariant failed";function Ne(t,e){if(!t){if(fh)throw new Error(go);var r=typeof e=="function"?e():e,n=r?"".concat(go,": ").concat(r):go;throw new Error(n)}}var K,ee,G,Wt,Gt,xe,J,Me,Ml,Al,Il,Tl,yi=class{constructor(e,r){h(this,J);h(this,K);h(this,ee);h(this,G,null);w(this,"isStreaming",!1);w(this,"typingIndicator");w(this,"ranOutOfCredits",!1);w(this,"messages",[]);w(this,"conversationId","");h(this,Wt,0);h(this,Gt);w(this,"isLiveMode",!1);h(this,xe,[]);g(this,K,e),g(this,ee,r),a(this,ee).autoConnect!==!1&&g(this,G,this.initWS()),e.addController(this)}get hasQueuedMessages(){return a(this,xe).length>0}async enqueueMessage(e,{expectStreaming:r=!1}={}){if(a(this,xe).length>0){let n=a(this,xe)[a(this,xe).length-1];if(e.type==="USER_INPUT"&&n.message.type==="USER_INPUT"&&e.value===n.message.value)return!0}return a(this,G)||this.connect(),a(this,G)?.isConnected?m(this,J,Me).call(this,e,{expectStreaming:r}):(a(this,xe).push({message:e,options:{expectStreaming:r}}),a(this,K).requestUpdate(),a(this,G)&&!a(this,G).isConnecting&&!a(this,G).isConnected&&this.retry(),await _l({times:5,delay:2e3},async()=>{if(a(this,G)?.isConnected){let n=[...a(this,xe)];g(this,xe,[]),a(this,K).requestUpdate();let i=!1;for(let{message:s,options:o}of n){let u=m(this,J,Me).call(this,s,o);s===e&&(i=u)}return i}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),g(this,xe,[]),a(this,K).requestUpdate(),!1)))}sendUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1}={}){return m(this,J,Me).call(this,{type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n},{expectStreaming:s})}sendImageDelete(e){return Ne(e,"imageId is required"),m(this,J,Me).call(this,{type:"USER_FILE_DELETE",imageId:e})}sendUserCancel(){return m(this,J,Me).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return m(this,J,Me).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return m(this,J,Me).call(this,{type:"USER_TYPING_STOP"})}sendUserMeta(e){return m(this,J,Me).call(this,{type:"USER_META",metadata:e})}reloadConfig(){m(this,J,Me).call(this,{type:"RELOAD_CONFIG"})}close(){a(this,G)?.close(1e3,"closed by user")}retry(){clearTimeout(a(this,Gt)),g(this,Gt,setTimeout(()=>{a(this,ee).onReconnect?.(),g(this,G,this.initWS())},1e3*a(this,Wt))),sl(this,Wt)._++}initWS(){return new gi(a(this,K),{url:()=>a(this,ee).url(this.conversationId,{}),onOpen:e=>m(this,J,Ml).call(this,e),onMessage:e=>m(this,J,Al).call(this,JSON.parse(e.data)),onError:e=>m(this,J,Il).call(this,e),onClose:e=>m(this,J,Tl).call(this,e)})}hostConnected(){this.conversationId=a(this,ee).restoreConversationState?.()?.conversationId||"",this.messages=a(this,ee).restoreConversationState?.()?.messages||[]}reset(){m(this,J,Me).call(this,{type:"NEW_CHAT"}),a(this,ee).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,g(this,xe,[]),a(this,K).requestUpdate()}hostDisconnected(){clearTimeout(a(this,Gt))}connect(){a(this,G)||g(this,G,this.initWS())}reconnectSocket(){a(this,G)?.close(1e3,"destroy"),g(this,G,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};K=new WeakMap,ee=new WeakMap,G=new WeakMap,Wt=new WeakMap,Gt=new WeakMap,xe=new WeakMap,J=new WeakSet,Me=function(e,{expectStreaming:r=!1}={}){return this.ranOutOfCredits?!1:a(this,G)?a(this,G).isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):a(this,G).isConnected?(r&&!this.isLiveMode&&(this.isStreaming=!0,a(this,K).requestUpdate()),a(this,G).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)},Ml=function(e){g(this,Wt,0)},Al=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,{...e.message,streaming:!0}].filter((r,n,i)=>n===i.findIndex(s=>s.id===r.id)),this.typingIndicator=void 0,a(this,K).requestUpdate(),a(this,ee).onNewMessage?.(e.message);break}case"APPEND_MESSAGE":{let r=this.messages.find(n=>n.id===e.message.id);if(r){switch(e.message.content_type){case"text":{let{part:n,delta:i,position:s}=e.message;r.content=r.content.slice(0,s)+i,r.parts||=[],r.parts[n]={text:r.parts[n]&&"text"in r.parts[n]?(r.parts[n].text||"").slice(0,s)+i:i};break}case"html":{let{part:n,delta:i,position:s}=e.message;r.parts||=[],r.parts[n]={html:r.parts[n]&&"html"in r.parts[n]?(r.parts[n].html||"").slice(0,s)+i:i};break}case"data":{let{part:n}=e.message;r.parts||=[],r.parts[n]={tag:e.message.tag,data:r.parts[n]&&"data"in r.parts[n]?Object.assign(r.parts[n].data||{},e.message.data):e.message.data};break}}e.metadata&&(r.metadata=e.metadata),a(this,ee).onMessageAppend?.(e),a(this,K).requestUpdate()}else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let r=this.messages.find(n=>n.id===e.message.id);if(r)Object.assign(r,e.message),r.streaming=!1;else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,a(this,K).requestUpdate(),a(this,ee).onMessageDone?.(e,r),a(this,ee).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,a(this,K).requestUpdate();break}case"ERROR":{a(this,ee).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,a(this,ee).onConnect?.(e.conversationId,e.metadata),a(this,ee).persistConversationState?.(e.conversationId,e.messages),this.isLiveMode=e.metadata?.isLiveMode,a(this,K).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},a(this,K).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,a(this,K).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,a(this,K).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),a(this,K).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Il=function(e){console.error("onError",e),a(this,ee).onError?.(e)},Tl=function(e){a(this,K).isConnected&&a(this,G)&&!a(this,G).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,a(this,K).requestUpdate(),a(this,ee).onClose?.()};var l0=Symbol(),mh=Symbol();var Ll=Object.getPrototypeOf,wo=new WeakMap,gh=t=>t&&(wo.has(t)?wo.get(t):Ll(t)===Object.prototype||Ll(t)===Array.prototype);var jl=t=>gh(t)&&t[mh]||null,yo=(t,e=!0)=>{wo.set(t,e)};var bo=t=>typeof t=="object"&&t!==null,wh=t=>bo(t)&&!xo.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),Ul=(t,e)=>{let r=Ol.get(t);if(r?.[0]===e)return r[1];let n=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return yo(n,!0),Ol.set(t,[e,n]),Reflect.ownKeys(t).forEach(i=>{if(Object.getOwnPropertyDescriptor(n,i))return;let s=Reflect.get(t,i),{enumerable:o}=Reflect.getOwnPropertyDescriptor(t,i),u={value:s,enumerable:o,configurable:!0};if(xo.has(s))yo(s,!1);else if(bt.has(s)){let[l,c]=bt.get(s);u.value=Ul(l,c())}Object.defineProperty(n,i,u)}),Object.preventExtensions(n)},yh=(t,e,r,n)=>({deleteProperty(i,s){let o=Reflect.get(i,s);r(s);let u=Reflect.deleteProperty(i,s);return u&&n(["delete",[s],o]),u},set(i,s,o,u){let l=!t()&&Reflect.has(i,s),c=Reflect.get(i,s,u);if(l&&(Dl(c,o)||vi.has(o)&&Dl(c,vi.get(o))))return!0;r(s),bo(o)&&(o=jl(o)||o);let p=!bt.has(o)&&bh(o)?ko(o):o;return e(s,p),Reflect.set(i,s,p,u),n(["set",[s],o,c]),!0}}),bt=new WeakMap,xo=new WeakSet,Ol=new WeakMap,vo=[1],vi=new WeakMap,Dl=Object.is,vh=(t,e)=>new Proxy(t,e),bh=wh,xh=Ul,kh=yh;function ko(t={}){if(!bo(t))throw new Error("object required");let e=vi.get(t);if(e)return e;let r=vo[0],n=new Set,i=(C,T=++vo[0])=>{r!==T&&(s=r=T,n.forEach(k=>k(C,T)))},s=r,o=(C=vo[0])=>(s!==C&&(s=C,l.forEach(([T])=>{let k=T[1](C);k>r&&(r=k)})),r),u=C=>(T,k)=>{let _=[...T];_[1]=[C,..._[1]],i(_,k)},l=new Map,c=(C,T)=>{let k=!xo.has(T)&&bt.get(T);if(k){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(C))throw new Error("prop listener already exists");if(n.size){let _=k[2](u(C));l.set(C,[k,_])}else l.set(C,[k])}},p=C=>{var T;let k=l.get(C);k&&(l.delete(C),(T=k[1])==null||T.call(k))},d=C=>(n.add(C),n.size===1&&l.forEach(([k,_],L)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&_)throw new Error("remove already exists");let H=k[2](u(L));l.set(L,[k,H])}),()=>{n.delete(C),n.size===0&&l.forEach(([k,_],L)=>{_&&(_(),l.set(L,[k]))})}),y=!0,x=kh(()=>y,c,p,i),S=vh(t,x);vi.set(t,S);let I=[t,o,d];return bt.set(S,I),Reflect.ownKeys(t).forEach(C=>{let T=Object.getOwnPropertyDescriptor(t,C);"value"in T&&T.writable&&(S[C]=t[C])}),y=!1,S}function bi(t,e,r){let n=bt.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i,s=[],o=n[2],u=!1,c=o(p=>{if(s.push(p),r){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,u&&e(s.splice(0))}))});return u=!0,()=>{u=!1,c()}}function Zt(t){let e=bt.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,n]=e;return xh(r,n())}var nn,Kt,xt,Jt,Xt=class{constructor(e,r){h(this,nn);h(this,Kt);h(this,xt);h(this,Jt,()=>{});g(this,nn,e),g(this,Kt,r),g(this,xt,Zt(r)),e.addController(this)}get state(){return a(this,xt)}get value(){return a(this,xt)}hostConnected(){a(this,Jt).call(this),g(this,Jt,bi(a(this,Kt),()=>{g(this,xt,Zt(a(this,Kt))),a(this,nn).requestUpdate()}))}hostDisconnected(){a(this,Jt).call(this)}};nn=new WeakMap,Kt=new WeakMap,xt=new WeakMap,Jt=new WeakMap;var sn,on,kt,Yt,Xe=class{constructor(e,r,n){h(this,sn);h(this,on);w(this,"proxyObject");h(this,kt);h(this,Yt,()=>{});g(this,sn,e),g(this,on,n),this.proxyObject=ko(r),g(this,kt,Zt(this.proxyObject)),e.addController(this)}get state(){return a(this,kt)}get value(){return a(this,kt)}hostConnected(){a(this,Yt).call(this),a(this,on)?.subscribe&&g(this,Yt,bi(this.proxyObject,()=>{g(this,kt,Zt(this.proxyObject)),a(this,sn).requestUpdate()}))}hostDisconnected(){a(this,Yt).call(this)}};sn=new WeakMap,on=new WeakMap,kt=new WeakMap,Yt=new WeakMap;var Qt,an,er,Ct,St,xi=class{constructor(e,{provider:r,tag:n,key:i}){h(this,Qt);h(this,an);h(this,er);h(this,Ct,null);h(this,St,null);g(this,Qt,e),g(this,an,n),g(this,er,i),e.addController(this)}get value(){return a(this,St)?a(this,St).value:null}hostConnected(){if(a(this,St)||(g(this,Ct,Ch(a(this,Qt),a(this,an))),!a(this,Ct)))return;let e=a(this,Ct)[a(this,er)]instanceof Xe?a(this,Ct)[a(this,er)]:null;e&&g(this,St,new Xt(a(this,Qt),e.proxyObject))}hostDisconnected(){}};Qt=new WeakMap,an=new WeakMap,er=new WeakMap,Ct=new WeakMap,St=new WeakMap;function Ch(t,e){let r=t;for(;r;){let n=r.closest(e);if(n)return n;let i=r.getRootNode();if(i instanceof ShadowRoot)r=i.host;else break}return null}var Pl=()=>{if(window.Shopify)try{return{customerId:Sh()}}catch{return null}return null},Sh=()=>{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},Rl=async()=>{try{return(await(await fetch(window.Shopify.routes.root+"cart.js")).json()).items.map(n=>({id:n.id,name:n.title,quantity:n.quantity,price:n.price,variantId:n.variant_id,sku:n.sku,url:n.url,description:n.product_description,image:n.featured_image?.url}))}catch{return[]}};function Bl(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function Co(t){return new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+!*'();@&=,$]*)*(\\?[-a-z\\d%_.~+!*'();@&=,$]*)?(\\#[-a-z\\d%_.~+!*'();@&=,$]*)?$","i").test(t)}function Vl(t,e){let r=t instanceof URL?t:new URL(t);if(e)for(let[n,i]of e)r.searchParams.set(n,i);return r}var Fl=()=>{if(window.ShopRenter)try{let t=Eh();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},Eh=()=>{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}}},Nl=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=Bl(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 Hl=()=>{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},zl=async()=>new Promise((t,e)=>{try{window.UNAS.getCart(r=>{let i=r.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));t(i)})}catch(r){console.error("Error fetching cart information:",r),e(r)}});var So;function $o(t){return{lang:t?.lang??So?.lang,message:t?.message,abortEarly:t?.abortEarly??So?.abortEarly,abortPipeEarly:t?.abortPipeEarly??So?.abortPipeEarly}}var Ah;function Ih(t){return Ah?.get(t)}var Th;function Lh(t){return Th?.get(t)}var jh;function Oh(t,e){return jh?.get(t)?.get(e)}function Wl(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 ge(t,e,r,n,i){let s=i&&"input"in i?i.input:r.value,o=i?.expected??t.expects??null,u=i?.received??Wl(s),l={kind:t.kind,type:t.type,input:s,expected:o,received:u,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${u}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=t.kind==="schema",p=i?.message??t.message??Oh(t.reference,l.lang)??(c?Lh(l.lang):null)??n.message??Ih(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function we(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},$o())}}}function Dh(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Gl(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var Uh=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function Eo(t,e){return{kind:"validation",type:"max_length",reference:Eo,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length>this.requirement&&ge(this,"length",r,n,{received:`${r.value.length}`}),r}}}function _o(t,e){return{kind:"validation",type:"min_length",reference:_o,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length<this.requirement&&ge(this,"length",r,n,{received:`${r.value.length}`}),r}}}function Ph(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function Zl(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function Mo(){return{kind:"schema",type:"any",reference:Mo,expects:"any",async:!1,get"~standard"(){return we(this)},"~run"(t){return t.typed=!0,t}}}function tr(t,e){return{kind:"schema",type:"array",reference:tr,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return we(this)},"~run"(r,n){let i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<i.length;s++){let o=i[s],u=this.item["~run"]({value:o},n);if(u.issues){let l={type:"array",origin:"value",input:i,key:s,value:o};for(let c of u.issues)c.path?c.path.unshift(l):c.path=[l],r.issues?.push(c);if(r.issues||(r.issues=u.issues),n.abortEarly){r.typed=!1;break}}u.typed||(r.typed=!1),r.value.push(u.value)}}else ge(this,"type",r,n);return r}}}function Ao(t){return{kind:"schema",type:"boolean",reference:Ao,expects:"boolean",async:!1,message:t,get"~standard"(){return we(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:ge(this,"type",e,r),e}}}function Io(t){return{kind:"schema",type:"null",reference:Io,expects:"null",async:!1,message:t,get"~standard"(){return we(this)},"~run"(e,r){return e.value===null?e.typed=!0:ge(this,"type",e,r),e}}}function ki(t){return{kind:"schema",type:"number",reference:ki,expects:"number",async:!1,message:t,get"~standard"(){return we(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:ge(this,"type",e,r),e}}}function He(t,e){return{kind:"schema",type:"object",reference:He,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return we(this)},"~run"(r,n){let i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(let s in this.entries){let o=this.entries[s];if(s in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){let u=s in i?i[s]:Zl(o),l=o["~run"]({value:u},n);if(l.issues){let c={type:"object",origin:"value",input:i,key:s,value:u};for(let p of l.issues)p.path?p.path.unshift(c):p.path=[c],r.issues?.push(p);if(r.issues||(r.issues=l.issues),n.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value[s]=l.value}else if(o.fallback!==void 0)r.value[s]=Ph(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(ge(this,"key",r,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else ge(this,"type",r,n);return r}}}function rr(t,e){return{kind:"schema",type:"optional",reference:rr,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return we(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=Zl(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function To(t,e){return{kind:"schema",type:"picklist",reference:To,expects:Gl(t.map(Wl),"|"),async:!1,options:t,message:e,get"~standard"(){return we(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:ge(this,"type",r,n),r}}}function Ci(t,e,r){return{kind:"schema",type:"record",reference:Ci,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return we(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let o in s)if(Dh(s,o)){let u=s[o],l=this.key["~run"]({value:o},i);if(l.issues){let p={type:"object",origin:"key",input:s,key:o,value:u};for(let d of l.issues)d.path=[p],n.issues?.push(d);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}let c=this.value["~run"]({value:u},i);if(c.issues){let p={type:"object",origin:"value",input:s,key:o,value:u};for(let d of c.issues)d.path?d.path.unshift(p):d.path=[p],n.issues?.push(d);if(n.issues||(n.issues=c.issues),i.abortEarly){n.typed=!1;break}}(!l.typed||!c.typed)&&(n.typed=!1),l.typed&&(n.value[l.value]=c.value)}}else ge(this,"type",n,i);return n}}}function X(t){return{kind:"schema",type:"string",reference:X,expects:"string",async:!1,message:t,get"~standard"(){return we(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:ge(this,"type",e,r),e}}}function ql(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function nr(t,e){return{kind:"schema",type:"union",reference:nr,expects:Gl(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return we(this)},"~run"(r,n){let i,s,o;for(let u of this.options){let l=u["~run"]({value:r.value},n);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{i=l;break}else o?o.push(l):o=[l]}if(i)return i;if(s){if(s.length===1)return s[0];ge(this,"type",r,n,{issues:ql(s)}),r.typed=!0}else{if(o?.length===1)return o[0];ge(this,"type",r,n,{issues:ql(o)})}return r}}}function Kl(t,e,r){let n=t["~run"]({value:e},$o(r));if(n.issues)throw new Uh(n.issues);return n.value}function Jl(t,e){let r={};for(let n in t.entries)r[n]=!e||e.includes(n)?rr(t.entries[n]):t.entries[n];return{...t,entries:r,get"~standard"(){return we(this)}}}function Xl(...t){return{...t[0],pipe:t,get"~standard"(){return we(this)},"~run"(e,r){for(let n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=n["~run"](e,r))}return e}}}function ln(t,e,r){let n=t["~run"]({value:e},$o(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var Yl=Ci(X(),nr([X(),ki(),Ao(),Io()])),Ql=Xl(X(),_o(1),Eo(5e3)),ec=()=>{try{return window.UNAS?Hl():window.Shopify?Pl():window.ShopRenter?Fl():null}catch{return null}},tc=async()=>{try{return window.UNAS?await zl():window.Shopify?await Rl():window.ShopRenter?await Nl():[]}catch{return[]}},ir={schema:He({conversationId:rr(X()),messages:rr(tr(He({id:X(),timestamp:ki(),role:To(["user","assistant","support"]),content:X(),parts:rr(tr(nr([He({text:X()}),He({html:X()}),He({tag:X(),data:Ci(X(),Mo())})])))})))}),getStorageKey(t){if(!t)throw new Error("widgetId is not set");return`_molin_${t}`},persist(t,e,r){let n=this.getStorageKey(t);localStorage.setItem(n,JSON.stringify({conversationId:e,messages:r}))},restore(t){try{let e=this.getStorageKey(t),r=JSON.parse(localStorage.getItem(e)||"{}"),n=Kl(this.schema,r);return{conversationId:n.conversationId||"",messages:n.messages||[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(t){let e=this.getStorageKey(t);localStorage.removeItem(e)}};var D,rc,cn,un,sr,R,nc,$i=class $i extends ${constructor(){super();h(this,D);w(this,"contextCtrl");h(this,cn);h(this,un);h(this,sr,null);this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.autoConnect=!1,this.contextCtrl=new Xe(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,ranOutOfCredits:!1,isLiveMode:!1,lastMsg:void 0,hasQueuedMessages:!1,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this),sendImageDelete:a(this,D,R).sendImageDelete.bind(a(this,D,R))})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.autoConnect&&a(this,D,R).connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:a(this,cn),xCustomInstructions:a(this,un),conversationId:a(this,D,R).conversationId,messages:a(this,D,rc),isStreaming:a(this,D,R).isStreaming,typingIndicator:a(this,D,R).typingIndicator,ranOutOfCredits:a(this,D,R).ranOutOfCredits,isLiveMode:a(this,D,R).isLiveMode,lastMsg:a(this,D,R).lastMsg,hasQueuedMessages:a(this,D,R).hasQueuedMessages,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this),sendImageDelete:a(this,D,R).sendImageDelete.bind(a(this,D,R))}),m(this,D,nc).call(this)}sendUserInput(r,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...n},s=a(this,D,R).sendUserInput(r,i);return s&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:a(this,D,R).conversationId}),s}async enqueueUserInput(r,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...n};return a(this,D,R).enqueueUserInput(r,i)}sendUserCancel(){a(this,D,R).sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){a(this,D,R).sendUserTypingStart()}sendUserTypingStop(){a(this,D,R).sendUserTypingStop()}reset(){a(this,D,R).reset()}reloadConfig(){a(this,D,R).reloadConfig()}connect(){a(this,D,R).connect()}render(){return f`<slot></slot>`}};D=new WeakSet,rc=function(){return a(this,D,R)?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:a(this,D,R)?.messages||[]},cn=new WeakMap,un=new WeakMap,sr=new WeakMap,R=function(){return a(this,sr)||g(this,sr,new yi(this,{autoConnect:this.autoConnect,url:r=>{let n=new URL(this.config.wsApiUrl);return n.searchParams.set("widgetId",this.widgetId),n.searchParams.set("conversationId",r),n.searchParams.set("pageUrl",window.location.href),n},onReconnect:()=>{},onError:r=>{console.error("ws error",r)},onClose:()=>{},onNewMessage:r=>{r.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:r,conversationId:a(this,D,R).conversationId})},onMessageAppend:r=>{},onMessageDone:(r,n)=>{n.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:n.content??"",message:n,usage_TOKENS_COMPLETION:r.message.usage.TOKENS_COMPLETION,conversationId:a(this,D,R).conversationId})},onMessageError:r=>{console.error("ws message error",r),r.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+r.message})},onReset:()=>{ir.reset(this.widgetId)},onConnect:(r,n)=>{let i=ec();a(this,D,R).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),tc().then(s=>{s?.length>0&&a(this,D,R).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,cart:s,language:window.navigator.language})}).catch(s=>{console.error(s)}),this.dispatchEvent(new $i.ConnectedEvent({conversationId:r,metadata:n,widgetId:this.widgetId,pendingImages:n?.pendingImages||[]}))},persistConversationState:(r,n)=>{ir.persist(this.widgetId,r,n)},restoreConversationState:()=>ir.restore(this.widgetId)})),a(this,sr)},nc=function(){function r(i){if(!i)return;let s;try{s=typeof i=="object"?i:JSON.parse(i)}catch(u){console.error("Molin: user-data is not valid JSON",u);return}if(!s||typeof s!="object"||Object.keys(s).length===0)return;let o=ln(Yl,s);if(!o.success){console.error("Molin: user-data does not pass schema validation",o.issues);return}return o.output}function n(i){if(!i)return;let s=ln(Ql,i);if(!s.success){console.error("Molin: custom-instructions does not pass schema validation",s.issues);return}return s.output}g(this,cn,r(this.xUserData)),g(this,un,n(this.xCustomInstructions))},w($i,"properties",{widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object},autoConnect:{type:Boolean}});var or=$i;function ic(t){let e=new xi(t,{provider:or,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,n){if(n==="value")return e.value}})}var Lo;or.ConnectedEvent=(Lo=class extends CustomEvent{constructor(e,r={}){super(or.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}},w(Lo,"type","mw-context-widget:connected"),Lo);customElements.get("mw-context-widget")||customElements.define("mw-context-widget",or);function No(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function Rh(t,e=","){return t.map(No).join(e)}var pc=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Ei(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 Ai(t,e="@media "){return e+B(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(n=>`(${n}-width:${r[n]})`).join(" and "))).join(",")}function B(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function sc(t){return t}function Ii(){}var te={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function hc(t){return t.match(/[-=:;]/g)?.length||0}function Po(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(hc(t),15)<<18}var Bh=["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 Ho({n:t,i:e,v:r=[]},n,i,s){t&&(t=No({n:t,i:e,v:r})),s=[...B(s)];for(let u of r){let l=n.theme("screens",u);for(let c of B(l&&Ai(l)||n.v(u))){var o;s.push(c),i|=l?67108864|Po(c):u=="dark"?1073741824:c[0]=="@"?Po(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~Bh.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:i,r:s,i:e}}var dc=new Map;function Ro(t){if(t.d){let e=[],r=jo(t.r.reduce((n,i)=>i[0]=="@"?(e.push(i),n):i?jo(n,s=>jo(i,o=>{let u=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(u){let l=s.indexOf(u[1]);return~l?s.slice(0,l)+u[0]+s.slice(l+u[1].length):Oo(s,o)}return Oo(o,s)})):n,"&"),n=>Oo(n,t.n?"."+pc(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((n,i)=>i+"{"+n+"}",t.d)}}function jo(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,n,i)=>e(n)+i)}function Oo(t,e){return t.replace(/&/g,e)}var oc=new Intl.Collator("en",{numeric:!0});function fc(t,e){for(var r=0,n=t.length;r<n;){let i=n+r>>1;0>=mc(t[i],e)?r=i+1:n=i}return n}function mc(t,e){let r=t.p&te.o;return r==(e.p&te.o)&&(r==te.b||r==te.o)?0:t.p-e.p||t.o-e.o||oc.compare(ac(t.n),ac(e.n))||oc.compare(lc(t.n),lc(e.n))}function ac(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function lc(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Do(t,e){return Math.round(parseInt(t,16)*e)}function ke(t,e={}){if(typeof t=="function")return t(e);let{opacityValue:r="1",opacityVariable:n}=e,i=n?`var(${n})`:r;if(t.includes("<alpha-value>"))return t.replace("<alpha-value>",i);if(t[0]=="#"&&(t.length==4||t.length==7)){let s=(t.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Do(t.substr(1,s),o),Do(t.substr(1+s,s),o),Do(t.substr(1+2*s,s),o),i]})`}return i=="1"?t:i=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function gc(t,e,r,n,i=[]){return(function s(o,{n:u,p:l,r:c=[],i:p},d){let y=[],x="",S=0,I=0;for(let k in o||{}){var C,T;let _=o[k];if(k[0]=="@"){if(!_)continue;if(k[1]=="a"){y.push(...qo(u,l,Mi(""+_),d,l,c,p,!0));continue}if(k[1]=="l"){for(let L of B(_))y.push(...s(L,{n:u,p:(C=te[k[7]],l&~te.o|C),r:k[7]=="d"?[]:c,i:p},d));continue}if(k[1]=="i"){y.push(...B(_).map(L=>({p:-1,o:0,r:[],d:k+" "+L})));continue}if(k[1]=="k"){y.push({p:te.d,o:0,r:[k],d:s(_,{p:te.d},d).map(Ro).join("")});continue}if(k[1]=="f"){y.push(...B(_).map(L=>({p:te.d,o:0,r:[k],d:s(L,{p:te.d},d).map(Ro).join("")})));continue}}if(typeof _!="object"||Array.isArray(_))k=="label"&&_?u=_+Ei(JSON.stringify([l,p,o])):(_||_===0)&&(k=k.replace(/[A-Z]/g,L=>"-"+L.toLowerCase()),I+=1,S=Math.max(S,(T=k)[0]=="-"?0:hc(T)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(T)?+!!RegExp.$1||-!!RegExp.$2:0)+1),x+=(x?";":"")+B(_).map(L=>d.s(k,zo(""+L,d.theme)+(p?" !important":""))).join(";"));else if(k[0]=="@"||k.includes("&")){let L=l;k[0]=="@"&&(k=k.replace(/\bscreen\(([^)]+)\)/g,(H,Q)=>{let ne=d.theme("screens",Q);return ne?(L|=67108864,Ai(ne,"")):H}),L|=Po(k)),y.push(...s(_,{n:u,p:L,r:[...c,k],i:p},d))}else y.push(...s(_,{p:l,r:[...c,k]},d))}return y.unshift({n:u,p:l,o:Math.max(0,15-I)+1.5*Math.min(S||15,15),r:c,d:x}),y.sort(mc)})(t,Ho(e,r,n,i),r)}function zo(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,n,i,s,o="")=>{let u=e(i,o);return typeof u=="function"&&/color|fill|stroke/i.test(i)?ke(u):""+B(u).filter(l=>Object(l)!==l)})}function wc(t,e){let r,n=[];for(let i of t)i.d&&i.n?r?.p==i.p&&""+r.r==""+i.r?(r.c=[r.c,i.c].filter(Boolean).join(" "),r.d=r.d+";"+i.d):n.push(r={...i,n:i.n&&e}):n.push({...i,n:i.n&&e});return n}function _i(t,e,r=te.u,n,i){let s=[];for(let o of t)for(let u of(function(l,c,p,d,y){l={...l,i:l.i||y};let x=(function(S,I){let C=dc.get(S.n);return C?C(S,I):I.r(S.n,S.v[0]=="dark")})(l,c);return x?typeof x=="string"?({r:d,p}=Ho(l,c,p,d),wc(_i(Mi(x),c,p,d,l.i),l.n)):Array.isArray(x)?x.map(S=>{var I,C;return{o:0,...S,r:[...B(d),...B(S.r)],p:(I=p,C=S.p??p,I&~te.o|C)}}):gc(x,l,c,p,d):[{c:No(l),p:0,o:0,r:[]}]})(o,e,r,n,i))s.splice(fc(s,u),0,u);return s}function qo(t,e,r,n,i,s,o,u){return wc((u?r.flatMap(l=>_i([l],n,i,s,o)):_i(r,n,i,s,o)).map(l=>l.p&te.o&&(l.n||e==te.b)?{...l,p:l.p&~te.o|e,o:0}:l),t)}function Vh(t,e,r,n){var i;return i=(s,o)=>{let{n:u,p:l,r:c,i:p}=Ho(s,o,e);return r&&qo(u,e,r,o,l,c,p,n)},dc.set(t,i),t}function Uo(t,e,r){if(t[t.length-1]!="("){let n=[],i=!1,s=!1,o="";for(let u of t)if(!(u=="("||/[~@]$/.test(u))){if(u[0]=="!"&&(u=u.slice(1),i=!i),u.endsWith(":")){n[u=="dark:"?"unshift":"push"](u.slice(0,-1));continue}u[0]=="-"&&(u=u.slice(1),s=!s),u.endsWith("-")&&(u=u.slice(0,-1)),u&&u!="&"&&(o+=(o&&"-")+u)}o&&(s&&(o="-"+o),e[0].push({n:o,v:n.filter(Fh),i}))}}function Fh(t,e,r){return r.indexOf(t)==e}var cc=new Map;function Mi(t){let e=cc.get(t);if(!e){let r=[],n=[[]],i=0,s=0,o=null,u=0,l=(c,p=0)=>{i!=u&&(r.push(t.slice(i,u+p)),c&&Uo(r,n)),i=u+1};for(;u<t.length;u++){let c=t[u];if(s)t[u-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)t[u-1]!="\\"&&o.test(t.slice(u))&&(o=null,i=u+RegExp.lastMatch.length);else if(c=="/"&&t[u-1]!="\\"&&(t[u+1]=="*"||t[u+1]=="/"))o=t[u+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),r.push(c);else if(c==":")t[u+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let p=r.lastIndexOf("(");if(c==")"){let d=r[p-1];if(/[~@]$/.test(d)){let y=n.shift();r.length=p,Uo([...r,"#"],n);let{v:x}=n[0].pop();for(let S of y)S.v.splice(+(S.v[0]=="dark")-+(x[0]=="dark"),x.length);Uo([...r,Vh(d.length>1?d.slice(0,-1)+Ei(JSON.stringify([d,y])):d+"("+Rh(y)+")",te.a,y,/@$/.test(d))],n)}p=r.lastIndexOf("(",p-1)}r.length=p+1}else/[~@]/.test(c)&&t[u+1]=="("&&n.unshift([])}l(!0),cc.set(t,e=n[0])}return e}function v(t,e,r){return[t,Bo(e,r)]}function Bo(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,n)=>({[t]:e?e(r,n):Vo(r,1)}):r=>t||{[r[1]]:Vo(r,2)}}function Vo(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function b(t,e,r,n){return[t,Wo(e,r,n)]}function Wo(t,e,r){let n=typeof e=="string"?(i,s)=>({[e]:r?r(i,s):i._}):e||(({1:i,_:s},o,u)=>({[i||u]:s}));return(i,s)=>{let o=yc(t||i[1]),u=s.theme(o,i.$$)??je(i.$$,o,s);if(u!=null)return i._=Vo(i,0,u),n(i,s,o)}}function re(t,e={},r){return[t,Nh(e,r)]}function Nh(t={},e){return(r,n)=>{let{section:i=yc(r[0]).replace("-","")+"Color"}=t,[s,o]=Hh(r.$$);if(!s)return;let u=n.theme(i,s)||je(s,i,n);if(!u||typeof u=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:c=i.replace("Color","Opacity"),property:p=i,selector:d}=t,y=n.theme(c,o||"DEFAULT")||o&&je(o,c,n),x=e||(({_:I})=>{let C=pn(p,I);return d?{[d]:C}:C});r._={value:ke(u,{opacityVariable:l||void 0,opacityValue:y||void 0}),color:I=>ke(u,I),opacityVariable:l||void 0,opacityValue:y||void 0};let S=x(r,n);if(!r.dark){let I=n.d(i,s,u);I&&I!==u&&(r._={value:ke(I,{opacityVariable:l||void 0,opacityValue:y||"1"}),color:C=>ke(I,C),opacityVariable:l||void 0,opacityValue:y||void 0},S={"&":S,[n.v("dark")]:x(r,n)})}return S}}function Hh(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function pn(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 je(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=ar(zo(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 yc(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function ar(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",n,i="")=>ar(r)+n+ar(i)):t.replace(/(^|[^\\])_+/g,(e,r)=>r+" ".repeat(e.length-r.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function Go({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:B(e.variants),rules:B(e.rules),ignorelist:B(e.ignorelist),hash:void 0,stringify:(n,i)=>n+":"+i,finalize:[]};for(let n of B([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&B(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:i,darkMode:s=r.darkMode,darkColor:o=r.darkColor,theme:u,variants:l,rules:c,ignorelist:p,hash:d=r.hash,stringify:y=r.stringify,finalize:x}=typeof n=="function"?n(r):n;r={preflight:r.preflight!==!1&&i!==!1&&[...r.preflight,...B(i)],darkMode:s,darkColor:o,theme:{...r.theme,...u,extend:{...r.theme.extend,...u?.extend}},variants:[...r.variants,...B(l)],rules:[...r.rules,...B(c)],ignorelist:[...r.ignorelist,...B(p)],hash:d,stringify:y,finalize:[...r.finalize,...B(x)]}}return r}function uc(t,e,r,n,i,s){for(let o of e){let u=r.get(o);u||r.set(o,u=n(o));let l=u(t,i,s);if(l)return l}}function zh(t){var e;return Fo(t[0],typeof(e=t[1])=="function"?e:()=>e)}function qh(t){var e,r;return Array.isArray(t)?Fo(t[0],Bo(t[1],t[2])):Fo(t,Bo(e,r))}function Fo(t,e){return vc(t,(r,n,i,s)=>{let o=n.exec(r);if(o)return o.$$=r.slice(o[0].length),o.dark=s,e(o,i)})}function vc(t,e){let r=B(t).map(Wh);return(n,i,s)=>{for(let o of r){let u=e(n,o,i,s);if(u)return u}}}function Wh(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function bc(t,e){let r=Go(t),n=(function({theme:l,darkMode:c,darkColor:p=Ii,variants:d,rules:y,hash:x,stringify:S,ignorelist:I,finalize:C}){let T=new Map,k=new Map,_=new Map,L=new Map,H=vc(I,(P,ie)=>ie.test(P));d.push(["dark",Array.isArray(c)||c=="class"?`${B(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let Q=typeof x=="function"?P=>x(P,Ei):x?Ei:sc;Q!==sc&&C.push(P=>({...P,n:P.n&&Q(P.n),d:P.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(ie,pe)=>"--"+Q(pe).replace("#",""))}));let ne={theme:(function({extend:P={},...ie}){let pe={},Zs={get colors(){return ht("colors")},theme:ht,negative(){return{}},breakpoints(Z){let se={};for(let fe in Z)typeof Z[fe]=="string"&&(se["screen-"+fe]=Z[fe]);return se}};return ht;function ht(Z,se,fe,Nr){if(Z){if({1:Z,2:Nr}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(Z)||[,Z],/[.[]/.test(Z)){let Be=[];Z.replace(/\[([^\]]+)\]|([^.[]+)/g,(ft,zr,Gp=zr)=>Be.push(Gp)),Z=Be.shift(),fe=se,se=Be.join("-")}let Le=pe[Z]||Object.assign(Object.assign(pe[Z]={},si(ie,Z)),si(P,Z));if(se==null)return Le;se||(se="DEFAULT");let dt=Le[se]??se.split("-").reduce((Be,ft)=>Be?.[ft],Le)??fe;return Nr?ke(dt,{opacityValue:zo(Nr,ht)}):dt}let Hr={};for(let Le of[...Object.keys(ie),...Object.keys(P)])Hr[Le]=ht(Le);return Hr}function si(Z,se){let fe=Z[se];return typeof fe=="function"&&(fe=fe(Zs)),fe&&/color|fill|stroke/i.test(se)?(function Nr(Hr,Le=[]){let dt={};for(let Be in Hr){let ft=Hr[Be],zr=[...Le,Be];dt[zr.join("-")]=ft,Be=="DEFAULT"&&(zr=Le,dt[Le.join("-")]=ft),typeof ft=="object"&&Object.assign(dt,Nr(ft,zr))}return dt})(fe):fe}})(l),e:pc,h:Q,s(P,ie){return S(P,ie,ne)},d(P,ie,pe){return p(P,ie,ne,pe)},v(P){return T.has(P)||T.set(P,uc(P,d,k,zh,ne)||"&:"+P),T.get(P)},r(P,ie){let pe=JSON.stringify([P,ie]);return _.has(pe)||_.set(pe,!H(P,ne)&&uc(P,y,L,qh,ne,ie)),_.get(pe)},f(P){return C.reduce((ie,pe)=>pe(ie,ne),P)}};return ne})(r),i=new Map,s=[],o=new Set;e.resume(l=>i.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),o.add(l)});function u(l){let c=n.f(l),p=Ro(c);if(p&&!o.has(p)){o.add(p);let d=fc(s,l);e.insert(p,d,l),s.splice(d,0,l)}return c.n}return Object.defineProperties(function(c){if(!i.size)for(let d of B(r.preflight))typeof d=="function"&&(d=d(n)),d&&(typeof d=="string"?qo("",te.b,Mi(d),n,te.b,[],!1,!0):gc(d,{},n,te.b)).forEach(u);c=""+c;let p=i.get(c);if(!p){let d=new Set;for(let y of _i(Mi(c),n))d.add(y.c).add(u(y));p=[...d].filter(Boolean).join(" "),i.set(c,p).set(p,p)}return p},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:n.theme,config:r,snapshot(){let l=e.snapshot(),c=new Set(o),p=new Map(i),d=[...s];return()=>{l(),o=c,i=p,s=d}},clear(){e.clear(),o=new Set,i=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Gh(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function xc(t){let e=new MutationObserver(r);return{observe(i){e.observe(i,{attributeFilter:["class"],subtree:!0,childList:!0}),n(i),r([{target:i,type:""}])},disconnect(){e.disconnect()}};function r(i){for(let{type:s,target:o}of i)if(s[0]=="a")n(o);else for(let u of o.querySelectorAll("[class]"))n(u);e.takeRecords()}function n(i){let s,o=i.getAttribute?.("class");o&&Gh(o,s=t(o))&&i.setAttribute("class",s)}}function Zh(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 Ti(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:Zh(t)).sheet;return{target:e,snapshot(){let r=Array.from(e.cssRules,n=>n.cssText);return()=>{this.clear(),r.forEach(this.insert)}},clear(){for(let r=e.cssRules.length;r--;)e.deleteRule(r)},destroy(){e.ownerNode?.remove()},insert(r,n){try{e.insertRule(r,n)}catch{e.insertRule(":root{}",n)}},resume:Ii}}var Kh=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 kc(t){return Kh.get(t)}function Cc(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 Sc(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 Jh=[["-webkit-",1],["-moz-",2],["-ms-",4]];function $c(){return({stringify:t})=>({stringify(e,r,n){let i="",s=kc(e);s&&(i+=t(s,r,n)+";");let o=Cc(e),u=Sc(e,r);for(let l of Jh)o&l[1]&&(i+=t(l[0]+e,r,n)+";"),u&l[1]&&(i+=t(e,l[0]+r,n)+";");return i+t(e,r,n)}})}function _c(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",Wo("lineClamp",({_:t})=>Ec(t))],["line-clamp-(\\d+)",({1:t})=>Ec(t)]]}}function Ec(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var dn={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",...ye(4,"rem",4,.5,.5),...ye(12,"rem",4,5),14:"3.5rem",...ye(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:U("blur"),backdropBrightness:U("brightness"),backdropContrast:U("contrast"),backdropGrayscale:U("grayscale"),backdropHueRotate:U("hueRotate"),backdropInvert:U("invert"),backdropOpacity:U("opacity"),backdropSaturate:U("saturate"),backdropSepia:U("sepia"),backgroundColor:U("colors"),backgroundImage:{none:"none"},backgroundOpacity:U("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:{...ye(200,"",100,0,50),...ye(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:U("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:U("spacing"),borderWidth:{DEFAULT:"1px",...Ce(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:U("colors"),caretColor:U("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...ye(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:U("borderColor"),divideOpacity:U("borderOpacity"),divideWidth:U("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"),...hn(2,6),...hn(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:U("spacing"),gradientColorStops:U("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"),...hn(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...hn(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:{...ye(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:{...ye(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:U("spacing"),placeholderColor:U("colors"),placeholderOpacity:U("opacity"),outlineColor:U("colors"),outlineOffset:Ce(8,"px"),outlineWidth:Ce(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:U("colors"),ringOffsetWidth:Ce(8,"px"),ringOpacity:({theme:t})=>({...t("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Ce(8,"px")},rotate:{...Ce(2,"deg"),...Ce(12,"deg",3),...Ce(180,"deg",45)},saturate:ye(200,"",100,0,50),scale:{...ye(150,"",100,0,50),...ye(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:U("spacing"),scrollPadding:U("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Ce(2,"deg"),...Ce(12,"deg",3)},space:U("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:ye(2),textColor:U("colors"),textDecorationColor:U("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Ce(8,"px")},textUnderlineOffset:{auto:"auto",...Ce(8,"px")},textIndent:U("spacing"),textOpacity:U("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:U("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"),...hn(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:{...ye(50,"",1,0,10),auto:"auto"}};function hn(t,e){let r={};do for(var n=1;n<t;n++)r[`${n}/${t}`]=Number((n/t*100).toFixed(6))+"%";while(++t<=e);return r}function Ce(t,e,r=0){let n={};for(;r<=t;r=2*r||1)n[r]=r+e;return n}function ye(t,e="",r=1,n=0,i=1,s={}){for(;n<=t;n+=i)s[n]=n/r+e;return s}function U(t){return({theme:e})=>e(t)}var Mc={"*,::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, ${dn.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, ${dn.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 Oc=[v("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:je(`[${e}]`,"",r)}}})),v("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),b("aspect-","aspectRatio"),v("container",(t,{theme:e})=>{let{screens:r=e("screens"),center:n,padding:i}=e("container"),s={width:"100%",marginRight:n&&"auto",marginLeft:n&&"auto",...o("xs")};for(let u in r){let l=r[u];typeof l=="string"&&(s[Ai(l)]={"&":{maxWidth:l,...o(u)}})}return s;function o(u){let l=i&&(typeof i=="string"?i:i[u]||i.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),b("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),v("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),v("box-(border|content)","boxSizing",({1:t})=>t+"-box"),v("hidden",{display:"none"}),v("table-(auto|fixed)","tableLayout"),v(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",v("isolate","isolation"),v("object-(contain|cover|fill|none|scale-down)","objectFit"),b("object-","objectPosition"),v("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Li),v("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),v("(static|fixed|absolute|relative|sticky)","position"),b("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),b("-?(top|bottom|left|right)(?:$|-)","inset"),v("(visible|collapse)","visibility"),v("invisible",{visibility:"hidden"}),b("-?z-","zIndex"),v("flex-((row|col)(-reverse)?)","flexDirection",Ac),v("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),b("(flex-(?:grow|shrink))(?:$|-)"),b("(flex)-"),b("grow(?:$|-)","flexGrow"),b("shrink(?:$|-)","flexShrink"),b("basis-","flexBasis"),b("-?(order)-"),"-?(order)-(\\d+)",b("grid-cols-","gridTemplateColumns"),v("grid-cols-(\\d+)","gridTemplateColumns",jc),b("col-","gridColumn"),v("col-(span)-(\\d+)","gridColumn",Lc),b("col-start-","gridColumnStart"),v("col-start-(auto|\\d+)","gridColumnStart"),b("col-end-","gridColumnEnd"),v("col-end-(auto|\\d+)","gridColumnEnd"),b("grid-rows-","gridTemplateRows"),v("grid-rows-(\\d+)","gridTemplateRows",jc),b("row-","gridRow"),v("row-(span)-(\\d+)","gridRow",Lc),b("row-start-","gridRowStart"),v("row-start-(auto|\\d+)","gridRowStart"),b("row-end-","gridRowEnd"),v("row-end-(auto|\\d+)","gridRowEnd"),v("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>Li(Ac(t))),v("grid-flow-(dense)","gridAutoFlow"),b("auto-cols-","gridAutoColumns"),b("auto-rows-","gridAutoRows"),b("gap-x(?:$|-)","gap","columnGap"),b("gap-y(?:$|-)","gap","rowGap"),b("gap(?:$|-)","gap"),"(justify-(?:items|self))-",v("justify-","justifyContent",Ic),v("(content|items|self)-",t=>({["align-"+t[1]]:Ic(t)})),v("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),b("p([xytrbl])?(?:$|-)","padding",lr("padding")),b("-?m([xytrbl])?(?:$|-)","margin",lr("margin")),b("-?space-(x|y)(?:$|-)","space",({1:t,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[t]]:`calc(${e} * calc(1 - var(--tw-space-${t}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[t]]:`calc(${e} * var(--tw-space-${t}-reverse))`}})),v("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),b("w-","width"),b("min-w-","minWidth"),b("max-w-","maxWidth"),b("h-","height"),b("min-h-","minHeight"),b("max-h-","maxHeight"),b("font-","fontWeight"),b("font-","fontFamily",({_:t})=>typeof(t=B(t))[1]=="string"?{fontFamily:Ae(t)}:{fontFamily:Ae(t[0]),...t[1]}),v("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),v("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),v("italic","fontStyle"),v("not-italic",{fontStyle:"normal"}),v("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:t,2:e="",3:r})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(r?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":t)]:t,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...Ye({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),b("tracking-","letterSpacing"),b("leading-","lineHeight"),v("list-(inside|outside)","listStylePosition"),b("list-","listStyleType"),v("list-","listStyleType"),b("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),re("placeholder-",{property:"color",selector:"&::placeholder"}),v("text-(left|center|right|justify|start|end)","textAlign"),v("text-(ellipsis|clip)","textOverflow"),b("text-opacity-","textOpacity","--tw-text-opacity"),re("text-",{property:"color"}),b("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),b("indent-","textIndent"),v("(overline|underline|line-through)","textDecorationLine"),v("no-underline",{textDecorationLine:"none"}),b("underline-offset-","textUnderlineOffset"),re("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),b("decoration-","textDecorationThickness"),v("decoration-","textDecorationStyle"),v("(uppercase|lowercase|capitalize)","textTransform"),v("normal-case",{textTransform:"none"}),v("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),v("align-","verticalAlign"),v("whitespace-","whiteSpace"),v("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),v("break-words",{overflowWrap:"break-word"}),v("break-all",{wordBreak:"break-all"}),v("break-keep",{wordBreak:"keep-all"}),re("caret-",{opacityVariable:!1,opacitySection:"opacity"}),re("accent-",{opacityVariable:!1,opacitySection:"opacity"}),v("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${$t(t," ")},var(--tw-gradient-stops))`),re("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-from":t.value,"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),re("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${t.value},var(--tw-gradient-to)`})),re("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),v("bg-(fixed|local|scroll)","backgroundAttachment"),v("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),v(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),v("bg-blend-","backgroundBlendMode"),v("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),b("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),re("bg-",{section:"backgroundColor"}),b("bg-","backgroundImage"),b("bg-","backgroundPosition"),v("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Li),b("bg-","backgroundSize"),b("rounded(?:$|-)","borderRadius"),b("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:t,_:e})=>{let r={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[t]||[t,t];return{[`border-${$t(r[0])}-radius`]:e,[`border-${$t(r[1])}-radius`]:e}}),v("border-(collapse|separate)","borderCollapse"),b("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),v("border-(solid|dashed|dotted|double|none)","borderStyle"),b("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...Ye({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(t||"-x")]:e,["--tw-border-spacing"+(t||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),re("border-([xytrbl])-",{section:"borderColor"},lr("border","Color")),re("border-"),b("border-([xytrbl])(?:$|-)","borderWidth",lr("border","Width")),b("border(?:$|-)","borderWidth"),b("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),v("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),v("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),b("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${$t(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${$t(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),re("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),b("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),re("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),b("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),v("ring-inset",{"--tw-ring-inset":"inset"}),re("ring-",{property:"--tw-ring-color"}),b("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...Ye({"--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":ke(e("ringOffsetColor","","#fff")),"--tw-ring-color":ke(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${t} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),re("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),b("shadow(?:$|-)","boxShadow",({_:t})=>({...Ye({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":Ae(t),"--tw-shadow-colored":Ae(t).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),b("(opacity)-"),v("mix-blend-","mixBlendMode"),...Tc(),...Tc("backdrop-"),b("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:Ae(t),transitionTimingFunction:t._=="none"?void 0:Ae(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:Ae(e("transitionDuration",""))})),b("duration(?:$|-)","transitionDuration","transitionDuration",Ae),b("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Ae),b("delay(?:$|-)","transitionDelay","transitionDelay",Ae),b("animate(?:$|-)","animation",(t,{theme:e,h:r,e:n})=>{let i=Ae(t),s=i.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=n(r(s[0])))]:o,animation:s.join(" ")}:{animation:i}}),"(transform)-(none)",v("transform",Ko),v("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":Dc(t=="gpu")})),b("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...Ko()})),b("-?(rotate)-","rotate",Zo),b("-?(translate-[xy])-","translate",Zo),b("-?(skew-[xy])-","skew",Zo),v("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Li),"(appearance)-",b("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",b("(cursor)-"),"(cursor)-",v("snap-(none)","scroll-snap-type"),v("snap-(x|y|both)",({1:t})=>({...Ye({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),v("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),v("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),v("snap-(normal|always)","scroll-snap-stop"),v("scroll-(auto|smooth)","scroll-behavior"),b("scroll-p([xytrbl])?(?:$|-)","padding",lr("scroll-padding")),b("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",lr("scroll-margin")),v("touch-(auto|none|manipulation)","touch-action"),v("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...Ye({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":r?"pan-y":t}`]:t,"touch-action":"var(--tw-touch-action)"})),v("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),v("outline",{outlineStyle:"solid"}),v("outline-(dashed|dotted|double)","outlineStyle"),b("-?(outline-offset)-"),re("outline-",{opacityVariable:!1,opacitySection:"opacity"}),b("outline-","outlineWidth"),"(pointer-events)-",b("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],v("select-(none|text|all|auto)","userSelect"),re("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),re("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),b("stroke-","strokeWidth"),v("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),v("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Li(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function Ac(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function $t(t,e="-"){let r=[];for(let n of t)r.push({t:"top",r:"right",b:"bottom",l:"left"}[n]);return r.join(e)}function Ae(t){return t&&""+(t._||t)}function Ic({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function lr(t,e=""){return({1:r,_:n})=>{let i={x:"lr",y:"tb"}[r]||r+r;return i?{...pn(t+"-"+$t(i[0])+e,n),...pn(t+"-"+$t(i[1])+e,n)}:pn(t+e,n)}}function Tc(t=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",t&&"opacity","saturate","sepia",!t&&"drop-shadow"].filter(Boolean),r={};for(let n of e)r[`--tw-${t}${n}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...Ye(r),[`${t}filter`]:e.map(n=>`var(--tw-${t}${n})`).join(" ")},[`(${t}filter)-(none)`,v(`${t}filter`,r),...e.map(n=>b(`${n[0]=="h"?"-?":""}(${t}${n})(?:$|-)`,n,({1:i,_:s})=>({[`--tw-${i}`]:B(s).map(o=>`${n}(${o})`).join(" "),...r})))]}function Zo({1:t,_:e}){return{["--tw-"+t]:e,...Ko()}}function Ko(){return{...Ye({"--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":Dc()}),transform:"var(--tw-transform)"}}function Dc(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 Lc({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function jc({1:t}){return`repeat(${t},minmax(0,1fr))`}function Ye(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var Uc=[["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)||je(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:n="",6:i=e},{e:s,h:o,v:u})=>{let l=ar(n)||(r[0]=="["?r:u(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(t+i))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||je(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)||je(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=je(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&ar(t).replace(/[}]+$/,"").split("{")]];function Pc({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:Mc,theme:{...dn,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:Uc,rules:Oc,finalize(r){return r.n&&r.d&&r.r.some(n=>/^&::(before|after)$/.test(n))&&!/(^|;)content:/.test(r.d)?{...r,d:"content:var(--tw-content);"+r.d}:r}}}var Xh={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Yh={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Qh={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},ed={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},td={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},rd={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},nd={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},id={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},sd={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},od={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},ad={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},ld={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},cd={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},ud={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},pd={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},hd={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},dd={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},fd={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},md={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},gd={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},wd={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},yd={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Rc={__proto__:null,slate:Xh,gray:Yh,zinc:Qh,neutral:ed,stone:td,red:rd,orange:nd,amber:id,yellow:sd,lime:od,green:ad,emerald:ld,teal:cd,cyan:ud,sky:pd,blue:hd,indigo:dd,violet:fd,purple:md,fuchsia:gd,pink:wd,rose:yd};function Bc({disablePreflight:t}={}){return Pc({colors:Rc,disablePreflight:t})}function Nc({className:t="prose",defaultColor:e="gray",extend:r={},colors:n={}}={}){return n={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...n,dark:n.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...n.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${t}-${s}`,(u,l)=>Hc(t,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${t})`,({1:s},{h:o})=>[{c:o(s)}]],[`${t}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[t+"-",({$$:s},o)=>{let u=Fc(o.theme("fontSize",s));return u&&{"@layer components":u}}],[t+"-",({$$:s},o)=>i(s,o)],[t,(s,o)=>({...i(e,o),"@layer base":[Vc(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:E(20,16),marginBottom:E(20,16),paddingLeft:E(26,16)},li:{marginTop:E(8,16),marginBottom:E(8,16)},"ol>li,ul>li":{paddingLeft:E(6,16)},">ul>li p":{marginTop:E(12,16),marginBottom:E(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:E(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:E(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:E(12,16),marginBottom:E(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:E(48,16),marginBottom:E(48,16)},blockquote:{marginTop:E(32,20),marginBottom:E(32,20),paddingLeft:E(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:E(20,16),marginBottom:E(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:E(36,16),marginTop:"0",marginBottom:E(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:E(24,16),marginTop:E(48,24),marginBottom:E(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:E(20,16),marginTop:E(32,20),marginBottom:E(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:E(24,16),marginBottom:E(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:E(32,16),marginBottom:E(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:E(14,16),lineHeight:"1.4",marginTop:E(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:E(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:E(21,24)},"h3 code":{fontSize:E(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:E(14,16),lineHeight:"1.7",marginTop:E(24,14),marginBottom:E(24,14),borderRadius:"0.375rem",paddingTop:E(12,14),paddingRight:E(16,14),paddingBottom:E(12,14),paddingLeft:E(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:E(32,16),marginBottom:E(32,16),fontSize:E(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:E(8,14),paddingBottom:E(8,14),paddingLeft:E(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:E(8,14),paddingRight:E(8,14),paddingBottom:E(8,14),paddingLeft:E(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:E(20,16),lineHeight:"1.6",marginTop:E(24,20),marginBottom:E(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Vc(t,o,r)],"@layer components":{...Fc(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function i(s,o){let u={},l={},c=(p,d,y)=>{let x=o.theme(`colors.${s}.${d}`,d);y["--tw-prose-"+p]=ke(x);let S=y!=l&&o.d("colors",`${s}-${d}`,x);S&&(l["--tw-prose-"+p]=ke(S))};for(let p in n){let d=n[p];p!="dark"&&d&&c(p,d,u)}for(let p in n.dark||{}){let d=n.dark[p];d&&(n.dark?c("invert-"+p,d,u):c(p,d,l))}return Object.keys(u).length?{"@layer defaults":{"&":u,[o.v("dark")]:l}}:void 0}}function Vc(t,e,r){let n={};for(let i in r)n[Hc(t,i,e,s=>`.${e.e(e.h(t))}${s}`)]=r[i];return n}function Hc(t,e,{e:r,h:n},i){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",u=s,l="")=>i(`${o}:where(${u}):not(:where(.${r(n("not-"+t))} *))${l}`))}function Fc(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function E(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var Jo=Go({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:[Bc(),$c(),_c(),Nc()]});function zc(t,e=!0){let r=(function(){if(vd)try{let l=Ti(new CSSStyleSheet);return l.connect=c=>{let p=Xo(c);p.adoptedStyleSheets=[...p.adoptedStyleSheets,l.target]},l.disconnect=Ii,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Ti(s)],u=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(c=>c.snapshot());return()=>l.forEach(c=>c())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,c,p){o[0].insert(l,c,p);let d=this.target.cssRules[c];o.forEach((y,x)=>x&&y.target.insertRule(d.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");Xo(l).appendChild(c);let p=Ti(c),{cssRules:d}=this.target;for(let y=0;y<d.length;y++)p.target.insertRule(d[y].cssText,y);o.push(p),u.set(l,p)},disconnect(l){let c=o.indexOf(u.get(l));c>=0&&o.splice(c,1)}}})(),n=bc({...t,hash:t.hash??e},r),i=xc(n);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),i.observe(Xo(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=n}}}}var vd=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function Xo(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var M=t=>zc(Jo)(t);var fn=class extends M($){constructor(){super(),this.color="#601feb",this.radius="16.8576px",this.size="320px",this.border="#d1d5db"}render(){return f`
|
|
126
|
+
</svg>`};var dh=Sl,ao=class extends mi{resolveIcon(e){let r=dh[e];if(!r)throw console.warn("hi-outline: icon not found",e),new Error(`Icon ${e} not found`);return r}render(){super.render();let e=this.shadowRoot?.querySelector("svg");if(!e)throw new Error("svgEl not found "+this.name);e.setAttribute("fill","none"),e.querySelectorAll("[stroke]").forEach(r=>{r.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",ao);var Qr,he,me,en,lo,gi=class{constructor(e,r){h(this,en);h(this,Qr);h(this,he);h(this,me);if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");g(this,Qr,e),a(this,Qr).addController(this),g(this,he,r)}connect(e){g(this,he,e),g(this,me,m(this,en,lo).call(this))}hostConnected(){a(this,me)||setTimeout(()=>{a(this,me)||g(this,me,m(this,en,lo).call(this))},0)}hostDisconnected(){a(this,me)?.close(1e3,"lit_host_disconnected"),g(this,me,void 0)}send(e){a(this,me)?.send(e)}close(e,r){a(this,me)?.close(e,r)}get isConnected(){return a(this,me)?.readyState===WebSocket.OPEN}get isConnecting(){return a(this,me)?.readyState===WebSocket.CONNECTING}};Qr=new WeakMap,he=new WeakMap,me=new WeakMap,en=new WeakSet,lo=function(){let e=new WebSocket(a(this,he).url());return a(this,he).onClose&&(e.onclose=a(this,he).onClose),a(this,he).onOpen&&(e.onopen=a(this,he).onOpen),a(this,he).onError&&(e.onerror=a(this,he).onError),a(this,he).onMessage&&(e.onmessage=a(this,he).onMessage),e};var $l=Array.isArray;var co=t=>!!(t&&t.constructor&&t.call&&t.apply);var El=t=>!(!t||!t.then||!co(t.then));var uo=(t,e,r=!1)=>{if(!t)return[];let n=(s,o)=>e(s)-e(o),i=(s,o)=>e(o)-e(s);return t.slice().sort(r===!0?i:n)};function*tn(t,e,r=i=>i,n=1){let i=co(r)?r:()=>r,s=e?t:0,o=e??t;for(let u=s;u<=o&&(yield i(u),!(u+n>o));u+=n);}var po=(t,e,r,n)=>Array.from(tn(t,e,r,n));var ho=(t,e)=>t?t.reduce((r,n)=>{let[i,s]=r;return e(n)?[[...i,n],s]:[i,[...s,n]]},[[],[]]):[[],[]];var fo=class extends Error{constructor(e=[]){super();let r=e.find(n=>n.name)?.name??"";this.name=`AggregateError(${r}...)`,this.message=`AggregateError with ${e.length} errors`,this.stack=e.find(n=>n.stack)?.stack??this.stack,this.errors=e}},mo=async(t,e,r)=>{let n=e.map((c,p)=>({index:p,item:c})),i=async c=>{let p=[];for(;;){let f=n.pop();if(!f)return c(p);let[y,x]=await rn(r)(f.item);p.push({error:y,result:x,index:f.index})}},s=po(1,t).map(()=>new Promise(i)),o=await Promise.all(s),[u,l]=ho(uo(o.flat(),c=>c.index),c=>!!c.error);if(u.length>0)throw new fo(u.map(c=>c.error));return l.map(c=>c.result)};var wi=t=>new Promise(e=>setTimeout(e,t)),rn=t=>(...e)=>{try{let r=t(...e);return El(r)?r.then(n=>[void 0,n]).catch(n=>[n,void 0]):[void 0,r]}catch(r){return[r,void 0]}};async function _l(t,e){let r=t?.times??3,n=t?.delay,i=t?.backoff??null;for(let s of tn(1,r)){let[o,u]=await rn(e)(l=>{throw{_exited:l}});if(!o)return u;if(o._exited)throw o._exited;if(s===r)throw o;n&&await wi(n),i&&await wi(i(s))}throw new Error("unreachable")}var fh=!0,go="Invariant failed";function Ne(t,e){if(!t){if(fh)throw new Error(go);var r=typeof e=="function"?e():e,n=r?"".concat(go,": ").concat(r):go;throw new Error(n)}}var K,ee,G,Wt,Gt,xe,J,Me,Ml,Al,Il,Tl,yi=class{constructor(e,r){h(this,J);h(this,K);h(this,ee);h(this,G,null);w(this,"isStreaming",!1);w(this,"typingIndicator");w(this,"ranOutOfCredits",!1);w(this,"messages",[]);w(this,"conversationId","");h(this,Wt,0);h(this,Gt);w(this,"isLiveMode",!1);h(this,xe,[]);g(this,K,e),g(this,ee,r),a(this,ee).autoConnect!==!1&&g(this,G,this.initWS()),e.addController(this)}get hasQueuedMessages(){return a(this,xe).length>0}async enqueueMessage(e,{expectStreaming:r=!1}={}){if(a(this,xe).length>0){let n=a(this,xe)[a(this,xe).length-1];if(e.type==="USER_INPUT"&&n.message.type==="USER_INPUT"&&e.value===n.message.value)return!0}return a(this,G)||this.connect(),a(this,G)?.isConnected?m(this,J,Me).call(this,e,{expectStreaming:r}):(a(this,xe).push({message:e,options:{expectStreaming:r}}),a(this,K).requestUpdate(),a(this,G)&&!a(this,G).isConnecting&&!a(this,G).isConnected&&this.retry(),await _l({times:5,delay:2e3},async()=>{if(a(this,G)?.isConnected){let n=[...a(this,xe)];g(this,xe,[]),a(this,K).requestUpdate();let i=!1;for(let{message:s,options:o}of n){let u=m(this,J,Me).call(this,s,o);s===e&&(i=u)}return i}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),g(this,xe,[]),a(this,K).requestUpdate(),!1)))}sendUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1}={}){return m(this,J,Me).call(this,{type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n},{expectStreaming:s})}sendImageDelete(e){return Ne(e,"imageId is required"),m(this,J,Me).call(this,{type:"USER_FILE_DELETE",imageId:e})}sendUserCancel(){return m(this,J,Me).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return m(this,J,Me).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return m(this,J,Me).call(this,{type:"USER_TYPING_STOP"})}sendUserMeta(e){return m(this,J,Me).call(this,{type:"USER_META",metadata:e})}reloadConfig(){m(this,J,Me).call(this,{type:"RELOAD_CONFIG"})}close(){a(this,G)?.close(1e3,"closed by user")}retry(){clearTimeout(a(this,Gt)),g(this,Gt,setTimeout(()=>{a(this,ee).onReconnect?.(),g(this,G,this.initWS())},1e3*a(this,Wt))),sl(this,Wt)._++}initWS(){return new gi(a(this,K),{url:()=>a(this,ee).url(this.conversationId,{}),onOpen:e=>m(this,J,Ml).call(this,e),onMessage:e=>m(this,J,Al).call(this,JSON.parse(e.data)),onError:e=>m(this,J,Il).call(this,e),onClose:e=>m(this,J,Tl).call(this,e)})}hostConnected(){this.conversationId=a(this,ee).restoreConversationState?.()?.conversationId||"",this.messages=a(this,ee).restoreConversationState?.()?.messages||[]}reset(){m(this,J,Me).call(this,{type:"NEW_CHAT"}),a(this,ee).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,g(this,xe,[]),a(this,K).requestUpdate()}hostDisconnected(){clearTimeout(a(this,Gt))}connect(){a(this,G)||g(this,G,this.initWS())}reconnectSocket(){a(this,G)?.close(1e3,"destroy"),g(this,G,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};K=new WeakMap,ee=new WeakMap,G=new WeakMap,Wt=new WeakMap,Gt=new WeakMap,xe=new WeakMap,J=new WeakSet,Me=function(e,{expectStreaming:r=!1}={}){return this.ranOutOfCredits?!1:a(this,G)?a(this,G).isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):a(this,G).isConnected?(r&&!this.isLiveMode&&(this.isStreaming=!0,a(this,K).requestUpdate()),a(this,G).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)},Ml=function(e){g(this,Wt,0)},Al=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,{...e.message,streaming:!0}].filter((r,n,i)=>n===i.findIndex(s=>s.id===r.id)),this.typingIndicator=void 0,a(this,K).requestUpdate(),a(this,ee).onNewMessage?.(e.message);break}case"APPEND_MESSAGE":{let r=this.messages.find(n=>n.id===e.message.id);if(r){switch(e.message.content_type){case"text":{let{part:n,delta:i,position:s}=e.message;r.content=r.content.slice(0,s)+i,r.parts||=[],r.parts[n]={text:r.parts[n]&&"text"in r.parts[n]?(r.parts[n].text||"").slice(0,s)+i:i};break}case"html":{let{part:n,delta:i,position:s}=e.message;r.parts||=[],r.parts[n]={html:r.parts[n]&&"html"in r.parts[n]?(r.parts[n].html||"").slice(0,s)+i:i};break}case"data":{let{part:n}=e.message;r.parts||=[],r.parts[n]={tag:e.message.tag,data:r.parts[n]&&"data"in r.parts[n]?Object.assign(r.parts[n].data||{},e.message.data):e.message.data};break}}e.metadata&&(r.metadata=e.metadata),a(this,ee).onMessageAppend?.(e),a(this,K).requestUpdate()}else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let r=this.messages.find(n=>n.id===e.message.id);if(r)Object.assign(r,e.message),r.streaming=!1;else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,a(this,K).requestUpdate(),a(this,ee).onMessageDone?.(e,r),a(this,ee).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,a(this,K).requestUpdate();break}case"ERROR":{a(this,ee).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,a(this,ee).onConnect?.(e.conversationId,e.metadata),a(this,ee).persistConversationState?.(e.conversationId,e.messages),this.isLiveMode=e.metadata?.isLiveMode,a(this,K).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},a(this,K).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,a(this,K).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,a(this,K).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),a(this,K).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Il=function(e){console.error("onError",e),a(this,ee).onError?.(e)},Tl=function(e){a(this,K).isConnected&&a(this,G)&&!a(this,G).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,a(this,K).requestUpdate(),a(this,ee).onClose?.()};var l0=Symbol(),mh=Symbol();var Ll=Object.getPrototypeOf,wo=new WeakMap,gh=t=>t&&(wo.has(t)?wo.get(t):Ll(t)===Object.prototype||Ll(t)===Array.prototype);var jl=t=>gh(t)&&t[mh]||null,yo=(t,e=!0)=>{wo.set(t,e)};var bo=t=>typeof t=="object"&&t!==null,wh=t=>bo(t)&&!xo.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),Ul=(t,e)=>{let r=Ol.get(t);if(r?.[0]===e)return r[1];let n=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return yo(n,!0),Ol.set(t,[e,n]),Reflect.ownKeys(t).forEach(i=>{if(Object.getOwnPropertyDescriptor(n,i))return;let s=Reflect.get(t,i),{enumerable:o}=Reflect.getOwnPropertyDescriptor(t,i),u={value:s,enumerable:o,configurable:!0};if(xo.has(s))yo(s,!1);else if(bt.has(s)){let[l,c]=bt.get(s);u.value=Ul(l,c())}Object.defineProperty(n,i,u)}),Object.preventExtensions(n)},yh=(t,e,r,n)=>({deleteProperty(i,s){let o=Reflect.get(i,s);r(s);let u=Reflect.deleteProperty(i,s);return u&&n(["delete",[s],o]),u},set(i,s,o,u){let l=!t()&&Reflect.has(i,s),c=Reflect.get(i,s,u);if(l&&(Dl(c,o)||vi.has(o)&&Dl(c,vi.get(o))))return!0;r(s),bo(o)&&(o=jl(o)||o);let p=!bt.has(o)&&bh(o)?ko(o):o;return e(s,p),Reflect.set(i,s,p,u),n(["set",[s],o,c]),!0}}),bt=new WeakMap,xo=new WeakSet,Ol=new WeakMap,vo=[1],vi=new WeakMap,Dl=Object.is,vh=(t,e)=>new Proxy(t,e),bh=wh,xh=Ul,kh=yh;function ko(t={}){if(!bo(t))throw new Error("object required");let e=vi.get(t);if(e)return e;let r=vo[0],n=new Set,i=(C,T=++vo[0])=>{r!==T&&(s=r=T,n.forEach(k=>k(C,T)))},s=r,o=(C=vo[0])=>(s!==C&&(s=C,l.forEach(([T])=>{let k=T[1](C);k>r&&(r=k)})),r),u=C=>(T,k)=>{let _=[...T];_[1]=[C,..._[1]],i(_,k)},l=new Map,c=(C,T)=>{let k=!xo.has(T)&&bt.get(T);if(k){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(C))throw new Error("prop listener already exists");if(n.size){let _=k[2](u(C));l.set(C,[k,_])}else l.set(C,[k])}},p=C=>{var T;let k=l.get(C);k&&(l.delete(C),(T=k[1])==null||T.call(k))},f=C=>(n.add(C),n.size===1&&l.forEach(([k,_],L)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&_)throw new Error("remove already exists");let H=k[2](u(L));l.set(L,[k,H])}),()=>{n.delete(C),n.size===0&&l.forEach(([k,_],L)=>{_&&(_(),l.set(L,[k]))})}),y=!0,x=kh(()=>y,c,p,i),S=vh(t,x);vi.set(t,S);let I=[t,o,f];return bt.set(S,I),Reflect.ownKeys(t).forEach(C=>{let T=Object.getOwnPropertyDescriptor(t,C);"value"in T&&T.writable&&(S[C]=t[C])}),y=!1,S}function bi(t,e,r){let n=bt.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i,s=[],o=n[2],u=!1,c=o(p=>{if(s.push(p),r){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,u&&e(s.splice(0))}))});return u=!0,()=>{u=!1,c()}}function Zt(t){let e=bt.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,n]=e;return xh(r,n())}var nn,Kt,xt,Jt,Xt=class{constructor(e,r){h(this,nn);h(this,Kt);h(this,xt);h(this,Jt,()=>{});g(this,nn,e),g(this,Kt,r),g(this,xt,Zt(r)),e.addController(this)}get state(){return a(this,xt)}get value(){return a(this,xt)}hostConnected(){a(this,Jt).call(this),g(this,Jt,bi(a(this,Kt),()=>{g(this,xt,Zt(a(this,Kt))),a(this,nn).requestUpdate()}))}hostDisconnected(){a(this,Jt).call(this)}};nn=new WeakMap,Kt=new WeakMap,xt=new WeakMap,Jt=new WeakMap;var sn,on,kt,Yt,Xe=class{constructor(e,r,n){h(this,sn);h(this,on);w(this,"proxyObject");h(this,kt);h(this,Yt,()=>{});g(this,sn,e),g(this,on,n),this.proxyObject=ko(r),g(this,kt,Zt(this.proxyObject)),e.addController(this)}get state(){return a(this,kt)}get value(){return a(this,kt)}hostConnected(){a(this,Yt).call(this),a(this,on)?.subscribe&&g(this,Yt,bi(this.proxyObject,()=>{g(this,kt,Zt(this.proxyObject)),a(this,sn).requestUpdate()}))}hostDisconnected(){a(this,Yt).call(this)}};sn=new WeakMap,on=new WeakMap,kt=new WeakMap,Yt=new WeakMap;var Qt,an,er,Ct,St,xi=class{constructor(e,{provider:r,tag:n,key:i}){h(this,Qt);h(this,an);h(this,er);h(this,Ct,null);h(this,St,null);g(this,Qt,e),g(this,an,n),g(this,er,i),e.addController(this)}get value(){return a(this,St)?a(this,St).value:null}hostConnected(){if(a(this,St)||(g(this,Ct,Ch(a(this,Qt),a(this,an))),!a(this,Ct)))return;let e=a(this,Ct)[a(this,er)]instanceof Xe?a(this,Ct)[a(this,er)]:null;e&&g(this,St,new Xt(a(this,Qt),e.proxyObject))}hostDisconnected(){}};Qt=new WeakMap,an=new WeakMap,er=new WeakMap,Ct=new WeakMap,St=new WeakMap;function Ch(t,e){let r=t;for(;r;){let n=r.closest(e);if(n)return n;let i=r.getRootNode();if(i instanceof ShadowRoot)r=i.host;else break}return null}var Pl=()=>{if(window.Shopify)try{return{customerId:Sh()}}catch{return null}return null},Sh=()=>{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},Rl=async()=>{try{return(await(await fetch(window.Shopify.routes.root+"cart.js")).json()).items.map(n=>({id:n.id,name:n.title,quantity:n.quantity,price:n.price,variantId:n.variant_id,sku:n.sku,url:n.url,description:n.product_description,image:n.featured_image?.url}))}catch{return[]}};function Bl(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function Co(t){return new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+!*'();@&=,$]*)*(\\?[-a-z\\d%_.~+!*'();@&=,$]*)?(\\#[-a-z\\d%_.~+!*'();@&=,$]*)?$","i").test(t)}function Vl(t,e){let r=t instanceof URL?t:new URL(t);if(e)for(let[n,i]of e)r.searchParams.set(n,i);return r}var Fl=()=>{if(window.ShopRenter)try{let t=Eh();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},Eh=()=>{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}}},Nl=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=Bl(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 Hl=()=>{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},zl=async()=>new Promise((t,e)=>{try{window.UNAS.getCart(r=>{let i=r.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));t(i)})}catch(r){console.error("Error fetching cart information:",r),e(r)}});var So;function $o(t){return{lang:t?.lang??So?.lang,message:t?.message,abortEarly:t?.abortEarly??So?.abortEarly,abortPipeEarly:t?.abortPipeEarly??So?.abortPipeEarly}}var Ah;function Ih(t){return Ah?.get(t)}var Th;function Lh(t){return Th?.get(t)}var jh;function Oh(t,e){return jh?.get(t)?.get(e)}function Wl(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 ge(t,e,r,n,i){let s=i&&"input"in i?i.input:r.value,o=i?.expected??t.expects??null,u=i?.received??Wl(s),l={kind:t.kind,type:t.type,input:s,expected:o,received:u,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${u}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=t.kind==="schema",p=i?.message??t.message??Oh(t.reference,l.lang)??(c?Lh(l.lang):null)??n.message??Ih(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function we(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},$o())}}}function Dh(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Gl(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var Uh=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function Eo(t,e){return{kind:"validation",type:"max_length",reference:Eo,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length>this.requirement&&ge(this,"length",r,n,{received:`${r.value.length}`}),r}}}function _o(t,e){return{kind:"validation",type:"min_length",reference:_o,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length<this.requirement&&ge(this,"length",r,n,{received:`${r.value.length}`}),r}}}function Ph(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function Zl(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function Mo(){return{kind:"schema",type:"any",reference:Mo,expects:"any",async:!1,get"~standard"(){return we(this)},"~run"(t){return t.typed=!0,t}}}function tr(t,e){return{kind:"schema",type:"array",reference:tr,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return we(this)},"~run"(r,n){let i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<i.length;s++){let o=i[s],u=this.item["~run"]({value:o},n);if(u.issues){let l={type:"array",origin:"value",input:i,key:s,value:o};for(let c of u.issues)c.path?c.path.unshift(l):c.path=[l],r.issues?.push(c);if(r.issues||(r.issues=u.issues),n.abortEarly){r.typed=!1;break}}u.typed||(r.typed=!1),r.value.push(u.value)}}else ge(this,"type",r,n);return r}}}function Ao(t){return{kind:"schema",type:"boolean",reference:Ao,expects:"boolean",async:!1,message:t,get"~standard"(){return we(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:ge(this,"type",e,r),e}}}function Io(t){return{kind:"schema",type:"null",reference:Io,expects:"null",async:!1,message:t,get"~standard"(){return we(this)},"~run"(e,r){return e.value===null?e.typed=!0:ge(this,"type",e,r),e}}}function ki(t){return{kind:"schema",type:"number",reference:ki,expects:"number",async:!1,message:t,get"~standard"(){return we(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:ge(this,"type",e,r),e}}}function He(t,e){return{kind:"schema",type:"object",reference:He,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return we(this)},"~run"(r,n){let i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(let s in this.entries){let o=this.entries[s];if(s in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){let u=s in i?i[s]:Zl(o),l=o["~run"]({value:u},n);if(l.issues){let c={type:"object",origin:"value",input:i,key:s,value:u};for(let p of l.issues)p.path?p.path.unshift(c):p.path=[c],r.issues?.push(p);if(r.issues||(r.issues=l.issues),n.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value[s]=l.value}else if(o.fallback!==void 0)r.value[s]=Ph(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(ge(this,"key",r,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else ge(this,"type",r,n);return r}}}function rr(t,e){return{kind:"schema",type:"optional",reference:rr,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return we(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=Zl(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function To(t,e){return{kind:"schema",type:"picklist",reference:To,expects:Gl(t.map(Wl),"|"),async:!1,options:t,message:e,get"~standard"(){return we(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:ge(this,"type",r,n),r}}}function Ci(t,e,r){return{kind:"schema",type:"record",reference:Ci,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return we(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let o in s)if(Dh(s,o)){let u=s[o],l=this.key["~run"]({value:o},i);if(l.issues){let p={type:"object",origin:"key",input:s,key:o,value:u};for(let f of l.issues)f.path=[p],n.issues?.push(f);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}let c=this.value["~run"]({value:u},i);if(c.issues){let p={type:"object",origin:"value",input:s,key:o,value:u};for(let f of c.issues)f.path?f.path.unshift(p):f.path=[p],n.issues?.push(f);if(n.issues||(n.issues=c.issues),i.abortEarly){n.typed=!1;break}}(!l.typed||!c.typed)&&(n.typed=!1),l.typed&&(n.value[l.value]=c.value)}}else ge(this,"type",n,i);return n}}}function X(t){return{kind:"schema",type:"string",reference:X,expects:"string",async:!1,message:t,get"~standard"(){return we(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:ge(this,"type",e,r),e}}}function ql(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function nr(t,e){return{kind:"schema",type:"union",reference:nr,expects:Gl(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return we(this)},"~run"(r,n){let i,s,o;for(let u of this.options){let l=u["~run"]({value:r.value},n);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{i=l;break}else o?o.push(l):o=[l]}if(i)return i;if(s){if(s.length===1)return s[0];ge(this,"type",r,n,{issues:ql(s)}),r.typed=!0}else{if(o?.length===1)return o[0];ge(this,"type",r,n,{issues:ql(o)})}return r}}}function Kl(t,e,r){let n=t["~run"]({value:e},$o(r));if(n.issues)throw new Uh(n.issues);return n.value}function Jl(t,e){let r={};for(let n in t.entries)r[n]=!e||e.includes(n)?rr(t.entries[n]):t.entries[n];return{...t,entries:r,get"~standard"(){return we(this)}}}function Xl(...t){return{...t[0],pipe:t,get"~standard"(){return we(this)},"~run"(e,r){for(let n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=n["~run"](e,r))}return e}}}function ln(t,e,r){let n=t["~run"]({value:e},$o(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var Yl=Ci(X(),nr([X(),ki(),Ao(),Io()])),Ql=Xl(X(),_o(1),Eo(5e3)),ec=()=>{try{return window.UNAS?Hl():window.Shopify?Pl():window.ShopRenter?Fl():null}catch{return null}},tc=async()=>{try{return window.UNAS?await zl():window.Shopify?await Rl():window.ShopRenter?await Nl():[]}catch{return[]}},ir={schema:He({conversationId:rr(X()),messages:rr(tr(He({id:X(),timestamp:ki(),role:To(["user","assistant","support"]),content:X(),parts:rr(tr(nr([He({text:X()}),He({html:X()}),He({tag:X(),data:Ci(X(),Mo())})])))})))}),getStorageKey(t){if(!t)throw new Error("widgetId is not set");return`_molin_${t}`},persist(t,e,r){let n=this.getStorageKey(t);localStorage.setItem(n,JSON.stringify({conversationId:e,messages:r}))},restore(t){try{let e=this.getStorageKey(t),r=JSON.parse(localStorage.getItem(e)||"{}"),n=Kl(this.schema,r);return{conversationId:n.conversationId||"",messages:n.messages||[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(t){let e=this.getStorageKey(t);localStorage.removeItem(e)}};var D,rc,cn,un,sr,R,nc,$i=class $i extends ${constructor(){super();h(this,D);w(this,"contextCtrl");h(this,cn);h(this,un);h(this,sr,null);this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.autoConnect=!1,this.contextCtrl=new Xe(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,ranOutOfCredits:!1,isLiveMode:!1,lastMsg:void 0,hasQueuedMessages:!1,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this),sendImageDelete:a(this,D,R).sendImageDelete.bind(a(this,D,R))})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.autoConnect&&a(this,D,R).connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:a(this,cn),xCustomInstructions:a(this,un),conversationId:a(this,D,R).conversationId,messages:a(this,D,rc),isStreaming:a(this,D,R).isStreaming,typingIndicator:a(this,D,R).typingIndicator,ranOutOfCredits:a(this,D,R).ranOutOfCredits,isLiveMode:a(this,D,R).isLiveMode,lastMsg:a(this,D,R).lastMsg,hasQueuedMessages:a(this,D,R).hasQueuedMessages,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this),sendImageDelete:a(this,D,R).sendImageDelete.bind(a(this,D,R))}),m(this,D,nc).call(this)}sendUserInput(r,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...n},s=a(this,D,R).sendUserInput(r,i);return s&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:a(this,D,R).conversationId}),s}async enqueueUserInput(r,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...n};return a(this,D,R).enqueueUserInput(r,i)}sendUserCancel(){a(this,D,R).sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){a(this,D,R).sendUserTypingStart()}sendUserTypingStop(){a(this,D,R).sendUserTypingStop()}reset(){a(this,D,R).reset()}reloadConfig(){a(this,D,R).reloadConfig()}connect(){a(this,D,R).connect()}render(){return d`<slot></slot>`}};D=new WeakSet,rc=function(){return a(this,D,R)?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:a(this,D,R)?.messages||[]},cn=new WeakMap,un=new WeakMap,sr=new WeakMap,R=function(){return a(this,sr)||g(this,sr,new yi(this,{autoConnect:this.autoConnect,url:r=>{let n=new URL(this.config.wsApiUrl);return n.searchParams.set("widgetId",this.widgetId),n.searchParams.set("conversationId",r),n.searchParams.set("pageUrl",window.location.href),n},onReconnect:()=>{},onError:r=>{console.error("ws error",r)},onClose:()=>{},onNewMessage:r=>{r.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:r,conversationId:a(this,D,R).conversationId})},onMessageAppend:r=>{},onMessageDone:(r,n)=>{n.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:n.content??"",message:n,usage_TOKENS_COMPLETION:r.message.usage.TOKENS_COMPLETION,conversationId:a(this,D,R).conversationId})},onMessageError:r=>{console.error("ws message error",r),r.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+r.message})},onReset:()=>{ir.reset(this.widgetId)},onConnect:(r,n)=>{let i=ec();a(this,D,R).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),tc().then(s=>{s?.length>0&&a(this,D,R).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,cart:s,language:window.navigator.language})}).catch(s=>{console.error(s)}),this.dispatchEvent(new $i.ConnectedEvent({conversationId:r,metadata:n,widgetId:this.widgetId,pendingImages:n?.pendingImages||[]}))},persistConversationState:(r,n)=>{ir.persist(this.widgetId,r,n)},restoreConversationState:()=>ir.restore(this.widgetId)})),a(this,sr)},nc=function(){function r(i){if(!i)return;let s;try{s=typeof i=="object"?i:JSON.parse(i)}catch(u){console.error("Molin: user-data is not valid JSON",u);return}if(!s||typeof s!="object"||Object.keys(s).length===0)return;let o=ln(Yl,s);if(!o.success){console.error("Molin: user-data does not pass schema validation",o.issues);return}return o.output}function n(i){if(!i)return;let s=ln(Ql,i);if(!s.success){console.error("Molin: custom-instructions does not pass schema validation",s.issues);return}return s.output}g(this,cn,r(this.xUserData)),g(this,un,n(this.xCustomInstructions))},w($i,"properties",{widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object},autoConnect:{type:Boolean}});var or=$i;function ic(t){let e=new xi(t,{provider:or,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,n){if(n==="value")return e.value}})}var Lo;or.ConnectedEvent=(Lo=class extends CustomEvent{constructor(e,r={}){super(or.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}},w(Lo,"type","mw-context-widget:connected"),Lo);customElements.get("mw-context-widget")||customElements.define("mw-context-widget",or);function No(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function Rh(t,e=","){return t.map(No).join(e)}var pc=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Ei(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 Ai(t,e="@media "){return e+B(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(n=>`(${n}-width:${r[n]})`).join(" and "))).join(",")}function B(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function sc(t){return t}function Ii(){}var te={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function hc(t){return t.match(/[-=:;]/g)?.length||0}function Po(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(hc(t),15)<<18}var Bh=["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 Ho({n:t,i:e,v:r=[]},n,i,s){t&&(t=No({n:t,i:e,v:r})),s=[...B(s)];for(let u of r){let l=n.theme("screens",u);for(let c of B(l&&Ai(l)||n.v(u))){var o;s.push(c),i|=l?67108864|Po(c):u=="dark"?1073741824:c[0]=="@"?Po(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~Bh.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:i,r:s,i:e}}var dc=new Map;function Ro(t){if(t.d){let e=[],r=jo(t.r.reduce((n,i)=>i[0]=="@"?(e.push(i),n):i?jo(n,s=>jo(i,o=>{let u=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(u){let l=s.indexOf(u[1]);return~l?s.slice(0,l)+u[0]+s.slice(l+u[1].length):Oo(s,o)}return Oo(o,s)})):n,"&"),n=>Oo(n,t.n?"."+pc(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((n,i)=>i+"{"+n+"}",t.d)}}function jo(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,n,i)=>e(n)+i)}function Oo(t,e){return t.replace(/&/g,e)}var oc=new Intl.Collator("en",{numeric:!0});function fc(t,e){for(var r=0,n=t.length;r<n;){let i=n+r>>1;0>=mc(t[i],e)?r=i+1:n=i}return n}function mc(t,e){let r=t.p&te.o;return r==(e.p&te.o)&&(r==te.b||r==te.o)?0:t.p-e.p||t.o-e.o||oc.compare(ac(t.n),ac(e.n))||oc.compare(lc(t.n),lc(e.n))}function ac(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function lc(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Do(t,e){return Math.round(parseInt(t,16)*e)}function ke(t,e={}){if(typeof t=="function")return t(e);let{opacityValue:r="1",opacityVariable:n}=e,i=n?`var(${n})`:r;if(t.includes("<alpha-value>"))return t.replace("<alpha-value>",i);if(t[0]=="#"&&(t.length==4||t.length==7)){let s=(t.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Do(t.substr(1,s),o),Do(t.substr(1+s,s),o),Do(t.substr(1+2*s,s),o),i]})`}return i=="1"?t:i=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function gc(t,e,r,n,i=[]){return(function s(o,{n:u,p:l,r:c=[],i:p},f){let y=[],x="",S=0,I=0;for(let k in o||{}){var C,T;let _=o[k];if(k[0]=="@"){if(!_)continue;if(k[1]=="a"){y.push(...qo(u,l,Mi(""+_),f,l,c,p,!0));continue}if(k[1]=="l"){for(let L of B(_))y.push(...s(L,{n:u,p:(C=te[k[7]],l&~te.o|C),r:k[7]=="d"?[]:c,i:p},f));continue}if(k[1]=="i"){y.push(...B(_).map(L=>({p:-1,o:0,r:[],d:k+" "+L})));continue}if(k[1]=="k"){y.push({p:te.d,o:0,r:[k],d:s(_,{p:te.d},f).map(Ro).join("")});continue}if(k[1]=="f"){y.push(...B(_).map(L=>({p:te.d,o:0,r:[k],d:s(L,{p:te.d},f).map(Ro).join("")})));continue}}if(typeof _!="object"||Array.isArray(_))k=="label"&&_?u=_+Ei(JSON.stringify([l,p,o])):(_||_===0)&&(k=k.replace(/[A-Z]/g,L=>"-"+L.toLowerCase()),I+=1,S=Math.max(S,(T=k)[0]=="-"?0:hc(T)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(T)?+!!RegExp.$1||-!!RegExp.$2:0)+1),x+=(x?";":"")+B(_).map(L=>f.s(k,zo(""+L,f.theme)+(p?" !important":""))).join(";"));else if(k[0]=="@"||k.includes("&")){let L=l;k[0]=="@"&&(k=k.replace(/\bscreen\(([^)]+)\)/g,(H,Q)=>{let ne=f.theme("screens",Q);return ne?(L|=67108864,Ai(ne,"")):H}),L|=Po(k)),y.push(...s(_,{n:u,p:L,r:[...c,k],i:p},f))}else y.push(...s(_,{p:l,r:[...c,k]},f))}return y.unshift({n:u,p:l,o:Math.max(0,15-I)+1.5*Math.min(S||15,15),r:c,d:x}),y.sort(mc)})(t,Ho(e,r,n,i),r)}function zo(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,n,i,s,o="")=>{let u=e(i,o);return typeof u=="function"&&/color|fill|stroke/i.test(i)?ke(u):""+B(u).filter(l=>Object(l)!==l)})}function wc(t,e){let r,n=[];for(let i of t)i.d&&i.n?r?.p==i.p&&""+r.r==""+i.r?(r.c=[r.c,i.c].filter(Boolean).join(" "),r.d=r.d+";"+i.d):n.push(r={...i,n:i.n&&e}):n.push({...i,n:i.n&&e});return n}function _i(t,e,r=te.u,n,i){let s=[];for(let o of t)for(let u of(function(l,c,p,f,y){l={...l,i:l.i||y};let x=(function(S,I){let C=dc.get(S.n);return C?C(S,I):I.r(S.n,S.v[0]=="dark")})(l,c);return x?typeof x=="string"?({r:f,p}=Ho(l,c,p,f),wc(_i(Mi(x),c,p,f,l.i),l.n)):Array.isArray(x)?x.map(S=>{var I,C;return{o:0,...S,r:[...B(f),...B(S.r)],p:(I=p,C=S.p??p,I&~te.o|C)}}):gc(x,l,c,p,f):[{c:No(l),p:0,o:0,r:[]}]})(o,e,r,n,i))s.splice(fc(s,u),0,u);return s}function qo(t,e,r,n,i,s,o,u){return wc((u?r.flatMap(l=>_i([l],n,i,s,o)):_i(r,n,i,s,o)).map(l=>l.p&te.o&&(l.n||e==te.b)?{...l,p:l.p&~te.o|e,o:0}:l),t)}function Vh(t,e,r,n){var i;return i=(s,o)=>{let{n:u,p:l,r:c,i:p}=Ho(s,o,e);return r&&qo(u,e,r,o,l,c,p,n)},dc.set(t,i),t}function Uo(t,e,r){if(t[t.length-1]!="("){let n=[],i=!1,s=!1,o="";for(let u of t)if(!(u=="("||/[~@]$/.test(u))){if(u[0]=="!"&&(u=u.slice(1),i=!i),u.endsWith(":")){n[u=="dark:"?"unshift":"push"](u.slice(0,-1));continue}u[0]=="-"&&(u=u.slice(1),s=!s),u.endsWith("-")&&(u=u.slice(0,-1)),u&&u!="&"&&(o+=(o&&"-")+u)}o&&(s&&(o="-"+o),e[0].push({n:o,v:n.filter(Fh),i}))}}function Fh(t,e,r){return r.indexOf(t)==e}var cc=new Map;function Mi(t){let e=cc.get(t);if(!e){let r=[],n=[[]],i=0,s=0,o=null,u=0,l=(c,p=0)=>{i!=u&&(r.push(t.slice(i,u+p)),c&&Uo(r,n)),i=u+1};for(;u<t.length;u++){let c=t[u];if(s)t[u-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)t[u-1]!="\\"&&o.test(t.slice(u))&&(o=null,i=u+RegExp.lastMatch.length);else if(c=="/"&&t[u-1]!="\\"&&(t[u+1]=="*"||t[u+1]=="/"))o=t[u+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),r.push(c);else if(c==":")t[u+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let p=r.lastIndexOf("(");if(c==")"){let f=r[p-1];if(/[~@]$/.test(f)){let y=n.shift();r.length=p,Uo([...r,"#"],n);let{v:x}=n[0].pop();for(let S of y)S.v.splice(+(S.v[0]=="dark")-+(x[0]=="dark"),x.length);Uo([...r,Vh(f.length>1?f.slice(0,-1)+Ei(JSON.stringify([f,y])):f+"("+Rh(y)+")",te.a,y,/@$/.test(f))],n)}p=r.lastIndexOf("(",p-1)}r.length=p+1}else/[~@]/.test(c)&&t[u+1]=="("&&n.unshift([])}l(!0),cc.set(t,e=n[0])}return e}function v(t,e,r){return[t,Bo(e,r)]}function Bo(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,n)=>({[t]:e?e(r,n):Vo(r,1)}):r=>t||{[r[1]]:Vo(r,2)}}function Vo(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function b(t,e,r,n){return[t,Wo(e,r,n)]}function Wo(t,e,r){let n=typeof e=="string"?(i,s)=>({[e]:r?r(i,s):i._}):e||(({1:i,_:s},o,u)=>({[i||u]:s}));return(i,s)=>{let o=yc(t||i[1]),u=s.theme(o,i.$$)??je(i.$$,o,s);if(u!=null)return i._=Vo(i,0,u),n(i,s,o)}}function re(t,e={},r){return[t,Nh(e,r)]}function Nh(t={},e){return(r,n)=>{let{section:i=yc(r[0]).replace("-","")+"Color"}=t,[s,o]=Hh(r.$$);if(!s)return;let u=n.theme(i,s)||je(s,i,n);if(!u||typeof u=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:c=i.replace("Color","Opacity"),property:p=i,selector:f}=t,y=n.theme(c,o||"DEFAULT")||o&&je(o,c,n),x=e||(({_:I})=>{let C=pn(p,I);return f?{[f]:C}:C});r._={value:ke(u,{opacityVariable:l||void 0,opacityValue:y||void 0}),color:I=>ke(u,I),opacityVariable:l||void 0,opacityValue:y||void 0};let S=x(r,n);if(!r.dark){let I=n.d(i,s,u);I&&I!==u&&(r._={value:ke(I,{opacityVariable:l||void 0,opacityValue:y||"1"}),color:C=>ke(I,C),opacityVariable:l||void 0,opacityValue:y||void 0},S={"&":S,[n.v("dark")]:x(r,n)})}return S}}function Hh(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function pn(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 je(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=ar(zo(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 yc(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function ar(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",n,i="")=>ar(r)+n+ar(i)):t.replace(/(^|[^\\])_+/g,(e,r)=>r+" ".repeat(e.length-r.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function Go({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:B(e.variants),rules:B(e.rules),ignorelist:B(e.ignorelist),hash:void 0,stringify:(n,i)=>n+":"+i,finalize:[]};for(let n of B([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&B(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:i,darkMode:s=r.darkMode,darkColor:o=r.darkColor,theme:u,variants:l,rules:c,ignorelist:p,hash:f=r.hash,stringify:y=r.stringify,finalize:x}=typeof n=="function"?n(r):n;r={preflight:r.preflight!==!1&&i!==!1&&[...r.preflight,...B(i)],darkMode:s,darkColor:o,theme:{...r.theme,...u,extend:{...r.theme.extend,...u?.extend}},variants:[...r.variants,...B(l)],rules:[...r.rules,...B(c)],ignorelist:[...r.ignorelist,...B(p)],hash:f,stringify:y,finalize:[...r.finalize,...B(x)]}}return r}function uc(t,e,r,n,i,s){for(let o of e){let u=r.get(o);u||r.set(o,u=n(o));let l=u(t,i,s);if(l)return l}}function zh(t){var e;return Fo(t[0],typeof(e=t[1])=="function"?e:()=>e)}function qh(t){var e,r;return Array.isArray(t)?Fo(t[0],Bo(t[1],t[2])):Fo(t,Bo(e,r))}function Fo(t,e){return vc(t,(r,n,i,s)=>{let o=n.exec(r);if(o)return o.$$=r.slice(o[0].length),o.dark=s,e(o,i)})}function vc(t,e){let r=B(t).map(Wh);return(n,i,s)=>{for(let o of r){let u=e(n,o,i,s);if(u)return u}}}function Wh(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function bc(t,e){let r=Go(t),n=(function({theme:l,darkMode:c,darkColor:p=Ii,variants:f,rules:y,hash:x,stringify:S,ignorelist:I,finalize:C}){let T=new Map,k=new Map,_=new Map,L=new Map,H=vc(I,(P,ie)=>ie.test(P));f.push(["dark",Array.isArray(c)||c=="class"?`${B(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let Q=typeof x=="function"?P=>x(P,Ei):x?Ei:sc;Q!==sc&&C.push(P=>({...P,n:P.n&&Q(P.n),d:P.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(ie,pe)=>"--"+Q(pe).replace("#",""))}));let ne={theme:(function({extend:P={},...ie}){let pe={},Zs={get colors(){return ht("colors")},theme:ht,negative(){return{}},breakpoints(Z){let se={};for(let fe in Z)typeof Z[fe]=="string"&&(se["screen-"+fe]=Z[fe]);return se}};return ht;function ht(Z,se,fe,Nr){if(Z){if({1:Z,2:Nr}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(Z)||[,Z],/[.[]/.test(Z)){let Be=[];Z.replace(/\[([^\]]+)\]|([^.[]+)/g,(ft,zr,Gp=zr)=>Be.push(Gp)),Z=Be.shift(),fe=se,se=Be.join("-")}let Le=pe[Z]||Object.assign(Object.assign(pe[Z]={},si(ie,Z)),si(P,Z));if(se==null)return Le;se||(se="DEFAULT");let dt=Le[se]??se.split("-").reduce((Be,ft)=>Be?.[ft],Le)??fe;return Nr?ke(dt,{opacityValue:zo(Nr,ht)}):dt}let Hr={};for(let Le of[...Object.keys(ie),...Object.keys(P)])Hr[Le]=ht(Le);return Hr}function si(Z,se){let fe=Z[se];return typeof fe=="function"&&(fe=fe(Zs)),fe&&/color|fill|stroke/i.test(se)?(function Nr(Hr,Le=[]){let dt={};for(let Be in Hr){let ft=Hr[Be],zr=[...Le,Be];dt[zr.join("-")]=ft,Be=="DEFAULT"&&(zr=Le,dt[Le.join("-")]=ft),typeof ft=="object"&&Object.assign(dt,Nr(ft,zr))}return dt})(fe):fe}})(l),e:pc,h:Q,s(P,ie){return S(P,ie,ne)},d(P,ie,pe){return p(P,ie,ne,pe)},v(P){return T.has(P)||T.set(P,uc(P,f,k,zh,ne)||"&:"+P),T.get(P)},r(P,ie){let pe=JSON.stringify([P,ie]);return _.has(pe)||_.set(pe,!H(P,ne)&&uc(P,y,L,qh,ne,ie)),_.get(pe)},f(P){return C.reduce((ie,pe)=>pe(ie,ne),P)}};return ne})(r),i=new Map,s=[],o=new Set;e.resume(l=>i.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),o.add(l)});function u(l){let c=n.f(l),p=Ro(c);if(p&&!o.has(p)){o.add(p);let f=fc(s,l);e.insert(p,f,l),s.splice(f,0,l)}return c.n}return Object.defineProperties(function(c){if(!i.size)for(let f of B(r.preflight))typeof f=="function"&&(f=f(n)),f&&(typeof f=="string"?qo("",te.b,Mi(f),n,te.b,[],!1,!0):gc(f,{},n,te.b)).forEach(u);c=""+c;let p=i.get(c);if(!p){let f=new Set;for(let y of _i(Mi(c),n))f.add(y.c).add(u(y));p=[...f].filter(Boolean).join(" "),i.set(c,p).set(p,p)}return p},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:n.theme,config:r,snapshot(){let l=e.snapshot(),c=new Set(o),p=new Map(i),f=[...s];return()=>{l(),o=c,i=p,s=f}},clear(){e.clear(),o=new Set,i=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Gh(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function xc(t){let e=new MutationObserver(r);return{observe(i){e.observe(i,{attributeFilter:["class"],subtree:!0,childList:!0}),n(i),r([{target:i,type:""}])},disconnect(){e.disconnect()}};function r(i){for(let{type:s,target:o}of i)if(s[0]=="a")n(o);else for(let u of o.querySelectorAll("[class]"))n(u);e.takeRecords()}function n(i){let s,o=i.getAttribute?.("class");o&&Gh(o,s=t(o))&&i.setAttribute("class",s)}}function Zh(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 Ti(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:Zh(t)).sheet;return{target:e,snapshot(){let r=Array.from(e.cssRules,n=>n.cssText);return()=>{this.clear(),r.forEach(this.insert)}},clear(){for(let r=e.cssRules.length;r--;)e.deleteRule(r)},destroy(){e.ownerNode?.remove()},insert(r,n){try{e.insertRule(r,n)}catch{e.insertRule(":root{}",n)}},resume:Ii}}var Kh=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 kc(t){return Kh.get(t)}function Cc(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 Sc(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 Jh=[["-webkit-",1],["-moz-",2],["-ms-",4]];function $c(){return({stringify:t})=>({stringify(e,r,n){let i="",s=kc(e);s&&(i+=t(s,r,n)+";");let o=Cc(e),u=Sc(e,r);for(let l of Jh)o&l[1]&&(i+=t(l[0]+e,r,n)+";"),u&l[1]&&(i+=t(e,l[0]+r,n)+";");return i+t(e,r,n)}})}function _c(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",Wo("lineClamp",({_:t})=>Ec(t))],["line-clamp-(\\d+)",({1:t})=>Ec(t)]]}}function Ec(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var dn={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",...ye(4,"rem",4,.5,.5),...ye(12,"rem",4,5),14:"3.5rem",...ye(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:U("blur"),backdropBrightness:U("brightness"),backdropContrast:U("contrast"),backdropGrayscale:U("grayscale"),backdropHueRotate:U("hueRotate"),backdropInvert:U("invert"),backdropOpacity:U("opacity"),backdropSaturate:U("saturate"),backdropSepia:U("sepia"),backgroundColor:U("colors"),backgroundImage:{none:"none"},backgroundOpacity:U("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:{...ye(200,"",100,0,50),...ye(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:U("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:U("spacing"),borderWidth:{DEFAULT:"1px",...Ce(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:U("colors"),caretColor:U("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...ye(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:U("borderColor"),divideOpacity:U("borderOpacity"),divideWidth:U("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"),...hn(2,6),...hn(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:U("spacing"),gradientColorStops:U("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"),...hn(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...hn(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:{...ye(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:{...ye(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:U("spacing"),placeholderColor:U("colors"),placeholderOpacity:U("opacity"),outlineColor:U("colors"),outlineOffset:Ce(8,"px"),outlineWidth:Ce(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:U("colors"),ringOffsetWidth:Ce(8,"px"),ringOpacity:({theme:t})=>({...t("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Ce(8,"px")},rotate:{...Ce(2,"deg"),...Ce(12,"deg",3),...Ce(180,"deg",45)},saturate:ye(200,"",100,0,50),scale:{...ye(150,"",100,0,50),...ye(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:U("spacing"),scrollPadding:U("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Ce(2,"deg"),...Ce(12,"deg",3)},space:U("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:ye(2),textColor:U("colors"),textDecorationColor:U("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Ce(8,"px")},textUnderlineOffset:{auto:"auto",...Ce(8,"px")},textIndent:U("spacing"),textOpacity:U("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:U("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"),...hn(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:{...ye(50,"",1,0,10),auto:"auto"}};function hn(t,e){let r={};do for(var n=1;n<t;n++)r[`${n}/${t}`]=Number((n/t*100).toFixed(6))+"%";while(++t<=e);return r}function Ce(t,e,r=0){let n={};for(;r<=t;r=2*r||1)n[r]=r+e;return n}function ye(t,e="",r=1,n=0,i=1,s={}){for(;n<=t;n+=i)s[n]=n/r+e;return s}function U(t){return({theme:e})=>e(t)}var Mc={"*,::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, ${dn.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, ${dn.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 Oc=[v("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:je(`[${e}]`,"",r)}}})),v("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),b("aspect-","aspectRatio"),v("container",(t,{theme:e})=>{let{screens:r=e("screens"),center:n,padding:i}=e("container"),s={width:"100%",marginRight:n&&"auto",marginLeft:n&&"auto",...o("xs")};for(let u in r){let l=r[u];typeof l=="string"&&(s[Ai(l)]={"&":{maxWidth:l,...o(u)}})}return s;function o(u){let l=i&&(typeof i=="string"?i:i[u]||i.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),b("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),v("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),v("box-(border|content)","boxSizing",({1:t})=>t+"-box"),v("hidden",{display:"none"}),v("table-(auto|fixed)","tableLayout"),v(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",v("isolate","isolation"),v("object-(contain|cover|fill|none|scale-down)","objectFit"),b("object-","objectPosition"),v("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Li),v("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),v("(static|fixed|absolute|relative|sticky)","position"),b("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),b("-?(top|bottom|left|right)(?:$|-)","inset"),v("(visible|collapse)","visibility"),v("invisible",{visibility:"hidden"}),b("-?z-","zIndex"),v("flex-((row|col)(-reverse)?)","flexDirection",Ac),v("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),b("(flex-(?:grow|shrink))(?:$|-)"),b("(flex)-"),b("grow(?:$|-)","flexGrow"),b("shrink(?:$|-)","flexShrink"),b("basis-","flexBasis"),b("-?(order)-"),"-?(order)-(\\d+)",b("grid-cols-","gridTemplateColumns"),v("grid-cols-(\\d+)","gridTemplateColumns",jc),b("col-","gridColumn"),v("col-(span)-(\\d+)","gridColumn",Lc),b("col-start-","gridColumnStart"),v("col-start-(auto|\\d+)","gridColumnStart"),b("col-end-","gridColumnEnd"),v("col-end-(auto|\\d+)","gridColumnEnd"),b("grid-rows-","gridTemplateRows"),v("grid-rows-(\\d+)","gridTemplateRows",jc),b("row-","gridRow"),v("row-(span)-(\\d+)","gridRow",Lc),b("row-start-","gridRowStart"),v("row-start-(auto|\\d+)","gridRowStart"),b("row-end-","gridRowEnd"),v("row-end-(auto|\\d+)","gridRowEnd"),v("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>Li(Ac(t))),v("grid-flow-(dense)","gridAutoFlow"),b("auto-cols-","gridAutoColumns"),b("auto-rows-","gridAutoRows"),b("gap-x(?:$|-)","gap","columnGap"),b("gap-y(?:$|-)","gap","rowGap"),b("gap(?:$|-)","gap"),"(justify-(?:items|self))-",v("justify-","justifyContent",Ic),v("(content|items|self)-",t=>({["align-"+t[1]]:Ic(t)})),v("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),b("p([xytrbl])?(?:$|-)","padding",lr("padding")),b("-?m([xytrbl])?(?:$|-)","margin",lr("margin")),b("-?space-(x|y)(?:$|-)","space",({1:t,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[t]]:`calc(${e} * calc(1 - var(--tw-space-${t}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[t]]:`calc(${e} * var(--tw-space-${t}-reverse))`}})),v("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),b("w-","width"),b("min-w-","minWidth"),b("max-w-","maxWidth"),b("h-","height"),b("min-h-","minHeight"),b("max-h-","maxHeight"),b("font-","fontWeight"),b("font-","fontFamily",({_:t})=>typeof(t=B(t))[1]=="string"?{fontFamily:Ae(t)}:{fontFamily:Ae(t[0]),...t[1]}),v("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),v("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),v("italic","fontStyle"),v("not-italic",{fontStyle:"normal"}),v("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:t,2:e="",3:r})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(r?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":t)]:t,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...Ye({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),b("tracking-","letterSpacing"),b("leading-","lineHeight"),v("list-(inside|outside)","listStylePosition"),b("list-","listStyleType"),v("list-","listStyleType"),b("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),re("placeholder-",{property:"color",selector:"&::placeholder"}),v("text-(left|center|right|justify|start|end)","textAlign"),v("text-(ellipsis|clip)","textOverflow"),b("text-opacity-","textOpacity","--tw-text-opacity"),re("text-",{property:"color"}),b("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),b("indent-","textIndent"),v("(overline|underline|line-through)","textDecorationLine"),v("no-underline",{textDecorationLine:"none"}),b("underline-offset-","textUnderlineOffset"),re("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),b("decoration-","textDecorationThickness"),v("decoration-","textDecorationStyle"),v("(uppercase|lowercase|capitalize)","textTransform"),v("normal-case",{textTransform:"none"}),v("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),v("align-","verticalAlign"),v("whitespace-","whiteSpace"),v("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),v("break-words",{overflowWrap:"break-word"}),v("break-all",{wordBreak:"break-all"}),v("break-keep",{wordBreak:"keep-all"}),re("caret-",{opacityVariable:!1,opacitySection:"opacity"}),re("accent-",{opacityVariable:!1,opacitySection:"opacity"}),v("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${$t(t," ")},var(--tw-gradient-stops))`),re("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-from":t.value,"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),re("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${t.value},var(--tw-gradient-to)`})),re("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),v("bg-(fixed|local|scroll)","backgroundAttachment"),v("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),v(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),v("bg-blend-","backgroundBlendMode"),v("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),b("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),re("bg-",{section:"backgroundColor"}),b("bg-","backgroundImage"),b("bg-","backgroundPosition"),v("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Li),b("bg-","backgroundSize"),b("rounded(?:$|-)","borderRadius"),b("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:t,_:e})=>{let r={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[t]||[t,t];return{[`border-${$t(r[0])}-radius`]:e,[`border-${$t(r[1])}-radius`]:e}}),v("border-(collapse|separate)","borderCollapse"),b("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),v("border-(solid|dashed|dotted|double|none)","borderStyle"),b("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...Ye({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(t||"-x")]:e,["--tw-border-spacing"+(t||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),re("border-([xytrbl])-",{section:"borderColor"},lr("border","Color")),re("border-"),b("border-([xytrbl])(?:$|-)","borderWidth",lr("border","Width")),b("border(?:$|-)","borderWidth"),b("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),v("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),v("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),b("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${$t(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${$t(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),re("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),b("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),re("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),b("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),v("ring-inset",{"--tw-ring-inset":"inset"}),re("ring-",{property:"--tw-ring-color"}),b("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...Ye({"--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":ke(e("ringOffsetColor","","#fff")),"--tw-ring-color":ke(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${t} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),re("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),b("shadow(?:$|-)","boxShadow",({_:t})=>({...Ye({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":Ae(t),"--tw-shadow-colored":Ae(t).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),b("(opacity)-"),v("mix-blend-","mixBlendMode"),...Tc(),...Tc("backdrop-"),b("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:Ae(t),transitionTimingFunction:t._=="none"?void 0:Ae(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:Ae(e("transitionDuration",""))})),b("duration(?:$|-)","transitionDuration","transitionDuration",Ae),b("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Ae),b("delay(?:$|-)","transitionDelay","transitionDelay",Ae),b("animate(?:$|-)","animation",(t,{theme:e,h:r,e:n})=>{let i=Ae(t),s=i.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=n(r(s[0])))]:o,animation:s.join(" ")}:{animation:i}}),"(transform)-(none)",v("transform",Ko),v("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":Dc(t=="gpu")})),b("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...Ko()})),b("-?(rotate)-","rotate",Zo),b("-?(translate-[xy])-","translate",Zo),b("-?(skew-[xy])-","skew",Zo),v("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Li),"(appearance)-",b("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",b("(cursor)-"),"(cursor)-",v("snap-(none)","scroll-snap-type"),v("snap-(x|y|both)",({1:t})=>({...Ye({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),v("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),v("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),v("snap-(normal|always)","scroll-snap-stop"),v("scroll-(auto|smooth)","scroll-behavior"),b("scroll-p([xytrbl])?(?:$|-)","padding",lr("scroll-padding")),b("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",lr("scroll-margin")),v("touch-(auto|none|manipulation)","touch-action"),v("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...Ye({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":r?"pan-y":t}`]:t,"touch-action":"var(--tw-touch-action)"})),v("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),v("outline",{outlineStyle:"solid"}),v("outline-(dashed|dotted|double)","outlineStyle"),b("-?(outline-offset)-"),re("outline-",{opacityVariable:!1,opacitySection:"opacity"}),b("outline-","outlineWidth"),"(pointer-events)-",b("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],v("select-(none|text|all|auto)","userSelect"),re("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),re("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),b("stroke-","strokeWidth"),v("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),v("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Li(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function Ac(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function $t(t,e="-"){let r=[];for(let n of t)r.push({t:"top",r:"right",b:"bottom",l:"left"}[n]);return r.join(e)}function Ae(t){return t&&""+(t._||t)}function Ic({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function lr(t,e=""){return({1:r,_:n})=>{let i={x:"lr",y:"tb"}[r]||r+r;return i?{...pn(t+"-"+$t(i[0])+e,n),...pn(t+"-"+$t(i[1])+e,n)}:pn(t+e,n)}}function Tc(t=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",t&&"opacity","saturate","sepia",!t&&"drop-shadow"].filter(Boolean),r={};for(let n of e)r[`--tw-${t}${n}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...Ye(r),[`${t}filter`]:e.map(n=>`var(--tw-${t}${n})`).join(" ")},[`(${t}filter)-(none)`,v(`${t}filter`,r),...e.map(n=>b(`${n[0]=="h"?"-?":""}(${t}${n})(?:$|-)`,n,({1:i,_:s})=>({[`--tw-${i}`]:B(s).map(o=>`${n}(${o})`).join(" "),...r})))]}function Zo({1:t,_:e}){return{["--tw-"+t]:e,...Ko()}}function Ko(){return{...Ye({"--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":Dc()}),transform:"var(--tw-transform)"}}function Dc(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 Lc({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function jc({1:t}){return`repeat(${t},minmax(0,1fr))`}function Ye(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var Uc=[["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)||je(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:n="",6:i=e},{e:s,h:o,v:u})=>{let l=ar(n)||(r[0]=="["?r:u(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(t+i))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||je(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)||je(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=je(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&ar(t).replace(/[}]+$/,"").split("{")]];function Pc({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:Mc,theme:{...dn,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:Uc,rules:Oc,finalize(r){return r.n&&r.d&&r.r.some(n=>/^&::(before|after)$/.test(n))&&!/(^|;)content:/.test(r.d)?{...r,d:"content:var(--tw-content);"+r.d}:r}}}var Xh={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Yh={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Qh={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},ed={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},td={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},rd={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},nd={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},id={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},sd={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},od={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},ad={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},ld={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},cd={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},ud={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},pd={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},hd={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},dd={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},fd={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},md={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},gd={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},wd={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},yd={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Rc={__proto__:null,slate:Xh,gray:Yh,zinc:Qh,neutral:ed,stone:td,red:rd,orange:nd,amber:id,yellow:sd,lime:od,green:ad,emerald:ld,teal:cd,cyan:ud,sky:pd,blue:hd,indigo:dd,violet:fd,purple:md,fuchsia:gd,pink:wd,rose:yd};function Bc({disablePreflight:t}={}){return Pc({colors:Rc,disablePreflight:t})}function Nc({className:t="prose",defaultColor:e="gray",extend:r={},colors:n={}}={}){return n={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...n,dark:n.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...n.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${t}-${s}`,(u,l)=>Hc(t,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${t})`,({1:s},{h:o})=>[{c:o(s)}]],[`${t}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[t+"-",({$$:s},o)=>{let u=Fc(o.theme("fontSize",s));return u&&{"@layer components":u}}],[t+"-",({$$:s},o)=>i(s,o)],[t,(s,o)=>({...i(e,o),"@layer base":[Vc(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:E(20,16),marginBottom:E(20,16),paddingLeft:E(26,16)},li:{marginTop:E(8,16),marginBottom:E(8,16)},"ol>li,ul>li":{paddingLeft:E(6,16)},">ul>li p":{marginTop:E(12,16),marginBottom:E(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:E(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:E(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:E(12,16),marginBottom:E(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:E(48,16),marginBottom:E(48,16)},blockquote:{marginTop:E(32,20),marginBottom:E(32,20),paddingLeft:E(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:E(20,16),marginBottom:E(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:E(36,16),marginTop:"0",marginBottom:E(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:E(24,16),marginTop:E(48,24),marginBottom:E(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:E(20,16),marginTop:E(32,20),marginBottom:E(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:E(24,16),marginBottom:E(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:E(32,16),marginBottom:E(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:E(14,16),lineHeight:"1.4",marginTop:E(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:E(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:E(21,24)},"h3 code":{fontSize:E(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:E(14,16),lineHeight:"1.7",marginTop:E(24,14),marginBottom:E(24,14),borderRadius:"0.375rem",paddingTop:E(12,14),paddingRight:E(16,14),paddingBottom:E(12,14),paddingLeft:E(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:E(32,16),marginBottom:E(32,16),fontSize:E(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:E(8,14),paddingBottom:E(8,14),paddingLeft:E(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:E(8,14),paddingRight:E(8,14),paddingBottom:E(8,14),paddingLeft:E(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:E(20,16),lineHeight:"1.6",marginTop:E(24,20),marginBottom:E(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Vc(t,o,r)],"@layer components":{...Fc(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function i(s,o){let u={},l={},c=(p,f,y)=>{let x=o.theme(`colors.${s}.${f}`,f);y["--tw-prose-"+p]=ke(x);let S=y!=l&&o.d("colors",`${s}-${f}`,x);S&&(l["--tw-prose-"+p]=ke(S))};for(let p in n){let f=n[p];p!="dark"&&f&&c(p,f,u)}for(let p in n.dark||{}){let f=n.dark[p];f&&(n.dark?c("invert-"+p,f,u):c(p,f,l))}return Object.keys(u).length?{"@layer defaults":{"&":u,[o.v("dark")]:l}}:void 0}}function Vc(t,e,r){let n={};for(let i in r)n[Hc(t,i,e,s=>`.${e.e(e.h(t))}${s}`)]=r[i];return n}function Hc(t,e,{e:r,h:n},i){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",u=s,l="")=>i(`${o}:where(${u}):not(:where(.${r(n("not-"+t))} *))${l}`))}function Fc(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function E(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var Jo=Go({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:[Bc(),$c(),_c(),Nc()]});function zc(t,e=!0){let r=(function(){if(vd)try{let l=Ti(new CSSStyleSheet);return l.connect=c=>{let p=Xo(c);p.adoptedStyleSheets=[...p.adoptedStyleSheets,l.target]},l.disconnect=Ii,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Ti(s)],u=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(c=>c.snapshot());return()=>l.forEach(c=>c())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,c,p){o[0].insert(l,c,p);let f=this.target.cssRules[c];o.forEach((y,x)=>x&&y.target.insertRule(f.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");Xo(l).appendChild(c);let p=Ti(c),{cssRules:f}=this.target;for(let y=0;y<f.length;y++)p.target.insertRule(f[y].cssText,y);o.push(p),u.set(l,p)},disconnect(l){let c=o.indexOf(u.get(l));c>=0&&o.splice(c,1)}}})(),n=bc({...t,hash:t.hash??e},r),i=xc(n);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),i.observe(Xo(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=n}}}}var vd=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function Xo(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var M=t=>zc(Jo)(t);var fn=class extends M($){constructor(){super(),this.color="#601feb",this.radius="16.8576px",this.size="320px",this.border="#d1d5db"}render(){return d`
|
|
127
127
|
<div class="flex flex-row flex-wrap gap-0">
|
|
128
128
|
<div class="relative z-0 flex min-h-9 items-center justify-center overflow-hidden" style="border-radius: ${this.radius};">
|
|
129
129
|
<!-- Spinning gradient background -->
|
|
@@ -150,7 +150,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
150
150
|
transform: rotate(360deg);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
`);customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",fn);var mn=class extends M($){constructor(){super();w(this,"render",()=>
|
|
153
|
+
`);customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",fn);var mn=class extends M($){constructor(){super();w(this,"render",()=>d`
|
|
154
154
|
<div class="shadow-button inline-block transition-transform hover:scale-105 active:scale-90" style="border-radius: ${this.dynamicRadius};">
|
|
155
155
|
<mw-spinning-border .color="${this.color}" .border="${"#f9fafb"}" .radius="${this.dynamicRadius}">
|
|
156
156
|
<!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
|
|
@@ -161,14 +161,14 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
161
161
|
aria-label="Open Molin AI chat window">
|
|
162
162
|
<!-- the 'open' state invites the user to open (e.g. the chat window) -->
|
|
163
163
|
<div class="${this.state==="open"?"visible opacity-100":"invisible opacity-0"} absolute top-[1px] right-0 bottom-0 left-[1px] transition-[opacity,visibility]">
|
|
164
|
-
${this.src?
|
|
164
|
+
${this.src?d`
|
|
165
165
|
<!-- load given source -->
|
|
166
166
|
<img
|
|
167
167
|
class="flex items-center justify-center bg-white"
|
|
168
168
|
style="width: calc(${this.width} - 2px); height: calc(${this.height} - 2px); border-radius: ${this.dynamicRadius};"
|
|
169
169
|
src="${this.src}"
|
|
170
170
|
alt="Molin AI chat" />
|
|
171
|
-
`:
|
|
171
|
+
`:d`
|
|
172
172
|
<!-- the solid background with AI text -->
|
|
173
173
|
<div
|
|
174
174
|
class="flex items-center justify-center bg-[${this.backgroundColor}]"
|
|
@@ -1147,7 +1147,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1147
1147
|
display: inline-block;
|
|
1148
1148
|
line-height: 0;
|
|
1149
1149
|
}
|
|
1150
|
-
`,this.shadowRoot){for(;this.shadowRoot.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild);this.shadowRoot.appendChild(r)}if(!this.name)return;let n=this.resolveIcon(this.name);if(!n){console.warn(`'${this.name}' not found, please add it to ${gn.name}`);return}let o=new DOMParser().parseFromString(n,"image/svg+xml").documentElement;o.setAttribute("fill",this.fill),o.setAttribute("stroke",this.stroke),o.style.width="100%",o.style.height="100%",this.shadowRoot?.appendChild(o)}};w(gn,"observedAttributes",["name","fill","stroke"]);var ji=gn;var bd=qc,Yo=class extends ji{resolveIcon(e){return bd[e]}};customElements.get("lucide-icon")||customElements.define("lucide-icon",Yo);var yn,Ie,Wc,Gc,xd,Zc,Kc,wn=class wn extends M($){constructor(){super();h(this,Ie);h(this,yn,new Date);this.color="#8B5CF6",this.disabled=!1,this.placeholder="Ask AI...",this.dark=!1,this._inputValue=""}render(){return
|
|
1150
|
+
`,this.shadowRoot){for(;this.shadowRoot.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild);this.shadowRoot.appendChild(r)}if(!this.name)return;let n=this.resolveIcon(this.name);if(!n){console.warn(`'${this.name}' not found, please add it to ${gn.name}`);return}let o=new DOMParser().parseFromString(n,"image/svg+xml").documentElement;o.setAttribute("fill",this.fill),o.setAttribute("stroke",this.stroke),o.style.width="100%",o.style.height="100%",this.shadowRoot?.appendChild(o)}};w(gn,"observedAttributes",["name","fill","stroke"]);var ji=gn;var bd=qc,Yo=class extends ji{resolveIcon(e){return bd[e]}};customElements.get("lucide-icon")||customElements.define("lucide-icon",Yo);var yn,Ie,Wc,Gc,xd,Zc,Kc,wn=class wn extends M($){constructor(){super();h(this,Ie);h(this,yn,new Date);this.color="#8B5CF6",this.disabled=!1,this.placeholder="Ask AI...",this.dark=!1,this._inputValue=""}render(){return d`
|
|
1151
1151
|
<mw-spinning-border
|
|
1152
1152
|
.size=${"420px"}
|
|
1153
1153
|
.color=${this.color||"#8B5CF6"}
|
|
@@ -1179,9 +1179,9 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1179
1179
|
</button>
|
|
1180
1180
|
</form>
|
|
1181
1181
|
</mw-spinning-border>
|
|
1182
|
-
`}};yn=new WeakMap,Ie=new WeakSet,Wc=function(r){let n=r.target;this._inputValue=n.value,this.dispatchEvent(new wn.ChangeEvent({value:this._inputValue}))},Gc=function(r){r.preventDefault();let n=new Date;if(n.getTime()-a(this,yn).getTime()<500)return;g(this,yn,n);let s=this._inputValue.trim();s&&this.dispatchEvent(new wn.SubmitInputEvent({text:s}))&&(this._inputValue="")},xd=function(){return this.renderRoot.querySelector('input[name="input"]')??null},Zc=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},Kc=function(r){kd(r)&&(r.preventDefault(),this.disabled||a(this,Ie,Zc)?.click())},w(wn,"properties",{color:{type:String},disabled:{type:Boolean},placeholder:{type:String},dark:{type:Boolean},_inputValue:{type:String,state:!0}});var Et=wn,Qo;Et.SubmitInputEvent=(Qo=class extends CustomEvent{constructor(e,r={}){super(Et.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}},w(Qo,"type","mw-floating-ask-ai:submit"),Qo);var ea;Et.ChangeEvent=(ea=class extends CustomEvent{constructor(e,r={}){super(Et.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}},w(ea,"type","mw-floating-ask-ai:change"),ea);function kd(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",Et);var Oi={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Di=t=>(...e)=>({_$litDirective$:t,values:e}),cr=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var{I:Cd}=kl;var Jc=()=>document.createComment(""),ur=(t,e,r)=>{let n=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=n.insertBefore(Jc(),i),o=n.insertBefore(Jc(),i);r=new Cd(s,o,t,t.options)}else{let s=r._$AB.nextSibling,o=r._$AM,u=o!==t;if(u){let l;r._$AQ?.(t),r._$AM=t,r._$AP!==void 0&&(l=t._$AU)!==o._$AU&&r._$AP(l)}if(s!==i||u){let l=r._$AA;for(;l!==s;){let c=l.nextSibling;n.insertBefore(l,i),l=c}}}return r},Qe=(t,e,r=t)=>(t._$AI(e,r),t),Sd={},Xc=(t,e=Sd)=>t._$AH=e,Yc=t=>t._$AH,Ui=t=>{t._$AR(),t._$AA.remove()};var Qc=(t,e,r)=>{let n=new Map;for(let i=e;i<=r;i++)n.set(t[i],i);return n},Se=Di(class extends cr{constructor(t){if(super(t),t.type!==Oi.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,r){let n;r===void 0?r=e:e!==void 0&&(n=e);let i=[],s=[],o=0;for(let u of t)i[o]=n?n(u,o):o,s[o]=r(u,o),o++;return{values:s,keys:i}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,n]){let i=Yc(t),{values:s,keys:o}=this.dt(e,r,n);if(!Array.isArray(i))return this.ut=o,s;let u=this.ut??=[],l=[],c,p,
|
|
1182
|
+
`}};yn=new WeakMap,Ie=new WeakSet,Wc=function(r){let n=r.target;this._inputValue=n.value,this.dispatchEvent(new wn.ChangeEvent({value:this._inputValue}))},Gc=function(r){r.preventDefault();let n=new Date;if(n.getTime()-a(this,yn).getTime()<500)return;g(this,yn,n);let s=this._inputValue.trim();s&&this.dispatchEvent(new wn.SubmitInputEvent({text:s}))&&(this._inputValue="")},xd=function(){return this.renderRoot.querySelector('input[name="input"]')??null},Zc=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},Kc=function(r){kd(r)&&(r.preventDefault(),this.disabled||a(this,Ie,Zc)?.click())},w(wn,"properties",{color:{type:String},disabled:{type:Boolean},placeholder:{type:String},dark:{type:Boolean},_inputValue:{type:String,state:!0}});var Et=wn,Qo;Et.SubmitInputEvent=(Qo=class extends CustomEvent{constructor(e,r={}){super(Et.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}},w(Qo,"type","mw-floating-ask-ai:submit"),Qo);var ea;Et.ChangeEvent=(ea=class extends CustomEvent{constructor(e,r={}){super(Et.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}},w(ea,"type","mw-floating-ask-ai:change"),ea);function kd(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",Et);var Oi={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Di=t=>(...e)=>({_$litDirective$:t,values:e}),cr=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var{I:Cd}=kl;var Jc=()=>document.createComment(""),ur=(t,e,r)=>{let n=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=n.insertBefore(Jc(),i),o=n.insertBefore(Jc(),i);r=new Cd(s,o,t,t.options)}else{let s=r._$AB.nextSibling,o=r._$AM,u=o!==t;if(u){let l;r._$AQ?.(t),r._$AM=t,r._$AP!==void 0&&(l=t._$AU)!==o._$AU&&r._$AP(l)}if(s!==i||u){let l=r._$AA;for(;l!==s;){let c=l.nextSibling;n.insertBefore(l,i),l=c}}}return r},Qe=(t,e,r=t)=>(t._$AI(e,r),t),Sd={},Xc=(t,e=Sd)=>t._$AH=e,Yc=t=>t._$AH,Ui=t=>{t._$AR(),t._$AA.remove()};var Qc=(t,e,r)=>{let n=new Map;for(let i=e;i<=r;i++)n.set(t[i],i);return n},Se=Di(class extends cr{constructor(t){if(super(t),t.type!==Oi.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,r){let n;r===void 0?r=e:e!==void 0&&(n=e);let i=[],s=[],o=0;for(let u of t)i[o]=n?n(u,o):o,s[o]=r(u,o),o++;return{values:s,keys:i}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,n]){let i=Yc(t),{values:s,keys:o}=this.dt(e,r,n);if(!Array.isArray(i))return this.ut=o,s;let u=this.ut??=[],l=[],c,p,f=0,y=i.length-1,x=0,S=s.length-1;for(;f<=y&&x<=S;)if(i[f]===null)f++;else if(i[y]===null)y--;else if(u[f]===o[x])l[x]=Qe(i[f],s[x]),f++,x++;else if(u[y]===o[S])l[S]=Qe(i[y],s[S]),y--,S--;else if(u[f]===o[S])l[S]=Qe(i[f],s[S]),ur(t,l[S+1],i[f]),f++,S--;else if(u[y]===o[x])l[x]=Qe(i[y],s[x]),ur(t,i[f],i[y]),y--,x++;else if(c===void 0&&(c=Qc(o,x,S),p=Qc(u,f,y)),c.has(u[f]))if(c.has(u[y])){let I=p.get(o[x]),C=I!==void 0?i[I]:null;if(C===null){let T=ur(t,i[f]);Qe(T,s[x]),l[x]=T}else l[x]=Qe(C,s[x]),ur(t,i[f],C),i[I]=null;x++}else Ui(i[y]),y--;else Ui(i[f]),f++;for(;x<=S;){let I=ur(t,l[S+1]);Qe(I,s[x]),l[x++]=I}for(;f<=y;){let I=i[f++];I!==null&&Ui(I)}return this.ut=o,Xc(t,l),_e}});var Pi,eu,Ri=class Ri extends M($){constructor(){super();h(this,Pi);this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?null:d`
|
|
1183
1183
|
<div class="flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pt-6 pb-2">
|
|
1184
|
-
${this.examples.title?
|
|
1184
|
+
${this.examples.title?d`
|
|
1185
1185
|
<h2 class="mt-14 px-2 pt-9 pb-2 text-left text-3xl leading-tight font-bold tracking-tight">
|
|
1186
1186
|
<span>${this.examples.title}</span>
|
|
1187
1187
|
<svg class="inline-block h-9 w-9 align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 58 61">
|
|
@@ -1191,9 +1191,9 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1191
1191
|
</svg>
|
|
1192
1192
|
</h2>
|
|
1193
1193
|
`:null}
|
|
1194
|
-
${this.examples?.items?.length?
|
|
1194
|
+
${this.examples?.items?.length?d`
|
|
1195
1195
|
<ul class="mt-auto flex flex-wrap justify-end gap-2.5 text-sm leading-6 text-black select-none">
|
|
1196
|
-
${Se(this.examples.items,r=>r,r=>
|
|
1196
|
+
${Se(this.examples.items,r=>r,r=>d`
|
|
1197
1197
|
<li
|
|
1198
1198
|
class="my-auto inline-block cursor-pointer rounded-2xl border-1 border-gray-300 px-4 py-2 text-left transition-all duration-200 hover:-translate-y-0.5 hover:bg-[${this.color}]/[0.08] hover:opacity-80 hover:shadow"
|
|
1199
1199
|
@click="${()=>m(this,Pi,eu).call(this,r)}">
|
|
@@ -1203,7 +1203,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1203
1203
|
</ul>
|
|
1204
1204
|
`:null}
|
|
1205
1205
|
</div>
|
|
1206
|
-
`}};Pi=new WeakSet,eu=function(r){this.dispatchEvent(new Ri.ExampleClickEvent({example:r}))},w(Ri,"properties",{examples:{type:Object},color:{type:String}});var vn=Ri,ta;vn.ExampleClickEvent=(ta=class extends CustomEvent{constructor(e,r={}){super(vn.ExampleClickEvent.type,{detail:e,...r})}},w(ta,"type","mw:example-click"),ta);customElements.get("mw-chat-background")||customElements.define("mw-chat-background",vn);var hr,tu,ru,pr=class pr extends M($){constructor(){super();h(this,hr);this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}render(){return
|
|
1206
|
+
`}};Pi=new WeakSet,eu=function(r){this.dispatchEvent(new Ri.ExampleClickEvent({example:r}))},w(Ri,"properties",{examples:{type:Object},color:{type:String}});var vn=Ri,ta;vn.ExampleClickEvent=(ta=class extends CustomEvent{constructor(e,r={}){super(vn.ExampleClickEvent.type,{detail:e,...r})}},w(ta,"type","mw:example-click"),ta);customElements.get("mw-chat-background")||customElements.define("mw-chat-background",vn);var hr,tu,ru,pr=class pr extends M($){constructor(){super();h(this,hr);this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}render(){return d`
|
|
1207
1207
|
<div class="relative z-10 h-12">
|
|
1208
1208
|
<div class="gradient-blur absolute inset-x-0.5 mt-2 h-12"></div>
|
|
1209
1209
|
|
|
@@ -1265,13 +1265,13 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1265
1265
|
/* bg-color gradient */
|
|
1266
1266
|
background-image: linear-gradient(to bottom, white 20%, transparent);
|
|
1267
1267
|
}
|
|
1268
|
-
`);var _t=pr,ra;_t.NewChatClickEvent=(ra=class extends CustomEvent{constructor(e={}){super(_t.NewChatClickEvent.type,{...e})}},w(ra,"type","mw:new-chat-click"),ra);var na;_t.CloseClickEvent=(na=class extends CustomEvent{constructor(e={}){super(_t.CloseClickEvent.type,{...e})}},w(na,"type","mw:close-click"),na);customElements.get("mw-chat-header")||customElements.define("mw-chat-header",_t);var xp=th(ou(),1);var Tt,bn,et,Lt,Ni,au,Fi=class{constructor(e,r,n){h(this,Ni);h(this,Tt);h(this,bn);h(this,et);h(this,Lt);w(this,"isLoading",!1);w(this,"data");g(this,Tt,e),g(this,bn,r),g(this,et,n),e.addController(this)}fetch(){if(this.isLoading)return;a(this,Lt)?.abort();let e=new AbortController;g(this,Lt,e),this.isLoading=!0,this.data=void 0,a(this,Tt).requestUpdate(),(async()=>{let r=m(this,Ni,au).call(this);return r.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(r,{signal:e.signal})})().then(async r=>{if(!r.ok)throw new Error(`${r.statusText}: ${await r.text()}`);this.isLoading=!1,this.data=typeof a(this,et)?.transform=="function"?await a(this,et).transform(r):r,a(this,Tt).requestUpdate()}).catch(r=>{a(this,et)?.onError?.(r),this.isLoading=!1,this.data=void 0,a(this,Tt).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||a(this,et)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){a(this,Lt)?.abort(),g(this,Lt,void 0)}};Tt=new WeakMap,bn=new WeakMap,et=new WeakMap,Lt=new WeakMap,Ni=new WeakSet,au=function(){let e=a(this,bn);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var tt,De,la,xn,aa=class{constructor(e=window.localStorage){h(this,De);h(this,tt);g(this,tt,e)}setex(e,r,n){return a(this,tt).setItem(e,m(this,De,xn).call(this,{value:m(this,De,xn).call(this,r),expiresAt:Date.now()+n*1e3})||"")}set(e,r){return a(this,tt).setItem(e,m(this,De,xn).call(this,{value:m(this,De,xn).call(this,r)})||"")}get(e){let r=a(this,tt).getItem(e);if(!r)return;let n=m(this,De,la).call(this,r);if(n){if(n.expiresAt&&n.expiresAt<Date.now()){a(this,tt).removeItem(e);return}return m(this,De,la).call(this,n.value)}}get molin_shop_assistant_distinct_id(){return localStorage.getItem("molin_shop_assistant_distinct_id")}set molin_shop_assistant_distinct_id(e){e===null?localStorage.removeItem("molin_shop_assistant_distinct_id"):localStorage.setItem("molin_shop_assistant_distinct_id",e)}get molin_widget_open_state(){return ve.get("molin-shop-ai-widget-open")??null}set molin_widget_open_state(e){ve.set("molin-shop-ai-widget-open",e)}resetWidgetData(){ve.molin_shop_assistant_distinct_id=null,ve.molin_widget_open_state=null}};tt=new WeakMap,De=new WeakSet,la=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},xn=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var ve=new aa;var jt,fr,mr,rt,nt,lu,cu,uu,Hi,zi,qi,kn,Wi,Ue=class extends M($){constructor(){super();h(this,nt);h(this,jt,!1);h(this,fr,!1);h(this,mr,!1);h(this,rt,!1);h(this,Hi,r=>{console.error("Failed to load chat image:",this.src),g(this,fr,!0),this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:r},bubbles:!0}))});h(this,zi,r=>{g(this,jt,!0),this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:r},bubbles:!0}))});h(this,qi,r=>{this.clickable&&(r.preventDefault(),r.stopPropagation(),g(this,mr,!0),this.requestUpdate(),g(this,rt,!0),this.requestUpdate(),setTimeout(()=>{g(this,rt,!1),this.requestUpdate()},500),this.dispatchEvent(new CustomEvent("mw-chat-image:click",{detail:{src:this.src,event:r},bubbles:!0})))});h(this,kn,r=>{r.preventDefault(),r.stopPropagation(),g(this,mr,!1),this.requestUpdate()});h(this,Wi,r=>{r.preventDefault(),r.stopPropagation()});this.src="",this.alt="",this.side="right",this.position="single",this.width="300px",this.height="auto",this.clickable=!1}updated(r){r.has("src")&&(g(this,jt,!1),g(this,fr,!1))}render(){return this.src?
|
|
1268
|
+
`);var _t=pr,ra;_t.NewChatClickEvent=(ra=class extends CustomEvent{constructor(e={}){super(_t.NewChatClickEvent.type,{...e})}},w(ra,"type","mw:new-chat-click"),ra);var na;_t.CloseClickEvent=(na=class extends CustomEvent{constructor(e={}){super(_t.CloseClickEvent.type,{...e})}},w(na,"type","mw:close-click"),na);customElements.get("mw-chat-header")||customElements.define("mw-chat-header",_t);var xp=th(ou(),1);var Tt,bn,et,Lt,Ni,au,Fi=class{constructor(e,r,n){h(this,Ni);h(this,Tt);h(this,bn);h(this,et);h(this,Lt);w(this,"isLoading",!1);w(this,"data");g(this,Tt,e),g(this,bn,r),g(this,et,n),e.addController(this)}fetch(){if(this.isLoading)return;a(this,Lt)?.abort();let e=new AbortController;g(this,Lt,e),this.isLoading=!0,this.data=void 0,a(this,Tt).requestUpdate(),(async()=>{let r=m(this,Ni,au).call(this);return r.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(r,{signal:e.signal})})().then(async r=>{if(!r.ok)throw new Error(`${r.statusText}: ${await r.text()}`);this.isLoading=!1,this.data=typeof a(this,et)?.transform=="function"?await a(this,et).transform(r):r,a(this,Tt).requestUpdate()}).catch(r=>{a(this,et)?.onError?.(r),this.isLoading=!1,this.data=void 0,a(this,Tt).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||a(this,et)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){a(this,Lt)?.abort(),g(this,Lt,void 0)}};Tt=new WeakMap,bn=new WeakMap,et=new WeakMap,Lt=new WeakMap,Ni=new WeakSet,au=function(){let e=a(this,bn);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var tt,De,la,xn,aa=class{constructor(e=window.localStorage){h(this,De);h(this,tt);g(this,tt,e)}setex(e,r,n){return a(this,tt).setItem(e,m(this,De,xn).call(this,{value:m(this,De,xn).call(this,r),expiresAt:Date.now()+n*1e3})||"")}set(e,r){return a(this,tt).setItem(e,m(this,De,xn).call(this,{value:m(this,De,xn).call(this,r)})||"")}get(e){let r=a(this,tt).getItem(e);if(!r)return;let n=m(this,De,la).call(this,r);if(n){if(n.expiresAt&&n.expiresAt<Date.now()){a(this,tt).removeItem(e);return}return m(this,De,la).call(this,n.value)}}get molin_shop_assistant_distinct_id(){return localStorage.getItem("molin_shop_assistant_distinct_id")}set molin_shop_assistant_distinct_id(e){e===null?localStorage.removeItem("molin_shop_assistant_distinct_id"):localStorage.setItem("molin_shop_assistant_distinct_id",e)}get molin_widget_open_state(){return ve.get("molin-shop-ai-widget-open")??null}set molin_widget_open_state(e){ve.set("molin-shop-ai-widget-open",e)}resetWidgetData(){ve.molin_shop_assistant_distinct_id=null,ve.molin_widget_open_state=null}};tt=new WeakMap,De=new WeakSet,la=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},xn=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var ve=new aa;var jt,fr,mr,rt,nt,lu,cu,uu,Hi,zi,qi,kn,Wi,Ue=class extends M($){constructor(){super();h(this,nt);h(this,jt,!1);h(this,fr,!1);h(this,mr,!1);h(this,rt,!1);h(this,Hi,r=>{console.error("Failed to load chat image:",this.src),g(this,fr,!0),this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:r},bubbles:!0}))});h(this,zi,r=>{g(this,jt,!0),this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:r},bubbles:!0}))});h(this,qi,r=>{this.clickable&&(r.preventDefault(),r.stopPropagation(),g(this,mr,!0),this.requestUpdate(),g(this,rt,!0),this.requestUpdate(),setTimeout(()=>{g(this,rt,!1),this.requestUpdate()},500),this.dispatchEvent(new CustomEvent("mw-chat-image:click",{detail:{src:this.src,event:r},bubbles:!0})))});h(this,kn,r=>{r.preventDefault(),r.stopPropagation(),g(this,mr,!1),this.requestUpdate()});h(this,Wi,r=>{r.preventDefault(),r.stopPropagation()});this.src="",this.alt="",this.side="right",this.position="single",this.width="300px",this.height="auto",this.clickable=!1}updated(r){r.has("src")&&(g(this,jt,!1),g(this,fr,!1))}render(){return this.src?d`
|
|
1269
1269
|
<div class="${a(this,nt,lu)} mb-2 min-h-[100px]">
|
|
1270
1270
|
<div class="${a(this,nt,cu)} relative">
|
|
1271
1271
|
<!-- Placeholder background that's only shown when loading or error -->
|
|
1272
|
-
${a(this,jt)?null:
|
|
1272
|
+
${a(this,jt)?null:d`
|
|
1273
1273
|
<div class="flex items-center justify-center bg-gray-100" style="width: ${this.width}; height: 200px;">
|
|
1274
|
-
${a(this,fr)?
|
|
1274
|
+
${a(this,fr)?d`
|
|
1275
1275
|
<!-- Error icon -->
|
|
1276
1276
|
<svg class="h-8 w-8 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
1277
1277
|
<path
|
|
@@ -1279,7 +1279,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1279
1279
|
stroke-linejoin="round"
|
|
1280
1280
|
d="m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
|
|
1281
1281
|
</svg>
|
|
1282
|
-
`:
|
|
1282
|
+
`:d`
|
|
1283
1283
|
<!-- Loading pulse animation -->
|
|
1284
1284
|
<div class="h-8 w-8 animate-pulse rounded-full bg-gray-300"></div>
|
|
1285
1285
|
`}
|
|
@@ -1300,7 +1300,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1300
1300
|
</div>
|
|
1301
1301
|
|
|
1302
1302
|
<!-- Full image modal -->
|
|
1303
|
-
${a(this,mr)?
|
|
1303
|
+
${a(this,mr)?d`
|
|
1304
1304
|
<div
|
|
1305
1305
|
class="${a(this,rt)?"bg-opacity-0":"bg-opacity-75"} fixed inset-0 z-50 flex items-center justify-center bg-black p-4 transition-opacity duration-300"
|
|
1306
1306
|
@click="${a(this,kn)}">
|
|
@@ -1324,7 +1324,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1324
1324
|
</div>
|
|
1325
1325
|
</div>
|
|
1326
1326
|
`:null}
|
|
1327
|
-
`:(console.warn("MwChatImage: No src provided"),null)}};jt=new WeakMap,fr=new WeakMap,mr=new WeakMap,rt=new WeakMap,nt=new WeakSet,lu=function(){return this.side==="left"||this.side==="assistant"?"flex justify-start":"flex justify-end"},cu=function(){let r="inline-block overflow-hidden shadow-sm";if(this.side==="right"||this.side==="user")switch(this.position){case"first":r+=" rounded-2xl rounded-br-[4px]";break;case"middle":r+=" rounded-2xl rounded-r-[4px]";break;case"last":case"last-current":r+=" rounded-2xl rounded-tr-[4px]";break;default:r+=" rounded-2xl";break}else switch(this.position){case"first":r+=" rounded-2xl rounded-bl-[4px]";break;case"middle":r+=" rounded-2xl rounded-l-[4px]";break;case"last":case"last-current":r+=" rounded-2xl rounded-tl-[4px]";break;default:r+=" rounded-2xl";break}return r},uu=function(){if(!this.src)return"";try{let r=new URL(this.src);return r.searchParams.set("for","full"),r.href}catch{return this.src}},Hi=new WeakMap,zi=new WeakMap,qi=new WeakMap,kn=new WeakMap,Wi=new WeakMap,w(Ue,"properties",{src:{type:String},alt:{type:String},side:{type:String},position:{type:String},width:{type:String},height:{type:String},clickable:{type:Boolean}});var ca;Ue.ErrorEvent=(ca=class extends CustomEvent{constructor(e,r={}){super(Ue.ErrorEvent.type,{detail:e,...r})}},w(ca,"type","mw-chat-image:error"),ca);var ua;Ue.LoadEvent=(ua=class extends CustomEvent{constructor(e,r={}){super(Ue.LoadEvent.type,{detail:e,...r})}},w(ua,"type","mw-chat-image:load"),ua);var pa;Ue.ClickEvent=(pa=class extends CustomEvent{constructor(e,r={}){super(Ue.ClickEvent.type,{detail:e,...r})}},w(pa,"type","mw-chat-image:click"),pa);customElements.get("mw-chat-image")||customElements.define("mw-chat-image",Ue);var Gi=class extends M($){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single"}render(){let r=this.side==="user"&&this.position==="single"?"rounded-2xl":this.side==="user"&&["single-current","first"].includes(this.position)?"rounded-2xl rounded-br-[4px]":this.side==="user"&&["middle","last-current"].includes(this.position)?"rounded-2xl rounded-r-[4px]":this.side==="user"&&this.position==="last"?"rounded-2xl rounded-tr-[4px]":["support","assistant"].includes(this.side)&&["single","single-current"].includes(this.position)?"rounded-2xl":["support","assistant"].includes(this.side)&&this.position==="first"?"rounded-2xl rounded-bl-[4px]":["support","assistant"].includes(this.side)&&this.position==="middle"?"rounded-2xl rounded-l-[4px]":["support","assistant"].includes(this.side)&&["last","last-current"].includes(this.position)?"rounded-2xl rounded-tl-[4px]":"rounded-2xl";switch(this.side){case"user":return
|
|
1327
|
+
`:(console.warn("MwChatImage: No src provided"),null)}};jt=new WeakMap,fr=new WeakMap,mr=new WeakMap,rt=new WeakMap,nt=new WeakSet,lu=function(){return this.side==="left"||this.side==="assistant"?"flex justify-start":"flex justify-end"},cu=function(){let r="inline-block overflow-hidden shadow-sm";if(this.side==="right"||this.side==="user")switch(this.position){case"first":r+=" rounded-2xl rounded-br-[4px]";break;case"middle":r+=" rounded-2xl rounded-r-[4px]";break;case"last":case"last-current":r+=" rounded-2xl rounded-tr-[4px]";break;default:r+=" rounded-2xl";break}else switch(this.position){case"first":r+=" rounded-2xl rounded-bl-[4px]";break;case"middle":r+=" rounded-2xl rounded-l-[4px]";break;case"last":case"last-current":r+=" rounded-2xl rounded-tl-[4px]";break;default:r+=" rounded-2xl";break}return r},uu=function(){if(!this.src)return"";try{let r=new URL(this.src);return r.searchParams.set("for","full"),r.href}catch{return this.src}},Hi=new WeakMap,zi=new WeakMap,qi=new WeakMap,kn=new WeakMap,Wi=new WeakMap,w(Ue,"properties",{src:{type:String},alt:{type:String},side:{type:String},position:{type:String},width:{type:String},height:{type:String},clickable:{type:Boolean}});var ca;Ue.ErrorEvent=(ca=class extends CustomEvent{constructor(e,r={}){super(Ue.ErrorEvent.type,{detail:e,...r})}},w(ca,"type","mw-chat-image:error"),ca);var ua;Ue.LoadEvent=(ua=class extends CustomEvent{constructor(e,r={}){super(Ue.LoadEvent.type,{detail:e,...r})}},w(ua,"type","mw-chat-image:load"),ua);var pa;Ue.ClickEvent=(pa=class extends CustomEvent{constructor(e,r={}){super(Ue.ClickEvent.type,{detail:e,...r})}},w(pa,"type","mw-chat-image:click"),pa);customElements.get("mw-chat-image")||customElements.define("mw-chat-image",Ue);var Gi=class extends M($){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single"}render(){let r=this.side==="user"&&this.position==="single"?"rounded-2xl":this.side==="user"&&["single-current","first"].includes(this.position)?"rounded-2xl rounded-br-[4px]":this.side==="user"&&["middle","last-current"].includes(this.position)?"rounded-2xl rounded-r-[4px]":this.side==="user"&&this.position==="last"?"rounded-2xl rounded-tr-[4px]":["support","assistant"].includes(this.side)&&["single","single-current"].includes(this.position)?"rounded-2xl":["support","assistant"].includes(this.side)&&this.position==="first"?"rounded-2xl rounded-bl-[4px]":["support","assistant"].includes(this.side)&&this.position==="middle"?"rounded-2xl rounded-l-[4px]":["support","assistant"].includes(this.side)&&["last","last-current"].includes(this.position)?"rounded-2xl rounded-tl-[4px]":"rounded-2xl";switch(this.side){case"user":return d`
|
|
1328
1328
|
<div class="ml-20 flex justify-end font-sans text-base">
|
|
1329
1329
|
<div class="max-w-full">
|
|
1330
1330
|
<!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
|
|
@@ -1333,7 +1333,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1333
1333
|
</div>
|
|
1334
1334
|
|
|
1335
1335
|
<!-- render status (if any) -->
|
|
1336
|
-
${this.status==="sent"?
|
|
1336
|
+
${this.status==="sent"?d`
|
|
1337
1337
|
<!-- tick mark -->
|
|
1338
1338
|
<svg class="ml-auto h-3 w-3 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
|
1339
1339
|
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
|
|
@@ -1341,7 +1341,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1341
1341
|
`:null}
|
|
1342
1342
|
</div>
|
|
1343
1343
|
</div>
|
|
1344
|
-
`;case"assistant":case"support":return
|
|
1344
|
+
`;case"assistant":case"support":return d`
|
|
1345
1345
|
<div class="mr-8 flex justify-start font-sans text-base">
|
|
1346
1346
|
<div class="flex max-w-full space-x-2">
|
|
1347
1347
|
<!--
|
|
@@ -1360,24 +1360,24 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1360
1360
|
</div>
|
|
1361
1361
|
</div>
|
|
1362
1362
|
</div>
|
|
1363
|
-
`;default:throw new Error(`Unknown side: ${this.side}`)}}};w(Gi,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String}});customElements.get("mw-chat-message")||customElements.define("mw-chat-message",Gi);var le=t=>t??z;var Bd=["javascript:","data:text/html","vbscript:","data:text/javascript","data:text/vbscript","data:text/css","data:text/plain","data:text/xml"],ze,da,pu,Zi,hu,Ki,Ji=class Ji extends M($){constructor(){super();h(this,ze);h(this,Zi,r=>{r.preventDefault(),this._dismissed=!0,this.storageKey&&m(this,ze,pu).call(this),this.dispatchEvent(new Ji.DismissEvent)});h(this,Ki,r=>{r.stopPropagation()});this.text="By chatting with us, you agree to the monitoring and recording of this chat to deliver our services and processing of your personal data in accordance with our [Privacy Policy](https://docs.molin.ai/legal/privacy-policy).",this.color="#3b82f6",this.dismissible=!1,this.storageKey="mw-disclaimer-dismissed",this._dismissed=!1}updated(r){super.updated(r),r.has("storageKey")&&this.storageKey&&this.dismissible&&(this._dismissed=m(this,ze,da).call(this))}connectedCallback(){super.connectedCallback(),this.storageKey&&this.dismissible&&(this._dismissed=m(this,ze,da).call(this))}render(){if(this._dismissed)return null;let r=m(this,ze,hu).call(this,this.text);return
|
|
1363
|
+
`;default:throw new Error(`Unknown side: ${this.side}`)}}};w(Gi,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String}});customElements.get("mw-chat-message")||customElements.define("mw-chat-message",Gi);var le=t=>t??z;var Bd=["javascript:","data:text/html","vbscript:","data:text/javascript","data:text/vbscript","data:text/css","data:text/plain","data:text/xml"],ze,da,pu,Zi,hu,Ki,Ji=class Ji extends M($){constructor(){super();h(this,ze);h(this,Zi,r=>{r.preventDefault(),this._dismissed=!0,this.storageKey&&m(this,ze,pu).call(this),this.dispatchEvent(new Ji.DismissEvent)});h(this,Ki,r=>{r.stopPropagation()});this.text="By chatting with us, you agree to the monitoring and recording of this chat to deliver our services and processing of your personal data in accordance with our [Privacy Policy](https://docs.molin.ai/legal/privacy-policy).",this.color="#3b82f6",this.dismissible=!1,this.storageKey="mw-disclaimer-dismissed",this._dismissed=!1}updated(r){super.updated(r),r.has("storageKey")&&this.storageKey&&this.dismissible&&(this._dismissed=m(this,ze,da).call(this))}connectedCallback(){super.connectedCallback(),this.storageKey&&this.dismissible&&(this._dismissed=m(this,ze,da).call(this))}render(){if(this._dismissed)return null;let r=m(this,ze,hu).call(this,this.text);return d`
|
|
1364
1364
|
<div class="flex items-center justify-between">
|
|
1365
1365
|
<div class="flex flex-1 items-center justify-center">
|
|
1366
1366
|
<span class="text-xs text-gray-600"> ${r} </span>
|
|
1367
1367
|
</div>
|
|
1368
1368
|
|
|
1369
|
-
${this.dismissible?
|
|
1369
|
+
${this.dismissible?d`
|
|
1370
1370
|
<button type="button" aria-label="Dismiss" class="ml-2 flex h-4 w-4 flex-shrink-0 cursor-pointer items-center justify-center rounded hover:bg-gray-200" @click="${a(this,Zi)}">
|
|
1371
1371
|
<lucide-icon name="x" class="h-3 w-3 text-gray-500"></lucide-icon>
|
|
1372
1372
|
</button>
|
|
1373
1373
|
`:null}
|
|
1374
1374
|
</div>
|
|
1375
|
-
`}};ze=new WeakSet,da=function(){try{return localStorage.getItem(this.storageKey)==="true"}catch{return!1}},pu=function(){try{localStorage.setItem(this.storageKey,"true")}catch(r){console.warn("Could not save disclaimer dismissed state to localStorage:",r)}},Zi=new WeakMap,hu=function(r){let i=/\[([^\]]+)\]\(([^)]+)\)/g.exec(r);if(i){let s=i[0],o=i[1],u=i[2],l=i.index;return Bd.some(c=>u.toLowerCase().startsWith(c))||!u||!o?r:
|
|
1375
|
+
`}};ze=new WeakSet,da=function(){try{return localStorage.getItem(this.storageKey)==="true"}catch{return!1}},pu=function(){try{localStorage.setItem(this.storageKey,"true")}catch(r){console.warn("Could not save disclaimer dismissed state to localStorage:",r)}},Zi=new WeakMap,hu=function(r){let i=/\[([^\]]+)\]\(([^)]+)\)/g.exec(r);if(i){let s=i[0],o=i[1],u=i[2],l=i.index;return Bd.some(c=>u.toLowerCase().startsWith(c))||!u||!o?r:d`${r.slice(0,l)}<a href="${le(u)}" @click="${a(this,Ki)}" class="underline" style="color: ${this.color}">${o}</a>${r.slice(l+s.length)}`}return r},Ki=new WeakMap,w(Ji,"properties",{text:{type:String},color:{type:String},dismissible:{type:Boolean},storageKey:{type:String,attribute:"storage-key"},_dismissed:{type:Boolean,state:!0}});var Cn=Ji,ha;Cn.DismissEvent=(ha=class extends CustomEvent{constructor(e={}){super(Cn.DismissEvent.type,{...e})}},w(ha,"type","mw-disclaimer:dismiss"),ha);customElements.get("mw-disclaimer")||customElements.define("mw-disclaimer",Cn);var gr,du,fu,Xi=class extends M($){constructor(){super();h(this,gr);this.text="I'm still learning!",this.variant="info",this.autoDismissable=!1,this.dismissDelay=5e3,this._isVisible=!0}connectedCallback(){super.connectedCallback(),this.autoDismissable&&m(this,gr,du).call(this)}render(){let r=m(this,gr,fu).call(this);return d`
|
|
1376
1376
|
<div
|
|
1377
1377
|
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">
|
|
1378
1378
|
<div class="${r.bg} mb-2 flex max-w-[70%] items-center justify-center rounded-full px-3 py-2 select-none">
|
|
1379
1379
|
<!-- Icon based on variant -->
|
|
1380
|
-
${this.variant==="info"?
|
|
1380
|
+
${this.variant==="info"?d`
|
|
1381
1381
|
<!-- (i) symbol for info -->
|
|
1382
1382
|
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
|
|
1383
1383
|
<path
|
|
@@ -1386,21 +1386,21 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1386
1386
|
d="M2.25 12C2.25 6.61522 6.61522 2.25 12 2.25C17.3848 2.25 21.75 6.61522 21.75 12C21.75 17.3848 17.3848 21.75 12 21.75C6.61522 21.75 2.25 17.3848 2.25 12ZM10.9562 10.5584C12.1025 9.98533 13.3931 11.0206 13.0823 12.2639L12.3733 15.0999L12.4148 15.0792C12.7852 14.894 13.2357 15.0441 13.421 15.4146C13.6062 15.7851 13.4561 16.2356 13.0856 16.4208L13.0441 16.4416C11.8979 17.0147 10.6072 15.9794 10.9181 14.7361L11.6271 11.9001L11.5856 11.9208C11.2151 12.1061 10.7646 11.9559 10.5793 11.5854C10.3941 11.2149 10.5443 10.7644 10.9148 10.5792L10.9562 10.5584ZM12 9C12.4142 9 12.75 8.66421 12.75 8.25C12.75 7.83579 12.4142 7.5 12 7.5C11.5858 7.5 11.25 7.83579 11.25 8.25C11.25 8.66421 11.5858 9 12 9Z"
|
|
1387
1387
|
fill="white" />
|
|
1388
1388
|
</svg>
|
|
1389
|
-
`:this.variant==="error"?
|
|
1389
|
+
`:this.variant==="error"?d`
|
|
1390
1390
|
<!-- Alert circle for error -->
|
|
1391
1391
|
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
|
|
1392
1392
|
<circle cx="12" cy="12" r="10" stroke="white" stroke-width="2" />
|
|
1393
1393
|
<line x1="15" y1="9" x2="9" y2="15" stroke="white" stroke-width="2" />
|
|
1394
1394
|
<line x1="9" y1="9" x2="15" y2="15" stroke="white" stroke-width="2" />
|
|
1395
1395
|
</svg>
|
|
1396
|
-
`:this.variant==="warning"?
|
|
1396
|
+
`:this.variant==="warning"?d`
|
|
1397
1397
|
<!-- Alert triangle for warning -->
|
|
1398
1398
|
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
|
|
1399
1399
|
<path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
1400
1400
|
<line x1="12" y1="9" x2="12" y2="13" stroke="white" stroke-width="2" stroke-linecap="round" />
|
|
1401
1401
|
<path d="M12 17h.01" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
1402
1402
|
</svg>
|
|
1403
|
-
`:
|
|
1403
|
+
`:d`
|
|
1404
1404
|
<!-- Check circle for success -->
|
|
1405
1405
|
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
|
|
1406
1406
|
<path d="M22 11.08V12a10 10 0 11-5.93-9.14" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -1411,7 +1411,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1411
1411
|
<span class="${r.text} ml-1 text-xs">${this.text}</span>
|
|
1412
1412
|
</div>
|
|
1413
1413
|
</div>
|
|
1414
|
-
`}};gr=new WeakSet,du=function(){setTimeout(()=>{this._isVisible=!1,this.requestUpdate()},this.dismissDelay)},fu=function(){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"};case"info":default:return{bg:"bg-black",text:"text-white",icon:"info"}}},w(Xi,"properties",{text:{type:String},variant:{type:String},autoDismissable:{type:Boolean,attribute:"auto-dismissable"},dismissDelay:{type:Number,attribute:"dismiss-delay"},_isVisible:{type:Boolean,state:!0}});customElements.get("mw-info-banner")||customElements.define("mw-info-banner",Xi);var fa=class extends M($){constructor(){super(...arguments);w(this,"render",()=>
|
|
1414
|
+
`}};gr=new WeakSet,du=function(){setTimeout(()=>{this._isVisible=!1,this.requestUpdate()},this.dismissDelay)},fu=function(){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"};case"info":default:return{bg:"bg-black",text:"text-white",icon:"info"}}},w(Xi,"properties",{text:{type:String},variant:{type:String},autoDismissable:{type:Boolean,attribute:"auto-dismissable"},dismissDelay:{type:Number,attribute:"dismiss-delay"},_isVisible:{type:Boolean,state:!0}});customElements.get("mw-info-banner")||customElements.define("mw-info-banner",Xi);var fa=class extends M($){constructor(){super(...arguments);w(this,"render",()=>d`
|
|
1415
1415
|
<svg class="inline-block h-full w-full leading-0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" xml:space="preserve">
|
|
1416
1416
|
<circle fill="currentFill" stroke="none" cx="27" cy="50" r="6">
|
|
1417
1417
|
<animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
|
|
@@ -1423,7 +1423,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1423
1423
|
<animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
|
|
1424
1424
|
</circle>
|
|
1425
1425
|
</svg>
|
|
1426
|
-
`)}};customElements.get("mw-loading")||customElements.define("mw-loading",fa);var Vd="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",ma=class extends M($){constructor(){super(...arguments);w(this,"render",()=>
|
|
1426
|
+
`)}};customElements.get("mw-loading")||customElements.define("mw-loading",fa);var Vd="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",ma=class extends M($){constructor(){super(...arguments);w(this,"render",()=>d`
|
|
1427
1427
|
<p class="flex items-center justify-center text-xs whitespace-nowrap">
|
|
1428
1428
|
<span>Powered by</span>
|
|
1429
1429
|
|
|
@@ -1446,33 +1446,33 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1446
1446
|
<span>Molin AI</span>
|
|
1447
1447
|
</a>
|
|
1448
1448
|
</p>
|
|
1449
|
-
`)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",ma);var Yi=class extends M($){constructor(){super(),this.product=void 0,this.streaming=!1,this.linksNewTab=!1,this.searchParams=void 0,this.imagesByProductUrl={}}get trackedProductUrl(){let e=this.product?.url,r=this.searchParams;try{if(e&&r)return Vl(e,r).href}catch{}return e}render(){let{name:e,description:r,price:n,url:i}=this.product||{},s=i?this.imagesByProductUrl?.[i]:void 0;return
|
|
1449
|
+
`)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",ma);var Yi=class extends M($){constructor(){super(),this.product=void 0,this.streaming=!1,this.linksNewTab=!1,this.searchParams=void 0,this.imagesByProductUrl={}}get trackedProductUrl(){let e=this.product?.url,r=this.searchParams;try{if(e&&r)return Vl(e,r).href}catch{}return e}render(){let{name:e,description:r,price:n,url:i}=this.product||{},s=i?this.imagesByProductUrl?.[i]:void 0;return d`
|
|
1450
1450
|
<a
|
|
1451
1451
|
href="${le(this.trackedProductUrl)}"
|
|
1452
1452
|
title="${le(e)}"
|
|
1453
1453
|
class="group flex w-full max-w-md cursor-pointer gap-[10px] overflow-hidden rounded-lg"
|
|
1454
1454
|
target="${this.linksNewTab?"_blank":"_self"}"
|
|
1455
1455
|
?disabled="${this.streaming}">
|
|
1456
|
-
${this.streaming?
|
|
1456
|
+
${this.streaming?d`
|
|
1457
1457
|
<!-- shimmer -->
|
|
1458
1458
|
<div class="h-[70px] w-[70px] animate-pulse overflow-hidden rounded-lg bg-gray-200"></div>
|
|
1459
|
-
`:
|
|
1459
|
+
`:d`<img src="${le(s)}" class="block h-[70px] w-[70px] rounded-lg bg-gray-100 object-contain" loading="lazy" />`}
|
|
1460
1460
|
|
|
1461
1461
|
<div class="flex flex-1 flex-col justify-between">
|
|
1462
1462
|
<div>
|
|
1463
|
-
${e||!this.streaming?
|
|
1463
|
+
${e||!this.streaming?d`<h3 class="line-clamp-1 text-sm font-medium group-hover:underline">${e}</h3>`:d`<div class="h-5 w-32 animate-pulse rounded bg-gray-200"></div>`}
|
|
1464
1464
|
|
|
1465
1465
|
<!-- no margin here -->
|
|
1466
1466
|
|
|
1467
|
-
${r||!this.streaming?
|
|
1467
|
+
${r||!this.streaming?d`<p class="line-clamp-2 text-xs text-gray-500">${r}</p>`:d`<div class="my-1 h-6 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
|
|
1468
1468
|
</div>
|
|
1469
1469
|
|
|
1470
1470
|
<!-- flexbox filled space -->
|
|
1471
1471
|
|
|
1472
|
-
${n||!this.streaming?
|
|
1472
|
+
${n||!this.streaming?d`<span class="text-xs text-gray-900">${n}</span>`:d`<div class="h-4 w-14 animate-pulse rounded bg-gray-200"></div>`}
|
|
1473
1473
|
</div>
|
|
1474
1474
|
</a>
|
|
1475
|
-
`}};w(Yi,"properties",{product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object}});customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",Yi);function Qi(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}var es=function(){},wr=function(){};var Sn=(t,e,r)=>Math.min(Math.max(r,t),e);var ga=.001,Fd=.01,mu=10,Nd=.05,Hd=1;function gu({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s;es(t<=mu*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=Sn(Nd,Hd,o),t=Sn(Fd,mu,t/1e3),o<1?(i=c=>{let p=c*o,d=p*t,y=p-r,x=ts(c,o),S=Math.exp(-d);return ga-y/x*S},s=c=>{let d=c*o*t,y=d*r+r,x=Math.pow(o,2)*Math.pow(c,2)*t,S=Math.exp(-d),I=ts(Math.pow(c,2),o);return(-i(c)+ga>0?-1:1)*((y-x)*S)/I}):(i=c=>{let p=Math.exp(-c*t),d=(c-r)*t+1;return-ga+p*d},s=c=>{let p=Math.exp(-c*t),d=(r-c)*(t*t);return p*d});let u=5/t,l=qd(i,s,u);if(t=t*1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{let c=Math.pow(l,2)*n;return{stiffness:c,damping:o*2*Math.sqrt(n*c),duration:t}}}var zd=12;function qd(t,e,r){let n=r;for(let i=1;i<zd;i++)n=n-t(n)/e(n);return n}function ts(t,e){return t*Math.sqrt(1-e*e)}var Wd=["duration","bounce"],Gd=["stiffness","damping","mass"];function wu(t,e){return e.some(r=>t[r]!==void 0)}function Zd(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!wu(t,Gd)&&wu(t,Wd)){let r=gu(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function rs(t){var{from:e=0,to:r=1,restSpeed:n=2,restDelta:i}=t,s=Qi(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:u,damping:l,mass:c,velocity:p,duration:d,isResolvedFromDuration:y}=Zd(s),x=yu,S=yu;function I(){let C=p?-(p/1e3):0,T=r-e,k=l/(2*Math.sqrt(u*c)),_=Math.sqrt(u/c)/1e3;if(i===void 0&&(i=Math.min(Math.abs(r-e)/100,.4)),k<1){let L=ts(_,k);x=H=>{let Q=Math.exp(-k*_*H);return r-Q*((C+k*_*T)/L*Math.sin(L*H)+T*Math.cos(L*H))},S=H=>{let Q=Math.exp(-k*_*H);return k*_*Q*(Math.sin(L*H)*(C+k*_*T)/L+T*Math.cos(L*H))-Q*(Math.cos(L*H)*(C+k*_*T)-L*T*Math.sin(L*H))}}else if(k===1)x=L=>r-Math.exp(-_*L)*(T+(C+_*T)*L);else{let L=_*Math.sqrt(k*k-1);x=H=>{let Q=Math.exp(-k*_*H),ne=Math.min(L*H,300);return r-Q*((C+k*_*T)*Math.sinh(ne)+L*T*Math.cosh(ne))/L}}}return I(),{next:C=>{let T=x(C);if(y)o.done=C>=d;else{let k=S(C)*1e3,_=Math.abs(k)<=n,L=Math.abs(r-T)<=i;o.done=_&&L}return o.value=o.done?r:T,o},flipTarget:()=>{p=-p,[e,r]=[r,e],I()}}}rs.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var yu=t=>0;var wa=(t,e,r)=>{let n=e-t;return n===0?1:(r-t)/n};var yr=(t,e,r)=>-r*t+r*e+t;var ns=(t,e)=>r=>Math.max(Math.min(r,e),t),it=t=>t%1?Number(t.toFixed(5)):t,vr=/(-)?([\d]*\.?[\d])+/g,is=/(#[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,vu=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function qe(t){return typeof t=="string"}var br={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ss=Object.assign(Object.assign({},br),{transform:ns(0,1)}),Vg=Object.assign(Object.assign({},br),{default:1});var $n=t=>({test:e=>qe(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Hg=$n("deg"),xr=$n("%"),zg=$n("px"),qg=$n("vh"),Wg=$n("vw"),Gg=Object.assign(Object.assign({},xr),{parse:t=>xr.parse(t)/100,transform:t=>xr.transform(t*100)});var kr=(t,e)=>r=>!!(qe(r)&&vu.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),os=(t,e,r)=>n=>{if(!qe(n))return n;let[i,s,o,u]=n.match(vr);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:u!==void 0?parseFloat(u):1}};var Pe={test:kr("hsl","hue"),parse:os("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+xr.transform(it(e))+", "+xr.transform(it(r))+", "+it(ss.transform(n))+")"};var Kd=ns(0,255),as=Object.assign(Object.assign({},br),{transform:t=>Math.round(Kd(t))}),$e={test:kr("rgb","red"),parse:os("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+as.transform(t)+", "+as.transform(e)+", "+as.transform(r)+", "+it(ss.transform(n))+")"};function Jd(t){let e="",r="",n="",i="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),n=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),n=t.substr(3,1),i=t.substr(4,1),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}var Cr={test:kr("#"),parse:Jd,transform:$e.transform};var st={test:t=>$e.test(t)||Cr.test(t)||Pe.test(t),parse:t=>$e.test(t)?$e.parse(t):Pe.test(t)?Pe.parse(t):Cr.parse(t),transform:t=>qe(t)?t:t.hasOwnProperty("red")?$e.transform(t):Pe.transform(t)};var bu="${c}",xu="${n}";function Xd(t){var e,r,n,i;return isNaN(t)&&qe(t)&&((r=(e=t.match(vr))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((i=(n=t.match(is))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0)>0}function ku(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,n=t.match(is);n&&(r=n.length,t=t.replace(is,bu),e.push(...n.map(st.parse)));let i=t.match(vr);return i&&(t=t.replace(vr,xu),e.push(...i.map(br.parse))),{values:e,numColors:r,tokenised:t}}function Cu(t){return ku(t).values}function Su(t){let{values:e,numColors:r,tokenised:n}=ku(t),i=e.length;return s=>{let o=n;for(let u=0;u<i;u++)o=o.replace(u<r?bu:xu,u<r?st.transform(s[u]):it(s[u]));return o}}var Yd=t=>typeof t=="number"?0:t;function Qd(t){let e=Cu(t);return Su(t)(e.map(Yd))}var ls={test:Xd,parse:Cu,createTransformer:Su,getAnimatableNone:Qd};function ya(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 va({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{let u=r<.5?r*(1+e):r+e-r*e,l=2*r-u;i=ya(l,u,t+1/3),s=ya(l,u,t),o=ya(l,u,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}var e1=(t,e,r)=>{let n=t*t,i=e*e;return Math.sqrt(Math.max(0,r*(i-n)+n))},t1=[Cr,$e,Pe],$u=t=>t1.find(e=>e.test(t)),Eu=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,cs=(t,e)=>{let r=$u(t),n=$u(e);wr(!!r,Eu(t)),wr(!!n,Eu(e));let i=r.parse(t),s=n.parse(e);r===Pe&&(i=va(i),r=$e),n===Pe&&(s=va(s),n=$e);let o=Object.assign({},i);return u=>{for(let l in o)l!=="alpha"&&(o[l]=e1(i[l],s[l],u));return o.alpha=yr(i.alpha,s.alpha,u),r.transform(o)}};var _u=t=>typeof t=="number";var r1=(t,e)=>r=>e(t(r)),us=(...t)=>t.reduce(r1);function Au(t,e){return _u(t)?r=>yr(t,e,r):st.test(t)?cs(t,e):xa(t,e)}var ba=(t,e)=>{let r=[...t],n=r.length,i=t.map((s,o)=>Au(s,e[o]));return s=>{for(let o=0;o<n;o++)r[o]=i[o](s);return r}},Iu=(t,e)=>{let r=Object.assign(Object.assign({},t),e),n={};for(let i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=Au(t[i],e[i]));return i=>{for(let s in n)r[s]=n[s](i);return r}};function Mu(t){let e=ls.parse(t),r=e.length,n=0,i=0,s=0;for(let o=0;o<r;o++)n||typeof e[o]=="number"?n++:e[o].hue!==void 0?s++:i++;return{parsed:e,numNumbers:n,numRGB:i,numHSL:s}}var xa=(t,e)=>{let r=ls.createTransformer(e),n=Mu(t),i=Mu(e);return n.numHSL===i.numHSL&&n.numRGB===i.numRGB&&n.numNumbers>=i.numNumbers?us(ba(n.parsed,i.parsed),r):(es(!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 n1=(t,e)=>r=>yr(t,e,r);function i1(t){if(typeof t=="number")return n1;if(typeof t=="string")return st.test(t)?cs:xa;if(Array.isArray(t))return ba;if(typeof t=="object")return Iu}function s1(t,e,r){let n=[],i=r||i1(t[0]),s=t.length-1;for(let o=0;o<s;o++){let u=i(t[o],t[o+1]);if(e){let l=Array.isArray(e)?e[o]:e;u=us(l,u)}n.push(u)}return n}function o1([t,e],[r]){return n=>r(wa(t,e,n))}function a1(t,e){let r=t.length,n=r-1;return i=>{let s=0,o=!1;if(i<=t[0]?o=!0:i>=t[n]&&(s=n-1,o=!0),!o){let l=1;for(;l<r&&!(t[l]>i||l===n);l++);s=l-1}let u=wa(t[s],t[s+1],i);return e[s](u)}}function ps(t,e,{clamp:r=!0,ease:n,mixer:i}={}){let s=t.length;wr(s===e.length,"Both input and output ranges must be the same length"),wr(!n||!Array.isArray(n)||n.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());let o=s1(e,n,i),u=s===2?o1(t,o):a1(t,o);return r?l=>u(Sn(t[0],t[s-1],l)):u}var En=t=>e=>1-t(1-e),hs=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Tu=t=>e=>Math.pow(e,t),ka=t=>e=>e*e*((t+1)*e-t),Lu=t=>{let e=ka(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var ju=1.525,l1=4/11,c1=8/11,u1=9/10;var Ou=Tu(2),J5=En(Ou),Du=hs(Ou),p1=t=>1-Math.sin(Math.acos(t)),h1=En(p1),X5=hs(h1),Uu=ka(ju),Y5=En(Uu),Q5=hs(Uu),ew=Lu(ju),d1=4356/361,f1=35442/1805,m1=16061/1805,g1=t=>{if(t===1||t===0)return t;let e=t*t;return t<l1?7.5625*e:t<c1?9.075*e-9.9*t+3.4:t<u1?d1*e-f1*t+m1:10.8*t*t-20.52*t+10.72},tw=En(g1);function w1(t,e){return t.map(()=>e||Du).splice(0,t.length-1)}function y1(t){let e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function v1(t,e){return t.map(r=>r*e)}function _n({from:t=0,to:e=1,ease:r,offset:n,duration:i=300}){let s={done:!1,value:t},o=Array.isArray(e)?e:[t,e],u=v1(n&&n.length===o.length?n:y1(o),i);function l(){return ps(u,o,{ease:Array.isArray(r)?r:w1(o,r)})}let c=l();return{next:p=>(s.value=c(p),s.done=p>=i,s),flipTarget:()=>{o.reverse(),c=l()}}}function Pu({velocity:t=0,from:e=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){let o={done:!1,value:e},u=r*t,l=e+u,c=s===void 0?l:s(l);return c!==l&&(u=c-e),{next:p=>{let d=-u*Math.exp(-p/n);return o.done=!(d>i||d<-i),o.value=o.done?c:c+d,o},flipTarget:()=>{}}}var Ru={keyframes:_n,spring:rs,decay:Pu};function Bu(t){if(Array.isArray(t.to))return _n;if(Ru[t.type])return Ru[t.type];let e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?_n:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?rs:_n}var Ca=16.666666666666668,b1=typeof performance<"u"?()=>performance.now():()=>Date.now(),Sa=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(b1()),Ca);function Vu(t){let e=[],r=[],n=0,i=!1,s=!1,o=new WeakSet,u={schedule:(l,c=!1,p=!1)=>{let d=p&&i,y=d?e:r;return c&&o.add(l),y.indexOf(l)===-1&&(y.push(l),d&&i&&(n=e.length)),l},cancel:l=>{let c=r.indexOf(l);c!==-1&&r.splice(c,1),o.delete(l)},process:l=>{if(i){s=!0;return}if(i=!0,[e,r]=[r,e],r.length=0,n=e.length,n)for(let c=0;c<n;c++){let p=e[c];p(l),o.has(p)&&(u.schedule(p),t())}i=!1,s&&(s=!1,u.process(l))}};return u}var x1=40,$a=!0,An=!1,Ea=!1,Mn={delta:0,timestamp:0},In=["read","update","preRender","render","postRender"],ds=In.reduce((t,e)=>(t[e]=Vu(()=>An=!0),t),{}),k1=In.reduce((t,e)=>{let r=ds[e];return t[e]=(n,i=!1,s=!1)=>(An||S1(),r.schedule(n,i,s)),t},{}),Fu=In.reduce((t,e)=>(t[e]=ds[e].cancel,t),{}),mw=In.reduce((t,e)=>(t[e]=()=>ds[e].process(Mn),t),{}),C1=t=>ds[t].process(Mn),Nu=t=>{An=!1,Mn.delta=$a?Ca:Math.max(Math.min(t-Mn.timestamp,x1),1),Mn.timestamp=t,Ea=!0,In.forEach(C1),Ea=!1,An&&($a=!1,Sa(Nu))},S1=()=>{An=!0,$a=!0,Ea||Sa(Nu)};var Hu=k1;function _a(t,e,r=0){return t-e-r}function zu(t,e,r=0,n=!0){return n?_a(e+-t,e,r):e-(t-e)+r}function qu(t,e,r,n){return n?t>=e+r:t<=-r}var $1=t=>{let e=({delta:r})=>t(r);return{start:()=>Hu.update(e,!0),stop:()=>Fu.update(e)}};function Ma(t){var e,r,{from:n,autoplay:i=!0,driver:s=$1,elapsed:o=0,repeat:u=0,repeatType:l="loop",repeatDelay:c=0,onPlay:p,onStop:d,onComplete:y,onRepeat:x,onUpdate:S}=t,I=Qi(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:C}=I,T,k=0,_=I.duration,L,H=!1,Q=!0,ne,P=Bu(I);!((r=(e=P).needsInterpolation)===null||r===void 0)&&r.call(e,n,C)&&(ne=ps([0,100],[n,C],{clamp:!1}),n=0,C=100);let ie=P(Object.assign(Object.assign({},I),{from:n,to:C}));function pe(){k++,l==="reverse"?(Q=k%2===0,o=zu(o,_,c,Q)):(o=_a(o,_,c),l==="mirror"&&ie.flipTarget()),H=!1,x&&x()}function Zs(){T.stop(),y&&y()}function ht(Z){if(Q||(Z=-Z),o+=Z,!H){let se=ie.next(Math.max(0,o));L=se.value,ne&&(L=ne(L)),H=Q?se.done:o<=0}S?.(L),H&&(k===0&&(_??(_=o)),k<u?qu(o,_,c,Q)&&pe():Zs())}function si(){p?.(),T=s(ht),T.start()}return i&&si(),{stop:()=>{d?.(),T.stop()}}}var V,Wu,fs,Gu,ms,Zu,Ku,Ju,gs,ws=class ws extends M($){constructor(){super();h(this,V);this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(r){r.has("product")&&m(this,V,Wu).call(this)}get images(){return this.product?.images||[]}render(){if(!this.product)return f`
|
|
1475
|
+
`}};w(Yi,"properties",{product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object}});customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",Yi);function Qi(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}var es=function(){},wr=function(){};var Sn=(t,e,r)=>Math.min(Math.max(r,t),e);var ga=.001,Fd=.01,mu=10,Nd=.05,Hd=1;function gu({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s;es(t<=mu*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=Sn(Nd,Hd,o),t=Sn(Fd,mu,t/1e3),o<1?(i=c=>{let p=c*o,f=p*t,y=p-r,x=ts(c,o),S=Math.exp(-f);return ga-y/x*S},s=c=>{let f=c*o*t,y=f*r+r,x=Math.pow(o,2)*Math.pow(c,2)*t,S=Math.exp(-f),I=ts(Math.pow(c,2),o);return(-i(c)+ga>0?-1:1)*((y-x)*S)/I}):(i=c=>{let p=Math.exp(-c*t),f=(c-r)*t+1;return-ga+p*f},s=c=>{let p=Math.exp(-c*t),f=(r-c)*(t*t);return p*f});let u=5/t,l=qd(i,s,u);if(t=t*1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{let c=Math.pow(l,2)*n;return{stiffness:c,damping:o*2*Math.sqrt(n*c),duration:t}}}var zd=12;function qd(t,e,r){let n=r;for(let i=1;i<zd;i++)n=n-t(n)/e(n);return n}function ts(t,e){return t*Math.sqrt(1-e*e)}var Wd=["duration","bounce"],Gd=["stiffness","damping","mass"];function wu(t,e){return e.some(r=>t[r]!==void 0)}function Zd(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!wu(t,Gd)&&wu(t,Wd)){let r=gu(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function rs(t){var{from:e=0,to:r=1,restSpeed:n=2,restDelta:i}=t,s=Qi(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:u,damping:l,mass:c,velocity:p,duration:f,isResolvedFromDuration:y}=Zd(s),x=yu,S=yu;function I(){let C=p?-(p/1e3):0,T=r-e,k=l/(2*Math.sqrt(u*c)),_=Math.sqrt(u/c)/1e3;if(i===void 0&&(i=Math.min(Math.abs(r-e)/100,.4)),k<1){let L=ts(_,k);x=H=>{let Q=Math.exp(-k*_*H);return r-Q*((C+k*_*T)/L*Math.sin(L*H)+T*Math.cos(L*H))},S=H=>{let Q=Math.exp(-k*_*H);return k*_*Q*(Math.sin(L*H)*(C+k*_*T)/L+T*Math.cos(L*H))-Q*(Math.cos(L*H)*(C+k*_*T)-L*T*Math.sin(L*H))}}else if(k===1)x=L=>r-Math.exp(-_*L)*(T+(C+_*T)*L);else{let L=_*Math.sqrt(k*k-1);x=H=>{let Q=Math.exp(-k*_*H),ne=Math.min(L*H,300);return r-Q*((C+k*_*T)*Math.sinh(ne)+L*T*Math.cosh(ne))/L}}}return I(),{next:C=>{let T=x(C);if(y)o.done=C>=f;else{let k=S(C)*1e3,_=Math.abs(k)<=n,L=Math.abs(r-T)<=i;o.done=_&&L}return o.value=o.done?r:T,o},flipTarget:()=>{p=-p,[e,r]=[r,e],I()}}}rs.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var yu=t=>0;var wa=(t,e,r)=>{let n=e-t;return n===0?1:(r-t)/n};var yr=(t,e,r)=>-r*t+r*e+t;var ns=(t,e)=>r=>Math.max(Math.min(r,e),t),it=t=>t%1?Number(t.toFixed(5)):t,vr=/(-)?([\d]*\.?[\d])+/g,is=/(#[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,vu=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function qe(t){return typeof t=="string"}var br={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ss=Object.assign(Object.assign({},br),{transform:ns(0,1)}),Vg=Object.assign(Object.assign({},br),{default:1});var $n=t=>({test:e=>qe(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Hg=$n("deg"),xr=$n("%"),zg=$n("px"),qg=$n("vh"),Wg=$n("vw"),Gg=Object.assign(Object.assign({},xr),{parse:t=>xr.parse(t)/100,transform:t=>xr.transform(t*100)});var kr=(t,e)=>r=>!!(qe(r)&&vu.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),os=(t,e,r)=>n=>{if(!qe(n))return n;let[i,s,o,u]=n.match(vr);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:u!==void 0?parseFloat(u):1}};var Pe={test:kr("hsl","hue"),parse:os("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+xr.transform(it(e))+", "+xr.transform(it(r))+", "+it(ss.transform(n))+")"};var Kd=ns(0,255),as=Object.assign(Object.assign({},br),{transform:t=>Math.round(Kd(t))}),$e={test:kr("rgb","red"),parse:os("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+as.transform(t)+", "+as.transform(e)+", "+as.transform(r)+", "+it(ss.transform(n))+")"};function Jd(t){let e="",r="",n="",i="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),n=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),n=t.substr(3,1),i=t.substr(4,1),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}var Cr={test:kr("#"),parse:Jd,transform:$e.transform};var st={test:t=>$e.test(t)||Cr.test(t)||Pe.test(t),parse:t=>$e.test(t)?$e.parse(t):Pe.test(t)?Pe.parse(t):Cr.parse(t),transform:t=>qe(t)?t:t.hasOwnProperty("red")?$e.transform(t):Pe.transform(t)};var bu="${c}",xu="${n}";function Xd(t){var e,r,n,i;return isNaN(t)&&qe(t)&&((r=(e=t.match(vr))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((i=(n=t.match(is))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0)>0}function ku(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,n=t.match(is);n&&(r=n.length,t=t.replace(is,bu),e.push(...n.map(st.parse)));let i=t.match(vr);return i&&(t=t.replace(vr,xu),e.push(...i.map(br.parse))),{values:e,numColors:r,tokenised:t}}function Cu(t){return ku(t).values}function Su(t){let{values:e,numColors:r,tokenised:n}=ku(t),i=e.length;return s=>{let o=n;for(let u=0;u<i;u++)o=o.replace(u<r?bu:xu,u<r?st.transform(s[u]):it(s[u]));return o}}var Yd=t=>typeof t=="number"?0:t;function Qd(t){let e=Cu(t);return Su(t)(e.map(Yd))}var ls={test:Xd,parse:Cu,createTransformer:Su,getAnimatableNone:Qd};function ya(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 va({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{let u=r<.5?r*(1+e):r+e-r*e,l=2*r-u;i=ya(l,u,t+1/3),s=ya(l,u,t),o=ya(l,u,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}var e1=(t,e,r)=>{let n=t*t,i=e*e;return Math.sqrt(Math.max(0,r*(i-n)+n))},t1=[Cr,$e,Pe],$u=t=>t1.find(e=>e.test(t)),Eu=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,cs=(t,e)=>{let r=$u(t),n=$u(e);wr(!!r,Eu(t)),wr(!!n,Eu(e));let i=r.parse(t),s=n.parse(e);r===Pe&&(i=va(i),r=$e),n===Pe&&(s=va(s),n=$e);let o=Object.assign({},i);return u=>{for(let l in o)l!=="alpha"&&(o[l]=e1(i[l],s[l],u));return o.alpha=yr(i.alpha,s.alpha,u),r.transform(o)}};var _u=t=>typeof t=="number";var r1=(t,e)=>r=>e(t(r)),us=(...t)=>t.reduce(r1);function Au(t,e){return _u(t)?r=>yr(t,e,r):st.test(t)?cs(t,e):xa(t,e)}var ba=(t,e)=>{let r=[...t],n=r.length,i=t.map((s,o)=>Au(s,e[o]));return s=>{for(let o=0;o<n;o++)r[o]=i[o](s);return r}},Iu=(t,e)=>{let r=Object.assign(Object.assign({},t),e),n={};for(let i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=Au(t[i],e[i]));return i=>{for(let s in n)r[s]=n[s](i);return r}};function Mu(t){let e=ls.parse(t),r=e.length,n=0,i=0,s=0;for(let o=0;o<r;o++)n||typeof e[o]=="number"?n++:e[o].hue!==void 0?s++:i++;return{parsed:e,numNumbers:n,numRGB:i,numHSL:s}}var xa=(t,e)=>{let r=ls.createTransformer(e),n=Mu(t),i=Mu(e);return n.numHSL===i.numHSL&&n.numRGB===i.numRGB&&n.numNumbers>=i.numNumbers?us(ba(n.parsed,i.parsed),r):(es(!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 n1=(t,e)=>r=>yr(t,e,r);function i1(t){if(typeof t=="number")return n1;if(typeof t=="string")return st.test(t)?cs:xa;if(Array.isArray(t))return ba;if(typeof t=="object")return Iu}function s1(t,e,r){let n=[],i=r||i1(t[0]),s=t.length-1;for(let o=0;o<s;o++){let u=i(t[o],t[o+1]);if(e){let l=Array.isArray(e)?e[o]:e;u=us(l,u)}n.push(u)}return n}function o1([t,e],[r]){return n=>r(wa(t,e,n))}function a1(t,e){let r=t.length,n=r-1;return i=>{let s=0,o=!1;if(i<=t[0]?o=!0:i>=t[n]&&(s=n-1,o=!0),!o){let l=1;for(;l<r&&!(t[l]>i||l===n);l++);s=l-1}let u=wa(t[s],t[s+1],i);return e[s](u)}}function ps(t,e,{clamp:r=!0,ease:n,mixer:i}={}){let s=t.length;wr(s===e.length,"Both input and output ranges must be the same length"),wr(!n||!Array.isArray(n)||n.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());let o=s1(e,n,i),u=s===2?o1(t,o):a1(t,o);return r?l=>u(Sn(t[0],t[s-1],l)):u}var En=t=>e=>1-t(1-e),hs=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Tu=t=>e=>Math.pow(e,t),ka=t=>e=>e*e*((t+1)*e-t),Lu=t=>{let e=ka(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var ju=1.525,l1=4/11,c1=8/11,u1=9/10;var Ou=Tu(2),J5=En(Ou),Du=hs(Ou),p1=t=>1-Math.sin(Math.acos(t)),h1=En(p1),X5=hs(h1),Uu=ka(ju),Y5=En(Uu),Q5=hs(Uu),ew=Lu(ju),d1=4356/361,f1=35442/1805,m1=16061/1805,g1=t=>{if(t===1||t===0)return t;let e=t*t;return t<l1?7.5625*e:t<c1?9.075*e-9.9*t+3.4:t<u1?d1*e-f1*t+m1:10.8*t*t-20.52*t+10.72},tw=En(g1);function w1(t,e){return t.map(()=>e||Du).splice(0,t.length-1)}function y1(t){let e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function v1(t,e){return t.map(r=>r*e)}function _n({from:t=0,to:e=1,ease:r,offset:n,duration:i=300}){let s={done:!1,value:t},o=Array.isArray(e)?e:[t,e],u=v1(n&&n.length===o.length?n:y1(o),i);function l(){return ps(u,o,{ease:Array.isArray(r)?r:w1(o,r)})}let c=l();return{next:p=>(s.value=c(p),s.done=p>=i,s),flipTarget:()=>{o.reverse(),c=l()}}}function Pu({velocity:t=0,from:e=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){let o={done:!1,value:e},u=r*t,l=e+u,c=s===void 0?l:s(l);return c!==l&&(u=c-e),{next:p=>{let f=-u*Math.exp(-p/n);return o.done=!(f>i||f<-i),o.value=o.done?c:c+f,o},flipTarget:()=>{}}}var Ru={keyframes:_n,spring:rs,decay:Pu};function Bu(t){if(Array.isArray(t.to))return _n;if(Ru[t.type])return Ru[t.type];let e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?_n:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?rs:_n}var Ca=16.666666666666668,b1=typeof performance<"u"?()=>performance.now():()=>Date.now(),Sa=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(b1()),Ca);function Vu(t){let e=[],r=[],n=0,i=!1,s=!1,o=new WeakSet,u={schedule:(l,c=!1,p=!1)=>{let f=p&&i,y=f?e:r;return c&&o.add(l),y.indexOf(l)===-1&&(y.push(l),f&&i&&(n=e.length)),l},cancel:l=>{let c=r.indexOf(l);c!==-1&&r.splice(c,1),o.delete(l)},process:l=>{if(i){s=!0;return}if(i=!0,[e,r]=[r,e],r.length=0,n=e.length,n)for(let c=0;c<n;c++){let p=e[c];p(l),o.has(p)&&(u.schedule(p),t())}i=!1,s&&(s=!1,u.process(l))}};return u}var x1=40,$a=!0,An=!1,Ea=!1,Mn={delta:0,timestamp:0},In=["read","update","preRender","render","postRender"],ds=In.reduce((t,e)=>(t[e]=Vu(()=>An=!0),t),{}),k1=In.reduce((t,e)=>{let r=ds[e];return t[e]=(n,i=!1,s=!1)=>(An||S1(),r.schedule(n,i,s)),t},{}),Fu=In.reduce((t,e)=>(t[e]=ds[e].cancel,t),{}),mw=In.reduce((t,e)=>(t[e]=()=>ds[e].process(Mn),t),{}),C1=t=>ds[t].process(Mn),Nu=t=>{An=!1,Mn.delta=$a?Ca:Math.max(Math.min(t-Mn.timestamp,x1),1),Mn.timestamp=t,Ea=!0,In.forEach(C1),Ea=!1,An&&($a=!1,Sa(Nu))},S1=()=>{An=!0,$a=!0,Ea||Sa(Nu)};var Hu=k1;function _a(t,e,r=0){return t-e-r}function zu(t,e,r=0,n=!0){return n?_a(e+-t,e,r):e-(t-e)+r}function qu(t,e,r,n){return n?t>=e+r:t<=-r}var $1=t=>{let e=({delta:r})=>t(r);return{start:()=>Hu.update(e,!0),stop:()=>Fu.update(e)}};function Ma(t){var e,r,{from:n,autoplay:i=!0,driver:s=$1,elapsed:o=0,repeat:u=0,repeatType:l="loop",repeatDelay:c=0,onPlay:p,onStop:f,onComplete:y,onRepeat:x,onUpdate:S}=t,I=Qi(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:C}=I,T,k=0,_=I.duration,L,H=!1,Q=!0,ne,P=Bu(I);!((r=(e=P).needsInterpolation)===null||r===void 0)&&r.call(e,n,C)&&(ne=ps([0,100],[n,C],{clamp:!1}),n=0,C=100);let ie=P(Object.assign(Object.assign({},I),{from:n,to:C}));function pe(){k++,l==="reverse"?(Q=k%2===0,o=zu(o,_,c,Q)):(o=_a(o,_,c),l==="mirror"&&ie.flipTarget()),H=!1,x&&x()}function Zs(){T.stop(),y&&y()}function ht(Z){if(Q||(Z=-Z),o+=Z,!H){let se=ie.next(Math.max(0,o));L=se.value,ne&&(L=ne(L)),H=Q?se.done:o<=0}S?.(L),H&&(k===0&&(_??(_=o)),k<u?qu(o,_,c,Q)&&pe():Zs())}function si(){p?.(),T=s(ht),T.start()}return i&&si(),{stop:()=>{f?.(),T.stop()}}}var V,Wu,fs,Gu,ms,Zu,Ku,Ju,gs,ws=class ws extends M($){constructor(){super();h(this,V);this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(r){r.has("product")&&m(this,V,Wu).call(this)}get images(){return this.product?.images||[]}render(){if(!this.product)return d`
|
|
1476
1476
|
<div class="my-2 w-full rounded-3xl border bg-white p-4">
|
|
1477
1477
|
<div class="relative mx-auto mb-4 max-w-[240px]">
|
|
1478
1478
|
<div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200"></div>
|
|
@@ -1491,15 +1491,15 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1491
1491
|
<div class="h-8 flex-auto animate-pulse rounded-xl bg-gray-200"></div>
|
|
1492
1492
|
</div>
|
|
1493
1493
|
</div>
|
|
1494
|
-
`;if(this.product.layout==="horizontal")return
|
|
1494
|
+
`;if(this.product.layout==="horizontal")return d` <mw-product-card-horizontal product="${JSON.stringify(this.product)}"></mw-product-card-horizontal> `;let{name:r,description:n,price:i,category:s}=this.product;return d`
|
|
1495
1495
|
<div class="my-2 w-full rounded-3xl border-[0.5px] border-[#5e5d59]/25 bg-white p-4 hover:shadow-sm">
|
|
1496
1496
|
<div class="pointer-events-auto mx-auto mb-4">
|
|
1497
1497
|
<div class="group relative overflow-hidden rounded-2xl">
|
|
1498
1498
|
<div class="image-slider z-0 flex transition-transform duration-300 ease-in-out" style="transform: translateX(-${this._currentImageIndex*100}%)">
|
|
1499
|
-
${this.images.length>0?Se(this.images,o=>o,(o,u)=>
|
|
1499
|
+
${this.images.length>0?Se(this.images,o=>o,(o,u)=>d`
|
|
1500
1500
|
<!-- TODO: add srcset with 1x/2x variants for high DPI displays -->
|
|
1501
1501
|
<img src="${o}" alt="image ${u+1}: ${r}" class="h-auto w-full flex-shrink-0 object-scale-down" loading="lazy" />
|
|
1502
|
-
`):
|
|
1502
|
+
`):d`
|
|
1503
1503
|
<div class="h-full w-full flex-shrink-0 object-scale-down"></div>
|
|
1504
1504
|
<svg class="rounded-lg" height="144" viewBox="0 0 100 133" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1505
1505
|
<rect width="100" height="133" rx="2" fill="#EEEEEE" style="" transform="matrix(0.9999999999999999, 0, 0, 0.9999999999999999, 0, -7.105427357601002e-15)" />
|
|
@@ -1511,7 +1511,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1511
1511
|
</svg>
|
|
1512
1512
|
`}
|
|
1513
1513
|
</div>
|
|
1514
|
-
${this.images.length>1?
|
|
1514
|
+
${this.images.length>1?d`
|
|
1515
1515
|
<div class="absolute inset-0 flex items-center justify-between px-4">
|
|
1516
1516
|
<button
|
|
1517
1517
|
@click="${m(this,V,Ku)}"
|
|
@@ -1525,9 +1525,9 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1525
1525
|
</button>
|
|
1526
1526
|
</div>
|
|
1527
1527
|
`:null}
|
|
1528
|
-
${this.images?.length>1?
|
|
1528
|
+
${this.images?.length>1?d`
|
|
1529
1529
|
<div class="slider-dots absolute bottom-3 left-1/2 flex -translate-x-1/2 gap-2">
|
|
1530
|
-
${this.images.map((o,u)=>
|
|
1530
|
+
${this.images.map((o,u)=>d`
|
|
1531
1531
|
<button
|
|
1532
1532
|
@click="${()=>m(this,V,Ju).call(this,u)}"
|
|
1533
1533
|
class="${u===this._currentImageIndex?"bg-opacity-100":"bg-opacity-60"} hover:bg-opacity-80 h-1.5 w-1.5 rounded-full bg-white transition-all"></button>
|
|
@@ -1537,15 +1537,15 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1537
1537
|
</div>
|
|
1538
1538
|
</div>
|
|
1539
1539
|
<div @click="${m(this,V,fs)}" class="cursor-pointer">
|
|
1540
|
-
${s?
|
|
1540
|
+
${s?d`<a @click="${m(this,V,fs)}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline"> ${s} </a>`:null}
|
|
1541
1541
|
|
|
1542
1542
|
<h3
|
|
1543
1543
|
@click="${m(this,V,fs)}"
|
|
1544
1544
|
class="${this._isValidUrl?"":"pointer-events-none cursor-default"} mb-1 line-clamp-2 cursor-pointer text-lg font-semibold transition-all hover:underline">
|
|
1545
|
-
${r||
|
|
1545
|
+
${r||d`<span class="inline-block h-6 w-32 animate-pulse rounded bg-gray-200"></span>`}
|
|
1546
1546
|
</h3>
|
|
1547
|
-
${n?
|
|
1548
|
-
<span class="text-lg font-bold"> ${i||
|
|
1547
|
+
${n?d`<p class="mb-2 line-clamp-2 text-sm text-gray-600">${n}</p>`:d`<div class="mb-2 h-4 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
|
|
1548
|
+
<span class="text-lg font-bold"> ${i||d`<span class="inline-block h-6 w-16 animate-pulse rounded bg-gray-200"></span>`} </span>
|
|
1549
1549
|
|
|
1550
1550
|
<!-- <div class="my-4 border-t border-gray-200"></div> -->
|
|
1551
1551
|
|
|
@@ -1557,21 +1557,21 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1557
1557
|
</button> -->
|
|
1558
1558
|
</div>
|
|
1559
1559
|
</div>
|
|
1560
|
-
`}};V=new WeakSet,Wu=function(){if(!this.product?.url){this._isValidUrl=!1;return}try{let r=new URL(this.product.url);this._isValidUrl=r.protocol==="http:"||r.protocol==="https:"}catch{this._isValidUrl=!1}},fs=function(r){r.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")},Gu=function(r){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new ws.AddToCartEvent(this.product)))},ms=function(r,n){a(this,V,gs)&&Ma({from:r,to:n,duration:300,onUpdate:i=>{a(this,V,gs)&&(a(this,V,gs).style.transform=`translateX(${i}%)`)}})},Zu=function(){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=(r+1)%this.product.images.length,i=-(r*100),s=-(n*100);m(this,V,ms).call(this,i,s),this._currentImageIndex=n},Ku=function(){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=(r-1+this.product.images.length)%this.product.images.length,i=-(r*100),s=-(n*100);m(this,V,ms).call(this,i,s),this._currentImageIndex=n},Ju=function(r){if(!this.product?.images?.length)return;let n=this._currentImageIndex,i=Math.max(0,Math.min(r,this.product.images.length-1)),s=-(n*100),o=-(i*100);m(this,V,ms).call(this,s,o),this._currentImageIndex=i},gs=function(){return this.renderRoot.querySelector(".image-slider")},w(ws,"properties",{product:{type:Object},labels:{type:Object},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}});var Tn=ws,Aa;Tn.AddToCartEvent=(Aa=class extends CustomEvent{constructor(e,r={}){super(Tn.AddToCartEvent.type,{detail:{product:e},...r})}},w(Aa,"type","mw-product-card:add-to-cart"),Aa);customElements.get("mw-product-card")||customElements.define("mw-product-card",Tn);function Sr(t){return Array.isArray(t)?t:t?[t]:[]}function Xu(t,e){let r=new Map;for(let n of t){let i=e(n);r.has(i)||r.set(i,[]),(r.get(i)||[]).push(n)}return r}var Yu=(t,e,r)=>{for(let n of e)if(n[0]===t)return(0,n[1])();return r?.()};var ys=class extends M($){constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1}render(){let e=Sr(this.orderDetails?.order_status?.step||[]),r=Sr(this.orderDetails?.items?.item||[]),n=Sr(this.orderDetails?.actions||[]);return
|
|
1560
|
+
`}};V=new WeakSet,Wu=function(){if(!this.product?.url){this._isValidUrl=!1;return}try{let r=new URL(this.product.url);this._isValidUrl=r.protocol==="http:"||r.protocol==="https:"}catch{this._isValidUrl=!1}},fs=function(r){r.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")},Gu=function(r){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new ws.AddToCartEvent(this.product)))},ms=function(r,n){a(this,V,gs)&&Ma({from:r,to:n,duration:300,onUpdate:i=>{a(this,V,gs)&&(a(this,V,gs).style.transform=`translateX(${i}%)`)}})},Zu=function(){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=(r+1)%this.product.images.length,i=-(r*100),s=-(n*100);m(this,V,ms).call(this,i,s),this._currentImageIndex=n},Ku=function(){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=(r-1+this.product.images.length)%this.product.images.length,i=-(r*100),s=-(n*100);m(this,V,ms).call(this,i,s),this._currentImageIndex=n},Ju=function(r){if(!this.product?.images?.length)return;let n=this._currentImageIndex,i=Math.max(0,Math.min(r,this.product.images.length-1)),s=-(n*100),o=-(i*100);m(this,V,ms).call(this,s,o),this._currentImageIndex=i},gs=function(){return this.renderRoot.querySelector(".image-slider")},w(ws,"properties",{product:{type:Object},labels:{type:Object},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}});var Tn=ws,Aa;Tn.AddToCartEvent=(Aa=class extends CustomEvent{constructor(e,r={}){super(Tn.AddToCartEvent.type,{detail:{product:e},...r})}},w(Aa,"type","mw-product-card:add-to-cart"),Aa);customElements.get("mw-product-card")||customElements.define("mw-product-card",Tn);function Sr(t){return Array.isArray(t)?t:t?[t]:[]}function Xu(t,e){let r=new Map;for(let n of t){let i=e(n);r.has(i)||r.set(i,[]),(r.get(i)||[]).push(n)}return r}var Yu=(t,e,r)=>{for(let n of e)if(n[0]===t)return(0,n[1])();return r?.()};var ys=class extends M($){constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1}render(){let e=Sr(this.orderDetails?.order_status?.step||[]),r=Sr(this.orderDetails?.items?.item||[]),n=Sr(this.orderDetails?.actions||[]);return d`
|
|
1561
1561
|
<div class="flex w-full max-w-md flex-col rounded-3xl border bg-white p-4">
|
|
1562
1562
|
<!-- Header with order ID -->
|
|
1563
1563
|
<div class="mb-2">
|
|
1564
|
-
${this.orderDetails?.order_id?.label||!this.streaming?
|
|
1564
|
+
${this.orderDetails?.order_id?.label||!this.streaming?d`<h2 class="text-lg font-semibold">${this.orderDetails?.order_id?.label} ${this.orderDetails?.order_id?.value}</h2>`:d`<div class="h-7 w-full animate-pulse rounded bg-gray-200"></div>`}
|
|
1565
1565
|
</div>
|
|
1566
1566
|
|
|
1567
1567
|
<!-- Progress Timeline -->
|
|
1568
1568
|
<div>
|
|
1569
1569
|
<ol role="list" class="w-full overflow-hidden">
|
|
1570
|
-
${this.streaming&&!this.orderDetails?
|
|
1570
|
+
${this.streaming&&!this.orderDetails?d`
|
|
1571
1571
|
<!-- Loading for status timeline -->
|
|
1572
|
-
${[1,2,3].map((i,s)=>
|
|
1572
|
+
${[1,2,3].map((i,s)=>d`
|
|
1573
1573
|
<li class="w-full pb-8">
|
|
1574
|
-
${s<2?
|
|
1574
|
+
${s<2?d`<div class="absolute top-2 left-2 mt-0.5 -ml-px h-full w-0.5 animate-pulse bg-gray-200" aria-hidden="true"></div>`:""}
|
|
1575
1575
|
<div class="group relative flex items-start">
|
|
1576
1576
|
<span class="flex h-6 items-center">
|
|
1577
1577
|
<span class="h-4 w-4 animate-pulse rounded-full bg-gray-200"></span>
|
|
@@ -1582,25 +1582,25 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1582
1582
|
</div>
|
|
1583
1583
|
</li>
|
|
1584
1584
|
`)}
|
|
1585
|
-
`:Se(e,i=>i.label,(i,s)=>{let o=i.status==="completed",u=i.status==="in_progress",l=s===e.length-1;return
|
|
1586
|
-
${l?"":
|
|
1585
|
+
`:Se(e,i=>i.label,(i,s)=>{let o=i.status==="completed",u=i.status==="in_progress",l=s===e.length-1;return d`<li class="relative pb-4">
|
|
1586
|
+
${l?"":d`<div class="${`absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 ${o?"bg-[#601feb]":"bg-gray-300"}`}" aria-hidden="true"></div>`}
|
|
1587
1587
|
|
|
1588
1588
|
<div class="group relative flex items-start">
|
|
1589
|
-
${Yu(i.status,[["pending",()=>
|
|
1589
|
+
${Yu(i.status,[["pending",()=>d` <span class="flex h-6 items-center">
|
|
1590
1590
|
<span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-gray-300 bg-white">
|
|
1591
1591
|
<span class="h-1.5 w-1.5 rounded-full bg-transparent"></span>
|
|
1592
1592
|
</span>
|
|
1593
|
-
</span>`],["in_progress",()=>
|
|
1593
|
+
</span>`],["in_progress",()=>d`<span class="flex h-6 items-center">
|
|
1594
1594
|
<span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[#601feb] bg-white">
|
|
1595
1595
|
<span class="h-1.5 w-1.5 rounded-full bg-[#601feb]"></span>
|
|
1596
1596
|
</span>
|
|
1597
|
-
</span>`],["completed",()=>
|
|
1597
|
+
</span>`],["completed",()=>d`
|
|
1598
1598
|
<span class="flex h-6 items-center">
|
|
1599
1599
|
<span class="flex h-4 w-4 items-center justify-center rounded-full bg-[#601feb]">
|
|
1600
1600
|
<hi-outline class="mb-3 block h-3 w-3 text-white" name="check"></hi-outline>
|
|
1601
1601
|
</span>
|
|
1602
1602
|
</span>
|
|
1603
|
-
`]],()=>
|
|
1603
|
+
`]],()=>d`<span class="flex h-6 items-center">
|
|
1604
1604
|
<span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[#601feb] bg-white">
|
|
1605
1605
|
<span class="h-1.5 w-1.5 rounded-full bg-[#601feb]"></span>
|
|
1606
1606
|
</span>
|
|
@@ -1616,7 +1616,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1616
1616
|
|
|
1617
1617
|
<!-- Products list with order items -->
|
|
1618
1618
|
<div class="mb-2 w-full">
|
|
1619
|
-
${r.length===0&&!this.orderDetails?.total?.amount&&this.streaming?
|
|
1619
|
+
${r.length===0&&!this.orderDetails?.total?.amount&&this.streaming?d`
|
|
1620
1620
|
<!-- Loading shimmer for products -->
|
|
1621
1621
|
<div class="w-full space-y-4">
|
|
1622
1622
|
<div class="flex items-center gap-2">
|
|
@@ -1631,11 +1631,11 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1631
1631
|
<div class="h-4 w-10 animate-pulse rounded bg-gray-200"></div>
|
|
1632
1632
|
</div>
|
|
1633
1633
|
</div>
|
|
1634
|
-
`:
|
|
1634
|
+
`:d`
|
|
1635
1635
|
<div class="divide-y divide-gray-100">
|
|
1636
|
-
${this.streaming&&!r.length?
|
|
1636
|
+
${this.streaming&&!r.length?d`
|
|
1637
1637
|
<!-- Loading shimmer for individual products -->
|
|
1638
|
-
${[1,2].map(()=>
|
|
1638
|
+
${[1,2].map(()=>d`
|
|
1639
1639
|
<div class="flex items-center gap-2 py-1.5">
|
|
1640
1640
|
<div class="h-12 w-12 animate-pulse rounded-lg bg-gray-200"></div>
|
|
1641
1641
|
<div class="min-w-0 flex-1">
|
|
@@ -1644,14 +1644,14 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1644
1644
|
<div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>
|
|
1645
1645
|
</div>
|
|
1646
1646
|
`)}
|
|
1647
|
-
`:r?.map(i=>{let s=i?.image_url;return
|
|
1647
|
+
`:r?.map(i=>{let s=i?.image_url;return d`
|
|
1648
1648
|
<div class="flex items-center gap-2 py-1.5">
|
|
1649
1649
|
<img src="${le(s)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain" loading="lazy" />
|
|
1650
1650
|
|
|
1651
1651
|
<div class="min-w-0 flex-1">
|
|
1652
|
-
${!i?.name&&this.streaming?
|
|
1652
|
+
${!i?.name&&this.streaming?d`<div class="h-4 w-32 animate-pulse rounded bg-gray-200"></div>`:d`<h3 class="truncate text-sm font-medium">${i?.name}</h3>`}
|
|
1653
1653
|
</div>
|
|
1654
|
-
${!i?.price&&this.streaming?
|
|
1654
|
+
${!i?.price&&this.streaming?d`<div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>`:d`<span class="text-sm text-gray-500">${i?.quantity&&Number(i.quantity)>1?"x":""} ${i?.price}</span>`}
|
|
1655
1655
|
</div>
|
|
1656
1656
|
`})}
|
|
1657
1657
|
</div>
|
|
@@ -1667,9 +1667,9 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1667
1667
|
|
|
1668
1668
|
<!-- Shipping and payment information -->
|
|
1669
1669
|
<div class="mb-2 flex w-full flex-col gap-2 overflow-hidden">
|
|
1670
|
-
${this.streaming&&!this.orderDetails?
|
|
1670
|
+
${this.streaming&&!this.orderDetails?d`
|
|
1671
1671
|
<!-- Loading shimmer template -->
|
|
1672
|
-
${[1,2].map(()=>
|
|
1672
|
+
${[1,2].map(()=>d`
|
|
1673
1673
|
<div>
|
|
1674
1674
|
<div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
1675
1675
|
<div class="space-y-2 overflow-hidden">
|
|
@@ -1678,10 +1678,10 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1678
1678
|
</div>
|
|
1679
1679
|
</div>
|
|
1680
1680
|
`)}
|
|
1681
|
-
`:
|
|
1681
|
+
`:d`
|
|
1682
1682
|
<!-- Shipping Section -->
|
|
1683
1683
|
<div>
|
|
1684
|
-
${this.streaming&&!this.orderDetails?.shipping?
|
|
1684
|
+
${this.streaming&&!this.orderDetails?.shipping?d`
|
|
1685
1685
|
<div>
|
|
1686
1686
|
<div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
1687
1687
|
<div class="space-y-2 overflow-hidden">
|
|
@@ -1689,18 +1689,18 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1689
1689
|
<div class="h-4 w-36 animate-pulse rounded bg-gray-200"></div>
|
|
1690
1690
|
</div>
|
|
1691
1691
|
</div>
|
|
1692
|
-
`:this.orderDetails?.shipping?.method||this.orderDetails?.customer?.name?
|
|
1692
|
+
`:this.orderDetails?.shipping?.method||this.orderDetails?.customer?.name?d`
|
|
1693
1693
|
<h3 class="mb-1 text-sm font-medium">${this.orderDetails?.shipping?.label}</h3>
|
|
1694
1694
|
<div class="space-y-1">
|
|
1695
|
-
${this.orderDetails.customer?.name?
|
|
1696
|
-
${this.orderDetails.shipping?.method?
|
|
1695
|
+
${this.orderDetails.customer?.name?d`<p class="text-xs text-gray-600">${this.orderDetails.customer.name}</p>`:""}
|
|
1696
|
+
${this.orderDetails.shipping?.method?d`<p class="text-xs text-gray-600">${this.orderDetails.shipping.method}</p>`:""}
|
|
1697
1697
|
</div>
|
|
1698
1698
|
`:""}
|
|
1699
1699
|
</div>
|
|
1700
1700
|
|
|
1701
1701
|
<!-- Payment Section -->
|
|
1702
1702
|
<div>
|
|
1703
|
-
${this.streaming&&!this.orderDetails?.payment?
|
|
1703
|
+
${this.streaming&&!this.orderDetails?.payment?d`
|
|
1704
1704
|
<div>
|
|
1705
1705
|
<div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
1706
1706
|
<div class="space-y-2 overflow-hidden">
|
|
@@ -1708,15 +1708,15 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1708
1708
|
<div class="h-4 w-36 animate-pulse rounded bg-gray-200"></div>
|
|
1709
1709
|
</div>
|
|
1710
1710
|
</div>
|
|
1711
|
-
`:this.orderDetails?.payment?
|
|
1711
|
+
`:this.orderDetails?.payment?d`
|
|
1712
1712
|
<h3 class="mb-1 text-sm font-medium">${this.orderDetails.payment.label}</h3>
|
|
1713
|
-
${this.orderDetails.payment?.method?.value?
|
|
1713
|
+
${this.orderDetails.payment?.method?.value?d`
|
|
1714
1714
|
<p class="text-xs text-gray-600">
|
|
1715
1715
|
<span class="font-medium">${this.orderDetails.payment.method.label}:</span>
|
|
1716
1716
|
${this.orderDetails.payment.method.value}
|
|
1717
1717
|
</p>
|
|
1718
1718
|
`:""}
|
|
1719
|
-
${this.orderDetails.payment.status?.value?
|
|
1719
|
+
${this.orderDetails.payment.status?.value?d`
|
|
1720
1720
|
<p class="text-xs text-gray-600">
|
|
1721
1721
|
<span class="font-medium">${this.orderDetails.payment.status.label}:</span>
|
|
1722
1722
|
<span>${this.orderDetails.payment.status.value}</span>
|
|
@@ -1729,11 +1729,11 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1729
1729
|
|
|
1730
1730
|
<!-- Action buttons section -->
|
|
1731
1731
|
<div class="flex w-full flex-col gap-2 overflow-hidden">
|
|
1732
|
-
${this.streaming&&!n[0]?.track_order?.label&&!Co(n[0]?.track_order?.tracking_url||"")?
|
|
1732
|
+
${this.streaming&&!n[0]?.track_order?.label&&!Co(n[0]?.track_order?.tracking_url||"")?d`
|
|
1733
1733
|
<!-- Loading shimmer for buttons -->
|
|
1734
1734
|
<div class="h-10 w-full min-w-[250px] animate-pulse overflow-hidden rounded-xl bg-gray-200"></div>
|
|
1735
|
-
`:Se(n,(i,s)=>`action-${s}`,i=>{if(i?.track_order?.label)return
|
|
1736
|
-
${Co(i.track_order?.tracking_url||"")?
|
|
1735
|
+
`:Se(n,(i,s)=>`action-${s}`,i=>{if(i?.track_order?.label)return d`
|
|
1736
|
+
${Co(i.track_order?.tracking_url||"")?d` <a
|
|
1737
1737
|
target="${this.linksNewTab?"_blank":"_self"}"
|
|
1738
1738
|
href="${i.track_order?.tracking_url}"
|
|
1739
1739
|
class="mt-1 w-full rounded-xl bg-[#601feb] px-4 py-2 text-center text-sm font-medium text-white hover:opacity-90"
|
|
@@ -1742,15 +1742,15 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1742
1742
|
`})}
|
|
1743
1743
|
</div>
|
|
1744
1744
|
</div>
|
|
1745
|
-
`}};w(ys,"properties",{orderDetails:{type:Object,attribute:"order-details"},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"}});customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",ys);var Ln=class extends cr{constructor(e){if(super(e),this.it=z,e.type!==Oi.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===z||e==null)return this._t=void 0,this.it=e;if(e===_e)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let r=[e];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}};Ln.directiveName="unsafeHTML",Ln.resultType=1;var Qu=Di(Ln);var ep=Jl(He({name:X(),description:X(),price:X(),image_url:nr([X(),tr(X())]),category:X(),url:X()}));function tp(t,e,r,{imagesByProductUrl:n,linksNewTab:i=!0,searchParams:s,messageIsStreaming:o=!1}){if(!t)return
|
|
1746
|
-
${u?
|
|
1745
|
+
`}};w(ys,"properties",{orderDetails:{type:Object,attribute:"order-details"},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"}});customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",ys);var Ln=class extends cr{constructor(e){if(super(e),this.it=z,e.type!==Oi.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===z||e==null)return this._t=void 0,this.it=e;if(e===_e)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let r=[e];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}};Ln.directiveName="unsafeHTML",Ln.resultType=1;var Qu=Di(Ln);var ep=Jl(He({name:X(),description:X(),price:X(),image_url:nr([X(),tr(X())]),category:X(),url:X()}));function tp(t,e,r,{imagesByProductUrl:n,linksNewTab:i=!0,searchParams:s,messageIsStreaming:o=!1}){if(!t)return d``;let u=e>0&&r[e-1]&&"data"in r[e-1],l=e<r.length-1||!o;if("text"in t)return d`<p>${t.text}</p>`;if("html"in t)return d`${Qu(t.html)}`;if("data"in t)switch(t.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let c=ln(ep,t.data);if(c.success){let p={...c.output,images:[]};return p.images=Sr(p.image_url),d`
|
|
1746
|
+
${u?d`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
|
|
1747
1747
|
<mw-product-card-horizontal
|
|
1748
1748
|
product="${JSON.stringify(p)}"
|
|
1749
1749
|
?streaming="${!l}"
|
|
1750
1750
|
?links-new-tab="${i}"
|
|
1751
1751
|
.searchParams="${s}"
|
|
1752
1752
|
.imagesByProductUrl="${n}"></mw-product-card-horizontal>
|
|
1753
|
-
`}console.warn(c.issues);break}case"order-status-card-v1":return
|
|
1753
|
+
`}console.warn(c.issues);break}case"order-status-card-v1":return d`<mw-product-order-status-card order-details="${JSON.stringify(t.data)}" ?streaming="${!l}" ?links-new-tab="${i}"></mw-product-order-status-card> `}return console.warn("could not render part:",t),d`<p><i>data type not supported</i></p>`}var jn,$r,ot,Ot,bs,rp,vs=class{constructor(e,r,{timeoutMs:n=2e3}={}){h(this,bs);h(this,jn);h(this,$r);h(this,ot);h(this,Ot,!1);w(this,"timeoutMs");g(this,jn,e),g(this,$r,r),this.timeoutMs=n,e.addController(this)}get isTyping(){return a(this,Ot)}hostDisconnected(){clearTimeout(a(this,ot)),g(this,ot,void 0)}onInput(e){if(a(this,jn).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(a(this,ot)),g(this,ot,setTimeout(()=>this.typingStopped(),this.timeoutMs)),a(this,Ot)||m(this,bs,rp).call(this)}}typingStopped(){clearTimeout(a(this,ot)),g(this,Ot,!1),a(this,$r).typingStopped()}};jn=new WeakMap,$r=new WeakMap,ot=new WeakMap,Ot=new WeakMap,bs=new WeakSet,rp=function(){g(this,Ot,!0),a(this,$r).typingStarted()};function np(t,e="en-US"){let r=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(t);return`${t.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${r}`}var E1="\xB7 \xB7 \xB7",j,Dn,ce,Er,xs,F,ip,sp,op,ap,lp,cp,up,_1,Dt,ks=class ks extends M($){constructor(){super();h(this,F);h(this,j,ic(this));h(this,Dn,new vs(this,{typingStarted:()=>a(this,j).value?.sendUserTypingStart(),typingStopped:()=>a(this,j).value?.sendUserTypingStop()}));h(this,ce,new Cs(this,{onImageDelete:r=>{if(!a(this,j).value){console.warn("widget context not available, cannot delete image");return}a(this,j).value.sendImageDelete(r),a(this,F,Dt)?.focus()}}));h(this,Er,"single");h(this,xs,r=>{let n=r,{pendingImages:i}=n.detail;Array.isArray(i)&&a(this,ce).restoreImages(i)});this.showClose=!1}get conversationId(){return a(this,j).value?.conversationId||""}get messages(){return a(this,j).value?.messages||[]}get config(){return a(this,j).value?.config}get callbacks(){return a(this,j).value?.callbacks||{}}get widgetId(){return a(this,j).value?.widgetId||""}get typingIndicator(){return a(this,j).value?.typingIndicator}get isStreaming(){return a(this,j).value?.isStreaming}get ranOutOfCredits(){return a(this,j).value?.ranOutOfCredits}get isLiveMode(){return a(this,j).value?.isLiveMode}get lastMsg(){return a(this,j).value?.lastMsg}get hasQueuedMessages(){return a(this,j).value?.hasQueuedMessages}firstUpdated(){document.addEventListener("mw-context-widget:connected",a(this,xs),{once:!0})}updated(){a(this,j).value?.widgetId&&a(this,ce).updateUploadOptions({conversationId:this.conversationId,widgetId:a(this,j).value?.widgetId,enabled:this.config?.enableImageUpload})}render(){Ne(this.config,"config is required");let r=Xu(this.messages,n=>{try{let i=new Date(n.timestamp),s=Math.floor(i.getUTCMinutes()/5)*5;return i.setUTCMinutes(s,0,0),i.valueOf().toString()}catch(i){console.error(i)}});return d`
|
|
1754
1754
|
<div class="relative mx-auto h-full bg-[#FDFDFD] font-sans text-base before:absolute before:inset-0 before:bg-[#8d8d8d] before:opacity-10 sm:rounded-[36px] sm:p-1.5 sm:before:rounded-[36px]">
|
|
1755
1755
|
<div
|
|
1756
1756
|
class="relative flex h-full flex-col bg-white shadow-[0px_4px_4px_0px_rgba(0,0,0,0.25),-116px_177px_59px_0px_rgba(0,0,0,0.00),-74px_113px_54px_0px_rgba(0,0,0,0.01),-42px_64px_46px_0px_rgba(0,0,0,0.03),-19px_28px_34px_0px_rgba(0,0,0,0.06)] sm:rounded-[30px]">
|
|
@@ -1769,7 +1769,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1769
1769
|
</div>
|
|
1770
1770
|
|
|
1771
1771
|
<!-- drag overlay -->
|
|
1772
|
-
${this.config.enableImageUpload&&a(this,ce).isDragging?
|
|
1772
|
+
${this.config.enableImageUpload&&a(this,ce).isDragging?d`
|
|
1773
1773
|
<div class="bg-opacity-90 absolute inset-0 z-50 flex items-center justify-center bg-white sm:rounded-[30px]">
|
|
1774
1774
|
<div class="p-8 text-center">
|
|
1775
1775
|
<lucide-icon name="image-plus" class="mx-auto mb-4 h-12 w-12 text-blue-500"></lucide-icon>
|
|
@@ -1781,8 +1781,8 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1781
1781
|
|
|
1782
1782
|
<!-- this structure of 2 divs is required for the browser native stick/scroll to bottom -->
|
|
1783
1783
|
<div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto">
|
|
1784
|
-
${this.config.enableImageUpload&&a(this,ce).error?
|
|
1785
|
-
${this.config?.showStillLearningBanner?
|
|
1784
|
+
${this.config.enableImageUpload&&a(this,ce).error?d`<mw-info-banner variant="error" text="${a(this,ce).error}" auto-dismissable></mw-info-banner> `:null}
|
|
1785
|
+
${this.config?.showStillLearningBanner?d`<mw-info-banner variant="info" text="I'm still learning!"></mw-info-banner>`:d`
|
|
1786
1786
|
<!-- this makes the chat stick to bottom when the banner is hidden -->
|
|
1787
1787
|
<div class="flex p-1"></div>
|
|
1788
1788
|
`}
|
|
@@ -1790,15 +1790,15 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1790
1790
|
<!-- the padding at the top makes empty room at the top when scrolling and content is hidden behind header -->
|
|
1791
1791
|
<!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
|
|
1792
1792
|
<div class="${this.messages.length>0?"pt-20":""}">
|
|
1793
|
-
${Se(Array.from(r),([n])=>n,([n,i])=>
|
|
1793
|
+
${Se(Array.from(r),([n])=>n,([n,i])=>d`
|
|
1794
1794
|
<div class="my-2 text-center text-xs text-gray-500">${np(new Date(Number(n)),window.navigator.language)}</div>
|
|
1795
|
-
${Se(i??[],s=>s.id,(s,o)=>{let l=i[o+1]?.role===s.role,p=(o>0?i[o-1]:void 0)?.role===s.role,y=(i.length>0?i[i.length-1]:void 0)?.id===s.id;g(this,Er,y&&!p&&!l?"single-current":!p&&!l?"single":!p&&l?"first":y&&p&&!l?"last-current":p&&!l?"last":p&&l?"middle":"single");let S=this.isLiveMode&&s.role==="user"&&s.id===this.lastMsg?.id?"sent":"";return
|
|
1796
|
-
${s.images?Se(s.images,I=>I,I=>
|
|
1795
|
+
${Se(i??[],s=>s.id,(s,o)=>{let l=i[o+1]?.role===s.role,p=(o>0?i[o-1]:void 0)?.role===s.role,y=(i.length>0?i[i.length-1]:void 0)?.id===s.id;g(this,Er,y&&!p&&!l?"single-current":!p&&!l?"single":!p&&l?"first":y&&p&&!l?"last-current":p&&!l?"last":p&&l?"middle":"single");let S=this.isLiveMode&&s.role==="user"&&s.id===this.lastMsg?.id?"sent":"";return d`
|
|
1796
|
+
${s.images?Se(s.images,I=>I,I=>d`
|
|
1797
1797
|
<div data-id="${s.id}" class="${l?"mb-[1px]":"mb-3"} mx-2 flex-row">
|
|
1798
1798
|
<mw-chat-image src="${I}" alt="User uploaded image" side="${s.role}" position=${a(this,Er)} width="300px"></mw-chat-image>
|
|
1799
1799
|
</div>
|
|
1800
1800
|
`):null}
|
|
1801
|
-
${s.content||s.parts?
|
|
1801
|
+
${s.content||s.parts?d` <div data-id="${s.id}" class="${l?"mb-[1px]":"mb-3"} mx-2 flex-row">
|
|
1802
1802
|
<mw-chat-message
|
|
1803
1803
|
.color="${this.config?.color}"
|
|
1804
1804
|
status="${S}"
|
|
@@ -1808,7 +1808,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1808
1808
|
@click="${m(this,F,ip)}">
|
|
1809
1809
|
<div
|
|
1810
1810
|
class="prose prose-h1:first:mt-0 prose-h2:first:mt-0 prose-h3:first:mt-0 prose-h4:first:mt-0 prose-h1:last:mb-0 prose-h2:last:mb-0 prose-h3:last:mb-0 prose-h4:last:mb-0 prose-h1:mt-5 prose-h2:mt-5 prose-h3:mt-5 prose-h4:mt-5 prose-h1:mb-2 prose-h2:mb-2 prose-h3:mb-2 prose-h4:mb-2 prose-h1:text-xl prose-h1:text-bold prose-h2:text-lg prose-h2:text-bold prose-h3:text-base prose-h3:text-bold prose-h4:text-sm prose-h4:text-bold break-words text-inherit">
|
|
1811
|
-
${s.content===E1?
|
|
1811
|
+
${s.content===E1?d`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config?.color}]"></mw-loading>`:s.parts?Se(s.parts,(I,C)=>C,(I,C)=>tp(I,C,s.parts??[],{imagesByProductUrl:s.metadata?.imagesByProductUrl,linksNewTab:this.config?.linksNewTab??!0,searchParams:this.config?.disableUtmInjection?void 0:new URLSearchParams({utm_source:"molin.ai",utm_medium:"chat",utm_campaign:"general"}),messageIsStreaming:s.streaming})):d`<p>${s.content}</p>`}
|
|
1812
1812
|
</div>
|
|
1813
1813
|
</mw-chat-message>
|
|
1814
1814
|
</div>`:null}
|
|
@@ -1816,7 +1816,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1816
1816
|
`)}
|
|
1817
1817
|
|
|
1818
1818
|
<!-- show typing indicator if the non-user side is typing -->
|
|
1819
|
-
${["assistant","support"].includes(this.typingIndicator?.role??"")&&this.typingIndicator?.role?
|
|
1819
|
+
${["assistant","support"].includes(this.typingIndicator?.role??"")&&this.typingIndicator?.role?d`
|
|
1820
1820
|
<mw-chat-message class="mx-2 mb-3 block" color="${this.config?.color}" logo="${this.typingIndicator?.metadata?.avatar||this.config?.logoUrl}" side="${this.typingIndicator.role}">
|
|
1821
1821
|
<div
|
|
1822
1822
|
class="prose prose-h1:first:mt-0 prose-h2:first:mt-0 prose-h3:first:mt-0 prose-h4:first:mt-0 prose-h1:last:mb-0 prose-h2:last:mb-0 prose-h3:last:mb-0 prose-h4:last:mb-0 prose-h1:mt-5 prose-h2:mt-5 prose-h3:mt-5 prose-h4:mt-5 prose-h1:mb-2 prose-h2:mb-2 prose-h3:mb-2 prose-h4:mb-2 prose-h1:text-xl prose-h1:text-bold prose-h2:text-lg prose-h2:text-bold prose-h3:text-base prose-h3:text-bold prose-h4:text-sm prose-h4:text-bold break-words text-inherit">
|
|
@@ -1833,8 +1833,14 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1833
1833
|
@mw:example-click="${m(this,F,sp)}"></mw-chat-background>
|
|
1834
1834
|
</div>
|
|
1835
1835
|
|
|
1836
|
+
${this.messages.length===0&&this.config.disclaimerFloating?d`
|
|
1837
|
+
<div class="mx-4 mb-2 rounded-xl bg-[#eeedf1] px-3 py-2">
|
|
1838
|
+
<mw-disclaimer .text="${this.config.disclaimerFloating}" .color="${this.config.color}"></mw-disclaimer>
|
|
1839
|
+
</div>
|
|
1840
|
+
`:null}
|
|
1841
|
+
|
|
1836
1842
|
<div class="m-1.5 flex-shrink-0 flex-grow-0 space-y-2 rounded-3xl bg-[#eeedf1] p-1.5">
|
|
1837
|
-
${this.config.disclaimer&&!this.config.removePoweredBy?
|
|
1843
|
+
${this.config.disclaimer&&!this.config.removePoweredBy?d`
|
|
1838
1844
|
<!-- spacing between input box and disclaimer or bottom -->
|
|
1839
1845
|
<div class="mb-1.5">
|
|
1840
1846
|
<mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}"></mw-disclaimer>
|
|
@@ -1856,12 +1862,12 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1856
1862
|
.onImageDelete="${this.config.enableImageUpload?a(this,ce).onImageDelete:void 0}">
|
|
1857
1863
|
</mw-chat-input>
|
|
1858
1864
|
|
|
1859
|
-
${this.config.removePoweredBy?this.config.disclaimer?
|
|
1865
|
+
${this.config.removePoweredBy?this.config.disclaimer?d`
|
|
1860
1866
|
<!-- spacing between input box and disclaimer or bottom -->
|
|
1861
1867
|
<div class="mt-1.5">
|
|
1862
1868
|
<mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}"></mw-disclaimer>
|
|
1863
1869
|
</div>
|
|
1864
|
-
`:null:
|
|
1870
|
+
`:null:d`
|
|
1865
1871
|
<!-- spacing between input box and powered-by or bottom -->
|
|
1866
1872
|
<div class="h-4">
|
|
1867
1873
|
<mw-powered-by></mw-powered-by>
|
|
@@ -1870,7 +1876,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1870
1876
|
</div>
|
|
1871
1877
|
</div>
|
|
1872
1878
|
</div>
|
|
1873
|
-
`}reloadConfig(){a(this,j).value?.reloadConfig(),this.requestUpdate()}async sendMessage(r){if(Ne(a(this,j).value,"widget context is required"),!r||typeof r!="string")return console.warn("sendMessage requires a valid string message"),!1;let n=await a(this,j).value.enqueueUserInput(r,{xUserData:a(this,j).value?.xUserData,xCustomInstructions:a(this,j).value?.xCustomInstructions,role:"user",expectStreaming:!0});return n&&a(this,F,Dt)?.setValue(""),n??!1}setInputValue(r){if(!r||typeof r!="string"){console.warn("setInputValue requires a valid string value");return}let n=a(this,F,Dt);if(!n){console.warn("input element not found, cannot set value");return}n.setValue?n.setValue(r):console.warn("input element does not have setValue method")}focusInput(){window.requestAnimationFrame(()=>{a(this,F,Dt)?.focus()})}reset(){a(this,j).value?.reset()}};j=new WeakMap,Dn=new WeakMap,ce=new WeakMap,Er=new WeakMap,xs=new WeakMap,F=new WeakSet,ip=function(r){let i=r.composedPath().find(s=>s instanceof HTMLAnchorElement);if(i){if(r.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}let o=this.config?.linksNewTab?"_blank":"_self";window.open(i.href,i.target||o)}},sp=function(r){if(Ne(a(this,j).value,"widget context is required"),this.isStreaming)return;r.preventDefault();let n=r.detail.example;a(this,j).value.enqueueUserInput(n,{xUserData:a(this,j).value?.xUserData,xCustomInstructions:a(this,j).value?.xCustomInstructions}).then(i=>{i&&(a(this,F,Dt)?.setValue(""),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:n,example:!0,conversationId:this.conversationId}))}).catch(console.warn)},op=function(r){if(Ne(a(this,j).value,"widget context is required"),r.preventDefault(),this.config?.enableImageUpload&&a(this,ce).hasPendingImages)return;let n=r.detail;a(this,j).value.enqueueUserInput(n,{xUserData:a(this,j).value?.xUserData,xCustomInstructions:a(this,j).value?.xCustomInstructions}).then(i=>{i&&(a(this,F,Dt)?.setValue(""),a(this,ce).clearImages(),a(this,Dn).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:n,example:!1,conversationId:this.conversationId}))}).catch(console.warn)},ap=function(r){a(this,Dn).onInput(r.detail.full)},lp=function(){Ne(a(this,j).value,"widget context is required"),a(this,j).value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},cp=function(){Ne(a(this,j).value,"widget context is required"),a(this,j).value.reset()},up=function(){this.dispatchEvent(new ks.CloseClickEvent)},_1=function(){return this.renderRoot.querySelector("#scrollable-content")},Dt=function(){return this.renderRoot.querySelector("mw-chat-input")},w(ks,"properties",{showClose:{type:Boolean,attribute:"show-close"}});var On=ks,Ia;On.CloseClickEvent=(Ia=class extends CustomEvent{constructor(e={}){super(On.CloseClickEvent.type,{...e})}},w(Ia,"type","mw:close-click"),Ia);customElements.get("mw-chat")||customElements.define("mw-chat",On);function pp(t){t?.body?.cancel().catch(console.warn)}var ue,We,Ss,Un,_r,Ta=class{constructor(){h(this,ue,[]);h(this,We);h(this,Ss,10);h(this,Un,5e3);h(this,_r,!1)}async add(e,r){if(a(this,ue).push(fp(e,r)),a(this,ue).length>=a(this,Ss))return this.flush();a(this,We)||g(this,We,setTimeout(()=>{this.flush().catch(console.error)},a(this,Un)))}async flush(){if(a(this,_r)||a(this,ue).length===0)return;let e=[...a(this,ue)];try{g(this,_r,!0),clearTimeout(a(this,We)),g(this,We,void 0),g(this,ue,[]);let r=new AbortController,n=setTimeout(()=>r.abort(),5e3);await dp(e,{signal:r.signal}),clearTimeout(n)}catch(r){if(r.name==="AbortError")console.error("Request timed out, retrying events"),g(this,ue,[...e,...a(this,ue)]);else{console.error("Failed to send events to backend:",r);let n=e.filter(i=>i.event.includes("error"));g(this,ue,[...n,...a(this,ue)])}}finally{g(this,_r,!1),a(this,ue).length>0&&!a(this,We)&&g(this,We,setTimeout(()=>{this.flush().catch(console.error)},a(this,Un)))}}async flushBeforeUnload(){if(a(this,ue).length>0)try{let e=new FormData;e.set("events",JSON.stringify(a(this,ue))),navigator.sendBeacon(new URL("/widgets/data/collect",mp()).href,e)}catch(e){console.error("Failed to send final events:",e)}}};ue=new WeakMap,We=new WeakMap,Ss=new WeakMap,Un=new WeakMap,_r=new WeakMap;var hp=new Ta;window.addEventListener("beforeunload",()=>{hp.flushBeforeUnload().catch(console.error)});async function q(t,e,r){if(typeof t!="string")throw new TypeError("Event name must be a string");if(typeof e!="object"||e===null)throw new TypeError("Properties must be an object");try{if(t==="ShopAssistant: user clicked link"&&I1("molin_link_click",e),r?.immediate){await dp([fp(t,e)]);return}else return hp.add(t,e)}catch(n){console.error("Failed to send event:",n)}}async function dp(t,{signal:e}={}){let r=new FormData;r.set("events",JSON.stringify(t));let n=await fetch(new URL("/widgets/data/collect",mp()),{method:"POST",body:r,signal:e});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);pp(n)}function fp(t,e){return{event:t,widget_id:e.widgetId,properties:Object.assign({},e,A1()),distinct_id:M1(),timestamp:new Date().toISOString()}}function M1(){try{let t=ve.molin_shop_assistant_distinct_id;return t||(t=crypto.randomUUID(),ve.molin_shop_assistant_distinct_id=t),t}catch(t){console.error("Failed to deserialize distinct_id:",t);let e=crypto.randomUUID();try{ve.molin_shop_assistant_distinct_id=e}catch(r){console.error("Failed to store new distinct_id:",r)}return e}}function A1(){return{referrer:document.referrer,userAgent:navigator.userAgent,language:navigator.language,screenWidth:window.innerWidth,screenHeight:window.innerHeight,timestamp:new Date().toISOString(),timezoneOffset:new Date().getTimezoneOffset(),doNotTrack:navigator.doNotTrack??void 0}}function mp(){let t=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8787","molin.localhost":"http://molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://molin.ai","molin.foo":"https://molin.foo"}[t]||"https://molin.ai"}function I1(t,e){try{window.dataLayer=window.dataLayer||[];let r={event:t,link_url:e.url};window.dataLayer.push(r)}catch(r){console.error("Failed to send event to dataLayer:",r)}}function at(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}var $s,Bn,Es,Ge,wp,Pn,Rn=class Rn extends M($){constructor(){super();h(this,Ge);h(this,$s,new lt(this,{onError:console.error}));h(this,Bn);h(this,Es,{onError:r=>{alert(r.error),console.error(r.widgetId,r.error),q("ShopAssistant: error",{...r},{immediate:!0})},onNewMessageStartedStreaming:r=>{q("ShopAssistant: user received bot message (streaming started)",r)},onMessageEndedStreaming:r=>{q("ShopAssistant: user received bot message (streaming ended)",r)},onUserCanceledStreaming:r=>{q("ShopAssistant: user canceled streaming",r)},onUserClickedLink:r=>{q("ShopAssistant: user clicked link",r)},onUserSentInput:r=>{q("ShopAssistant: user sent input",r)}});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData=at()?.userData,this.xCustomInstructions=at()?.customInstructions}get config(){return a(this,Bn)||a(this,$s).data}render(){return this.config?
|
|
1879
|
+
`}reloadConfig(){a(this,j).value?.reloadConfig(),this.requestUpdate()}async sendMessage(r){if(Ne(a(this,j).value,"widget context is required"),!r||typeof r!="string")return console.warn("sendMessage requires a valid string message"),!1;let n=await a(this,j).value.enqueueUserInput(r,{xUserData:a(this,j).value?.xUserData,xCustomInstructions:a(this,j).value?.xCustomInstructions,role:"user",expectStreaming:!0});return n&&a(this,F,Dt)?.setValue(""),n??!1}setInputValue(r){if(!r||typeof r!="string"){console.warn("setInputValue requires a valid string value");return}let n=a(this,F,Dt);if(!n){console.warn("input element not found, cannot set value");return}n.setValue?n.setValue(r):console.warn("input element does not have setValue method")}focusInput(){window.requestAnimationFrame(()=>{a(this,F,Dt)?.focus()})}reset(){a(this,j).value?.reset()}};j=new WeakMap,Dn=new WeakMap,ce=new WeakMap,Er=new WeakMap,xs=new WeakMap,F=new WeakSet,ip=function(r){let i=r.composedPath().find(s=>s instanceof HTMLAnchorElement);if(i){if(r.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}let o=this.config?.linksNewTab?"_blank":"_self";window.open(i.href,i.target||o)}},sp=function(r){if(Ne(a(this,j).value,"widget context is required"),this.isStreaming)return;r.preventDefault();let n=r.detail.example;a(this,j).value.enqueueUserInput(n,{xUserData:a(this,j).value?.xUserData,xCustomInstructions:a(this,j).value?.xCustomInstructions}).then(i=>{i&&(a(this,F,Dt)?.setValue(""),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:n,example:!0,conversationId:this.conversationId}))}).catch(console.warn)},op=function(r){if(Ne(a(this,j).value,"widget context is required"),r.preventDefault(),this.config?.enableImageUpload&&a(this,ce).hasPendingImages)return;let n=r.detail;a(this,j).value.enqueueUserInput(n,{xUserData:a(this,j).value?.xUserData,xCustomInstructions:a(this,j).value?.xCustomInstructions}).then(i=>{i&&(a(this,F,Dt)?.setValue(""),a(this,ce).clearImages(),a(this,Dn).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:n,example:!1,conversationId:this.conversationId}))}).catch(console.warn)},ap=function(r){a(this,Dn).onInput(r.detail.full)},lp=function(){Ne(a(this,j).value,"widget context is required"),a(this,j).value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},cp=function(){Ne(a(this,j).value,"widget context is required"),a(this,j).value.reset()},up=function(){this.dispatchEvent(new ks.CloseClickEvent)},_1=function(){return this.renderRoot.querySelector("#scrollable-content")},Dt=function(){return this.renderRoot.querySelector("mw-chat-input")},w(ks,"properties",{showClose:{type:Boolean,attribute:"show-close"}});var On=ks,Ia;On.CloseClickEvent=(Ia=class extends CustomEvent{constructor(e={}){super(On.CloseClickEvent.type,{...e})}},w(Ia,"type","mw:close-click"),Ia);customElements.get("mw-chat")||customElements.define("mw-chat",On);function pp(t){t?.body?.cancel().catch(console.warn)}var ue,We,Ss,Un,_r,Ta=class{constructor(){h(this,ue,[]);h(this,We);h(this,Ss,10);h(this,Un,5e3);h(this,_r,!1)}async add(e,r){if(a(this,ue).push(fp(e,r)),a(this,ue).length>=a(this,Ss))return this.flush();a(this,We)||g(this,We,setTimeout(()=>{this.flush().catch(console.error)},a(this,Un)))}async flush(){if(a(this,_r)||a(this,ue).length===0)return;let e=[...a(this,ue)];try{g(this,_r,!0),clearTimeout(a(this,We)),g(this,We,void 0),g(this,ue,[]);let r=new AbortController,n=setTimeout(()=>r.abort(),5e3);await dp(e,{signal:r.signal}),clearTimeout(n)}catch(r){if(r.name==="AbortError")console.error("Request timed out, retrying events"),g(this,ue,[...e,...a(this,ue)]);else{console.error("Failed to send events to backend:",r);let n=e.filter(i=>i.event.includes("error"));g(this,ue,[...n,...a(this,ue)])}}finally{g(this,_r,!1),a(this,ue).length>0&&!a(this,We)&&g(this,We,setTimeout(()=>{this.flush().catch(console.error)},a(this,Un)))}}async flushBeforeUnload(){if(a(this,ue).length>0)try{let e=new FormData;e.set("events",JSON.stringify(a(this,ue))),navigator.sendBeacon(new URL("/widgets/data/collect",mp()).href,e)}catch(e){console.error("Failed to send final events:",e)}}};ue=new WeakMap,We=new WeakMap,Ss=new WeakMap,Un=new WeakMap,_r=new WeakMap;var hp=new Ta;window.addEventListener("beforeunload",()=>{hp.flushBeforeUnload().catch(console.error)});async function q(t,e,r){if(typeof t!="string")throw new TypeError("Event name must be a string");if(typeof e!="object"||e===null)throw new TypeError("Properties must be an object");try{if(t==="ShopAssistant: user clicked link"&&I1("molin_link_click",e),r?.immediate){await dp([fp(t,e)]);return}else return hp.add(t,e)}catch(n){console.error("Failed to send event:",n)}}async function dp(t,{signal:e}={}){let r=new FormData;r.set("events",JSON.stringify(t));let n=await fetch(new URL("/widgets/data/collect",mp()),{method:"POST",body:r,signal:e});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);pp(n)}function fp(t,e){return{event:t,widget_id:e.widgetId,properties:Object.assign({},e,A1()),distinct_id:M1(),timestamp:new Date().toISOString()}}function M1(){try{let t=ve.molin_shop_assistant_distinct_id;return t||(t=crypto.randomUUID(),ve.molin_shop_assistant_distinct_id=t),t}catch(t){console.error("Failed to deserialize distinct_id:",t);let e=crypto.randomUUID();try{ve.molin_shop_assistant_distinct_id=e}catch(r){console.error("Failed to store new distinct_id:",r)}return e}}function A1(){return{referrer:document.referrer,userAgent:navigator.userAgent,language:navigator.language,screenWidth:window.innerWidth,screenHeight:window.innerHeight,timestamp:new Date().toISOString(),timezoneOffset:new Date().getTimezoneOffset(),doNotTrack:navigator.doNotTrack??void 0}}function mp(){let t=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8787","molin.localhost":"http://molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://molin.ai","molin.foo":"https://molin.foo"}[t]||"https://molin.ai"}function I1(t,e){try{window.dataLayer=window.dataLayer||[];let r={event:t,link_url:e.url};window.dataLayer.push(r)}catch(r){console.error("Failed to send event to dataLayer:",r)}}function at(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}var $s,Bn,Es,Ge,wp,Pn,Rn=class Rn extends M($){constructor(){super();h(this,Ge);h(this,$s,new lt(this,{onError:console.error}));h(this,Bn);h(this,Es,{onError:r=>{alert(r.error),console.error(r.widgetId,r.error),q("ShopAssistant: error",{...r},{immediate:!0})},onNewMessageStartedStreaming:r=>{q("ShopAssistant: user received bot message (streaming started)",r)},onMessageEndedStreaming:r=>{q("ShopAssistant: user received bot message (streaming ended)",r)},onUserCanceledStreaming:r=>{q("ShopAssistant: user canceled streaming",r)},onUserClickedLink:r=>{q("ShopAssistant: user clicked link",r)},onUserSentInput:r=>{q("ShopAssistant: user sent input",r)}});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData=at()?.userData,this.xCustomInstructions=at()?.customInstructions}get config(){return a(this,Bn)||a(this,$s).data}render(){return this.config?d`
|
|
1874
1880
|
<mw-context-widget .widgetId="${this.widgetId}" .config="${this.config}" .callbacks="${a(this,Es)}" .xUserData="${this.xUserData}" .xCustomInstructions="${this.xCustomInstructions}">
|
|
1875
1881
|
<!-- embed our chat component forwarding props -->
|
|
1876
1882
|
<mw-chat ?show-close="${this.showClose}" @mw:close-click="${m(this,Ge,wp)}">
|
|
@@ -1881,22 +1887,22 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1881
1887
|
:host {
|
|
1882
1888
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
1883
1889
|
}
|
|
1884
|
-
`),w(Rn,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1}});var Ut=Rn;customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",Ut);var La;Ut.CloseClickEvent=(La=class extends CustomEvent{constructor(e={}){super(Ut.CloseClickEvent.type,{...e})}},w(La,"type","mw:close-click"),La);var ja=class{constructor({hidden:e=!1}){w(this,"hidden");this.hidden=e}setUserData(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data")}setCustomInstructions(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions")}showLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof Te&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof Te&&e.hideLauncher()}openChat(e){let{message:r,autoSend:n}=e||{};for(let i of document.querySelectorAll("molin-shop-ai"))i instanceof Te&&i.openChat({message:r,autoSend:n})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof Te&&e.closeChat()}reset(){ve.resetWidgetData();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof Te&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof Ut&&e.reset()}};function yp({hidden:t}){let e=new ja({hidden:t});return window.Molin=e,e}function _s(){let t=window.Molin;if(!t)throw new Error("window.Molin global not initialized");return t}window.__INIT_MOLIN_SHOP_AI=function(e){T1(e);let r=at(),n=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(yp({hidden:n}),e.auto){let i=document.createElement("molin-shop-ai");i.setAttribute("cdn",e.cdn),i.setAttribute("widget",e.widgetId),document.body.appendChild(i)}};function T1(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function vp(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Ee,Vn,Mr,Ar,lt=class{constructor(e,r){h(this,Ee);h(this,Vn);h(this,Mr);h(this,Ar);g(this,Ee,e),g(this,Vn,r),e.addController(this)}get data(){return a(this,Ar)||a(this,Mr)?.data}hostConnected(){if(a(this,Mr)||a(this,Ar))return;let e=vp();e&&e.widgetId===a(this,Ee).widgetId?g(this,Ar,e.config):g(this,Mr,new Fi(a(this,Ee),()=>{if(a(this,Ee).cdn&&a(this,Ee).widgetId)return`${a(this,Ee).cdn}/config?w=${a(this,Ee).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:async r=>{let n=await r.json();return n&&!e&&window.__INIT_MOLIN_SHOP_AI({cdn:a(this,Ee).cdn,widgetId:a(this,Ee).widgetId,config:n}),n},onError:a(this,Vn)?.onError}))}};Ee=new WeakMap,Vn=new WeakMap,Mr=new WeakMap,Ar=new WeakMap;function bp(){let t=new URL(import.meta.url).hostname;return{localhost:"http://uploads.molin.localhost:8787","molin.localhost":"http://uploads.molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo"}[t]||"https://widget.molin.ai"}var Re=Object.freeze({PENDING:"pending",READY:"ready",ERROR:"error"}),N,W,oe,Ir,Tr,de,O,kp,Oa,Cp,As,Nn,Hn,zn,qn,Sp,Ms,ct,Fn,Da,$p,Ep,_p,Cs=class{constructor(e,r={}){h(this,O);h(this,N);h(this,W);h(this,oe,null);h(this,Ir,!1);h(this,Tr,null);h(this,de,[]);h(this,As,e=>{let r=e.target,n=Array.from(r.files||[]);m(this,O,Da).call(this,n),r.value=""});h(this,Nn,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")});h(this,Hn,e=>{e.preventDefault(),e.dataTransfer&&m(this,O,Sp).call(this,e.dataTransfer)&&m(this,O,Ms).call(this,!0)});h(this,zn,e=>{e.preventDefault();let r=e.relatedTarget;a(this,N).contains(r)||m(this,O,Ms).call(this,!1)});h(this,qn,e=>{if(e.preventDefault(),m(this,O,Ms).call(this,!1),e.dataTransfer){let r=Array.from(e.dataTransfer.files||[]);m(this,O,Da).call(this,r)}});w(this,"openImagePicker",()=>{a(this,oe)&&a(this,oe).click()});w(this,"onImageDelete",e=>{a(this,W).onImageDelete&&a(this,W).onImageDelete(e),g(this,de,a(this,de).filter(r=>r.id!==e)),m(this,O,Fn).call(this),a(this,N).requestUpdate()});g(this,N,e),g(this,W,{acceptedTypes:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/heic"],maxFileSize:10*1024*1024,maxFiles:3,onError:()=>{},uploadUrl:new URL("/v1/uploads",bp()).href,enabled:!0,...r}),e.addController(this),m(this,O,Cp).call(this)}hostConnected(){m(this,O,kp).call(this)}hostDisconnected(){m(this,O,Oa).call(this),a(this,oe)&&a(this,oe).parentNode&&a(this,oe).parentNode.removeChild(a(this,oe))}get isDragging(){return a(this,Ir)}get error(){return a(this,Tr)}get selectedImages(){return a(this,de)}get hasPendingImages(){return a(this,de).some(e=>e.processingState===Re.PENDING)}clearError(){m(this,O,Fn).call(this)}updateUploadOptions(e){e.conversationId!==void 0&&(a(this,W).conversationId=e.conversationId),e.widgetId!==void 0&&(a(this,W).widgetId=e.widgetId),a(this,W).enabled=!!e.enabled,e.enabled||m(this,O,Oa).call(this)}restoreImages(e){if(!Array.isArray(e)||e.length===0){g(this,de,[]),a(this,N).requestUpdate();return}let r=e.map(n=>{let i=new File([],n.name,{type:n.type});return{id:n.id,name:n.name,type:n.type,size:n.size,dataUrl:n.url,file:i,processingState:Re.READY,imageUrl:n.url}});g(this,de,r),a(this,N).requestUpdate()}clearImages(){g(this,de,[]),this.clearError(),a(this,N).requestUpdate()}};N=new WeakMap,W=new WeakMap,oe=new WeakMap,Ir=new WeakMap,Tr=new WeakMap,de=new WeakMap,O=new WeakSet,kp=function(){a(this,W).enabled&&(a(this,N).addEventListener("dragover",a(this,Nn)),a(this,N).addEventListener("dragenter",a(this,Hn)),a(this,N).addEventListener("dragleave",a(this,zn)),a(this,N).addEventListener("drop",a(this,qn)))},Oa=function(){a(this,N).removeEventListener("dragover",a(this,Nn)),a(this,N).removeEventListener("dragenter",a(this,Hn)),a(this,N).removeEventListener("dragleave",a(this,zn)),a(this,N).removeEventListener("drop",a(this,qn))},Cp=function(){g(this,oe,document.createElement("input")),a(this,oe).type="file",a(this,oe).accept=a(this,W).acceptedTypes.join(","),a(this,oe).multiple=a(this,W).maxFiles>1,a(this,oe).style.display="none",a(this,oe).addEventListener("change",a(this,As)),document.body.appendChild(a(this,oe))},As=new WeakMap,Nn=new WeakMap,Hn=new WeakMap,zn=new WeakMap,qn=new WeakMap,Sp=function(e){return e.types&&e.types.includes("Files")},Ms=function(e){a(this,Ir)!==e&&(g(this,Ir,e),a(this,N).requestUpdate())},ct=function(e){g(this,Tr,e),a(this,W).onError(e),a(this,N).requestUpdate(),setTimeout(()=>{m(this,O,Fn).call(this)},6e3)},Fn=function(){g(this,Tr,null),a(this,N).requestUpdate()},Da=async function(e){if(e.length===0)return;m(this,O,Fn).call(this);let r=e.filter(o=>m(this,O,$p).call(this,o));if(r.length===0)return;let n=a(this,de).length,i=a(this,W).maxFiles??1/0,s=r.length;if(n+s>i){m(this,O,ct).call(this,`You can upload a maximum of ${i} files`);return}try{let u=(await Promise.all(r.map(l=>m(this,O,Ep).call(this,l)))).filter(l=>!a(this,de).some(c=>c.dataUrl===l.dataUrl));g(this,de,[...a(this,de),...u]),await mo(3,u,async l=>{await m(this,O,_p).call(this,l)}),a(this,N).requestUpdate()}catch(o){let u=o instanceof Error?o:new Error(String(o));m(this,O,ct).call(this,"Upload failed")}},$p=function(e){return a(this,W).acceptedTypes.includes(e.type)?e.size>a(this,W).maxFileSize?(m(this,O,ct).call(this,`Max file size: ${a(this,W).maxFileSize/(1024*1024)}MB`),!1):!0:(m(this,O,ct).call(this,"Invalid file type"),!1)},Ep=async function(e){try{let r=await(0,xp.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:r,file:e,processingState:Re.PENDING}}catch(r){let n=r instanceof Error?r:new Error(String(r));throw new Error(`Failed to read file: ${e.name} - ${n.message}`)}},_p=async function(e){if(!e){console.error("No image provided to upload"),m(this,O,ct).call(this,"No image provided");return}if(!a(this,W)?.uploadUrl){console.error("Missing uploadUrl in options"),m(this,O,ct).call(this,"Upload URL not configured");return}e.processingState=Re.PENDING,a(this,N).requestUpdate();let r=new FormData;r.append("file",e.file),r.append("imageId",e.id),a(this,W).conversationId&&r.append("conversationId",a(this,W).conversationId),a(this,W).widgetId&&r.append("widgetId",a(this,W).widgetId);try{let n=await fetch(a(this,W).uploadUrl,{method:"POST",body:r});if(!n.ok)throw new Error(`Upload failed with status: ${n.status}`);let i=await n.json();if(!!!i?.success){let o=i?.error||"Upload failed";throw new Error(o)}i.imageUrl&&i.imageId?(e.imageUrl=i.imageUrl,e.id=i.imageId,e.processingState=Re.READY):e.processingState=Re.PENDING,a(this,N).requestUpdate()}catch(n){let i=n instanceof Error?n:new Error(String(n));console.error("Upload error:",i.message),m(this,O,ct).call(this,i.message),e.processingState=Re.ERROR,a(this,N).requestUpdate()}};var Ua={maxHeight:120,initialHeight:32,paddingY:12},Wn,Y,Lr,Mp,Ap,Ip,Tp,Is,Pt=class Pt extends M($){constructor(){super();h(this,Y);h(this,Wn,new Date);this.disabled=!1,this.streaming=!1,this.loading=!1,this.placeholder="Type a message...",this.enableImageUpload=!1,this.onImageUploadClick=void 0,this.images=[],this.onImageDelete=void 0,this.color="#8B5CF6"}get value(){return a(this,Y,Lr)?.value?.trim()??""}render(){return
|
|
1890
|
+
`),w(Rn,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1}});var Ut=Rn;customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",Ut);var La;Ut.CloseClickEvent=(La=class extends CustomEvent{constructor(e={}){super(Ut.CloseClickEvent.type,{...e})}},w(La,"type","mw:close-click"),La);var ja=class{constructor({hidden:e=!1}){w(this,"hidden");this.hidden=e}setUserData(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data")}setCustomInstructions(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions")}showLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof Te&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof Te&&e.hideLauncher()}openChat(e){let{message:r,autoSend:n}=e||{};for(let i of document.querySelectorAll("molin-shop-ai"))i instanceof Te&&i.openChat({message:r,autoSend:n})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof Te&&e.closeChat()}reset(){ve.resetWidgetData();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof Te&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof Ut&&e.reset()}};function yp({hidden:t}){let e=new ja({hidden:t});return window.Molin=e,e}function _s(){let t=window.Molin;if(!t)throw new Error("window.Molin global not initialized");return t}window.__INIT_MOLIN_SHOP_AI=function(e){T1(e);let r=at(),n=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(yp({hidden:n}),e.auto){let i=document.createElement("molin-shop-ai");i.setAttribute("cdn",e.cdn),i.setAttribute("widget",e.widgetId),document.body.appendChild(i)}};function T1(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function vp(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Ee,Vn,Mr,Ar,lt=class{constructor(e,r){h(this,Ee);h(this,Vn);h(this,Mr);h(this,Ar);g(this,Ee,e),g(this,Vn,r),e.addController(this)}get data(){return a(this,Ar)||a(this,Mr)?.data}hostConnected(){if(a(this,Mr)||a(this,Ar))return;let e=vp();e&&e.widgetId===a(this,Ee).widgetId?g(this,Ar,e.config):g(this,Mr,new Fi(a(this,Ee),()=>{if(a(this,Ee).cdn&&a(this,Ee).widgetId)return`${a(this,Ee).cdn}/config?w=${a(this,Ee).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:async r=>{let n=await r.json();return n&&!e&&window.__INIT_MOLIN_SHOP_AI({cdn:a(this,Ee).cdn,widgetId:a(this,Ee).widgetId,config:n}),n},onError:a(this,Vn)?.onError}))}};Ee=new WeakMap,Vn=new WeakMap,Mr=new WeakMap,Ar=new WeakMap;function bp(){let t=new URL(import.meta.url).hostname;return{localhost:"http://uploads.molin.localhost:8787","molin.localhost":"http://uploads.molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo"}[t]||"https://widget.molin.ai"}var Re=Object.freeze({PENDING:"pending",READY:"ready",ERROR:"error"}),N,W,oe,Ir,Tr,de,O,kp,Oa,Cp,As,Nn,Hn,zn,qn,Sp,Ms,ct,Fn,Da,$p,Ep,_p,Cs=class{constructor(e,r={}){h(this,O);h(this,N);h(this,W);h(this,oe,null);h(this,Ir,!1);h(this,Tr,null);h(this,de,[]);h(this,As,e=>{let r=e.target,n=Array.from(r.files||[]);m(this,O,Da).call(this,n),r.value=""});h(this,Nn,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")});h(this,Hn,e=>{e.preventDefault(),e.dataTransfer&&m(this,O,Sp).call(this,e.dataTransfer)&&m(this,O,Ms).call(this,!0)});h(this,zn,e=>{e.preventDefault();let r=e.relatedTarget;a(this,N).contains(r)||m(this,O,Ms).call(this,!1)});h(this,qn,e=>{if(e.preventDefault(),m(this,O,Ms).call(this,!1),e.dataTransfer){let r=Array.from(e.dataTransfer.files||[]);m(this,O,Da).call(this,r)}});w(this,"openImagePicker",()=>{a(this,oe)&&a(this,oe).click()});w(this,"onImageDelete",e=>{a(this,W).onImageDelete&&a(this,W).onImageDelete(e),g(this,de,a(this,de).filter(r=>r.id!==e)),m(this,O,Fn).call(this),a(this,N).requestUpdate()});g(this,N,e),g(this,W,{acceptedTypes:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/heic"],maxFileSize:10*1024*1024,maxFiles:3,onError:()=>{},uploadUrl:new URL("/v1/uploads",bp()).href,enabled:!0,...r}),e.addController(this),m(this,O,Cp).call(this)}hostConnected(){m(this,O,kp).call(this)}hostDisconnected(){m(this,O,Oa).call(this),a(this,oe)&&a(this,oe).parentNode&&a(this,oe).parentNode.removeChild(a(this,oe))}get isDragging(){return a(this,Ir)}get error(){return a(this,Tr)}get selectedImages(){return a(this,de)}get hasPendingImages(){return a(this,de).some(e=>e.processingState===Re.PENDING)}clearError(){m(this,O,Fn).call(this)}updateUploadOptions(e){e.conversationId!==void 0&&(a(this,W).conversationId=e.conversationId),e.widgetId!==void 0&&(a(this,W).widgetId=e.widgetId),a(this,W).enabled=!!e.enabled,e.enabled||m(this,O,Oa).call(this)}restoreImages(e){if(!Array.isArray(e)||e.length===0){g(this,de,[]),a(this,N).requestUpdate();return}let r=e.map(n=>{let i=new File([],n.name,{type:n.type});return{id:n.id,name:n.name,type:n.type,size:n.size,dataUrl:n.url,file:i,processingState:Re.READY,imageUrl:n.url}});g(this,de,r),a(this,N).requestUpdate()}clearImages(){g(this,de,[]),this.clearError(),a(this,N).requestUpdate()}};N=new WeakMap,W=new WeakMap,oe=new WeakMap,Ir=new WeakMap,Tr=new WeakMap,de=new WeakMap,O=new WeakSet,kp=function(){a(this,W).enabled&&(a(this,N).addEventListener("dragover",a(this,Nn)),a(this,N).addEventListener("dragenter",a(this,Hn)),a(this,N).addEventListener("dragleave",a(this,zn)),a(this,N).addEventListener("drop",a(this,qn)))},Oa=function(){a(this,N).removeEventListener("dragover",a(this,Nn)),a(this,N).removeEventListener("dragenter",a(this,Hn)),a(this,N).removeEventListener("dragleave",a(this,zn)),a(this,N).removeEventListener("drop",a(this,qn))},Cp=function(){g(this,oe,document.createElement("input")),a(this,oe).type="file",a(this,oe).accept=a(this,W).acceptedTypes.join(","),a(this,oe).multiple=a(this,W).maxFiles>1,a(this,oe).style.display="none",a(this,oe).addEventListener("change",a(this,As)),document.body.appendChild(a(this,oe))},As=new WeakMap,Nn=new WeakMap,Hn=new WeakMap,zn=new WeakMap,qn=new WeakMap,Sp=function(e){return e.types&&e.types.includes("Files")},Ms=function(e){a(this,Ir)!==e&&(g(this,Ir,e),a(this,N).requestUpdate())},ct=function(e){g(this,Tr,e),a(this,W).onError(e),a(this,N).requestUpdate(),setTimeout(()=>{m(this,O,Fn).call(this)},6e3)},Fn=function(){g(this,Tr,null),a(this,N).requestUpdate()},Da=async function(e){if(e.length===0)return;m(this,O,Fn).call(this);let r=e.filter(o=>m(this,O,$p).call(this,o));if(r.length===0)return;let n=a(this,de).length,i=a(this,W).maxFiles??1/0,s=r.length;if(n+s>i){m(this,O,ct).call(this,`You can upload a maximum of ${i} files`);return}try{let u=(await Promise.all(r.map(l=>m(this,O,Ep).call(this,l)))).filter(l=>!a(this,de).some(c=>c.dataUrl===l.dataUrl));g(this,de,[...a(this,de),...u]),await mo(3,u,async l=>{await m(this,O,_p).call(this,l)}),a(this,N).requestUpdate()}catch(o){let u=o instanceof Error?o:new Error(String(o));m(this,O,ct).call(this,"Upload failed")}},$p=function(e){return a(this,W).acceptedTypes.includes(e.type)?e.size>a(this,W).maxFileSize?(m(this,O,ct).call(this,`Max file size: ${a(this,W).maxFileSize/(1024*1024)}MB`),!1):!0:(m(this,O,ct).call(this,"Invalid file type"),!1)},Ep=async function(e){try{let r=await(0,xp.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:r,file:e,processingState:Re.PENDING}}catch(r){let n=r instanceof Error?r:new Error(String(r));throw new Error(`Failed to read file: ${e.name} - ${n.message}`)}},_p=async function(e){if(!e){console.error("No image provided to upload"),m(this,O,ct).call(this,"No image provided");return}if(!a(this,W)?.uploadUrl){console.error("Missing uploadUrl in options"),m(this,O,ct).call(this,"Upload URL not configured");return}e.processingState=Re.PENDING,a(this,N).requestUpdate();let r=new FormData;r.append("file",e.file),r.append("imageId",e.id),a(this,W).conversationId&&r.append("conversationId",a(this,W).conversationId),a(this,W).widgetId&&r.append("widgetId",a(this,W).widgetId);try{let n=await fetch(a(this,W).uploadUrl,{method:"POST",body:r});if(!n.ok)throw new Error(`Upload failed with status: ${n.status}`);let i=await n.json();if(!!!i?.success){let o=i?.error||"Upload failed";throw new Error(o)}i.imageUrl&&i.imageId?(e.imageUrl=i.imageUrl,e.id=i.imageId,e.processingState=Re.READY):e.processingState=Re.PENDING,a(this,N).requestUpdate()}catch(n){let i=n instanceof Error?n:new Error(String(n));console.error("Upload error:",i.message),m(this,O,ct).call(this,i.message),e.processingState=Re.ERROR,a(this,N).requestUpdate()}};var Ua={maxHeight:120,initialHeight:32,paddingY:12},Wn,Y,Lr,Mp,Ap,Ip,Tp,Is,Pt=class Pt extends M($){constructor(){super();h(this,Y);h(this,Wn,new Date);this.disabled=!1,this.streaming=!1,this.loading=!1,this.placeholder="Type a message...",this.enableImageUpload=!1,this.onImageUploadClick=void 0,this.images=[],this.onImageDelete=void 0,this.color="#8B5CF6"}get value(){return a(this,Y,Lr)?.value?.trim()??""}render(){return d`
|
|
1885
1891
|
<div
|
|
1886
1892
|
class="focus-within:ring-opacity-50 ${this.enableImageUpload&&this.images.length>0?`ring-2 ring-[${this.color}] ring-opacity-50`:""} w-full overflow-hidden rounded-[18px] bg-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)] transition-all duration-200 focus-within:ring-2 focus-within:ring-[${this.color}]">
|
|
1887
1893
|
<!-- Image preview area -->
|
|
1888
|
-
${this.enableImageUpload&&this.images&&this.images.length>0?
|
|
1894
|
+
${this.enableImageUpload&&this.images&&this.images.length>0?d`
|
|
1889
1895
|
<div class="mb-2 flex flex-wrap gap-2 rounded-t-[18px] bg-white p-2">
|
|
1890
|
-
${this.images.map(r=>
|
|
1896
|
+
${this.images.map(r=>d`
|
|
1891
1897
|
<div class="relative inline-block">
|
|
1892
1898
|
<img src="${r.dataUrl}" alt="${r.name}" class="h-[60px] w-[60px] rounded-xl object-cover" />
|
|
1893
1899
|
|
|
1894
1900
|
<!-- Progress/Status overlay -->
|
|
1895
|
-
${r.processingState===Re.PENDING?
|
|
1901
|
+
${r.processingState===Re.PENDING?d`
|
|
1896
1902
|
<div class="absolute inset-0 flex items-center justify-center rounded-xl bg-black/40">
|
|
1897
1903
|
<lucide-icon name="loader-circle" class="inline-flex animate-spin text-white transition-all duration-1000"></lucide-icon>
|
|
1898
1904
|
</div>
|
|
1899
|
-
`:r.processingState===Re.ERROR?
|
|
1905
|
+
`:r.processingState===Re.ERROR?d`
|
|
1900
1906
|
<div class="absolute inset-0 flex items-center justify-center rounded-xl bg-red-500/60">
|
|
1901
1907
|
<lucide-icon name="badge-alert" class="h-6 w-6 text-white"></lucide-icon>
|
|
1902
1908
|
</div>
|
|
@@ -1917,7 +1923,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1917
1923
|
|
|
1918
1924
|
<!-- Input form -->
|
|
1919
1925
|
<form @submit="${m(this,Y,Ip)}" class="flex w-full items-center">
|
|
1920
|
-
${this.enableImageUpload?
|
|
1926
|
+
${this.enableImageUpload?d`
|
|
1921
1927
|
<button
|
|
1922
1928
|
data-testid="image-upload-btn"
|
|
1923
1929
|
type="button"
|
|
@@ -1945,7 +1951,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1945
1951
|
class="mx-1 rounded-full px-2 transition-all duration-150 ease-out disabled:cursor-not-allowed disabled:opacity-50">
|
|
1946
1952
|
<div
|
|
1947
1953
|
class="${this.streaming||this.loading||!this.value&&(!this.enableImageUpload||this.images.length===0)?"bg-gray-400":""} ${this.streaming||this.loading?"scale-100":"scale-95"} flex h-8 w-8 flex-row items-center justify-center rounded-full bg-[${this.color}] p-1.5 transition-all transition-colors duration-200">
|
|
1948
|
-
${this.loading?
|
|
1954
|
+
${this.loading?d`<lucide-icon name="loader-circle" class="inline-flex animate-spin text-white transition-all"></lucide-icon>`:this.streaming?d`<lucide-icon name="x" class="inline-flex h-4 w-4 text-white transition-colors"></lucide-icon>`:d`<lucide-icon name="arrow-up" class="inline-flex h-4 w-4 text-white transition-colors"></lucide-icon>`}
|
|
1949
1955
|
</div>
|
|
1950
1956
|
</button>
|
|
1951
1957
|
</form>
|
|
@@ -1954,7 +1960,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1954
1960
|
<slot>
|
|
1955
1961
|
<div class="h-5 w-full"></div>
|
|
1956
1962
|
</slot>
|
|
1957
|
-
`}setValue(r){let n=a(this,Y,Lr);if(!n){console.warn("input element not found, cannot set value");return}n.value=r,m(this,Y,Is).call(this),this.dispatchEvent(new Pt.ChangeEvent({delta:null,full:r}))}focus(){a(this,Y,Lr)?.focus()}};Wn=new WeakMap,Y=new WeakSet,Lr=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},Mp=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},Ap=function(r){L1(r)&&(r.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&a(this,Y,Mp)?.click())},Ip=function(r){r.preventDefault();let n=new Date;if(n.getTime()-a(this,Wn).getTime()<500)return;if(g(this,Wn,n),this.streaming){this.dispatchEvent(new Pt.CancelEvent);return}let s=a(this,Y,Lr);if(!s)throw new Error("Expected input element to be present");let o=s.value.trim();(o||this.enableImageUpload&&this.images.length>0)&&this.dispatchEvent(new Pt.SubmitEvent(o))&&(s.value=""),m(this,Y,Is).call(this),window.requestAnimationFrame(()=>{this.focus()})},Tp=function(r){this.dispatchEvent(new Pt.ChangeEvent({delta:r.data,full:r.target instanceof HTMLTextAreaElement?r.target.value:""})),m(this,Y,Is).call(this)},Is=function(){let r=a(this,Y,Lr);if(!r)return;let{maxHeight:n,initialHeight:i,paddingY:s}=Ua;r.style.height=`${i}px`;let o=r.scrollHeight,u=s*2,l=Math.min(o-u,n);r.style.height=`${l}px`,this.requestUpdate()},w(Pt,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String},color:{type:String},enableImageUpload:{type:Boolean},onImageUploadClick:{type:Function},images:{type:Array},onImageDelete:{type:Function}});var Ze=Pt,Pa;Ze.ChangeEvent=(Pa=class extends CustomEvent{constructor(e,r={}){super(Ze.ChangeEvent.type,{detail:e,...r})}},w(Pa,"type","mw:change"),Pa);var Ra;Ze.SubmitEvent=(Ra=class extends CustomEvent{constructor(e,r={}){super(Ze.SubmitEvent.type,{detail:e,...r,cancelable:!0})}},w(Ra,"type","mw:submit"),Ra);var Ba;Ze.CancelEvent=(Ba=class extends CustomEvent{constructor(e={}){super(Ze.CancelEvent.type,{...e})}},w(Ba,"type","mw:cancel"),Ba);function L1(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",Ze);var Or,Lp,jp,jr=class jr extends M($){constructor(){super();h(this,Or);w(this,"render",()=>
|
|
1963
|
+
`}setValue(r){let n=a(this,Y,Lr);if(!n){console.warn("input element not found, cannot set value");return}n.value=r,m(this,Y,Is).call(this),this.dispatchEvent(new Pt.ChangeEvent({delta:null,full:r}))}focus(){a(this,Y,Lr)?.focus()}};Wn=new WeakMap,Y=new WeakSet,Lr=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},Mp=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},Ap=function(r){L1(r)&&(r.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&a(this,Y,Mp)?.click())},Ip=function(r){r.preventDefault();let n=new Date;if(n.getTime()-a(this,Wn).getTime()<500)return;if(g(this,Wn,n),this.streaming){this.dispatchEvent(new Pt.CancelEvent);return}let s=a(this,Y,Lr);if(!s)throw new Error("Expected input element to be present");let o=s.value.trim();(o||this.enableImageUpload&&this.images.length>0)&&this.dispatchEvent(new Pt.SubmitEvent(o))&&(s.value=""),m(this,Y,Is).call(this),window.requestAnimationFrame(()=>{this.focus()})},Tp=function(r){this.dispatchEvent(new Pt.ChangeEvent({delta:r.data,full:r.target instanceof HTMLTextAreaElement?r.target.value:""})),m(this,Y,Is).call(this)},Is=function(){let r=a(this,Y,Lr);if(!r)return;let{maxHeight:n,initialHeight:i,paddingY:s}=Ua;r.style.height=`${i}px`;let o=r.scrollHeight,u=s*2,l=Math.min(o-u,n);r.style.height=`${l}px`,this.requestUpdate()},w(Pt,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String},color:{type:String},enableImageUpload:{type:Boolean},onImageUploadClick:{type:Function},images:{type:Array},onImageDelete:{type:Function}});var Ze=Pt,Pa;Ze.ChangeEvent=(Pa=class extends CustomEvent{constructor(e,r={}){super(Ze.ChangeEvent.type,{detail:e,...r})}},w(Pa,"type","mw:change"),Pa);var Ra;Ze.SubmitEvent=(Ra=class extends CustomEvent{constructor(e,r={}){super(Ze.SubmitEvent.type,{detail:e,...r,cancelable:!0})}},w(Ra,"type","mw:submit"),Ra);var Ba;Ze.CancelEvent=(Ba=class extends CustomEvent{constructor(e={}){super(Ze.CancelEvent.type,{...e})}},w(Ba,"type","mw:cancel"),Ba);function L1(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",Ze);var Or,Lp,jp,jr=class jr extends M($){constructor(){super();h(this,Or);w(this,"render",()=>d`
|
|
1958
1964
|
<div class="popup-desktop group relative w-[300px] cursor-pointer rounded-[17px] shadow-2xl select-none">
|
|
1959
1965
|
<mw-spinning-border .color="${this.color}" .border="${"transparent"}" .radius="${"17px"}">
|
|
1960
1966
|
<!-- wrapper -->
|
|
@@ -1982,7 +1988,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1982
1988
|
.popup-desktop button {
|
|
1983
1989
|
transition-delay: 1s;
|
|
1984
1990
|
}
|
|
1985
|
-
`);var Rt=jr,Va;Rt.CloseEvent=(Va=class extends CustomEvent{constructor(e={}){super(Rt.CloseEvent.type,{...e})}},w(Va,"type","mw:close"),Va);var Fa;Rt.ClickEvent=(Fa=class extends CustomEvent{constructor(e={}){super(Rt.ClickEvent.type,{...e})}},w(Fa,"type","mw:click"),Fa);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",Rt);var Dr,Op,Dp,Gn=class Gn extends M($){constructor(){super();h(this,Dr);w(this,"render",()=>
|
|
1991
|
+
`);var Rt=jr,Va;Rt.CloseEvent=(Va=class extends CustomEvent{constructor(e={}){super(Rt.CloseEvent.type,{...e})}},w(Va,"type","mw:close"),Va);var Fa;Rt.ClickEvent=(Fa=class extends CustomEvent{constructor(e={}){super(Rt.ClickEvent.type,{...e})}},w(Fa,"type","mw:click"),Fa);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",Rt);var Dr,Op,Dp,Gn=class Gn extends M($){constructor(){super();h(this,Dr);w(this,"render",()=>d`
|
|
1986
1992
|
<!-- wrapper -->
|
|
1987
1993
|
<div class="group relative z-[2147483647] rounded-t-2xl bg-white text-left font-sans text-base text-[16px] leading-normal text-gray-800 shadow-2xl transition-all select-none">
|
|
1988
1994
|
<!-- close button -->
|
|
@@ -1998,7 +2004,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
1998
2004
|
<h1 class="font-display mr-8 py-2.5 text-left text-lg font-bold">${this.title}</h1>
|
|
1999
2005
|
<p class="py-2.5 text-left">${this.text}</p>
|
|
2000
2006
|
<div class="h-4"></div>
|
|
2001
|
-
${this.button&&this.color?
|
|
2007
|
+
${this.button&&this.color?d`
|
|
2002
2008
|
<!-- only visible if button text and color are given -->
|
|
2003
2009
|
<button class="w-full rounded-full bg-[${this.color}] px-5 py-2.5 text-center text-sm font-medium text-white" type="button">${this.button}</button>
|
|
2004
2010
|
`:null}
|
|
@@ -2007,14 +2013,14 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
2007
2013
|
<!-- can append any other content -->
|
|
2008
2014
|
<slot name="footer"></slot>
|
|
2009
2015
|
</div>
|
|
2010
|
-
`);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Dr=new WeakSet,Op=function(){this.dispatchEvent(new Gn.CloseEvent)},Dp=function(){this.dispatchEvent(new Gn.ClickEvent)},w(Gn,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var Bt=Gn,Na;Bt.CloseEvent=(Na=class extends CustomEvent{constructor(e={}){super(Bt.CloseEvent.type,{...e})}},w(Na,"type","mw:close"),Na);var Ha;Bt.ClickEvent=(Ha=class extends CustomEvent{constructor(e={}){super(Bt.ClickEvent.type,{...e})}},w(Ha,"type","mw:click"),Ha);customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Bt);var Ur,Zn,Vt,Ts=class{constructor(e,r){h(this,Ur);h(this,Zn,!1);h(this,Vt,()=>{a(this,Zn)||(a(this,Ur).userFirstInteracted?.(),g(this,Zn,!0)),a(this,Ur).userInteracted?.()});g(this,Ur,r),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",a(this,Vt)),window.addEventListener("keydown",a(this,Vt))}stopListening(){window.removeEventListener("click",a(this,Vt)),window.removeEventListener("keydown",a(this,Vt))}};Ur=new WeakMap,Zn=new WeakMap,Vt=new WeakMap;var j1=1440*60*1e3,Pr,be,Ft,Kn,Nt,Jn,js,Up,Ls=class{constructor(e,r,n=Date){h(this,js);h(this,Pr);h(this,be);h(this,Ft);h(this,Kn);h(this,Nt,!1);h(this,Jn,!1);g(this,Pr,e),g(this,be,r),g(this,Ft,n),e.addController(this)}get showing(){return a(this,Nt)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!a(this,Nt)&&(g(this,Nt,!0),a(this,Pr).requestUpdate(),e)){a(this,be).playPopupSound();let r=a(this,be).getPersistedState();a(this,be).setPersistedState({...r,playedSoundOnce:!0})}}hide(){g(this,Jn,!0),this.abortAutoShowTimer(),g(this,Nt,!1),a(this,Pr).requestUpdate()}abortAutoShowTimer(){clearTimeout(a(this,Kn))}onCloseClick(){let e=a(this,be).getPersistedState();a(this,be).setPersistedState({...e,userDismissedAt:a(this,Ft).now()}),this.hide()}onContentClick(){let e=a(this,be).getPersistedState();a(this,be).setPersistedState({...e,userDismissedAt:a(this,Ft).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),a(this,Jn)||g(this,Kn,setTimeout(()=>m(this,js,Up).call(this),a(this,be).getDelayMs()))}};Pr=new WeakMap,be=new WeakMap,Ft=new WeakMap,Kn=new WeakMap,Nt=new WeakMap,Jn=new WeakMap,js=new WeakSet,Up=function(){let e=a(this,be).getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&a(this,Ft).now()-e.userDismissedAt<j1||this.show({sound:!r})};var ut,Wa,Ke,Os,qa,Ds=class Ds extends M($){constructor(){super();h(this,Ke);h(this,ut,new Ls(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(r=>{console.error("Error playing audio:",r,{})})},setPersistedState:r=>{r?localStorage.setItem("_molin_popup",JSON.stringify(r)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let r=localStorage.getItem("_molin_popup");try{return r?JSON.parse(r):null}catch{return null}}}));h(this,Wa,new Ts(this,a(this,ut)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:"",color:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let r=a(this,ut).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",n=this.content;return
|
|
2016
|
+
`);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Dr=new WeakSet,Op=function(){this.dispatchEvent(new Gn.CloseEvent)},Dp=function(){this.dispatchEvent(new Gn.ClickEvent)},w(Gn,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var Bt=Gn,Na;Bt.CloseEvent=(Na=class extends CustomEvent{constructor(e={}){super(Bt.CloseEvent.type,{...e})}},w(Na,"type","mw:close"),Na);var Ha;Bt.ClickEvent=(Ha=class extends CustomEvent{constructor(e={}){super(Bt.ClickEvent.type,{...e})}},w(Ha,"type","mw:click"),Ha);customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Bt);var Ur,Zn,Vt,Ts=class{constructor(e,r){h(this,Ur);h(this,Zn,!1);h(this,Vt,()=>{a(this,Zn)||(a(this,Ur).userFirstInteracted?.(),g(this,Zn,!0)),a(this,Ur).userInteracted?.()});g(this,Ur,r),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",a(this,Vt)),window.addEventListener("keydown",a(this,Vt))}stopListening(){window.removeEventListener("click",a(this,Vt)),window.removeEventListener("keydown",a(this,Vt))}};Ur=new WeakMap,Zn=new WeakMap,Vt=new WeakMap;var j1=1440*60*1e3,Pr,be,Ft,Kn,Nt,Jn,js,Up,Ls=class{constructor(e,r,n=Date){h(this,js);h(this,Pr);h(this,be);h(this,Ft);h(this,Kn);h(this,Nt,!1);h(this,Jn,!1);g(this,Pr,e),g(this,be,r),g(this,Ft,n),e.addController(this)}get showing(){return a(this,Nt)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!a(this,Nt)&&(g(this,Nt,!0),a(this,Pr).requestUpdate(),e)){a(this,be).playPopupSound();let r=a(this,be).getPersistedState();a(this,be).setPersistedState({...r,playedSoundOnce:!0})}}hide(){g(this,Jn,!0),this.abortAutoShowTimer(),g(this,Nt,!1),a(this,Pr).requestUpdate()}abortAutoShowTimer(){clearTimeout(a(this,Kn))}onCloseClick(){let e=a(this,be).getPersistedState();a(this,be).setPersistedState({...e,userDismissedAt:a(this,Ft).now()}),this.hide()}onContentClick(){let e=a(this,be).getPersistedState();a(this,be).setPersistedState({...e,userDismissedAt:a(this,Ft).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),a(this,Jn)||g(this,Kn,setTimeout(()=>m(this,js,Up).call(this),a(this,be).getDelayMs()))}};Pr=new WeakMap,be=new WeakMap,Ft=new WeakMap,Kn=new WeakMap,Nt=new WeakMap,Jn=new WeakMap,js=new WeakSet,Up=function(){let e=a(this,be).getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&a(this,Ft).now()-e.userDismissedAt<j1||this.show({sound:!r})};var ut,Wa,Ke,Os,qa,Ds=class Ds extends M($){constructor(){super();h(this,Ke);h(this,ut,new Ls(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(r=>{console.error("Error playing audio:",r,{})})},setPersistedState:r=>{r?localStorage.setItem("_molin_popup",JSON.stringify(r)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let r=localStorage.getItem("_molin_popup");try{return r?JSON.parse(r):null}catch{return null}}}));h(this,Wa,new Ts(this,a(this,ut)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:"",color:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let r=a(this,ut).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",n=this.content;return d`
|
|
2011
2017
|
<!-- mobile shadow backdrop -->
|
|
2012
2018
|
<div @click="${m(this,Ke,Os)}" class="${r} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
|
|
2013
2019
|
|
|
2014
2020
|
<!-- mobile overlay -->
|
|
2015
2021
|
<div class="${r} fixed right-0 bottom-0 left-0 z-[2147483647] sm:hidden">
|
|
2016
2022
|
<mw-popup-mobile title="${n.mobile.title}" text="${n.mobile.text}" button="${n.mobile.button}" color="${n.mobile.color}" @mw:click="${m(this,Ke,qa)}" @mw:close="${m(this,Ke,Os)}">
|
|
2017
|
-
${n.mobile.poweredBy?
|
|
2023
|
+
${n.mobile.poweredBy?d`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:null}
|
|
2018
2024
|
</mw-popup-mobile>
|
|
2019
2025
|
</div>
|
|
2020
2026
|
|
|
@@ -2022,7 +2028,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
2022
2028
|
<div class="${r} ${this.positionClasses} fixed z-[2147483647] transition-[opacity,translate,visibility] max-sm:hidden">
|
|
2023
2029
|
<mw-popup-desktop color="${n.desktop.color}" text="${n.desktop.text}" @mw:click="${m(this,Ke,qa)}" @mw:close="${m(this,Ke,Os)}"></mw-popup-desktop>
|
|
2024
2030
|
</div>
|
|
2025
|
-
`}hide(){a(this,ut).hide()}};ut=new WeakMap,Wa=new WeakMap,Ke=new WeakSet,Os=function(){a(this,ut).onCloseClick()},qa=function(){this.dispatchEvent(new Ds.ClickEvent),a(this,ut).onContentClick()},w(Ds,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var Xn=Ds,za;Xn.ClickEvent=(za=class extends CustomEvent{constructor(e={}){super(Xn.ClickEvent.type,{...e})}},w(za,"type","mw:click"),za);customElements.get("mw-popup")||customElements.define("mw-popup",Xn);var Ps,Pp,Us=class extends M($){constructor(){super();h(this,Ps);w(this,"render",()=>
|
|
2031
|
+
`}hide(){a(this,ut).hide()}};ut=new WeakMap,Wa=new WeakMap,Ke=new WeakSet,Os=function(){a(this,ut).onCloseClick()},qa=function(){this.dispatchEvent(new Ds.ClickEvent),a(this,ut).onContentClick()},w(Ds,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var Xn=Ds,za;Xn.ClickEvent=(za=class extends CustomEvent{constructor(e={}){super(Xn.ClickEvent.type,{...e})}},w(za,"type","mw:click"),za);customElements.get("mw-popup")||customElements.define("mw-popup",Xn);var Ps,Pp,Us=class extends M($){constructor(){super();h(this,Ps);w(this,"render",()=>d`
|
|
2026
2032
|
<span class="relative inline-flex">
|
|
2027
2033
|
<slot></slot>
|
|
2028
2034
|
<span class="${a(this,Ps,Pp)} pointer-events-none absolute z-10 flex h-3 w-3">
|
|
@@ -2030,7 +2036,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
2030
2036
|
<span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
|
|
2031
2037
|
</span>
|
|
2032
2038
|
</span>
|
|
2033
|
-
`);this.color="sky-500",this.position="top-right"}};Ps=new WeakSet,Pp=function(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:throw new Error(`Invalid position: ${this.position}`)}},w(Us,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",Us);var Rs=class extends M($){constructor(){super();w(this,"render",()=>
|
|
2039
|
+
`);this.color="sky-500",this.position="top-right"}};Ps=new WeakSet,Pp=function(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:throw new Error(`Invalid position: ${this.position}`)}},w(Us,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",Us);var Rs=class extends M($){constructor(){super();w(this,"render",()=>d`
|
|
2034
2040
|
<div class="${this.positionClasses} fixed right-6 bottom-24 z-10 flex animate-bounce flex-col items-center justify-center font-sans text-base">
|
|
2035
2041
|
<p class="mb-2 -translate-x-4 -rotate-12 transform text-lg leading-normal font-bold text-gray-800">${this.text}</p>
|
|
2036
2042
|
|
|
@@ -2043,7 +2049,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
2043
2049
|
stroke-linecap="round"></path>
|
|
2044
2050
|
</svg>
|
|
2045
2051
|
</div>
|
|
2046
|
-
`);this.positionClasses="",this.text="Try it out"}};w(Rs,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Rs);var Bs,Yn=class extends M($){constructor(){super();h(this,Bs,new lt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return a(this,Bs).data}render(){return this.config?
|
|
2052
|
+
`);this.positionClasses="",this.text="Try it out"}};w(Rs,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Rs);var Bs,Yn=class extends M($){constructor(){super();h(this,Bs,new lt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return a(this,Bs).data}render(){return this.config?d`
|
|
2047
2053
|
<!-- embed our bubble component forwarding props -->
|
|
2048
2054
|
<!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
|
|
2049
2055
|
<mw-bubble
|
|
@@ -2057,7 +2063,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
2057
2063
|
:host {
|
|
2058
2064
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
2059
2065
|
}
|
|
2060
|
-
`),w(Yn,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",Yn);var Gv="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),Zv="navigator"in globalThis&&"share"in navigator,O1=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function D1(t){if(typeof window>"u")return!1;let e=O1[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function Ga(){return D1("sm")}var Fs,Rr,Br,Ht,Qn,Ns,Vs=class{constructor(e,r,n,i=window.history){h(this,Fs);h(this,Rr);h(this,Br);h(this,Ht);h(this,Qn,!1);h(this,Ns,()=>{a(this,Rr).test(window.location.pathname)&&a(this,Br).navigated()});g(this,Fs,e),g(this,Rr,r),g(this,Br,n),g(this,Ht,i),e.addController(this)}hostConnected(){a(this,Ns).call(this);let e=a(this,Ht).pushState;a(this,Ht).pushState=(...r)=>{if(e.call(a(this,Ht),...r),!a(this,Qn))try{let n=new URL(r[2],window.location.origin);a(this,Rr).test(n.pathname)&&a(this,Br).navigated()}catch{}}}hostDisconnected(){g(this,Qn,!0)}};Fs=new WeakMap,Rr=new WeakMap,Br=new WeakMap,Ht=new WeakMap,Qn=new WeakMap,Ns=new WeakMap;function Rp({minMs:t,maxMs:e}){return Math.random()*(e-t)+t}function Hs(t,e=""){return Object.entries(t).filter(([r,n])=>n).map(([r,n])=>`${e}${r}-[${n}]`).join(" ")}function Bp(t,e={}){return[Hs(t),Hs(e,"max-sm:")].join(" ")}function Vp(t){return Hs(t)}function Fp(t){return Object.entries(t).filter(([e,r])=>r).filter(([e])=>e==="left"||e==="right").map(([e,r])=>{let n=`sm:${e}-[${r}]`;return e==="left"&&(n+=" sm:right-auto"),e==="right"&&(n+=" sm:left-auto"),n}).join(" ")}function Np(t){let e=Hs(t),n=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,n].filter(Boolean).join(" ")}var Vr,Fr,ei,ti,ri,zs,Za=class{constructor(e,r,{threshold:n=5}={}){h(this,Vr,0);h(this,Fr,!1);h(this,ei);h(this,ti);h(this,ri,()=>{a(this,Fr)||(requestAnimationFrame(a(this,zs)),g(this,Fr,!0))});h(this,zs,()=>{let e=window.scrollY,r=e-a(this,Vr);if(Math.abs(r)>=a(this,ti)){let n=r>0?"down":"up";a(this,ei).call(this,{scrollY:e,direction:n,deltaY:Math.abs(r)}),g(this,Vr,e)}g(this,Fr,!1)});g(this,ei,r),g(this,ti,n),e.addController(this)}hostConnected(){g(this,Vr,window.scrollY),window.addEventListener("scroll",a(this,ri),{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",a(this,ri))}};Vr=new WeakMap,Fr=new WeakMap,ei=new WeakMap,ti=new WeakMap,ri=new WeakMap,zs=new WeakMap;function Hp(t,e,r){return new Za(t,e,r)}var qs,rl,ii,nl,Je,Ws,A,Ka,Ja,Xa,ni,pt,Ya,zp,qp,Wp,Gs,Qa,el,tl,zt,Te=class extends M($){constructor(){super();h(this,A);h(this,qs,new lt(this,{onError:console.error}));h(this,rl,Hp(this,r=>{a(this,A,Ja)&&!this._dialogShown&&(r.direction==="down"?this._floatingInputVisible=!1:r.direction==="up"&&(this._floatingInputVisible=!0),this.requestUpdate())},{threshold:20}));h(this,ii);h(this,nl,new Vs(this,/.*/i,{navigated:()=>{if(this.requestUpdate(),!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let r=a(this,A,pt)?.conversationId,n=ir.restore(this.widgetId)?.conversationId,i=r||n;i&&q("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:i,url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0,shouldHideForCurrentUrl:a(this,A,Xa)})}}));h(this,Je,!1);h(this,Ws,{onError:r=>{alert(r.error),console.error(r.widgetId,r.error),q("ShopAssistant: error",{...r},{immediate:!0})},onNewMessageStartedStreaming:r=>{q("ShopAssistant: user received bot message (streaming started)",r)},onMessageEndedStreaming:r=>{q("ShopAssistant: user received bot message (streaming ended)",r)},onUserCanceledStreaming:r=>{q("ShopAssistant: user canceled streaming",r)},onUserClickedLink:r=>{q("ShopAssistant: user clicked link",r)},onUserSentInput:r=>{q("ShopAssistant: user sent input",r)}});h(this,Gs,r=>{let n=r.detail.text,i=a(this,A,Ya);i&&typeof i.connect=="function"&&i.connect(),this._dialogShown=!0,g(this,Je,!0),this.requestUpdate(),m(this,A,zt).call(this,!0),setTimeout(()=>{m(this,A,tl).call(this,n),m(this,A,el).call(this,n).catch(console.warn)},100),q("ShopAssistant: user sent input",{widgetId:this.widgetId,text:n,example:!1,conversationId:a(this,A,pt)?.conversationId||"",source:"ask-ai"})});this.cdn="https://widget.molin.ai",this.widgetId="",this._floatingInputVisible=!0,this._dialogShown=!1,this.xUserData=at()?.userData,this.xCustomInstructions=at()?.customInstructions}get config(){return a(this,ii)||a(this,qs).data}render(){if(!this.config)return null;let r=Bp(this.config.bubble.position,this.config.bubble.mobilePosition),n=Vp(this.config.bubble.position),i=Fp(this.config.bubble.position),s=Np(this.config.bubble.position);return this.config.hidden||_s().hidden||a(this,A,Xa)?null:
|
|
2066
|
+
`),w(Yn,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",Yn);var Gv="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),Zv="navigator"in globalThis&&"share"in navigator,O1=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function D1(t){if(typeof window>"u")return!1;let e=O1[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function Ga(){return D1("sm")}var Fs,Rr,Br,Ht,Qn,Ns,Vs=class{constructor(e,r,n,i=window.history){h(this,Fs);h(this,Rr);h(this,Br);h(this,Ht);h(this,Qn,!1);h(this,Ns,()=>{a(this,Rr).test(window.location.pathname)&&a(this,Br).navigated()});g(this,Fs,e),g(this,Rr,r),g(this,Br,n),g(this,Ht,i),e.addController(this)}hostConnected(){a(this,Ns).call(this);let e=a(this,Ht).pushState;a(this,Ht).pushState=(...r)=>{if(e.call(a(this,Ht),...r),!a(this,Qn))try{let n=new URL(r[2],window.location.origin);a(this,Rr).test(n.pathname)&&a(this,Br).navigated()}catch{}}}hostDisconnected(){g(this,Qn,!0)}};Fs=new WeakMap,Rr=new WeakMap,Br=new WeakMap,Ht=new WeakMap,Qn=new WeakMap,Ns=new WeakMap;function Rp({minMs:t,maxMs:e}){return Math.random()*(e-t)+t}function Hs(t,e=""){return Object.entries(t).filter(([r,n])=>n).map(([r,n])=>`${e}${r}-[${n}]`).join(" ")}function Bp(t,e={}){return[Hs(t),Hs(e,"max-sm:")].join(" ")}function Vp(t){return Hs(t)}function Fp(t){return Object.entries(t).filter(([e,r])=>r).filter(([e])=>e==="left"||e==="right").map(([e,r])=>{let n=`sm:${e}-[${r}]`;return e==="left"&&(n+=" sm:right-auto"),e==="right"&&(n+=" sm:left-auto"),n}).join(" ")}function Np(t){let e=Hs(t),n=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,n].filter(Boolean).join(" ")}var Vr,Fr,ei,ti,ri,zs,Za=class{constructor(e,r,{threshold:n=5}={}){h(this,Vr,0);h(this,Fr,!1);h(this,ei);h(this,ti);h(this,ri,()=>{a(this,Fr)||(requestAnimationFrame(a(this,zs)),g(this,Fr,!0))});h(this,zs,()=>{let e=window.scrollY,r=e-a(this,Vr);if(Math.abs(r)>=a(this,ti)){let n=r>0?"down":"up";a(this,ei).call(this,{scrollY:e,direction:n,deltaY:Math.abs(r)}),g(this,Vr,e)}g(this,Fr,!1)});g(this,ei,r),g(this,ti,n),e.addController(this)}hostConnected(){g(this,Vr,window.scrollY),window.addEventListener("scroll",a(this,ri),{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",a(this,ri))}};Vr=new WeakMap,Fr=new WeakMap,ei=new WeakMap,ti=new WeakMap,ri=new WeakMap,zs=new WeakMap;function Hp(t,e,r){return new Za(t,e,r)}var qs,rl,ii,nl,Je,Ws,A,Ka,Ja,Xa,ni,pt,Ya,zp,qp,Wp,Gs,Qa,el,tl,zt,Te=class extends M($){constructor(){super();h(this,A);h(this,qs,new lt(this,{onError:console.error}));h(this,rl,Hp(this,r=>{a(this,A,Ja)&&!this._dialogShown&&(r.direction==="down"?this._floatingInputVisible=!1:r.direction==="up"&&(this._floatingInputVisible=!0),this.requestUpdate())},{threshold:20}));h(this,ii);h(this,nl,new Vs(this,/.*/i,{navigated:()=>{if(this.requestUpdate(),!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let r=a(this,A,pt)?.conversationId,n=ir.restore(this.widgetId)?.conversationId,i=r||n;i&&q("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:i,url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0,shouldHideForCurrentUrl:a(this,A,Xa)})}}));h(this,Je,!1);h(this,Ws,{onError:r=>{alert(r.error),console.error(r.widgetId,r.error),q("ShopAssistant: error",{...r},{immediate:!0})},onNewMessageStartedStreaming:r=>{q("ShopAssistant: user received bot message (streaming started)",r)},onMessageEndedStreaming:r=>{q("ShopAssistant: user received bot message (streaming ended)",r)},onUserCanceledStreaming:r=>{q("ShopAssistant: user canceled streaming",r)},onUserClickedLink:r=>{q("ShopAssistant: user clicked link",r)},onUserSentInput:r=>{q("ShopAssistant: user sent input",r)}});h(this,Gs,r=>{let n=r.detail.text,i=a(this,A,Ya);i&&typeof i.connect=="function"&&i.connect(),this._dialogShown=!0,g(this,Je,!0),this.requestUpdate(),m(this,A,zt).call(this,!0),setTimeout(()=>{m(this,A,tl).call(this,n),m(this,A,el).call(this,n).catch(console.warn)},100),q("ShopAssistant: user sent input",{widgetId:this.widgetId,text:n,example:!1,conversationId:a(this,A,pt)?.conversationId||"",source:"ask-ai"})});this.cdn="https://widget.molin.ai",this.widgetId="",this._floatingInputVisible=!0,this._dialogShown=!1,this.xUserData=at()?.userData,this.xCustomInstructions=at()?.customInstructions}get config(){return a(this,ii)||a(this,qs).data}render(){if(!this.config)return null;let r=Bp(this.config.bubble.position,this.config.bubble.mobilePosition),n=Vp(this.config.bubble.position),i=Fp(this.config.bubble.position),s=Np(this.config.bubble.position);return this.config.hidden||_s().hidden||a(this,A,Xa)?null:d`
|
|
2061
2067
|
<mw-context-widget
|
|
2062
2068
|
.widgetId="${this.widgetId}"
|
|
2063
2069
|
.config="${this.config}"
|
|
@@ -2076,7 +2082,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
2076
2082
|
height="${le(this.config?.bubble?.size?.height)}"></mw-bubble>
|
|
2077
2083
|
|
|
2078
2084
|
<!-- only load the component if enabled on any platform -->
|
|
2079
|
-
${this.isPopupEnabled?
|
|
2085
|
+
${this.isPopupEnabled?d`
|
|
2080
2086
|
<mw-popup
|
|
2081
2087
|
position="${s}"
|
|
2082
2088
|
delay="${this.config.popup?.delayMs||Rp({minMs:2e3,maxMs:5e3})}"
|
|
@@ -2086,7 +2092,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
2086
2092
|
`:null}
|
|
2087
2093
|
|
|
2088
2094
|
<!-- show "Try it out" if enabled (even if the chat window is showing) -->
|
|
2089
|
-
${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?
|
|
2095
|
+
${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?d`<mw-try-it-out
|
|
2090
2096
|
class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}"
|
|
2091
2097
|
position="${n}"
|
|
2092
2098
|
text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:null}
|
|
@@ -2100,7 +2106,7 @@ var Zp=Object.create;var Ks=Object.defineProperty;var Kp=Object.getOwnPropertyDe
|
|
|
2100
2106
|
</div>
|
|
2101
2107
|
|
|
2102
2108
|
<!-- Floating input only visible when enabled, in center, on desktop only -->
|
|
2103
|
-
${this.config?.floatingAskAI?.enabled&&a(this,A,Ja)?
|
|
2109
|
+
${this.config?.floatingAskAI?.enabled&&a(this,A,Ja)?d`
|
|
2104
2110
|
<mw-floating-ask-ai
|
|
2105
2111
|
?dark="${this.config?.floatingAskAI?.darkMode}"
|
|
2106
2112
|
.color="${this.config.color||this.config?.bubble?.color}"
|