@release0/js 1.1.7 → 1.1.9

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/web.js CHANGED
@@ -1,19 +1,18 @@
1
- // Release0 v1.1.7
2
- var oT=Object.create;var rs=Object.defineProperty;var iT=Object.getOwnPropertyDescriptor;var aT=Object.getOwnPropertyNames;var sT=Object.getPrototypeOf,lT=Object.prototype.hasOwnProperty;var cT=(e,t)=>()=>(e&&(t=e(e=0)),t);var et=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),uT=(e,t)=>{for(var r in t)rs(e,r,{get:t[r],enumerable:true});},gf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of aT(t))!lT.call(e,o)&&o!==r&&rs(e,o,{get:()=>t[o],enumerable:!(n=iT(t,o))||n.enumerable});return e};var wo=(e,t,r)=>(r=e!=null?oT(sT(e)):{},gf(rs(r,"default",{value:e,enumerable:true}),e)),ns=e=>gf(rs({},"__esModule",{value:true}),e);var Cp=et(ye=>{Object.defineProperty(ye,"__esModule",{value:true});ye.toBig=ye.shrSL=ye.shrSH=ye.rotrSL=ye.rotrSH=ye.rotrBL=ye.rotrBH=ye.rotr32L=ye.rotr32H=ye.rotlSL=ye.rotlSH=ye.rotlBL=ye.rotlBH=ye.add5L=ye.add5H=ye.add4L=ye.add4H=ye.add3L=ye.add3H=void 0;ye.add=bp;ye.fromBig=Nc;ye.split=np;var gs=BigInt(2**32-1),Lc=BigInt(32);function Nc(e,t=false){return t?{h:Number(e&gs),l:Number(e>>Lc&gs)}:{h:Number(e>>Lc&gs)|0,l:Number(e&gs)|0}}function np(e,t=false){let r=e.length,n=new Uint32Array(r),o=new Uint32Array(r);for(let i=0;i<r;i++){let{h:a,l:s}=Nc(e[i],t);[n[i],o[i]]=[a,s];}return [n,o]}var op=(e,t)=>BigInt(e>>>0)<<Lc|BigInt(t>>>0);ye.toBig=op;var ip=(e,t,r)=>e>>>r;ye.shrSH=ip;var ap=(e,t,r)=>e<<32-r|t>>>r;ye.shrSL=ap;var sp=(e,t,r)=>e>>>r|t<<32-r;ye.rotrSH=sp;var lp=(e,t,r)=>e<<32-r|t>>>r;ye.rotrSL=lp;var cp=(e,t,r)=>e<<64-r|t>>>r-32;ye.rotrBH=cp;var up=(e,t,r)=>e>>>r-32|t<<64-r;ye.rotrBL=up;var dp=(e,t)=>t;ye.rotr32H=dp;var fp=(e,t)=>e;ye.rotr32L=fp;var pp=(e,t,r)=>e<<r|t>>>32-r;ye.rotlSH=pp;var mp=(e,t,r)=>t<<r|e>>>32-r;ye.rotlSL=mp;var gp=(e,t,r)=>t<<r-32|e>>>64-r;ye.rotlBH=gp;var hp=(e,t,r)=>e<<r-32|t>>>64-r;ye.rotlBL=hp;function bp(e,t,r,n){let o=(t>>>0)+(n>>>0);return {h:e+r+(o/2**32|0)|0,l:o|0}}var yp=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);ye.add3L=yp;var vp=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;ye.add3H=vp;var xp=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);ye.add4L=xp;var wp=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0;ye.add4H=wp;var Tp=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0);ye.add5L=Tp;var _p=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0;ye.add5H=_p;var R_={fromBig:Nc,split:np,toBig:op,shrSH:ip,shrSL:ap,rotrSH:sp,rotrSL:lp,rotrBH:cp,rotrBL:up,rotr32H:dp,rotr32L:fp,rotlSH:pp,rotlSL:mp,rotlBH:gp,rotlBL:hp,add:bp,add3L:yp,add3H:vp,add4L:xp,add4H:wp,add5H:_p,add5L:Tp};ye.default=R_;});var Sp=et(hs=>{Object.defineProperty(hs,"__esModule",{value:true});hs.crypto=void 0;hs.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;});var Dp=et(ge=>{Object.defineProperty(ge,"__esModule",{value:true});ge.wrapXOFConstructorWithOpts=ge.wrapConstructorWithOpts=ge.wrapConstructor=ge.Hash=ge.nextTick=ge.swap32IfBE=ge.byteSwapIfBE=ge.swap8IfBE=ge.isLE=void 0;ge.isBytes=Pp;ge.anumber=Bc;ge.abytes=Oo;ge.ahash=D_;ge.aexists=M_;ge.aoutput=$_;ge.u8=L_;ge.u32=N_;ge.clean=B_;ge.createView=F_;ge.rotr=U_;ge.rotl=j_;ge.byteSwap=Uc;ge.byteSwap32=Ep;ge.bytesToHex=W_;ge.hexToBytes=V_;ge.asyncLoop=G_;ge.utf8ToBytes=jc;ge.bytesToUtf8=q_;ge.toBytes=bs;ge.kdfInputToBytes=Y_;ge.concatBytes=K_;ge.checkOpts=X_;ge.createHasher=Ap;ge.createOptHasher=Op;ge.createXOFer=Rp;ge.randomBytes=Z_;var Ao=Sp();function Pp(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Bc(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Oo(e,...t){if(!Pp(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function D_(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Bc(e.outputLen),Bc(e.blockLen);}function M_(e,t=true){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function $_(e,t){Oo(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function L_(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function N_(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function B_(...e){for(let t=0;t<e.length;t++)e[t].fill(0);}function F_(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function U_(e,t){return e<<32-t|e>>>t}function j_(e,t){return e<<t|e>>>32-t>>>0}ge.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Uc(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}ge.swap8IfBE=ge.isLE?e=>e:e=>Uc(e);ge.byteSwapIfBE=ge.swap8IfBE;function Ep(e){for(let t=0;t<e.length;t++)e[t]=Uc(e[t]);return e}ge.swap32IfBE=ge.isLE?e=>e:Ep;var Ip=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",H_=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function W_(e){if(Oo(e),Ip)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=H_[e[r]];return t}var Vr={_0:48,_9:57,A:65,F:70,a:97,f:102};function kp(e){if(e>=Vr._0&&e<=Vr._9)return e-Vr._0;if(e>=Vr.A&&e<=Vr.F)return e-(Vr.A-10);if(e>=Vr.a&&e<=Vr.f)return e-(Vr.a-10)}function V_(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Ip)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){let a=kp(e.charCodeAt(i)),s=kp(e.charCodeAt(i+1));if(a===void 0||s===void 0){let l=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+i)}n[o]=a*16+s;}return n}var z_=async()=>{};ge.nextTick=z_;async function G_(e,t,r){let n=Date.now();for(let o=0;o<e;o++){r(o);let i=Date.now()-n;i>=0&&i<t||(await(0, ge.nextTick)(),n+=i);}}function jc(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function q_(e){return new TextDecoder().decode(e)}function bs(e){return typeof e=="string"&&(e=jc(e)),Oo(e),e}function Y_(e){return typeof e=="string"&&(e=jc(e)),Oo(e),e}function K_(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];Oo(o),t+=o.length;}let r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){let i=e[n];r.set(i,o),o+=i.length;}return r}function X_(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(e,t)}var Fc=class{};ge.Hash=Fc;function Ap(e){let t=n=>e().update(bs(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Op(e){let t=(n,o)=>e(o).update(bs(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Rp(e){let t=(n,o)=>e(o).update(bs(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}ge.wrapConstructor=Ap;ge.wrapConstructorWithOpts=Op;ge.wrapXOFConstructorWithOpts=Rp;function Z_(e=32){if(Ao.crypto&&typeof Ao.crypto.getRandomValues=="function")return Ao.crypto.getRandomValues(new Uint8Array(e));if(Ao.crypto&&typeof Ao.crypto.randomBytes=="function")return Uint8Array.from(Ao.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}});var Hp=et(Je=>{Object.defineProperty(Je,"__esModule",{value:true});Je.shake256=Je.shake128=Je.keccak_512=Je.keccak_384=Je.keccak_256=Je.keccak_224=Je.sha3_512=Je.sha3_384=Je.sha3_256=Je.sha3_224=Je.Keccak=void 0;Je.keccakP=Up;var Ai=Cp(),kt=Dp(),Q_=BigInt(0),Ii=BigInt(1),J_=BigInt(2),eC=BigInt(7),tC=BigInt(256),rC=BigInt(113),Lp=[],Np=[],Bp=[];for(let e=0,t=Ii,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Lp.push(2*(5*n+r)),Np.push((e+1)*(e+2)/2%64);let o=Q_;for(let i=0;i<7;i++)t=(t<<Ii^(t>>eC)*rC)%tC,t&J_&&(o^=Ii<<(Ii<<BigInt(i))-Ii);Bp.push(o);}var Fp=(0, Ai.split)(Bp,true),nC=Fp[0],oC=Fp[1],Mp=(e,t,r)=>r>32?(0, Ai.rotlBH)(e,t,r):(0, Ai.rotlSH)(e,t,r),$p=(e,t,r)=>r>32?(0, Ai.rotlBL)(e,t,r):(0, Ai.rotlSL)(e,t,r);function Up(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let a=0;a<10;a++)r[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){let s=(a+8)%10,l=(a+2)%10,c=r[l],u=r[l+1],d=Mp(c,u,1)^r[s],f=$p(c,u,1)^r[s+1];for(let p=0;p<50;p+=10)e[a+p]^=d,e[a+p+1]^=f;}let o=e[2],i=e[3];for(let a=0;a<24;a++){let s=Np[a],l=Mp(o,i,s),c=$p(o,i,s),u=Lp[a];o=e[u],i=e[u+1],e[u]=l,e[u+1]=c;}for(let a=0;a<50;a+=10){for(let s=0;s<10;s++)r[s]=e[a+s];for(let s=0;s<10;s++)e[a+s]^=~r[(s+2)%10]&r[(s+4)%10];}e[0]^=nC[n],e[1]^=oC[n];}(0, kt.clean)(r);}var Oi=class e extends kt.Hash{constructor(t,r,n,o=false,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=false,this.destroyed=false,this.enableXOF=false,this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=i,(0, kt.anumber)(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0, kt.u32)(this.state);}clone(){return this._cloneInto()}keccak(){(0, kt.swap32IfBE)(this.state32),Up(this.state32,this.rounds),(0, kt.swap32IfBE)(this.state32),this.posOut=0,this.pos=0;}update(t){(0, kt.aexists)(this),t=(0, kt.toBytes)(t),(0, kt.abytes)(t);let{blockLen:r,state:n}=this,o=t.length;for(let i=0;i<o;){let a=Math.min(r-this.pos,o-i);for(let s=0;s<a;s++)n[this.pos++]^=t[i++];this.pos===r&&this.keccak();}return this}finish(){if(this.finished)return;this.finished=true;let{state:t,suffix:r,pos:n,blockLen:o}=this;t[n]^=r,r&128&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak();}writeInto(t){(0, kt.aexists)(this,false),(0, kt.abytes)(t),this.finish();let r=this.state,{blockLen:n}=this;for(let o=0,i=t.length;o<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-o);t.set(r.subarray(this.posOut,this.posOut+a),o),this.posOut+=a,o+=a;}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return (0, kt.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0, kt.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=true,(0, kt.clean)(this.state);}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:o,rounds:i,enableXOF:a}=this;return t||(t=new e(r,n,o,a,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=o,t.enableXOF=a,t.destroyed=this.destroyed,t}};Je.Keccak=Oi;var dn=(e,t,r)=>(0, kt.createHasher)(()=>new Oi(t,e,r));Je.sha3_224=dn(6,144,224/8);Je.sha3_256=dn(6,136,256/8);Je.sha3_384=dn(6,104,384/8);Je.sha3_512=dn(6,72,512/8);Je.keccak_224=dn(1,144,224/8);Je.keccak_256=dn(1,136,256/8);Je.keccak_384=dn(1,104,384/8);Je.keccak_512=dn(1,72,512/8);var jp=(e,t,r)=>(0, kt.createXOFer)((n={})=>new Oi(t,e,n.dkLen===void 0?r:n.dkLen,true));Je.shake128=jp(31,168,128/8);Je.shake256=jp(31,136,256/8);});var Xp=et((ZD,fn)=>{var{sha3_512:iC}=Hp(),Vp=24,Ri=32,Hc=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function zp(e){let t=8n,r=0n;for(let n of e.values()){let o=BigInt(n);r=(r<<t)+o;}return r}var Gp=(e="")=>zp(iC(e)).toString(36).slice(1),Wp=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),aC=e=>Wp[Math.floor(e()*Wp.length)],qp=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+Hc(Ri,t):Hc(Ri,t);return Gp(n).substring(0,Ri)},Yp=e=>()=>e++,sC=476782367,Kp=({random:e=Math.random,counter:t=Yp(Math.floor(e()*sC)),length:r=Vp,fingerprint:n=qp({random:e})}={})=>function(){let i=aC(e),a=Date.now().toString(36),s=t().toString(36),l=Hc(r,e),c=`${a+l+s+n}`;return `${i+Gp(c).substring(1,r)}`},lC=Kp(),cC=(e,{minLength:t=2,maxLength:r=Ri}={})=>{let n=e.length,o=/^[0-9a-z]+$/;try{if(typeof e=="string"&&n>=t&&n<=r&&o.test(e))return !0}finally{}return false};fn.exports.getConstants=()=>({defaultLength:Vp,bigLength:Ri});fn.exports.init=Kp;fn.exports.createId=lC;fn.exports.bufToBigInt=zp;fn.exports.createCounter=Yp;fn.exports.createFingerprint=qp;fn.exports.isCuid=cC;});var Zp=et((QD,Di)=>{var{createId:uC,init:dC,getConstants:fC,isCuid:pC}=Xp();Di.exports.createId=uC;Di.exports.init=dC;Di.exports.getConstants=fC;Di.exports.isCuid=pC;});var Jp=et((JD,Qp)=>{var Ro=1e3,Do=Ro*60,Mo=Do*60,Rn=Mo*24,mC=Rn*7,gC=Rn*365.25;Qp.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return hC(e);if(r==="number"&&isFinite(e))return t.long?yC(e):bC(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function hC(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case "years":case "year":case "yrs":case "yr":case "y":return r*gC;case "weeks":case "week":case "w":return r*mC;case "days":case "day":case "d":return r*Rn;case "hours":case "hour":case "hrs":case "hr":case "h":return r*Mo;case "minutes":case "minute":case "mins":case "min":case "m":return r*Do;case "seconds":case "second":case "secs":case "sec":case "s":return r*Ro;case "milliseconds":case "millisecond":case "msecs":case "msec":case "ms":return r;default:return}}}}function bC(e){var t=Math.abs(e);return t>=Rn?Math.round(e/Rn)+"d":t>=Mo?Math.round(e/Mo)+"h":t>=Do?Math.round(e/Do)+"m":t>=Ro?Math.round(e/Ro)+"s":e+"ms"}function yC(e){var t=Math.abs(e);return t>=Rn?ys(e,t,Rn,"day"):t>=Mo?ys(e,t,Mo,"hour"):t>=Do?ys(e,t,Do,"minute"):t>=Ro?ys(e,t,Ro,"second"):e+" ms"}function ys(e,t,r,n){var o=t>=r*1.5;return Math.round(e/r)+" "+n+(o?"s":"")}});var Wy=et((rB,ri)=>{var CE=typeof Buffer<"u",Fy=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Uy=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function jy(e,t,r){r==null&&t!==null&&typeof t=="object"&&(r=t,t=void 0),CE&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let n=JSON.parse(e,t);if(n===null||typeof n!="object")return n;let o=r&&r.protoAction||"error",i=r&&r.constructorAction||"error";if(o==="ignore"&&i==="ignore")return n;if(o!=="ignore"&&i!=="ignore"){if(Fy.test(e)===false&&Uy.test(e)===false)return n}else if(o!=="ignore"&&i==="ignore"){if(Fy.test(e)===false)return n}else if(Uy.test(e)===false)return n;return Hy(n,{protoAction:o,constructorAction:i,safe:r&&r.safe})}function Hy(e,{protoAction:t="error",constructorAction:r="error",safe:n}={}){let o=[e];for(;o.length;){let i=o;o=[];for(let a of i){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(a,"__proto__")){if(n===true)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete a.__proto__;}if(r!=="ignore"&&Object.prototype.hasOwnProperty.call(a,"constructor")&&Object.prototype.hasOwnProperty.call(a.constructor,"prototype")){if(n===true)return null;if(r==="error")throw new SyntaxError("Object contains forbidden prototype property");delete a.constructor;}for(let s in a){let l=a[s];l&&typeof l=="object"&&o.push(l);}}}return e}function $u(e,t,r){let n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return jy(e,t,r)}finally{Error.stackTraceLimit=n;}}function SE(e,t){let r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return jy(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=r;}}ri.exports=$u;ri.exports.default=$u;ri.exports.parse=$u;ri.exports.safeParse=SE;ri.exports.scan=Hy;});var wx=et(id=>{Object.defineProperty(id,"__esModule",{value:true});function Rl(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rl=function(t){return typeof t}:Rl=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rl(e)}var vx="https://js.stripe.com/v3",H1=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,W1=function(){for(var t=document.querySelectorAll('script[src^="'.concat(vx,'"]')),r=0;r<t.length;r++){var n=t[r];if(H1.test(n.src))return n}return null},V1=function(t){var r=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(vx).concat(r);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(n),n},z1=function(t,r){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"1.54.1",startTime:r});},Ol=null,G1=function(t){return Ol!==null||(Ol=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe){r(window.Stripe);return}try{var o=W1();o&&t||o||(o=V1(t)),o.addEventListener("load",function(){window.Stripe?r(window.Stripe):n(new Error("Stripe.js not available"));}),o.addEventListener("error",function(){n(new Error("Failed to load Stripe.js"));});}catch(i){n(i);return}})),Ol},q1=function(t,r,n){if(t===null)return null;var o=t.apply(void 0,r);return z1(o,n),o},yx=function(t){var r=`invalid load parameters; expected object of shape
1
+ // Release0 v1.1.9
2
+ var y0=Object.create;var Da=Object.defineProperty;var x0=Object.getOwnPropertyDescriptor;var v0=Object.getOwnPropertyNames;var w0=Object.getPrototypeOf,T0=Object.prototype.hasOwnProperty;var C0=(e,t)=>()=>(e&&(t=e(e=0)),t);var tt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_0=(e,t)=>{for(var r in t)Da(e,r,{get:t[r],enumerable:true});},Rd=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of v0(t))!T0.call(e,o)&&o!==r&&Da(e,o,{get:()=>t[o],enumerable:!(n=x0(t,o))||n.enumerable});return e};var Ma=(e,t,r)=>(r=e!=null?y0(w0(e)):{},Rd(Da(r,"default",{value:e,enumerable:true}),e)),$a=e=>Rd(Da({},"__esModule",{value:true}),e);var Hf=tt(ge=>{Object.defineProperty(ge,"__esModule",{value:true});ge.toBig=ge.shrSL=ge.shrSH=ge.rotrSL=ge.rotrSH=ge.rotrBL=ge.rotrBH=ge.rotr32L=ge.rotr32H=ge.rotlSL=ge.rotlSH=ge.rotlBL=ge.rotlBH=ge.add5L=ge.add5H=ge.add4L=ge.add4H=ge.add3L=ge.add3H=void 0;ge.add=$f;ge.fromBig=ec;ge.split=wf;var Ga=BigInt(2**32-1),Jl=BigInt(32);function ec(e,t=false){return t?{h:Number(e&Ga),l:Number(e>>Jl&Ga)}:{h:Number(e>>Jl&Ga)|0,l:Number(e&Ga)|0}}function wf(e,t=false){let r=e.length,n=new Uint32Array(r),o=new Uint32Array(r);for(let i=0;i<r;i++){let{h:a,l:s}=ec(e[i],t);[n[i],o[i]]=[a,s];}return [n,o]}var Tf=(e,t)=>BigInt(e>>>0)<<Jl|BigInt(t>>>0);ge.toBig=Tf;var Cf=(e,t,r)=>e>>>r;ge.shrSH=Cf;var _f=(e,t,r)=>e<<32-r|t>>>r;ge.shrSL=_f;var Sf=(e,t,r)=>e>>>r|t<<32-r;ge.rotrSH=Sf;var kf=(e,t,r)=>e<<32-r|t>>>r;ge.rotrSL=kf;var Pf=(e,t,r)=>e<<64-r|t>>>r-32;ge.rotrBH=Pf;var Ef=(e,t,r)=>e>>>r-32|t<<64-r;ge.rotrBL=Ef;var If=(e,t)=>t;ge.rotr32H=If;var Af=(e,t)=>e;ge.rotr32L=Af;var Of=(e,t,r)=>e<<r|t>>>32-r;ge.rotlSH=Of;var Rf=(e,t,r)=>t<<r|e>>>32-r;ge.rotlSL=Rf;var Df=(e,t,r)=>t<<r-32|e>>>64-r;ge.rotlBH=Df;var Mf=(e,t,r)=>e<<r-32|t>>>64-r;ge.rotlBL=Mf;function $f(e,t,r,n){let o=(t>>>0)+(n>>>0);return {h:e+r+(o/2**32|0)|0,l:o|0}}var Nf=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);ge.add3L=Nf;var Lf=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;ge.add3H=Lf;var Ff=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);ge.add4L=Ff;var Bf=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0;ge.add4H=Bf;var Uf=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0);ge.add5L=Uf;var Vf=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0;ge.add5H=Vf;var qT={fromBig:ec,split:wf,toBig:Tf,shrSH:Cf,shrSL:_f,rotrSH:Sf,rotrSL:kf,rotrBH:Pf,rotrBL:Ef,rotr32H:If,rotr32L:Af,rotlSH:Of,rotlSL:Rf,rotlBH:Df,rotlBL:Mf,add:$f,add3L:Nf,add3H:Lf,add4L:Ff,add4H:Bf,add5H:Vf,add5L:Uf};ge.default=qT;});var Wf=tt(qa=>{Object.defineProperty(qa,"__esModule",{value:true});qa.crypto=void 0;qa.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;});var Zf=tt(de=>{Object.defineProperty(de,"__esModule",{value:true});de.wrapXOFConstructorWithOpts=de.wrapConstructorWithOpts=de.wrapConstructor=de.Hash=de.nextTick=de.swap32IfBE=de.byteSwapIfBE=de.swap8IfBE=de.isLE=void 0;de.isBytes=zf;de.anumber=tc;de.abytes=bo;de.ahash=YT;de.aexists=KT;de.aoutput=XT;de.u8=ZT;de.u32=QT;de.clean=JT;de.createView=eC;de.rotr=tC;de.rotl=rC;de.byteSwap=nc;de.byteSwap32=Gf;de.bytesToHex=oC;de.hexToBytes=iC;de.asyncLoop=sC;de.utf8ToBytes=oc;de.bytesToUtf8=lC;de.toBytes=Ya;de.kdfInputToBytes=cC;de.concatBytes=uC;de.checkOpts=dC;de.createHasher=Yf;de.createOptHasher=Kf;de.createXOFer=Xf;de.randomBytes=fC;var ho=Wf();function zf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function tc(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function bo(e,...t){if(!zf(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function YT(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");tc(e.outputLen),tc(e.blockLen);}function KT(e,t=true){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function XT(e,t){bo(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function ZT(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function QT(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function JT(...e){for(let t=0;t<e.length;t++)e[t].fill(0);}function eC(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function tC(e,t){return e<<32-t|e>>>t}function rC(e,t){return e<<t|e>>>32-t>>>0}de.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function nc(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}de.swap8IfBE=de.isLE?e=>e:e=>nc(e);de.byteSwapIfBE=de.swap8IfBE;function Gf(e){for(let t=0;t<e.length;t++)e[t]=nc(e[t]);return e}de.swap32IfBE=de.isLE?e=>e:Gf;var qf=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",nC=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function oC(e){if(bo(e),qf)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=nC[e[r]];return t}var Br={_0:48,_9:57,A:65,F:70,a:97,f:102};function jf(e){if(e>=Br._0&&e<=Br._9)return e-Br._0;if(e>=Br.A&&e<=Br.F)return e-(Br.A-10);if(e>=Br.a&&e<=Br.f)return e-(Br.a-10)}function iC(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(qf)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){let a=jf(e.charCodeAt(i)),s=jf(e.charCodeAt(i+1));if(a===void 0||s===void 0){let l=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+i)}n[o]=a*16+s;}return n}var aC=async()=>{};de.nextTick=aC;async function sC(e,t,r){let n=Date.now();for(let o=0;o<e;o++){r(o);let i=Date.now()-n;i>=0&&i<t||(await(0, de.nextTick)(),n+=i);}}function oc(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function lC(e){return new TextDecoder().decode(e)}function Ya(e){return typeof e=="string"&&(e=oc(e)),bo(e),e}function cC(e){return typeof e=="string"&&(e=oc(e)),bo(e),e}function uC(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];bo(o),t+=o.length;}let r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){let i=e[n];r.set(i,o),o+=i.length;}return r}function dC(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(e,t)}var rc=class{};de.Hash=rc;function Yf(e){let t=n=>e().update(Ya(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Kf(e){let t=(n,o)=>e(o).update(Ya(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Xf(e){let t=(n,o)=>e(o).update(Ya(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}de.wrapConstructor=Yf;de.wrapConstructorWithOpts=Kf;de.wrapXOFConstructorWithOpts=Xf;function fC(e=32){if(ho.crypto&&typeof ho.crypto.getRandomValues=="function")return ho.crypto.getRandomValues(new Uint8Array(e));if(ho.crypto&&typeof ho.crypto.randomBytes=="function")return Uint8Array.from(ho.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}});var ap=tt(qe=>{Object.defineProperty(qe,"__esModule",{value:true});qe.shake256=qe.shake128=qe.keccak_512=qe.keccak_384=qe.keccak_256=qe.keccak_224=qe.sha3_512=qe.sha3_384=qe.sha3_256=qe.sha3_224=qe.Keccak=void 0;qe.keccakP=op;var mi=Hf(),vt=Zf(),pC=BigInt(0),pi=BigInt(1),mC=BigInt(2),gC=BigInt(7),hC=BigInt(256),bC=BigInt(113),ep=[],tp=[],rp=[];for(let e=0,t=pi,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],ep.push(2*(5*n+r)),tp.push((e+1)*(e+2)/2%64);let o=pC;for(let i=0;i<7;i++)t=(t<<pi^(t>>gC)*bC)%hC,t&mC&&(o^=pi<<(pi<<BigInt(i))-pi);rp.push(o);}var np=(0, mi.split)(rp,true),yC=np[0],xC=np[1],Qf=(e,t,r)=>r>32?(0, mi.rotlBH)(e,t,r):(0, mi.rotlSH)(e,t,r),Jf=(e,t,r)=>r>32?(0, mi.rotlBL)(e,t,r):(0, mi.rotlSL)(e,t,r);function op(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let a=0;a<10;a++)r[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){let s=(a+8)%10,l=(a+2)%10,u=r[l],c=r[l+1],d=Qf(u,c,1)^r[s],p=Jf(u,c,1)^r[s+1];for(let f=0;f<50;f+=10)e[a+f]^=d,e[a+f+1]^=p;}let o=e[2],i=e[3];for(let a=0;a<24;a++){let s=tp[a],l=Qf(o,i,s),u=Jf(o,i,s),c=ep[a];o=e[c],i=e[c+1],e[c]=l,e[c+1]=u;}for(let a=0;a<50;a+=10){for(let s=0;s<10;s++)r[s]=e[a+s];for(let s=0;s<10;s++)e[a+s]^=~r[(s+2)%10]&r[(s+4)%10];}e[0]^=yC[n],e[1]^=xC[n];}(0, vt.clean)(r);}var gi=class e extends vt.Hash{constructor(t,r,n,o=false,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=false,this.destroyed=false,this.enableXOF=false,this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=i,(0, vt.anumber)(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0, vt.u32)(this.state);}clone(){return this._cloneInto()}keccak(){(0, vt.swap32IfBE)(this.state32),op(this.state32,this.rounds),(0, vt.swap32IfBE)(this.state32),this.posOut=0,this.pos=0;}update(t){(0, vt.aexists)(this),t=(0, vt.toBytes)(t),(0, vt.abytes)(t);let{blockLen:r,state:n}=this,o=t.length;for(let i=0;i<o;){let a=Math.min(r-this.pos,o-i);for(let s=0;s<a;s++)n[this.pos++]^=t[i++];this.pos===r&&this.keccak();}return this}finish(){if(this.finished)return;this.finished=true;let{state:t,suffix:r,pos:n,blockLen:o}=this;t[n]^=r,(r&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak();}writeInto(t){(0, vt.aexists)(this,false),(0, vt.abytes)(t),this.finish();let r=this.state,{blockLen:n}=this;for(let o=0,i=t.length;o<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-o);t.set(r.subarray(this.posOut,this.posOut+a),o),this.posOut+=a,o+=a;}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return (0, vt.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0, vt.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=true,(0, vt.clean)(this.state);}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:o,rounds:i,enableXOF:a}=this;return t||(t=new e(r,n,o,a,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=o,t.enableXOF=a,t.destroyed=this.destroyed,t}};qe.Keccak=gi;var rn=(e,t,r)=>(0, vt.createHasher)(()=>new gi(t,e,r));qe.sha3_224=rn(6,144,224/8);qe.sha3_256=rn(6,136,256/8);qe.sha3_384=rn(6,104,384/8);qe.sha3_512=rn(6,72,512/8);qe.keccak_224=rn(1,144,224/8);qe.keccak_256=rn(1,136,256/8);qe.keccak_384=rn(1,104,384/8);qe.keccak_512=rn(1,72,512/8);var ip=(e,t,r)=>(0, vt.createXOFer)((n={})=>new gi(t,e,n.dkLen===void 0?r:n.dkLen,true));qe.shake128=ip(31,168,128/8);qe.shake256=ip(31,136,256/8);});var mp=tt((lD,nn)=>{var{sha3_512:vC}=ap(),lp=24,hi=32,ic=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function cp(e){let t=8n,r=0n;for(let n of e.values()){let o=BigInt(n);r=(r<<t)+o;}return r}var up=(e="")=>cp(vC(e)).toString(36).slice(1),sp=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),wC=e=>sp[Math.floor(e()*sp.length)],dp=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+ic(hi,t):ic(hi,t);return up(n).substring(0,hi)},fp=e=>()=>e++,TC=476782367,pp=({random:e=Math.random,counter:t=fp(Math.floor(e()*TC)),length:r=lp,fingerprint:n=dp({random:e})}={})=>function(){let i=wC(e),a=Date.now().toString(36),s=t().toString(36),l=ic(r,e),u=`${a+l+s+n}`;return `${i+up(u).substring(1,r)}`},CC=pp(),_C=(e,{minLength:t=2,maxLength:r=hi}={})=>{let n=e.length,o=/^[0-9a-z]+$/;try{if(typeof e=="string"&&n>=t&&n<=r&&o.test(e))return !0}finally{}return false};nn.exports.getConstants=()=>({defaultLength:lp,bigLength:hi});nn.exports.init=pp;nn.exports.createId=CC;nn.exports.bufToBigInt=cp;nn.exports.createCounter=fp;nn.exports.createFingerprint=dp;nn.exports.isCuid=_C;});var gp=tt((cD,bi)=>{var{createId:SC,init:kC,getConstants:PC,isCuid:EC}=mp();bi.exports.createId=SC;bi.exports.init=kC;bi.exports.getConstants=PC;bi.exports.isCuid=EC;});var bp=tt((uD,hp)=>{var yo=1e3,xo=yo*60,vo=xo*60,yn=vo*24,IC=yn*7,AC=yn*365.25;hp.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return OC(e);if(r==="number"&&isFinite(e))return t.long?DC(e):RC(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function OC(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case "years":case "year":case "yrs":case "yr":case "y":return r*AC;case "weeks":case "week":case "w":return r*IC;case "days":case "day":case "d":return r*yn;case "hours":case "hour":case "hrs":case "hr":case "h":return r*vo;case "minutes":case "minute":case "mins":case "min":case "m":return r*xo;case "seconds":case "second":case "secs":case "sec":case "s":return r*yo;case "milliseconds":case "millisecond":case "msecs":case "msec":case "ms":return r;default:return}}}}function RC(e){var t=Math.abs(e);return t>=yn?Math.round(e/yn)+"d":t>=vo?Math.round(e/vo)+"h":t>=xo?Math.round(e/xo)+"m":t>=yo?Math.round(e/yo)+"s":e+"ms"}function DC(e){var t=Math.abs(e);return t>=yn?Ka(e,t,yn,"day"):t>=vo?Ka(e,t,vo,"hour"):t>=xo?Ka(e,t,xo,"minute"):t>=yo?Ka(e,t,yo,"second"):e+" ms"}function Ka(e,t,r,n){var o=t>=r*1.5;return Math.round(e/r)+" "+n+(o?"s":"")}});var Mx=tt(ku=>{Object.defineProperty(ku,"__esModule",{value:true});function nl(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?nl=function(t){return typeof t}:nl=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nl(e)}var Ox="basil",T1=function(t){return t===3?"v3":t},Rx="https://js.stripe.com",C1="".concat(Rx,"/").concat(Ox,"/stripe.js"),_1=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,S1=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,Ex="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",k1=function(t){return _1.test(t)||S1.test(t)},P1=function(){for(var t=document.querySelectorAll('script[src^="'.concat(Rx,'"]')),r=0;r<t.length;r++){var n=t[r];if(k1(n.src))return n}return null},Ix=function(t){var r=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(C1).concat(r);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(n),n},E1=function(t,r){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"7.4.0",startTime:r});},ua=null,tl=null,rl=null,I1=function(t){return function(r){t(new Error("Failed to load Stripe.js",{cause:r}));}},A1=function(t,r){return function(){window.Stripe?t(window.Stripe):r(new Error("Stripe.js not available"));}},O1=function(t){return ua!==null?ua:(ua=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&t&&console.warn(Ex),window.Stripe){r(window.Stripe);return}try{var o=P1();if(o&&t)console.warn(Ex);else if(!o)o=Ix(t);else if(o&&rl!==null&&tl!==null){var i;o.removeEventListener("load",rl),o.removeEventListener("error",tl),(i=o.parentNode)===null||i===void 0||i.removeChild(o),o=Ix(t);}rl=A1(r,n),tl=I1(n),o.addEventListener("load",rl),o.addEventListener("error",tl);}catch(a){n(a);return}}),ua.catch(function(r){return ua=null,Promise.reject(r)}))},R1=function(t,r,n){if(t===null)return null;var o=r[0],i=o.match(/^pk_test/),a=T1(t.version),s=Ox;i&&a!==s&&console.warn("Stripe.js@".concat(a," was loaded on the page, but @stripe/stripe-js@").concat("7.4.0"," expected Stripe.js@").concat(s,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var l=t.apply(void 0,r);return E1(l,n),l},Ax=function(t){var r=`invalid load parameters; expected object of shape
3
3
 
4
4
  {advancedFraudSignals: boolean}
5
5
 
6
6
  but received
7
7
 
8
8
  `.concat(JSON.stringify(t),`
9
- `);if(t===null||Rl(t)!=="object")throw new Error(r);if(Object.keys(t).length===1&&typeof t.advancedFraudSignals=="boolean")return t;throw new Error(r)},Dl,od=false,xx=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];od=true;var o=Date.now();return G1(Dl).then(function(i){return q1(i,r,o)})};xx.setLoadParameters=function(e){if(od&&Dl){var t=yx(e),r=Object.keys(t),n=r.reduce(function(o,i){var a;return o&&e[i]===((a=Dl)===null||a===void 0?void 0:a[i])},true);if(n)return}if(od)throw new Error("You cannot change load parameters after calling loadStripe");Dl=yx(e);};id.loadStripe=xx;});var _x=et((g7,Tx)=>{Tx.exports=wx();});var Ua={};uT(Ua,{__addDisposableResource:()=>cw,__assign:()=>Nl,__asyncDelegator:()=>tw,__asyncGenerator:()=>ew,__asyncValues:()=>rw,__await:()=>ui,__awaiter:()=>Yx,__classPrivateFieldGet:()=>aw,__classPrivateFieldIn:()=>lw,__classPrivateFieldSet:()=>sw,__createBinding:()=>Fl,__decorate:()=>jx,__disposeResources:()=>uw,__esDecorate:()=>Wx,__exportStar:()=>Xx,__extends:()=>Fx,__generator:()=>Kx,__importDefault:()=>iw,__importStar:()=>ow,__makeTemplateObject:()=>nw,__metadata:()=>qx,__param:()=>Hx,__propKey:()=>zx,__read:()=>ud,__rest:()=>Ux,__rewriteRelativeImportExtension:()=>dw,__runInitializers:()=>Vx,__setFunctionName:()=>Gx,__spread:()=>Zx,__spreadArray:()=>Jx,__spreadArrays:()=>Qx,__values:()=>Bl,default:()=>AA});function Fx(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ld(e,t);function r(){this.constructor=e;}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r);}function Ux(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function jx(e,t,r,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(o<3?a(i):o>3?a(t,r,i):a(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function Hx(e,t){return function(r,n){t(r,n,e);}}function Wx(e,t,r,n,o,i){function a(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var s=n.kind,l=s==="getter"?"get":s==="setter"?"set":"value",c=!t&&e?n.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),d,f=false,p=r.length-1;p>=0;p--){var g={};for(var h in n)g[h]=h==="access"?{}:n[h];for(var h in n.access)g.access[h]=n.access[h];g.addInitializer=function(y){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(y||null));};var b=(0, r[p])(s==="accessor"?{get:u.get,set:u.set}:u[l],g);if(s==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(d=a(b.get))&&(u.get=d),(d=a(b.set))&&(u.set=d),(d=a(b.init))&&o.unshift(d);}else (d=a(b))&&(s==="field"?o.unshift(d):u[l]=d);}c&&Object.defineProperty(c,n.name,u),f=true;}function Vx(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function zx(e){return typeof e=="symbol"?e:"".concat(e)}function Gx(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:true,value:r?"".concat(r," ",t):t})}function qx(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Yx(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i);})}return new(r||(r=Promise))(function(i,a){function s(u){try{c(n.next(u));}catch(d){a(d);}}function l(u){try{c(n.throw(u));}catch(d){a(d);}}function c(u){u.done?i(u.value):o(u.value).then(s,l);}c((n=n.apply(e,t||[])).next());})}function Kx(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r);}catch(u){c=[6,u],o=0;}finally{n=i=0;}if(c[0]&5)throw c[1];return {value:c[0]?c[1]:void 0,done:true}}}function Xx(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Fl(t,e,r);}function Bl(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return {next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ud(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value);}catch(s){a={error:s};}finally{try{o&&!o.done&&(r=n.return)&&r.call(n);}finally{if(a)throw a.error}}return i}function Zx(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ud(arguments[t]));return e}function Qx(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}function Jx(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function ui(e){return this instanceof ui?(this.v=e,this):new ui(e)}function ew(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(p){return function(g){return Promise.resolve(g).then(p,d)}}function s(p,g){n[p]&&(o[p]=function(h){return new Promise(function(b,y){i.push([p,h,b,y])>1||l(p,h);})},g&&(o[p]=g(o[p])));}function l(p,g){try{c(n[p](g));}catch(h){f(i[0][3],h);}}function c(p){p.value instanceof ui?Promise.resolve(p.value.v).then(u,d):f(i[0][2],p);}function u(p){l("next",p);}function d(p){l("throw",p);}function f(p,g){p(g),i.shift(),i.length&&l(i[0][0],i[0][1]);}}function tw(e){var t,r;return t={},n("next"),n("throw",function(o){throw o}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(o,i){t[o]=e[o]?function(a){return (r=!r)?{value:ui(e[o](a)),done:false}:i?i(a):a}:i;}}function rw(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Bl=="function"?Bl(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,l){a=e[i](a),o(s,l,a.done,a.value);})};}function o(i,a,s,l){Promise.resolve(l).then(function(c){i({value:c,done:s});},a);}}function nw(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function ow(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=cd(e),n=0;n<r.length;n++)r[n]!=="default"&&Fl(t,e,r[n]);return EA(t,e),t}function iw(e){return e&&e.__esModule?e:{default:e}}function aw(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function sw(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function lw(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function cw(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose];}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(o=n);}if(typeof n!="function")throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this);}catch(i){return Promise.reject(i)}}),e.stack.push({value:t,dispose:n,async:r});}else r&&e.stack.push({async:true});return t}function uw(e){function t(i){e.error=e.hasError?new IA(i,e.error,"An error was suppressed during disposal."):i,e.hasError=true;}var r,n=0;function o(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(a){return t(a),o()})}else n|=1;}catch(a){t(a);}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function dw(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,o,i,a){return n?t?".jsx":".js":o&&(!i||!a)?r:o+i+"."+a.toLowerCase()+"js"}):e}var ld,Nl,Fl,EA,cd,IA,AA,ja=cT(()=>{ld=function(e,t){return ld=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n;}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o]);},ld(e,t)};Nl=function(){return Nl=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i]);}return t},Nl.apply(this,arguments)};Fl=Object.create?function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:true,get:function(){return t[r]}}),Object.defineProperty(e,n,o);}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r];};EA=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t});}:function(e,t){e.default=t;},cd=function(e){return cd=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},cd(e)};IA=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};AA={__extends:Fx,__assign:Nl,__rest:Ux,__decorate:jx,__param:Hx,__esDecorate:Wx,__runInitializers:Vx,__propKey:zx,__setFunctionName:Gx,__metadata:qx,__awaiter:Yx,__generator:Kx,__createBinding:Fl,__exportStar:Xx,__values:Bl,__read:ud,__spread:Zx,__spreadArrays:Qx,__spreadArray:Jx,__await:ui,__asyncGenerator:ew,__asyncDelegator:tw,__asyncValues:rw,__makeTemplateObject:nw,__importStar:ow,__importDefault:iw,__classPrivateFieldGet:aw,__classPrivateFieldSet:sw,__classPrivateFieldIn:lw,__addDisposableResource:cw,__disposeResources:uw,__rewriteRelativeImportExtension:dw};});var di=et(Ul=>{Object.defineProperty(Ul,"__esModule",{value:true});Ul.WebmBase=void 0;var dd=class{constructor(t="Unknown",r=0){this.name=t,this.start=r;}getType(){return "Unknown"}updateBySource(){}setSource(t){this.source=t,this.updateBySource();}updateByData(){}setData(t){this.data=t,this.updateByData();}getValue(){return this.data}setValue(t){this.setData(t);}};Ul.WebmBase=dd;});var Hl=et(jl=>{Object.defineProperty(jl,"__esModule",{value:true});jl.SectionType=void 0;var fw;(function(e){e.Container="Container",e.Uint="Uint",e.Int="Int",e.Float="Float",e.String="String",e.Date="Date",e.Binary="Binary";})(fw||(jl.SectionType=fw={}));});var fd=et(Wl=>{Object.defineProperty(Wl,"__esModule",{value:true});Wl.sections=void 0;var x=Hl();Wl.sections={172351395:{name:"EBML",type:x.SectionType.Container},646:{name:"EBMLVersion",type:x.SectionType.Uint},759:{name:"EBMLReadVersion",type:x.SectionType.Uint},754:{name:"EBMLMaxIDLength",type:x.SectionType.Uint},755:{name:"EBMLMaxSizeLength",type:x.SectionType.Uint},642:{name:"DocType",type:x.SectionType.String},647:{name:"DocTypeVersion",type:x.SectionType.Uint},645:{name:"DocTypeReadVersion",type:x.SectionType.Uint},108:{name:"Void",type:x.SectionType.Binary},63:{name:"CRC-32",type:x.SectionType.Binary},190023271:{name:"SignatureSlot",type:x.SectionType.Container},16010:{name:"SignatureAlgo",type:x.SectionType.Uint},16026:{name:"SignatureHash",type:x.SectionType.Uint},16037:{name:"SignaturePublicKey",type:x.SectionType.Binary},16053:{name:"Signature",type:x.SectionType.Binary},15963:{name:"SignatureElements",type:x.SectionType.Container},15995:{name:"SignatureElementList",type:x.SectionType.Container},9522:{name:"SignedElement",type:x.SectionType.Binary},139690087:{name:"Segment",type:x.SectionType.Container},21863284:{name:"SeekHead",type:x.SectionType.Container},3515:{name:"Seek",type:x.SectionType.Container},5035:{name:"SeekID",type:x.SectionType.Binary},5036:{name:"SeekPosition",type:x.SectionType.Uint},88713574:{name:"Info",type:x.SectionType.Container},13220:{name:"SegmentUID",type:x.SectionType.Binary},13188:{name:"SegmentFilename",type:x.SectionType.String},1882403:{name:"PrevUID",type:x.SectionType.Binary},1868715:{name:"PrevFilename",type:x.SectionType.String},2013475:{name:"NextUID",type:x.SectionType.Binary},1999803:{name:"NextFilename",type:x.SectionType.String},1092:{name:"SegmentFamily",type:x.SectionType.Binary},10532:{name:"ChapterTranslate",type:x.SectionType.Container},10748:{name:"ChapterTranslateEditionUID",type:x.SectionType.Uint},10687:{name:"ChapterTranslateCodec",type:x.SectionType.Uint},10661:{name:"ChapterTranslateID",type:x.SectionType.Binary},710577:{name:"TimecodeScale",type:x.SectionType.Uint},1161:{name:"Duration",type:x.SectionType.Float},1121:{name:"DateUTC",type:x.SectionType.Date},15273:{name:"Title",type:x.SectionType.String},3456:{name:"MuxingApp",type:x.SectionType.String},5953:{name:"WritingApp",type:x.SectionType.String},103:{name:"Timecode",type:x.SectionType.Uint},6228:{name:"SilentTracks",type:x.SectionType.Container},6359:{name:"SilentTrackNumber",type:x.SectionType.Uint},39:{name:"Position",type:x.SectionType.Uint},43:{name:"PrevSize",type:x.SectionType.Uint},35:{name:"SimpleBlock",type:x.SectionType.Binary},32:{name:"BlockGroup",type:x.SectionType.Container},33:{name:"Block",type:x.SectionType.Binary},34:{name:"BlockVirtual",type:x.SectionType.Binary},13729:{name:"BlockAdditions",type:x.SectionType.Container},38:{name:"BlockMore",type:x.SectionType.Container},110:{name:"BlockAddID",type:x.SectionType.Uint},37:{name:"BlockAdditional",type:x.SectionType.Binary},27:{name:"BlockDuration",type:x.SectionType.Uint},122:{name:"ReferencePriority",type:x.SectionType.Uint},123:{name:"ReferenceBlock",type:x.SectionType.Int},125:{name:"ReferenceVirtual",type:x.SectionType.Int},36:{name:"CodecState",type:x.SectionType.Binary},13730:{name:"DiscardPadding",type:x.SectionType.Int},14:{name:"Slices",type:x.SectionType.Container},104:{name:"TimeSlice",type:x.SectionType.Container},76:{name:"LaceNumber",type:x.SectionType.Uint},77:{name:"FrameNumber",type:x.SectionType.Uint},75:{name:"BlockAdditionID",type:x.SectionType.Uint},78:{name:"Delay",type:x.SectionType.Uint},79:{name:"SliceDuration",type:x.SectionType.Uint},72:{name:"ReferenceFrame",type:x.SectionType.Container},73:{name:"ReferenceOffset",type:x.SectionType.Uint},74:{name:"ReferenceTimeCode",type:x.SectionType.Uint},47:{name:"EncryptedBlock",type:x.SectionType.Binary},106212971:{name:"Tracks",type:x.SectionType.Container},46:{name:"TrackEntry",type:x.SectionType.Container},87:{name:"TrackNumber",type:x.SectionType.Uint},13253:{name:"TrackUID",type:x.SectionType.Uint},3:{name:"TrackType",type:x.SectionType.Uint},57:{name:"FlagEnabled",type:x.SectionType.Uint},8:{name:"FlagDefault",type:x.SectionType.Uint},5546:{name:"FlagForced",type:x.SectionType.Uint},28:{name:"FlagLacing",type:x.SectionType.Uint},11751:{name:"MinCache",type:x.SectionType.Uint},11768:{name:"MaxCache",type:x.SectionType.Uint},254851:{name:"DefaultDuration",type:x.SectionType.Uint},216698:{name:"DefaultDecodedFieldDuration",type:x.SectionType.Uint},209231:{name:"TrackTimecodeScale",type:x.SectionType.Float},4991:{name:"TrackOffset",type:x.SectionType.Int},5614:{name:"MaxBlockAdditionID",type:x.SectionType.Uint},4974:{name:"Name",type:x.SectionType.String},177564:{name:"Language",type:x.SectionType.String},6:{name:"CodecID",type:x.SectionType.String},9122:{name:"CodecPrivate",type:x.SectionType.Binary},362120:{name:"CodecName",type:x.SectionType.String},13382:{name:"AttachmentLink",type:x.SectionType.Uint},1742487:{name:"CodecSettings",type:x.SectionType.String},1785920:{name:"CodecInfoURL",type:x.SectionType.String},438848:{name:"CodecDownloadURL",type:x.SectionType.String},42:{name:"CodecDecodeAll",type:x.SectionType.Uint},12203:{name:"TrackOverlay",type:x.SectionType.Uint},5802:{name:"CodecDelay",type:x.SectionType.Uint},5819:{name:"SeekPreRoll",type:x.SectionType.Uint},9764:{name:"TrackTranslate",type:x.SectionType.Container},9980:{name:"TrackTranslateEditionUID",type:x.SectionType.Uint},9919:{name:"TrackTranslateCodec",type:x.SectionType.Uint},9893:{name:"TrackTranslateTrackID",type:x.SectionType.Binary},96:{name:"Video",type:x.SectionType.Container},26:{name:"FlagInterlaced",type:x.SectionType.Uint},5048:{name:"StereoMode",type:x.SectionType.Uint},5056:{name:"AlphaMode",type:x.SectionType.Uint},5049:{name:"OldStereoMode",type:x.SectionType.Uint},48:{name:"PixelWidth",type:x.SectionType.Uint},58:{name:"PixelHeight",type:x.SectionType.Uint},5290:{name:"PixelCropBottom",type:x.SectionType.Uint},5307:{name:"PixelCropTop",type:x.SectionType.Uint},5324:{name:"PixelCropLeft",type:x.SectionType.Uint},5341:{name:"PixelCropRight",type:x.SectionType.Uint},5296:{name:"DisplayWidth",type:x.SectionType.Uint},5306:{name:"DisplayHeight",type:x.SectionType.Uint},5298:{name:"DisplayUnit",type:x.SectionType.Uint},5299:{name:"AspectRatioType",type:x.SectionType.Uint},963876:{name:"ColourSpace",type:x.SectionType.Binary},1029411:{name:"GammaValue",type:x.SectionType.Float},230371:{name:"FrameRate",type:x.SectionType.Float},97:{name:"Audio",type:x.SectionType.Container},53:{name:"SamplingFrequency",type:x.SectionType.Float},14517:{name:"OutputSamplingFrequency",type:x.SectionType.Float},31:{name:"Channels",type:x.SectionType.Uint},15739:{name:"ChannelPositions",type:x.SectionType.Binary},8804:{name:"BitDepth",type:x.SectionType.Uint},98:{name:"TrackOperation",type:x.SectionType.Container},99:{name:"TrackCombinePlanes",type:x.SectionType.Container},100:{name:"TrackPlane",type:x.SectionType.Container},101:{name:"TrackPlaneUID",type:x.SectionType.Uint},102:{name:"TrackPlaneType",type:x.SectionType.Uint},105:{name:"TrackJoinBlocks",type:x.SectionType.Container},109:{name:"TrackJoinUID",type:x.SectionType.Uint},64:{name:"TrickTrackUID",type:x.SectionType.Uint},65:{name:"TrickTrackSegmentUID",type:x.SectionType.Binary},70:{name:"TrickTrackFlag",type:x.SectionType.Uint},71:{name:"TrickMasterTrackUID",type:x.SectionType.Uint},68:{name:"TrickMasterTrackSegmentUID",type:x.SectionType.Binary},11648:{name:"ContentEncodings",type:x.SectionType.Container},8768:{name:"ContentEncoding",type:x.SectionType.Container},4145:{name:"ContentEncodingOrder",type:x.SectionType.Uint},4146:{name:"ContentEncodingScope",type:x.SectionType.Uint},4147:{name:"ContentEncodingType",type:x.SectionType.Uint},4148:{name:"ContentCompression",type:x.SectionType.Container},596:{name:"ContentCompAlgo",type:x.SectionType.Uint},597:{name:"ContentCompSettings",type:x.SectionType.Binary},4149:{name:"ContentEncryption",type:x.SectionType.Container},2017:{name:"ContentEncAlgo",type:x.SectionType.Uint},2018:{name:"ContentEncKeyID",type:x.SectionType.Binary},2019:{name:"ContentSignature",type:x.SectionType.Binary},2020:{name:"ContentSigKeyID",type:x.SectionType.Binary},2021:{name:"ContentSigAlgo",type:x.SectionType.Uint},2022:{name:"ContentSigHashAlgo",type:x.SectionType.Uint},206814059:{name:"Cues",type:x.SectionType.Container},59:{name:"CuePoint",type:x.SectionType.Container},51:{name:"CueTime",type:x.SectionType.Uint},55:{name:"CueTrackPositions",type:x.SectionType.Container},119:{name:"CueTrack",type:x.SectionType.Uint},113:{name:"CueClusterPosition",type:x.SectionType.Uint},112:{name:"CueRelativePosition",type:x.SectionType.Uint},50:{name:"CueDuration",type:x.SectionType.Uint},4984:{name:"CueBlockNumber",type:x.SectionType.Uint},106:{name:"CueCodecState",type:x.SectionType.Uint},91:{name:"CueReference",type:x.SectionType.Container},22:{name:"CueRefTime",type:x.SectionType.Uint},23:{name:"CueRefCluster",type:x.SectionType.Uint},4959:{name:"CueRefNumber",type:x.SectionType.Uint},107:{name:"CueRefCodecState",type:x.SectionType.Uint},155296873:{name:"Attachments",type:x.SectionType.Container},8615:{name:"AttachedFile",type:x.SectionType.Container},1662:{name:"FileDescription",type:x.SectionType.String},1646:{name:"FileName",type:x.SectionType.String},1632:{name:"FileMimeType",type:x.SectionType.String},1628:{name:"FileData",type:x.SectionType.Binary},1710:{name:"FileUID",type:x.SectionType.Uint},1653:{name:"FileReferral",type:x.SectionType.Binary},1633:{name:"FileUsedStartTime",type:x.SectionType.Uint},1634:{name:"FileUsedEndTime",type:x.SectionType.Uint},4433776:{name:"Chapters",type:x.SectionType.Container},1465:{name:"EditionEntry",type:x.SectionType.Container},1468:{name:"EditionUID",type:x.SectionType.Uint},1469:{name:"EditionFlagHidden",type:x.SectionType.Uint},1499:{name:"EditionFlagDefault",type:x.SectionType.Uint},1501:{name:"EditionFlagOrdered",type:x.SectionType.Uint},54:{name:"ChapterAtom",type:x.SectionType.Container},13252:{name:"ChapterUID",type:x.SectionType.Uint},5716:{name:"ChapterStringUID",type:x.SectionType.String},17:{name:"ChapterTimeStart",type:x.SectionType.Uint},18:{name:"ChapterTimeEnd",type:x.SectionType.Uint},24:{name:"ChapterFlagHidden",type:x.SectionType.Uint},1432:{name:"ChapterFlagEnabled",type:x.SectionType.Uint},11879:{name:"ChapterSegmentUID",type:x.SectionType.Binary},11964:{name:"ChapterSegmentEditionUID",type:x.SectionType.Uint},9155:{name:"ChapterPhysicalEquiv",type:x.SectionType.Uint},15:{name:"ChapterTrack",type:x.SectionType.Container},9:{name:"ChapterTrackNumber",type:x.SectionType.Uint},0:{name:"ChapterDisplay",type:x.SectionType.Container},5:{name:"ChapString",type:x.SectionType.String},892:{name:"ChapLanguage",type:x.SectionType.String},894:{name:"ChapCountry",type:x.SectionType.String},10564:{name:"ChapProcess",type:x.SectionType.Container},10581:{name:"ChapProcessCodecID",type:x.SectionType.Uint},1293:{name:"ChapProcessPrivate",type:x.SectionType.Binary},10513:{name:"ChapProcessCommand",type:x.SectionType.Container},10530:{name:"ChapProcessTime",type:x.SectionType.Uint},10547:{name:"ChapProcessData",type:x.SectionType.Binary},39109479:{name:"Tags",type:x.SectionType.Container},13171:{name:"Tag",type:x.SectionType.Container},9152:{name:"Targets",type:x.SectionType.Container},10442:{name:"TargetTypeValue",type:x.SectionType.Uint},9162:{name:"TargetType",type:x.SectionType.String},9157:{name:"TagTrackUID",type:x.SectionType.Uint},9161:{name:"TagEditionUID",type:x.SectionType.Uint},9156:{name:"TagChapterUID",type:x.SectionType.Uint},9158:{name:"TagAttachmentUID",type:x.SectionType.Uint},10184:{name:"SimpleTag",type:x.SectionType.Container},1443:{name:"TagName",type:x.SectionType.String},1146:{name:"TagLanguage",type:x.SectionType.String},1156:{name:"TagDefault",type:x.SectionType.Uint},1159:{name:"TagString",type:x.SectionType.String},1157:{name:"TagBinary",type:x.SectionType.Binary},5552:{name:"Colour",type:x.SectionType.Container},5553:{name:"MatrixCoefficients",type:x.SectionType.Uint},5554:{name:"BitsPerChannel",type:x.SectionType.Uint},5555:{name:"ChromaSubsamplingHorz",type:x.SectionType.Uint},5556:{name:"ChromaSubsamplingVert",type:x.SectionType.Uint},5557:{name:"CbSubsamplingHorz",type:x.SectionType.Uint},5558:{name:"CbSubsamplingVert",type:x.SectionType.Uint},5559:{name:"ChromaSitingHorz",type:x.SectionType.Uint},5560:{name:"ChromaSitingVert",type:x.SectionType.Uint},5561:{name:"Range",type:x.SectionType.Uint},5562:{name:"TransferCharacteristics",type:x.SectionType.Uint},5563:{name:"Primaries",type:x.SectionType.Uint},5564:{name:"MaxCLL",type:x.SectionType.Uint},5565:{name:"MaxFALL",type:x.SectionType.Uint}};});var md=et(Vl=>{Object.defineProperty(Vl,"__esModule",{value:true});Vl.WebmUint=void 0;var OA=di();function pw(e){return e.length%2===1?"0"+e:e}var pd=class extends OA.WebmBase{constructor(t,r=0){super(t,r);}getType(){return "Uint"}updateBySource(){this.data="";for(let t=0;t<this.source.length;t++){let r=this.source[t].toString(16);this.data+=pw(r);}}updateByData(){let t=this.data.length/2;this.source=new Uint8Array(t);for(let r=0;r<t;r++){let n=this.data.substring(r*2,r*2+2);this.source[r]=parseInt(n,16);}}getValue(){return parseInt(this.data,16)}setValue(t){this.setData(pw(t.toString(16)));}};Vl.WebmUint=pd;});var hd=et(zl=>{Object.defineProperty(zl,"__esModule",{value:true});zl.WebmFloat=void 0;var RA=di(),gd=class extends RA.WebmBase{constructor(t,r=0){super(t,r);}getType(){return "Float"}getFloatArrayType(){return this.source&&this.source.length===4?Float32Array:Float64Array}updateBySource(){let t=this.source.reverse(),r=this.getFloatArrayType(),n=new r(t.buffer);this.data=n[0];}updateByData(){let t=this.getFloatArrayType(),r=new t([this.data]),n=new Uint8Array(r.buffer);this.source=n.reverse();}};zl.WebmFloat=gd;});var yd=et(Gl=>{Object.defineProperty(Gl,"__esModule",{value:true});Gl.WebmString=void 0;var DA=di(),bd=class extends DA.WebmBase{constructor(t,r=0){super(t,r);}getType(){return "String"}updateBySource(){this.data=this.source;}updateByData(){this.source=this.data;}getValue(){let t="";return this.source.forEach(r=>{t+=String.fromCharCode(r);}),t}};Gl.WebmString=bd;});var xd=et(Yl=>{Object.defineProperty(Yl,"__esModule",{value:true});Yl.WebmContainer=void 0;var mw=di(),MA=fd(),ql=Hl(),$A=md(),LA=hd(),NA=yd(),vd=class e extends mw.WebmBase{constructor(t,r=false,n=0){super(t,n),this.isInfinite=r,this.offset=0;}getType(){return "Container"}readByte(){return this.source[this.offset++]}readUint(){let t=this.readByte(),r=8-t.toString(2).length,n=t-(1<<7-r);for(let o=0;o<r;o++)n<<=8,n|=this.readByte();return n}updateBySource(){var t;this.data=[];let r;for(this.offset=0;this.offset<this.source.length;this.offset=r){let n=this.offset,o=this.readUint(),{name:i,type:a}=(t=MA.sections[o])!==null&&t!==void 0?t:{},s=this.readUint();r=this.source.length,s>=0&&(r=Math.min(this.offset+s,r));let l=this.source.slice(this.offset,r),c;switch(a){case ql.SectionType.Container:c=new e(i,s<0,n);break;case ql.SectionType.Uint:c=new $A.WebmUint(i,n);break;case ql.SectionType.Float:c=new LA.WebmFloat(i,n);break;case ql.SectionType.String:c=new NA.WebmString(i,n);break;default:c=new mw.WebmBase(i,n);break}c.setSource(l),this.data.push({id:o,idHex:o.toString(16),data:c});}}writeUint(t,r=false){let n;for(n=1;(t<0||t>=1<<7*n)&&n<8;n++);if(!r){for(let o=0;o<n;o++)this.source[this.offset+o]=t>>8*(n-1-o)&255;this.source[this.offset]&=(1<<8-n)-1,this.source[this.offset]|=1<<8-n;}this.offset+=n;}writeSections(t=false){this.offset=0;for(let r=0;r<this.data.length;r++){let n=this.data[r],o=n.data.source,i=o.length;this.writeUint(n.id,t),this.writeUint(n.data instanceof e&&n.data.isInfinite?-1:i,t),t||this.source.set(o,this.offset),this.offset+=i;}return this.offset}updateByData(){let t=this.writeSections(true);this.source=new Uint8Array(t),this.writeSections();}getSectionById(t){for(let r=0;r<this.data.length;r++){let n=this.data[r];if(n.id===t)return n.data}return null}};Yl.WebmContainer=vd;});var gw=et(Kl=>{Object.defineProperty(Kl,"__esModule",{value:true});Kl.WebmFile=void 0;var BA=(ja(),ns(Ua)),FA=xd(),wd=class e extends FA.WebmContainer{constructor(t){super("File"),this.setSource(t);}getType(){return "File"}toBlob(t="video/webm"){return new Blob([this.source.buffer],{type:t})}static blobToArray(t){return new Promise((r,n)=>{try{let o=new FileReader;o.onloadend=()=>{try{r(new Uint8Array(o.result));}catch(i){n(i);}},o.readAsArrayBuffer(t);}catch(o){n(o);}})}static fromBlob(t){return BA.__awaiter(this,void 0,void 0,function*(){let r=yield e.blobToArray(t);return new e(r)})}};Kl.WebmFile=wd;});var bw=et(hw=>{Object.defineProperty(hw,"__esModule",{value:true});});var Td=et(Cr=>{Object.defineProperty(Cr,"__esModule",{value:true});var nn=(ja(),ns(Ua));nn.__exportStar(di(),Cr);nn.__exportStar(xd(),Cr);nn.__exportStar(gw(),Cr);nn.__exportStar(hd(),Cr);nn.__exportStar(yd(),Cr);nn.__exportStar(md(),Cr);nn.__exportStar(Hl(),Cr);nn.__exportStar(bw(),Cr);nn.__exportStar(fd(),Cr);});var _d=et(Xl=>{Object.defineProperty(Xl,"__esModule",{value:true});Xl.fixParsedWebmDuration=void 0;var UA=Td(),jA=(e,t,r={})=>{let n=r.logger;n===void 0?n=l=>{}:n||(n=()=>{});let o=e.getSectionById(139690087);if(!o)return n("[fix-webm-duration] Segment section is missing"),false;let i=o.getSectionById(88713574);if(!i)return n("[fix-webm-duration] Info section is missing"),false;let a=i.getSectionById(710577);if(!a)return n("[fix-webm-duration] TimecodeScale section is missing"),false;let s=i.getSectionById(1161);if(s)if(s.getValue()<=0)n(`[fix-webm-duration] Duration section is present, but the value is ${s.getValue()}`),s.setValue(t);else return n(`[fix-webm-duration] Duration section is present, and the value is ${s.getValue()}`),false;else n("[fix-webm-duration] Duration section is missing"),s=new UA.WebmFloat("Duration"),s.setValue(t),i.data.push({id:1161,data:s});return a.setValue(1e6),i.updateByData(),o.updateByData(),e.updateByData(),true};Xl.fixParsedWebmDuration=jA;});var yw=et(Zl=>{Object.defineProperty(Zl,"__esModule",{value:true});Zl.fixWebmDuration=void 0;var HA=(ja(),ns(Ua)),WA=Td(),VA=_d(),zA=(e,t,r)=>HA.__awaiter(void 0,void 0,void 0,function*(){try{let n=yield WA.WebmFile.fromBlob(e);if((0,VA.fixParsedWebmDuration)(n,t,r))return n.toBlob(e.type)}catch{}return e});Zl.fixWebmDuration=zA;});var xw=et(Ql=>{Object.defineProperty(Ql,"__esModule",{value:true});var vw=(ja(),ns(Ua));vw.__exportStar(yw(),Ql);vw.__exportStar(_d(),Ql);});var Kw=et((Dd,Md)=>{(function(e,t){typeof Dd=="object"&&typeof Md<"u"?Md.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.DOMPurify=t());})(Dd,function(){let{entries:e,setPrototypeOf:t,isFrozen:r,getPrototypeOf:n,getOwnPropertyDescriptor:o}=Object,{freeze:i,seal:a,create:s}=Object,{apply:l,construct:c}=typeof Reflect<"u"&&Reflect;i||(i=function(he){return he}),a||(a=function(he){return he}),l||(l=function(he,Ve,je){return he.apply(Ve,je)}),c||(c=function(he,Ve){return new he(...Ve)});let u=D(Array.prototype.forEach),d=D(Array.prototype.pop),f=D(Array.prototype.push),p=D(String.prototype.toLowerCase),g=D(String.prototype.toString),h=D(String.prototype.match),b=D(String.prototype.replace),y=D(String.prototype.indexOf),S=D(String.prototype.trim),C=D(RegExp.prototype.test),k=U(TypeError);function D(Le){return function(he){for(var Ve=arguments.length,je=new Array(Ve>1?Ve-1:0),At=1;At<Ve;At++)je[At-1]=arguments[At];return l(Le,he,je)}}function U(Le){return function(){for(var he=arguments.length,Ve=new Array(he),je=0;je<he;je++)Ve[je]=arguments[je];return c(Le,Ve)}}function N(Le,he){let Ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p;t&&t(Le,null);let je=he.length;for(;je--;){let At=he[je];if(typeof At=="string"){let sn=Ve(At);sn!==At&&(r(he)||(he[je]=sn),At=sn);}Le[At]=true;}return Le}function ie(Le){let he=s(null);for(let[Ve,je]of e(Le))o(Le,Ve)!==void 0&&(he[Ve]=je);return he}function I(Le,he){for(;Le!==null;){let je=o(Le,he);if(je){if(je.get)return D(je.get);if(typeof je.value=="function")return D(je.value)}Le=n(Le);}function Ve(je){return null}return Ve}let A=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),R=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),E=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),_=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),T=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),O=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),L=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),ne=i(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),K=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ie=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ce=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),nt=a(/<%[\w\W]*|[\w\W]*%>/gm),Lt=a(/\${[\w\W]*}/gm),ft=a(/^data-[\-\w.\u00B7-\uFFFF]/),Nt=a(/^aria-[\-\w]+$/),Kt=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Bt=a(/^(?:\w+script|data):/i),Ye=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$e=a(/^html$/i);var It=Object.freeze({__proto__:null,MUSTACHE_EXPR:Ce,ERB_EXPR:nt,TMPLIT_EXPR:Lt,DATA_ATTR:ft,ARIA_ATTR:Nt,IS_ALLOWED_URI:Kt,IS_SCRIPT_OR_DATA:Bt,ATTR_WHITESPACE:Ye,DOCTYPE_NAME:$e});let po=function(){return typeof window>"u"?null:window},Ya=function(he,Ve){if(typeof he!="object"||typeof he.createPolicy!="function")return null;let je=null,At="data-tt-policy-suffix";Ve&&Ve.hasAttribute(At)&&(je=Ve.getAttribute(At));let sn="dompurify"+(je?"#"+je:"");try{return he.createPolicy(sn,{createHTML(mo){return mo},createScriptURL(mo){return mo}})}catch{return null}};function bi(){let Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:po(),he=ue=>bi(ue);if(he.version="3.0.6",he.removed=[],!Le||!Le.document||Le.document.nodeType!==9)return he.isSupported=false,he;let{document:Ve}=Le,je=Ve,At=je.currentScript,{DocumentFragment:sn,HTMLTemplateElement:mo,Node:ic,Element:Hd,NodeFilter:ac,NamedNodeMap:L0=Le.NamedNodeMap||Le.MozNamedAttrMap,HTMLFormElement:N0,DOMParser:B0,trustedTypes:Ka}=Le,Xa=Hd.prototype,F0=I(Xa,"cloneNode"),U0=I(Xa,"nextSibling"),j0=I(Xa,"childNodes"),sc=I(Xa,"parentNode");if(typeof mo=="function"){let ue=Ve.createElement("template");ue.content&&ue.content.ownerDocument&&(Ve=ue.content.ownerDocument);}let Ot,vi="",{implementation:lc,createNodeIterator:H0,createDocumentFragment:W0,getElementsByTagName:V0}=Ve,{importNode:z0}=je,kr={};he.isSupported=typeof e=="function"&&typeof sc=="function"&&lc&&lc.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:cc,ERB_EXPR:uc,TMPLIT_EXPR:dc,DATA_ATTR:G0,ARIA_ATTR:q0,IS_SCRIPT_OR_DATA:Y0,ATTR_WHITESPACE:Wd}=It,{IS_ALLOWED_URI:Vd}=It,gt=null,zd=N({},[...A,...R,...E,...T,...L]),ht=null,Gd=N({},[...z,...ne,...K,...Ie]),at=Object.seal(s(null,{tagNameCheck:{writable:true,configurable:false,enumerable:true,value:null},attributeNameCheck:{writable:true,configurable:false,enumerable:true,value:null},allowCustomizedBuiltInElements:{writable:true,configurable:false,enumerable:true,value:false}})),xi=null,fc=null,qd=true,pc=true,Yd=false,Kd=true,go=false,kn=false,mc=false,gc=false,ho=false,Za=false,Qa=false,Xd=true,Zd=false,K0="user-content-",hc=true,wi=false,bo={},yo=null,Qd=N({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Jd=null,ef=N({},["audio","video","img","source","image","track"]),bc=null,tf=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ja="http://www.w3.org/1998/Math/MathML",es="http://www.w3.org/2000/svg",jr="http://www.w3.org/1999/xhtml",vo=jr,yc=false,vc=null,X0=N({},[Ja,es,jr],g),Pn=null,Z0=["application/xhtml+xml","text/html"],Q0="text/html",bt=null,xo=null,J0=Ve.createElement("form"),rf=function(P){return P instanceof RegExp||P instanceof Function},xc=function(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(xo&&xo===P)){if((!P||typeof P!="object")&&(P={}),P=ie(P),Pn=Z0.indexOf(P.PARSER_MEDIA_TYPE)===-1?Pn=Q0:Pn=P.PARSER_MEDIA_TYPE,bt=Pn==="application/xhtml+xml"?g:p,gt="ALLOWED_TAGS"in P?N({},P.ALLOWED_TAGS,bt):zd,ht="ALLOWED_ATTR"in P?N({},P.ALLOWED_ATTR,bt):Gd,vc="ALLOWED_NAMESPACES"in P?N({},P.ALLOWED_NAMESPACES,g):X0,bc="ADD_URI_SAFE_ATTR"in P?N(ie(tf),P.ADD_URI_SAFE_ATTR,bt):tf,Jd="ADD_DATA_URI_TAGS"in P?N(ie(ef),P.ADD_DATA_URI_TAGS,bt):ef,yo="FORBID_CONTENTS"in P?N({},P.FORBID_CONTENTS,bt):Qd,xi="FORBID_TAGS"in P?N({},P.FORBID_TAGS,bt):{},fc="FORBID_ATTR"in P?N({},P.FORBID_ATTR,bt):{},bo="USE_PROFILES"in P?P.USE_PROFILES:false,qd=P.ALLOW_ARIA_ATTR!==false,pc=P.ALLOW_DATA_ATTR!==false,Yd=P.ALLOW_UNKNOWN_PROTOCOLS||false,Kd=P.ALLOW_SELF_CLOSE_IN_ATTR!==false,go=P.SAFE_FOR_TEMPLATES||false,kn=P.WHOLE_DOCUMENT||false,ho=P.RETURN_DOM||false,Za=P.RETURN_DOM_FRAGMENT||false,Qa=P.RETURN_TRUSTED_TYPE||false,gc=P.FORCE_BODY||false,Xd=P.SANITIZE_DOM!==false,Zd=P.SANITIZE_NAMED_PROPS||false,hc=P.KEEP_CONTENT!==false,wi=P.IN_PLACE||false,Vd=P.ALLOWED_URI_REGEXP||Kt,vo=P.NAMESPACE||jr,at=P.CUSTOM_ELEMENT_HANDLING||{},P.CUSTOM_ELEMENT_HANDLING&&rf(P.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(at.tagNameCheck=P.CUSTOM_ELEMENT_HANDLING.tagNameCheck),P.CUSTOM_ELEMENT_HANDLING&&rf(P.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(at.attributeNameCheck=P.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),P.CUSTOM_ELEMENT_HANDLING&&typeof P.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(at.allowCustomizedBuiltInElements=P.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),go&&(pc=false),Za&&(ho=true),bo&&(gt=N({},[...L]),ht=[],bo.html===true&&(N(gt,A),N(ht,z)),bo.svg===true&&(N(gt,R),N(ht,ne),N(ht,Ie)),bo.svgFilters===true&&(N(gt,E),N(ht,ne),N(ht,Ie)),bo.mathMl===true&&(N(gt,T),N(ht,K),N(ht,Ie))),P.ADD_TAGS&&(gt===zd&&(gt=ie(gt)),N(gt,P.ADD_TAGS,bt)),P.ADD_ATTR&&(ht===Gd&&(ht=ie(ht)),N(ht,P.ADD_ATTR,bt)),P.ADD_URI_SAFE_ATTR&&N(bc,P.ADD_URI_SAFE_ATTR,bt),P.FORBID_CONTENTS&&(yo===Qd&&(yo=ie(yo)),N(yo,P.FORBID_CONTENTS,bt)),hc&&(gt["#text"]=true),kn&&N(gt,["html","head","body"]),gt.table&&(N(gt,["tbody"]),delete xi.tbody),P.TRUSTED_TYPES_POLICY){if(typeof P.TRUSTED_TYPES_POLICY.createHTML!="function")throw k('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof P.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw k('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Ot=P.TRUSTED_TYPES_POLICY,vi=Ot.createHTML("");}else Ot===void 0&&(Ot=Ya(Ka,At)),Ot!==null&&typeof vi=="string"&&(vi=Ot.createHTML(""));i&&i(P),xo=P;}},nf=N({},["mi","mo","mn","ms","mtext"]),of=N({},["foreignobject","desc","title","annotation-xml"]),eT=N({},["title","style","font","a","script"]),ts=N({},R);N(ts,E),N(ts,_);let wc=N({},T);N(wc,O);let tT=function(P){let V=sc(P);(!V||!V.tagName)&&(V={namespaceURI:vo,tagName:"template"});let ae=p(P.tagName),Ke=p(V.tagName);return vc[P.namespaceURI]?P.namespaceURI===es?V.namespaceURI===jr?ae==="svg":V.namespaceURI===Ja?ae==="svg"&&(Ke==="annotation-xml"||nf[Ke]):!!ts[ae]:P.namespaceURI===Ja?V.namespaceURI===jr?ae==="math":V.namespaceURI===es?ae==="math"&&of[Ke]:!!wc[ae]:P.namespaceURI===jr?V.namespaceURI===es&&!of[Ke]||V.namespaceURI===Ja&&!nf[Ke]?false:!wc[ae]&&(eT[ae]||!ts[ae]):!!(Pn==="application/xhtml+xml"&&vc[P.namespaceURI]):false},En=function(P){f(he.removed,{element:P});try{P.parentNode.removeChild(P);}catch{P.remove();}},Tc=function(P,V){try{f(he.removed,{attribute:V.getAttributeNode(P),from:V});}catch{f(he.removed,{attribute:null,from:V});}if(V.removeAttribute(P),P==="is"&&!ht[P])if(ho||Za)try{En(V);}catch{}else try{V.setAttribute(P,"");}catch{}},af=function(P){let V=null,ae=null;if(gc)P="<remove></remove>"+P;else {let Ct=h(P,/^[\r\n\t ]+/);ae=Ct&&Ct[0];}Pn==="application/xhtml+xml"&&vo===jr&&(P='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+P+"</body></html>");let Ke=Ot?Ot.createHTML(P):P;if(vo===jr)try{V=new B0().parseFromString(Ke,Pn);}catch{}if(!V||!V.documentElement){V=lc.createDocument(vo,"template",null);try{V.documentElement.innerHTML=yc?vi:Ke;}catch{}}let _t=V.body||V.documentElement;return P&&ae&&_t.insertBefore(Ve.createTextNode(ae),_t.childNodes[0]||null),vo===jr?V0.call(V,kn?"html":"body")[0]:kn?V.documentElement:_t},sf=function(P){return H0.call(P.ownerDocument||P,P,ac.SHOW_ELEMENT|ac.SHOW_COMMENT|ac.SHOW_TEXT,null)},rT=function(P){return P instanceof N0&&(typeof P.nodeName!="string"||typeof P.textContent!="string"||typeof P.removeChild!="function"||!(P.attributes instanceof L0)||typeof P.removeAttribute!="function"||typeof P.setAttribute!="function"||typeof P.namespaceURI!="string"||typeof P.insertBefore!="function"||typeof P.hasChildNodes!="function")},lf=function(P){return typeof ic=="function"&&P instanceof ic},Hr=function(P,V,ae){kr[P]&&u(kr[P],Ke=>{Ke.call(he,V,ae,xo);});},cf=function(P){let V=null;if(Hr("beforeSanitizeElements",P,null),rT(P))return En(P),true;let ae=bt(P.nodeName);if(Hr("uponSanitizeElement",P,{tagName:ae,allowedTags:gt}),P.hasChildNodes()&&!lf(P.firstElementChild)&&C(/<[/\w]/g,P.innerHTML)&&C(/<[/\w]/g,P.textContent))return En(P),true;if(!gt[ae]||xi[ae]){if(!xi[ae]&&df(ae)&&(at.tagNameCheck instanceof RegExp&&C(at.tagNameCheck,ae)||at.tagNameCheck instanceof Function&&at.tagNameCheck(ae)))return false;if(hc&&!yo[ae]){let Ke=sc(P)||P.parentNode,_t=j0(P)||P.childNodes;if(_t&&Ke){let Ct=_t.length;for(let Ft=Ct-1;Ft>=0;--Ft)Ke.insertBefore(F0(_t[Ft],true),U0(P));}}return En(P),true}return P instanceof Hd&&!tT(P)||(ae==="noscript"||ae==="noembed"||ae==="noframes")&&C(/<\/no(script|embed|frames)/i,P.innerHTML)?(En(P),true):(go&&P.nodeType===3&&(V=P.textContent,u([cc,uc,dc],Ke=>{V=b(V,Ke," ");}),P.textContent!==V&&(f(he.removed,{element:P.cloneNode()}),P.textContent=V)),Hr("afterSanitizeElements",P,null),false)},uf=function(P,V,ae){if(Xd&&(V==="id"||V==="name")&&(ae in Ve||ae in J0))return false;if(!(pc&&!fc[V]&&C(G0,V))){if(!(qd&&C(q0,V))){if(!ht[V]||fc[V]){if(!(df(P)&&(at.tagNameCheck instanceof RegExp&&C(at.tagNameCheck,P)||at.tagNameCheck instanceof Function&&at.tagNameCheck(P))&&(at.attributeNameCheck instanceof RegExp&&C(at.attributeNameCheck,V)||at.attributeNameCheck instanceof Function&&at.attributeNameCheck(V))||V==="is"&&at.allowCustomizedBuiltInElements&&(at.tagNameCheck instanceof RegExp&&C(at.tagNameCheck,ae)||at.tagNameCheck instanceof Function&&at.tagNameCheck(ae))))return false}else if(!bc[V]){if(!C(Vd,b(ae,Wd,""))){if(!((V==="src"||V==="xlink:href"||V==="href")&&P!=="script"&&y(ae,"data:")===0&&Jd[P])){if(!(Yd&&!C(Y0,b(ae,Wd,"")))){if(ae)return false}}}}}}return true},df=function(P){return P.indexOf("-")>0},ff=function(P){Hr("beforeSanitizeAttributes",P,null);let{attributes:V}=P;if(!V)return;let ae={attrName:"",attrValue:"",keepAttr:true,allowedAttributes:ht},Ke=V.length;for(;Ke--;){let _t=V[Ke],{name:Ct,namespaceURI:Ft,value:In}=_t,Ti=bt(Ct),Ut=Ct==="value"?In:S(In);if(ae.attrName=Ti,ae.attrValue=Ut,ae.keepAttr=true,ae.forceKeepAttr=void 0,Hr("uponSanitizeAttribute",P,ae),Ut=ae.attrValue,ae.forceKeepAttr||(Tc(Ct,P),!ae.keepAttr))continue;if(!Kd&&C(/\/>/i,Ut)){Tc(Ct,P);continue}go&&u([cc,uc,dc],mf=>{Ut=b(Ut,mf," ");});let pf=bt(P.nodeName);if(uf(pf,Ti,Ut)){if(Zd&&(Ti==="id"||Ti==="name")&&(Tc(Ct,P),Ut=K0+Ut),Ot&&typeof Ka=="object"&&typeof Ka.getAttributeType=="function"&&!Ft)switch(Ka.getAttributeType(pf,Ti)){case "TrustedHTML":{Ut=Ot.createHTML(Ut);break}case "TrustedScriptURL":{Ut=Ot.createScriptURL(Ut);break}}try{Ft?P.setAttributeNS(Ft,Ct,Ut):P.setAttribute(Ct,Ut),d(he.removed);}catch{}}}Hr("afterSanitizeAttributes",P,null);},nT=function ue(P){let V=null,ae=sf(P);for(Hr("beforeSanitizeShadowDOM",P,null);V=ae.nextNode();)Hr("uponSanitizeShadowNode",V,null),!cf(V)&&(V.content instanceof sn&&ue(V.content),ff(V));Hr("afterSanitizeShadowDOM",P,null);};return he.sanitize=function(ue){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},V=null,ae=null,Ke=null,_t=null;if(yc=!ue,yc&&(ue="<!-->"),typeof ue!="string"&&!lf(ue))if(typeof ue.toString=="function"){if(ue=ue.toString(),typeof ue!="string")throw k("dirty is not a string, aborting")}else throw k("toString is not a function");if(!he.isSupported)return ue;if(mc||xc(P),he.removed=[],typeof ue=="string"&&(wi=false),wi){if(ue.nodeName){let In=bt(ue.nodeName);if(!gt[In]||xi[In])throw k("root node is forbidden and cannot be sanitized in-place")}}else if(ue instanceof ic)V=af("<!---->"),ae=V.ownerDocument.importNode(ue,true),ae.nodeType===1&&ae.nodeName==="BODY"||ae.nodeName==="HTML"?V=ae:V.appendChild(ae);else {if(!ho&&!go&&!kn&&ue.indexOf("<")===-1)return Ot&&Qa?Ot.createHTML(ue):ue;if(V=af(ue),!V)return ho?null:Qa?vi:""}V&&gc&&En(V.firstChild);let Ct=sf(wi?ue:V);for(;Ke=Ct.nextNode();)cf(Ke)||(Ke.content instanceof sn&&nT(Ke.content),ff(Ke));if(wi)return ue;if(ho){if(Za)for(_t=W0.call(V.ownerDocument);V.firstChild;)_t.appendChild(V.firstChild);else _t=V;return (ht.shadowroot||ht.shadowrootmode)&&(_t=z0.call(je,_t,true)),_t}let Ft=kn?V.outerHTML:V.innerHTML;return kn&&gt["!doctype"]&&V.ownerDocument&&V.ownerDocument.doctype&&V.ownerDocument.doctype.name&&C($e,V.ownerDocument.doctype.name)&&(Ft="<!DOCTYPE "+V.ownerDocument.doctype.name+`>
10
- `+Ft),go&&u([cc,uc,dc],In=>{Ft=b(Ft,In," ");}),Ot&&Qa?Ot.createHTML(Ft):Ft},he.setConfig=function(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xc(ue),mc=true;},he.clearConfig=function(){xo=null,mc=false;},he.isValidAttribute=function(ue,P,V){xo||xc({});let ae=bt(ue),Ke=bt(P);return uf(ae,Ke,V)},he.addHook=function(ue,P){typeof P=="function"&&(kr[ue]=kr[ue]||[],f(kr[ue],P));},he.removeHook=function(ue){if(kr[ue])return d(kr[ue])},he.removeHooks=function(ue){kr[ue]&&(kr[ue]=[]);},he.removeAllHooks=function(){kr={};},he}var yi=bi();return yi});});function dT(e){return Object.keys(e).reduce((r,n)=>{let o=e[n];return r[n]=Object.assign({},o),yf(o.value)&&!hT(o.value)&&!Array.isArray(o.value)&&(r[n].value=Object.assign({},o.value)),Array.isArray(o.value)&&(r[n].value=o.value.slice(0)),r},{})}function fT(e){return e?Object.keys(e).reduce((r,n)=>{let o=e[n];return r[n]=yf(o)&&"value"in o?o:{value:o},r[n].attribute||(r[n].attribute=gT(n)),r[n].parse="parse"in r[n]?r[n].parse:typeof r[n].value!="string",r},{}):{}}function pT(e){return Object.keys(e).reduce((r,n)=>(r[n]=e[n].value,r),{})}function mT(e,t){let r=dT(t);return Object.keys(t).forEach(o=>{let i=r[o],a=e.getAttribute(i.attribute),s=e[o];a!=null&&(i.value=i.parse?bf(a):a),s!=null&&(i.value=Array.isArray(s)?s.slice(0):s),i.reflect&&hf(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(l){let c=i.value;i.value=l,i.reflect&&hf(this,i.attribute,i.value,!!i.parse);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](o,l,c);},enumerable:true,configurable:true});}),r}function bf(e){if(e)try{return JSON.parse(e)}catch{return e}}function hf(e,t,r,n){if(r==null||r===false)return e.removeAttribute(t);let o=n?JSON.stringify(r):r;e.__updating[t]=true,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t]);}function gT(e){return e.replace(/\.?([A-Z]+)/g,(t,r)=>"-"+r.toLowerCase()).replace("_","-").replace(/^-/,"")}function yf(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function hT(e){return Object.prototype.toString.call(e)==="[object Function]"}function bT(e){return typeof e=="function"&&e.toString().indexOf("class")===0}var _c;function yT(e,t){let r=Object.keys(t);return class extends e{static get observedAttributes(){return r.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=false,this.__released=false,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={};}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=mT(this,t);let o=pT(this.props),i=this.Component,a=_c;try{_c=this,this.__initialized=!0,bT(i)?new i(o,{element:this}):i(o,{element:this});}finally{_c=a;}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=true;}attributeChangedCallback(o,i,a){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(a==null&&!this[o])return;this[o]=t[o].parse?bf(a):a;}}lookupProp(o){if(t)return r.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o);}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o);}}}function vf(e,t={},r={}){let{BaseElement:n=HTMLElement,extension:o,customElements:i=window.customElements}=r;return a=>{if(!e)throw new Error("tag is required to register a Component");let s=i.get(e);return s?(s.prototype.Component=a,s):(s=yT(n,fT(t)),s.prototype.Component=a,s.prototype.registeredTag=e,i.define(e,s,o),s)}}var xT=(e,t)=>e===t,Xt=Symbol("solid-proxy"),kf=typeof Proxy=="function",ss=Symbol("solid-track"),is={equals:xT},Pf=Mf,Zt=1,_i=2,Ef={owned:null,cleanups:null,context:null,owner:null};var Pe=null,q=null,To=null,ze=null,pt=null,St=null,ls=0;function An(e,t){let r=ze,n=Pe,o=e.length===0,i=t===void 0?n:t,a=o?Ef:{owned:null,cleanups:null,context:i?i.context:null,owner:i},s=o?e:()=>e(()=>ct(()=>ln(a)));Pe=a,ze=null;try{return fr(s,!0)}finally{ze=r,Pe=n;}}function M(e,t){t=t?Object.assign({},is,t):is;let r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=o=>(typeof o=="function"&&(o=o(r.value)),Df(r,o));return [Rf.bind(r),n]}function $(e,t,r){let n=Ac(e,t,false,Zt);ki(n);}function Se(e,t,r){Pf=CT;let n=Ac(e,t,false,Zt);(!r||!r.render)&&(n.user=true),St?St.push(n):ki(n);}function B(e,t,r){r=r?Object.assign({},is,r):is;let n=Ac(e,t,true,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,ki(n),Rf.bind(n)}function If(e){return fr(e,false)}function ct(e){if(ze===null)return e();let t=ze;ze=null;try{return To?To.untrack(e):e()}finally{ze=t;}}function ce(e){Se(()=>ct(e));}function me(e){return Pe===null||(Pe.cleanups===null?Pe.cleanups=[e]:Pe.cleanups.push(e)),e}function cs(){return ze}function _o(){return Pe}function Af(e,t){let r=Pe,n=ze;Pe=e,ze=null;try{return fr(t,!0)}catch(o){ds(o);}finally{Pe=r,ze=n;}}var[CD,Tf]=M(false);function Of(e,t){let r=Symbol("context");return {id:r,Provider:kT(r),defaultValue:e}}function Ic(e){let t;return Pe&&Pe.context&&(t=Pe.context[e.id])!==void 0?t:e.defaultValue}function us(e){let t=B(e),r=B(()=>Pc(t()));return r.toArray=()=>{let n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}function Rf(){let e=q;if(this.sources&&(this.state))if((this.state)===Zt)ki(this);else {let t=pt;pt=null,fr(()=>as(this),false),pt=t;}if(ze){let t=this.observers?this.observers.length:0;ze.sources?(ze.sources.push(this),ze.sourceSlots.push(t)):(ze.sources=[this],ze.sourceSlots=[t]),this.observers?(this.observers.push(ze),this.observerSlots.push(ze.sources.length-1)):(this.observers=[ze],this.observerSlots=[ze.sources.length-1]);}return e&&q.sources.has(this)?this.tValue:this.value}function Df(e,t,r){let n=e.value;if(!e.comparator||!e.comparator(n,t)){e.value=t;e.observers&&e.observers.length&&fr(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],a=q&&q.running;a&&q.disposed.has(i)||((a?!i.tState:!i.state)&&(i.pure?pt.push(i):St.push(i),i.observers&&$f(i)),a?i.tState=Zt:i.state=Zt);}if(pt.length>1e6)throw pt=[],new Error},false);}return t}function ki(e){if(!e.fn)return;ln(e);let t=ls;_f(e,e.value,t);}function _f(e,t,r){let n,o=Pe,i=ze;ze=Pe=e;try{n=e.fn(t);}catch(a){return e.pure&&((e.state=Zt,e.owned&&e.owned.forEach(ln),e.owned=null)),e.updatedAt=r+1,ds(a)}finally{ze=i,Pe=o;}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?Df(e,n):e.value=n,e.updatedAt=r);}function Ac(e,t,r,n=Zt,o){let i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Pe,context:Pe?Pe.context:null,pure:r};if(Pe===null||Pe!==Ef&&(Pe.owned?Pe.owned.push(i):Pe.owned=[i]),To);return i}function Ci(e){let t=q;if((e.state)===0)return;if((e.state)===_i)return as(e);if(e.suspense&&ct(e.suspense.inFallback))return e.suspense.effects.push(e);let r=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ls);){(e.state)&&r.push(e);}for(let n=r.length-1;n>=0;n--){if(e=r[n],t);if((e.state)===Zt)ki(e);else if((e.state)===_i){let o=pt;pt=null,fr(()=>as(e,r[0]),false),pt=o;}}}function fr(e,t){if(pt)return e();let r=false;t||(pt=[]),St?r=true:St=[],ls++;try{let n=e();return TT(r),n}catch(n){r||(St=null),pt=null,ds(n);}}function TT(e){if(pt&&(Mf(pt),pt=null),e)return;let r=St;St=null,r.length&&fr(()=>Pf(r),false);}function Mf(e){for(let t=0;t<e.length;t++)Ci(e[t]);}function CT(e){let t,r=0;for(t=0;t<e.length;t++){let n=e[t];n.user?e[r++]=n:Ci(n);}for(t=0;t<r;t++)Ci(e[t]);}function as(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){let o=e.sources[n];if(o.sources){let i=o.state;i===Zt?o!==t&&(!o.updatedAt||o.updatedAt<ls)&&Ci(o):i===_i&&as(o,t);}}}function $f(e){for(let r=0;r<e.observers.length;r+=1){let n=e.observers[r];(!n.state)&&(n.state=_i,n.pure?pt.push(n):St.push(n),n.observers&&$f(n));}}function ln(e){let t;if(e.sources)for(;e.sources.length;){let r=e.sources.pop(),n=e.sourceSlots.pop(),o=r.observers;if(o&&o.length){let i=o.pop(),a=r.observerSlots.pop();n<o.length&&(i.sourceSlots[a]=n,o[n]=i,r.observerSlots[n]=a);}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)ln(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)ln(e.owned[t]);e.owned=null;}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null;}e.state=0;}function ST(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function ds(e,t=Pe){let n=ST(e);throw n;}function Pc(e){if(typeof e=="function"&&!e.length)return Pc(e());if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++){let n=Pc(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n);}return t}return e}function kT(e,t){return function(n){let o;return $(()=>o=ct(()=>(Pe.context={...Pe.context,[e]:n.value},us(()=>n.children))),void 0),o}}var PT=Symbol("fallback");function Sf(e){for(let t=0;t<e.length;t++)e[t]();}function ET(e,t,r={}){let n=[],o=[],i=[],a=0,s=t.length>1?[]:null;return me(()=>Sf(i)),()=>{let l=e()||[],c=l.length,u,d;return l[ss],ct(()=>{let p,g,h,b,y,S,C,k,D;if(c===0)a!==0&&(Sf(i),i=[],n=[],o=[],a=0,s&&(s=[])),r.fallback&&(n=[PT],o[0]=An(U=>(i[0]=U,r.fallback())),a=1);else if(a===0){for(o=new Array(c),d=0;d<c;d++)n[d]=l[d],o[d]=An(f);a=c;}else {for(h=new Array(c),b=new Array(c),s&&(y=new Array(c)),S=0,C=Math.min(a,c);S<C&&n[S]===l[S];S++);for(C=a-1,k=c-1;C>=S&&k>=S&&n[C]===l[k];C--,k--)h[k]=o[C],b[k]=i[C],s&&(y[k]=s[C]);for(p=new Map,g=new Array(k+1),d=k;d>=S;d--)D=l[d],u=p.get(D),g[d]=u===void 0?-1:u,p.set(D,d);for(u=S;u<=C;u++)D=n[u],d=p.get(D),d!==void 0&&d!==-1?(h[d]=o[u],b[d]=i[u],s&&(y[d]=s[u]),d=g[d],p.set(D,d)):i[u]();for(d=S;d<c;d++)d in h?(o[d]=h[d],i[d]=b[d],s&&(s[d]=y[d],s[d](d))):o[d]=An(f);o=o.slice(0,a=c),n=l.slice(0);}return o});function f(p){if(i[d]=p,s){let[g,h]=M(d);return s[d]=h,t(l[d],g)}return t(l[d])}}}function m(e,t){return ct(()=>e(t||{}))}function os(){return true}var Ec={get(e,t,r){return t===Xt?r:e.get(t)},has(e,t){return t===Xt?true:e.has(t)},set:os,deleteProperty:os,getOwnPropertyDescriptor(e,t){return {configurable:true,enumerable:true,get(){return e.get(t)},set:os,deleteProperty:os}},ownKeys(e){return e.keys()}};function Cc(e){return (e=typeof e=="function"?e():e)?e:{}}function AT(){for(let e=0,t=this.length;e<t;++e){let r=this[e]();if(r!==void 0)return r}}function Re(...e){let t=false;for(let a=0;a<e.length;a++){let s=e[a];t=t||!!s&&Xt in s,e[a]=typeof s=="function"?(t=true,B(s)):s;}if(kf&&t)return new Proxy({get(a){for(let s=e.length-1;s>=0;s--){let l=Cc(e[s])[a];if(l!==void 0)return l}},has(a){for(let s=e.length-1;s>=0;s--)if(a in Cc(e[s]))return true;return false},keys(){let a=[];for(let s=0;s<e.length;s++)a.push(...Object.keys(Cc(e[s])));return [...new Set(a)]}},Ec);let r={},n=Object.create(null);for(let a=e.length-1;a>=0;a--){let s=e[a];if(!s)continue;let l=Object.getOwnPropertyNames(s);for(let c=l.length-1;c>=0;c--){let u=l[c];if(u==="__proto__"||u==="constructor")continue;let d=Object.getOwnPropertyDescriptor(s,u);if(!n[u])n[u]=d.get?{enumerable:true,configurable:true,get:AT.bind(r[u]=[d.get.bind(s)])}:d.value!==void 0?d:void 0;else {let f=r[u];f&&(d.get?f.push(d.get.bind(s)):d.value!==void 0&&f.push(()=>d.value));}}}let o={},i=Object.keys(n);for(let a=i.length-1;a>=0;a--){let s=i[a],l=n[s];l&&l.get?Object.defineProperty(o,s,l):o[s]=l?l.value:void 0;}return o}function rt(e,...t){if(kf&&Xt in e){let o=new Set(t.length>1?t.flat():t[0]),i=t.map(a=>new Proxy({get(s){return a.includes(s)?e[s]:void 0},has(s){return a.includes(s)&&s in e},keys(){return a.filter(s=>s in e)}},Ec));return i.push(new Proxy({get(a){return o.has(a)?void 0:e[a]},has(a){return o.has(a)?false:a in e},keys(){return Object.keys(e).filter(a=>!o.has(a))}},Ec)),i}let r={},n=t.map(()=>({}));for(let o of Object.getOwnPropertyNames(e)){let i=Object.getOwnPropertyDescriptor(e,o),a=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable,s=false,l=0;for(let c of t)c.includes(o)&&(s=true,a?n[l][o]=i.value:Object.defineProperty(n[l],o,i)),++l;s||(a?r[o]=i.value:Object.defineProperty(r,o,i));}return [...n,r]}var OT=0;function Pr(){return `cl-${OT++}`}var Nf=e=>`Stale read from <${e}>.`;function ke(e){let t="fallback"in e&&{fallback:()=>e.fallback};return B(ET(()=>e.each,e.children,t||void 0))}function W(e){let t=e.keyed,r=B(()=>e.when,void 0,{equals:(n,o)=>t?n===o:!n==!o});return B(()=>{let n=r();if(n){let o=e.children;return typeof o=="function"&&o.length>0?ct(()=>o(t?n:()=>{if(!ct(r))throw Nf("Show");return e.when})):o}return e.fallback},void 0,void 0)}function He(e){let t=false,r=(i,a)=>(t?i[1]===a[1]:!i[1]==!a[1])&&i[2]===a[2],n=us(()=>e.children),o=B(()=>{let i=n();Array.isArray(i)||(i=[i]);for(let a=0;a<i.length;a++){let s=i[a].when;if(s)return t=!!i[a].keyed,[a,s,i[a]]}return [-1]},void 0,{equals:r});return B(()=>{let[i,a,s]=o();if(i<0)return e.fallback;let l=s.children;return typeof l=="function"&&l.length>0?ct(()=>l(t?a:()=>{if(ct(o)[0]!==i)throw Nf("Match");return s.when})):l},void 0,void 0)}function J(e){return e}var RT=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],DT=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...RT]),MT=new Set(["innerHTML","textContent","innerText","children"]),$T=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),LT=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function NT(e,t){let r=LT[e];return typeof r=="object"?r[t]?r.$:void 0:r}var BT=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),FT=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),UT={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function jT(e,t,r){let n=r.length,o=t.length,i=n,a=0,s=0,l=t[o-1].nextSibling,c=null;for(;a<o||s<i;){if(t[a]===r[s]){a++,s++;continue}for(;t[o-1]===r[i-1];)o--,i--;if(o===a){let u=i<n?s?r[s-1].nextSibling:r[i-s]:l;for(;s<i;)e.insertBefore(r[s++],u);}else if(i===s)for(;a<o;)(!c||!c.has(t[a]))&&t[a].remove(),a++;else if(t[a]===r[i-1]&&r[s]===t[o-1]){let u=t[--o].nextSibling;e.insertBefore(r[s++],t[a++].nextSibling),e.insertBefore(r[--i],u),t[o]=r[i];}else {if(!c){c=new Map;let d=s;for(;d<i;)c.set(r[d],d++);}let u=c.get(t[a]);if(u!=null)if(s<u&&u<i){let d=a,f=1,p;for(;++d<o&&d<i&&!((p=c.get(t[d]))==null||p!==u+f);)f++;if(f>u-s){let g=t[a];for(;s<u;)e.insertBefore(r[s++],g);}else e.replaceChild(r[s++],t[a++]);}else a++;else t[a++].remove();}}}var Bf="_$DX_DELEGATE";function w(e,t,r){let n,o=()=>{let a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},i=()=>(n||(n=o())).cloneNode(true);return i.cloneNode=i,i}function Ge(e,t=window.document){let r=t[Bf]||(t[Bf]=new Set);for(let n=0,o=e.length;n<o;n++){let i=e[n];r.has(i)||(r.add(i),t.addEventListener(i,YT));}}function G(e,t,r){(r==null?e.removeAttribute(t):e.setAttribute(t,r));}function HT(e,t,r,n){(n==null?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n));}function WT(e,t,r){(r?e.setAttribute(t,""):e.removeAttribute(t));}function j(e,t){(t==null?e.removeAttribute("class"):e.className=t);}function ot(e,t,r,n){if(n)Array.isArray(r)?(e[`$$${t}`]=r[0],e[`$$${t}Data`]=r[1]):e[`$$${t}`]=r;else if(Array.isArray(r)){let o=r[0];e.addEventListener(t,r[0]=i=>o.call(e,r[1],i));}else e.addEventListener(t,r,typeof r!="function"&&r);}function VT(e,t,r={}){let n=Object.keys(t||{}),o=Object.keys(r),i,a;for(i=0,a=o.length;i<a;i++){let s=o[i];!s||s==="undefined"||t[s]||(Ff(e,s,false),delete r[s]);}for(i=0,a=n.length;i<a;i++){let s=n[i],l=!!t[s];!s||s==="undefined"||r[s]===l||!l||(Ff(e,s,true),r[s]=l);}return r}function Rc(e,t,r){if(!t)return r?G(e,"style"):t;let n=e.style;if(typeof t=="string")return n.cssText=t;typeof r=="string"&&(n.cssText=r=void 0),r||(r={}),t||(t={});let o,i;for(i in r)t[i]==null&&n.removeProperty(i),delete r[i];for(i in t)o=t[i],o!==r[i]&&(n.setProperty(i,o),r[i]=o);return r}function De(e,t={},r,n){let o={};return n||$(()=>o.children=So(e,t.children,o.children)),$(()=>typeof t.ref=="function"&&be(t.ref,e)),$(()=>zT(e,t,r,true,o,true)),o}function be(e,t,r){return ct(()=>e(t,r))}function v(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return So(e,t,n,r);$(o=>So(e,t(),o,r),n);}function zT(e,t,r,n,o={},i=false){t||(t={});for(let a in o)if(!(a in t)){if(a==="children")continue;o[a]=Uf(e,a,null,o[a],r,i,t);}for(let a in t){if(a==="children"){continue}let s=t[a];o[a]=Uf(e,a,s,o[a],r,i,t);}}function qT(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function Ff(e,t,r){let n=t.trim().split(/\s+/);for(let o=0,i=n.length;o<i;o++)e.classList.toggle(n[o],r);}function Uf(e,t,r,n,o,i,a){let s,l,c,u,d;if(t==="style")return Rc(e,r,n);if(t==="classList")return VT(e,r,n);if(r===n)return n;if(t==="ref")i||r(e);else if(t.slice(0,3)==="on:"){let f=t.slice(3);n&&e.removeEventListener(f,n,typeof n!="function"&&n),r&&e.addEventListener(f,r,typeof r!="function"&&r);}else if(t.slice(0,10)==="oncapture:"){let f=t.slice(10);n&&e.removeEventListener(f,n,true),r&&e.addEventListener(f,r,true);}else if(t.slice(0,2)==="on"){let f=t.slice(2).toLowerCase(),p=BT.has(f);if(!p&&n){let g=Array.isArray(n)?n[0]:n;e.removeEventListener(f,g);}(p||r)&&(ot(e,f,r,p),p&&Ge([f]));}else if(t.slice(0,5)==="attr:")G(e,t.slice(5),r);else if(t.slice(0,5)==="bool:")WT(e,t.slice(5),r);else if((d=t.slice(0,5)==="prop:")||(c=MT.has(t))||!o&&((u=NT(t,e.tagName))||(l=DT.has(t)))||(s=e.nodeName.includes("-")||"is"in a)){if(d)t=t.slice(5),l=true;t==="class"||t==="className"?j(e,r):s&&!l&&!c?e[qT(t)]=r:e[u||t]=r;}else {let f=o&&t.indexOf(":")>-1&&UT[t.split(":")[0]];f?HT(e,f,t,r):G(e,$T[t]||t,r);}return r}function YT(e){let t=e.target,r=`$$${e.type}`,n=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:true,value:l}),a=()=>{let l=t[r];if(l&&!t.disabled){let c=t[`${r}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),true},s=()=>{for(;a()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:true,get(){return t||document}}),e.composedPath){let l=e.composedPath();i(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!a());c++){if(t._$host){t=t._$host,s();break}if(t.parentNode===o)break}}else s();i(n);}function So(e,t,r,n,o){for(;typeof r=="function";)r=r();if(t===r)return r;let a=typeof t,s=n!==void 0;if(e=s&&r[0]&&r[0].parentNode||e,a==="string"||a==="number"){if(a==="number"&&(t=t.toString(),t===r))return r;if(s){let l=r[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),r=Co(e,r,n,l);}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t;}else if(t==null||a==="boolean"){r=Co(e,r,n);}else {if(a==="function")return $(()=>{let l=t();for(;typeof l=="function";)l=l();r=So(e,l,r,n);}),()=>r;if(Array.isArray(t)){let l=[],c=r&&Array.isArray(r);if(Oc(l,t,r,o))return $(()=>r=So(e,l,r,n,true)),()=>r;if(l.length===0){if(r=Co(e,r,n),s)return r}else c?r.length===0?jf(e,l,n):jT(e,r,l):(r&&Co(e),jf(e,l));r=l;}else if(t.nodeType){if(Array.isArray(r)){if(s)return r=Co(e,r,n,t);Co(e,r,null,t);}else r==null||r===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);r=t;}}return r}function Oc(e,t,r,n){let o=false;for(let i=0,a=t.length;i<a;i++){let s=t[i],l=r&&r[e.length],c;if(!(s==null||s===true||s===false))if((c=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))o=Oc(e,s,l)||o;else if(c==="function")if(n){for(;typeof s=="function";)s=s();o=Oc(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||o;}else e.push(s),o=true;else {let u=String(s);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u));}}return o}function jf(e,t,r=null){for(let n=0,o=t.length;n<o;n++)e.insertBefore(t[n],r);}function Co(e,t,r,n){if(r===void 0)return e.textContent="";let o=n||document.createTextNode("");if(t.length){let i=false;for(let a=t.length-1;a>=0;a--){let s=t[a];if(o!==s){let l=s.parentNode===e;!i&&!a?l?e.replaceChild(o,s):e.insertBefore(o,r):l&&s.remove();}else i=true;}}else e.insertBefore(o,r);return [o]}var XT="http://www.w3.org/2000/svg";function Hf(e,t=false){return t?document.createElementNS(XT,e):document.createElement(e)}function Wf(e){let {useShadow:t}=e,r=document.createTextNode(""),n=()=>e.mount||document.body,o=_o(),i;return Se(()=>{i||(i=Af(o,()=>B(()=>e.children)));let s=n();if(s instanceof HTMLHeadElement){let[l,c]=M(false),u=()=>c(true);An(d=>v(s,()=>l()?d():i(),null)),me(u);}else {let l=Hf(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return r.parentNode},configurable:true}),v(c,i),s.appendChild(l),e.ref&&e.ref(l),me(()=>s.removeChild(l));}},void 0,{render:true}),r}function Vf(e){let[t,r]=rt(e,["component"]),n=B(()=>t.component);return B(()=>{let o=n();switch(typeof o){case "function":return ct(()=>o(r));case "string":let i=FT.has(o),a=Hf(o,i);return De(a,r,i),a}})}function ZT(e){let t=Object.keys(e),r={};for(let n=0;n<t.length;n++){let[o,i]=M(e[t[n]]);Object.defineProperty(r,t[n],{get:o,set(a){i(()=>a);}});}return r}function QT(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function JT(e){return (t,r)=>{let{element:n}=r;return An(o=>{let i=ZT(t);n.addPropertyChangedCallback((s,l)=>i[s]=l),n.addReleaseCallback(()=>{n.renderRoot.textContent="",o();});let a=e(i,r);return v(n.renderRoot,a)},QT(n))}}function fs(e,t,r){return arguments.length===2&&(r=t,t={}),vf(e,t)(JT(r))}var ps={id:void 0,agent:void 0,onNewInputBlock:void 0,onAnswer:void 0,onEnd:void 0,onInit:void 0,onNewLogs:void 0,onChatStatePersisted:void 0,onScriptExecutionSuccess:void 0,font:void 0,progressBarRef:void 0,isPreview:void 0,startFrom:void 0,prefilledVariables:void 0,apiHost:void 0,resultId:void 0,sessionId:void 0},zf={...ps,onClose:void 0,onOpen:void 0,theme:void 0,autoShowDelay:void 0,isOpen:void 0,defaultOpen:void 0},Gf={...ps,onClose:void 0,onOpen:void 0,theme:void 0,previewMessage:void 0,onPreviewMessageClick:void 0,onPreviewMessageDismissed:void 0,autoShowDelay:void 0};var qf=e=>{sessionStorage.setItem("agentPaymentInProgress",JSON.stringify(e));},ko=()=>sessionStorage.getItem("agentPaymentInProgress"),ms=()=>{sessionStorage.removeItem("agentPaymentInProgress");};var Po=class extends Error{constructor(t){super("This agent can only be executed on "+t);}};var Er=(e,t)=>{if(typeof window<"u")return window.__ENV?window.__ENV[e]??t:void 0;if(!(typeof process>"u"))return process.env[e]??t};var e_="https://r0.ar",yt=({ignoreChatApiUrl:e}={ignoreChatApiUrl:false})=>{let t=Er("NEXT_PUBLIC_CHAT_API_URL"),r=Er("NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON")?.split(",");if(!e&&t&&(!r||r.some(i=>i===window.location.href)))return t;let n=Er("NEXT_PUBLIC_VIEWER_URL")?.split(",");return n?.find(i=>window.location.href.startsWith(i))??n?.[0]??e_};function Yf(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Yf(e[t]))&&(n&&(n+=" "),n+=r);}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Qt(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Yf(e))&&(n&&(n+=" "),n+=t);return n}var xe=Qt;var $c="-",t_=e=>{let t=n_(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return {getClassGroupId:a=>{let s=a.split($c);return s[0]===""&&s.length!==1&&s.shift(),Zf(s,t)||r_(a)},getConflictingClassGroupIds:(a,s)=>{let l=r[a]||[];return s&&n[a]?[...l,...n[a]]:l}}},Zf=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],n=t.nextPart.get(r),o=n?Zf(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;let i=e.join($c);return t.validators.find(({validator:a})=>a(i))?.classGroupId},Kf=/^\[(.+)\]$/,r_=e=>{if(Kf.test(e)){let t=Kf.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return "arbitrary.."+r}},n_=e=>{let{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return i_(Object.entries(e.classGroups),r).forEach(([i,a])=>{Mc(a,n,i,t);}),n},Mc=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){let i=o===""?t:Xf(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(o_(o)){Mc(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,a])=>{Mc(a,Xf(t,i),r,n);});});},Xf=(e,t)=>{let r=e;return t.split($c).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n);}),r},o_=e=>e.isThemeGetter,i_=(e,t)=>t?e.map(([r,n])=>{let o=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,s])=>[t+a,s])):i);return [r,o]}):e,a_=e=>{if(e<1)return {get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map,o=(i,a)=>{r.set(i,a),t++,t>e&&(t=0,n=r,r=new Map);};return {get(i){let a=r.get(i);if(a!==void 0)return a;if((a=n.get(i))!==void 0)return o(i,a),a},set(i,a){r.has(i)?r.set(i,a):o(i,a);}}},Qf="!",s_=e=>{let{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],i=t.length,a=s=>{let l=[],c=0,u=0,d;for(let b=0;b<s.length;b++){let y=s[b];if(c===0){if(y===o&&(n||s.slice(b,b+i)===t)){l.push(s.slice(u,b)),u=b+i;continue}if(y==="/"){d=b;continue}}y==="["?c++:y==="]"&&c--;}let f=l.length===0?s:s.substring(u),p=f.startsWith(Qf),g=p?f.substring(1):f,h=d&&d>u?d-u:void 0;return {modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:h}};return r?s=>r({className:s,parseClassName:a}):a},l_=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n);}),t.push(...r.sort()),t},c_=e=>({cache:a_(e.cacheSize),parseClassName:s_(e),...t_(e)}),u_=/\s+/,d_=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(u_),s="";for(let l=a.length-1;l>=0;l-=1){let c=a[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=r(c),g=!!p,h=n(g?f.substring(0,p):f);if(!h){if(!g){s=c+(s.length>0?" "+s:s);continue}if(h=n(f),!h){s=c+(s.length>0?" "+s:s);continue}g=false;}let b=l_(u).join(":"),y=d?b+Qf:b,S=y+h;if(i.includes(S))continue;i.push(S);let C=o(h,g);for(let k=0;k<C.length;++k){let D=C[k];i.push(y+D);}s=c+(s.length>0?" "+s:s);}return s};function f_(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Jf(t))&&(n&&(n+=" "),n+=r);return n}var Jf=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Jf(e[n]))&&(r&&(r+=" "),r+=t);return r};function p_(e,...t){let r,n,o,i=a;function a(l){let c=t.reduce((u,d)=>d(u),e());return r=c_(c),n=r.cache.get,o=r.cache.set,i=s,s(l)}function s(l){let c=n(l);if(c)return c;let u=d_(l,r);return o(l,u),u}return function(){return i(f_.apply(null,arguments))}}var Qe=e=>{let t=r=>r[e]||[];return t.isThemeGetter=true,t},ep=/^\[(?:([a-z-]+):)?(.+)\]$/i,m_=/^\d+\/\d+$/,g_=new Set(["px","full","screen"]),h_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,b_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,y_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,v_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,x_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wr=e=>Eo(e)||g_.has(e)||m_.test(e),cn=e=>Io(e,"length",E_),Eo=e=>!!e&&!Number.isNaN(Number(e)),Dc=e=>Io(e,"number",Eo),Pi=e=>!!e&&Number.isInteger(Number(e)),w_=e=>e.endsWith("%")&&Eo(e.slice(0,-1)),Te=e=>ep.test(e),un=e=>h_.test(e),T_=new Set(["length","size","percentage"]),__=e=>Io(e,T_,tp),C_=e=>Io(e,"position",tp),S_=new Set(["image","url"]),k_=e=>Io(e,S_,A_),P_=e=>Io(e,"",I_),Ei=()=>true,Io=(e,t,r)=>{let n=ep.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):false},E_=e=>b_.test(e)&&!y_.test(e),tp=()=>false,I_=e=>v_.test(e),A_=e=>x_.test(e);var O_=()=>{let e=Qe("colors"),t=Qe("spacing"),r=Qe("blur"),n=Qe("brightness"),o=Qe("borderColor"),i=Qe("borderRadius"),a=Qe("borderSpacing"),s=Qe("borderWidth"),l=Qe("contrast"),c=Qe("grayscale"),u=Qe("hueRotate"),d=Qe("invert"),f=Qe("gap"),p=Qe("gradientColorStops"),g=Qe("gradientColorStopPositions"),h=Qe("inset"),b=Qe("margin"),y=Qe("opacity"),S=Qe("padding"),C=Qe("saturate"),k=Qe("scale"),D=Qe("sepia"),U=Qe("skew"),N=Qe("space"),ie=Qe("translate"),I=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",Te,t],E=()=>[Te,t],_=()=>["",Wr,cn],T=()=>["auto",Eo,Te],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",Te],Ie=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ce=()=>[Eo,Te];return {cacheSize:500,separator:":",theme:{colors:[Ei],spacing:[Wr,cn],blur:["none","",un,Te],brightness:Ce(),borderColor:[e],borderRadius:["none","","full",un,Te],borderSpacing:E(),borderWidth:_(),contrast:Ce(),grayscale:K(),hueRotate:Ce(),invert:K(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[w_,cn],inset:R(),margin:R(),opacity:Ce(),padding:E(),saturate:Ce(),scale:Ce(),sepia:K(),skew:Ce(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",Te]}],container:["container"],columns:[{columns:[un]}],"break-after":[{"break-after":Ie()}],"break-before":[{"break-before":Ie()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...O(),Te]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Pi,Te]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Te]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",Pi,Te]}],"grid-cols":[{"grid-cols":[Ei]}],"col-start-end":[{col:["auto",{span:["full",Pi,Te]},Te]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[Ei]}],"row-start-end":[{row:["auto",{span:[Pi,Te]},Te]}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Te]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Te]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Te,t]}],"min-w":[{"min-w":[Te,t,"min","max","fit"]}],"max-w":[{"max-w":[Te,t,"none","full","min","max","fit","prose",{screen:[un]},un]}],h:[{h:[Te,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Te,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Te,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Te,t,"auto","min","max","fit"]}],"font-size":[{text:["base",un,cn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Dc]}],"font-family":[{font:[Ei]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Te]}],"line-clamp":[{"line-clamp":["none",Eo,Dc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wr,Te]}],"list-image":[{"list-image":["none",Te]}],"list-style-type":[{list:["none","disc","decimal",Te]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wr,cn]}],"underline-offset":[{"underline-offset":["auto",Wr,Te]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...O(),C_]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",__]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},k_]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...L(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:L()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[Wr,Te]}],"outline-w":[{outline:[Wr,cn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Wr,cn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",un,P_]}],"shadow-color":[{shadow:[Ei]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",un,Te]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[C]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Te]}],duration:[{duration:Ce()}],ease:[{ease:["linear","in","out","in-out",Te]}],delay:[{delay:Ce()}],animate:[{animate:["none","spin","ping","pulse","bounce",Te]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Pi,Te]}],"translate-x":[{"translate-x":[ie]}],"translate-y":[{"translate-y":[ie]}],"skew-x":[{"skew-x":[U]}],"skew-y":[{"skew-y":[U]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Te]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Te]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Te]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Wr,cn,Dc]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var rp=p_(O_);wo(Zp());wo(Jp());var em=async e=>{let t;try{let r=typeof e=="string"?e:e.url;t=await fetch(r,{method:typeof e=="string"?"GET":e.method,mode:"cors",headers:typeof e!="string"&&pe(e.body)?{"Content-Type":"application/json"}:void 0,body:typeof e!="string"&&pe(e.body)?JSON.stringify(e.body):void 0});let n=await t.json();if(!t.ok)throw typeof n=="object"&&n!==null&&"error"in n?n.error:n;return {data:n,response:t}}catch(r){return {error:r,response:t}}},pe=e=>e!=null,ut=e=>e==null,tt=e=>e==null||e==="",Ne=e=>e!=null&&e!=="";var tm=e=>{e.split("</noscript>").forEach(r=>{let[n,o]=r.split("<noscript>"),i=document.createRange().createContextualFragment(n??"");if(document.head.append(i),ut(o))return;let a=document.createElement("noscript"),s=document.createRange().createContextualFragment(o);a.append(s),document.head.append(a);});};var pr=e=>e?.startsWith("data:image/svg")||e?.endsWith(".svg");var Ir=class extends Error{constructor(t,r,n){let o=t.status||t.status===0?t.status:"",i=t.statusText||"",a=`${o} ${i}`.trim(),s=a?`status code ${a}`:"an unknown error";super(`Request failed with ${s}`),Object.defineProperty(this,"response",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"request",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"options",{enumerable:true,configurable:true,writable:true,value:void 0}),this.name="HTTPError",this.response=t,this.request=r,this.options=n;}};var $o=class extends Error{constructor(t){super("Request timed out"),Object.defineProperty(this,"request",{enumerable:true,configurable:true,writable:true,value:void 0}),this.name="TimeoutError",this.request=t;}};var Mi=e=>e!==null&&typeof e=="object";var $i=(...e)=>{for(let t of e)if((!Mi(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return vs({},...e)},Wc=(e={},t={})=>{let r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(let[i,a]of o.entries())n&&a==="undefined"||a===void 0?r.delete(i):r.set(i,a);return r},vs=(...e)=>{let t={},r={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(Mi(n)){for(let[o,i]of Object.entries(n))Mi(i)&&o in t&&(i=vs(t[o],i)),t={...t,[o]:i};Mi(n.headers)&&(r=Wc(r,n.headers),t.headers=r);}return t};var rm=(()=>{let e=false,t=false,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";return r&&n&&(t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=true,"half"}}).headers.has("Content-Type")),e&&!t})(),nm=typeof globalThis.AbortController=="function",om=typeof globalThis.ReadableStream=="function",im=typeof globalThis.FormData=="function",xs=["get","post","put","patch","head","delete"];var am={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},ws=2147483647,Ts=Symbol("stop"),sm={json:true,parseJson:true,searchParams:true,prefixUrl:true,retry:true,timeout:true,hooks:true,throwHttpErrors:true,onDownloadProgress:true,fetch:true},lm={method:true,headers:true,body:true,mode:true,credentials:true,cache:true,redirect:true,referrer:true,referrerPolicy:true,integrity:true,keepalive:true,signal:true,window:true,dispatcher:true,duplex:true,priority:true};var um=e=>xs.includes(e)?e.toUpperCase():e,TC=["get","put","head","delete","options","trace"],_C=[408,413,429,500,502,503,504],dm=[413,429,503],cm={limit:2,methods:TC,statusCodes:_C,afterStatusCodes:dm,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},fm=(e={})=>{if(typeof e=="number")return {...cm,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return {...cm,...e,afterStatusCodes:dm}};async function Vc(e,t,r,n){return new Promise((o,i)=>{let a=setTimeout(()=>{r&&r.abort(),i(new $o(e));},n.timeout);n.fetch(e,t).then(o).catch(i).then(()=>{clearTimeout(a);});})}async function zc(e,{signal:t}){return new Promise((r,n)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:true}));function o(){clearTimeout(i),n(t.reason);}let i=setTimeout(()=>{t?.removeEventListener("abort",o),r();},e);})}var pm=(e,t)=>{let r={};for(let n in t)!(n in lm)&&!(n in sm)&&!(n in e)&&(r[n]=t[n]);return r};var Li=class e{static create(t,r){let n=new e(t,r),o=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>ws)throw new RangeError(`The \`timeout\` option cannot be greater than ${ws}`);await Promise.resolve();let s=await n._fetch();for(let l of n._options.hooks.afterResponse){let c=await l(n.request,n._options,n._decorateResponse(s.clone()));c instanceof globalThis.Response&&(s=c);}if(n._decorateResponse(s),!s.ok&&n._options.throwHttpErrors){let l=new Ir(s,n.request,n._options);for(let c of n._options.hooks.beforeError)l=await c(l);throw l}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!om)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(s.clone(),n._options.onDownloadProgress)}return s},a=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(o):o();for(let[s,l]of Object.entries(am))a[s]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||l);let u=(await a).clone();if(s==="json"){if(u.status===204||(await u.clone().arrayBuffer()).byteLength===0)return "";if(r.parseJson)return r.parseJson(await u.text())}return u[s]()};return a}constructor(t,r={}){Object.defineProperty(this,"request",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:true,configurable:true,writable:true,value:0}),Object.defineProperty(this,"_input",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"_options",{enumerable:true,configurable:true,writable:true,value:void 0}),this._input=t;let n=this._input instanceof Request&&"credentials"in Request.prototype?this._input.credentials:void 0;if(this._options={...n&&{credentials:n},...r,headers:Wc(this._input.headers,r.headers),hooks:vs({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:um(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:fm(r.retry),throwHttpErrors:r.throwHttpErrors!==false,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input;}if(nm){if(this.abortController=new globalThis.AbortController,this._options.signal){let o=this._options.signal;this._options.signal.addEventListener("abort",()=>{this.abortController.abort(o.reason);});}this._options.signal=this.abortController.signal;}if(rm&&(this._options.duplex="half"),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(im&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(a,{...this.request}),this._options);}this._options.json!==void 0&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",this._options.headers.get("content-type")??"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}));}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount<=this._options.retry.limit&&!(t instanceof $o)){if(t instanceof Ir){if(!this._options.retry.statusCodes.includes(t.response.status))return 0;let n=t.response.headers.get("Retry-After");if(n&&this._options.retry.afterStatusCodes.includes(t.response.status)){let o=Number(n);return Number.isNaN(o)?o=Date.parse(n)-Date.now():o*=1e3,this._options.retry.maxRetryAfter!==void 0&&o>this._options.retry.maxRetryAfter?0:o}if(t.response.status===413)return 0}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}return 0}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(r){let n=Math.min(this._calculateRetryDelay(r),ws);if(n!==0&&this._retryCount>0){await zc(n,{signal:this._options.signal});for(let o of this._options.hooks.beforeRetry)if(await o({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===Ts)return;return this._retry(t)}throw r}}async _fetch(){for(let r of this._options.hooks.beforeRequest){let n=await r(this.request,this._options);if(n instanceof Request){this.request=n;break}if(n instanceof Response)return n}let t=pm(this.request,this._options);return this._options.timeout===false?this._options.fetch(this.request.clone(),t):Vc(this.request.clone(),t,this.abortController,this._options)}_stream(t,r){let n=Number(t.headers.get("content-length"))||0,o=0;return t.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:o},new Uint8Array),new globalThis.Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(i){let a=t.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function s(){let{done:l,value:c}=await a.read();if(l){i.close();return}if(r){o+=c.byteLength;let u=n===0?0:o/n;r({percent:u,transferredBytes:o,totalBytes:n},c);}i.enqueue(c),await s();}await s();}}),{status:t.status,statusText:t.statusText,headers:t.headers})}};var Gc=e=>{let t=(r,n)=>Li.create(r,$i(e,n));for(let r of xs)t[r]=(n,o)=>Li.create(n,$i(e,o,{method:r}));return t.create=r=>Gc($i(r)),t.extend=r=>Gc($i(e,r)),t.stop=Ts,t},CC=Gc(),pn=CC;async function mm({agent:e,isPreview:t,apiHost:r,prefilledVariables:n,resultId:o,stripeRedirectStatus:i,startFrom:a,sessionId:s}){if(ut(e))throw new Error("Agent is required to start the chat");let l=ko()??void 0,c=l?JSON.parse(l):void 0;if(c)return SC({apiHost:r,stripeRedirectStatus:i,paymentInProgressState:c});let u=typeof e=="string"?e:e.id;if(t)return kC({apiHost:r,agentId:u,startFrom:a,agent:e,prefilledVariables:n,sessionId:s});try{let d=parent!==window&&Ne(document.referrer)?new URL(document.referrer).origin:void 0,f=await pn.post(`${qc(r)}/api/v1/agents/${u}/startChat`,{headers:{"x-agent-iframe-referrer-origin":d,"x-original-referrer":document.referrer},json:{isStreamEnabled:!0,prefilledVariables:n,resultId:o,isOnlyRegistering:!1},timeout:!1}),p=f.headers.get("access-control-allow-origin");if(d&&p&&p!=="*"&&!d.includes(p))throw new Po(p);return {data:await f.json()}}catch(d){return {error:d}}}var SC=async({apiHost:e,stripeRedirectStatus:t,paymentInProgressState:r})=>{ms();try{return {data:{...await pn.post(`${qc(e)}/api/v1/sessions/${r.sessionId}/continueChat`,{json:{message:t==="failed"?"fail":"Success"},timeout:!1}).json(),...r}}}catch(n){return {error:n}}},kC=async({apiHost:e,agentId:t,startFrom:r,agent:n,prefilledVariables:o,sessionId:i})=>{try{return {data:await pn.post(`${qc(e)}/api/v1/agents/${t}/preview/startChat`,{json:{isStreamEnabled:!0,startFrom:r,agent:n,prefilledVariables:o,sessionId:i},timeout:!1}).json()}}catch(a){return {error:a}}},qc=e=>Ne(e)?e:yt();var[gm,hm]=M("100%");var[YM,bm]=M();var _s="#303235",Cs="#FFFFFF",ym="Google",Lo="Open Sans",No="Color",Ni="#ffffff";var vm="#000",xm="#000",wm=2,Ss="absolute",Tm="Top",Dn="medium",Rt=1,_m=0,Cm="800px",Sm="100%",Bi="transparent";var Bo="#F7F8FF",km=_s,Pm="#000",Em=Cs,Fi="#0042DA",Im=Cs,Am=1;var Om="#FFFFFF",Ui=_s,Rm="#9095A0",Dm="md";var Fo=true,ji=false;var PC="https://fonts.bunny.net/css2",ks="agent-font",Yc=e=>{let t=document.getElementById(ks);if(typeof e=="string"||e.type==="Google"){let r=(typeof e=="string"?e:e.family)??Lo;if(t?.getAttribute("href")?.includes(r))return;t?.remove();let n=document.createElement("link");n.href=`${PC}?family=${r}:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap`,n.rel="stylesheet",n.id=ks,document.head.appendChild(n);return}if(e.type==="Custom"){if(Ne(e.css)){if(t?.innerHTML===e.css)return;t?.remove();let r=document.createElement("style");r.innerHTML=e.css,r.id=ks,document.head.appendChild(r);}if(Ne(e.url)){if(t?.getAttribute("href")===e.url)return;t?.remove();let r=document.createElement("link");r.href=e.url,r.rel="stylesheet",r.id=ks,document.head.appendChild(r);}}};var[X,Mm]=M();var vt={general:{isInputPrefillEnabled:false,rememberUser:{isEnabled:false,storage:"session"}},typingEmulation:{enabled:true,speed:900,maxDelay:2,delayBetweenBubbles:0,isDisabledOnFirstMessage:true}};var Kc=Symbol("store-raw"),jo=Symbol("store-node"),zr=Symbol("store-has"),$m=Symbol("store-self");function Lm(e){let t=e[Xt];if(!t&&(Object.defineProperty(e,Xt,{value:t=new Proxy(e,AC)}),!Array.isArray(e))){let r=Object.keys(e),n=Object.getOwnPropertyDescriptors(e);for(let o=0,i=r.length;o<i;o++){let a=r[o];n[a].get&&Object.defineProperty(e,a,{enumerable:n[a].enumerable,get:n[a].get.bind(t)});}}return t}function mn(e){let t;return e!=null&&typeof e=="object"&&(e[Xt]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Ho(e,t=new Set){let r,n,o,i;if(r=e!=null&&e[Kc])return r;if(!mn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let a=0,s=e.length;a<s;a++)o=e[a],(n=Ho(o,t))!==o&&(e[a]=n);}else {Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let a=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let l=0,c=a.length;l<c;l++)i=a[l],!s[i].get&&(o=e[i],(n=Ho(o,t))!==o&&(e[i]=n));}return e}function Ps(e,t){let r=e[t];return r||Object.defineProperty(e,t,{value:r=Object.create(null)}),r}function Wi(e,t,r){if(e[t])return e[t];let[n,o]=M(r,{equals:false,internal:true});return n.$=o,e[t]=n}function EC(e,t){let r=Reflect.getOwnPropertyDescriptor(e,t);return !r||r.get||!r.configurable||t===Xt||t===jo||(delete r.value,delete r.writable,r.get=()=>e[Xt][t]),r}function Nm(e){cs()&&Wi(Ps(e,jo),$m)();}function IC(e){return Nm(e),Reflect.ownKeys(e)}var AC={get(e,t,r){if(t===Kc)return e;if(t===Xt)return r;if(t===ss)return Nm(e),r;let n=Ps(e,jo),o=n[t],i=o?o():e[t];if(t===jo||t===zr||t==="__proto__")return i;if(!o){let a=Object.getOwnPropertyDescriptor(e,t);cs()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(a&&a.get)&&(i=Wi(n,t,i)());}return mn(i)?Lm(i):i},has(e,t){return t===Kc||t===Xt||t===ss||t===jo||t===zr||t==="__proto__"?true:(cs()&&Wi(Ps(e,zr),t)(),t in e)},set(){return true},deleteProperty(){return true},ownKeys:IC,getOwnPropertyDescriptor:EC};function Jt(e,t,r,n=false){if(!n&&e[t]===r)return;let o=e[t],i=e.length;r===void 0?(delete e[t],e[zr]&&e[zr][t]&&o!==void 0&&e[zr][t].$()):(e[t]=r,e[zr]&&e[zr][t]&&o===void 0&&e[zr][t].$());let a=Ps(e,jo),s;if((s=Wi(a,t,o))&&s.$(()=>r),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(s=a[l])&&s.$();(s=Wi(a,"length",i))&&s.$(e.length);}(s=a[$m])&&s.$();}function Bm(e,t){let r=Object.keys(t);for(let n=0;n<r.length;n+=1){let o=r[n];Jt(e,o,t[o]);}}function OC(e,t){if(typeof t=="function"&&(t=t(e)),t=Ho(t),Array.isArray(t)){if(e===t)return;let r=0,n=t.length;for(;r<n;r++){let o=t[r];e[r]!==o&&Jt(e,r,o);}Jt(e,"length",n);}else Bm(e,t);}function Hi(e,t,r=[]){let n,o=e;if(t.length>1){n=t.shift();let a=typeof n,s=Array.isArray(e);if(Array.isArray(n)){for(let l=0;l<n.length;l++)Hi(e,[n[l]].concat(t),r);return}else if(s&&a==="function"){for(let l=0;l<e.length;l++)n(e[l],l)&&Hi(e,[l].concat(t),r);return}else if(s&&a==="object"){let{from:l=0,to:c=e.length-1,by:u=1}=n;for(let d=l;d<=c;d+=u)Hi(e,[d].concat(t),r);return}else if(t.length>1){Hi(e[n],t,[n].concat(r));return}o=e[n],r=[n].concat(r);}let i=t[0];typeof i=="function"&&(i=i(o,r),i===o)||n===void 0&&i==null||(i=Ho(i),n===void 0||mn(o)&&mn(i)&&!Array.isArray(i)?Bm(o,i):Jt(e,n,i));}function Fm(...[e,t]){let r=Ho(e||{}),n=Array.isArray(r),o=Lm(r);function i(...a){If(()=>{n&&a.length===1?OC(r,a[0]):Hi(r,a);});}return [o,i]}var Xc=Symbol("store-root");function Uo(e,t,r,n,o){let i=t[r];if(e===i)return;let a=Array.isArray(e);if(r!==Xc&&(!mn(e)||!mn(i)||a!==Array.isArray(i)||o&&e[o]!==i[o])){Jt(t,r,e);return}if(a){if(e.length&&i.length&&(!n||o&&e[0]&&e[0][o]!=null)){let c,u,d,f,p,g,h,b;for(d=0,f=Math.min(i.length,e.length);d<f&&(i[d]===e[d]||o&&i[d]&&e[d]&&i[d][o]===e[d][o]);d++)Uo(e[d],i,d,n,o);let y=new Array(e.length),S=new Map;for(f=i.length-1,p=e.length-1;f>=d&&p>=d&&(i[f]===e[p]||o&&i[d]&&e[d]&&i[f][o]===e[p][o]);f--,p--)y[p]=i[f];if(d>p||d>f){for(u=d;u<=p;u++)Jt(i,u,e[u]);for(;u<e.length;u++)Jt(i,u,y[u]),Uo(e[u],i,u,n,o);i.length>e.length&&Jt(i,"length",e.length);return}for(h=new Array(p+1),u=p;u>=d;u--)g=e[u],b=o&&g?g[o]:g,c=S.get(b),h[u]=c===void 0?-1:c,S.set(b,u);for(c=d;c<=f;c++)g=i[c],b=o&&g?g[o]:g,u=S.get(b),u!==void 0&&u!==-1&&(y[u]=i[c],u=h[u],S.set(b,u));for(u=d;u<e.length;u++)u in y?(Jt(i,u,y[u]),Uo(e[u],i,u,n,o)):Jt(i,u,e[u]);}else for(let c=0,u=e.length;c<u;c++)Uo(e[c],i,c,n,o);i.length>e.length&&Jt(i,"length",e.length);return}let s=Object.keys(e);for(let c=0,u=s.length;c<u;c++)Uo(e[s[c]],i,s[c],n,o);let l=Object.keys(i);for(let c=0,u=l.length;c<u;c++)e[l[c]]===void 0&&Jt(i,l[c],void 0);}function Es(e,t={}){let{merge:r,key:n="id"}=t,o=Ho(e);return i=>{if(!mn(i)||!mn(o))return o;let a=Uo(o,{[Xc]:i},Xc,r,n);return a===void 0?i:a}}function Ar(e,t){if(!t.storage)return [...e];let r=RC(t.storage||vt.general.rememberUser.storage),n=s=>{let l=JSON.parse(JSON.stringify(s));return typeof l!="object"||("blobUrl"in l&&(l.blobUrl=void 0),"attachments"in l&&Array.isArray(l.attachments)&&l.attachments.forEach(c=>{c&&"blobUrl"in c&&(c.blobUrl=void 0);})),JSON.stringify(l)},o=JSON.parse.bind(JSON),i=r.getItem(t.key),a=typeof e[0]=="function"?s=>e[1](()=>o(s)):s=>e[1](Es(o(s)));return i&&(a(i),t.onRecovered?.()),[e[0],typeof e[0]=="function"?s=>{let l=e[1](s);return s?r.setItem(t.key,n(l)):r.removeItem(t.key),l}:(...s)=>{e[1](...s);let l=n(ct(()=>e[0]));r.setItem(t.key,l);}]}var RC=e=>(e??vt.general.rememberUser.storage)==="session"?sessionStorage:localStorage;var mt=e=>{let t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,(n,o,i,a)=>o+o+i+i+a+a);let r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return r?[Number.parseInt(r[1]??"",16),Number.parseInt(r[2]??"",16),Number.parseInt(r[3]??"",16)]:[0,0,0]},Gr=e=>(([t,r,n])=>(t*299+r*587+n*114)/1e3>155)(mt(e));var Um=({chatContainer:e,generalBackground:t})=>{let r=e?.backgroundColor??Bi;if((e?.opacity??Rt)<=.3||r==="transparent"||tt(r)){let o=t?.type??No,i=o==="Image"?"#000000":o==="Color"&&Ne(t?.content)?t.content:"#ffffff";return Gr(i)}return Gr(e?.backgroundColor??Ni)};var ee={general:{bgImage:"--agent-container-bg-image",bgColor:"--agent-container-bg-color",fontFamily:"--agent-container-font-family",progressBar:{position:"--agent-progress-bar-position",color:"--agent-progress-bar-color",colorRgb:"--agent-progress-bar-bg-rgb",height:"--agent-progress-bar-height",top:"--agent-progress-bar-top",bottom:"--agent-progress-bar-bottom"}},chat:{container:{maxWidth:"--agent-chat-container-max-width",maxHeight:"--agent-chat-container-max-height",bgColor:"--agent-chat-container-bg-rgb",color:"--agent-chat-container-color",borderRadius:"--agent-chat-container-border-radius",borderWidth:"--agent-chat-container-border-width",borderColor:"--agent-chat-container-border-rgb",borderOpacity:"--agent-chat-container-border-opacity",opacity:"--agent-chat-container-opacity",blur:"--agent-chat-container-blur",boxShadow:"--agent-chat-container-box-shadow"},hostBubbles:{bgColor:"--agent-host-bubble-bg-rgb",color:"--agent-host-bubble-color",borderRadius:"--agent-host-bubble-border-radius",borderWidth:"--agent-host-bubble-border-width",borderColor:"--agent-host-bubble-border-rgb",borderOpacity:"--agent-host-bubble-border-opacity",opacity:"--agent-host-bubble-opacity",blur:"--agent-host-bubble-blur",boxShadow:"--agent-host-bubble-box-shadow"},guestBubbles:{bgColor:"--agent-guest-bubble-bg-rgb",color:"--agent-guest-bubble-color",borderRadius:"--agent-guest-bubble-border-radius",borderWidth:"--agent-guest-bubble-border-width",borderColor:"--agent-guest-bubble-border-rgb",borderOpacity:"--agent-guest-bubble-border-opacity",opacity:"--agent-guest-bubble-opacity",blur:"--agent-guest-bubble-blur",boxShadow:"--agent-guest-bubble-box-shadow"},inputs:{bgColor:"--agent-input-bg-rgb",color:"--agent-input-color",placeholderColor:"--agent-input-placeholder-color",borderRadius:"--agent-input-border-radius",borderWidth:"--agent-input-border-width",borderColor:"--agent-input-border-rgb",borderOpacity:"--agent-input-border-opacity",opacity:"--agent-input-opacity",blur:"--agent-input-blur",boxShadow:"--agent-input-box-shadow"},buttons:{bgRgb:"--agent-button-bg-rgb",color:"--agent-button-color",borderRadius:"--agent-button-border-radius",borderWidth:"--agent-button-border-width",borderColor:"--agent-button-border-rgb",borderOpacity:"--agent-button-border-opacity",opacity:"--agent-button-opacity",blur:"--agent-button-blur",boxShadow:"--agent-button-box-shadow"},checkbox:{bgRgb:"--agent-checkbox-bg-rgb",alphaRatio:"--selectable-alpha-ratio"}}},jm=(e,t,r)=>{if(!e)return;let n=t?.style;n&&(MC(e.general,n,r),LC(e.chat,e.general?.background,n));},MC=(e,t,r)=>{WC(e?.background,t),t.setProperty(ee.general.fontFamily,(typeof e?.font=="string"?e.font:e?.font?.family)??Lo),$C(e?.progressBar,t,r);},$C=(e,t,r)=>{let n=e?.position??Ss;t.setProperty(ee.general.progressBar.position,n==="fixed"?r?"absolute":"fixed":n),t.setProperty(ee.general.progressBar.color,e?.color??vm),t.setProperty(ee.general.progressBar.colorRgb,mt(e?.backgroundColor??xm).join(", ")),t.setProperty(ee.general.progressBar.height,`${e?.thickness??wm}px`);let o=e?.placement??Tm;t.setProperty(ee.general.progressBar.top,o==="Top"?"0":"auto"),t.setProperty(ee.general.progressBar.bottom,o==="Bottom"?"0":"auto");},LC=(e,t,r)=>{NC(e?.container,t,r,e?.roundness),BC(e?.hostBubbles,r,e?.roundness),FC(e?.guestBubbles,r,e?.roundness),UC(e?.buttons,r,e?.roundness),jC(e?.inputs,r,e?.roundness),HC(e?.container,t,r);},NC=(e,t,r,n)=>{let o=e?.backgroundColor??Bi,i=o==="transparent"||tt(o);r.setProperty(ee.chat.container.bgColor,i?"0, 0, 0":mt(o).join(", ")),r.setProperty(ee.chat.container.color,mt(e?.color??(Um({chatContainer:e,generalBackground:t})?_s:Cs)).join(", ")),r.setProperty(ee.chat.container.maxWidth,e?.maxWidth??Cm),r.setProperty(ee.chat.container.maxHeight,e?.maxHeight??Sm);let a=i?"1":(e?.opacity??Rt).toString();r.setProperty(ee.chat.container.opacity,i?"0":(e?.opacity??Rt).toString()),r.setProperty(ee.chat.container.blur,a==="1"||i?"0xp":`${e?.blur??_m}px`),zi(e?.shadow,r,ee.chat.container.boxShadow),Vi(e?.border??{roundeness:n??Dn},r,ee.chat.container.borderRadius),r.setProperty(ee.chat.container.borderWidth,pe(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),r.setProperty(ee.chat.container.borderOpacity,pe(e?.border?.opacity)?e.border.opacity.toString():Rt.toString()),r.setProperty(ee.chat.container.borderColor,mt(e?.border?.color??"").join(", "));},BC=(e,t,r)=>{t.setProperty(ee.chat.hostBubbles.bgColor,mt(e?.backgroundColor??Bo).join(", ")),t.setProperty(ee.chat.hostBubbles.color,e?.color??km),Vi(e?.border??{roundeness:r??Dn},t,ee.chat.hostBubbles.borderRadius),t.setProperty(ee.chat.hostBubbles.borderWidth,pe(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(ee.chat.hostBubbles.borderColor,mt(e?.border?.color??"").join(", ")),t.setProperty(ee.chat.hostBubbles.opacity,e?.backgroundColor==="transparent"?"0":pe(e?.opacity)?e.opacity.toString():Rt.toString()),t.setProperty(ee.chat.hostBubbles.borderOpacity,pe(e?.border?.opacity)?e.border.opacity.toString():Rt.toString()),t.setProperty(ee.chat.hostBubbles.blur,pe(e?.blur)?`${e.blur??0}px`:"none"),zi(e?.shadow,t,ee.chat.hostBubbles.boxShadow);},FC=(e,t,r)=>{t.setProperty(ee.chat.guestBubbles.bgColor,mt(e?.backgroundColor??Pm).join(", ")),t.setProperty(ee.chat.guestBubbles.color,e?.color??Em),Vi(e?.border??{roundeness:r??Dn},t,ee.chat.guestBubbles.borderRadius),t.setProperty(ee.chat.guestBubbles.borderWidth,pe(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(ee.chat.guestBubbles.borderColor,mt(e?.border?.color??"").join(", ")),t.setProperty(ee.chat.guestBubbles.borderOpacity,pe(e?.border?.opacity)?e.border.opacity.toString():Rt.toString()),t.setProperty(ee.chat.guestBubbles.opacity,e?.backgroundColor==="transparent"?"0":pe(e?.opacity)?e.opacity.toString():Rt.toString()),t.setProperty(ee.chat.guestBubbles.blur,pe(e?.blur)?`${e.blur??0}px`:"none"),zi(e?.shadow,t,ee.chat.guestBubbles.boxShadow);},UC=(e,t,r)=>{let n=e?.backgroundColor??Fi;t.setProperty(ee.chat.buttons.bgRgb,mt(n).join(", ")),t.setProperty(ee.chat.buttons.bgRgb,mt(n).join(", ")),t.setProperty(ee.chat.buttons.color,e?.color??Im),Vi(e?.border??{roundeness:r??Dn},t,ee.chat.buttons.borderRadius),t.setProperty(ee.chat.buttons.borderWidth,pe(e?.border?.thickness)?`${e?.border?.thickness}px`:`${Am}px`),t.setProperty(ee.chat.buttons.borderColor,mt(e?.border?.color??e?.backgroundColor??Fi).join(", ")),t.setProperty(ee.chat.buttons.borderOpacity,pe(e?.border?.opacity)?e.border.opacity.toString():Rt.toString()),t.setProperty(ee.chat.buttons.opacity,e?.backgroundColor==="transparent"?"0":pe(e?.opacity)?e.opacity.toString():Rt.toString()),t.setProperty(ee.chat.buttons.blur,pe(e?.blur)?`${e.blur??0}px`:"none"),zi(e?.shadow,t,ee.chat.buttons.boxShadow);},jC=(e,t,r)=>{t.setProperty(ee.chat.inputs.bgColor,mt(e?.backgroundColor??Om).join(", ")),t.setProperty(ee.chat.inputs.color,e?.color??Ui),t.setProperty(ee.chat.inputs.placeholderColor,e?.placeholderColor??Rm),Vi(e?.border??{roundeness:r??Dn},t,ee.chat.inputs.borderRadius),t.setProperty(ee.chat.inputs.borderWidth,pe(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(ee.chat.inputs.borderColor,mt(e?.border?.color??"").join(", ")),t.setProperty(ee.chat.inputs.borderOpacity,pe(e?.border?.opacity)?e.border.opacity.toString():Rt.toString()),t.setProperty(ee.chat.inputs.opacity,e?.backgroundColor==="transparent"?"0":pe(e?.opacity)?e.opacity.toString():Rt.toString()),t.setProperty(ee.chat.inputs.blur,pe(e?.blur)?`${e.blur??0}px`:"none"),zi(e?.shadow??Dm,t,ee.chat.inputs.boxShadow);},HC=(e,t,r)=>{let n=e?.backgroundColor??Bi;if(n==="transparent"||tt(n)||(e?.opacity??Rt)<=.2){let i=t?.type??No;r.setProperty(ee.chat.checkbox.bgRgb,i==="Image"?"rgba(255, 255, 255, 0.75)":mt((i==="Color"?t?.content:"#ffffff")??"#ffffff").join(", ")),i==="Image"?r.setProperty(ee.chat.checkbox.alphaRatio,"3"):r.setProperty(ee.chat.checkbox.alphaRatio,t?.content&&Gr(t?.content)?"1":"2");}else r.setProperty(ee.chat.checkbox.bgRgb,mt(n).concat(e?.opacity??1).join(", ")),r.setProperty(ee.chat.checkbox.alphaRatio,Gr(n)?"1":"2");},WC=(e,t)=>{t.setProperty(ee.general.bgImage,null),t.setProperty(ee.general.bgColor,null),t.setProperty((e?.type??No)==="Image"?ee.general.bgImage:ee.general.bgColor,VC({type:e?.type??No,content:e?.content??Ni}));},VC=({type:e,content:t}={})=>{switch(e){case "None":return "transparent";case void 0:case "Color":return t??Ni;case "Image":return `url(${t})`}},Vi=(e,t,r)=>{switch(e?.roundeness??Dn){case "none":{t.setProperty(r,"0");break}case "medium":{t.setProperty(r,"6px");break}case "large":{t.setProperty(r,"20px");break}case "custom":{t.setProperty(r,`${e.customRoundeness??6}px`);break}}},zi=(e,t,r)=>{if(e===void 0){t.setProperty(r,"0 0 #0000");return}switch(e){case "none":t.setProperty(r,"0 0 #0000");break;case "sm":t.setProperty(r,"0 1px 2px 0 rgb(0 0 0 / 0.05)");break;case "md":t.setProperty(r,"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)");break;case "lg":t.setProperty(r,"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)");break;case "xl":t.setProperty(r,"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)");break;case "2xl":t.setProperty(r,"0 25px 50px -12px rgb(0 0 0 / 0.25)");break}};var Zc="resultId",Hm=e=>{if(e)try{return sessionStorage.getItem(`${Zc}-${e}`)??localStorage.getItem(`${Zc}-${e}`)??void 0}catch{}},Wm=(e="session")=>(t,r)=>{try{zm(e).setItem(`${Zc}-${t}`,r);}catch{}},Vm=e=>{if(e)try{let t=sessionStorage.getItem(`agent-${e}-initialChatReply`)??localStorage.getItem(`agent-${e}-initialChatReply`);return t?JSON.parse(t):void 0}catch{}},Qc=(e,{agentId:t,storage:r})=>{try{let n=JSON.stringify(e);zm(r).setItem(`agent-${t}-initialChatReply`,n);}catch{}},Is=()=>{try{sessionStorage.setItem("agent-typeOpened","true");}catch{}},As=()=>{try{sessionStorage.removeItem("agent-typeOpened");}catch{}},Os=()=>{try{return sessionStorage.getItem("agent-typeOpened")==="true"}catch{return false}},zm=e=>(e??vt.general.rememberUser.storage)==="session"?sessionStorage:localStorage,Rs=e=>{Object.keys(localStorage).forEach(t=>{t.startsWith(`agent-${e}`)&&localStorage.removeItem(t);}),Object.keys(sessionStorage).forEach(t=>{t.startsWith(`agent-${e}`)&&sessionStorage.removeItem(t);});};var xt=()=>(e,t)=>rt(e,t);function zC(e,t){return `${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function st(e={}){let{strict:t=true,hookName:r="useContext",providerName:n="Provider",errorMessage:o,defaultValue:i}=e,a=Of(i);function s(){let l=Ic(a);if(!l&&t){let c=new Error(o??zC(r,n));throw c.name="ContextError",Error.captureStackTrace?.(c,s),c}return l}return [a.Provider,s,a]}var[Jc,Gm]=st({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"}),Gi=e=>xt()(e,["lazyMount","unmountOnExit"]);var GC=Symbol();var qm=Object.getPrototypeOf,eu=new WeakMap,qC=e=>e&&(eu.has(e)?eu.get(e):qm(e)===Object.prototype||qm(e)===Array.prototype);var Ym=e=>qC(e)&&e[GC]||null,tu=(e,t=true)=>{eu.set(e,t);};function YC(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function Km(e,t){let r=YC();return r?(r[e]||(r[e]=t()),r[e]):t()}var ru=e=>typeof e=="object"&&e!==null,Mn=Km("__zag__proxyStateMap",()=>new WeakMap),qi=Km("__zag__refSet",()=>new WeakSet),KC=e=>typeof e=="object"&&e!==null&&"$$typeof"in e,XC=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,ZC=e=>typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeName=="string",QC=e=>KC(e)||XC(e)||ZC(e),JC=(e=Object.is,t=(c,u)=>new Proxy(c,u),r=c=>ru(c)&&!qi.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!QC(c)&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),n=c=>{switch(c.status){case "fulfilled":return c.value;case "rejected":throw c.reason;default:throw c}},o=new WeakMap,i=(c,u,d=n)=>{let f=o.get(c);if(f?.[0]===u)return f[1];let p=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return tu(p,true),o.set(c,[u,p]),Reflect.ownKeys(c).forEach(g=>{let h=Reflect.get(c,g);qi.has(h)?(tu(h,false),p[g]=h):h instanceof Promise?Object.defineProperty(p,g,{get(){return d(h)}}):Mn.has(h)?p[g]=gn(h,d):p[g]=h;}),Object.freeze(p)},a=new WeakMap,s=[1,1],l=c=>{if(!ru(c))throw new Error("object required");let u=a.get(c);if(u)return u;let d=s[0],f=new Set,p=(I,A=++s[0])=>{d!==A&&(d=A,f.forEach(R=>R(I,A)));},g=s[1],h=(I=++s[1])=>(g!==I&&!f.size&&(g=I,y.forEach(([A])=>{let R=A[1](I);R>d&&(d=R);})),d),b=I=>(A,R)=>{let E=[...A];E[1]=[I,...E[1]],p(E,R);},y=new Map,S=(I,A)=>{if(f.size){let R=A[3](b(I));y.set(I,[A,R]);}else y.set(I,[A]);},C=I=>{let A=y.get(I);A&&(y.delete(I),A[1]?.());},k=I=>(f.add(I),f.size===1&&y.forEach(([R,E],_)=>{let T=R[3](b(_));y.set(_,[R,T]);}),()=>{f.delete(I),f.size===0&&y.forEach(([R,E],_)=>{E&&(E(),y.set(_,[R]));});}),D=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),N=t(D,{deleteProperty(I,A){let R=Reflect.get(I,A);C(A);let E=Reflect.deleteProperty(I,A);return E&&p(["delete",[A],R]),E},set(I,A,R,E){let _=Reflect.has(I,A),T=Reflect.get(I,A,E);if(_&&(e(T,R)||a.has(R)&&e(T,a.get(R))))return true;C(A),ru(R)&&(R=Ym(R)||R);let O=R;if(!Object.getOwnPropertyDescriptor(I,A)?.set)if(R instanceof Promise)R.then(L=>{Object.assign(R,{status:"fulfilled",value:L}),p(["resolve",[A],L]);}).catch(L=>{Object.assign(R,{status:"rejected",reason:L}),p(["reject",[A],L]);});else {!Mn.has(R)&&r(R)&&(O=Yi(R));let L=!qi.has(O)&&Mn.get(O);L&&S(A,L);}return Reflect.set(I,A,O,E),p(["set",[A],R,T]),true}});a.set(c,N);let ie=[D,h,i,k];return Mn.set(N,ie),Reflect.ownKeys(c).forEach(I=>{let A=Object.getOwnPropertyDescriptor(c,I);A.get||A.set?Object.defineProperty(D,I,A):N[I]=c[I];}),N})=>[l,Mn,qi,e,t,r,n,o,i,a,s],[eS]=JC();function Yi(e={}){return eS(e)}function Wo(e,t,r){let n=Mn.get(e);let o,i=[],a=n[3],s=false,c=a(u=>{if(i.push(u),r){t(i.splice(0));return}o||(o=Promise.resolve().then(()=>{o=void 0,s&&t(i.splice(0));}));});return s=true,()=>{s=false,c();}}function gn(e,t){let r=Mn.get(e);let[n,o,i]=r;return i(n,o(),t)}function zt(e){return qi.add(e),e}function Xm(e,t){Object.keys(t).forEach(o=>{if(Object.getOwnPropertyDescriptor(e,o))throw new Error("object property already defined");let i=t[o],{get:a,set:s}=typeof i=="function"?{get:i}:i,l={};l.get=()=>a(gn(n)),s&&(l.set=c=>s(n,c)),Object.defineProperty(e,o,l);});let n=Yi(e);return n}var Qm=e=>e[0],Jm=e=>e[e.length-1];function eg(e){for(;e.length>0;)e.pop();return e}var Zm=e=>e?.constructor.name==="Array",tS=(e,t)=>{if(e.length!==t.length)return false;for(let r=0;r<e.length;r++)if(!Ms(e[r],t[r]))return false;return true},Ms=(e,t)=>{if(Object.is(e,t))return true;if(e==null&&t!=null||e!=null&&t==null)return false;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(Zm(e)&&Zm(t))return tS(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return false;let r=Object.keys(t??Object.create(null)),n=r.length;for(let o=0;o<n;o++)if(!Reflect.has(e,r[o]))return false;for(let o=0;o<n;o++){let i=r[o];if(!Ms(e[i],t[i]))return false}return true},qr=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,er=e=>e,$s=()=>{},Ki=(...e)=>(...t)=>{e.forEach(function(r){r?.(...t);});},Xi=(()=>{let e=0;return ()=>(e++,e.toString(36))})();var Zi=e=>Array.isArray(e);var rg=e=>e!=null&&typeof e=="object",Qi=e=>rg(e)&&!Zi(e),Ji=e=>typeof e=="number"&&!Number.isNaN(e),jt=e=>typeof e=="string",hn=e=>typeof e=="function",ng=e=>e==null,nu=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),rS=e=>Object.prototype.toString.call(e),og=Function.prototype.toString,nS=og.call(Object),ig=e=>{if(!rg(e)||rS(e)!="[object Object]")return false;let t=Object.getPrototypeOf(e);if(t===null)return true;let r=nu(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&og.call(r)==nS};function Pt(e){if(!iS(e)||e===void 0)return e;let t=Reflect.ownKeys(e).filter(n=>typeof n=="string"),r={};for(let n of t){let o=e[n];o!==void 0&&(r[n]=Pt(o));}return r}var iS=e=>e&&typeof e=="object"&&e.constructor===Object;function Yr(...e){e.length===1?e[0]:e[1];e.length===2?e[0]:true;}function ea(...e){e.length===1?e[0]:e[1];e.length===2?e[0]:true;}function ag(e,t,r){typeof r.value=="object"&&(r.value=$n(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value;}function $n(e){if(typeof e!="object")return e;var t=0,r,n,o,i=Object.prototype.toString.call(e);if(i==="[object Object]"?o=Object.create(e.__proto__||null):i==="[object Array]"?o=Array(e.length):i==="[object Set]"?(o=new Set,e.forEach(function(a){o.add($n(a));})):i==="[object Map]"?(o=new Map,e.forEach(function(a,s){o.set($n(s),$n(a));})):i==="[object Date]"?o=new Date(+e):i==="[object RegExp]"?o=new RegExp(e.source,e.flags):i==="[object DataView]"?o=new e.constructor($n(e.buffer)):i==="[object ArrayBuffer]"?o=e.slice(0):i.slice(-6)==="Array]"&&(o=new e.constructor(e)),o){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)ag(o,n[t],Object.getOwnPropertyDescriptor(e,n[t]));for(t=0,n=Object.getOwnPropertyNames(e);t<n.length;t++)Object.hasOwnProperty.call(o,r=n[t])&&o[r]===e[r]||ag(o,r,Object.getOwnPropertyDescriptor(e,r));}return o||e}var aS=Object.defineProperty,sS=(e,t,r)=>t in e?aS(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,se=(e,t,r)=>sS(e,typeof t!="symbol"?t+"":t,r);function cg(e,...t){for(let r of t){let n=Pt(r);for(let o in n)ig(r[o])?(e[o]||(e[o]={}),cg(e[o],r[o])):e[o]=r[o];}return e}function sg(e){return $n(e)}function mr(e){return jt(e)?{type:e}:e}function bn(e){return e?Zi(e)?e.slice():[e]:[]}function ug(e){return Qi(e)&&e.predicate!=null}var lS=()=>true;function iu(e,t,r,n){return o=>jt(o)?!!e[o]?.(t,r,n):hn(o)?o(t,r,n):o.predicate(e)(t,r,n)}function cS(...e){return {predicate:t=>(r,n,o)=>e.map(iu(t,r,n,o)).some(Boolean)}}function uS(...e){return {predicate:t=>(r,n,o)=>e.map(iu(t,r,n,o)).every(Boolean)}}function dS(e){return {predicate:t=>(r,n,o)=>!iu(t,r,n,o)(e)}}var Ls={or:cS,and:uS,not:dS};function dg(e,t){return e=e??lS,(r,n,o)=>{if(jt(e)){let i=t[e];return hn(i)?i(r,n,o):i}return ug(e)?e.predicate(t)(r,n,o):e?.(r,n,o)}}function ou(e,t){return (r,n,o)=>ug(e)?e.predicate(t)(r,n,o):e}function pS(e){let t=e.computed??er({}),r=e.context??er({}),n=e.initial?e.states?.[e.initial]?.tags:[],o=Yi({value:e.initial??"",previousValue:"",event:er({}),previousEvent:er({}),context:Xm(r,t),done:false,tags:n??[],hasTag(i){return this.tags.includes(i)},matches(...i){return i.includes(this.value)},can(i){return er(this).nextEvents.includes(i)},get nextEvents(){let i=e.states?.[this.value]?.on??{},a=e?.on??{};return Object.keys({...i,...a})},get changed(){return this.event.value==="machine.init"||!this.previousValue?false:this.value!==this.previousValue}});return er(o)}function ta(e,t){return (r,n)=>{if(Ji(e))return e;if(hn(e))return e(r,n);if(jt(e)){let o=Number.parseFloat(e);if(!Number.isNaN(o))return o;if(t){let i=t?.[e];return ea(i==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${e}\`. It doesn't exist in \`options.delays\``),hn(i)?i(r,n):i}}}}function mS(e){return jt(e)?{target:e}:e}function gS(e,t){return (r,n,o)=>bn(e).map(mS).find(i=>dg(i.guard,t)(r,n,o)??i.target??i.actions)}var fg=class{constructor(e,t){se(this,"status","Not Started"),se(this,"state"),se(this,"initialState"),se(this,"initialContext"),se(this,"id"),se(this,"type","machine"),se(this,"activityEvents",new Map),se(this,"delayedEvents",new Map),se(this,"stateListeners",new Set),se(this,"doneListeners",new Set),se(this,"contextWatchers",new Set),se(this,"removeStateListener",$s),se(this,"parent"),se(this,"children",new Map),se(this,"guardMap"),se(this,"actionMap"),se(this,"delayMap"),se(this,"activityMap"),se(this,"sync"),se(this,"options"),se(this,"config"),se(this,"_created",()=>{let r=mr("machine.created");this.executeActions(this.config?.created,r);}),se(this,"start",r=>{if(this.state.value="",this.state.tags=[],this.status==="Running")return this;this.status="Running",this.removeStateListener=Wo(this.state,()=>{this.stateListeners.forEach(l=>{l(this.stateSnapshot);});},this.sync),this.setupContextWatchers(),this.executeActivities(mr("machine.start"),bn(this.config.activities),"machine.start"),this.executeActions(this.config.entry,mr("machine.start"));let n=mr("machine.init"),o=Qi(r)?r.value:r,i=Qi(r)?r.context:void 0;i&&this.setContext(i);let a={target:o??this.config.initial},s=this.getNextStateInfo(a,n);return this.initialState=s,this.performStateChangeEffects(this.state.value,s,n),this}),se(this,"setupContextWatchers",()=>{let{watch:r}=this.config;if(!r)return;let n=gn(this.state.context),o=Wo(this.state.context,()=>{let i=gn(this.state.context);for(let[a,s]of Object.entries(r))(this.options.compareFns?.[a]??Object.is)(n[a],i[a])||this.executeActions(s,this.state.event);n=i;});this.contextWatchers.add(o);}),se(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,mr("machine.stop")),this.executeActions(this.config.exit,mr("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this}),se(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear();}),se(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(r=>r()),this.contextWatchers.clear();}),se(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(r=>{r.forEach(n=>n());}),this.delayedEvents.clear();}),se(this,"stopActivities",r=>{r?(this.activityEvents.get(r)?.forEach(n=>n()),this.activityEvents.get(r)?.clear(),this.activityEvents.delete(r)):(this.activityEvents.forEach(n=>{n.forEach(o=>o()),n.clear();}),this.activityEvents.clear());}),se(this,"sendChild",(r,n)=>{let o=mr(r),i=qr(n,this.contextSnapshot),a=this.children.get(i);a||ea(`[@zag-js/core] Cannot send '${o.type}' event to unknown child`),a.send(o);}),se(this,"stopChild",r=>{this.children.has(r)||ea(`[@zag-js/core > stop-child] Cannot stop unknown child ${r}`),this.children.get(r).stop(),this.children.delete(r);}),se(this,"removeChild",r=>{this.children.delete(r);}),se(this,"stopChildren",()=>{this.children.forEach(r=>r.stop()),this.children.clear();}),se(this,"setParent",r=>{this.parent=r;}),se(this,"spawn",(r,n)=>{let o=qr(r);return n&&(o.id=n),o.type="machine.actor",o.setParent(this),this.children.set(o.id,er(o)),o.onDone(()=>{this.removeChild(o.id);}).start(),er(zt(o))}),se(this,"stopActivity",r=>{if(!this.state.value)return;let n=this.activityEvents.get(this.state.value);n?.get(r)?.(),n?.delete(r);}),se(this,"addActivityCleanup",(r,n,o)=>{r&&(this.activityEvents.has(r)?this.activityEvents.get(r)?.set(n,o):this.activityEvents.set(r,new Map([[n,o]])));}),se(this,"setState",r=>{this.state.previousValue=this.state.value,this.state.value=r;let n=this.getStateNode(r);r==null?eg(this.state.tags):this.state.tags=bn(n?.tags);}),se(this,"setContext",r=>{r&&cg(this.state.context,Pt(r));}),se(this,"setOptions",r=>{let n=Pt(r);this.actionMap={...this.actionMap,...n.actions},this.delayMap={...this.delayMap,...n.delays},this.activityMap={...this.activityMap,...n.activities},this.guardMap={...this.guardMap,...n.guards};}),se(this,"getStateNode",r=>{if(r)return this.config.states?.[r]}),se(this,"getNextStateInfo",(r,n)=>{let o=this.determineTransition(r,n),i=!o?.target,a=o?.target??this.state.value,s=this.state.value!==a,l=this.getStateNode(a),u={reenter:!i&&!s&&!o?.internal,transition:o,stateNode:l,target:a,changed:s};return this.log("NextState:",`[${n.type}]`,this.state.value,"---->",u.target),u}),se(this,"getAfterActions",(r,n)=>{let o,i=this.state.value;return {entry:()=>{o=globalThis.setTimeout(()=>{let a=this.getNextStateInfo(r,this.state.event);this.performStateChangeEffects(i,a,this.state.event);},n);},exit:()=>{globalThis.clearTimeout(o);}}}),se(this,"getDelayedEventActions",r=>{let n=this.getStateNode(r),o=this.state.event;if(!n||!n.after)return;let i=[],a=[];if(Zi(n.after)){let s=this.determineTransition(n.after,o);if(!s)return;if(!nu(s,"delay"))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(s)}`);let c=ta(s.delay,this.delayMap)(this.contextSnapshot,o),u=this.getAfterActions(s,c);return i.push(u.entry),a.push(u.exit),{entries:i,exits:a}}if(Qi(n.after))for(let s in n.after){let l=n.after[s],u=ta(s,this.delayMap)(this.contextSnapshot,o),d=this.getAfterActions(l,u);i.push(d.entry),a.push(d.exit);}return {entries:i,exits:a}}),se(this,"executeActions",(r,n)=>{let o=ou(r,this.guardMap)(this.contextSnapshot,n,this.guardMeta);for(let i of bn(o)){let a=jt(i)?this.actionMap?.[i]:i;Yr(jt(i)&&!a,`[@zag-js/core > execute-actions] No implementation found for action: \`${i}\``),a?.(this.state.context,n,this.meta);}}),se(this,"executeActivities",(r,n,o)=>{for(let i of n){let a=jt(i)?this.activityMap?.[i]:i;if(!a){Yr(`[@zag-js/core > execute-activity] No implementation found for activity: \`${i}\``);continue}let s=a(this.state.context,r,this.meta);if(s){let l=jt(i)?i:i.name||Xi();this.addActivityCleanup(o??this.state.value,l,s);}}}),se(this,"createEveryActivities",(r,n)=>{if(r)if(Zi(r)){let o=bn(r).find(l=>{let c=l.delay,d=ta(c,this.delayMap)(this.contextSnapshot,this.state.event);return dg(l.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??d!=null});if(!o)return;let a=ta(o.delay,this.delayMap)(this.contextSnapshot,this.state.event);n(()=>{let l=globalThis.setInterval(()=>{this.executeActions(o.actions,this.state.event);},a);return ()=>{globalThis.clearInterval(l);}});}else for(let o in r){let i=r?.[o],s=ta(o,this.delayMap)(this.contextSnapshot,this.state.event);n(()=>{let c=globalThis.setInterval(()=>{this.executeActions(i,this.state.event);},s);return ()=>{globalThis.clearInterval(c);}});}}),se(this,"setEvent",r=>{this.state.previousEvent=this.state.event,this.state.event=zt(mr(r));}),se(this,"performExitEffects",(r,n)=>{let o=this.state.value;if(o==="")return;let i=r?this.getStateNode(r):void 0;this.stopActivities(o);let a=ou(i?.exit,this.guardMap)(this.contextSnapshot,n,this.guardMeta),s=bn(a),l=this.delayedEvents.get(o);l&&s.push(...l),this.executeActions(s,n),this.delayedEvents.delete(o);}),se(this,"performEntryEffects",(r,n)=>{let o=this.getStateNode(r),i=bn(o?.activities);this.createEveryActivities(o?.every,c=>{i.unshift(c);}),i.length>0&&this.executeActivities(n,i);let a=ou(o?.entry,this.guardMap)(this.contextSnapshot,n,this.guardMeta),s=bn(a),l=this.getDelayedEventActions(r);o?.after&&l&&(this.delayedEvents.set(r,l?.exits),s.push(...l.entries)),this.executeActions(s,n),o?.type==="final"&&(this.state.done=true,this.doneListeners.forEach(c=>{c(this.stateSnapshot);}),this.stop());}),se(this,"performTransitionEffects",(r,n)=>{let o=this.determineTransition(r,n);this.executeActions(o?.actions,n);}),se(this,"performStateChangeEffects",(r,n,o)=>{this.setEvent(o);let i=n.changed||n.reenter;i&&this.performExitEffects(r,o),this.performTransitionEffects(n.transition,o),this.setState(n.target),i&&this.performEntryEffects(n.target,o);}),se(this,"determineTransition",(r,n)=>gS(r,this.guardMap)?.(this.contextSnapshot,n,this.guardMeta)),se(this,"sendParent",r=>{this.parent||ea("[@zag-js/core > send-parent] Cannot send event to an unknown parent");let n=mr(r);this.parent?.send(n);}),se(this,"log",(...r)=>{}),se(this,"send",r=>{let n=mr(r);this.transition(this.state.value,n);}),se(this,"transition",(r,n)=>{let o=jt(r)?this.getStateNode(r):r?.stateNode,i=mr(n);if(!o&&!this.config.on){let l=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${r}, \`event\`: ${i.type}`;Yr(l);return}let a=o?.on?.[i.type]??this.config.on?.[i.type],s=this.getNextStateInfo(a,i);return this.performStateChangeEffects(this.state.value,s,i),s.stateNode}),se(this,"subscribe",r=>(this.stateListeners.add(r),this.status==="Running"&&r(this.stateSnapshot),()=>{this.stateListeners.delete(r);})),se(this,"onDone",r=>(this.doneListeners.add(r),this)),se(this,"onTransition",r=>(this.stateListeners.add(r),this.status==="Running"&&r(this.stateSnapshot),this)),this.config=sg(e),this.options=sg(t??{}),this.id=this.config.id??`machine-${Xi()}`,this.guardMap=this.options?.guards??{},this.actionMap=this.options?.actions??{},this.delayMap=this.options?.delays??{},this.activityMap=this.options?.activities??{},this.sync=this.options?.sync??false,this.state=pS(this.config),this.initialContext=gn(this.state.context);}get stateSnapshot(){return er(gn(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){let e=this;return {id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){return e.initialState?.target??""}}}get meta(){return {state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:this.initialState?.target??"",getState:()=>this.stateSnapshot,getAction:e=>this.actionMap[e],getGuard:e=>this.guardMap[e]}}get guardMeta(){return {state:this.stateSnapshot}}get[Symbol.toStringTag](){return "Machine"}getHydrationState(){let e=this.getState();return {value:e.value,tags:e.tags}}},gr=(e,t)=>new fg(e,t),pg=e=>e instanceof fg||e?.type==="machine",hS=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),bS=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,lg=e=>{let t={},r;for(;r=bS.exec(e);)t[r[1]]=r[2];return t},yS=(e,t)=>{if(jt(e)){if(jt(t))return `${e};${t}`;e=lg(e);}else jt(t)&&(t=lg(t));return Object.assign({},e??{},t??{})};function Ns(...e){let t={};for(let r of e){for(let n in t){if(n.startsWith("on")&&typeof t[n]=="function"&&typeof r[n]=="function"){t[n]=Ki(r[n],t[n]);continue}if(n==="className"||n==="class"){t[n]=hS(t[n],r[n]);continue}if(n==="style"){t[n]=yS(t[n],r[n]);continue}t[n]=r[n]!==void 0?r[n]:t[n];}for(let n in r)t[n]===void 0&&(t[n]=r[n]);}return t}function mg(e){return new Proxy({},{get(){return e}})}var tr=()=>e=>Array.from(new Set(e));function de(...e){let t={};for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="function"&&(n=n()),n){let o=Object.getOwnPropertyDescriptors(n);for(let i in o)i in t||Object.defineProperty(t,i,{enumerable:true,get(){let a={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let s=0;s<e.length;s++){let l=e[s];typeof l=="function"&&(l=l()),a=Ns(a,{[i]:(l||{})[i]});}return a[i]}for(let s=e.length-1;s>=0;s--){let l,c=e[s];if(typeof c=="function"&&(c=c()),l=(c||{})[i],l!==void 0)return l}}});}}return t}var vS=e=>Array.isArray(e),xS=e=>e!=null&&typeof e=="object",wS=e=>xS(e)&&!vS(e),TS=e=>typeof e=="number"&&!Number.isNaN(e),hg=e=>typeof e=="string",_S=Function.prototype.toString;_S.call(Object);var gg={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},CS=e=>e.startsWith("--")?e:AS(e);function SS(e){return e in gg?gg[e]:e}var rr=mg(e=>{let t={};for(let r in e){let n=e[r];if(!(r==="readOnly"&&n===false)){if(r==="style"&&wS(n)){t.style=kS(n);continue}if(r==="children"){hg(n)&&(t.textContent=n);continue}t[SS(r)]=n;}}return t});function kS(e){let t={};for(let r in e){let n=e[r];!hg(n)&&!TS(n)||(t[CS(r)]=n);}return t}var PS=/[A-Z]/g,ES=/^ms-/;function IS(e){return "-"+e.toLowerCase()}var au={};function AS(e){if(au.hasOwnProperty(e))return au[e];var t=e.replace(PS,IS);return au[e]=ES.test(t)?"-"+t:t}function bg(e,t){let{actions:r,context:n}=t??{},[o,i]=Fm(e.getState());return ce(()=>{let a=e.subscribe(s=>{i(Es(s));});me(()=>{a();});}),Se(()=>{let a=typeof n=="function"?n():n;e.setContext(a);}),Se(()=>{e.setOptions({actions:r});}),o}function yg(e){return [bg(e),e.send]}function OS(e,t){let{state:r,context:n}=t??{},o=(()=>{let i=typeof e=="function"?e():e,a=typeof n=="function"?n():n;return a&&i.setContext(a),i._created(),i})();return ce(()=>{o.start(r),me(()=>{o.stop();});}),o}function Rr(e,t){let r=OS(e,t);return [bg(r,t),r.send,r]}var su=e=>r=>{let[n,o]=rt(r,["asChild"]);if(n.asChild){let i=a=>{let[,s]=rt(o,["ref"]);return de(s,a)};return n.asChild(i)}return m(Vf,Re({component:e},o))};function RS(){let e=new Map;return new Proxy(su,{apply(t,r,n){return su(n[0])},get(t,r){let n=r;return e.has(n)||e.set(n,su(n)),e.get(n)}})}var ve=RS();function vg(e,t,r){let n=e.matches("mounted","unmountSuspended");return {skip:!e.context.initial&&n,present:n,setNode(o){o&&t({type:"NODE.SET",node:o});},unmount(){t({type:"UNMOUNT"});}}}function Bs(e){return e?.animationName||"none"}function xg(e){return gr({initial:e.present?"mounted":"unmounted",context:{node:null,styles:null,unmountAnimationName:null,prevAnimationName:null,present:false,initial:false,...e},exit:["clearInitial"],watch:{present:["setInitial","syncPresence"]},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]},"UNMOUNT.SUSPEND":"unmountSuspended"}},unmountSuspended:{activities:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},"ANIMATION.END":{target:"unmounted",actions:["invokeOnExitComplete"]},UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]}}},unmounted:{entry:["clearPrevAnimationName"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}}},{actions:{setInitial(t){t.initial=true;},clearInitial(t){t.initial=false;},invokeOnExitComplete(t){t.onExitComplete?.();},setNode(t,r){t.node=zt(r.node);},setStyles(t,r){let n=r.node.ownerDocument.defaultView||window;t.styles=zt(n.getComputedStyle(r.node));},syncPresence(t,r,{send:n}){if(t.present){n({type:"MOUNT",src:"presence.changed"});return}let o=Bs(t.styles);(t.immediate?queueMicrotask:requestAnimationFrame)(()=>{t.unmountAnimationName=o,o==="none"||o===t.prevAnimationName||t.styles?.display==="none"||t.styles?.animationDuration==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"});});},setPrevAnimationName(t){(t.immediate?queueMicrotask:requestAnimationFrame)(()=>{t.prevAnimationName=Bs(t.styles);});},clearPrevAnimationName(t){t.prevAnimationName=null;}},activities:{trackAnimationEvents(t,r,{send:n}){let o=t.node;if(!o)return;let i=s=>{(s.composedPath?.()?.[0]??s.target)===o&&(t.prevAnimationName=Bs(t.styles));},a=s=>{let l=Bs(t.styles);(s.composedPath?.()?.[0]??s.target)===o&&l===t.unmountAnimationName&&n({type:"UNMOUNT",src:"animationend"});};return o.addEventListener("animationstart",i),o.addEventListener("animationcancel",a),o.addEventListener("animationend",a),()=>{o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",a),o.removeEventListener("animationend",a);}}}})}tr()(["onExitComplete","present","immediate"]);var Vo=e=>xt()(e,["immediate","lazyMount","onExitComplete","present","unmountOnExit"]),Ln=e=>{let[t,r]=Gi(e),[n,o]=M(false),[i,a]=Rr(xg(r),{context:r}),s=B(()=>vg(i,a));return Se(()=>{s().present&&o(true);}),B(()=>({unmounted:!s().present&&!n()&&t.lazyMount||t.unmountOnExit&&!s().present&&n(),present:s().present,presenceProps:{ref:s().setNode,hidden:!s().present,"data-state":r.present?"open":"closed"}}))};var[zo,yn]=st({hookName:"usePresenceContext",providerName:"<PresenceProvider />"});var Ht=e=>e?"":void 0;var Tg=2147483647,MS=1,$S=9,LS=11,Fs=e=>typeof e=="object"&&e!==null,wt=e=>Fs(e)&&e.nodeType===MS&&typeof e.nodeName=="string",_g=e=>Fs(e)&&e.nodeType===$S,NS=e=>Fs(e)&&e===e.window;var Cg=e=>wt(e)?e.localName||"":"#document";function BS(e){return ["html","body","#document"].includes(Cg(e))}var FS=e=>Fs(e)&&e.nodeType!==void 0,cu=e=>FS(e)&&e.nodeType===LS&&"host"in e;function nr(e,t){return !e||!t||!wt(e)||!wt(t)?false:e===t||e.contains(t)}function hr(e){return _g(e)?e:NS(e)?e.document:e?.ownerDocument??document}function US(e){return hr(e).documentElement}function Dr(e){return cu(e)?Dr(e.host):_g(e)?e.defaultView??window:wt(e)?e.ownerDocument?.defaultView??window:window}function jS(e){let t=e.activeElement;for(;t?.shadowRoot;){let r=t.shadowRoot.activeElement;if(r===t)break;t=r;}return t}var Sg=()=>typeof document<"u";function HS(){return navigator.userAgentData?.platform??navigator.platform}var uu=e=>Sg()&&e.test(HS()),WS=e=>Sg()&&e.test(navigator.userAgent);var kg=()=>uu(/^Mac/);var Pg=()=>WS(/firefox\//i),VS=()=>uu(/mac|iphone|ipad|ipod/i),Eg=()=>uu(/iP(hone|ad|od)|iOS/);function zS(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function Mr(e){return zS(e)?.[0]??e.target}var Ig=e=>nr(e.currentTarget,Mr(e));function du(e){let t=e.currentTarget;if(!t)return false;let r=VS();if(r&&!e.metaKey||!r&&!e.ctrlKey)return false;let n=t.localName;return n==="a"||n==="button"&&t.type==="submit"||n==="input"&&t.type==="submit"}function fu(e){let t=e.currentTarget;if(!t)return false;let r=t.localName;return e.altKey?r==="a"||r==="button"&&t.type==="submit"||r==="input"&&t.type==="submit":false}var pu=e=>e.id;function GS(e,t,r=pu){return e.find(n=>r(n)===t)}function mu(e,t,r=pu){let n=GS(e,t,r);return n?e.indexOf(n):-1}function Ag(e,t,r=true){let n=mu(e,t);return n=r?(n+1)%e.length:Math.min(n+1,e.length-1),e[n]}function Og(e,t,r=true){let n=mu(e,t);return n===-1?r?e[e.length-1]:null:(n=r?(n-1+e.length)%e.length:Math.max(0,n-1),e[n])}var qS=e=>e.split("").map(t=>{let r=t.charCodeAt(0);return r>0&&r<128?t:r>=128&&r<=255?`/x${r.toString(16)}`.replace("/","\\"):""}).join("").trim(),YS=e=>qS(e.dataset.valuetext??e.textContent??""),KS=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase()),XS=(e,t)=>e.map((r,n)=>e[(Math.max(t,0)+n)%e.length]);function ZS(e,t,r,n=pu){let o=r?mu(e,r,n):-1,i=r?XS(e,o):e;return t.length===1&&(i=i.filter(s=>n(s)!==r)),i.find(s=>KS(YS(s),t))}function QS(e,t){let{state:r,activeId:n,key:o,timeout:i=350,itemToId:a}=t,s=r.keysSoFar+o,c=s.length>1&&Array.from(s).every(g=>g===s[0])?s[0]:s,u=e.slice(),d=ZS(u,c,n,a);function f(){clearTimeout(r.timer),r.timer=-1;}function p(g){r.keysSoFar=g,f(),g!==""&&(r.timer=+setTimeout(()=>{p(""),f();},i));}return p(s),d}var gu=Object.assign(QS,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:JS});function JS(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}function ek(e){if(Cg(e)==="html")return e;let t=e.assignedSlot||e.parentNode||cu(e)&&e.host||US(e);return cu(t)?t.host:t}var Rg=e=>typeof e=="object"&&e!==null&&e.nodeType===1,tk=e=>Rg(e)&&e.tagName==="IFRAME";function rk(e){return Rg(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:false}function nk(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}var Dg="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function Us(e){return !e||e.closest("[inert]")?false:e.matches(Dg)&&rk(e)}function hu(e,t){if(!e)return [];let r=Array.from(e.querySelectorAll(Dg)),n=r.filter(wg);return n.forEach((o,i)=>{if(tk(o)&&o.contentDocument){let a=o.contentDocument.body,s=hu(a);n.splice(i,1,...s);}}),!n.length&&t?r:n}function wg(e){return e!=null&&e.tabIndex>0?true:Us(e)&&!nk(e)}function ok(e,t){let r=hu(e,t),n=r[0]||null,o=r[r.length-1]||null;return [n,o]}function Mg(e){let{root:t,getInitialEl:r,filter:n,enabled:o=true}=e;if(!o)return;let i=null;if(i||(i=typeof r=="function"?r():r),i||(i=t?.querySelector("[data-autofocus],[autofocus]")),!i){let a=hu(t);i=n?a.filter(n)[0]:a[0];}return i||t||void 0}function $g(e){let t=e.currentTarget;if(!t)return false;let[r,n]=ok(t),o=t.ownerDocument||document;return !(o.activeElement===r&&e.shiftKey||o.activeElement===n&&!e.shiftKey||!r&&!n)}function bu(e){if(e==null||!wt(e))return false;try{let t=Dr(e);return e instanceof t.HTMLInputElement&&e.selectionStart!=null||/(textarea|select)/.test(e.localName)||e.isContentEditable}catch{return false}}var ik=/auto|scroll|overlay|hidden|clip/;function Lg(e){let t=Dr(e),{overflow:r,overflowX:n,overflowY:o,display:i}=t.getComputedStyle(e);return ik.test(r+o+n)&&!["inline","contents"].includes(i)}function Ng(e){let t=new Set;function r(n){let o=globalThis.requestAnimationFrame(n);t.add(()=>globalThis.cancelAnimationFrame(o));}return r(()=>r(e)),function(){t.forEach(o=>o());}}function lt(e){let t=globalThis.requestAnimationFrame(e);return ()=>{globalThis.cancelAnimationFrame(t);}}function ak(e,t){if(!e)return;let{attributes:r,callback:n}=t,o=e.ownerDocument.defaultView||window,i=new o.MutationObserver(a=>{for(let s of a)s.type==="attributes"&&s.attributeName&&r.includes(s.attributeName)&&n(s);});return i.observe(e,{attributes:true,attributeFilter:r}),()=>i.disconnect()}function Bg(e,t){let n=lt,o=[];return o.push(n(()=>{let i=typeof e=="function"?e():e;o.push(ak(i,t));})),()=>{o.forEach(i=>i?.());}}function yu(e){let t=ek(e);return BS(t)?hr(t).body:wt(t)&&Lg(t)?t:yu(t)}function js(e,t){return Array.from(e?.querySelectorAll(t)??[])}function vn(e){let t={getRootNode:r=>r.getRootNode?.()??document,getDoc:r=>hr(t.getRootNode(r)),getWin:r=>t.getDoc(r).defaultView??window,getActiveElement:r=>jS(t.getRootNode(r)),isActiveElement:(r,n)=>n===t.getActiveElement(r),getById:(r,n)=>t.getRootNode(r).getElementById(n),setValue:(r,n)=>{if(r==null||n==null)return;let o=n.toString();r.value!==o&&(r.value=n.toString());}};return {...t,...e}}function sk(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function Fg(e,t){let{rootEl:r,...n}=t||{};!e||!r||!Lg(r)||!sk(r)||e.scrollIntoView(n);}var lu=new WeakMap;function lk(e,t,r){lu.has(e)||lu.set(e,new Map);let n=lu.get(e),o=n.get(t);if(!o)return n.set(t,r()),()=>{n.get(t)?.(),n.delete(t);};let i=r(),a=()=>{i(),o(),n.delete(t);};return n.set(t,a),()=>{n.get(t)===a&&(i(),n.set(t,o));}}function Ug(e,t){return e?lk(e,"style",()=>{let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n;}}):()=>{}}var ck=1e3/60;function uk(e,t){let r=e();if(wt(r)&&r.isConnected)return t(r),()=>{};{let n=setInterval(()=>{let o=e();wt(o)&&o.isConnected&&(t(o),clearInterval(n));},ck);return ()=>clearInterval(n)}}function jg(e,t){let r=[];return e?.forEach(n=>{let o=uk(n,t);r.push(o);}),()=>{r.forEach(n=>n());}}var[s$,Go]=st({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:false,defaultValue:()=>({dir:"ltr",locale:"en-US"})});var dk=e=>typeof e=="function",Hg=(e,...t)=>dk(e)?e(...t):e;var[fk,Nn]=st({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:false,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})}),pk=w("<span hidden>"),Bn=e=>{let[t,r]=M(),n=()=>Hg(e.value)??t()?.ownerDocument??document,o=B(()=>({getRootNode:n,getDocument:()=>hr(n()),getWindow:()=>Dr(n())}));return m(fk,{value:o,get children(){return [B(()=>e.children),m(W,{get when(){return !e.value},get children(){var i=pk();return be(r,i),i}})]}})};var mk=Object.defineProperty,xn=(e,t)=>{for(var r in t)mk(e,r,{get:t[r],enumerable:true});};var br=(e,t=[])=>({parts:(...r)=>{if(gk(t))return br(e,r);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...r)=>br(e,[...t,...r]),rename:r=>br(r,t),keys:()=>t,build:()=>[...new Set(t)].reduce((r,n)=>Object.assign(r,{[n]:{selector:[`&[data-scope="${qo(e)}"][data-part="${qo(n)}"]`,`& [data-scope="${qo(e)}"][data-part="${qo(n)}"]`].join(", "),attrs:{"data-scope":qo(e),"data-part":qo(n)}}}),{})}),qo=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),gk=e=>e.length===0;var Wg=["top","right","bottom","left"];var $r=Math.min,Dt=Math.max,na=Math.round,oa=Math.floor,Kr=e=>({x:e,y:e}),hk={left:"right",right:"left",bottom:"top",top:"bottom"},bk={start:"end",end:"start"};function Ws(e,t,r){return Dt(e,$r(t,r))}function Lr(e,t){return typeof e=="function"?e(t):e}function Nr(e){return e.split("-")[0]}function Fn(e){return e.split("-")[1]}function Vs(e){return e==="x"?"y":"x"}function zs(e){return e==="y"?"height":"width"}function yr(e){return ["top","bottom"].includes(Nr(e))?"y":"x"}function Gs(e){return Vs(yr(e))}function Vg(e,t,r){r===void 0&&(r=false);let n=Fn(e),o=Gs(e),i=zs(o),a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=ra(a)),[a,ra(a)]}function zg(e){let t=ra(e);return [Hs(e),t,Hs(t)]}function Hs(e){return e.replace(/start|end/g,t=>bk[t])}function yk(e,t,r){let n=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case "top":case "bottom":return r?t?o:n:t?n:o;case "left":case "right":return t?i:a;default:return []}}function Gg(e,t,r,n){let o=Fn(e),i=yk(Nr(e),r==="start",n);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Hs)))),i}function ra(e){return e.replace(/left|right|bottom|top/g,t=>hk[t])}function vk(e){return {top:0,right:0,bottom:0,left:0,...e}}function vu(e){return typeof e!="number"?vk(e):{top:e,right:e,bottom:e,left:e}}function Un(e){let{x:t,y:r,width:n,height:o}=e;return {width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function qg(e,t,r){let{reference:n,floating:o}=e,i=yr(t),a=Gs(t),s=zs(a),l=Nr(t),c=i==="y",u=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[s]/2-o[s]/2,p;switch(l){case "top":p={x:u,y:n.y-o.height};break;case "bottom":p={x:u,y:n.y+n.height};break;case "right":p={x:n.x+n.width,y:d};break;case "left":p={x:n.x-o.width,y:d};break;default:p={x:n.x,y:n.y};}switch(Fn(t)){case "start":p[a]-=f*(r&&c?-1:1);break;case "end":p[a]+=f*(r&&c?-1:1);break}return p}var Xg=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t)),c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=qg(c,n,l),f=n,p={},g=0;for(let h=0;h<s.length;h++){let{name:b,fn:y}=s[h],{x:S,y:C,data:k,reset:D}=await y({x:u,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});u=S??u,d=C??d,p={...p,[b]:{...p[b],...k}},D&&g<=50&&(g++,typeof D=="object"&&(D.placement&&(f=D.placement),D.rects&&(c=D.rects===true?await a.getElementRects({reference:e,floating:t,strategy:o}):D.rects),{x:u,y:d}=qg(c,f,l)),h=-1);}return {x:u,y:d,placement:f,strategy:o,middlewareData:p}};async function Yo(e,t){var r;t===void 0&&(t={});let{x:n,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=false,padding:p=0}=Lr(t,e),g=vu(p),b=s[f?d==="floating"?"reference":"floating":d],y=Un(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),S=d==="floating"?{x:n,y:o,width:a.floating.width,height:a.floating.height}:a.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),k=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},D=Un(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:S,offsetParent:C,strategy:l}):S);return {top:(y.top-D.top+g.top)/k.y,bottom:(D.bottom-y.bottom+g.bottom)/k.y,left:(y.left-D.left+g.left)/k.x,right:(D.right-y.right+g.right)/k.x}}var Zg=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Lr(e,t)||{};if(c==null)return {};let d=vu(u),f={x:r,y:n},p=Gs(o),g=zs(p),h=await a.getDimensions(c),b=p==="y",y=b?"top":"left",S=b?"bottom":"right",C=b?"clientHeight":"clientWidth",k=i.reference[g]+i.reference[p]-f[p]-i.floating[g],D=f[p]-i.reference[p],U=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c)),N=U?U[C]:0;(!N||!await(a.isElement==null?void 0:a.isElement(U)))&&(N=s.floating[C]||i.floating[g]);let ie=k/2-D/2,I=N/2-h[g]/2-1,A=$r(d[y],I),R=$r(d[S],I),E=A,_=N-h[g]-R,T=N/2-h[g]/2+ie,O=Ws(E,T,_),L=!l.arrow&&Fn(o)!=null&&T!==O&&i.reference[g]/2-(T<E?A:R)-h[g]/2<0,z=L?T<E?T-E:T-_:0;return {[p]:f[p]+z,data:{[p]:O,centerOffset:T-O-z,...L&&{alignmentOffset:z}},reset:L}}});var Qg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;let{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=true,crossAxis:d=true,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=true,...b}=Lr(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return {};let y=Nr(o),S=yr(s),C=Nr(s)===s,k=await(l.isRTL==null?void 0:l.isRTL(c.floating)),D=f||(C||!h?[ra(s)]:zg(s)),U=g!=="none";!f&&U&&D.push(...Gg(s,h,g,k));let N=[s,...D],ie=await Yo(t,b),I=[],A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&I.push(ie[y]),d){let T=Vg(o,a,k);I.push(ie[T[0]],ie[T[1]]);}if(A=[...A,{placement:o,overflows:I}],!I.every(T=>T<=0)){var R,E;let T=(((R=i.flip)==null?void 0:R.index)||0)+1,O=N[T];if(O&&(!(d==="alignment"?S!==yr(O):false)||A.every(ne=>ne.overflows[0]>0&&yr(ne.placement)===S)))return {data:{index:T,overflows:A},reset:{placement:O}};let L=(E=A.filter(z=>z.overflows[0]<=0).sort((z,ne)=>z.overflows[1]-ne.overflows[1])[0])==null?void 0:E.placement;if(!L)switch(p){case "bestFit":{var _;let z=(_=A.filter(ne=>{if(U){let K=yr(ne.placement);return K===S||K==="y"}return true}).map(ne=>[ne.placement,ne.overflows.filter(K=>K>0).reduce((K,Ie)=>K+Ie,0)]).sort((ne,K)=>ne[1]-K[1])[0])==null?void 0:_[0];z&&(L=z);break}case "initialPlacement":L=s;break}if(o!==L)return {reset:{placement:L}}}return {}}}};function Yg(e,t){return {top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kg(e){return Wg.some(t=>e[t]>=0)}var Jg=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:n="referenceHidden",...o}=Lr(e,t);switch(n){case "referenceHidden":{let i=await Yo(t,{...o,elementContext:"reference"}),a=Yg(i,r.reference);return {data:{referenceHiddenOffsets:a,referenceHidden:Kg(a)}}}case "escaped":{let i=await Yo(t,{...o,altBoundary:true}),a=Yg(i,r.floating);return {data:{escapedOffsets:a,escaped:Kg(a)}}}default:return {}}}}};async function xk(e,t){let{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),a=Nr(r),s=Fn(r),l=yr(r)==="y",c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d=Lr(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof g=="number"&&(p=s==="end"?g*-1:g),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}var eh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:o,y:i,placement:a,middlewareData:s}=t,l=await xk(t,e);return a===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},th=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:o}=t,{mainAxis:i=true,crossAxis:a=false,limiter:s={fn:b=>{let{x:y,y:S}=b;return {x:y,y:S}}},...l}=Lr(e,t),c={x:r,y:n},u=await Yo(t,l),d=yr(Nr(o)),f=Vs(d),p=c[f],g=c[d];if(i){let b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",S=p+u[b],C=p-u[y];p=Ws(S,p,C);}if(a){let b=d==="y"?"top":"left",y=d==="y"?"bottom":"right",S=g+u[b],C=g-u[y];g=Ws(S,g,C);}let h=s.fn({...t,[f]:p,[d]:g});return {...h,data:{x:h.x-r,y:h.y-n,enabled:{[f]:i,[d]:a}}}}}},rh=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:r,y:n,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=true,crossAxis:c=true}=Lr(e,t),u={x:r,y:n},d=yr(o),f=Vs(d),p=u[f],g=u[d],h=Lr(s,t),b=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){let C=f==="y"?"height":"width",k=i.reference[f]-i.floating[C]+b.mainAxis,D=i.reference[f]+i.reference[C]-b.mainAxis;p<k?p=k:p>D&&(p=D);}if(c){var y,S;let C=f==="y"?"width":"height",k=["top","left"].includes(Nr(o)),D=i.reference[d]-i.floating[C]+(k&&((y=a.offset)==null?void 0:y[d])||0)+(k?0:b.crossAxis),U=i.reference[d]+i.reference[C]+(k?0:((S=a.offset)==null?void 0:S[d])||0)-(k?b.crossAxis:0);g<D?g=D:g>U&&(g=U);}return {[f]:p,[d]:g}}}},nh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;let{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=Lr(e,t),u=await Yo(t,c),d=Nr(o),f=Fn(o),p=yr(o)==="y",{width:g,height:h}=i.floating,b,y;d==="top"||d==="bottom"?(b=d,y=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,b=f==="end"?"top":"bottom");let S=h-u.top-u.bottom,C=g-u.left-u.right,k=$r(h-u[b],S),D=$r(g-u[y],C),U=!t.middlewareData.shift,N=k,ie=D;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(ie=C),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=S),U&&!f){let A=Dt(u.left,0),R=Dt(u.right,0),E=Dt(u.top,0),_=Dt(u.bottom,0);p?ie=g-2*(A!==0||R!==0?A+R:Dt(u.left,u.right)):N=h-2*(E!==0||_!==0?E+_:Dt(u.top,u.bottom));}await l({...t,availableWidth:ie,availableHeight:N});let I=await a.getDimensions(s.floating);return g!==I.width||h!==I.height?{reset:{rects:true}}:{}}}};function qs(){return typeof window<"u"}function jn(e){return ih(e)?(e.nodeName||"").toLowerCase():"#document"}function Wt(e){var t;return (e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vr(e){var t;return (t=(ih(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ih(e){return qs()?e instanceof Node||e instanceof Wt(e).Node:false}function or(e){return qs()?e instanceof Element||e instanceof Wt(e).Element:false}function xr(e){return qs()?e instanceof HTMLElement||e instanceof Wt(e).HTMLElement:false}function oh(e){return !qs()||typeof ShadowRoot>"u"?false:e instanceof ShadowRoot||e instanceof Wt(e).ShadowRoot}function Xo(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=ir(e);return /auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function ah(e){return ["table","td","th"].includes(jn(e))}function ia(e){return [":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return false}})}function Ys(e){let t=Ks(),r=or(e)?ir(e):e;return ["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":false)||(r.containerType?r.containerType!=="normal":false)||!t&&(r.backdropFilter?r.backdropFilter!=="none":false)||!t&&(r.filter?r.filter!=="none":false)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function sh(e){let t=Xr(e);for(;xr(t)&&!Hn(t);){if(Ys(t))return t;if(ia(t))return null;t=Xr(t);}return null}function Ks(){return typeof CSS>"u"||!CSS.supports?false:CSS.supports("-webkit-backdrop-filter","none")}function Hn(e){return ["html","body","#document"].includes(jn(e))}function ir(e){return Wt(e).getComputedStyle(e)}function aa(e){return or(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xr(e){if(jn(e)==="html")return e;let t=e.assignedSlot||e.parentNode||oh(e)&&e.host||vr(e);return oh(t)?t.host:t}function lh(e){let t=Xr(e);return Hn(t)?e.ownerDocument?e.ownerDocument.body:e.body:xr(t)&&Xo(t)?t:lh(t)}function Ko(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=true);let o=lh(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),a=Wt(o);if(i){let s=Xs(a);return t.concat(a,a.visualViewport||[],Xo(o)?o:[],s&&r?Ko(s):[])}return t.concat(o,Ko(o,[],r))}function Xs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dh(e){let t=ir(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=xr(e),i=o?e.offsetWidth:r,a=o?e.offsetHeight:n,s=na(r)!==i||na(n)!==a;return s&&(r=i,n=a),{width:r,height:n,$:s}}function Tu(e){return or(e)?e:e.contextElement}function Zo(e){let t=Tu(e);if(!xr(t))return Kr(1);let r=t.getBoundingClientRect(),{width:n,height:o,$:i}=dh(t),a=(i?na(r.width):r.width)/n,s=(i?na(r.height):r.height)/o;return (!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var wk=Kr(0);function fh(e){let t=Wt(e);return !Ks()||!t.visualViewport?wk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Tk(e,t,r){return t===void 0&&(t=false),!r||t&&r!==Wt(e)?false:t}function Wn(e,t,r,n){t===void 0&&(t=false),r===void 0&&(r=false);let o=e.getBoundingClientRect(),i=Tu(e),a=Kr(1);t&&(n?or(n)&&(a=Zo(n)):a=Zo(e));let s=Tk(i,r,n)?fh(i):Kr(0),l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){let f=Wt(i),p=n&&or(n)?Wt(n):n,g=f,h=Xs(g);for(;h&&n&&p!==g;){let b=Zo(h),y=h.getBoundingClientRect(),S=ir(h),C=y.left+(h.clientLeft+parseFloat(S.paddingLeft))*b.x,k=y.top+(h.clientTop+parseFloat(S.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=C,c+=k,g=Wt(h),h=Xs(g);}}return Un({width:u,height:d,x:l,y:c})}function _k(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,i=o==="fixed",a=vr(n),s=t?ia(t.floating):false;if(n===a||s&&i)return r;let l={scrollLeft:0,scrollTop:0},c=Kr(1),u=Kr(0),d=xr(n);if((d||!d&&!i)&&((jn(n)!=="body"||Xo(a))&&(l=aa(n)),xr(n))){let f=Wn(n);c=Zo(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop;}return {width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x,y:r.y*c.y-l.scrollTop*c.y+u.y}}function Ck(e){return Array.from(e.getClientRects())}function wu(e,t){let r=aa(e).scrollLeft;return t?t.left+r:Wn(vr(e)).left+r}function Sk(e){let t=vr(e),r=aa(e),n=e.ownerDocument.body,o=Dt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Dt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),a=-r.scrollLeft+wu(e),s=-r.scrollTop;return ir(n).direction==="rtl"&&(a+=Dt(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:s}}function kk(e,t){let r=Wt(e),n=vr(e),o=r.visualViewport,i=n.clientWidth,a=n.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;let c=Ks();(!c||c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop);}return {width:i,height:a,x:s,y:l}}function Pk(e,t){let r=Wn(e,true,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=xr(e)?Zo(e):Kr(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=o*i.x,c=n*i.y;return {width:a,height:s,x:l,y:c}}function ch(e,t,r){let n;if(t==="viewport")n=kk(e,r);else if(t==="document")n=Sk(vr(e));else if(or(t))n=Pk(t,r);else {let o=fh(e);n={...t,x:t.x-o.x,y:t.y-o.y};}return Un(n)}function ph(e,t){let r=Xr(e);return r===t||!or(r)||Hn(r)?false:ir(r).position==="fixed"||ph(r,t)}function Ek(e,t){let r=t.get(e);if(r)return r;let n=Ko(e,[],false).filter(s=>or(s)&&jn(s)!=="body"),o=null,i=ir(e).position==="fixed",a=i?Xr(e):e;for(;or(a)&&!Hn(a);){let s=ir(a),l=Ys(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Xo(a)&&!l&&ph(e,a))?n=n.filter(u=>u!==a):o=s,a=Xr(a);}return t.set(e,n),n}function Ik(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,a=[...r==="clippingAncestors"?ia(t)?[]:Ek(t,this._c):[].concat(r),n],s=a[0],l=a.reduce((c,u)=>{let d=ch(t,u,o);return c.top=Dt(d.top,c.top),c.right=$r(d.right,c.right),c.bottom=$r(d.bottom,c.bottom),c.left=Dt(d.left,c.left),c},ch(t,s,o));return {width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ak(e){let{width:t,height:r}=dh(e);return {width:t,height:r}}function Ok(e,t,r){let n=xr(t),o=vr(t),i=r==="fixed",a=Wn(e,true,i,t),s={scrollLeft:0,scrollTop:0},l=Kr(0);if(n||!n&&!i)if((jn(t)!=="body"||Xo(o))&&(s=aa(t)),n){let p=Wn(t,true,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop;}else o&&(l.x=wu(o));let c=0,u=0;if(o&&!n&&!i){let p=o.getBoundingClientRect();u=p.top+s.scrollTop,c=p.left+s.scrollLeft-wu(o,p);}let d=a.left+s.scrollLeft-l.x-c,f=a.top+s.scrollTop-l.y-u;return {x:d,y:f,width:a.width,height:a.height}}function xu(e){return ir(e).position==="static"}function uh(e,t){if(!xr(e)||ir(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return vr(e)===r&&(r=r.ownerDocument.body),r}function mh(e,t){let r=Wt(e);if(ia(e))return r;if(!xr(e)){let o=Xr(e);for(;o&&!Hn(o);){if(or(o)&&!xu(o))return o;o=Xr(o);}return r}let n=uh(e,t);for(;n&&ah(n)&&xu(n);)n=uh(n,t);return n&&Hn(n)&&xu(n)&&!Ys(n)?r:n||sh(e)||r}var Rk=async function(e){let t=this.getOffsetParent||mh,r=this.getDimensions,n=await r(e.floating);return {reference:Ok(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Dk(e){return ir(e).direction==="rtl"}var Mk={convertOffsetParentRelativeRectToViewportRelativeRect:_k,getDocumentElement:vr,getClippingRect:Ik,getOffsetParent:mh,getElementRects:Rk,getClientRects:Ck,getDimensions:Ak,getScale:Zo,isElement:or,isRTL:Dk};function $k(e,t){let r=null,n,o=vr(e);function i(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null;}function a(s,l){s===void 0&&(s=false),l===void 0&&(l=1),i();let{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;let p=oa(u),g=oa(o.clientWidth-(c+d)),h=oa(o.clientHeight-(u+f)),b=oa(c),S={rootMargin:-p+"px "+-g+"px "+-h+"px "+-b+"px",threshold:Dt(0,$r(1,l))||1},C=true;function k(D){let U=D[0].intersectionRatio;if(U!==l){if(!C)return a();U?a(false,U):n=setTimeout(()=>{a(false,1e-7);},1e3);}C=false;}try{r=new IntersectionObserver(k,{...S,root:o.ownerDocument});}catch{r=new IntersectionObserver(k,S);}r.observe(e);}return a(true),i}function gh(e,t,r,n){n===void 0&&(n={});let{ancestorScroll:o=true,ancestorResize:i=true,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=false}=n,c=Tu(e),u=o||i?[...c?Ko(c):[],...Ko(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:true}),i&&y.addEventListener("resize",r);});let d=c&&s?$k(c,r):null,f=-1,p=null;a&&(p=new ResizeObserver(y=>{let[S]=y;S&&S.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t);})),r();}),c&&!l&&p.observe(c),p.observe(t));let g,h=l?Wn(e):null;l&&b();function b(){let y=Wn(e);h&&(y.x!==h.x||y.y!==h.y||y.width!==h.width||y.height!==h.height)&&r(),h=y,g=requestAnimationFrame(b);}return r(),()=>{var y;u.forEach(S=>{o&&S.removeEventListener("scroll",r),i&&S.removeEventListener("resize",r);}),d?.(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(g);}}var hh=eh;var bh=th,yh=Qg,vh=nh,xh=Jg,wh=Zg;var Th=rh,_h=(e,t,r)=>{let n=new Map,o={platform:Mk,...r},i={...o.platform,_c:n};return Xg(e,t,{...o,platform:i})};function Ch(e=0,t=0,r=0,n=0){if(typeof DOMRect=="function")return new DOMRect(e,t,r,n);let o={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return {...o,toJSON:()=>o}}function Lk(e){if(!e)return Ch();let{x:t,y:r,width:n,height:o}=e;return Ch(t,r,n,o)}function Nk(e,t){return {contextElement:wt(e)?e:void 0,getBoundingClientRect:()=>{let r=e,n=t?.(r);return n||!r?Lk(n):r.getBoundingClientRect()}}}var sa=e=>({variable:e,reference:`var(${e})`}),Zr={arrowSize:sa("--arrow-size"),arrowSizeHalf:sa("--arrow-size-half"),arrowBg:sa("--arrow-background"),transformOrigin:sa("--transform-origin"),arrowOffset:sa("--arrow-offset")},Bk=e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}),Fk={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:r}){let{arrow:n}=r,o=Bk(n)[e],{floating:i}=t;return i.style.setProperty(Zr.transformOrigin.variable,o),{data:{transformOrigin:o}}}},Uk={name:"rects",fn({rects:e}){return {data:e}}},jk=e=>{if(e)return {name:"shiftArrow",fn({placement:t,middlewareData:r}){if(!r.arrow)return {};let{x:n,y:o}=r.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:n!=null?`${n}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${Zr.arrowOffset.reference})`}),{}}}};function Hk(e){let[t,r]=e.split("-");return {side:t,align:r,hasAlign:r!=null}}function kh(e){return e.split("-")[0]}var Wk={strategy:"absolute",placement:"bottom",listeners:true,gutter:8,flip:true,slide:true,overlap:false,sameWidth:false,fitViewport:false,overflowPadding:8,arrowPadding:4};function Sh(e,t){let r=e.devicePixelRatio||1;return Math.round(t*r)/r}function Ph(e){return qr(e.boundary)}function Vk(e,t){if(e)return wh({element:e,padding:t.arrowPadding})}function zk(e,t){if(!ng(t.offset??t.gutter))return hh(({placement:r})=>{let n=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+n:o??n,{hasAlign:a}=Hk(r),s=a?void 0:t.shift,l=t.offset?.crossAxis??s;return Pt({crossAxis:l,mainAxis:i,alignmentAxis:t.shift})})}function Gk(e){if(e.flip)return yh({boundary:Ph(e),padding:e.overflowPadding,fallbackPlacements:e.flip===true?void 0:e.flip})}function qk(e){if(!(!e.slide&&!e.overlap))return bh({boundary:Ph(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Th()})}function Yk(e){return vh({padding:e.overflowPadding,apply({elements:t,rects:r,availableHeight:n,availableWidth:o}){let i=t.floating,a=Math.round(r.reference.width);o=Math.floor(o),n=Math.floor(n),i.style.setProperty("--reference-width",`${a}px`),i.style.setProperty("--available-width",`${o}px`),i.style.setProperty("--available-height",`${n}px`);}})}function Kk(e){if(e.hideWhenDetached)return xh({strategy:"referenceHidden",boundary:e.boundary?.()??"clippingAncestors"})}function Xk(e){return e?e===true?{ancestorResize:true,ancestorScroll:true,elementResize:true,layoutShift:true}:e:{}}function Zk(e,t,r={}){let n=Nk(e,r.getAnchorRect);if(!t||!n)return;let o=Object.assign({},Wk,r),i=t.querySelector("[data-part=arrow]"),a=[zk(i,o),Gk(o),qk(o),Vk(i,o),jk(i),Fk,Yk(o),Kk(o),Uk],{placement:s,strategy:l,onComplete:c,onPositioned:u}=o,d=async()=>{if(!n||!t)return;let h=await _h(n,t,{placement:s,middleware:a,strategy:l});c?.(h),u?.({placed:true});let b=Dr(t),y=Sh(b,h.x),S=Sh(b,h.y);t.style.setProperty("--x",`${y}px`),t.style.setProperty("--y",`${S}px`),o.hideWhenDetached&&h.middlewareData.hide?.referenceHidden&&t.style.setProperty("visibility","hidden");let C=t.firstElementChild;if(C){let k=b.getComputedStyle(C).zIndex;t.style.setProperty("--z-index",k);}},f=async()=>{r.updatePosition?(await r.updatePosition({updatePosition:d}),u?.({placed:true})):await d();},p=Xk(o.listeners),g=o.listeners?gh(n,t,f,p):$s;return f(),()=>{g?.(),u?.({placed:false});}}function _u(e,t,r={}){let{defer:n,...o}=r,i=n?lt:s=>s(),a=[];return a.push(i(()=>{let s=typeof e=="function"?e():e,l=typeof t=="function"?t():t;a.push(Zk(s,l,o));})),()=>{a.forEach(s=>s?.());}}var Qk={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function Eh(e={}){let{placement:t,sameWidth:r,fitViewport:n,strategy:o="absolute"}=e;return {arrow:{position:"absolute",width:Zr.arrowSize.reference,height:Zr.arrowSize.reference,[Zr.arrowSizeHalf.variable]:`calc(${Zr.arrowSize.reference} / 2)`,[Zr.arrowOffset.variable]:`calc(${Zr.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?Qk[t.split("-")[0]]:void 0,background:Zr.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:r?void 0:"max-content",width:r?"var(--reference-width)":void 0,maxWidth:n?"var(--available-width)":void 0,maxHeight:n?"var(--available-height)":void 0,top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}var wr=(e,t,r,n)=>{let o=typeof e=="function"?e():e;return o?.addEventListener(t,r,n),()=>{o?.removeEventListener(t,r,n);}};function Ah(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var Zs=e=>e.button===2||kg()&&e.ctrlKey&&e.button===0,Oh=e=>e.ctrlKey||e.altKey||e.metaKey;function Jk(e,t,r){let o=(a=>{let s=requestAnimationFrame(a);return ()=>cancelAnimationFrame(s)})(()=>{e.removeEventListener(t,i,true),r();}),i=()=>{o(),r();};return e.addEventListener(t,i,{once:true,capture:true}),o}function eP(e){return e?.matches("a[href]")??false}function Rh(e){if(!eP(e))return;let t=()=>e.click();Pg()?Jk(e,"keyup",t):queueMicrotask(t);}function Cu(e,t,r){if(!e)return;let n=e.ownerDocument.defaultView||window,o=new n.CustomEvent(t,r);return e.dispatchEvent(o)}var tP={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Ih={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function Su(e,t={}){let{dir:r="ltr",orientation:n="horizontal"}=t,{key:o}=e;return o=tP[o]??o,r==="rtl"&&n==="horizontal"&&o in Ih&&(o=Ih[o]),o}function rP(e,t="client"){let r=e.touches[0]||e.changedTouches[0];return {x:r[`${t}X`],y:r[`${t}Y`]}}function nP(e,t="client"){return {x:e[`${t}X`],y:e[`${t}Y`]}}var oP=e=>"touches"in e&&e.touches.length>0;function Qs(e,t="client"){return oP(e)?rP(e,t):nP(e,t)}function iP(e){let t={each(r){for(let n=0;n<e.frames?.length;n+=1){let o=e.frames[n];o&&r(o);}},addEventListener(r,n,o){return t.each(i=>{try{i.document.addEventListener(r,n,o);}catch{}}),()=>{try{t.removeEventListener(r,n,o);}catch{}}},removeEventListener(r,n,o){t.each(i=>{try{i.document.removeEventListener(r,n,o);}catch{}});}};return t}function aP(e){let t=e.frameElement!=null?e.parent:null;return {addEventListener:(r,n,o)=>{try{t?.addEventListener(r,n,o);}catch{}return ()=>{try{t?.removeEventListener(r,n,o);}catch{}}},removeEventListener:(r,n,o)=>{try{t?.removeEventListener(r,n,o);}catch{}}}}var Dh="pointerdown.outside",Mh="focus.outside";function sP(e){for(let t of e)if(wt(t)&&Us(t))return true;return false}var Lh=e=>"clientY"in e;function lP(e,t){if(!Lh(t)||!e)return false;let r=e.getBoundingClientRect();return r.width===0||r.height===0?false:r.top<=t.clientY&&t.clientY<=r.top+r.height&&r.left<=t.clientX&&t.clientX<=r.left+r.width}function $h(e,t){if(!t||!Lh(e))return false;let n=t.scrollHeight>t.clientHeight&&e.clientX>t.clientWidth,i=t.scrollWidth>t.clientWidth&&e.clientY>t.clientHeight;return n||i}function cP(e,t){let{exclude:r,onFocusOutside:n,onPointerDownOutside:o,onInteractOutside:i,defer:a}=t;if(!e)return;let s=hr(e),l=Dr(e),c=iP(l),u=aP(l);function d(y){let S=Mr(y);if(!wt(S)||nr(e,S)||lP(e,y)||$h(y,S))return false;let C=yu(e);return $h(y,C)?false:!r?.(S)}let f=new Set;function p(y){function S(){let C=a?lt:D=>D(),k=y.composedPath?.()??[y.target];C(()=>{if(!(!e||!d(y))){if(o||i){let D=Ki(o,i);e.addEventListener(Dh,D,{once:true});}Cu(e,Dh,{bubbles:false,cancelable:true,detail:{originalEvent:y,contextmenu:Zs(y),focusable:sP(k)}});}});}y.pointerType==="touch"?(f.forEach(C=>C()),f.add(wr(s,"click",S,{once:true})),f.add(u.addEventListener("click",S,{once:true})),f.add(c.addEventListener("click",S,{once:true}))):S();}let g=new Set,h=setTimeout(()=>{g.add(wr(s,"pointerdown",p,true)),g.add(u.addEventListener("pointerdown",p,true)),g.add(c.addEventListener("pointerdown",p,true));},0);function b(y){(a?lt:C=>C())(()=>{if(!(!e||!d(y))){if(n||i){let C=Ki(n,i);e.addEventListener(Mh,C,{once:true});}Cu(e,Mh,{bubbles:false,cancelable:true,detail:{originalEvent:y,contextmenu:false,focusable:Us(Mr(y))}});}});}return g.add(wr(s,"focusin",b,true)),g.add(u.addEventListener("focusin",b,true)),g.add(c.addEventListener("focusin",b,true)),()=>{clearTimeout(h),f.forEach(y=>y()),g.forEach(y=>y());}}function Nh(e,t){let{defer:r}=t,n=r?lt:i=>i(),o=[];return o.push(n(()=>{let i=typeof e=="function"?e():e;o.push(cP(i,t));})),()=>{o.forEach(i=>i?.());}}function uP(e,t){let r=n=>{n.key==="Escape"&&(n.isComposing||t?.(n));};return wr(hr(e),"keydown",r,{capture:true})}var Gt={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return [...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){let t=this.indexOf(e),r=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<r},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(r=>nr(r.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>nr(t,e))},add(e){let t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`);},addBranch(e){this.branches.push(e);},remove(e){let t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(n=>n.dismiss()),this.layers.splice(t,1),e.style.removeProperty("--layer-index"));},removeBranch(e){let t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1);},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){this.layers[this.indexOf(e)]?.dismiss();},clear(){this.remove(this.layers[0].node);}},Bh;function Fh(){Gt.layers.forEach(({node:e})=>{e.style.pointerEvents=Gt.isBelowPointerBlockingLayer(e)?"none":"auto";});}function dP(e){e.style.pointerEvents="";}function fP(e,t){let r=hr(e),n=[];if(Gt.hasPointerBlockingLayer()&&!r.body.hasAttribute("data-inert")&&(Bh=document.body.style.pointerEvents,queueMicrotask(()=>{r.body.style.pointerEvents="none",r.body.setAttribute("data-inert","");})),t){let o=jg(t,i=>{n.push(Ug(i,{pointerEvents:"auto"}));});n.push(o);}return ()=>{Gt.hasPointerBlockingLayer()||(queueMicrotask(()=>{r.body.style.pointerEvents=Bh,r.body.removeAttribute("data-inert"),r.body.style.length===0&&r.body.removeAttribute("style");}),n.forEach(o=>o()));}}function pP(e,t){if(!e){Yr("[@zag-js/dismissable] node is `null` or `undefined`");return}let{onDismiss:r,pointerBlocking:n,exclude:o,debug:i}=t,a={dismiss:r,node:e,pointerBlocking:n};Gt.add(a),Fh();function s(f){let p=Mr(f.detail.originalEvent);Gt.isBelowPointerBlockingLayer(e)||Gt.isInBranch(p)||(t.onPointerDownOutside?.(f),t.onInteractOutside?.(f),!f.defaultPrevented&&r?.());}function l(f){let p=Mr(f.detail.originalEvent);Gt.isInBranch(p)||(t.onFocusOutside?.(f),t.onInteractOutside?.(f),!f.defaultPrevented&&r?.());}function c(f){Gt.isTopMost(e)&&(t.onEscapeKeyDown?.(f),!f.defaultPrevented&&r&&(f.preventDefault(),r()));}function u(f){if(!e)return false;let p=typeof o=="function"?o():o,g=Array.isArray(p)?p:[p],h=t.persistentElements?.map(b=>b()).filter(wt);return h&&g.push(...h),g.some(b=>nr(b,f))||Gt.isInNestedLayer(e,f)}let d=[n?fP(e,t.persistentElements):void 0,uP(e,c),Nh(e,{exclude:u,onFocusOutside:l,onPointerDownOutside:s,defer:t.defer})];return ()=>{Gt.remove(e),Fh(),dP(e),d.forEach(f=>f?.());}}function Js(e,t){let{defer:r}=t,n=r?lt:i=>i(),o=[];return o.push(n(()=>{let i=hn(e)?e():e;o.push(pP(i,t));})),()=>{o.forEach(i=>i?.());}}function Uh(e,t={}){let{defer:r}=t,n=r?lt:i=>i(),o=[];return o.push(n(()=>{let i=hn(e)?e():e;if(!i){Yr("[@zag-js/dismissable] branch node is `null` or `undefined`");return}Gt.addBranch(i),o.push(()=>{Gt.removeBranch(i);});})),()=>{o.forEach(i=>i?.());}}var Wh=br("toast").parts("group","root","title","description","actionTrigger","closeTrigger"),Qo=Wh.build(),Et=vn({getRegionId:e=>`toast-group:${e}`,getRegionEl:(e,t)=>Et.getById(e,`toast-group:${t}`),getRootId:e=>`toast:${e.id}`,getRootEl:e=>Et.getById(e,Et.getRootId(e)),getTitleId:e=>`toast:${e.id}:title`,getDescriptionId:e=>`toast:${e.id}:description`,getCloseTriggerId:e=>`toast${e.id}:close`});function ku(e,t){return e.filter(r=>r.state.context.placement===t)}var jh={info:5e3,error:5e3,success:2e3,loading:1/0,DEFAULT:5e3};function Hh(e,t){return e??jh[t]??jh.DEFAULT}function mP(e,t){let r=e.offsets,n=typeof r=="string"?{left:r,right:r,bottom:r,top:r}:r,o=e.dir==="rtl",i=t.replace("-start",o?"-right":"-left").replace("-end",o?"-left":"-right"),a=i.includes("right"),s=i.includes("left"),l={position:"fixed",pointerEvents:e.count>0?void 0:"none",display:"flex",flexDirection:"column","--gap":`${e.gap}px`,"--first-height":`${e.heights[0]?.height||0}px`,zIndex:Tg},c="center";if(a&&(c="flex-end"),s&&(c="flex-start"),l.alignItems=c,i.includes("top")){let u=n.top;l.top=`max(env(safe-area-inset-top, 0px), ${u})`;}if(i.includes("bottom")){let u=n.bottom;l.bottom=`max(env(safe-area-inset-bottom, 0px), ${u})`;}if(!i.includes("left")){let u=n.right;l.insetInlineEnd=`calc(env(safe-area-inset-right, 0px) + ${u})`;}if(!i.includes("right")){let u=n.left;l.insetInlineStart=`calc(env(safe-area-inset-left, 0px) + ${u})`;}return l}function gP(e,t){let[r]=e.placement.split("-"),n=!e.frontmost,o=!e.stacked,i={position:"absolute",pointerEvents:"auto","--opacity":"0","--remove-delay":`${e.removeDelay}ms`,"--duration":`${e.type==="loading"?Number.MAX_SAFE_INTEGER:e.duration}ms`,"--initial-height":`${e.height}px`,"--offset":`${e.offset}px`,"--index":e.index,"--z-index":e.zIndex,"--lift-amount":"calc(var(--lift) * var(--gap))","--y":"100%","--x":"0"},a=s=>Object.assign(i,s);return r==="top"?a({top:"0","--sign":"-1","--y":"-100%","--lift":"1"}):r==="bottom"&&a({bottom:"0","--sign":"1","--y":"100%","--lift":"-1"}),e.mounted&&(a({"--y":"0","--opacity":"1"}),e.stacked&&a({"--y":"calc(var(--lift) * var(--offset))","--height":"var(--initial-height)"})),t||a({"--opacity":"0",pointerEvents:"none"}),n&&o&&(a({"--base-scale":"var(--index) * 0.05 + 1","--y":"calc(var(--lift-amount) * var(--index))","--scale":"calc(-1 * var(--base-scale))","--height":"var(--first-height)"}),t||a({"--y":"calc(var(--sign) * 40%)"})),n&&e.stacked&&!t&&a({"--y":"calc(var(--lift) * var(--offset) + var(--lift) * -100%)"}),e.frontmost&&!t&&a({"--y":"calc(var(--lift) * -100%)"}),i}function hP(e,t){let r={position:"absolute",inset:"0",scale:"1 2",pointerEvents:t?"none":"auto"},n=o=>Object.assign(r,o);return e.frontmost&&!t&&n({height:"calc(var(--initial-height) + 80%)"}),r}function bP(e,t){return {position:"absolute",left:"0",height:"calc(var(--gap) + 2px)",bottom:"100%",width:"100%"}}function yP(e,t,r){function n(){return pg(e)?e.getState():e}function o(u){return ku(n().context.toasts,u)}function i(u){let d=n().context.toasts;return d.length?!!d.find(f=>f.id==u):false}function a(u){let d=`toast:${Xi()}`,f=u.id?u.id:d;return i(f)||t({type:"ADD_TOAST",toast:{...u,id:f}}),f}function s(u,d){return i(u)&&t({type:"UPDATE_TOAST",id:u,toast:d}),u}function l(u){let{id:d}=u;return (d?i(d):false)&&d!=null?s(d,u):a(u)}function c(u){u==null?t("DISMISS_ALL"):i(u)&&t({type:"DISMISS_TOAST",id:u});}return {getCount(){return n().context.count},getPlacements(){let d=n().context.toasts.map(f=>f.state.context.placement);return Array.from(new Set(d))},getToastsByPlacement:o,isVisible:i,create:a,update:s,upsert:l,dismiss:c,remove(u){u==null?t("REMOVE_ALL"):i(u)&&t({type:"REMOVE_TOAST",id:u});},dismissByPlacement(u){o(u).forEach(f=>c(f.id));},loading(u){return l({...u,type:"loading"})},success(u){return l({...u,type:"success"})},error(u){return l({...u,type:"error"})},promise(u,d,f={}){let p=l({...f,...d.loading,type:"loading"});return qr(u).then(g=>{let h=qr(d.success,g);l({...f,...h,id:p,type:"success"});}).catch(g=>{let h=qr(d.error,g);l({...f,...h,id:p,type:"error"});}).finally(()=>{d.finally?.();}),p},pause(u){u==null?t("PAUSE_ALL"):i(u)&&t({type:"PAUSE_TOAST",id:u});},resume(u){u==null?t("RESUME_ALL"):i(u)&&t({type:"RESUME_TOAST",id:u});},getGroupProps(u){let{placement:d,label:f="Notifications"}=u,p=n(),g=p.context.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),[h,b="center"]=d.split("-");return r.element({...Qo.group.attrs,dir:p.context.dir,tabIndex:-1,"aria-label":`${d} ${f} ${g}`,id:Et.getRegionId(d),"data-placement":d,"data-side":h,"data-align":b,"aria-live":"polite",role:"region",style:mP(p.context,d),onMouseMove(){t({type:"REGION.POINTER_ENTER",placement:d});},onMouseLeave(){t({type:"REGION.POINTER_LEAVE",placement:d});},onFocus(y){t({type:"REGION.FOCUS",target:y.relatedTarget});},onBlur(y){p.context.isFocusWithin&&!nr(y.currentTarget,y.relatedTarget)&&t({type:"REGION.BLUR"});}})},subscribe(u){let d=n();return Wo(d.context.toasts,()=>{let p=o(d.context.placement).map(g=>g.getState().context);u(p);})}}}var{not:vP,and:xP,or:wP}=Ls;function TP(e){let{type:t="info",duration:r,id:n="1",placement:o="bottom",removeDelay:i=200,...a}=e,s=Pt(a),l=Hh(r,t);return gr({id:n,context:{id:n,type:t,remaining:l,duration:l,removeDelay:i,createdAt:Date.now(),placement:o,...s,height:0,offset:0,frontmost:false,mounted:false,index:-1,zIndex:0},initial:t==="loading"?"visible:persist":"visible",on:{UPDATE:[{guard:xP("hasTypeChanged","isChangingToLoading"),target:"visible:persist",actions:["setContext"]},{guard:wP("hasDurationChanged","hasTypeChanged"),target:"visible:updating",actions:["setContext"]},{actions:["setContext"]}],MEASURE:{actions:["measureHeight"]}},entry:["invokeOnVisible"],activities:["trackHeight"],states:{"visible:updating":{tags:["visible","updating"],after:{0:"visible"}},"visible:persist":{tags:["visible","paused"],on:{RESUME:{guard:vP("isLoadingType"),target:"visible",actions:["setCreatedAt"]},DISMISS:"dismissing"}},visible:{tags:["visible"],after:{VISIBLE_DURATION:"dismissing"},on:{DISMISS:"dismissing",PAUSE:{target:"visible:persist",actions:"setRemainingDuration"}}},dismissing:{entry:"invokeOnDismiss",after:{REMOVE_DELAY:{target:"unmounted",actions:"notifyParentToRemove"}}},unmounted:{entry:"invokeOnUnmount",type:"final"}}},{activities:{trackHeight(c,u,{self:d}){let f;return lt(()=>{let p=Et.getRootEl(c);if(!p)return;c.mounted=true;let g=js(p,"[data-ghost]");Yr(g.length!==2,"[toast] No ghost element found in toast. Render the `ghostBefore` and `ghostAfter` elements");let h=()=>{let S=p.style.height;p.style.height="auto";let C=p.getBoundingClientRect().height;p.style.height=S,c.height=C,d.sendParent({type:"UPDATE_HEIGHT",id:d.id,height:C,placement:c.placement});};h();let b=Et.getWin(c),y=new b.MutationObserver(h);y.observe(p,{childList:true,subtree:true,characterData:true}),f=()=>y.disconnect();}),()=>f?.()}},guards:{isChangingToLoading:(c,u)=>u.toast?.type==="loading",isLoadingType:c=>c.type==="loading",hasTypeChanged:(c,u)=>u.toast?.type!=null&&u.toast.type!==c.type,hasDurationChanged:(c,u)=>u.toast?.duration!=null&&u.toast.duration!==c.duration},delays:{VISIBLE_DURATION:c=>c.remaining,REMOVE_DELAY:c=>c.removeDelay},actions:{measureHeight(c,u,{self:d}){lt(()=>{let f=Et.getRootEl(c);if(!f)return;c.mounted=true;let p=f.style.height;f.style.height="auto";let g=f.getBoundingClientRect().height;f.style.height=p,c.height=g,d.sendParent({type:"UPDATE_HEIGHT",id:d.id,height:g,placement:c.placement});});},setRemainingDuration(c){c.remaining-=Date.now()-c.createdAt;},setCreatedAt(c){c.createdAt=Date.now();},notifyParentToRemove(c,u,{self:d}){d.sendParent({type:"REMOVE_TOAST",id:d.id});},invokeOnDismiss(c){c.onStatusChange?.({status:"dismissing"});},invokeOnUnmount(c){c.onStatusChange?.({status:"unmounted"});},invokeOnVisible(c){c.onStatusChange?.({status:"visible"});},setContext(c,u){let d=u.toast?.duration,f=u.toast?.type??c.type,p=Hh(d,f);Object.assign(c,{...u.toast,duration:p,remaining:p});}}})}function _P(e){let t=Pt(e);return gr({id:"toaster",initial:t.overlap?"overlap":"stack",context:{dir:"ltr",max:Number.MAX_SAFE_INTEGER,gap:16,pauseOnPageIdle:false,hotkey:["altKey","KeyT"],offsets:"1rem",placement:"bottom",removeDelay:200,...t,toasts:[],lastFocusedEl:null,isFocusWithin:false,heights:[]},computed:{count:r=>r.toasts.length},activities:["trackDocumentVisibility","trackHotKeyPress"],watch:{toasts:["collapsedIfEmpty","setDismissableBranch"]},exit:["removeToasts","clearDismissableBranch","clearLastFocusedEl"],on:{PAUSE_TOAST:{actions:["pauseToast"]},PAUSE_ALL:{actions:["pauseToasts"]},RESUME_TOAST:{actions:["resumeToast"]},RESUME_ALL:{actions:["resumeToasts"]},ADD_TOAST:{guard:"isWithinRange",actions:["createToast","syncToastIndex"]},UPDATE_TOAST:{actions:["updateToast"]},DISMISS_TOAST:{actions:["dismissToast"]},DISMISS_ALL:{actions:["dismissToasts"]},REMOVE_TOAST:{actions:["removeToast","syncToastIndex","syncToastOffset"]},REMOVE_ALL:{actions:["removeToasts"]},UPDATE_HEIGHT:{actions:["syncHeights","syncToastOffset"]},"DOC.HOTKEY":{actions:["focusRegionEl"]},"REGION.BLUR":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts","restoreLastFocusedEl"]},{actions:["resumeToasts","restoreLastFocusedEl"]}]},states:{stack:{entry:["expandToasts"],on:{"REGION.POINTER_LEAVE":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts"]},{actions:["resumeToasts"]}],"REGION.OVERLAP":{target:"overlap"},"REGION.FOCUS":{actions:["setLastFocusedEl","pauseToasts"]},"REGION.POINTER_ENTER":{actions:["pauseToasts"]}}},overlap:{entry:["collapseToasts"],on:{"REGION.STACK":{target:"stack"},"REGION.POINTER_ENTER":{target:"stack",actions:["pauseToasts"]},"REGION.FOCUS":{target:"stack",actions:["setLastFocusedEl","pauseToasts"]}}}}},{guards:{isWithinRange:r=>r.toasts.length<r.max,isOverlapping:r=>!!r.overlap},activities:{trackHotKeyPress(r,n,{send:o}){return wr(document,"keydown",a=>{r.hotkey.every(l=>a[l]||a.code===l)&&o({type:"DOC.HOTKEY"});},{capture:true})},trackDocumentVisibility(r,n,{send:o}){if(!r.pauseOnPageIdle)return;let i=Et.getDoc(r);return wr(i,"visibilitychange",()=>{o(i.visibilityState==="hidden"?"PAUSE_ALL":"RESUME_ALL");})}},actions:{setDismissableBranch(r){let o=ku(r.toasts,r.placement).length>0;if(!o){r._cleanup?.();return}if(o&&r._cleanup)return;let i=()=>Et.getRegionEl(r,r.placement);r._cleanup=Uh(i,{defer:true});},clearDismissableBranch(r){r._cleanup?.();},focusRegionEl(r){queueMicrotask(()=>{Et.getRegionEl(r,r.placement)?.focus();});},expandToasts(r){el(r,n=>{n.state.context.stacked=true;});},collapseToasts(r){el(r,n=>{n.state.context.stacked=false;});},collapsedIfEmpty(r,n,{send:o}){!r.overlap||r.toasts.length>1||o("REGION.OVERLAP");},pauseToast(r,n,{self:o}){o.sendChild("PAUSE",n.id);},pauseToasts(r){r.toasts.forEach(n=>n.send("PAUSE"));},resumeToast(r,n,{self:o}){o.sendChild("RESUME",n.id);},resumeToasts(r){r.toasts.forEach(n=>n.send("RESUME"));},measureToasts(r){r.toasts.forEach(n=>n.send("MEASURE"));},createToast(r,n,{self:o,getState:i}){let a={placement:r.placement,duration:r.duration,removeDelay:r.removeDelay,...n.toast,dir:r.dir,getRootNode:r.getRootNode,stacked:i().matches("stack")},s=TP(a),l=o.spawn(s);r.toasts=[l,...r.toasts];},updateToast(r,n,{self:o}){o.sendChild({type:"UPDATE",toast:n.toast},n.id);},dismissToast(r,n,{self:o}){o.sendChild("DISMISS",n.id);},dismissToasts(r){r.toasts.forEach(n=>n.send("DISMISS"));},removeToast(r,n,{self:o}){o.stopChild(n.id),r.toasts=r.toasts.filter(i=>i.id!==n.id),r.heights=r.heights.filter(i=>i.id!==n.id);},removeToasts(r,n,{self:o}){r.toasts.forEach(i=>o.stopChild(i.id)),r.toasts=[],r.heights=[];},syncHeights(r,n){let o=r.heights.find(i=>i.id===n.id);if(o)o.height=n.height,o.placement=n.placement;else {let i={id:n.id,height:n.height,placement:n.placement};r.heights=[i,...r.heights];}},syncToastIndex(r){el(r,(n,o,i)=>{n.state.context.index=o,n.state.context.frontmost=o===0,n.state.context.zIndex=i.length-o;});},syncToastOffset(r,n){let o=n.placement??r.placement;el({...r,placement:o},i=>{let a=Math.max(r.heights.findIndex(l=>l.id===i.id),0),s=r.heights.reduce((l,c,u)=>u>=a?l:l+c.height,0);i.state.context.offset=a*r.gap+s;});},setLastFocusedEl(r,n){r.isFocusWithin||!n.target||(r.isFocusWithin=true,r.lastFocusedEl=zt(n.target));},restoreLastFocusedEl(r){r.isFocusWithin=false,r.lastFocusedEl&&(r.lastFocusedEl.focus({preventScroll:true}),r.lastFocusedEl=null);},clearLastFocusedEl(r){r.lastFocusedEl&&(r.lastFocusedEl.focus({preventScroll:true}),r.lastFocusedEl=null,r.isFocusWithin=false);}}})}function el(e,t){ku(e.toasts,e.placement).forEach(t);}function Vh(e,t,r){let n=e.hasTag("visible"),o=e.hasTag("paused"),i=e.context.placement,a=e.context.type,[s,l="center"]=i.split("-");return {type:a,title:e.context.title,description:e.context.description,placement:i,visible:n,paused:o,pause(){t("PAUSE");},resume(){t("RESUME");},dismiss(){t("DISMISS");},getRootProps(){return r.element({...Qo.root.attrs,dir:e.context.dir,id:Et.getRootId(e.context),"data-state":n?"open":"closed","data-type":a,"data-placement":i,"data-align":l,"data-side":s,"data-mounted":Ht(e.context.mounted),"data-paused":Ht(o),"data-first":Ht(e.context.frontmost),"data-sibling":Ht(!e.context.frontmost),"data-stack":Ht(e.context.stacked),"data-overlap":Ht(!e.context.stacked),role:"status","aria-atomic":"true","aria-describedby":e.context.description?Et.getDescriptionId(e.context):void 0,"aria-labelledby":e.context.title?Et.getTitleId(e.context):void 0,tabIndex:0,style:gP(e.context,n),onKeyDown(c){c.defaultPrevented||c.key=="Escape"&&(t("DISMISS"),c.preventDefault());}})},getGhostBeforeProps(){return r.element({"data-ghost":"before",style:hP(e.context,n)})},getGhostAfterProps(){return r.element({"data-ghost":"after",style:bP()})},getTitleProps(){return r.element({...Qo.title.attrs,id:Et.getTitleId(e.context)})},getDescriptionProps(){return r.element({...Qo.description.attrs,id:Et.getDescriptionId(e.context)})},getActionTriggerProps(){return r.button({...Qo.actionTrigger.attrs,type:"button",onClick(c){c.defaultPrevented||(e.context.action?.onClick?.(),t("DISMISS"));}})},getCloseTriggerProps(){return r.button({id:Et.getCloseTriggerId(e.context),...Qo.closeTrigger.attrs,type:"button","aria-label":"Dismiss notification",onClick(c){c.defaultPrevented||t("DISMISS");}})}}}var tl={connect:yP,machine:_P};var Pu=e=>{let t=tl.machine({id:"1",...e});return {...tl.connect(t,t.send,rr),machine:t}},[SP,Vn]=st({hookName:"useToastContext",providerName:"<ToastProvider />"}),zh=e=>{let t=Vn(),r=de(()=>t().getActionTriggerProps(),e);return m(ve.button,r)},Gh=e=>{let t=Vn(),r=de(()=>t().getCloseTriggerProps(),e);return m(ve.button,r)},qh=e=>e.children(Vn()),Yh=e=>{let t=Vn(),r=de(()=>t().getDescriptionProps(),e);return m(ve.div,r)},kP=w("<div><div></div><div>"),Kh=e=>{let t=Vn(),r=de(()=>t().getRootProps(),e);return (()=>{var n=kP(),o=n.firstChild,i=o.nextSibling;return De(n,r,false,true),De(o,Re(()=>t().getGhostBeforeProps()),false,false),v(n,()=>e.children,i),De(i,Re(()=>t().getGhostAfterProps()),false,false),n})()},Xh=e=>{let t=Vn(),r=de(()=>t().getTitleProps(),e);return m(ve.div,r)},Eu=e=>{let[t,r]=rt(e,["toaster","children"]),[n,o]=Rr(t.toaster.machine),i=n.context.placement,a=B(()=>tl.connect(n,o,rr)),s=B(()=>a().getToastsByPlacement(i)),l=de(a().getGroupProps({placement:i}),r);return m(ve.div,Re(l,{get children(){return m(ke,{get each(){return s()},children:c=>m(PP,{value:c,children:u=>t.children(u)})})}}))},PP=e=>{let[t,r]=yg(e.value),n=B(()=>Vh(t,r,rr)),o=B(()=>t.context);return m(SP,{value:n,get children(){return e.children(o)}})},zn={};xn(zn,{ActionTrigger:()=>zh,CloseTrigger:()=>Gh,Context:()=>qh,Description:()=>Yh,Root:()=>Kh,Title:()=>Xh});var la=(e,t)=>({x:e,y:t});function EP(e){let{x:t,y:r,width:n,height:o}=e,i=t+n/2,a=r+o/2;return {x:t,y:r,width:n,height:o,minX:t,minY:r,maxX:t+n,maxY:r+o,midX:i,midY:a,center:la(i,a)}}function IP(e){let t=la(e.minX,e.minY),r=la(e.maxX,e.minY),n=la(e.maxX,e.maxY),o=la(e.minX,e.maxY);return {top:t,right:r,bottom:n,left:o}}function Zh(e,t){let r=EP(e),{top:n,right:o,left:i,bottom:a}=IP(r),[s]=t.split("-");return {top:[i,n,o,a],right:[n,o,a,i],bottom:[n,i,a,o],left:[o,n,i,a]}[s]}function Qh(e,t){let{x:r,y:n}=t,o=false;for(let i=0,a=e.length-1;i<e.length;a=i++){let s=e[i].x,l=e[i].y,c=e[a].x,u=e[a].y;l>n!=u>n&&r<(c-s)*(n-l)/(u-l)+s&&(o=!o);}return o}var eb=br("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem"),Mt=eb.build(),le=vn({getTriggerId:e=>e.ids?.trigger??`menu:${e.id}:trigger`,getContextTriggerId:e=>e.ids?.contextTrigger??`menu:${e.id}:ctx-trigger`,getContentId:e=>e.ids?.content??`menu:${e.id}:content`,getArrowId:e=>e.ids?.arrow??`menu:${e.id}:arrow`,getPositionerId:e=>e.ids?.positioner??`menu:${e.id}:popper`,getGroupId:(e,t)=>e.ids?.group?.(t)??`menu:${e.id}:group:${t}`,getGroupLabelId:(e,t)=>e.ids?.groupLabel?.(t)??`menu:${e.id}:group-label:${t}`,getContentEl:e=>le.getById(e,le.getContentId(e)),getPositionerEl:e=>le.getById(e,le.getPositionerId(e)),getTriggerEl:e=>le.getById(e,le.getTriggerId(e)),getHighlightedItemEl:e=>e.highlightedValue?le.getById(e,e.highlightedValue):null,getArrowEl:e=>le.getById(e,le.getArrowId(e)),getElements:e=>{let r=`[role^="menuitem"][data-ownedby=${CSS.escape(le.getContentId(e))}]:not([data-disabled])`;return js(le.getContentEl(e),r)},getFirstEl:e=>Qm(le.getElements(e)),getLastEl:e=>Jm(le.getElements(e)),getNextEl:(e,t)=>Ag(le.getElements(e),e.highlightedValue,t??e.loopFocus),getPrevEl:(e,t)=>Og(le.getElements(e),e.highlightedValue,t??e.loopFocus),getElemByKey:(e,t)=>gu(le.getElements(e),{state:e.typeaheadState,key:t,activeId:e.highlightedValue}),isTargetDisabled:e=>wt(e)&&(e.dataset.disabled===""||e.hasAttribute("disabled")),isTriggerItem:e=>!!e?.getAttribute("role")?.startsWith("menuitem")&&!!e?.hasAttribute("aria-controls"),getOptionFromItemEl(e){return {id:e.id,name:e.dataset.name,value:e.dataset.value,valueText:e.dataset.valueText,type:e.dataset.type}}});function tb(e,t,r){let n=e.context.isSubmenu,o=e.context.isTypingAhead,i=e.context.composite,a=e.hasTag("open"),s=Eh({...e.context.positioning,placement:e.context.anchorPoint?"bottom":e.context.currentPlacement});function l(f){return {disabled:!!f.disabled,highlighted:e.context.highlightedValue===f.value}}function c(f){let p=f.valueText??f.value;return {...f,id:f.value,valueText:p}}function u(f){return {...l(c(f)),checked:!!f.checked}}function d(f){let{value:p,closeOnSelect:g,valueText:h}=f,b=l(f);return r.element({...Mt.item.attrs,id:p,role:"menuitem","aria-disabled":b.disabled,"data-disabled":Ht(b.disabled),"data-ownedby":le.getContentId(e.context),"data-highlighted":Ht(b.highlighted),"data-valuetext":h,onDragStart(y){y.currentTarget.matches("a[href]")&&y.preventDefault();},onPointerMove(y){if(b.disabled||y.pointerType!=="mouse")return;let S=y.currentTarget;b.highlighted||t({type:"ITEM_POINTERMOVE",id:p,target:S,closeOnSelect:g});},onPointerLeave(y){if(b.disabled||y.pointerType!=="mouse"||!e.previousEvent.type.includes("POINTER"))return;let C=y.currentTarget;t({type:"ITEM_POINTERLEAVE",id:p,target:C,closeOnSelect:g});},onPointerDown(y){if(b.disabled)return;let S=y.currentTarget;t({type:"ITEM_POINTERDOWN",target:S,id:p,closeOnSelect:g});},onClick(y){if(fu(y)||du(y)||b.disabled)return;let S=y.currentTarget;t({type:"ITEM_CLICK",target:S,id:p,closeOnSelect:g});}})}return {highlightedValue:e.context.highlightedValue,open:a,setOpen(f){f!==a&&t(f?"OPEN":"CLOSE");},setHighlightedValue(f){t({type:"HIGHLIGHTED.SET",id:f});},setParent(f){t({type:"PARENT.SET",value:f,id:f.state.context.id});},setChild(f){t({type:"CHILD.SET",value:f,id:f.state.context.id});},reposition(f={}){t({type:"POSITIONING.SET",options:f});},getContextTriggerProps(){return r.element({...Mt.contextTrigger.attrs,dir:e.context.dir,id:le.getContextTriggerId(e.context),onPointerDown(f){if(f.pointerType==="mouse")return;let p=Qs(f);t({type:"CONTEXT_MENU_START",point:p});},onPointerCancel(f){f.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL");},onPointerMove(f){f.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL");},onPointerUp(f){f.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL");},onContextMenu(f){let p=Qs(f);t({type:"CONTEXT_MENU",point:p}),f.preventDefault();},style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"}})},getTriggerItemProps(f){return Ns(d({value:f.getTriggerProps().id}),f.getTriggerProps())},getTriggerProps(){return r.button({...n?Mt.triggerItem.attrs:Mt.trigger.attrs,"data-placement":e.context.currentPlacement,type:"button",dir:e.context.dir,id:le.getTriggerId(e.context),"data-uid":e.context.id,"aria-haspopup":i?"menu":"dialog","aria-controls":le.getContentId(e.context),"aria-expanded":a||void 0,"data-state":a?"open":"closed",onPointerMove(f){f.pointerType!=="mouse"||le.isTargetDisabled(f.currentTarget)||!n||t({type:"TRIGGER_POINTERMOVE",target:f.currentTarget});},onPointerLeave(f){if(le.isTargetDisabled(f.currentTarget)||f.pointerType!=="mouse"||!n)return;let p=Qs(f);t({type:"TRIGGER_POINTERLEAVE",target:f.currentTarget,point:p});},onPointerDown(f){le.isTargetDisabled(f.currentTarget)||Zs(f)||f.preventDefault();},onClick(f){f.defaultPrevented||le.isTargetDisabled(f.currentTarget)||t({type:"TRIGGER_CLICK",target:f.currentTarget});},onBlur(){t("TRIGGER_BLUR");},onFocus(){t("TRIGGER_FOCUS");},onKeyDown(f){if(f.defaultPrevented)return;let p={ArrowDown(){t("ARROW_DOWN");},ArrowUp(){t("ARROW_UP");},Enter(){t({type:"ARROW_DOWN",src:"enter"});},Space(){t({type:"ARROW_DOWN",src:"space"});}},g=Su(f,e.context),h=p[g];h&&(f.preventDefault(),h(f));}})},getIndicatorProps(){return r.element({...Mt.indicator.attrs,dir:e.context.dir,"data-state":a?"open":"closed"})},getPositionerProps(){return r.element({...Mt.positioner.attrs,dir:e.context.dir,id:le.getPositionerId(e.context),style:s.floating})},getArrowProps(){return r.element({id:le.getArrowId(e.context),...Mt.arrow.attrs,dir:e.context.dir,style:s.arrow})},getArrowTipProps(){return r.element({...Mt.arrowTip.attrs,dir:e.context.dir,style:s.arrowTip})},getContentProps(){return r.element({...Mt.content.attrs,id:le.getContentId(e.context),"aria-label":e.context["aria-label"],hidden:!a,"data-state":a?"open":"closed",role:i?"menu":"dialog",tabIndex:0,dir:e.context.dir,"aria-activedescendant":e.context.highlightedValue??void 0,"aria-labelledby":le.getTriggerId(e.context),"data-placement":e.context.currentPlacement,onPointerEnter(f){f.pointerType==="mouse"&&t("MENU_POINTERENTER");},onKeyDown(f){if(f.defaultPrevented||!Ig(f))return;let p=Mr(f);if(!(p?.closest("[role=menu]")===f.currentTarget||p===f.currentTarget))return;if(f.key==="Tab"&&!$g(f)){f.preventDefault();return}let h=le.getHighlightedItemEl(e.context),b={ArrowDown(){t("ARROW_DOWN");},ArrowUp(){t("ARROW_UP");},ArrowLeft(){t("ARROW_LEFT");},ArrowRight(){t("ARROW_RIGHT");},Enter(){t("ENTER"),Rh(h);},Space(C){o?t({type:"TYPEAHEAD",key:C.key}):b.Enter?.(C);},Home(){t("HOME");},End(){t("END");}},y=Su(f,{dir:e.context.dir}),S=b[y];if(S){S(f),f.stopPropagation(),f.preventDefault();return}e.context.typeahead&&Ah(f)&&(Oh(f)||bu(p)||(t({type:"TYPEAHEAD",key:f.key}),f.preventDefault()));}})},getSeparatorProps(){return r.element({...Mt.separator.attrs,role:"separator",dir:e.context.dir,"aria-orientation":"horizontal"})},getItemState:l,getItemProps:d,getOptionItemState:u,getOptionItemProps(f){let{type:p,disabled:g,onCheckedChange:h,closeOnSelect:b}=f,y=c(f),S=u(f);return {...d(y),...r.element({"data-type":p,...Mt.item.attrs,dir:e.context.dir,"data-value":y.value,role:`menuitem${p}`,"aria-checked":!!S.checked,"data-state":S.checked?"checked":"unchecked",onClick(C){if(g||fu(C)||du(C))return;let k=C.currentTarget;t({type:"ITEM_CLICK",target:k,option:y,closeOnSelect:b}),h?.(!S.checked);}})}},getItemIndicatorProps(f){let p=u(f);return r.element({...Mt.itemIndicator.attrs,dir:e.context.dir,"data-disabled":Ht(p.disabled),"data-highlighted":Ht(p.highlighted),"data-state":p.checked?"checked":"unchecked",hidden:!p.checked})},getItemTextProps(f){let p=u(f);return r.element({...Mt.itemText.attrs,dir:e.context.dir,"data-disabled":Ht(p.disabled),"data-highlighted":Ht(p.highlighted),"data-state":p.checked?"checked":"unchecked"})},getItemGroupLabelProps(f){return r.element({id:le.getGroupLabelId(e.context,f.htmlFor),dir:e.context.dir,...Mt.itemGroupLabel.attrs})},getItemGroupProps(f){return r.element({id:le.getGroupId(e.context,f.id),...Mt.itemGroup.attrs,dir:e.context.dir,"aria-labelledby":le.getGroupLabelId(e.context,f.id),role:"group"})}}}var{not:ar,and:Jo,or:AP}=Ls;function rb(e){let t=Pt(e);return gr({id:"menu",initial:t.open?"open":"idle",context:{highlightedValue:null,loopFocus:false,anchorPoint:null,closeOnSelect:true,typeahead:true,composite:true,...t,positioning:{placement:"bottom-start",gutter:8,...t.positioning},intentPolygon:null,parent:null,lastHighlightedValue:null,children:er(zt({})),suspendPointer:false,restoreFocus:true,typeaheadState:gu.defaultOptions},computed:{isSubmenu:r=>r.parent!==null,isRtl:r=>r.dir==="rtl",isTypingAhead:r=>r.typeaheadState.keysSoFar!==""},watch:{isSubmenu:"setSubmenuPlacement",anchorPoint:"reposition",open:"toggleVisibility"},on:{"PARENT.SET":{actions:"setParentMenu"},"CHILD.SET":{actions:"setChildMenu"},OPEN:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],OPEN_AUTOFOCUS:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{internal:true,target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],CLOSE:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}],"HIGHLIGHTED.RESTORE":{actions:"restoreHighlightedItem"},"HIGHLIGHTED.SET":{actions:"setHighlightedItem"}},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",CONTEXT_MENU_START:{target:"opening:contextmenu",actions:"setAnchorPoint"},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],TRIGGER_FOCUS:{guard:ar("isSubmenu"),target:"closed"},TRIGGER_POINTERMOVE:{guard:"isSubmenu",target:"opening"}}},"opening:contextmenu":{tags:["closed"],after:{LONG_PRESS_DELAY:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",CONTEXT_MENU_CANCEL:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}]}},opening:{tags:["closed"],after:{SUBMENU_OPEN_DELAY:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",BLUR:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}],TRIGGER_POINTERLEAVE:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}]}},closing:{tags:["open"],activities:["trackPointerMove","trackInteractOutside"],after:{SUBMENU_CLOSE_DELAY:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem","invokeOnClose"]}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem"]},MENU_POINTERENTER:{target:"open",actions:"clearIntentPolygon"},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem"]}]}},closed:{tags:["closed"],entry:["clearHighlightedItem","focusTrigger","resumePointer"],on:{"CONTROLLED.OPEN":[{guard:AP("isOpenAutoFocusEvent","isArrowDownEvent"),target:"open",actions:"highlightFirstItem"},{guard:"isArrowUpEvent",target:"open",actions:"highlightLastItem"},{target:"open"}],CONTEXT_MENU_START:{target:"opening:contextmenu",actions:"setAnchorPoint"},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",target:"opening"},TRIGGER_BLUR:"idle",ARROW_DOWN:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],ARROW_UP:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:["highlightLastItem","invokeOnOpen"]}]}},open:{tags:["open"],activities:["trackInteractOutside","trackPositioning","scrollToHighlightedItem"],entry:["focusMenu","resumePointer"],on:{"CONTROLLED.CLOSE":[{target:"closed",guard:"isArrowLeftEvent",actions:["focusParentMenu"]},{target:"closed"}],TRIGGER_CLICK:[{guard:Jo(ar("isTriggerItem"),"isOpenControlled"),actions:"invokeOnClose"},{guard:ar("isTriggerItem"),target:"closed",actions:"invokeOnClose"}],ARROW_UP:{actions:["highlightPrevItem","focusMenu"]},ARROW_DOWN:{actions:["highlightNextItem","focusMenu"]},ARROW_LEFT:[{guard:Jo("isSubmenu","isOpenControlled"),actions:"invokeOnClose"},{guard:"isSubmenu",target:"closed",actions:["focusParentMenu","invokeOnClose"]}],HOME:{actions:["highlightFirstItem","focusMenu"]},END:{actions:["highlightLastItem","focusMenu"]},ARROW_RIGHT:{guard:"isTriggerItemHighlighted",actions:"openSubmenu"},ENTER:[{guard:"isTriggerItemHighlighted",actions:"openSubmenu"},{actions:"clickHighlightedItem"}],ITEM_POINTERMOVE:[{guard:ar("suspendPointer"),actions:["setHighlightedItem","focusMenu"]},{actions:"setLastHighlightedItem"}],ITEM_POINTERLEAVE:{guard:Jo(ar("suspendPointer"),ar("isTriggerItem")),actions:"clearHighlightedItem"},ITEM_CLICK:[{guard:Jo(ar("isTriggerItemHighlighted"),ar("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Jo(ar("isTriggerItemHighlighted"),ar("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Jo(ar("isTriggerItemHighlighted"),ar("isHighlightedItemEditable")),actions:["invokeOnSelect","setOptionState"]},{actions:"setHighlightedItem"}],TRIGGER_POINTERLEAVE:{target:"closing",actions:"setIntentPolygon"},ITEM_POINTERDOWN:{actions:"setHighlightedItem"},TYPEAHEAD:{actions:"highlightMatchedItem"},FOCUS_MENU:{actions:"focusMenu"},"POSITIONING.SET":{actions:"reposition"}}}}},{delays:{LONG_PRESS_DELAY:700,SUBMENU_OPEN_DELAY:100,SUBMENU_CLOSE_DELAY:100},guards:{closeOnSelect:(r,n)=>!!(n?.closeOnSelect??r.closeOnSelect),isTriggerItem:(r,n)=>le.isTriggerItem(n.target),isTriggerItemHighlighted:(r,n)=>!!(n.target??le.getHighlightedItemEl(r))?.hasAttribute("aria-controls"),isSubmenu:r=>r.isSubmenu,suspendPointer:r=>r.suspendPointer,isHighlightedItemEditable:r=>bu(le.getHighlightedItemEl(r)),isWithinPolygon:(r,n)=>r.intentPolygon?Qh(r.intentPolygon,n.point):false,isOpenControlled:r=>!!r["open.controlled"],isArrowLeftEvent:(r,n)=>n.previousEvent?.type==="ARROW_LEFT",isArrowUpEvent:(r,n)=>n.previousEvent?.type==="ARROW_UP",isArrowDownEvent:(r,n)=>n.previousEvent?.type==="ARROW_DOWN",isOpenAutoFocusEvent:(r,n)=>n.previousEvent?.type==="OPEN_AUTOFOCUS"},activities:{trackPositioning(r){if(r.anchorPoint)return;r.currentPlacement=r.positioning.placement;let n=()=>le.getPositionerEl(r);return _u(le.getTriggerEl(r),n,{...r.positioning,defer:true,onComplete(o){r.currentPlacement=o.placement;}})},trackInteractOutside(r,n,{send:o}){return Js(()=>le.getContentEl(r),{defer:true,exclude:[le.getTriggerEl(r)],onInteractOutside:r.onInteractOutside,onFocusOutside:r.onFocusOutside,onEscapeKeyDown(a){r.onEscapeKeyDown?.(a),r.isSubmenu&&a.preventDefault(),Jh(r);},onPointerDownOutside(a){r.restoreFocus=!a.detail.focusable,r.onPointerDownOutside?.(a);},onDismiss(){o({type:"CLOSE",src:"interact-outside"});}})},trackPointerMove(r,n,{guards:o,send:i}){let{isWithinPolygon:a}=o;r.parent.state.context.suspendPointer=true;let s=le.getDoc(r);return wr(s,"pointermove",l=>{let c={x:l.clientX,y:l.clientY};a(r,{point:c})||(i("POINTER_MOVED_AWAY_FROM_SUBMENU"),r.parent.state.context.suspendPointer=false);})},scrollToHighlightedItem(r,n,{getState:o}){let i=()=>{if(o().event.type.startsWith("ITEM_POINTER"))return;let l=le.getHighlightedItemEl(r),c=le.getContentEl(r);Fg(l,{rootEl:c,block:"nearest"});};return lt(()=>i()),Bg(()=>le.getContentEl(r),{attributes:["aria-activedescendant"],callback:i})}},actions:{setAnchorPoint(r,n){r.anchorPoint=n.point;},setSubmenuPlacement(r){r.isSubmenu&&(r.positioning.placement=r.isRtl?"left-start":"right-start",r.positioning.gutter=0);},reposition(r,n){let o=()=>le.getPositionerEl(r),i=r.anchorPoint?()=>({width:0,height:0,...r.anchorPoint}):void 0;_u(le.getTriggerEl(r),o,{...r.positioning,defer:true,getAnchorRect:i,...n.options??{},listeners:false,onComplete(a){r.currentPlacement=a.placement;}});},setOptionState(r,n){if(!n.option)return;let{checked:o,onCheckedChange:i,type:a}=n.option;a==="radio"?i?.(true):a==="checkbox"&&i?.(!o);},clickHighlightedItem(r,n){let o=le.getHighlightedItemEl(r);!o||o.dataset.disabled||queueMicrotask(()=>o.click());},setIntentPolygon(r,n){let o=le.getContentEl(r),i=r.currentPlacement;if(!o||!i)return;let a=o.getBoundingClientRect(),s=Zh(a,i);if(!s)return;let c=kh(i)==="right"?-5:5;r.intentPolygon=[{...n.point,x:n.point.x+c},...s];},clearIntentPolygon(r){r.intentPolygon=null;},resumePointer(r){r.parent&&(r.parent.state.context.suspendPointer=false);},setHighlightedItem(r,n){wn.highlighted(r,n.id);},clearHighlightedItem(r){wn.highlighted(r,null);},focusMenu(r){lt(()=>{let n=le.getContentEl(r);Mg({root:n,enabled:!nr(n,le.getActiveElement(r)),filter(i){return !i.role?.startsWith("menuitem")}})?.focus({preventScroll:true});});},highlightFirstItem(r){(le.getContentEl(r)?queueMicrotask:lt)(()=>{let o=le.getFirstEl(r);o&&wn.highlighted(r,o.id);});},highlightLastItem(r){(le.getContentEl(r)?queueMicrotask:lt)(()=>{let o=le.getLastEl(r);o&&wn.highlighted(r,o.id);});},highlightNextItem(r,n){let o=le.getNextEl(r,n.loop);wn.highlighted(r,o?.id??null);},highlightPrevItem(r,n){let o=le.getPrevEl(r,n.loop);wn.highlighted(r,o?.id??null);},invokeOnSelect(r){r.highlightedValue&&r.onSelect?.({value:r.highlightedValue});},focusTrigger(r){r.isSubmenu||r.anchorPoint||!r.restoreFocus||queueMicrotask(()=>le.getTriggerEl(r)?.focus({preventScroll:true}));},highlightMatchedItem(r,n){let o=le.getElemByKey(r,n.key);o&&wn.highlighted(r,o.id);},setParentMenu(r,n){r.parent=zt(n.value);},setChildMenu(r,n){r.children[n.id]=zt(n.value);},closeRootMenu(r){Jh(r);},openSubmenu(r){let o=le.getHighlightedItemEl(r)?.getAttribute("data-uid");(o?r.children[o]:null)?.send("OPEN_AUTOFOCUS");},focusParentMenu(r){r.parent?.send("FOCUS_MENU");},setLastHighlightedItem(r,n){r.lastHighlightedValue=n.id;},restoreHighlightedItem(r){r.lastHighlightedValue&&(wn.highlighted(r,r.lastHighlightedValue),r.lastHighlightedValue=null);},restoreParentHiglightedItem(r){r.parent?.send("HIGHLIGHTED.RESTORE");},invokeOnOpen(r){r.onOpenChange?.({open:true});},invokeOnClose(r){r.onOpenChange?.({open:false});},toggleVisibility(r,n,{send:o}){o({type:r.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n});}}})}function Jh(e){let t=e.parent;for(;t&&t.state.context.isSubmenu;)t=t.state.context.parent;t?.send("CLOSE");}var wn={highlighted(e,t){Ms(e.highlightedValue,t)||(e.highlightedValue=t,e.onHighlightChange?.({highlightedValue:t}));}};tr()(["anchorPoint","aria-label","closeOnSelect","dir","getRootNode","highlightedValue","id","ids","loopFocus","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onEscapeKeyDown","onSelect","onHighlightChange","open","open.controlled","positioning","typeahead","composite"]);tr()(["closeOnSelect","disabled","value","valueText"]);tr()(["htmlFor"]);tr()(["id"]);tr()(["disabled","valueText","closeOnSelect","type","value","checked","onCheckedChange"]);var[nb,dt]=st({hookName:"useMenuContext",providerName:"<MenuProvider />",strict:false}),ob=e=>{let t=dt(),r=de(()=>t().getArrowProps(),e);return m(ve.div,r)},ib=e=>{let t=dt(),r=de(()=>t().getArrowTipProps(),e);return m(ve.div,r)},[Iu,ab]=st({hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[sb,lb]=st({hookName:"useMenuOptionItemPropsContext",providerName:"<MenuOptionItemPropsProvider />"}),cb=e=>{let[t,r]=xt()(e,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),n=de(t,{type:"checkbox"}),o=dt(),i=de(()=>o().getOptionItemProps(n),r),a=B(()=>o().getItemState(n));return m(sb,{value:n,get children(){return m(Iu,{value:a,get children(){return m(ve.div,i)}})}})},ub=e=>{let t=dt(),r=yn(),n=de(()=>t().getContentProps(),()=>r().presenceProps,e);return m(W,{get when(){return !r().unmounted},get children(){return m(ve.div,n)}})},db=e=>e.children(dt()),fb=e=>{let t=dt(),r=de(()=>t().getContextTriggerProps(),e);return m(ve.button,r)},pb=e=>{let t=dt(),r=de(()=>t().getIndicatorProps(),e);return m(ve.div,r)},mb=e=>{let[t,r]=xt()(e,["closeOnSelect","disabled","value","valueText"]),n=dt(),o=de(()=>n().getItemProps(t),r),i=B(()=>n().getItemState(t));return m(Iu,{value:i,get children(){return m(ve.div,o)}})},gb=e=>e.children(ab()),[hb,bb]=st({hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),yb=e=>{let[t,r]=xt()(e,["id"]),n=de({id:Pr()},t),o=dt(),i=de(()=>o().getItemGroupProps(n),r);return m(hb,{value:n,get children(){return m(ve.div,i)}})},vb=e=>{let t=dt(),r=bb(),n=de(t().getItemGroupLabelProps({htmlFor:r.id}),e);return m(ve.div,n)},xb=e=>{let t=dt(),r=lb(),n=de(()=>t().getItemIndicatorProps(r),e);return m(ve.div,n)},wb=e=>{let t=dt(),r=lb(),n=de(()=>t().getItemTextProps(r),e);return m(ve.div,n)},Tb=e=>{let t=dt(),r=yn(),n=de(()=>t().getPositionerProps(),e);return m(W,{get when(){return !r().unmounted},get children(){return m(ve.div,n)}})},_b=e=>{let[t,r]=xt()(e,["closeOnSelect","disabled","value","valueText"]),n=dt(),o=bb(),i=de(t,()=>({type:"radio",checked:o.value===t.value,onCheckedChange:()=>o.onValueChange?.({value:t.value})})),a=de(()=>n().getOptionItemProps(i),r),s=B(()=>n().getOptionItemState(i));return m(sb,{value:i,get children(){return m(Iu,{value:s,get children(){return m(ve.div,a)}})}})},Cb=e=>{let[t,r]=xt()(e,["id","onValueChange","value"]),n=dt(),o=de({id:Pr()},t),i=de(()=>n().getItemGroupProps(o),r);return m(hb,{value:o,get children(){return m(ve.div,i)}})},Sb=e=>{let t=Go(),r=Nn(),n=Pr(),o=B(()=>({id:n,dir:t().dir,getRootNode:r().getRootNode,open:e.defaultOpen,"open.controlled":e.open!==void 0,...e})),[i,a,s]=Rr(rb(o()),{context:o});return {api:B(()=>tb(i,a,rr)),machine:s}},[kb,Pb]=st({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:false}),[Eb,NP]=st({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:false}),Ib=e=>{let[t,r]=Vo(e),[n,o]=xt()(r,["anchorPoint","aria-label","closeOnSelect","composite","defaultOpen","highlightedValue","id","ids","loopFocus","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),i=dt(),a=Pb(),s=Sb(n),l=Ln(de(t,()=>({present:s.api().open})));return Se(()=>{a&&(i?.().setChild(s.machine),s.api().setParent(a));}),m(Eb,{value:()=>i?.().getTriggerItemProps(s.api()),get children(){return m(kb,{get value(){return s.machine},get children(){return m(nb,{get value(){return s.api},get children(){return m(zo,{value:l,get children(){return o.children}})}})}})}})},Ab=e=>{let t=dt(),r=Pb(),[n,o]=Vo(e),i=Ln(de(n,()=>({present:o.value.api().open})));return Se(()=>{r&&(t?.().setChild(o.value.machine),o.value.api().setParent(r));}),m(Eb,{value:()=>t?.().getTriggerItemProps(o.value.api()),get children(){return m(kb,{get value(){return o.value.machine},get children(){return m(nb,{get value(){return o.value.api},get children(){return m(zo,{value:i,get children(){return o.children}})}})}})}})},Ob=e=>{let t=dt(),r=de(()=>t().getSeparatorProps(),e);return m(ve.hr,r)},Rb=e=>{let t=dt(),r=yn(),n=de(()=>t().getTriggerProps(),()=>({"aria-controls":r().unmounted&&null}),e);return m(ve.button,n)},Db=e=>{let t=NP(),r=de(()=>t?.(),e);return m(ve.div,r)},Qr={};xn(Qr,{Arrow:()=>ob,ArrowTip:()=>ib,CheckboxItem:()=>cb,Content:()=>ub,Context:()=>db,ContextTrigger:()=>fb,Indicator:()=>pb,Item:()=>mb,ItemContext:()=>gb,ItemGroup:()=>yb,ItemGroupLabel:()=>vb,ItemIndicator:()=>xb,ItemText:()=>wb,Positioner:()=>Tb,RadioItem:()=>_b,RadioItemGroup:()=>Cb,Root:()=>Ib,RootProvider:()=>Ab,Separator:()=>Ob,Trigger:()=>Rb,TriggerItem:()=>Db});var Mb=br("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange"),Jr=Mb.build(),rl=vn({getRootId:e=>e.ids?.root??`progress-${e.id}`,getTrackId:e=>e.ids?.track??`progress-${e.id}-track`,getLabelId:e=>e.ids?.label??`progress-${e.id}-label`,getCircleId:e=>e.ids?.circle??`progress-${e.id}-circle`});function $b(e,t,r){let n=e.context.percent,o=e.context.isIndeterminate?"":`${n}%`,i=e.context.max,a=e.context.min,s=e.context.orientation,l=e.context.translations,c=e.context.isIndeterminate,u=e.context.value,d=l.value({value:u,max:i,percent:n,min:a}),f=BP(u,i),p={role:"progressbar","aria-label":d,"data-max":i,"aria-valuemin":a,"aria-valuemax":i,"aria-valuenow":u??void 0,"data-orientation":s,"data-state":f},g=FP(e.context);return {value:u,valueAsString:d,min:a,max:i,percent:n,percentAsString:o,indeterminate:c,setValue(h){t({type:"VALUE.SET",value:h});},setToMax(){t({type:"VALUE.SET",value:i});},setToMin(){t({type:"VALUE.SET",value:a});},getRootProps(){return r.element({dir:e.context.dir,...Jr.root.attrs,id:rl.getRootId(e.context),"data-max":i,"data-value":u??void 0,"data-state":f,"data-orientation":s,style:{"--percent":c?void 0:n}})},getLabelProps(){return r.element({dir:e.context.dir,id:rl.getLabelId(e.context),...Jr.label.attrs,"data-orientation":s})},getValueTextProps(){return r.element({dir:e.context.dir,"aria-live":"polite",...Jr.valueText.attrs})},getTrackProps(){return r.element({dir:e.context.dir,id:rl.getTrackId(e.context),...Jr.track.attrs,...p})},getRangeProps(){return r.element({dir:e.context.dir,...Jr.range.attrs,"data-orientation":s,"data-state":f,style:{[e.context.isHorizontal?"width":"height"]:c?void 0:`${n}%`}})},getCircleProps(){return r.element({dir:e.context.dir,id:rl.getCircleId(e.context),...Jr.circle.attrs,...p,...g.root})},getCircleTrackProps(){return r.element({dir:e.context.dir,"data-orientation":s,...Jr.circleTrack.attrs,...g.track})},getCircleRangeProps(){return r.element({dir:e.context.dir,...Jr.circleRange.attrs,...g.range,"data-state":f})},getViewProps(h){return r.element({dir:e.context.dir,...Jr.view.attrs,"data-state":h.state,hidden:h.state!==f})}}}function BP(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function FP(e){let t={style:{"--radius":"calc(var(--size) / 2 - var(--thickness) / 2)",cx:"calc(var(--size) / 2)",cy:"calc(var(--size) / 2)",r:"var(--radius)",fill:"transparent",strokeWidth:"var(--thickness)"}};return {root:{style:{width:"var(--size)",height:"var(--size)"}},track:t,range:{opacity:e.value===0?0:void 0,style:{...t.style,"--percent":e.percent,"--circumference":"calc(2 * 3.14159 * var(--radius))","--offset":"calc(var(--circumference) * (100 - var(--percent)) / 100)",strokeDashoffset:"calc(var(--circumference) * ((100 - var(--percent)) / 100))",strokeDasharray:e.isIndeterminate?void 0:"var(--circumference)",transformOrigin:"center",transform:"rotate(-90deg)"}}}}function UP(e,t){return e+(t-e)/2}function Lb(e){let t=Pt(e);return gr({id:"progress",initial:"idle",context:{max:t.max??100,min:t.min??0,value:UP(t.min??0,t.max??100),orientation:"horizontal",translations:{value:({percent:r})=>r===-1?"loading...":`${r} percent`,...t.translations},...t},created:["validateContext"],computed:{isIndeterminate:r=>r.value===null,percent(r){return Ji(r.value)?Math.round((r.value-r.min)/(r.max-r.min)*100):-1},isAtMax:r=>r.value===r.max,isHorizontal:r=>r.orientation==="horizontal",isRtl:r=>r.dir==="rtl"},states:{idle:{on:{"VALUE.SET":{actions:["setValue"]}}}}},{actions:{setValue:(r,n)=>{r.value=n.value===null?null:Math.max(0,Math.min(n.value,r.max));},validateContext:r=>{if(r.value!=null){if(!Au(r.max))throw new Error(`[progress] The max value passed \`${r.max}\` is not a valid number`);if(!jP(r.value,r.max))throw new Error(`[progress] The value passed \`${r.value}\` exceeds the max value \`${r.max}\``);if(!HP(r.value,r.min))throw new Error(`[progress] The value passed \`${r.value}\` exceeds the min value \`${r.min}\``)}}}})}function Au(e){return Ji(e)&&!isNaN(e)}function jP(e,t){return Au(e)&&e<=t}function HP(e,t){return Au(e)&&e>=t}tr()(["dir","getRootNode","id","ids","max","min","orientation","translations","value"]);var[Nb,Br]=st({hookName:"useProgressContext",providerName:"<ProgressProvider />"}),Bb=e=>{let t=Br(),r=de(()=>t().getCircleProps(),e);return m(ve.svg,r)},Fb=e=>{let t=Br(),r=de(()=>t().getCircleRangeProps(),e);return m(ve.circle,r)},Ub=e=>{let t=Br(),r=de(()=>t().getCircleTrackProps(),e);return m(ve.circle,r)},jb=e=>e.children(Br()),Hb=e=>{let t=Br(),r=de(()=>t().getLabelProps(),e);return m(ve.label,r)},Wb=e=>{let t=Br(),r=de(()=>t().getRangeProps(),e);return m(ve.div,r)},Vb=e=>{let t=Go(),r=Nn(),n=Pr(),o=B(()=>({id:n,dir:t().dir,getRootNode:r().getRootNode,...e})),[i,a]=Rr(Lb(o()),{context:o});return B(()=>$b(i,a,rr))},zb=e=>{let[t,r]=xt()(e,["id","ids","max","min","orientation","translations","value"]),n=Vb(t),o=de(()=>n().getRootProps(),r);return m(Nb,{value:n,get children(){return m(ve.div,o)}})},Gb=e=>{let[{value:t},r]=xt()(e,["value"]),n=de(()=>t().getRootProps(),r);return m(Nb,{value:t,get children(){return m(ve.div,n)}})},qb=e=>{let t=Br(),r=de(()=>t().getTrackProps(),e);return m(ve.div,r)},Yb=e=>{let t=Br(),r=de(()=>t().getValueTextProps(),e);return m(ve.span,Re(r,{get children(){return e.children||t().percentAsString}}))},Kb=e=>{let[t,r]=xt()(e,["state"]),n=Br(),o=de(()=>n().getViewProps(t),r);return m(ve.span,o)},Gn={};xn(Gn,{Circle:()=>Bb,CircleRange:()=>Fb,CircleTrack:()=>Ub,Context:()=>jb,Label:()=>Hb,Range:()=>Wb,Root:()=>zb,RootProvider:()=>Gb,Track:()=>qb,ValueText:()=>Yb,View:()=>Kb});var zP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ei=new WeakMap,nl=new WeakMap,ol={},Ou=0,Xb=function(e){return e&&(e.host||Xb(e.parentNode))},GP=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Xb(r);return n&&e.contains(n)?n:null}).filter(function(r){return !!r})},qP=function(e,t,r,n){var o=GP(t,Array.isArray(e)?e:[e]);ol[r]||(ol[r]=new WeakMap);var i=ol[r],a=[],s=new Set,l=new Set(o),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode));};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))u(f);else try{var p=f.getAttribute(n),g=p!==null&&p!=="false",h=(ei.get(f)||0)+1,b=(i.get(f)||0)+1;ei.set(f,h),i.set(f,b),a.push(f),h===1&&g&&nl.set(f,!0),b===1&&f.setAttribute(r,"true"),g||f.setAttribute(n,"true");}catch{}});};return u(t),s.clear(),Ou++,function(){a.forEach(function(d){var f=ei.get(d)-1,p=i.get(d)-1;ei.set(d,f),i.set(d,p),f||(nl.has(d)||d.removeAttribute(n),nl.delete(d)),p||d.removeAttribute(r);}),Ou--,Ou||(ei=new WeakMap,ei=new WeakMap,nl=new WeakMap,ol={});}},Zb=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=zP(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live]"))),qP(n,o,r,"aria-hidden")):function(){return null}};var YP=e=>{let t=requestAnimationFrame(()=>e());return ()=>cancelAnimationFrame(t)};function Qb(e,t={}){let{defer:r=true}=t,n=r?YP:i=>i(),o=[];return o.push(n(()=>{let a=(typeof e=="function"?e():e).filter(Boolean);o.push(Zb(a));})),()=>{o.forEach(i=>i?.());}}var Ru="data-scroll-lock";function Jb(e,t){if(!e)return;let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r;}}function KP(e,t,r){if(!e)return;let n=e.style.getPropertyValue(t);return e.style.setProperty(t,r),()=>{n?e.style.setProperty(t,n):e.style.removeProperty(t);}}function XP(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function ey(e){let t=e??document,r=t.defaultView??window,{documentElement:n,body:o}=t;if(o.hasAttribute(Ru))return;o.setAttribute(Ru,"");let a=r.innerWidth-n.clientWidth,s=()=>KP(n,"--scrollbar-width",`${a}px`),l=XP(n),c=()=>Jb(o,{overflow:"hidden",[l]:`${a}px`}),u=()=>{let{scrollX:f,scrollY:p,visualViewport:g}=r,h=g?.offsetLeft??0,b=g?.offsetTop??0,y=Jb(o,{position:"fixed",overflow:"hidden",top:`${-(p-Math.floor(b))}px`,left:`${-(f-Math.floor(h))}px`,right:"0",[l]:`${a}px`});return ()=>{y?.(),r.scrollTo({left:f,top:p,behavior:"instant"});}},d=[s(),Eg()?u():c()];return ()=>{d.forEach(f=>f?.()),o.removeAttribute(Ru);}}var ry=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],il=ry.join(","),ny=typeof Element>"u",qn=ny?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,al=!ny&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},sl=function e(t,r){var n;r===void 0&&(r=true);var o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"inert"),i=o===""||o==="true",a=i||r&&t&&e(t.parentNode);return a},ZP=function(t){var r,n=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return n===""||n==="true"},oy=function(t,r,n){if(sl(t))return [];var o=Array.prototype.slice.apply(t.querySelectorAll(il));return r&&qn.call(t,il)&&o.unshift(t),o=o.filter(n),o},iy=function e(t,r,n){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!sl(a,false))if(a.tagName==="SLOT"){var s=a.assignedElements(),l=s.length?s:a.children,c=e(l,true,n);n.flatten?o.push.apply(o,c):o.push({scopeParent:a,candidates:c});}else {var u=qn.call(a,il);u&&n.filter(a)&&(r||!t.includes(a))&&o.push(a);var d=a.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(a),f=!sl(d,false)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(d&&f){var p=e(d===true?a.children:d.children,true,n);n.flatten?o.push.apply(o,p):o.push({scopeParent:a,candidates:p});}else i.unshift.apply(i,a.children);}}return o},ay=function(t){return !isNaN(parseInt(t.getAttribute("tabindex"),10))},Tn=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ZP(t))&&!ay(t)?0:t.tabIndex},QP=function(t,r){var n=Tn(t);return n<0&&r&&!ay(t)?0:n},JP=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},sy=function(t){return t.tagName==="INPUT"},eE=function(t){return sy(t)&&t.type==="hidden"},tE=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return r},rE=function(t,r){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===r)return t[n]},nE=function(t){if(!t.name)return true;var r=t.form||al(t),n=function(s){return r.querySelectorAll('input[type="radio"][name="'+s+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=n(window.CSS.escape(t.name));else try{o=n(t.name);}catch{return false}var i=rE(o,t.form);return !i||i===t},oE=function(t){return sy(t)&&t.type==="radio"},iE=function(t){return oE(t)&&!nE(t)},aE=function(t){var r,n=t&&al(t),o=(r=n)===null||r===void 0?void 0:r.host,i=false;if(n&&n!==t){var a,s,l;for(i=!!((a=o)!==null&&a!==void 0&&(s=a.ownerDocument)!==null&&s!==void 0&&s.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&o;){var c,u,d;n=al(o),o=(c=n)===null||c===void 0?void 0:c.host,i=!!((u=o)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(o));}}return i},ty=function(t){var r=t.getBoundingClientRect(),n=r.width,o=r.height;return n===0&&o===0},sE=function(t,r){var n=r.displayCheck,o=r.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return true;var i=qn.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(qn.call(a,"details:not([open]) *"))return true;if(!n||n==="full"||n==="legacy-full"){if(typeof o=="function"){for(var s=t;t;){var l=t.parentElement,c=al(t);if(l&&!l.shadowRoot&&o(l)===true)return ty(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l;}t=s;}if(aE(t))return !t.getClientRects().length;if(n!=="legacy-full")return true}else if(n==="non-zero-area")return ty(t);return false},lE=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var n=0;n<r.children.length;n++){var o=r.children.item(n);if(o.tagName==="LEGEND")return qn.call(r,"fieldset[disabled] *")?true:!o.contains(t)}return true}r=r.parentElement;}return false},ll=function(t,r){return !(r.disabled||sl(r)||eE(r)||sE(r,t)||tE(r)||lE(r))},Du=function(t,r){return !(iE(r)||Tn(r)<0||!ll(t,r))},cE=function(t){var r=parseInt(t.getAttribute("tabindex"),10);return !!(isNaN(r)||r>=0)},uE=function e(t){var r=[],n=[];return t.forEach(function(o,i){var a=!!o.scopeParent,s=a?o.scopeParent:o,l=QP(s,a),c=a?e(o.candidates):s;l===0?a?r.push.apply(r,c):r.push(s):n.push({documentOrder:i,tabIndex:l,item:o,isScope:a,content:c});}),n.sort(JP).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(r)},ly=function(t,r){r=r||{};var n;return r.getShadowRoot?n=iy([t],r.includeContainer,{filter:Du.bind(null,r),flatten:false,getShadowRoot:r.getShadowRoot,shadowRootFilter:cE}):n=oy(t,r.includeContainer,Du.bind(null,r)),uE(n)},cy=function(t,r){r=r||{};var n;return r.getShadowRoot?n=iy([t],r.includeContainer,{filter:ll.bind(null,r),flatten:true,getShadowRoot:r.getShadowRoot}):n=oy(t,r.includeContainer,ll.bind(null,r)),n},Yn=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return qn.call(t,il)===false?false:Du(r,t)},dE=ry.concat("iframe").join(","),cl=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return qn.call(t,dE)===false?false:ll(r,t)};function fE(e,t,r){return (t=mE(t))in e?Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true}):e[t]=r,e}function uy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n);}return r}function dy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uy(Object(r),true).forEach(function(n){fE(e,n,r[n]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));});}return e}function pE(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}function mE(e){var t=pE(e,"string");return typeof t=="symbol"?t:t+""}var fy={activateTrap:function(t,r){if(t.length>0){var n=t[t.length-1];n!==r&&n.pause();}var o=t.indexOf(r);o===-1||t.splice(o,1),t.push(r);},deactivateTrap:function(t,r){var n=t.indexOf(r);n!==-1&&t.splice(n,1),t.length>0&&t[t.length-1].unpause();}},gE=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},hE=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},ua=function(t){return t?.key==="Tab"||t?.keyCode===9},bE=function(t){return ua(t)&&!t.shiftKey},yE=function(t){return ua(t)&&t.shiftKey},py=function(t){return setTimeout(t,0)},my=function(t,r){var n=-1;return t.every(function(o,i){return r(o)?(n=i,false):true}),n},ca=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return typeof t=="function"?t.apply(void 0,n):t},ul=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},vE=[],gy=function(t,r){var n=r?.document||document,o=r?.trapStack||vE,i=dy({returnFocusOnDeactivate:true,escapeDeactivates:true,delayInitialFocus:true,isKeyForward:bE,isKeyBackward:yE},r),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:false,paused:false,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s,l=function(_,T,O){return _&&_[T]!==void 0?_[T]:i[O||T]},c=function(_,T){var O=typeof T?.composedPath=="function"?T.composedPath():void 0;return a.containerGroups.findIndex(function(L){var z=L.container,ne=L.tabbableNodes;return z.contains(_)||O?.includes(z)||ne.find(function(K){return K===_})})},u=function(_){var T=i[_];if(typeof T=="function"){for(var O=arguments.length,L=new Array(O>1?O-1:0),z=1;z<O;z++)L[z-1]=arguments[z];T=T.apply(void 0,L);}if(T===true&&(T=void 0),!T){if(T===void 0||T===false)return T;throw new Error("`".concat(_,"` was specified but was not a node, or did not return a node"))}var ne=T;if(typeof T=="string"&&(ne=n.querySelector(T),!ne))throw new Error("`".concat(_,"` as selector refers to no known node"));return ne},d=function(){var _=u("initialFocus");if(_===false)return false;if(_===void 0||!cl(_,i.tabbableOptions))if(c(n.activeElement)>=0)_=n.activeElement;else {var T=a.tabbableGroups[0],O=T&&T.firstTabbableNode;_=O||u("fallbackFocus");}if(!_)throw new Error("Your focus-trap needs to have at least one focusable element");return _},f=function(){if(a.containerGroups=a.containers.map(function(_){var T=ly(_,i.tabbableOptions),O=cy(_,i.tabbableOptions),L=T.length>0?T[0]:void 0,z=T.length>0?T[T.length-1]:void 0,ne=O.find(function(Ce){return Yn(Ce)}),K=O.slice().reverse().find(function(Ce){return Yn(Ce)}),Ie=!!T.find(function(Ce){return Tn(Ce)>0});return {container:_,tabbableNodes:T,focusableNodes:O,posTabIndexesFound:Ie,firstTabbableNode:L,lastTabbableNode:z,firstDomTabbableNode:ne,lastDomTabbableNode:K,nextTabbableNode:function(nt){var Lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:true,ft=T.indexOf(nt);return ft<0?Lt?O.slice(O.indexOf(nt)+1).find(function(Nt){return Yn(Nt)}):O.slice(0,O.indexOf(nt)).reverse().find(function(Nt){return Yn(Nt)}):T[ft+(Lt?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(_){return _.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(_){return _.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function(_){var T=_.activeElement;if(T)return T.shadowRoot&&T.shadowRoot.activeElement!==null?p(T.shadowRoot):T},g=function(_){if(_!==false&&_!==p(document)){if(!_||!_.focus){g(d());return}_.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=_,gE(_)&&_.select();}},h=function(_){var T=u("setReturnFocus",_);return T||(T===false?false:_)},b=function(_){var T=_.target,O=_.event,L=_.isBackward,z=L===void 0?false:L;T=T||ul(O),f();var ne=null;if(a.tabbableGroups.length>0){var K=c(T,O),Ie=K>=0?a.containerGroups[K]:void 0;if(K<0)z?ne=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:ne=a.tabbableGroups[0].firstTabbableNode;else if(z){var Ce=my(a.tabbableGroups,function(Bt){var Ye=Bt.firstTabbableNode;return T===Ye});if(Ce<0&&(Ie.container===T||cl(T,i.tabbableOptions)&&!Yn(T,i.tabbableOptions)&&!Ie.nextTabbableNode(T,false))&&(Ce=K),Ce>=0){var nt=Ce===0?a.tabbableGroups.length-1:Ce-1,Lt=a.tabbableGroups[nt];ne=Tn(T)>=0?Lt.lastTabbableNode:Lt.lastDomTabbableNode;}else ua(O)||(ne=Ie.nextTabbableNode(T,false));}else {var ft=my(a.tabbableGroups,function(Bt){var Ye=Bt.lastTabbableNode;return T===Ye});if(ft<0&&(Ie.container===T||cl(T,i.tabbableOptions)&&!Yn(T,i.tabbableOptions)&&!Ie.nextTabbableNode(T))&&(ft=K),ft>=0){var Nt=ft===a.tabbableGroups.length-1?0:ft+1,Kt=a.tabbableGroups[Nt];ne=Tn(T)>=0?Kt.firstTabbableNode:Kt.firstDomTabbableNode;}else ua(O)||(ne=Ie.nextTabbableNode(T));}}else ne=u("fallbackFocus");return ne},y=function(_){var T=ul(_);if(!(c(T,_)>=0)){if(ca(i.clickOutsideDeactivates,_)){s.deactivate({returnFocus:i.returnFocusOnDeactivate});return}ca(i.allowOutsideClick,_)||_.preventDefault();}},S=function(_){var T=ul(_),O=c(T,_)>=0;if(O||T instanceof Document)O&&(a.mostRecentlyFocusedNode=T);else {_.stopImmediatePropagation();var L,z=true;if(a.mostRecentlyFocusedNode)if(Tn(a.mostRecentlyFocusedNode)>0){var ne=c(a.mostRecentlyFocusedNode),K=a.containerGroups[ne].tabbableNodes;if(K.length>0){var Ie=K.findIndex(function(Ce){return Ce===a.mostRecentlyFocusedNode});Ie>=0&&(i.isKeyForward(a.recentNavEvent)?Ie+1<K.length&&(L=K[Ie+1],z=false):Ie-1>=0&&(L=K[Ie-1],z=false));}}else a.containerGroups.some(function(Ce){return Ce.tabbableNodes.some(function(nt){return Tn(nt)>0})})||(z=false);else z=false;z&&(L=b({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),g(L||a.mostRecentlyFocusedNode||d());}a.recentNavEvent=void 0;},C=function(_){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:false;a.recentNavEvent=_;var O=b({event:_,isBackward:T});O&&(ua(_)&&_.preventDefault(),g(O));},k=function(_){(i.isKeyForward(_)||i.isKeyBackward(_))&&C(_,i.isKeyBackward(_));},D=function(_){hE(_)&&ca(i.escapeDeactivates,_)!==false&&(_.preventDefault(),s.deactivate());},U=function(_){var T=ul(_);c(T,_)>=0||ca(i.clickOutsideDeactivates,_)||ca(i.allowOutsideClick,_)||(_.preventDefault(),_.stopImmediatePropagation());},N=function(){if(a.active)return fy.activateTrap(o,s),a.delayInitialFocusTimer=i.delayInitialFocus?py(function(){g(d());}):g(d()),n.addEventListener("focusin",S,true),n.addEventListener("mousedown",y,{capture:true,passive:false}),n.addEventListener("touchstart",y,{capture:true,passive:false}),n.addEventListener("click",U,{capture:true,passive:false}),n.addEventListener("keydown",k,{capture:true,passive:false}),n.addEventListener("keydown",D),s},ie=function(){if(a.active)return n.removeEventListener("focusin",S,true),n.removeEventListener("mousedown",y,true),n.removeEventListener("touchstart",y,true),n.removeEventListener("click",U,true),n.removeEventListener("keydown",k,true),n.removeEventListener("keydown",D),s},I=function(_){var T=_.some(function(O){var L=Array.from(O.removedNodes);return L.some(function(z){return z===a.mostRecentlyFocusedNode})});T&&g(d());},A=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(I):void 0,R=function(){A&&(A.disconnect(),a.active&&!a.paused&&a.containers.map(function(_){A.observe(_,{subtree:true,childList:true});}));};return s={get active(){return a.active},get paused(){return a.paused},activate:function(_){if(a.active)return this;var T=l(_,"onActivate"),O=l(_,"onPostActivate"),L=l(_,"checkCanFocusTrap");L||f(),a.active=true,a.paused=false,a.nodeFocusedBeforeActivation=n.activeElement,T?.();var z=function(){L&&f(),N(),R(),O?.();};return L?(L(a.containers.concat()).then(z,z),this):(z(),this)},deactivate:function(_){if(!a.active)return this;var T=dy({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},_);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,ie(),a.active=false,a.paused=false,R(),fy.deactivateTrap(o,s);var O=l(T,"onDeactivate"),L=l(T,"onPostDeactivate"),z=l(T,"checkCanReturnFocus"),ne=l(T,"returnFocus","returnFocusOnDeactivate");O?.();var K=function(){py(function(){ne&&g(h(a.nodeFocusedBeforeActivation)),L?.();});};return ne&&z?(z(h(a.nodeFocusedBeforeActivation)).then(K,K),this):(K(),this)},pause:function(_){if(a.paused||!a.active)return this;var T=l(_,"onPause"),O=l(_,"onPostPause");return a.paused=true,T?.(),ie(),R(),O?.(),this},unpause:function(_){if(!a.paused||!a.active)return this;var T=l(_,"onUnpause"),O=l(_,"onPostUnpause");return a.paused=false,T?.(),f(),N(),R(),O?.(),this},updateContainerElements:function(_){var T=[].concat(_).filter(Boolean);return a.containers=T.map(function(O){return typeof O=="string"?n.querySelector(O):O}),a.active&&f(),R(),this}},s.updateContainerElements(t),s};var hy=br("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),Kn=hy.build(),Ee=vn({getPositionerId:e=>e.ids?.positioner??`dialog:${e.id}:positioner`,getBackdropId:e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,getContentId:e=>e.ids?.content??`dialog:${e.id}:content`,getTriggerId:e=>e.ids?.trigger??`dialog:${e.id}:trigger`,getTitleId:e=>e.ids?.title??`dialog:${e.id}:title`,getDescriptionId:e=>e.ids?.description??`dialog:${e.id}:description`,getCloseTriggerId:e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,getContentEl:e=>Ee.getById(e,Ee.getContentId(e)),getPositionerEl:e=>Ee.getById(e,Ee.getPositionerId(e)),getBackdropEl:e=>Ee.getById(e,Ee.getBackdropId(e)),getTriggerEl:e=>Ee.getById(e,Ee.getTriggerId(e)),getTitleEl:e=>Ee.getById(e,Ee.getTitleId(e)),getDescriptionEl:e=>Ee.getById(e,Ee.getDescriptionId(e)),getCloseTriggerEl:e=>Ee.getById(e,Ee.getCloseTriggerId(e))});function by(e,t,r){let n=e.context["aria-label"],o=e.matches("open"),i=e.context.renderedElements;return {open:o,setOpen(a){a!==o&&t(a?"OPEN":"CLOSE");},getTriggerProps(){return r.button({...Kn.trigger.attrs,dir:e.context.dir,id:Ee.getTriggerId(e.context),"aria-haspopup":"dialog",type:"button","aria-expanded":o,"data-state":o?"open":"closed","aria-controls":Ee.getContentId(e.context),onClick(a){a.defaultPrevented||t("TOGGLE");}})},getBackdropProps(){return r.element({...Kn.backdrop.attrs,dir:e.context.dir,hidden:!o,id:Ee.getBackdropId(e.context),"data-state":o?"open":"closed"})},getPositionerProps(){return r.element({...Kn.positioner.attrs,dir:e.context.dir,id:Ee.getPositionerId(e.context),style:{pointerEvents:o?void 0:"none"}})},getContentProps(){return r.element({...Kn.content.attrs,dir:e.context.dir,role:e.context.role,hidden:!o,id:Ee.getContentId(e.context),tabIndex:-1,"data-state":o?"open":"closed","aria-modal":true,"aria-label":n||void 0,"aria-labelledby":n||!i.title?void 0:Ee.getTitleId(e.context),"aria-describedby":i.description?Ee.getDescriptionId(e.context):void 0})},getTitleProps(){return r.element({...Kn.title.attrs,dir:e.context.dir,id:Ee.getTitleId(e.context)})},getDescriptionProps(){return r.element({...Kn.description.attrs,dir:e.context.dir,id:Ee.getDescriptionId(e.context)})},getCloseTriggerProps(){return r.button({...Kn.closeTrigger.attrs,dir:e.context.dir,id:Ee.getCloseTriggerId(e.context),type:"button",onClick(a){a.defaultPrevented||(a.stopPropagation(),t("CLOSE"));}})}}}function yy(e){let t=Pt(e);return gr({id:"dialog",initial:t.open?"open":"closed",context:{role:"dialog",renderedElements:{title:true,description:true},modal:true,trapFocus:true,preventScroll:true,closeOnInteractOutside:true,closeOnEscape:true,restoreFocus:true,...t},created:["setAlertDialogProps"],watch:{open:["toggleVisibility"]},states:{open:{entry:["checkRenderedElements","syncZIndex"],activities:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}}},{guards:{isOpenControlled:r=>!!r["open.controlled"]},activities:{trackDismissableElement(r,n,{send:o}){return Js(()=>Ee.getContentEl(r),{defer:true,pointerBlocking:r.modal,exclude:[Ee.getTriggerEl(r)],onInteractOutside(a){r.onInteractOutside?.(a),r.closeOnInteractOutside||a.preventDefault();},persistentElements:r.persistentElements,onFocusOutside:r.onFocusOutside,onPointerDownOutside:r.onPointerDownOutside,onEscapeKeyDown(a){r.onEscapeKeyDown?.(a),r.closeOnEscape||a.preventDefault();},onDismiss(){o({type:"CLOSE",src:"interact-outside"});}})},preventScroll(r){if(r.preventScroll)return ey(Ee.getDoc(r))},trapFocus(r){if(!r.trapFocus||!r.modal)return;let n,o=Ng(()=>{let i=Ee.getContentEl(r);if(i){n=gy(i,{document:Ee.getDoc(r),escapeDeactivates:false,preventScroll:true,fallbackFocus:i,returnFocusOnDeactivate:r.restoreFocus,allowOutsideClick:true,initialFocus:r.initialFocusEl?.()??void 0,setReturnFocus(a){return r.finalFocusEl?.()??a}});try{n.activate();}catch{}}});return ()=>{n?.deactivate(),o();}},hideContentBelow(r){return r.modal?Qb(()=>[Ee.getContentEl(r)],{defer:true}):void 0}},actions:{setAlertDialogProps(r){r.role==="alertdialog"&&(r.initialFocusEl||(r.initialFocusEl=()=>Ee.getCloseTriggerEl(r)),r.closeOnInteractOutside=false);},checkRenderedElements(r){lt(()=>{r.renderedElements.title=!!Ee.getTitleEl(r),r.renderedElements.description=!!Ee.getDescriptionEl(r);});},syncZIndex(r){lt(()=>{let n=Ee.getContentEl(r);if(!n)return;let i=Ee.getWin(r).getComputedStyle(n);[Ee.getPositionerEl(r),Ee.getBackdropEl(r)].forEach(s=>{s?.style.setProperty("--z-index",i.zIndex);});});},invokeOnClose(r){r.onOpenChange?.({open:false});},invokeOnOpen(r){r.onOpenChange?.({open:true});},toggleVisibility(r,n,{send:o}){o({type:r.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n});}}})}tr()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open.controlled","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);var[vy,en]=st({hookName:"useDialogContext",providerName:"<DialogProvider />"}),xy=e=>{let t=en(),r=Gm(),n=Ln(de(r,()=>({present:t().open}))),o=de(()=>t().getBackdropProps(),()=>n().presenceProps,e);return m(W,{get when(){return !n().unmounted},get children(){return m(ve.div,o)}})},wy=e=>{let t=en(),r=de(()=>t().getCloseTriggerProps(),e);return m(ve.button,r)},Ty=e=>{let t=en(),r=yn(),n=de(()=>t().getContentProps(),()=>r().presenceProps,e);return m(W,{get when(){return !r().unmounted},get children(){return m(ve.div,n)}})},_y=e=>e.children(en()),Cy=e=>{let t=en(),r=de(()=>t().getDescriptionProps(),e);return m(ve.div,r)},Sy=e=>{let t=en(),r=yn(),n=de(()=>t().getPositionerProps(),e);return m(W,{get when(){return !r().unmounted},get children(){return m(ve.div,n)}})},ky=e=>{let t=Go(),r=Nn(),n=Pr(),o=B(()=>({id:n,dir:t().dir,getRootNode:r().getRootNode,open:e.defaultOpen,"open.controlled":e.open!==void 0,...e})),[i,a]=Rr(yy(o()),{context:o});return B(()=>by(i,a,rr))},Py=e=>{let[t,r]=Vo(e),[n]=Gi(t),[o,i]=xt()(r,["aria-label","closeOnEscape","closeOnInteractOutside","defaultOpen","finalFocusEl","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),a=ky(o),s=Ln(de(t,()=>({present:a().open})));return m(vy,{value:a,get children(){return m(Jc,{value:n,get children(){return m(zo,{value:s,get children(){return i.children}})}})}})},Ey=e=>{let[t,r]=Vo(e),[n]=Gi(t),o=Ln(de(t,()=>({present:r.value().open})));return m(vy,{get value(){return r.value},get children(){return m(Jc,{value:n,get children(){return m(zo,{value:o,get children(){return r.children}})}})}})},Iy=e=>{let t=en(),r=de(()=>t().getTitleProps(),e);return m(ve.h2,r)},Ay=e=>{let t=en(),r=yn(),n=de(()=>t().getTriggerProps(),()=>({"aria-controls":r().unmounted&&null}),e);return m(ve.button,n)},_n={};xn(_n,{Backdrop:()=>xy,CloseTrigger:()=>wy,Content:()=>Ty,Context:()=>_y,Description:()=>Cy,Positioner:()=>Sy,Root:()=>Py,RootProvider:()=>Ey,Title:()=>Iy,Trigger:()=>Ay});var Fr=Pu({placement:"bottom-end",gap:24});var Oy="#brand-mark{background-color:#c2c2c6!important;border-color:#ebebf4!important;border-radius:5px!important;border-width:1px!important;bottom:20px!important;color:#000!important;cursor:pointer;display:flex!important;font-size:14px!important;font-weight:600!important;gap:8px!important;left:auto!important;line-height:20px!important;opacity:1!important;padding:5px 10px!important;position:absolute!important;right:auto!important;text-decoration:none!important;top:auto!important;transition:background-color .2s ease-in-out!important;visibility:visible!important;z-index:50!important}#brand-mark:hover{background-color:#000!important;border-color:#282828!important;color:#fff!important}";var Ry=async({apiHost:e,message:t,sessionId:r})=>{try{return {data:await pn.post(`${Ne(e)?e:yt()}/api/v1/sessions/${r}/continueChat`,{headers:{"x-original-referrer":document.referrer},json:{message:t},timeout:!1}).json()}}catch(n){return {error:n}}};var Mu=async({apiHost:e,sessionId:t,clientLogs:r})=>{try{await pn.post(`${Ne(e)?e:yt()}/api/v1/sessions/${t}/clientLogs`,{json:{clientLogs:r}});}catch{}};var dl=e=>typeof e=="string"?e:e instanceof Error?e.name+": "+e.message:JSON.stringify(e);var Dy=Object.getPrototypeOf(async()=>{}).constructor,fl=async({content:e,args:t})=>{try{let n=await Dy(...t.map(o=>o.id),_E(e))(...t.map(o=>o.value));if(n&&typeof n=="string")return {scriptCallbackMessage:n}}catch(r){return {logs:[{status:"error",description:"Script block failed to execute",details:dl(r)}]}}},_E=e=>e.replace(/<script>/g,"").replace(/<\/script>/g,""),da=async({args:e,content:t})=>{try{let n=await Dy(...Object.keys(e),t)(...Object.keys(e).map(o=>e[o]));if(n&&typeof n=="string")return {scriptCallbackMessage:n}}catch{}};var ti="Chatwoot Web Widget Opened";var My=e=>(fl(e.scriptToExecute),{scriptCallbackMessage:ti});var $y=e=>pe(window.gtag)?Promise.resolve():new Promise(t=>{let r=document.getElementById("gtag");if(!r){let n=document.createElement("script");n.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,n.id="gtag";let o=document.createElement("script");o.innerHTML=`window.dataLayer = window.dataLayer || [];
9
+ `);if(t===null||nl(t)!=="object")throw new Error(r);if(Object.keys(t).length===1&&typeof t.advancedFraudSignals=="boolean")return t;throw new Error(r)},ol,Su=false,Dx=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];Su=true;var o=Date.now();return O1(ol).then(function(i){return R1(i,r,o)})};Dx.setLoadParameters=function(e){if(Su&&ol){var t=Ax(e),r=Object.keys(t),n=r.reduce(function(o,i){var a;return o&&e[i]===((a=ol)===null||a===void 0?void 0:a[i])},true);if(n)return}if(Su)throw new Error("You cannot change load parameters after calling loadStripe");ol=Ax(e);};ku.loadStripe=Dx;});var Nx=tt((UY,$x)=>{$x.exports=Mx();});var pa={};_0(pa,{__addDisposableResource:()=>Tv,__assign:()=>ll,__asyncDelegator:()=>mv,__asyncGenerator:()=>pv,__asyncValues:()=>gv,__await:()=>Zo,__awaiter:()=>sv,__classPrivateFieldGet:()=>xv,__classPrivateFieldIn:()=>wv,__classPrivateFieldSet:()=>vv,__createBinding:()=>ul,__decorate:()=>ev,__disposeResources:()=>Cv,__esDecorate:()=>rv,__exportStar:()=>cv,__extends:()=>Qx,__generator:()=>lv,__importDefault:()=>yv,__importStar:()=>bv,__makeTemplateObject:()=>hv,__metadata:()=>av,__param:()=>tv,__propKey:()=>ov,__read:()=>Ou,__rest:()=>Jx,__rewriteRelativeImportExtension:()=>_v,__runInitializers:()=>nv,__setFunctionName:()=>iv,__spread:()=>uv,__spreadArray:()=>fv,__spreadArrays:()=>dv,__values:()=>cl,default:()=>hA});function Qx(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Iu(e,t);function r(){this.constructor=e;}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r);}function Jx(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function ev(e,t,r,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(o<3?a(i):o>3?a(t,r,i):a(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function tv(e,t){return function(r,n){t(r,n,e);}}function rv(e,t,r,n,o,i){function a(T){if(T!==void 0&&typeof T!="function")throw new TypeError("Function expected");return T}for(var s=n.kind,l=s==="getter"?"get":s==="setter"?"set":"value",u=!t&&e?n.static?e:e.prototype:null,c=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),d,p=false,f=r.length-1;f>=0;f--){var b={};for(var g in n)b[g]=g==="access"?{}:n[g];for(var g in n.access)b.access[g]=n.access[g];b.addInitializer=function(T){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(T||null));};var y=(0, r[f])(s==="accessor"?{get:c.get,set:c.set}:c[l],b);if(s==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(d=a(y.get))&&(c.get=d),(d=a(y.set))&&(c.set=d),(d=a(y.init))&&o.unshift(d);}else (d=a(y))&&(s==="field"?o.unshift(d):c[l]=d);}u&&Object.defineProperty(u,n.name,c),p=true;}function nv(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function ov(e){return typeof e=="symbol"?e:"".concat(e)}function iv(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:true,value:r?"".concat(r," ",t):t})}function av(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function sv(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i);})}return new(r||(r=Promise))(function(i,a){function s(c){try{u(n.next(c));}catch(d){a(d);}}function l(c){try{u(n.throw(c));}catch(d){a(d);}}function u(c){c.done?i(c.value):o(c.value).then(s,l);}u((n=n.apply(e,t||[])).next());})}function lv(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(c){return l([u,c])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(r=0)),r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r);}catch(c){u=[6,c],o=0;}finally{n=i=0;}if(u[0]&5)throw u[1];return {value:u[0]?u[1]:void 0,done:true}}}function cv(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&ul(t,e,r);}function cl(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return {next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ou(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value);}catch(s){a={error:s};}finally{try{o&&!o.done&&(r=n.return)&&r.call(n);}finally{if(a)throw a.error}}return i}function uv(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ou(arguments[t]));return e}function dv(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}function fv(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function Zo(e){return this instanceof Zo?(this.v=e,this):new Zo(e)}function pv(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(f){return function(b){return Promise.resolve(b).then(f,d)}}function s(f,b){n[f]&&(o[f]=function(g){return new Promise(function(y,T){i.push([f,g,y,T])>1||l(f,g);})},b&&(o[f]=b(o[f])));}function l(f,b){try{u(n[f](b));}catch(g){p(i[0][3],g);}}function u(f){f.value instanceof Zo?Promise.resolve(f.value.v).then(c,d):p(i[0][2],f);}function c(f){l("next",f);}function d(f){l("throw",f);}function p(f,b){f(b),i.shift(),i.length&&l(i[0][0],i[0][1]);}}function mv(e){var t,r;return t={},n("next"),n("throw",function(o){throw o}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(o,i){t[o]=e[o]?function(a){return (r=!r)?{value:Zo(e[o](a)),done:false}:i?i(a):a}:i;}}function gv(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof cl=="function"?cl(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,l){a=e[i](a),o(s,l,a.done,a.value);})};}function o(i,a,s,l){Promise.resolve(l).then(function(u){i({value:u,done:s});},a);}}function hv(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function bv(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=Au(e),n=0;n<r.length;n++)r[n]!=="default"&&ul(t,e,r[n]);return mA(t,e),t}function yv(e){return e&&e.__esModule?e:{default:e}}function xv(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function vv(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function wv(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function Tv(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose];}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(o=n);}if(typeof n!="function")throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this);}catch(i){return Promise.reject(i)}}),e.stack.push({value:t,dispose:n,async:r});}else r&&e.stack.push({async:true});return t}function Cv(e){function t(i){e.error=e.hasError?new gA(i,e.error,"An error was suppressed during disposal."):i,e.hasError=true;}var r,n=0;function o(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(a){return t(a),o()})}else n|=1;}catch(a){t(a);}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function _v(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,o,i,a){return n?t?".jsx":".js":o&&(!i||!a)?r:o+i+"."+a.toLowerCase()+"js"}):e}var Iu,ll,ul,mA,Au,gA,hA,ma=C0(()=>{Iu=function(e,t){return Iu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n;}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o]);},Iu(e,t)};ll=function(){return ll=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i]);}return t},ll.apply(this,arguments)};ul=Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:true,get:function(){return t[r]}}),Object.defineProperty(e,n,o);}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r];});mA=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t});}):function(e,t){e.default=t;},Au=function(e){return Au=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},Au(e)};gA=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};hA={__extends:Qx,__assign:ll,__rest:Jx,__decorate:ev,__param:tv,__esDecorate:rv,__runInitializers:nv,__propKey:ov,__setFunctionName:iv,__metadata:av,__awaiter:sv,__generator:lv,__createBinding:ul,__exportStar:cv,__values:cl,__read:Ou,__spread:uv,__spreadArrays:dv,__spreadArray:fv,__await:Zo,__asyncGenerator:pv,__asyncDelegator:mv,__asyncValues:gv,__makeTemplateObject:hv,__importStar:bv,__importDefault:yv,__classPrivateFieldGet:xv,__classPrivateFieldSet:vv,__classPrivateFieldIn:wv,__addDisposableResource:Tv,__disposeResources:Cv,__rewriteRelativeImportExtension:_v};});var Qo=tt(dl=>{Object.defineProperty(dl,"__esModule",{value:true});dl.WebmBase=void 0;var Ru=class{constructor(t="Unknown",r=0){this.name=t,this.start=r;}getType(){return "Unknown"}updateBySource(){}setSource(t){this.source=t,this.updateBySource();}updateByData(){}setData(t){this.data=t,this.updateByData();}getValue(){return this.data}setValue(t){this.setData(t);}};dl.WebmBase=Ru;});var pl=tt(fl=>{Object.defineProperty(fl,"__esModule",{value:true});fl.SectionType=void 0;var Sv;(function(e){e.Container="Container",e.Uint="Uint",e.Int="Int",e.Float="Float",e.String="String",e.Date="Date",e.Binary="Binary";})(Sv||(fl.SectionType=Sv={}));});var Du=tt(ml=>{Object.defineProperty(ml,"__esModule",{value:true});ml.sections=void 0;var v=pl();ml.sections={172351395:{name:"EBML",type:v.SectionType.Container},646:{name:"EBMLVersion",type:v.SectionType.Uint},759:{name:"EBMLReadVersion",type:v.SectionType.Uint},754:{name:"EBMLMaxIDLength",type:v.SectionType.Uint},755:{name:"EBMLMaxSizeLength",type:v.SectionType.Uint},642:{name:"DocType",type:v.SectionType.String},647:{name:"DocTypeVersion",type:v.SectionType.Uint},645:{name:"DocTypeReadVersion",type:v.SectionType.Uint},108:{name:"Void",type:v.SectionType.Binary},63:{name:"CRC-32",type:v.SectionType.Binary},190023271:{name:"SignatureSlot",type:v.SectionType.Container},16010:{name:"SignatureAlgo",type:v.SectionType.Uint},16026:{name:"SignatureHash",type:v.SectionType.Uint},16037:{name:"SignaturePublicKey",type:v.SectionType.Binary},16053:{name:"Signature",type:v.SectionType.Binary},15963:{name:"SignatureElements",type:v.SectionType.Container},15995:{name:"SignatureElementList",type:v.SectionType.Container},9522:{name:"SignedElement",type:v.SectionType.Binary},139690087:{name:"Segment",type:v.SectionType.Container},21863284:{name:"SeekHead",type:v.SectionType.Container},3515:{name:"Seek",type:v.SectionType.Container},5035:{name:"SeekID",type:v.SectionType.Binary},5036:{name:"SeekPosition",type:v.SectionType.Uint},88713574:{name:"Info",type:v.SectionType.Container},13220:{name:"SegmentUID",type:v.SectionType.Binary},13188:{name:"SegmentFilename",type:v.SectionType.String},1882403:{name:"PrevUID",type:v.SectionType.Binary},1868715:{name:"PrevFilename",type:v.SectionType.String},2013475:{name:"NextUID",type:v.SectionType.Binary},1999803:{name:"NextFilename",type:v.SectionType.String},1092:{name:"SegmentFamily",type:v.SectionType.Binary},10532:{name:"ChapterTranslate",type:v.SectionType.Container},10748:{name:"ChapterTranslateEditionUID",type:v.SectionType.Uint},10687:{name:"ChapterTranslateCodec",type:v.SectionType.Uint},10661:{name:"ChapterTranslateID",type:v.SectionType.Binary},710577:{name:"TimecodeScale",type:v.SectionType.Uint},1161:{name:"Duration",type:v.SectionType.Float},1121:{name:"DateUTC",type:v.SectionType.Date},15273:{name:"Title",type:v.SectionType.String},3456:{name:"MuxingApp",type:v.SectionType.String},5953:{name:"WritingApp",type:v.SectionType.String},103:{name:"Timecode",type:v.SectionType.Uint},6228:{name:"SilentTracks",type:v.SectionType.Container},6359:{name:"SilentTrackNumber",type:v.SectionType.Uint},39:{name:"Position",type:v.SectionType.Uint},43:{name:"PrevSize",type:v.SectionType.Uint},35:{name:"SimpleBlock",type:v.SectionType.Binary},32:{name:"BlockGroup",type:v.SectionType.Container},33:{name:"Block",type:v.SectionType.Binary},34:{name:"BlockVirtual",type:v.SectionType.Binary},13729:{name:"BlockAdditions",type:v.SectionType.Container},38:{name:"BlockMore",type:v.SectionType.Container},110:{name:"BlockAddID",type:v.SectionType.Uint},37:{name:"BlockAdditional",type:v.SectionType.Binary},27:{name:"BlockDuration",type:v.SectionType.Uint},122:{name:"ReferencePriority",type:v.SectionType.Uint},123:{name:"ReferenceBlock",type:v.SectionType.Int},125:{name:"ReferenceVirtual",type:v.SectionType.Int},36:{name:"CodecState",type:v.SectionType.Binary},13730:{name:"DiscardPadding",type:v.SectionType.Int},14:{name:"Slices",type:v.SectionType.Container},104:{name:"TimeSlice",type:v.SectionType.Container},76:{name:"LaceNumber",type:v.SectionType.Uint},77:{name:"FrameNumber",type:v.SectionType.Uint},75:{name:"BlockAdditionID",type:v.SectionType.Uint},78:{name:"Delay",type:v.SectionType.Uint},79:{name:"SliceDuration",type:v.SectionType.Uint},72:{name:"ReferenceFrame",type:v.SectionType.Container},73:{name:"ReferenceOffset",type:v.SectionType.Uint},74:{name:"ReferenceTimeCode",type:v.SectionType.Uint},47:{name:"EncryptedBlock",type:v.SectionType.Binary},106212971:{name:"Tracks",type:v.SectionType.Container},46:{name:"TrackEntry",type:v.SectionType.Container},87:{name:"TrackNumber",type:v.SectionType.Uint},13253:{name:"TrackUID",type:v.SectionType.Uint},3:{name:"TrackType",type:v.SectionType.Uint},57:{name:"FlagEnabled",type:v.SectionType.Uint},8:{name:"FlagDefault",type:v.SectionType.Uint},5546:{name:"FlagForced",type:v.SectionType.Uint},28:{name:"FlagLacing",type:v.SectionType.Uint},11751:{name:"MinCache",type:v.SectionType.Uint},11768:{name:"MaxCache",type:v.SectionType.Uint},254851:{name:"DefaultDuration",type:v.SectionType.Uint},216698:{name:"DefaultDecodedFieldDuration",type:v.SectionType.Uint},209231:{name:"TrackTimecodeScale",type:v.SectionType.Float},4991:{name:"TrackOffset",type:v.SectionType.Int},5614:{name:"MaxBlockAdditionID",type:v.SectionType.Uint},4974:{name:"Name",type:v.SectionType.String},177564:{name:"Language",type:v.SectionType.String},6:{name:"CodecID",type:v.SectionType.String},9122:{name:"CodecPrivate",type:v.SectionType.Binary},362120:{name:"CodecName",type:v.SectionType.String},13382:{name:"AttachmentLink",type:v.SectionType.Uint},1742487:{name:"CodecSettings",type:v.SectionType.String},1785920:{name:"CodecInfoURL",type:v.SectionType.String},438848:{name:"CodecDownloadURL",type:v.SectionType.String},42:{name:"CodecDecodeAll",type:v.SectionType.Uint},12203:{name:"TrackOverlay",type:v.SectionType.Uint},5802:{name:"CodecDelay",type:v.SectionType.Uint},5819:{name:"SeekPreRoll",type:v.SectionType.Uint},9764:{name:"TrackTranslate",type:v.SectionType.Container},9980:{name:"TrackTranslateEditionUID",type:v.SectionType.Uint},9919:{name:"TrackTranslateCodec",type:v.SectionType.Uint},9893:{name:"TrackTranslateTrackID",type:v.SectionType.Binary},96:{name:"Video",type:v.SectionType.Container},26:{name:"FlagInterlaced",type:v.SectionType.Uint},5048:{name:"StereoMode",type:v.SectionType.Uint},5056:{name:"AlphaMode",type:v.SectionType.Uint},5049:{name:"OldStereoMode",type:v.SectionType.Uint},48:{name:"PixelWidth",type:v.SectionType.Uint},58:{name:"PixelHeight",type:v.SectionType.Uint},5290:{name:"PixelCropBottom",type:v.SectionType.Uint},5307:{name:"PixelCropTop",type:v.SectionType.Uint},5324:{name:"PixelCropLeft",type:v.SectionType.Uint},5341:{name:"PixelCropRight",type:v.SectionType.Uint},5296:{name:"DisplayWidth",type:v.SectionType.Uint},5306:{name:"DisplayHeight",type:v.SectionType.Uint},5298:{name:"DisplayUnit",type:v.SectionType.Uint},5299:{name:"AspectRatioType",type:v.SectionType.Uint},963876:{name:"ColourSpace",type:v.SectionType.Binary},1029411:{name:"GammaValue",type:v.SectionType.Float},230371:{name:"FrameRate",type:v.SectionType.Float},97:{name:"Audio",type:v.SectionType.Container},53:{name:"SamplingFrequency",type:v.SectionType.Float},14517:{name:"OutputSamplingFrequency",type:v.SectionType.Float},31:{name:"Channels",type:v.SectionType.Uint},15739:{name:"ChannelPositions",type:v.SectionType.Binary},8804:{name:"BitDepth",type:v.SectionType.Uint},98:{name:"TrackOperation",type:v.SectionType.Container},99:{name:"TrackCombinePlanes",type:v.SectionType.Container},100:{name:"TrackPlane",type:v.SectionType.Container},101:{name:"TrackPlaneUID",type:v.SectionType.Uint},102:{name:"TrackPlaneType",type:v.SectionType.Uint},105:{name:"TrackJoinBlocks",type:v.SectionType.Container},109:{name:"TrackJoinUID",type:v.SectionType.Uint},64:{name:"TrickTrackUID",type:v.SectionType.Uint},65:{name:"TrickTrackSegmentUID",type:v.SectionType.Binary},70:{name:"TrickTrackFlag",type:v.SectionType.Uint},71:{name:"TrickMasterTrackUID",type:v.SectionType.Uint},68:{name:"TrickMasterTrackSegmentUID",type:v.SectionType.Binary},11648:{name:"ContentEncodings",type:v.SectionType.Container},8768:{name:"ContentEncoding",type:v.SectionType.Container},4145:{name:"ContentEncodingOrder",type:v.SectionType.Uint},4146:{name:"ContentEncodingScope",type:v.SectionType.Uint},4147:{name:"ContentEncodingType",type:v.SectionType.Uint},4148:{name:"ContentCompression",type:v.SectionType.Container},596:{name:"ContentCompAlgo",type:v.SectionType.Uint},597:{name:"ContentCompSettings",type:v.SectionType.Binary},4149:{name:"ContentEncryption",type:v.SectionType.Container},2017:{name:"ContentEncAlgo",type:v.SectionType.Uint},2018:{name:"ContentEncKeyID",type:v.SectionType.Binary},2019:{name:"ContentSignature",type:v.SectionType.Binary},2020:{name:"ContentSigKeyID",type:v.SectionType.Binary},2021:{name:"ContentSigAlgo",type:v.SectionType.Uint},2022:{name:"ContentSigHashAlgo",type:v.SectionType.Uint},206814059:{name:"Cues",type:v.SectionType.Container},59:{name:"CuePoint",type:v.SectionType.Container},51:{name:"CueTime",type:v.SectionType.Uint},55:{name:"CueTrackPositions",type:v.SectionType.Container},119:{name:"CueTrack",type:v.SectionType.Uint},113:{name:"CueClusterPosition",type:v.SectionType.Uint},112:{name:"CueRelativePosition",type:v.SectionType.Uint},50:{name:"CueDuration",type:v.SectionType.Uint},4984:{name:"CueBlockNumber",type:v.SectionType.Uint},106:{name:"CueCodecState",type:v.SectionType.Uint},91:{name:"CueReference",type:v.SectionType.Container},22:{name:"CueRefTime",type:v.SectionType.Uint},23:{name:"CueRefCluster",type:v.SectionType.Uint},4959:{name:"CueRefNumber",type:v.SectionType.Uint},107:{name:"CueRefCodecState",type:v.SectionType.Uint},155296873:{name:"Attachments",type:v.SectionType.Container},8615:{name:"AttachedFile",type:v.SectionType.Container},1662:{name:"FileDescription",type:v.SectionType.String},1646:{name:"FileName",type:v.SectionType.String},1632:{name:"FileMimeType",type:v.SectionType.String},1628:{name:"FileData",type:v.SectionType.Binary},1710:{name:"FileUID",type:v.SectionType.Uint},1653:{name:"FileReferral",type:v.SectionType.Binary},1633:{name:"FileUsedStartTime",type:v.SectionType.Uint},1634:{name:"FileUsedEndTime",type:v.SectionType.Uint},4433776:{name:"Chapters",type:v.SectionType.Container},1465:{name:"EditionEntry",type:v.SectionType.Container},1468:{name:"EditionUID",type:v.SectionType.Uint},1469:{name:"EditionFlagHidden",type:v.SectionType.Uint},1499:{name:"EditionFlagDefault",type:v.SectionType.Uint},1501:{name:"EditionFlagOrdered",type:v.SectionType.Uint},54:{name:"ChapterAtom",type:v.SectionType.Container},13252:{name:"ChapterUID",type:v.SectionType.Uint},5716:{name:"ChapterStringUID",type:v.SectionType.String},17:{name:"ChapterTimeStart",type:v.SectionType.Uint},18:{name:"ChapterTimeEnd",type:v.SectionType.Uint},24:{name:"ChapterFlagHidden",type:v.SectionType.Uint},1432:{name:"ChapterFlagEnabled",type:v.SectionType.Uint},11879:{name:"ChapterSegmentUID",type:v.SectionType.Binary},11964:{name:"ChapterSegmentEditionUID",type:v.SectionType.Uint},9155:{name:"ChapterPhysicalEquiv",type:v.SectionType.Uint},15:{name:"ChapterTrack",type:v.SectionType.Container},9:{name:"ChapterTrackNumber",type:v.SectionType.Uint},0:{name:"ChapterDisplay",type:v.SectionType.Container},5:{name:"ChapString",type:v.SectionType.String},892:{name:"ChapLanguage",type:v.SectionType.String},894:{name:"ChapCountry",type:v.SectionType.String},10564:{name:"ChapProcess",type:v.SectionType.Container},10581:{name:"ChapProcessCodecID",type:v.SectionType.Uint},1293:{name:"ChapProcessPrivate",type:v.SectionType.Binary},10513:{name:"ChapProcessCommand",type:v.SectionType.Container},10530:{name:"ChapProcessTime",type:v.SectionType.Uint},10547:{name:"ChapProcessData",type:v.SectionType.Binary},39109479:{name:"Tags",type:v.SectionType.Container},13171:{name:"Tag",type:v.SectionType.Container},9152:{name:"Targets",type:v.SectionType.Container},10442:{name:"TargetTypeValue",type:v.SectionType.Uint},9162:{name:"TargetType",type:v.SectionType.String},9157:{name:"TagTrackUID",type:v.SectionType.Uint},9161:{name:"TagEditionUID",type:v.SectionType.Uint},9156:{name:"TagChapterUID",type:v.SectionType.Uint},9158:{name:"TagAttachmentUID",type:v.SectionType.Uint},10184:{name:"SimpleTag",type:v.SectionType.Container},1443:{name:"TagName",type:v.SectionType.String},1146:{name:"TagLanguage",type:v.SectionType.String},1156:{name:"TagDefault",type:v.SectionType.Uint},1159:{name:"TagString",type:v.SectionType.String},1157:{name:"TagBinary",type:v.SectionType.Binary},5552:{name:"Colour",type:v.SectionType.Container},5553:{name:"MatrixCoefficients",type:v.SectionType.Uint},5554:{name:"BitsPerChannel",type:v.SectionType.Uint},5555:{name:"ChromaSubsamplingHorz",type:v.SectionType.Uint},5556:{name:"ChromaSubsamplingVert",type:v.SectionType.Uint},5557:{name:"CbSubsamplingHorz",type:v.SectionType.Uint},5558:{name:"CbSubsamplingVert",type:v.SectionType.Uint},5559:{name:"ChromaSitingHorz",type:v.SectionType.Uint},5560:{name:"ChromaSitingVert",type:v.SectionType.Uint},5561:{name:"Range",type:v.SectionType.Uint},5562:{name:"TransferCharacteristics",type:v.SectionType.Uint},5563:{name:"Primaries",type:v.SectionType.Uint},5564:{name:"MaxCLL",type:v.SectionType.Uint},5565:{name:"MaxFALL",type:v.SectionType.Uint}};});var $u=tt(gl=>{Object.defineProperty(gl,"__esModule",{value:true});gl.WebmUint=void 0;var bA=Qo();function kv(e){return e.length%2===1?"0"+e:e}var Mu=class extends bA.WebmBase{constructor(t,r=0){super(t,r);}getType(){return "Uint"}updateBySource(){this.data="";for(let t=0;t<this.source.length;t++){let r=this.source[t].toString(16);this.data+=kv(r);}}updateByData(){let t=this.data.length/2;this.source=new Uint8Array(t);for(let r=0;r<t;r++){let n=this.data.substring(r*2,r*2+2);this.source[r]=parseInt(n,16);}}getValue(){return parseInt(this.data,16)}setValue(t){this.setData(kv(t.toString(16)));}};gl.WebmUint=Mu;});var Lu=tt(hl=>{Object.defineProperty(hl,"__esModule",{value:true});hl.WebmFloat=void 0;var yA=Qo(),Nu=class extends yA.WebmBase{constructor(t,r=0){super(t,r);}getType(){return "Float"}getFloatArrayType(){return this.source&&this.source.length===4?Float32Array:Float64Array}updateBySource(){let t=this.source.reverse(),r=this.getFloatArrayType(),n=new r(t.buffer);this.data=n[0];}updateByData(){let t=this.getFloatArrayType(),r=new t([this.data]),n=new Uint8Array(r.buffer);this.source=n.reverse();}};hl.WebmFloat=Nu;});var Bu=tt(bl=>{Object.defineProperty(bl,"__esModule",{value:true});bl.WebmString=void 0;var xA=Qo(),Fu=class extends xA.WebmBase{constructor(t,r=0){super(t,r);}getType(){return "String"}updateBySource(){this.data=this.source;}updateByData(){this.source=this.data;}getValue(){let t="";return this.source.forEach(r=>{t+=String.fromCharCode(r);}),t}};bl.WebmString=Fu;});var Vu=tt(xl=>{Object.defineProperty(xl,"__esModule",{value:true});xl.WebmContainer=void 0;var Pv=Qo(),vA=Du(),yl=pl(),wA=$u(),TA=Lu(),CA=Bu(),Uu=class e extends Pv.WebmBase{constructor(t,r=false,n=0){super(t,n),this.isInfinite=r,this.offset=0;}getType(){return "Container"}readByte(){return this.source[this.offset++]}readUint(){let t=this.readByte(),r=8-t.toString(2).length,n=t-(1<<7-r);for(let o=0;o<r;o++)n<<=8,n|=this.readByte();return n}updateBySource(){var t;this.data=[];let r;for(this.offset=0;this.offset<this.source.length;this.offset=r){let n=this.offset,o=this.readUint(),{name:i,type:a}=(t=vA.sections[o])!==null&&t!==void 0?t:{},s=this.readUint();r=this.source.length,s>=0&&(r=Math.min(this.offset+s,r));let l=this.source.slice(this.offset,r),u;switch(a){case yl.SectionType.Container:u=new e(i,s<0,n);break;case yl.SectionType.Uint:u=new wA.WebmUint(i,n);break;case yl.SectionType.Float:u=new TA.WebmFloat(i,n);break;case yl.SectionType.String:u=new CA.WebmString(i,n);break;default:u=new Pv.WebmBase(i,n);break}u.setSource(l),this.data.push({id:o,idHex:o.toString(16),data:u});}}writeUint(t,r=false){let n;for(n=1;(t<0||t>=1<<7*n)&&n<8;n++);if(!r){for(let o=0;o<n;o++)this.source[this.offset+o]=t>>8*(n-1-o)&255;this.source[this.offset]&=(1<<8-n)-1,this.source[this.offset]|=1<<8-n;}this.offset+=n;}writeSections(t=false){this.offset=0;for(let r=0;r<this.data.length;r++){let n=this.data[r],o=n.data.source,i=o.length;this.writeUint(n.id,t),this.writeUint(n.data instanceof e&&n.data.isInfinite?-1:i,t),t||this.source.set(o,this.offset),this.offset+=i;}return this.offset}updateByData(){let t=this.writeSections(true);this.source=new Uint8Array(t),this.writeSections();}getSectionById(t){for(let r=0;r<this.data.length;r++){let n=this.data[r];if(n.id===t)return n.data}return null}};xl.WebmContainer=Uu;});var Ev=tt(vl=>{Object.defineProperty(vl,"__esModule",{value:true});vl.WebmFile=void 0;var _A=(ma(),$a(pa)),SA=Vu(),Hu=class e extends SA.WebmContainer{constructor(t){super("File"),this.setSource(t);}getType(){return "File"}toBlob(t="video/webm"){return new Blob([this.source.buffer],{type:t})}static blobToArray(t){return new Promise((r,n)=>{try{let o=new FileReader;o.onloadend=()=>{try{r(new Uint8Array(o.result));}catch(i){n(i);}},o.readAsArrayBuffer(t);}catch(o){n(o);}})}static fromBlob(t){return _A.__awaiter(this,void 0,void 0,function*(){let r=yield e.blobToArray(t);return new e(r)})}};vl.WebmFile=Hu;});var Av=tt(Iv=>{Object.defineProperty(Iv,"__esModule",{value:true});});var Wu=tt(gr=>{Object.defineProperty(gr,"__esModule",{value:true});var Xr=(ma(),$a(pa));Xr.__exportStar(Qo(),gr);Xr.__exportStar(Vu(),gr);Xr.__exportStar(Ev(),gr);Xr.__exportStar(Lu(),gr);Xr.__exportStar(Bu(),gr);Xr.__exportStar($u(),gr);Xr.__exportStar(pl(),gr);Xr.__exportStar(Av(),gr);Xr.__exportStar(Du(),gr);});var ju=tt(wl=>{Object.defineProperty(wl,"__esModule",{value:true});wl.fixParsedWebmDuration=void 0;var kA=Wu(),PA=(e,t,r={})=>{let n=r.logger;n===void 0?n=l=>console.debug(l):n||(n=()=>{});let o=e.getSectionById(139690087);if(!o)return n("[fix-webm-duration] Segment section is missing"),false;let i=o.getSectionById(88713574);if(!i)return n("[fix-webm-duration] Info section is missing"),false;let a=i.getSectionById(710577);if(!a)return n("[fix-webm-duration] TimecodeScale section is missing"),false;let s=i.getSectionById(1161);if(s)if(s.getValue()<=0)n(`[fix-webm-duration] Duration section is present, but the value is ${s.getValue()}`),s.setValue(t);else return n(`[fix-webm-duration] Duration section is present, and the value is ${s.getValue()}`),false;else n("[fix-webm-duration] Duration section is missing"),s=new kA.WebmFloat("Duration"),s.setValue(t),i.data.push({id:1161,data:s});return a.setValue(1e6),i.updateByData(),o.updateByData(),e.updateByData(),true};wl.fixParsedWebmDuration=PA;});var Ov=tt(Tl=>{Object.defineProperty(Tl,"__esModule",{value:true});Tl.fixWebmDuration=void 0;var EA=(ma(),$a(pa)),IA=Wu(),AA=ju(),OA=(e,t,r)=>EA.__awaiter(void 0,void 0,void 0,function*(){try{let n=yield IA.WebmFile.fromBlob(e);if((0,AA.fixParsedWebmDuration)(n,t,r))return n.toBlob(e.type)}catch{}return e});Tl.fixWebmDuration=OA;});var Dv=tt(Cl=>{Object.defineProperty(Cl,"__esModule",{value:true});var Rv=(ma(),$a(pa));Rv.__exportStar(Ov(),Cl);Rv.__exportStar(ju(),Cl);});function S0(e){return Object.keys(e).reduce((r,n)=>{let o=e[n];return r[n]=Object.assign({},o),$d(o.value)&&!A0(o.value)&&!Array.isArray(o.value)&&(r[n].value=Object.assign({},o.value)),Array.isArray(o.value)&&(r[n].value=o.value.slice(0)),r},{})}function k0(e){return e?Object.keys(e).reduce((r,n)=>{let o=e[n];return r[n]=$d(o)&&"value"in o?o:{value:o},r[n].attribute||(r[n].attribute=I0(n)),r[n].parse="parse"in r[n]?r[n].parse:typeof r[n].value!="string",r},{}):{}}function P0(e){return Object.keys(e).reduce((r,n)=>(r[n]=e[n].value,r),{})}function E0(e,t){let r=S0(t);return Object.keys(t).forEach(o=>{let i=r[o],a=e.getAttribute(i.attribute),s=e[o];a!=null&&(i.value=i.parse?Md(a):a),s!=null&&(i.value=Array.isArray(s)?s.slice(0):s),i.reflect&&Dd(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(l){let u=i.value;i.value=l,i.reflect&&Dd(this,i.attribute,i.value,!!i.parse);for(let c=0,d=this.__propertyChangedCallbacks.length;c<d;c++)this.__propertyChangedCallbacks[c](o,l,u);},enumerable:true,configurable:true});}),r}function Md(e){if(e)try{return JSON.parse(e)}catch{return e}}function Dd(e,t,r,n){if(r==null||r===false)return e.removeAttribute(t);let o=n?JSON.stringify(r):r;e.__updating[t]=true,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t]);}function I0(e){return e.replace(/\.?([A-Z]+)/g,(t,r)=>"-"+r.toLowerCase()).replace("_","-").replace(/^-/,"")}function $d(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function A0(e){return Object.prototype.toString.call(e)==="[object Function]"}function O0(e){return typeof e=="function"&&e.toString().indexOf("class")===0}var Hl;function R0(e,t){let r=Object.keys(t);return class extends e{static get observedAttributes(){return r.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=false,this.__released=false,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={};for(let o of r)this[o]=void 0;}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=E0(this,t);let o=P0(this.props),i=this.Component,a=Hl;try{Hl=this,this.__initialized=!0,O0(i)?new i(o,{element:this}):i(o,{element:this});}finally{Hl=a;}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=true;}attributeChangedCallback(o,i,a){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(a==null&&!this[o])return;this[o]=t[o].parse?Md(a):a;}}lookupProp(o){if(t)return r.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o);}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o);}}}function Nd(e,t={},r={}){let{BaseElement:n=HTMLElement,extension:o,customElements:i=window.customElements}=r;return a=>{if(!e)throw new Error("tag is required to register a Component");let s=i.get(e);return s?(s.prototype.Component=a,s):(s=R0(n,k0(t)),s.prototype.Component=a,s.prototype.registeredTag=e,i.define(e,s,o),s)}}var $0=(e,t)=>e===t,so=Symbol("solid-proxy"),Wd=typeof Proxy=="function",Ba=Symbol("solid-track"),La={equals:$0},jd=Xd,Ht=1,si=2,zd={owned:null,cleanups:null,context:null,owner:null};var _e=null,q=null,ao=null,He=null,lt=null,xt=null,Ua=0;function vr(e,t){let r=He,n=_e,o=e.length===0,i=t===void 0?n:t,a=o?zd:{owned:null,cleanups:null,context:i?i.context:null,owner:i},s=o?e:()=>e(()=>rt(()=>Jr(a)));_e=a,He=null;try{return wr(s,!0)}finally{He=r,_e=n;}}function R(e,t){t=t?Object.assign({},La,t):La;let r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=o=>(typeof o=="function"&&(o=o(r.value)),Kd(r,o));return [Yd.bind(r),n]}function M(e,t,r){let n=Kl(e,t,false,Ht);ui(n);}function Ce(e,t,r){jd=B0;let n=Kl(e,t,false,Ht);(!r||!r.render)&&(n.user=true),xt?xt.push(n):ui(n);}function L(e,t,r){r=r?Object.assign({},La,r):La;let n=Kl(e,t,true,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,ui(n),Yd.bind(n)}function rt(e){if(He===null)return e();let t=He;He=null;try{return ao?ao.untrack(e):e()}finally{He=t;}}function ie(e){Ce(()=>rt(e));}function ae(e){return _e===null||(_e.cleanups===null?_e.cleanups=[e]:_e.cleanups.push(e)),e}function lo(){return _e}function Gd(e,t){let r=_e,n=He;_e=e,He=null;try{return wr(t,!0)}catch(o){Ha(o);}finally{_e=r,He=n;}}var[$2,Bd]=R(false);function qd(e,t){let r=Symbol("context");return {id:r,Provider:V0(r),defaultValue:e}}function Yl(e){let t;return _e&&_e.context&&(t=_e.context[e.id])!==void 0?t:e.defaultValue}function Va(e){let t=L(e),r=L(()=>Gl(t()));return r.toArray=()=>{let n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}function Yd(){let e=q;if(this.sources&&(this.state))if((this.state)===Ht)ui(this);else {let t=lt;lt=null,wr(()=>Fa(this),false),lt=t;}if(He){let t=this.observers?this.observers.length:0;He.sources?(He.sources.push(this),He.sourceSlots.push(t)):(He.sources=[this],He.sourceSlots=[t]),this.observers?(this.observers.push(He),this.observerSlots.push(He.sources.length-1)):(this.observers=[He],this.observerSlots=[He.sources.length-1]);}return e&&q.sources.has(this)?this.tValue:this.value}function Kd(e,t,r){let n=e.value;if(!e.comparator||!e.comparator(n,t)){e.value=t;e.observers&&e.observers.length&&wr(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],a=q&&q.running;a&&q.disposed.has(i)||((a?!i.tState:!i.state)&&(i.pure?lt.push(i):xt.push(i),i.observers&&Zd(i)),a?i.tState=Ht:i.state=Ht);}if(lt.length>1e6)throw lt=[],new Error},false);}return t}function ui(e){if(!e.fn)return;Jr(e);let t=Ua;Ud(e,e.value,t);}function Ud(e,t,r){let n,o=_e,i=He;He=_e=e;try{n=e.fn(t);}catch(a){return e.pure&&((e.state=Ht,e.owned&&e.owned.forEach(Jr),e.owned=null)),e.updatedAt=r+1,Ha(a)}finally{He=i,_e=o;}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?Kd(e,n):e.value=n,e.updatedAt=r);}function Kl(e,t,r,n=Ht,o){let i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:_e,context:_e?_e.context:null,pure:r};if(_e===null||_e!==zd&&(_e.owned?_e.owned.push(i):_e.owned=[i]),ao);return i}function li(e){let t=q;if((e.state)===0)return;if((e.state)===si)return Fa(e);if(e.suspense&&rt(e.suspense.inFallback))return e.suspense.effects.push(e);let r=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ua);){(e.state)&&r.push(e);}for(let n=r.length-1;n>=0;n--){if(e=r[n],t);if((e.state)===Ht)ui(e);else if((e.state)===si){let o=lt;lt=null,wr(()=>Fa(e,r[0]),false),lt=o;}}}function wr(e,t){if(lt)return e();let r=false;t||(lt=[]),xt?r=true:xt=[],Ua++;try{let n=e();return L0(r),n}catch(n){r||(xt=null),lt=null,Ha(n);}}function L0(e){if(lt&&(Xd(lt),lt=null),e)return;let r=xt;xt=null,r.length&&wr(()=>jd(r),false);}function Xd(e){for(let t=0;t<e.length;t++)li(e[t]);}function B0(e){let t,r=0;for(t=0;t<e.length;t++){let n=e[t];n.user?e[r++]=n:li(n);}for(t=0;t<r;t++)li(e[t]);}function Fa(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){let o=e.sources[n];if(o.sources){let i=o.state;i===Ht?o!==t&&(!o.updatedAt||o.updatedAt<Ua)&&li(o):i===si&&Fa(o,t);}}}function Zd(e){for(let r=0;r<e.observers.length;r+=1){let n=e.observers[r];(!n.state)&&(n.state=si,n.pure?lt.push(n):xt.push(n),n.observers&&Zd(n));}}function Jr(e){let t;if(e.sources)for(;e.sources.length;){let r=e.sources.pop(),n=e.sourceSlots.pop(),o=r.observers;if(o&&o.length){let i=o.pop(),a=r.observerSlots.pop();n<o.length&&(i.sourceSlots[a]=n,o[n]=i,r.observerSlots[n]=a);}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Jr(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Jr(e.owned[t]);e.owned=null;}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null;}e.state=0;}function U0(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Ha(e,t=_e){let n=U0(e);throw n;}function Gl(e){if(typeof e=="function"&&!e.length)return Gl(e());if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++){let n=Gl(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n);}return t}return e}function V0(e,t){return function(n){let o;return M(()=>o=rt(()=>(_e.context={..._e.context,[e]:n.value},Va(()=>n.children))),void 0),o}}var H0=Symbol("fallback");function Hd(e){for(let t=0;t<e.length;t++)e[t]();}function Jd(e,t,r={}){let n=[],o=[],i=[],a=0,s=t.length>1?[]:null;return ae(()=>Hd(i)),()=>{let l=e()||[],u=l.length,c,d;return l[Ba],rt(()=>{let f,b,g,y,T,S,E,h,C;if(u===0)a!==0&&(Hd(i),i=[],n=[],o=[],a=0,s&&(s=[])),r.fallback&&(n=[H0],o[0]=vr($=>(i[0]=$,r.fallback())),a=1);else if(a===0){for(o=new Array(u),d=0;d<u;d++)n[d]=l[d],o[d]=vr(p);a=u;}else {for(g=new Array(u),y=new Array(u),s&&(T=new Array(u)),S=0,E=Math.min(a,u);S<E&&n[S]===l[S];S++);for(E=a-1,h=u-1;E>=S&&h>=S&&n[E]===l[h];E--,h--)g[h]=o[E],y[h]=i[E],s&&(T[h]=s[E]);for(f=new Map,b=new Array(h+1),d=h;d>=S;d--)C=l[d],c=f.get(C),b[d]=c===void 0?-1:c,f.set(C,d);for(c=S;c<=E;c++)C=n[c],d=f.get(C),d!==void 0&&d!==-1?(g[d]=o[c],y[d]=i[c],s&&(T[d]=s[c]),d=b[d],f.set(C,d)):i[c]();for(d=S;d<u;d++)d in g?(o[d]=g[d],i[d]=y[d],s&&(s[d]=T[d],s[d](d))):o[d]=vr(p);o=o.slice(0,a=u),n=l.slice(0);}return o});function p(f){if(i[d]=f,s){let[b,g]=R(d);return s[d]=g,t(l[d],b)}return t(l[d])}}}function m(e,t){return rt(()=>e(t||{}))}function Na(){return true}var ql={get(e,t,r){return t===so?r:e.get(t)},has(e,t){return t===so?true:e.has(t)},set:Na,deleteProperty:Na,getOwnPropertyDescriptor(e,t){return {configurable:true,enumerable:true,get(){return e.get(t)},set:Na,deleteProperty:Na}},ownKeys(e){return e.keys()}};function Wl(e){return (e=typeof e=="function"?e():e)?e:{}}function j0(){for(let e=0,t=this.length;e<t;++e){let r=this[e]();if(r!==void 0)return r}}function be(...e){let t=false;for(let a=0;a<e.length;a++){let s=e[a];t=t||!!s&&so in s,e[a]=typeof s=="function"?(t=true,L(s)):s;}if(Wd&&t)return new Proxy({get(a){for(let s=e.length-1;s>=0;s--){let l=Wl(e[s])[a];if(l!==void 0)return l}},has(a){for(let s=e.length-1;s>=0;s--)if(a in Wl(e[s]))return true;return false},keys(){let a=[];for(let s=0;s<e.length;s++)a.push(...Object.keys(Wl(e[s])));return [...new Set(a)]}},ql);let r={},n=Object.create(null);for(let a=e.length-1;a>=0;a--){let s=e[a];if(!s)continue;let l=Object.getOwnPropertyNames(s);for(let u=l.length-1;u>=0;u--){let c=l[u];if(c==="__proto__"||c==="constructor")continue;let d=Object.getOwnPropertyDescriptor(s,c);if(!n[c])n[c]=d.get?{enumerable:true,configurable:true,get:j0.bind(r[c]=[d.get.bind(s)])}:d.value!==void 0?d:void 0;else {let p=r[c];p&&(d.get?p.push(d.get.bind(s)):d.value!==void 0&&p.push(()=>d.value));}}}let o={},i=Object.keys(n);for(let a=i.length-1;a>=0;a--){let s=i[a],l=n[s];l&&l.get?Object.defineProperty(o,s,l):o[s]=l?l.value:void 0;}return o}function Je(e,...t){if(Wd&&so in e){let o=new Set(t.length>1?t.flat():t[0]),i=t.map(a=>new Proxy({get(s){return a.includes(s)?e[s]:void 0},has(s){return a.includes(s)&&s in e},keys(){return a.filter(s=>s in e)}},ql));return i.push(new Proxy({get(a){return o.has(a)?void 0:e[a]},has(a){return o.has(a)?false:a in e},keys(){return Object.keys(e).filter(a=>!o.has(a))}},ql)),i}let r={},n=t.map(()=>({}));for(let o of Object.getOwnPropertyNames(e)){let i=Object.getOwnPropertyDescriptor(e,o),a=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable,s=false,l=0;for(let u of t)u.includes(o)&&(s=true,a?n[l][o]=i.value:Object.defineProperty(n[l],o,i)),++l;s||(a?r[o]=i.value:Object.defineProperty(r,o,i));}return [...n,r]}var z0=0;function Wt(){return `cl-${z0++}`}var ef=e=>`Stale read from <${e}>.`;function ke(e){let t="fallback"in e&&{fallback:()=>e.fallback};return L(Jd(()=>e.each,e.children,t||void 0))}function W(e){let t=e.keyed,r=L(()=>e.when,void 0,void 0),n=t?r:L(r,void 0,{equals:(o,i)=>!o==!i});return L(()=>{let o=n();if(o){let i=e.children;return typeof i=="function"&&i.length>0?rt(()=>i(t?o:()=>{if(!rt(n))throw ef("Show");return r()})):i}return e.fallback},void 0,void 0)}function Le(e){let t=Va(()=>e.children),r=L(()=>{let n=t(),o=Array.isArray(n)?n:[n],i=()=>{};for(let a=0;a<o.length;a++){let s=a,l=o[a],u=i,c=L(()=>u()?void 0:l.when,void 0,void 0),d=l.keyed?c:L(c,void 0,{equals:(p,f)=>!p==!f});i=()=>u()||(d()?[s,c,l]:void 0);}return i});return L(()=>{let n=r()();if(!n)return e.fallback;let[o,i,a]=n,s=a.children;return typeof s=="function"&&s.length>0?rt(()=>s(a.keyed?i():()=>{if(rt(r)()?.[0]!==o)throw ef("Match");return i()})):s},void 0,void 0)}function X(e){return e}var G0=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],q0=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...G0]),Y0=new Set(["innerHTML","textContent","innerText","children"]),K0=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),X0=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function Z0(e,t){let r=X0[e];return typeof r=="object"?r[t]?r.$:void 0:r}var Q0=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),J0=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),eT={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function tT(e,t,r){let n=r.length,o=t.length,i=n,a=0,s=0,l=t[o-1].nextSibling,u=null;for(;a<o||s<i;){if(t[a]===r[s]){a++,s++;continue}for(;t[o-1]===r[i-1];)o--,i--;if(o===a){let c=i<n?s?r[s-1].nextSibling:r[i-s]:l;for(;s<i;)e.insertBefore(r[s++],c);}else if(i===s)for(;a<o;)(!u||!u.has(t[a]))&&t[a].remove(),a++;else if(t[a]===r[i-1]&&r[s]===t[o-1]){let c=t[--o].nextSibling;e.insertBefore(r[s++],t[a++].nextSibling),e.insertBefore(r[--i],c),t[o]=r[i];}else {if(!u){u=new Map;let d=s;for(;d<i;)u.set(r[d],d++);}let c=u.get(t[a]);if(c!=null)if(s<c&&c<i){let d=a,p=1,f;for(;++d<o&&d<i&&!((f=u.get(t[d]))==null||f!==c+p);)p++;if(p>c-s){let b=t[a];for(;s<c;)e.insertBefore(r[s++],b);}else e.replaceChild(r[s++],t[a++]);}else a++;else t[a++].remove();}}}var tf="_$DX_DELEGATE";function w(e,t,r,n){let o,i=()=>{let s=document.createElement("template");return s.innerHTML=e,s.content.firstChild},a=()=>(o||(o=i())).cloneNode(true);return a.cloneNode=a,a}function Ne(e,t=window.document){let r=t[tf]||(t[tf]=new Set);for(let n=0,o=e.length;n<o;n++){let i=e[n];r.has(i)||(r.add(i),t.addEventListener(i,lT));}}function G(e,t,r){(r==null?e.removeAttribute(t):e.setAttribute(t,r));}function rT(e,t,r,n){(n==null?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n));}function nT(e,t,r){(r?e.setAttribute(t,""):e.removeAttribute(t));}function U(e,t){(t==null?e.removeAttribute("class"):e.className=t);}function nt(e,t,r,n){if(n)Array.isArray(r)?(e[`$$${t}`]=r[0],e[`$$${t}Data`]=r[1]):e[`$$${t}`]=r;else if(Array.isArray(r)){let o=r[0];e.addEventListener(t,r[0]=i=>o.call(e,r[1],i));}else e.addEventListener(t,r,typeof r!="function"&&r);}function oT(e,t,r={}){let n=Object.keys(t||{}),o=Object.keys(r),i,a;for(i=0,a=o.length;i<a;i++){let s=o[i];!s||s==="undefined"||t[s]||(rf(e,s,false),delete r[s]);}for(i=0,a=n.length;i<a;i++){let s=n[i],l=!!t[s];!s||s==="undefined"||r[s]===l||!l||(rf(e,s,true),r[s]=l);}return r}function hn(e,t,r){if(!t)return r?G(e,"style"):t;let n=e.style;if(typeof t=="string")return n.cssText=t;typeof r=="string"&&(n.cssText=r=void 0),r||(r={}),t||(t={});let o,i;for(i in r)t[i]==null&&n.removeProperty(i),delete r[i];for(i in t)o=t[i],o!==r[i]&&(n.setProperty(i,o),r[i]=o);return r}function Pe(e,t={},r,n){let o={};return n||M(()=>o.children=uo(e,t.children,o.children)),M(()=>typeof t.ref=="function"&&me(t.ref,e)),M(()=>iT(e,t,r,true,o,true)),o}function me(e,t,r){return rt(()=>e(t,r))}function x(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return uo(e,t,n,r);M(o=>uo(e,t(),o,r),n);}function iT(e,t,r,n,o={},i=false){t||(t={});for(let a in o)if(!(a in t)){if(a==="children")continue;o[a]=nf(e,a,null,o[a],r,i,t);}for(let a in t){if(a==="children"){continue}let s=t[a];o[a]=nf(e,a,s,o[a],r,i,t);}}function sT(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function rf(e,t,r){let n=t.trim().split(/\s+/);for(let o=0,i=n.length;o<i;o++)e.classList.toggle(n[o],r);}function nf(e,t,r,n,o,i,a){let s,l,u,c,d;if(t==="style")return hn(e,r,n);if(t==="classList")return oT(e,r,n);if(r===n)return n;if(t==="ref")i||r(e);else if(t.slice(0,3)==="on:"){let p=t.slice(3);n&&e.removeEventListener(p,n,typeof n!="function"&&n),r&&e.addEventListener(p,r,typeof r!="function"&&r);}else if(t.slice(0,10)==="oncapture:"){let p=t.slice(10);n&&e.removeEventListener(p,n,true),r&&e.addEventListener(p,r,true);}else if(t.slice(0,2)==="on"){let p=t.slice(2).toLowerCase(),f=Q0.has(p);if(!f&&n){let b=Array.isArray(n)?n[0]:n;e.removeEventListener(p,b);}(f||r)&&(nt(e,p,r,f),f&&Ne([p]));}else if(t.slice(0,5)==="attr:")G(e,t.slice(5),r);else if(t.slice(0,5)==="bool:")nT(e,t.slice(5),r);else if((d=t.slice(0,5)==="prop:")||(u=Y0.has(t))||!o&&((c=Z0(t,e.tagName))||(l=q0.has(t)))||(s=e.nodeName.includes("-")||"is"in a)){if(d)t=t.slice(5),l=true;t==="class"||t==="className"?U(e,r):s&&!l&&!u?e[sT(t)]=r:e[c||t]=r;}else {let p=o&&t.indexOf(":")>-1&&eT[t.split(":")[0]];p?rT(e,p,t,r):G(e,K0[t]||t,r);}return r}function lT(e){let t=e.target,r=`$$${e.type}`,n=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:true,value:l}),a=()=>{let l=t[r];if(l&&!t.disabled){let u=t[`${r}Data`];if(u!==void 0?l.call(t,u,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),true},s=()=>{for(;a()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:true,get(){return t||document}}),e.composedPath){let l=e.composedPath();i(l[0]);for(let u=0;u<l.length-2&&(t=l[u],!!a());u++){if(t._$host){t=t._$host,s();break}if(t.parentNode===o)break}}else s();i(n);}function uo(e,t,r,n,o){for(;typeof r=="function";)r=r();if(t===r)return r;let a=typeof t,s=n!==void 0;if(e=s&&r[0]&&r[0].parentNode||e,a==="string"||a==="number"){if(a==="number"&&(t=t.toString(),t===r))return r;if(s){let l=r[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),r=co(e,r,n,l);}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t;}else if(t==null||a==="boolean"){r=co(e,r,n);}else {if(a==="function")return M(()=>{let l=t();for(;typeof l=="function";)l=l();r=uo(e,l,r,n);}),()=>r;if(Array.isArray(t)){let l=[],u=r&&Array.isArray(r);if(Xl(l,t,r,o))return M(()=>r=uo(e,l,r,n,true)),()=>r;if(l.length===0){if(r=co(e,r,n),s)return r}else u?r.length===0?of(e,l,n):tT(e,r,l):(r&&co(e),of(e,l));r=l;}else if(t.nodeType){if(Array.isArray(r)){if(s)return r=co(e,r,n,t);co(e,r,null,t);}else r==null||r===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);r=t;}}return r}function Xl(e,t,r,n){let o=false;for(let i=0,a=t.length;i<a;i++){let s=t[i],l=r&&r[e.length],u;if(!(s==null||s===true||s===false))if((u=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))o=Xl(e,s,l)||o;else if(u==="function")if(n){for(;typeof s=="function";)s=s();o=Xl(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||o;}else e.push(s),o=true;else {let c=String(s);l&&l.nodeType===3&&l.data===c?e.push(l):e.push(document.createTextNode(c));}}return o}function of(e,t,r=null){for(let n=0,o=t.length;n<o;n++)e.insertBefore(t[n],r);}function co(e,t,r,n){if(r===void 0)return e.textContent="";let o=n||document.createTextNode("");if(t.length){let i=false;for(let a=t.length-1;a>=0;a--){let s=t[a];if(o!==s){let l=s.parentNode===e;!i&&!a?l?e.replaceChild(o,s):e.insertBefore(o,r):l&&s.remove();}else i=true;}}else e.insertBefore(o,r);return [o]}var uT="http://www.w3.org/2000/svg";function sf(e,t=false){return t?document.createElementNS(uT,e):document.createElement(e)}function lf(e){let {useShadow:t}=e,r=document.createTextNode(""),n=()=>e.mount||document.body,o=lo(),i;return Ce(()=>{i||(i=Gd(o,()=>L(()=>e.children)));let s=n();if(s instanceof HTMLHeadElement){let[l,u]=R(false),c=()=>u(true);vr(d=>x(s,()=>l()?d():i(),null)),ae(c);}else {let l=sf(e.isSVG?"g":"div",e.isSVG),u=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return r.parentNode},configurable:true}),x(u,i),s.appendChild(l),e.ref&&e.ref(l),ae(()=>s.removeChild(l));}},void 0,{render:true}),r}function dT(e,t){let r=L(e);return L(()=>{let n=r();switch(typeof n){case "function":return rt(()=>n(t));case "string":let o=J0.has(n),i=sf(n,o);return Pe(i,t,o),i}})}function cf(e){let[,t]=Je(e,["component"]);return dT(()=>e.component,t)}function fT(e){let t=Object.keys(e),r={};for(let n=0;n<t.length;n++){let[o,i]=R(e[t[n]]);Object.defineProperty(r,t[n],{get:o,set(a){i(()=>a);}});}return r}function pT(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function mT(e){return (t,r)=>{let{element:n}=r;return vr(o=>{let i=fT(t);n.addPropertyChangedCallback((s,l)=>i[s]=l),n.addReleaseCallback(()=>{n.renderRoot.textContent="",o();});let a=e(i,r);return x(n.renderRoot,a)},pT(n))}}function Wa(e,t,r){return arguments.length===2&&(r=t,t={}),Nd(e,t)(mT(r))}var ja={agent:void 0,onNewInputBlock:void 0,onAnswer:void 0,onEnd:void 0,onInit:void 0,onNewLogs:void 0,onChatStatePersisted:void 0,onScriptExecutionSuccess:void 0,font:void 0,progressBarRef:void 0,isPreview:void 0,startFrom:void 0,prefilledVariables:void 0,apiHost:void 0,resultId:void 0,sessionId:void 0},uf={...ja,onClose:void 0,onOpen:void 0,theme:void 0,autoShowDelay:void 0,isOpen:void 0,defaultOpen:void 0},df={...ja,onClose:void 0,onOpen:void 0,theme:void 0,previewMessage:void 0,onPreviewMessageClick:void 0,onPreviewMessageDismissed:void 0,autoShowDelay:void 0,inlineStyle:void 0};var ff=e=>{sessionStorage.setItem("agentPaymentInProgress",JSON.stringify(e));},fo=()=>sessionStorage.getItem("agentPaymentInProgress"),za=()=>{sessionStorage.removeItem("agentPaymentInProgress");};var po=class extends Error{constructor(t){super("This agent can only be executed on "+t);}};var Lr=(e,t)=>{if(typeof window<"u")return window.__ENV?window.__ENV[e]??t:void 0;if(!(typeof process>"u"))return process.env[e]??t};var gT="https://r0.ar",dt=({ignoreChatApiUrl:e}={ignoreChatApiUrl:false})=>{let t=Lr("NEXT_PUBLIC_CHAT_API_URL"),r=Lr("NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON")?.split(",");if(!e&&t&&(!r||r.some(i=>i===window.location.href)))return t;let n=process.env.NEXT_PUBLIC_VIEWER_URL?.split(",")??[];return n?.find(i=>window.location.href.startsWith(i))??n?.[0]??gT};function pf(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=pf(e[t]))&&(n&&(n+=" "),n+=r);}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function jt(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=pf(e))&&(n&&(n+=" "),n+=t);return n}var ye=jt;var hT=e=>{let t=yT(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return {getClassGroupId:a=>{let s=a.split("-");return s[0]===""&&s.length!==1&&s.shift(),hf(s,t)||bT(a)},getConflictingClassGroupIds:(a,s)=>{let l=r[a]||[];return s&&n[a]?[...l,...n[a]]:l}}},hf=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],n=t.nextPart.get(r),o=n?hf(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;let i=e.join("-");return t.validators.find(({validator:a})=>a(i))?.classGroupId},mf=/^\[(.+)\]$/,bT=e=>{if(mf.test(e)){let t=mf.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return "arbitrary.."+r}},yT=e=>{let{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return vT(Object.entries(e.classGroups),r).forEach(([i,a])=>{Ql(a,n,i,t);}),n},Ql=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){let i=o===""?t:gf(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(xT(o)){Ql(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,a])=>{Ql(a,gf(t,i),r,n);});});},gf=(e,t)=>{let r=e;return t.split("-").forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n);}),r},xT=e=>e.isThemeGetter,vT=(e,t)=>t?e.map(([r,n])=>{let o=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,s])=>[t+a,s])):i);return [r,o]}):e,wT=e=>{if(e<1)return {get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map,o=(i,a)=>{r.set(i,a),t++,t>e&&(t=0,n=r,r=new Map);};return {get(i){let a=r.get(i);if(a!==void 0)return a;if((a=n.get(i))!==void 0)return o(i,a),a},set(i,a){r.has(i)?r.set(i,a):o(i,a);}}};var TT=e=>{let{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],i=t.length,a=s=>{let l=[],u=0,c=0,d;for(let y=0;y<s.length;y++){let T=s[y];if(u===0){if(T===o&&(n||s.slice(y,y+i)===t)){l.push(s.slice(c,y)),c=y+i;continue}if(T==="/"){d=y;continue}}T==="["?u++:T==="]"&&u--;}let p=l.length===0?s:s.substring(c),f=p.startsWith("!"),b=f?p.substring(1):p,g=d&&d>c?d-c:void 0;return {modifiers:l,hasImportantModifier:f,baseClassName:b,maybePostfixModifierPosition:g}};return r?s=>r({className:s,parseClassName:a}):a},CT=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n);}),t.push(...r.sort()),t},_T=e=>({cache:wT(e.cacheSize),parseClassName:TT(e),...hT(e)}),ST=/\s+/,kT=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(ST),s="";for(let l=a.length-1;l>=0;l-=1){let u=a[l],{modifiers:c,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:f}=r(u),b=!!f,g=n(b?p.substring(0,f):p);if(!g){if(!b){s=u+(s.length>0?" "+s:s);continue}if(g=n(p),!g){s=u+(s.length>0?" "+s:s);continue}b=false;}let y=CT(c).join(":"),T=d?y+"!":y,S=T+g;if(i.includes(S))continue;i.push(S);let E=o(g,b);for(let h=0;h<E.length;++h){let C=E[h];i.push(T+C);}s=u+(s.length>0?" "+s:s);}return s};function PT(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=bf(t))&&(n&&(n+=" "),n+=r);return n}var bf=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=bf(e[n]))&&(r&&(r+=" "),r+=t);return r};function ET(e,...t){let r,n,o,i=a;function a(l){let u=t.reduce((c,d)=>d(c),e());return r=_T(u),n=r.cache.get,o=r.cache.set,i=s,s(l)}function s(l){let u=n(l);if(u)return u;let c=kT(l,r);return o(l,c),c}return function(){return i(PT.apply(null,arguments))}}var Ge=e=>{let t=r=>r[e]||[];return t.isThemeGetter=true,t},yf=/^\[(?:([a-z-]+):)?(.+)\]$/i,IT=/^\d+\/\d+$/,AT=new Set(["px","full","screen"]),OT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,DT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,MT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$T=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fr=e=>mo(e)||AT.has(e)||IT.test(e),en=e=>go(e,"length",WT),mo=e=>!!e&&!Number.isNaN(Number(e)),Zl=e=>go(e,"number",mo),di=e=>!!e&&Number.isInteger(Number(e)),NT=e=>e.endsWith("%")&&mo(e.slice(0,-1)),we=e=>yf.test(e),tn=e=>OT.test(e),LT=new Set(["length","size","percentage"]),FT=e=>go(e,LT,xf),BT=e=>go(e,"position",xf),UT=new Set(["image","url"]),VT=e=>go(e,UT,zT),HT=e=>go(e,"",jT),fi=()=>true,go=(e,t,r)=>{let n=yf.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):false},WT=e=>RT.test(e)&&!DT.test(e),xf=()=>false,jT=e=>MT.test(e),zT=e=>$T.test(e);var GT=()=>{let e=Ge("colors"),t=Ge("spacing"),r=Ge("blur"),n=Ge("brightness"),o=Ge("borderColor"),i=Ge("borderRadius"),a=Ge("borderSpacing"),s=Ge("borderWidth"),l=Ge("contrast"),u=Ge("grayscale"),c=Ge("hueRotate"),d=Ge("invert"),p=Ge("gap"),f=Ge("gradientColorStops"),b=Ge("gradientColorStopPositions"),g=Ge("inset"),y=Ge("margin"),T=Ge("opacity"),S=Ge("padding"),E=Ge("saturate"),h=Ge("scale"),C=Ge("sepia"),$=Ge("skew"),H=Ge("space"),N=Ge("translate"),_=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",we,t],k=()=>[we,t],O=()=>["",Fr,en],D=()=>["auto",mo,we],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>["start","end","center","between","around","evenly","stretch"],fe=()=>["","0",we],Be=()=>["auto","avoid","all","avoid-page","page","left","right","column"],pe=()=>[mo,we];return {cacheSize:500,separator:":",theme:{colors:[fi],spacing:[Fr,en],blur:["none","",tn,we],brightness:pe(),borderColor:[e],borderRadius:["none","","full",tn,we],borderSpacing:k(),borderWidth:O(),contrast:pe(),grayscale:fe(),hueRotate:pe(),invert:fe(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[NT,en],inset:I(),margin:I(),opacity:pe(),padding:k(),saturate:pe(),scale:pe(),sepia:fe(),skew:pe(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",we]}],container:["container"],columns:[{columns:[tn]}],"break-after":[{"break-after":Be()}],"break-before":[{"break-before":Be()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...F(),we]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",di,we]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",we]}],grow:[{grow:fe()}],shrink:[{shrink:fe()}],order:[{order:["first","last","none",di,we]}],"grid-cols":[{"grid-cols":[fi]}],"col-start-end":[{col:["auto",{span:["full",di,we]},we]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[fi]}],"row-start-end":[{row:["auto",{span:[di,we]},we]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",we]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",we]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...ve()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ve(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ve(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[H]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[H]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",we,t]}],"min-w":[{"min-w":[we,t,"min","max","fit"]}],"max-w":[{"max-w":[we,t,"none","full","min","max","fit","prose",{screen:[tn]},tn]}],h:[{h:[we,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[we,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[we,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[we,t,"auto","min","max","fit"]}],"font-size":[{text:["base",tn,en]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Zl]}],"font-family":[{font:[fi]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",we]}],"line-clamp":[{"line-clamp":["none",mo,Zl]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fr,we]}],"list-image":[{"list-image":["none",we]}],"list-style-type":[{list:["none","disc","decimal",we]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[T]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[T]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Fr,en]}],"underline-offset":[{"underline-offset":["auto",Fr,we]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[T]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),BT]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",FT]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},VT]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[T]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[T]}],"divide-style":[{divide:j()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[Fr,we]}],"outline-w":[{outline:[Fr,en]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[T]}],"ring-offset-w":[{"ring-offset":[Fr,en]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",tn,HT]}],"shadow-color":[{shadow:[fi]}],opacity:[{opacity:[T]}],"mix-blend":[{"mix-blend":[...ne(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ne()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",tn,we]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[E]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[T]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",we]}],duration:[{duration:pe()}],ease:[{ease:["linear","in","out","in-out",we]}],delay:[{delay:pe()}],animate:[{animate:["none","spin","ping","pulse","bounce",we]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[h]}],"scale-x":[{"scale-x":[h]}],"scale-y":[{"scale-y":[h]}],rotate:[{rotate:[di,we]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",we]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",we]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",we]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Fr,en,Zl]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var vf=ET(GT);Ma(gp());Ma(bp());var yp=async e=>{let t;try{let r=typeof e=="string"?e:e.url;t=await fetch(r,{method:typeof e=="string"?"GET":e.method,mode:"cors",headers:typeof e!="string"&&ue(e.body)?{"Content-Type":"application/json"}:void 0,body:typeof e!="string"&&ue(e.body)?JSON.stringify(e.body):void 0});let n=await t.json();if(!t.ok)throw typeof n=="object"&&n!==null&&"error"in n?n.error:n;return {data:n,response:t}}catch(r){return console.error(r),{error:r,response:t}}},ue=e=>e!=null,at=e=>e==null,Ze=e=>e==null||e==="",Re=e=>e!=null&&e!=="";var xp=e=>{e.split("</noscript>").forEach(r=>{let[n,o]=r.split("<noscript>"),i=document.createRange().createContextualFragment(n??"");if(document.head.append(i),at(o))return;let a=document.createElement("noscript"),s=document.createRange().createContextualFragment(o);a.append(s),document.head.append(a);});};var or=e=>e?.startsWith("data:image/svg")||e?.endsWith(".svg");var Tr=class extends Error{constructor(t,r,n){let o=t.status||t.status===0?t.status:"",i=t.statusText||"",a=`${o} ${i}`.trim(),s=a?`status code ${a}`:"an unknown error";super(`Request failed with ${s}`),Object.defineProperty(this,"response",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"request",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"options",{enumerable:true,configurable:true,writable:true,value:void 0}),this.name="HTTPError",this.response=t,this.request=r,this.options=n;}};var wo=class extends Error{constructor(t){super("Request timed out"),Object.defineProperty(this,"request",{enumerable:true,configurable:true,writable:true,value:void 0}),this.name="TimeoutError",this.request=t;}};var yi=e=>e!==null&&typeof e=="object";var xi=(...e)=>{for(let t of e)if((!yi(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return Xa({},...e)},ac=(e={},t={})=>{let r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(let[i,a]of o.entries())n&&a==="undefined"||a===void 0?r.delete(i):r.set(i,a);return r},Xa=(...e)=>{let t={},r={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(yi(n)){for(let[o,i]of Object.entries(n))yi(i)&&o in t&&(i=Xa(t[o],i)),t={...t,[o]:i};yi(n.headers)&&(r=ac(r,n.headers),t.headers=r);}return t};var vp=(()=>{let e=false,t=false,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";return r&&n&&(t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=true,"half"}}).headers.has("Content-Type")),e&&!t})(),wp=typeof globalThis.AbortController=="function",Tp=typeof globalThis.ReadableStream=="function",Cp=typeof globalThis.FormData=="function",Za=["get","post","put","patch","head","delete"];var _p={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Qa=2147483647,Ja=Symbol("stop"),Sp={json:true,parseJson:true,searchParams:true,prefixUrl:true,retry:true,timeout:true,hooks:true,throwHttpErrors:true,onDownloadProgress:true,fetch:true},kp={method:true,headers:true,body:true,mode:true,credentials:true,cache:true,redirect:true,referrer:true,referrerPolicy:true,integrity:true,keepalive:true,signal:true,window:true,dispatcher:true,duplex:true,priority:true};var Ep=e=>Za.includes(e)?e.toUpperCase():e,LC=["get","put","head","delete","options","trace"],FC=[408,413,429,500,502,503,504],Ip=[413,429,503],Pp={limit:2,methods:LC,statusCodes:FC,afterStatusCodes:Ip,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},Ap=(e={})=>{if(typeof e=="number")return {...Pp,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return {...Pp,...e,afterStatusCodes:Ip}};async function sc(e,t,r,n){return new Promise((o,i)=>{let a=setTimeout(()=>{r&&r.abort(),i(new wo(e));},n.timeout);n.fetch(e,t).then(o).catch(i).then(()=>{clearTimeout(a);});})}async function lc(e,{signal:t}){return new Promise((r,n)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:true}));function o(){clearTimeout(i),n(t.reason);}let i=setTimeout(()=>{t?.removeEventListener("abort",o),r();},e);})}var Op=(e,t)=>{let r={};for(let n in t)!(n in kp)&&!(n in Sp)&&!(n in e)&&(r[n]=t[n]);return r};var vi=class e{static create(t,r){let n=new e(t,r),o=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>Qa)throw new RangeError(`The \`timeout\` option cannot be greater than ${Qa}`);await Promise.resolve();let s=await n._fetch();for(let l of n._options.hooks.afterResponse){let u=await l(n.request,n._options,n._decorateResponse(s.clone()));u instanceof globalThis.Response&&(s=u);}if(n._decorateResponse(s),!s.ok&&n._options.throwHttpErrors){let l=new Tr(s,n.request,n._options);for(let u of n._options.hooks.beforeError)l=await u(l);throw l}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Tp)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(s.clone(),n._options.onDownloadProgress)}return s},a=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(o):o();for(let[s,l]of Object.entries(_p))a[s]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||l);let c=(await a).clone();if(s==="json"){if(c.status===204||(await c.clone().arrayBuffer()).byteLength===0)return "";if(r.parseJson)return r.parseJson(await c.text())}return c[s]()};return a}constructor(t,r={}){Object.defineProperty(this,"request",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:true,configurable:true,writable:true,value:0}),Object.defineProperty(this,"_input",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"_options",{enumerable:true,configurable:true,writable:true,value:void 0}),this._input=t;let n=this._input instanceof Request&&"credentials"in Request.prototype?this._input.credentials:void 0;if(this._options={...n&&{credentials:n},...r,headers:ac(this._input.headers,r.headers),hooks:Xa({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Ep(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:Ap(r.retry),throwHttpErrors:r.throwHttpErrors!==false,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input;}if(wp){if(this.abortController=new globalThis.AbortController,this._options.signal){let o=this._options.signal;this._options.signal.addEventListener("abort",()=>{this.abortController.abort(o.reason);});}this._options.signal=this.abortController.signal;}if(vp&&(this._options.duplex="half"),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(Cp&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(a,{...this.request}),this._options);}this._options.json!==void 0&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",this._options.headers.get("content-type")??"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}));}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount<=this._options.retry.limit&&!(t instanceof wo)){if(t instanceof Tr){if(!this._options.retry.statusCodes.includes(t.response.status))return 0;let n=t.response.headers.get("Retry-After");if(n&&this._options.retry.afterStatusCodes.includes(t.response.status)){let o=Number(n);return Number.isNaN(o)?o=Date.parse(n)-Date.now():o*=1e3,this._options.retry.maxRetryAfter!==void 0&&o>this._options.retry.maxRetryAfter?0:o}if(t.response.status===413)return 0}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}return 0}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(r){let n=Math.min(this._calculateRetryDelay(r),Qa);if(n!==0&&this._retryCount>0){await lc(n,{signal:this._options.signal});for(let o of this._options.hooks.beforeRetry)if(await o({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===Ja)return;return this._retry(t)}throw r}}async _fetch(){for(let r of this._options.hooks.beforeRequest){let n=await r(this.request,this._options);if(n instanceof Request){this.request=n;break}if(n instanceof Response)return n}let t=Op(this.request,this._options);return this._options.timeout===false?this._options.fetch(this.request.clone(),t):sc(this.request.clone(),t,this.abortController,this._options)}_stream(t,r){let n=Number(t.headers.get("content-length"))||0,o=0;return t.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:o},new Uint8Array),new globalThis.Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(i){let a=t.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function s(){let{done:l,value:u}=await a.read();if(l){i.close();return}if(r){o+=u.byteLength;let c=n===0?0:o/n;r({percent:c,transferredBytes:o,totalBytes:n},u);}i.enqueue(u),await s();}await s();}}),{status:t.status,statusText:t.statusText,headers:t.headers})}};var cc=e=>{let t=(r,n)=>vi.create(r,xi(e,n));for(let r of Za)t[r]=(n,o)=>vi.create(n,xi(e,o,{method:r}));return t.create=r=>cc(xi(r)),t.extend=r=>cc(xi(e,r)),t.stop=Ja,t},BC=cc(),on=BC;async function Rp({agent:e,isPreview:t,apiHost:r,prefilledVariables:n,resultId:o,stripeRedirectStatus:i,startFrom:a,sessionId:s}){if(at(e))throw new Error("Agent is required to start the chat");let l=fo()??void 0,u=l?JSON.parse(l):void 0;if(u)return UC({apiHost:r,stripeRedirectStatus:i,paymentInProgressState:u});let c=typeof e=="string"?e:e.id;if(t)return VC({apiHost:r,agentId:c,startFrom:a,agent:e,prefilledVariables:n,sessionId:s});try{let d=parent!==window&&Re(document.referrer)?new URL(document.referrer).origin:void 0,p=await on.post(`${uc(r)}/api/v1/agents/${c}/start`,{headers:{"x-agent-iframe-referrer-origin":d,"x-original-referrer":document.referrer},json:{isStreamEnabled:!0,prefilledVariables:n,resultId:o,isOnlyRegistering:!1},timeout:!1}),f=p.headers.get("access-control-allow-origin");if(d&&f&&f!=="*"&&!d.includes(f))throw new po(f);return {data:await p.json()}}catch(d){return {error:d}}}var UC=async({apiHost:e,stripeRedirectStatus:t,paymentInProgressState:r})=>{za();try{return {data:{...await on.post(`${uc(e)}/api/v1/sessions/${r.sessionId}/continue`,{json:{message:t==="failed"?"fail":"Success"},timeout:!1}).json(),...r}}}catch(n){return {error:n}}},VC=async({apiHost:e,agentId:t,startFrom:r,agent:n,prefilledVariables:o,sessionId:i})=>{try{return {data:await on.post(`${uc(e)}/api/v1/agents/${t}/preview/start`,{json:{isStreamEnabled:!0,startFrom:r,agent:n,prefilledVariables:o,sessionId:i},timeout:!1}).json()}}catch(a){return {error:a}}},uc=e=>Re(e)?e:dt();var[Dp,Mp]=R("100%");var[iM,$p]=R();var es="#303235",ts="#FFFFFF",Np="Google",To="Open Sans",Co="Color",wi="#ffffff";var Lp="#000",Fp="#000",Bp=2,rs="absolute",Up="Top",xn="medium",_t=1,Vp=0,Hp="800px",Wp="100%",Ti="transparent";var _o="#F7F8FF",jp=es,zp="#000",Gp=ts,Ci="#0042DA",qp=ts,Yp=1;var Kp="#FFFFFF",_i=es,Xp="#9095A0",Zp="md";var So=true,Si=false;var HC="https://fonts.bunny.net/css2",ns="agent-font",dc=e=>{let t=document.getElementById(ns);if(typeof e=="string"||e.type==="Google"){let r=(typeof e=="string"?e:e.family)??To;if(t?.getAttribute("href")?.includes(r))return;t?.remove();let n=document.createElement("link");n.href=`${HC}?family=${r}:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap`,n.rel="stylesheet",n.id=ns,document.head.appendChild(n);return}if(e.type==="Custom"){if(Re(e.css)){if(t?.innerHTML===e.css)return;t?.remove();let r=document.createElement("style");r.innerHTML=e.css,r.id=ns,document.head.appendChild(r);}if(Re(e.url)){if(t?.getAttribute("href")===e.url)return;t?.remove();let r=document.createElement("link");r.href=e.url,r.rel="stylesheet",r.id=ns,document.head.appendChild(r);}}};var[K,Qp]=R();var ft={general:{isInputPrefillEnabled:false,rememberUser:{isEnabled:false,storage:"session"}},typingEmulation:{enabled:true,speed:900,maxDelay:2,delayBetweenBubbles:0,isDisabledOnFirstMessage:true}};var WC=Symbol("store-raw"),jC=Symbol("store-node"),ko=Symbol("store-has"),zC=Symbol("store-self");function ki(e){let t;return e!=null&&typeof e=="object"&&(e[so]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function fc(e,t=new Set){let r,n,o,i;if(r=e!=null&&e[WC])return r;if(!ki(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let a=0,s=e.length;a<s;a++)o=e[a],(n=fc(o,t))!==o&&(e[a]=n);}else {Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let a=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let l=0,u=a.length;l<u;l++)i=a[l],!s[i].get&&(o=e[i],(n=fc(o,t))!==o&&(e[i]=n));}return e}function GC(e,t){let r=e[t];return r||Object.defineProperty(e,t,{value:r=Object.create(null)}),r}function Jp(e,t,r){if(e[t])return e[t];let[n,o]=R(r,{equals:false,internal:true});return n.$=o,e[t]=n}function an(e,t,r,n=false){if(!n&&e[t]===r)return;let o=e[t],i=e.length;r===void 0?(delete e[t],e[ko]&&e[ko][t]&&o!==void 0&&e[ko][t].$()):(e[t]=r,e[ko]&&e[ko][t]&&o===void 0&&e[ko][t].$());let a=GC(e,jC),s;if((s=Jp(a,t,o))&&s.$(()=>r),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(s=a[l])&&s.$();(s=Jp(a,"length",i))&&s.$(e.length);}(s=a[zC])&&s.$();}var pc=Symbol("store-root");function Po(e,t,r,n,o){let i=t[r];if(e===i)return;let a=Array.isArray(e);if(r!==pc&&(!ki(e)||!ki(i)||a!==Array.isArray(i)||o&&e[o]!==i[o])){an(t,r,e);return}if(a){if(e.length&&i.length&&(!n||o&&e[0]&&e[0][o]!=null)){let u,c,d,p,f,b,g,y;for(d=0,p=Math.min(i.length,e.length);d<p&&(i[d]===e[d]||o&&i[d]&&e[d]&&i[d][o]===e[d][o]);d++)Po(e[d],i,d,n,o);let T=new Array(e.length),S=new Map;for(p=i.length-1,f=e.length-1;p>=d&&f>=d&&(i[p]===e[f]||o&&i[p]&&e[f]&&i[p][o]===e[f][o]);p--,f--)T[f]=i[p];if(d>f||d>p){for(c=d;c<=f;c++)an(i,c,e[c]);for(;c<e.length;c++)an(i,c,T[c]),Po(e[c],i,c,n,o);i.length>e.length&&an(i,"length",e.length);return}for(g=new Array(f+1),c=f;c>=d;c--)b=e[c],y=o&&b?b[o]:b,u=S.get(y),g[c]=u===void 0?-1:u,S.set(y,c);for(u=d;u<=p;u++)b=i[u],y=o&&b?b[o]:b,c=S.get(y),c!==void 0&&c!==-1&&(T[c]=i[u],c=g[c],S.set(y,c));for(c=d;c<e.length;c++)c in T?(an(i,c,T[c]),Po(e[c],i,c,n,o)):an(i,c,e[c]);}else for(let u=0,c=e.length;u<c;u++)Po(e[u],i,u,n,o);i.length>e.length&&an(i,"length",e.length);return}let s=Object.keys(e);for(let u=0,c=s.length;u<c;u++)Po(e[s[u]],i,s[u],n,o);let l=Object.keys(i);for(let u=0,c=l.length;u<c;u++)e[l[u]]===void 0&&an(i,l[u],void 0);}function em(e,t={}){let{merge:r,key:n="id"}=t,o=fc(e);return i=>{if(!ki(i)||!ki(o))return o;let a=Po(o,{[pc]:i},pc,r,n);return a===void 0?i:a}}function Cr(e,t){if(!t.storage)return [...e];let r=qC(t.storage||ft.general.rememberUser.storage),n=s=>{let l=JSON.parse(JSON.stringify(s));return typeof l!="object"||("blobUrl"in l&&(l.blobUrl=void 0),"attachments"in l&&Array.isArray(l.attachments)&&l.attachments.forEach(u=>{u&&"blobUrl"in u&&(u.blobUrl=void 0);})),JSON.stringify(l)},o=JSON.parse.bind(JSON),i=r.getItem(t.key),a=typeof e[0]=="function"?s=>e[1](()=>o(s)):s=>e[1](em(o(s)));return i&&(a(i),t.onRecovered?.()),[e[0],typeof e[0]=="function"?s=>{let l=e[1](s);return s?r.setItem(t.key,n(l)):r.removeItem(t.key),l}:(...s)=>{e[1](...s);let l=n(rt(()=>e[0]));r.setItem(t.key,l);}]}var qC=e=>(e??ft.general.rememberUser.storage)==="session"?sessionStorage:localStorage;var ct=e=>{let t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,(n,o,i,a)=>o+o+i+i+a+a);let r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return r?[Number.parseInt(r[1]??"",16),Number.parseInt(r[2]??"",16),Number.parseInt(r[3]??"",16)]:[0,0,0]},Ur=e=>(([t,r,n])=>(t*299+r*587+n*114)/1e3>155)(ct(e));var tm=({chatContainer:e,generalBackground:t})=>{let r=e?.backgroundColor??Ti;if((e?.opacity??_t)<=.3||r==="transparent"||Ze(r)){let o=t?.type??Co,i=o==="Image"?"#000000":o==="Color"&&Re(t?.content)?t.content:"#ffffff";return Ur(i)}return Ur(e?.backgroundColor??wi)};var J={general:{bgImage:"--agent-container-bg-image",bgColor:"--agent-container-bg-color",fontFamily:"--agent-container-font-family",progressBar:{position:"--agent-progress-bar-position",color:"--agent-progress-bar-color",colorRgb:"--agent-progress-bar-bg-rgb",height:"--agent-progress-bar-height",top:"--agent-progress-bar-top",bottom:"--agent-progress-bar-bottom"}},chat:{container:{maxWidth:"--agent-chat-container-max-width",maxHeight:"--agent-chat-container-max-height",bgColor:"--agent-chat-container-bg-rgb",color:"--agent-chat-container-color",borderRadius:"--agent-chat-container-border-radius",borderWidth:"--agent-chat-container-border-width",borderColor:"--agent-chat-container-border-rgb",borderOpacity:"--agent-chat-container-border-opacity",opacity:"--agent-chat-container-opacity",blur:"--agent-chat-container-blur",boxShadow:"--agent-chat-container-box-shadow"},hostBubbles:{bgColor:"--agent-host-bubble-bg-rgb",color:"--agent-host-bubble-color",borderRadius:"--agent-host-bubble-border-radius",borderWidth:"--agent-host-bubble-border-width",borderColor:"--agent-host-bubble-border-rgb",borderOpacity:"--agent-host-bubble-border-opacity",opacity:"--agent-host-bubble-opacity",blur:"--agent-host-bubble-blur",boxShadow:"--agent-host-bubble-box-shadow"},guestBubbles:{bgColor:"--agent-guest-bubble-bg-rgb",color:"--agent-guest-bubble-color",borderRadius:"--agent-guest-bubble-border-radius",borderWidth:"--agent-guest-bubble-border-width",borderColor:"--agent-guest-bubble-border-rgb",borderOpacity:"--agent-guest-bubble-border-opacity",opacity:"--agent-guest-bubble-opacity",blur:"--agent-guest-bubble-blur",boxShadow:"--agent-guest-bubble-box-shadow"},inputs:{bgColor:"--agent-input-bg-rgb",color:"--agent-input-color",placeholderColor:"--agent-input-placeholder-color",borderRadius:"--agent-input-border-radius",borderWidth:"--agent-input-border-width",borderColor:"--agent-input-border-rgb",borderOpacity:"--agent-input-border-opacity",opacity:"--agent-input-opacity",blur:"--agent-input-blur",boxShadow:"--agent-input-box-shadow"},buttons:{bgRgb:"--agent-button-bg-rgb",color:"--agent-button-color",borderRadius:"--agent-button-border-radius",borderWidth:"--agent-button-border-width",borderColor:"--agent-button-border-rgb",borderOpacity:"--agent-button-border-opacity",opacity:"--agent-button-opacity",blur:"--agent-button-blur",boxShadow:"--agent-button-box-shadow"},checkbox:{bgRgb:"--agent-checkbox-bg-rgb",alphaRatio:"--selectable-alpha-ratio"}}},rm=(e,t,r)=>{if(!e)return;let n=t?.style;n&&(KC(e.general,n,r),ZC(e.chat,e.general?.background,n));},KC=(e,t,r)=>{o_(e?.background,t),t.setProperty(J.general.fontFamily,(typeof e?.font=="string"?e.font:e?.font?.family)??To),XC(e?.progressBar,t,r);},XC=(e,t,r)=>{let n=e?.position??rs;t.setProperty(J.general.progressBar.position,n==="fixed"?r?"absolute":"fixed":n),t.setProperty(J.general.progressBar.color,e?.color??Lp),t.setProperty(J.general.progressBar.colorRgb,ct(e?.backgroundColor??Fp).join(", ")),t.setProperty(J.general.progressBar.height,`${e?.thickness??Bp}px`);let o=e?.placement??Up;t.setProperty(J.general.progressBar.top,o==="Top"?"0":"auto"),t.setProperty(J.general.progressBar.bottom,o==="Bottom"?"0":"auto");},ZC=(e,t,r)=>{QC(e?.container,t,r,e?.roundness),JC(e?.hostBubbles,r,e?.roundness),e_(e?.guestBubbles,r,e?.roundness),t_(e?.buttons,r,e?.roundness),r_(e?.inputs,r,e?.roundness),n_(e?.container,t,r);},QC=(e,t,r,n)=>{let o=e?.backgroundColor??Ti,i=o==="transparent"||Ze(o);r.setProperty(J.chat.container.bgColor,i?"0, 0, 0":ct(o).join(", ")),r.setProperty(J.chat.container.color,ct(e?.color??(tm({chatContainer:e,generalBackground:t})?es:ts)).join(", ")),r.setProperty(J.chat.container.maxWidth,e?.maxWidth??Hp),r.setProperty(J.chat.container.maxHeight,e?.maxHeight??Wp);let a=i?"1":(e?.opacity??_t).toString();r.setProperty(J.chat.container.opacity,i?"0":(e?.opacity??_t).toString()),r.setProperty(J.chat.container.blur,a==="1"||i?"0xp":`${e?.blur??Vp}px`),Ei(e?.shadow,r,J.chat.container.boxShadow),Pi(e?.border??{roundeness:n??xn},r,J.chat.container.borderRadius),r.setProperty(J.chat.container.borderWidth,ue(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),r.setProperty(J.chat.container.borderOpacity,ue(e?.border?.opacity)?e.border.opacity.toString():_t.toString()),r.setProperty(J.chat.container.borderColor,ct(e?.border?.color??"").join(", "));},JC=(e,t,r)=>{t.setProperty(J.chat.hostBubbles.bgColor,ct(e?.backgroundColor??_o).join(", ")),t.setProperty(J.chat.hostBubbles.color,e?.color??jp),Pi(e?.border??{roundeness:r??xn},t,J.chat.hostBubbles.borderRadius),t.setProperty(J.chat.hostBubbles.borderWidth,ue(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(J.chat.hostBubbles.borderColor,ct(e?.border?.color??"").join(", ")),t.setProperty(J.chat.hostBubbles.opacity,e?.backgroundColor==="transparent"?"0":ue(e?.opacity)?e.opacity.toString():_t.toString()),t.setProperty(J.chat.hostBubbles.borderOpacity,ue(e?.border?.opacity)?e.border.opacity.toString():_t.toString()),t.setProperty(J.chat.hostBubbles.blur,ue(e?.blur)?`${e.blur??0}px`:"none"),Ei(e?.shadow,t,J.chat.hostBubbles.boxShadow);},e_=(e,t,r)=>{t.setProperty(J.chat.guestBubbles.bgColor,ct(e?.backgroundColor??zp).join(", ")),t.setProperty(J.chat.guestBubbles.color,e?.color??Gp),Pi(e?.border??{roundeness:r??xn},t,J.chat.guestBubbles.borderRadius),t.setProperty(J.chat.guestBubbles.borderWidth,ue(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(J.chat.guestBubbles.borderColor,ct(e?.border?.color??"").join(", ")),t.setProperty(J.chat.guestBubbles.borderOpacity,ue(e?.border?.opacity)?e.border.opacity.toString():_t.toString()),t.setProperty(J.chat.guestBubbles.opacity,e?.backgroundColor==="transparent"?"0":ue(e?.opacity)?e.opacity.toString():_t.toString()),t.setProperty(J.chat.guestBubbles.blur,ue(e?.blur)?`${e.blur??0}px`:"none"),Ei(e?.shadow,t,J.chat.guestBubbles.boxShadow);},t_=(e,t,r)=>{let n=e?.backgroundColor??Ci;t.setProperty(J.chat.buttons.bgRgb,ct(n).join(", ")),t.setProperty(J.chat.buttons.bgRgb,ct(n).join(", ")),t.setProperty(J.chat.buttons.color,e?.color??qp),Pi(e?.border??{roundeness:r??xn},t,J.chat.buttons.borderRadius),t.setProperty(J.chat.buttons.borderWidth,ue(e?.border?.thickness)?`${e?.border?.thickness}px`:`${Yp}px`),t.setProperty(J.chat.buttons.borderColor,ct(e?.border?.color??e?.backgroundColor??Ci).join(", ")),t.setProperty(J.chat.buttons.borderOpacity,ue(e?.border?.opacity)?e.border.opacity.toString():_t.toString()),t.setProperty(J.chat.buttons.opacity,e?.backgroundColor==="transparent"?"0":ue(e?.opacity)?e.opacity.toString():_t.toString()),t.setProperty(J.chat.buttons.blur,ue(e?.blur)?`${e.blur??0}px`:"none"),Ei(e?.shadow,t,J.chat.buttons.boxShadow);},r_=(e,t,r)=>{t.setProperty(J.chat.inputs.bgColor,ct(e?.backgroundColor??Kp).join(", ")),t.setProperty(J.chat.inputs.color,e?.color??_i),t.setProperty(J.chat.inputs.placeholderColor,e?.placeholderColor??Xp),Pi(e?.border??{roundeness:r??xn},t,J.chat.inputs.borderRadius),t.setProperty(J.chat.inputs.borderWidth,ue(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(J.chat.inputs.borderColor,ct(e?.border?.color??"").join(", ")),t.setProperty(J.chat.inputs.borderOpacity,ue(e?.border?.opacity)?e.border.opacity.toString():_t.toString()),t.setProperty(J.chat.inputs.opacity,e?.backgroundColor==="transparent"?"0":ue(e?.opacity)?e.opacity.toString():_t.toString()),t.setProperty(J.chat.inputs.blur,ue(e?.blur)?`${e.blur??0}px`:"none"),Ei(e?.shadow??Zp,t,J.chat.inputs.boxShadow);},n_=(e,t,r)=>{let n=e?.backgroundColor??Ti;if(n==="transparent"||Ze(n)||(e?.opacity??_t)<=.2){let i=t?.type??Co;r.setProperty(J.chat.checkbox.bgRgb,i==="Image"?"rgba(255, 255, 255, 0.75)":ct((i==="Color"?t?.content:"#ffffff")??"#ffffff").join(", ")),i==="Image"?r.setProperty(J.chat.checkbox.alphaRatio,"3"):r.setProperty(J.chat.checkbox.alphaRatio,t?.content&&Ur(t?.content)?"1":"2");}else r.setProperty(J.chat.checkbox.bgRgb,ct(n).concat(e?.opacity??1).join(", ")),r.setProperty(J.chat.checkbox.alphaRatio,Ur(n)?"1":"2");},o_=(e,t)=>{t.setProperty(J.general.bgImage,null),t.setProperty(J.general.bgColor,null),t.setProperty((e?.type??Co)==="Image"?J.general.bgImage:J.general.bgColor,i_({type:e?.type??Co,content:e?.content??wi}));},i_=({type:e,content:t}={})=>{switch(e){case "None":return "transparent";case void 0:case "Color":return t??wi;case "Image":return `url(${t})`}},Pi=(e,t,r)=>{switch(e?.roundeness??xn){case "none":{t.setProperty(r,"0");break}case "medium":{t.setProperty(r,"6px");break}case "large":{t.setProperty(r,"20px");break}case "custom":{t.setProperty(r,`${e.customRoundeness??6}px`);break}}},Ei=(e,t,r)=>{if(e===void 0){t.setProperty(r,"0 0 #0000");return}switch(e){case "none":t.setProperty(r,"0 0 #0000");break;case "sm":t.setProperty(r,"0 1px 2px 0 rgb(0 0 0 / 0.05)");break;case "md":t.setProperty(r,"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)");break;case "lg":t.setProperty(r,"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)");break;case "xl":t.setProperty(r,"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)");break;case "2xl":t.setProperty(r,"0 25px 50px -12px rgb(0 0 0 / 0.25)");break}};var mc="resultId",nm=e=>{if(e)try{return sessionStorage.getItem(`${mc}-${e}`)??localStorage.getItem(`${mc}-${e}`)??void 0}catch{}},om=(e="session")=>(t,r)=>{try{am(e).setItem(`${mc}-${t}`,r);}catch{}},im=e=>{if(e)try{let t=sessionStorage.getItem(`agent-${e}-initialChatReply`)??localStorage.getItem(`agent-${e}-initialChatReply`);return t?JSON.parse(t):void 0}catch{}},gc=(e,{agentId:t,storage:r})=>{try{let n=JSON.stringify(e);am(r).setItem(`agent-${t}-initialChatReply`,n);}catch{}},os=()=>{try{sessionStorage.setItem("agent-typeOpened","true");}catch{}},is=()=>{try{sessionStorage.removeItem("agent-typeOpened");}catch{}},as=()=>{try{return sessionStorage.getItem("agent-typeOpened")==="true"}catch{return false}},am=e=>(e??ft.general.rememberUser.storage)==="session"?sessionStorage:localStorage,ss=e=>{Object.keys(localStorage).forEach(t=>{t.startsWith(`agent-${e}`)&&localStorage.removeItem(t);}),Object.keys(sessionStorage).forEach(t=>{t.startsWith(`agent-${e}`)&&sessionStorage.removeItem(t);});};var a_=e=>typeof e=="function";function s_(e,t){a_(e)&&e(t);}function Ii(...e){return t=>{for(let r of e)s_(r,t);}}var gt=()=>(e,t)=>Je(e,t);function l_(e,t){return `${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function ot(e={}){let{strict:t=true,hookName:r="useContext",providerName:n="Provider",errorMessage:o,defaultValue:i}=e,a=qd(i);function s(){let l=Yl(a);if(!l&&t){let u=new Error(o??l_(r,n));throw u.name="ContextError",Error.captureStackTrace?.(u,s),u}return l}return [a.Provider,s,a]}var[hc,sm]=ot({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"}),Ai=e=>gt()(e,["lazyMount","unmountOnExit"]);var bc=Symbol("fallback");function lm(e){for(let t of e)t.dispose();}function c_(e,t,r,n={}){let o=new Map;return ae(()=>lm(o.values())),()=>{let a=e()||[];return a[Ba],rt(()=>{if(!a.length)return lm(o.values()),o.clear(),n.fallback?[vr(d=>(o.set(bc,{dispose:d}),n.fallback()))]:[];let s=new Array(a.length),l=o.get(bc);if(!o.size||l){l?.dispose(),o.delete(bc);for(let c=0;c<a.length;c++){let d=a[c],p=t(d,c);i(s,d,c,p);}return s}let u=new Set(o.keys());for(let c=0;c<a.length;c++){let d=a[c],p=t(d,c);u.delete(p);let f=o.get(p);f?(s[c]=f.mapped,f.setIndex?.(c),f.setItem(()=>d)):i(s,d,c,p);}for(let c of u)o.get(c)?.dispose(),o.delete(c);return s})};function i(a,s,l,u){vr(c=>{let[d,p]=R(s),f={setItem:p,dispose:c};if(r.length>1){let[b,g]=R(l);f.setIndex=g,f.mapped=r(d,b);}else f.mapped=r(d);o.set(u,f),a[l]=f.mapped;});}}function yc(e){let{by:t}=e;return L(c_(()=>e.each,typeof t=="function"?t:r=>r[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function um(e){return e?Array.isArray(e)?e:[e]:[]}var dm=e=>e[0],fm=e=>e[e.length-1];function pm(e,t,r={}){let{step:n=1,loop:o=true}=r,i=t+n,a=e.length,s=a-1;return t===-1?n>0?0:s:i<0?o?s:0:i>=a?o?0:t>a?a:t:i}function mm(e,t,r={}){return e[pm(e,t,r)]}function u_(e,t,r={}){let{step:n=1,loop:o=true}=r;return pm(e,t,{step:-n,loop:o})}function gm(e,t,r={}){return e[u_(e,t,r)]}var cm=e=>e?.constructor.name==="Array",d_=(e,t)=>{if(e.length!==t.length)return false;for(let r=0;r<e.length;r++)if(!Eo(e[r],t[r]))return false;return true},Eo=(e,t)=>{if(Object.is(e,t))return true;if(e==null&&t!=null||e!=null&&t==null)return false;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(cm(e)&&cm(t))return d_(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return false;let r=Object.keys(t??Object.create(null)),n=r.length;for(let o=0;o<n;o++)if(!Reflect.has(e,r[o]))return false;for(let o=0;o<n;o++){let i=r[o];if(!Eo(e[i],t[i]))return false}return true};var f_=e=>Array.isArray(e);var p_=e=>e!=null&&typeof e=="object",hm=e=>p_(e)&&!f_(e),Oi=e=>typeof e=="number"&&!Number.isNaN(e),sn=e=>typeof e=="string",zt=e=>typeof e=="function",bm=e=>e==null;var m_=Function.prototype.toString;m_.call(Object);var vn=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0;var ym=()=>{},Ri=(...e)=>(...t)=>{e.forEach(function(r){r?.(...t);});},xc=(()=>{let e=0;return ()=>(e++,e.toString(36))})();var g_=e=>Number.isNaN(e),h_=e=>g_(e)?0:e;var xm=(e,t,r)=>(h_(e)-t)/(r-t);function wn(e){if(!b_(e)||e===void 0)return e;let t=Reflect.ownKeys(e).filter(n=>typeof n=="string"),r={};for(let n of t){let o=e[n];o!==void 0&&(r[n]=wn(o));}return r}var b_=e=>e&&typeof e=="object"&&e.constructor===Object;function ls(e,t){let r=performance.now(),n;function o(i){n=requestAnimationFrame(o),i-r>=t&&e();}return n=requestAnimationFrame(o),()=>cancelAnimationFrame(n)}function Io(...e){e.length===1?e[0]:e[1];e.length===2?e[0]:true;}function vm(e,t){if(e==null)throw new Error(t())}function wm(e,t,r){let n=[];for(let o of t)e[o]==null&&n.push(o);if(n.length>0)throw new Error(`[zag-js${` > ${r}`}] missing required props: ${n.join(", ")}`)}var x_=(e,t)=>e.map((r,n)=>e[(Math.max(t,0)+n)%e.length]);var Cm=()=>{},cs=e=>typeof e=="object"&&e!==null,_m=2147483647,Rt=e=>e?"":void 0,Sm=e=>e?"true":void 0,v_=1,w_=9,T_=11,it=e=>cs(e)&&e.nodeType===v_&&typeof e.nodeName=="string",us=e=>cs(e)&&e.nodeType===w_,C_=e=>cs(e)&&e===e.window;var km=e=>it(e)?e.localName||"":"#document";function __(e){return ["html","body","#document"].includes(km(e))}var S_=e=>cs(e)&&e.nodeType!==void 0,Ao=e=>S_(e)&&e.nodeType===T_&&"host"in e,k_=e=>it(e)&&e.localName==="input",Pm=e=>!!e?.matches("a[href]"),P_=e=>it(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:false,E_=/(textarea|select)/;function ds(e){if(e==null||!it(e))return false;try{return k_(e)&&e.selectionStart!=null||E_.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch{return false}}function Gt(e,t){if(!e||!t||!it(e)||!it(t))return false;let r=t.getRootNode?.();if(e===t||e.contains(t))return true;if(r&&Ao(r)){let n=t;for(;n;){if(e===n)return true;n=n.parentNode||n.host;}}return false}function Dt(e){return us(e)?e:C_(e)?e.document:e?.ownerDocument??document}function I_(e){return Dt(e).documentElement}function ir(e){return Ao(e)?ir(e.host):us(e)?e.defaultView??window:it(e)?e.ownerDocument?.defaultView??window:window}function fs(e){let t=e.activeElement;for(;t?.shadowRoot;){let r=t.shadowRoot.activeElement;if(r===t)break;t=r;}return t}function A_(e){if(km(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Ao(e)&&e.host||I_(e);return Ao(t)?t.host:t}var vc=new WeakMap;function Oo(e){return vc.has(e)||vc.set(e,ir(e).getComputedStyle(e)),vc.get(e)}var wc=()=>typeof document<"u";function O_(){return navigator.userAgentData?.platform??navigator.platform}function R_(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}var Tc=e=>wc()&&e.test(O_()),D_=e=>wc()&&e.test(R_());var Cc=()=>wc()&&!!navigator.maxTouchPoints,M_=()=>Tc(/^iPhone/i),$_=()=>Tc(/^iPad/i)||Sc()&&navigator.maxTouchPoints>1,_c=()=>M_()||$_(),N_=()=>Sc()||_c(),Sc=()=>Tc(/^Mac/i);var L_=()=>D_(/Firefox/i);function F_(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function ht(e){return F_(e)?.[0]??e.target}var Em=e=>Gt(e.currentTarget,ht(e));function kc(e){let t=e.currentTarget;if(!t)return false;let r=N_();if(r&&!e.metaKey||!r&&!e.ctrlKey)return false;let n=t.localName;return n==="a"||n==="button"&&t.type==="submit"||n==="input"&&t.type==="submit"}function Pc(e){let t=e.currentTarget;if(!t)return false;let r=t.localName;return e.altKey?r==="a"||r==="button"&&t.type==="submit"||r==="input"&&t.type==="submit":false}function Im(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var ps=e=>e.button===2||Sc()&&e.ctrlKey&&e.button===0,Am=e=>e.ctrlKey||e.altKey||e.metaKey,B_=e=>"touches"in e&&e.touches.length>0,U_={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Tm={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function Ec(e,t={}){let{dir:r="ltr",orientation:n="horizontal"}=t,o=e.key;return o=U_[o]??o,r==="rtl"&&n==="horizontal"&&o in Tm&&(o=Tm[o]),o}function Di(e,t="client"){let r=B_(e)?e.touches[0]||e.changedTouches[0]:e;return {x:r[`${t}X`],y:r[`${t}Y`]}}var pt=(e,t,r,n)=>{let o=typeof e=="function"?e():e;return o?.addEventListener(t,r,n),()=>{o?.removeEventListener(t,r,n);}};var Om=e=>it(e)&&e.tagName==="IFRAME",V_=e=>!Number.isNaN(parseInt(e.getAttribute("tabindex")||"0",10)),H_=e=>parseInt(e.getAttribute("tabindex")||"0",10)<0,Ic="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",Ac=(e,t=false)=>{if(!e)return [];let r=Array.from(e.querySelectorAll(Ic));(t==true||t=="if-empty"&&r.length===0)&&it(e)&&Sr(e)&&r.unshift(e);let o=r.filter(Sr);return o.forEach((i,a)=>{if(Om(i)&&i.contentDocument){let s=i.contentDocument.body;o.splice(a,1,...Ac(s));}}),o};function Sr(e){return !e||e.closest("[inert]")?false:e.matches(Ic)&&P_(e)}function Mi(e,t){if(!e)return [];let r=Array.from(e.querySelectorAll(Ic)),n=r.filter(Vr);return n.forEach((o,i)=>{if(Om(o)&&o.contentDocument){let a=o.contentDocument.body,s=Mi(a);n.splice(i,1,...s);}}),!n.length&&t?r:n}function Vr(e){return e!=null&&e.tabIndex>0?true:Sr(e)&&!H_(e)}function W_(e,t){let r=Mi(e,t),n=r[0]||null,o=r[r.length-1]||null;return [n,o]}function Ro(e){return e.tabIndex<0&&(/^(audio|video|details)$/.test(e.localName)||ds(e))&&!V_(e)?0:e.tabIndex}function Rm(e){let{root:t,getInitialEl:r,filter:n,enabled:o=true}=e;if(!o)return;let i=null;if(i||(i=typeof r=="function"?r():r),i||(i=t?.querySelector("[data-autofocus],[autofocus]")),!i){let a=Mi(t);i=n?a.filter(n)[0]:a[0];}return i||t||void 0}function Dm(e){let t=e.currentTarget;if(!t)return false;let[r,n]=W_(t),o=t.ownerDocument||document;return !(o.activeElement===r&&e.shiftKey||o.activeElement===n&&!e.shiftKey||!r&&!n)}function Mm(e){let t=new Set;function r(n){let o=globalThis.requestAnimationFrame(n);t.add(()=>globalThis.cancelAnimationFrame(o));}return r(()=>r(e)),function(){t.forEach(o=>o());}}function je(e){let t,r=globalThis.requestAnimationFrame(()=>{t=e();});return ()=>{globalThis.cancelAnimationFrame(r),t?.();}}function j_(e,t,r){let n=je(()=>{e.removeEventListener(t,o,true),r();}),o=()=>{n(),r();};return e.addEventListener(t,o,{once:true,capture:true}),n}function z_(e,t){if(!e)return;let{attributes:r,callback:n}=t,o=e.ownerDocument.defaultView||window,i=new o.MutationObserver(a=>{for(let s of a)s.type==="attributes"&&s.attributeName&&r.includes(s.attributeName)&&n(s);});return i.observe(e,{attributes:true,attributeFilter:r}),()=>i.disconnect()}function $m(e,t){let n=je,o=[];return o.push(n(()=>{let i=typeof e=="function"?e():e;o.push(z_(i,t));})),()=>{o.forEach(i=>i?.());}}function Nm(e){let t=()=>e.click();L_()?j_(e,"keyup",t):queueMicrotask(t);}function ms(e){let t=A_(e);return __(t)?Dt(t).body:it(t)&&Lm(t)?t:ms(t)}var G_=/auto|scroll|overlay|hidden|clip/;function Lm(e){let t=ir(e),{overflow:r,overflowX:n,overflowY:o,display:i}=t.getComputedStyle(e);return G_.test(r+o+n)&&!["inline","contents"].includes(i)}function q_(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function Fm(e,t){let{rootEl:r,...n}=t||{};!e||!r||!Lm(r)||!q_(r)||e.scrollIntoView(n);}function Bm(e,t){return Array.from(e?.querySelectorAll(t)??[])}var Oc=e=>e.id;function Y_(e,t,r=Oc){return e.find(n=>r(n)===t)}function K_(e,t,r=Oc){let n=Y_(e,t,r);return n?e.indexOf(n):-1}var X_=e=>e.split("").map(t=>{let r=t.charCodeAt(0);return r>0&&r<128?t:r>=128&&r<=255?`/x${r.toString(16)}`.replace("/","\\"):""}).join("").trim(),Z_=e=>X_(e.dataset?.valuetext??e.textContent??""),Q_=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase());function J_(e,t,r,n=Oc){let o=r?K_(e,r,n):-1,i=r?x_(e,o):e;return t.length===1&&(i=i.filter(s=>n(s)!==r)),i.find(s=>Q_(Z_(s),t))}function Tn(e,t){if(!e)return Cm;let r=Object.keys(t).reduce((n,o)=>(n[o]=e.style.getPropertyValue(o),n),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,r),e.style.length===0&&e.removeAttribute("style");}}function Um(e,t,r){if(!e)return Cm;let n=e.style.getPropertyValue(t);return e.style.setProperty(t,r),()=>{e.style.setProperty(t,n),e.style.length===0&&e.removeAttribute("style");}}function eS(e,t){let{state:r,activeId:n,key:o,timeout:i=350,itemToId:a}=t,s=r.keysSoFar+o,u=s.length>1&&Array.from(s).every(b=>b===s[0])?s[0]:s,c=e.slice(),d=J_(c,u,n,a);function p(){clearTimeout(r.timer),r.timer=-1;}function f(b){r.keysSoFar=b,p(),b!==""&&(r.timer=+setTimeout(()=>{f(""),p();},i));}return f(s),d}var Rc=Object.assign(eS,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:tS});function tS(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var rS=1e3/60;function nS(e,t){let r=e();if(it(r)&&r.isConnected)return t(r),()=>{};{let n=setInterval(()=>{let o=e();it(o)&&o.isConnected&&(t(o),clearInterval(n));},rS);return ()=>clearInterval(n)}}function Vm(e,t){let r=[];return e?.forEach(n=>{let o=nS(n,t);r.push(o);}),()=>{r.forEach(n=>n());}}var oS=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),iS=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Hm=e=>{let t={},r;for(;r=iS.exec(e);)t[r[1]]=r[2];return t},aS=(e,t)=>{if(sn(e)){if(sn(t))return `${e};${t}`;e=Hm(e);}else sn(t)&&(t=Hm(t));return Object.assign({},e??{},t??{})};function gs(...e){let t={};for(let r of e){for(let n in t){if(n.startsWith("on")&&typeof t[n]=="function"&&typeof r[n]=="function"){t[n]=Ri(r[n],t[n]);continue}if(n==="className"||n==="class"){t[n]=oS(t[n],r[n]);continue}if(n==="style"){t[n]=aS(t[n],r[n]);continue}t[n]=r[n]!==void 0?r[n]:t[n];}for(let n in r)t[n]===void 0&&(t[n]=r[n]);}return t}function Wm(e,t,r){let n=[],o;return i=>{let a=e(i);return (a.length!==n.length||a.some((l,u)=>!Eo(n[u],l)))&&(n=a,o=t(...a),r?.onChange?.(o)),o}}function hs(){return {and:(...e)=>function(r){return e.every(n=>r.guard(n))},or:(...e)=>function(r){return e.some(n=>r.guard(n))},not:e=>function(r){return !r.guard(e)}}}var Cn=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Cn||{}),bs="__init__";function jm(e){let t=()=>e.getRootNode?.()??document,r=()=>Dt(t()),n=()=>r().defaultView??window,o=()=>fs(t());return {...e,getRootNode:t,getDoc:r,getWin:n,getActiveElement:o,isActiveElement:s=>s===o(),getById:s=>t().getElementById(s)}}function zm(e){return new Proxy({},{get(t,r){return r==="style"?n=>e({style:n}).style:e}})}var qt=()=>e=>Array.from(new Set(e));function ys(e){let t=e().value??e().defaultValue,r=e().isEqual??Object.is,[n,o]=R(t),i=L(()=>e().value!=null),a={current:n()},s={current:void 0};Ce(()=>{let c=i()?e().value:n();s.current=c,a.current=c;});let l=c=>{let d=s.current,p=zt(c)?c(a.current):c;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:p,prev:d}),i()||o(p),r(p,d)||e().onChange?.(p,d);};function u(){let c=i()?e().value:n;return zt(c)?c():c}return {initial:t,ref:a,get:u,set:l,invoke(c,d){e().onChange?.(c,d);},hash(c){return e().hash?.(c)??String(c)}}}ys.cleanup=e=>{ae(()=>e());};ys.ref=e=>{let t=e;return {get:()=>t,set:r=>{t=r;}}};function sS(e){let[t,r]=R(e);return {get(n){return t()[n]},set(n,o){r(i=>({...i,[n]:o}));}}}function Dc(e){return zt(e)?e():e}var lS=(e,t)=>{let r=[],n=true;Ce(()=>{if(n){r=e.map(i=>Dc(i)),n=false;return}let o=false;for(let i=0;i<e.length;i++)if(!Eo(r[i],Dc(e[i]))){o=true;break}o&&(r=e.map(i=>Dc(i)),t());});};function ar(e,t={}){let r=L(()=>{let{id:N,ids:_,getRootNode:A}=Mc(t);return jm({id:N,ids:_,getRootNode:A})}),n=(...N)=>{e.debug&&console.log(...N);},o=L(()=>e.props?.({props:wn(Mc(t)),scope:r()})??Mc(t)),i=cS(o),a=e.context?.({prop:i,bindable:ys,get scope(){return r()},flush:Gm,getContext(){return s},getComputed(){return h},getRefs(){return b}}),s={get(N){return a?.[N].get()},set(N,_){a?.[N].set(_);},initial(N){return a?.[N].initial},hash(N){let _=a?.[N].get();return a?.[N].hash(_)}},l={current:new Map},u={current:null},c={current:null},d={current:{type:""}},p=()=>be(d.current,{current(){return d.current},previous(){return c.current}}),f=()=>be(C,{matches(...N){let _=C.get();return N.includes(_)},hasTag(N){let _=C.get();return !!e.states[_]?.tags?.includes(N)}}),b=sS(e.refs?.({prop:i,context:s})??{}),g=()=>({state:f(),context:s,event:p(),prop:i,send:H,action:y,guard:T,track:lS,refs:b,computed:h,flush:Gm,get scope(){return r()},choose:E}),y=N=>{let _=zt(N)?N(g()):N;if(!_)return;let A=_.map(I=>{let k=e.implementations?.actions?.[I];return k||Io(`[zag-js] No implementation found for action "${JSON.stringify(I)}"`),k});for(let I of A)I?.(g());},T=N=>zt(N)?N(g()):e.implementations?.guards?.[N](g()),S=N=>{let _=zt(N)?N(g()):N;if(!_)return;let A=_.map(k=>{let O=e.implementations?.effects?.[k];return O||Io(`[zag-js] No implementation found for effect "${JSON.stringify(k)}"`),O}),I=[];for(let k of A){let O=k?.(g());O&&I.push(O);}return ()=>I.forEach(k=>k?.())},E=N=>um(N).find(_=>{let A=!_.guard;return sn(_.guard)?A=!!T(_.guard):zt(_.guard)&&(A=_.guard(g())),A}),h=N=>{vm(e.computed,()=>"[zag-js] No computed object found on machine");let _=e.computed[N];return _({context:s,event:d.current,prop:i,refs:b,scope:r(),computed:h})},C=ys(()=>({defaultValue:e.initialState({prop:i}),onChange(N,_){_&&(l.current.get(_)?.(),l.current.delete(_)),_&&y(e.states[_]?.exit),y(u.current?.actions);let A=S(e.states[N]?.effects);if(A&&l.current.set(N,A),_===bs){y(e.entry);let I=S(e.effects);I&&l.current.set(bs,I);}y(e.states[N]?.entry);}})),$=Cn.NotStarted;ie(()=>{let N=$===Cn.Started;$=Cn.Started,n(N?"rehydrating...":"initializing..."),C.invoke(C.initial,bs);}),ae(()=>{n("unmounting..."),$=Cn.Stopped,l.current.forEach(_=>_?.()),l.current=new Map,u.current=null,y(e.exit);});let H=N=>{if($!==Cn.Started)return;c.current=d.current,d.current=N,n("send",N);let _=C.get(),A=e.states[_].on?.[N.type]??e.on?.[N.type],I=E(A);if(!I)return;n("transition",I),u.current=I;let k=I.target??_,O=k!==_;O?C.set(k):I.reenter&&!O?C.invoke(_,_):y(I.actions);};return e.watch?.(g()),{state:f(),send:H,context:s,prop:i,get scope(){return r()},refs:b,computed:h,event:p(),getStatus:()=>$}}function Gm(e){e();}function Mc(e){return zt(e)?e():e}function cS(e){return function(r){return e()[r]}}function se(...e){let t={};for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="function"&&(n=n()),n){let o=Object.getOwnPropertyDescriptors(n);for(let i in o)i in t||Object.defineProperty(t,i,{enumerable:true,get(){let a={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let s=0;s<e.length;s++){let l=e[s];typeof l=="function"&&(l=l()),a=gs(a,{[i]:(l||{})[i]});}return a[i]}for(let s=e.length-1;s>=0;s--){let l,u=e[s];if(typeof u=="function"&&(u=u()),l=(u||{})[i],l!==void 0)return l}}});}}return t}var qm={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},uS=e=>e.startsWith("--")?e:hS(e);function dS(e){return e in qm?qm[e]:e}var sr=zm(e=>{let t={};for(let r in e){let n=e[r];if(!(r==="readOnly"&&n===false)){if(r==="style"&&hm(n)){t.style=fS(n);continue}if(r==="children"){sn(n)&&(t.textContent=n);continue}t[dS(r)]=n;}}return t});function fS(e){let t={};for(let r in e){let n=e[r];!sn(n)&&!Oi(n)||(t[uS(r)]=n);}return t}var pS=/[A-Z]/g,mS=/^ms-/;function gS(e){return "-"+e.toLowerCase()}var $c={};function hS(e){if($c.hasOwnProperty(e))return $c[e];var t=e.replace(pS,gS);return $c[e]=mS.test(t)?"-"+t:t}var Nc=e=>r=>{let[n,o]=Je(r,["asChild"]);if(n.asChild){let i=a=>{let[,s]=Je(o,["ref"]);return se(s,a)};return n.asChild(i)}return m(cf,be({component:e},o))};function bS(){let e=new Map;return new Proxy(Nc,{apply(t,r,n){return Nc(n[0])},get(t,r){let n=r;return e.has(n)||e.set(n,Nc(n)),e.get(n)}})}var he=bS();var yS=e=>typeof e=="function",kr=(e,...t)=>yS(e)?e(...t):e;function Ym(e,t){let{state:r,send:n,context:o}=e,i=r.matches("mounted","unmountSuspended");return {skip:!o.get("initial"),present:i,setNode(a){a&&n({type:"NODE.SET",node:a});},unmount(){n({type:"UNMOUNT"});}}}var Km={props({props:e}){return {...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return {node:null,styles:null}},context({bindable:e}){return {unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:false})),initial:e(()=>({sync:true,defaultValue:false}))}},exit:["clearInitial","cleanupNode"],watch({track:e,action:t,prop:r}){e([()=>r("present")],()=>{t(["setInitial","syncPresence"]);});},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",true);});},clearInitial:({context:e})=>{e.set("initial",false);},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null);},invokeOnExitComplete:({prop:e})=>{e("onExitComplete")?.();},setNode:({refs:e,event:t})=>{e.set("node",t.node);},setStyles:({refs:e,event:t})=>{e.set("styles",Oo(t.node));},syncPresence:({context:e,refs:t,send:r,prop:n})=>{let o=n("present");if(o)return r({type:"MOUNT",src:"presence.changed"});let i=t.get("node");if(!o&&i?.ownerDocument.visibilityState==="hidden")return r({type:"UNMOUNT",src:"visibilitychange"});je(()=>{let a=xs(t.get("styles"));e.set("unmountAnimationName",a),a==="none"||a===e.get("prevAnimationName")||t.get("styles")?.display==="none"||t.get("styles")?.animationDuration==="0s"?r({type:"UNMOUNT",src:"presence.changed"}):r({type:"UNMOUNT.SUSPEND"});});},setPrevAnimationName:({context:e,refs:t})=>{je(()=>{e.set("prevAnimationName",xs(t.get("styles")));});},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null);}},effects:{trackAnimationEvents:({context:e,refs:t,send:r})=>{let n=t.get("node");if(!n)return;let o=s=>{(s.composedPath?.()?.[0]??s.target)===n&&e.set("prevAnimationName",xs(t.get("styles")));},i=s=>{let l=xs(t.get("styles"));ht(s)===n&&l===e.get("unmountAnimationName")&&r({type:"UNMOUNT",src:"animationend"});};n.addEventListener("animationstart",o),n.addEventListener("animationcancel",i),n.addEventListener("animationend",i);let a=Tn(n,{animationFillMode:"forwards"});return ()=>{n.removeEventListener("animationstart",o),n.removeEventListener("animationcancel",i),n.removeEventListener("animationend",i),Mm(()=>a());}}}}};function xs(e){return e?.animationName||"none"}qt()(["onExitComplete","present","immediate"]);var Do=e=>gt()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]),_n=e=>{let[t,r]=Ai(kr(e)),[n,o]=R(false),i=ar(Km,e),a=L(()=>Ym(i));return Ce(()=>{a().present&&o(true);}),L(()=>({unmounted:!a().present&&!n()&&t.lazyMount||t.unmountOnExit&&!a().present&&n(),present:a().present,ref:a().setNode,presenceProps:{hidden:!a().present,"data-state":a().skip&&r.skipAnimationOnMount?void 0:r.present?"open":"closed"}}))};var[Mo,ln]=ot({hookName:"usePresenceContext",providerName:"<PresenceProvider />"});var[E$,cn]=ot({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:false,defaultValue:()=>({dir:"ltr",locale:"en-US"})});var[vS,Pr]=ot({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:false,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})}),wS=w("<span hidden>"),Sn=e=>{let[t,r]=R(),n=()=>kr(e.value)??t()?.getRootNode()??document,o=L(()=>({getRootNode:n,getDocument:()=>Dt(n()),getWindow:()=>ir(n())}));return m(vS,{value:o,get children(){return [L(()=>e.children),m(W,{get when(){return !e.value},get children(){var i=wS();return me(r,i),i}})]}})};var TS=Object.defineProperty,un=(e,t)=>{for(var r in t)TS(e,r,{get:t[r],enumerable:true});};var lr=(e,t=[])=>({parts:(...r)=>{if(CS(t))return lr(e,r);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...r)=>lr(e,[...t,...r]),rename:r=>lr(r,t),keys:()=>t,build:()=>[...new Set(t)].reduce((r,n)=>Object.assign(r,{[n]:{selector:[`&[data-scope="${$o(e)}"][data-part="${$o(n)}"]`,`& [data-scope="${$o(e)}"][data-part="${$o(n)}"]`].join(", "),attrs:{"data-scope":$o(e),"data-part":$o(n)}}}),{})}),$o=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),CS=e=>e.length===0;var Qm=["top","right","bottom","left"];var Er=Math.min,St=Math.max,Ni=Math.round,Li=Math.floor,cr=e=>({x:e,y:e}),_S={left:"right",right:"left",bottom:"top",top:"bottom"},SS={start:"end",end:"start"};function ws(e,t,r){return St(e,Er(t,r))}function Ir(e,t){return typeof e=="function"?e(t):e}function Ar(e){return e.split("-")[0]}function kn(e){return e.split("-")[1]}function Ts(e){return e==="x"?"y":"x"}function Cs(e){return e==="y"?"height":"width"}var kS=new Set(["top","bottom"]);function ur(e){return kS.has(Ar(e))?"y":"x"}function _s(e){return Ts(ur(e))}function Jm(e,t,r){r===void 0&&(r=false);let n=kn(e),o=_s(e),i=Cs(o),a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=$i(a)),[a,$i(a)]}function eg(e){let t=$i(e);return [vs(e),t,vs(t)]}function vs(e){return e.replace(/start|end/g,t=>SS[t])}var Xm=["left","right"],Zm=["right","left"],PS=["top","bottom"],ES=["bottom","top"];function IS(e,t,r){switch(e){case "top":case "bottom":return r?t?Zm:Xm:t?Xm:Zm;case "left":case "right":return t?PS:ES;default:return []}}function tg(e,t,r,n){let o=kn(e),i=IS(Ar(e),r==="start",n);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(vs)))),i}function $i(e){return e.replace(/left|right|bottom|top/g,t=>_S[t])}function AS(e){return {top:0,right:0,bottom:0,left:0,...e}}function Lc(e){return typeof e!="number"?AS(e):{top:e,right:e,bottom:e,left:e}}function Pn(e){let{x:t,y:r,width:n,height:o}=e;return {width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function rg(e,t,r){let{reference:n,floating:o}=e,i=ur(t),a=_s(t),s=Cs(a),l=Ar(t),u=i==="y",c=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,p=n[s]/2-o[s]/2,f;switch(l){case "top":f={x:c,y:n.y-o.height};break;case "bottom":f={x:c,y:n.y+n.height};break;case "right":f={x:n.x+n.width,y:d};break;case "left":f={x:n.x-o.width,y:d};break;default:f={x:n.x,y:n.y};}switch(kn(t)){case "start":f[a]-=p*(r&&u?-1:1);break;case "end":f[a]+=p*(r&&u?-1:1);break}return f}var ig=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t)),u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=rg(u,n,l),p=n,f={},b=0;for(let g=0;g<s.length;g++){let{name:y,fn:T}=s[g],{x:S,y:E,data:h,reset:C}=await T({x:c,y:d,initialPlacement:n,placement:p,strategy:o,middlewareData:f,rects:u,platform:a,elements:{reference:e,floating:t}});c=S??c,d=E??d,f={...f,[y]:{...f[y],...h}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(u=C.rects===true?await a.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:c,y:d}=rg(u,p,l)),g=-1);}return {x:c,y:d,placement:p,strategy:o,middlewareData:f}};async function No(e,t){var r;t===void 0&&(t={});let{x:n,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=false,padding:f=0}=Ir(t,e),b=Lc(f),y=s[p?d==="floating"?"reference":"floating":d],T=Pn(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(y)))==null||r?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),S=d==="floating"?{x:n,y:o,width:a.floating.width,height:a.floating.height}:a.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),h=await(i.isElement==null?void 0:i.isElement(E))?await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1}:{x:1,y:1},C=Pn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:S,offsetParent:E,strategy:l}):S);return {top:(T.top-C.top+b.top)/h.y,bottom:(C.bottom-T.bottom+b.bottom)/h.y,left:(T.left-C.left+b.left)/h.x,right:(C.right-T.right+b.right)/h.x}}var ag=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=Ir(e,t)||{};if(u==null)return {};let d=Lc(c),p={x:r,y:n},f=_s(o),b=Cs(f),g=await a.getDimensions(u),y=f==="y",T=y?"top":"left",S=y?"bottom":"right",E=y?"clientHeight":"clientWidth",h=i.reference[b]+i.reference[f]-p[f]-i.floating[b],C=p[f]-i.reference[f],$=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u)),H=$?$[E]:0;(!H||!await(a.isElement==null?void 0:a.isElement($)))&&(H=s.floating[E]||i.floating[b]);let N=h/2-C/2,_=H/2-g[b]/2-1,A=Er(d[T],_),I=Er(d[S],_),k=A,O=H-g[b]-I,D=H/2-g[b]/2+N,F=ws(k,D,O),j=!l.arrow&&kn(o)!=null&&D!==F&&i.reference[b]/2-(D<k?A:I)-g[b]/2<0,ne=j?D<k?D-k:D-O:0;return {[f]:p[f]+ne,data:{[f]:F,centerOffset:D-F-ne,...j&&{alignmentOffset:ne}},reset:j}}});var sg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;let{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=true,crossAxis:d=true,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:g=true,...y}=Ir(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return {};let T=Ar(o),S=ur(s),E=Ar(s)===s,h=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=p||(E||!g?[$i(s)]:eg(s)),$=b!=="none";!p&&$&&C.push(...tg(s,g,b,h));let H=[s,...C],N=await No(t,y),_=[],A=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&_.push(N[T]),d){let D=Jm(o,a,h);_.push(N[D[0]],N[D[1]]);}if(A=[...A,{placement:o,overflows:_}],!_.every(D=>D<=0)){var I,k;let D=(((I=i.flip)==null?void 0:I.index)||0)+1,F=H[D];if(F&&(!(d==="alignment"?S!==ur(F):false)||A.every(ve=>ur(ve.placement)===S?ve.overflows[0]>0:true)))return {data:{index:D,overflows:A},reset:{placement:F}};let j=(k=A.filter(ne=>ne.overflows[0]<=0).sort((ne,ve)=>ne.overflows[1]-ve.overflows[1])[0])==null?void 0:k.placement;if(!j)switch(f){case "bestFit":{var O;let ne=(O=A.filter(ve=>{if($){let fe=ur(ve.placement);return fe===S||fe==="y"}return true}).map(ve=>[ve.placement,ve.overflows.filter(fe=>fe>0).reduce((fe,Be)=>fe+Be,0)]).sort((ve,fe)=>ve[1]-fe[1])[0])==null?void 0:O[0];ne&&(j=ne);break}case "initialPlacement":j=s;break}if(o!==j)return {reset:{placement:j}}}return {}}}};function ng(e,t){return {top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function og(e){return Qm.some(t=>e[t]>=0)}var lg=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:n="referenceHidden",...o}=Ir(e,t);switch(n){case "referenceHidden":{let i=await No(t,{...o,elementContext:"reference"}),a=ng(i,r.reference);return {data:{referenceHiddenOffsets:a,referenceHidden:og(a)}}}case "escaped":{let i=await No(t,{...o,altBoundary:true}),a=ng(i,r.floating);return {data:{escapedOffsets:a,escaped:og(a)}}}default:return {}}}}};var cg=new Set(["left","top"]);async function OS(e,t){let{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),a=Ar(r),s=kn(r),l=ur(r)==="y",u=cg.has(a)?-1:1,c=i&&l?-1:1,d=Ir(t,e),{mainAxis:p,crossAxis:f,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof b=="number"&&(f=s==="end"?b*-1:b),l?{x:f*c,y:p*u}:{x:p*u,y:f*c}}var ug=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:o,y:i,placement:a,middlewareData:s}=t,l=await OS(t,e);return a===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},dg=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:o}=t,{mainAxis:i=true,crossAxis:a=false,limiter:s={fn:y=>{let{x:T,y:S}=y;return {x:T,y:S}}},...l}=Ir(e,t),u={x:r,y:n},c=await No(t,l),d=ur(Ar(o)),p=Ts(d),f=u[p],b=u[d];if(i){let y=p==="y"?"top":"left",T=p==="y"?"bottom":"right",S=f+c[y],E=f-c[T];f=ws(S,f,E);}if(a){let y=d==="y"?"top":"left",T=d==="y"?"bottom":"right",S=b+c[y],E=b-c[T];b=ws(S,b,E);}let g=s.fn({...t,[p]:f,[d]:b});return {...g,data:{x:g.x-r,y:g.y-n,enabled:{[p]:i,[d]:a}}}}}},fg=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:r,y:n,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=true,crossAxis:u=true}=Ir(e,t),c={x:r,y:n},d=ur(o),p=Ts(d),f=c[p],b=c[d],g=Ir(s,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){let E=p==="y"?"height":"width",h=i.reference[p]-i.floating[E]+y.mainAxis,C=i.reference[p]+i.reference[E]-y.mainAxis;f<h?f=h:f>C&&(f=C);}if(u){var T,S;let E=p==="y"?"width":"height",h=cg.has(Ar(o)),C=i.reference[d]-i.floating[E]+(h&&((T=a.offset)==null?void 0:T[d])||0)+(h?0:y.crossAxis),$=i.reference[d]+i.reference[E]+(h?0:((S=a.offset)==null?void 0:S[d])||0)-(h?y.crossAxis:0);b<C?b=C:b>$&&(b=$);}return {[p]:f,[d]:b}}}},pg=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;let{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...u}=Ir(e,t),c=await No(t,u),d=Ar(o),p=kn(o),f=ur(o)==="y",{width:b,height:g}=i.floating,y,T;d==="top"||d==="bottom"?(y=d,T=p===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(T=d,y=p==="end"?"top":"bottom");let S=g-c.top-c.bottom,E=b-c.left-c.right,h=Er(g-c[y],S),C=Er(b-c[T],E),$=!t.middlewareData.shift,H=h,N=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(N=E),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(H=S),$&&!p){let A=St(c.left,0),I=St(c.right,0),k=St(c.top,0),O=St(c.bottom,0);f?N=b-2*(A!==0||I!==0?A+I:St(c.left,c.right)):H=g-2*(k!==0||O!==0?k+O:St(c.top,c.bottom));}await l({...t,availableWidth:N,availableHeight:H});let _=await a.getDimensions(s.floating);return b!==_.width||g!==_.height?{reset:{rects:true}}:{}}}};function Ss(){return typeof window<"u"}function En(e){return gg(e)?(e.nodeName||"").toLowerCase():"#document"}function Mt(e){var t;return (e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dr(e){var t;return (t=(gg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gg(e){return Ss()?e instanceof Node||e instanceof Mt(e).Node:false}function Yt(e){return Ss()?e instanceof Element||e instanceof Mt(e).Element:false}function fr(e){return Ss()?e instanceof HTMLElement||e instanceof Mt(e).HTMLElement:false}function mg(e){return !Ss()||typeof ShadowRoot>"u"?false:e instanceof ShadowRoot||e instanceof Mt(e).ShadowRoot}var RS=new Set(["inline","contents"]);function Fo(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=Kt(e);return /auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!RS.has(o)}var DS=new Set(["table","td","th"]);function hg(e){return DS.has(En(e))}var MS=[":popover-open",":modal"];function Fi(e){return MS.some(t=>{try{return e.matches(t)}catch{return false}})}var $S=["transform","translate","scale","rotate","perspective"],NS=["transform","translate","scale","rotate","perspective","filter"],LS=["paint","layout","strict","content"];function ks(e){let t=Ps(),r=Yt(e)?Kt(e):e;return $S.some(n=>r[n]?r[n]!=="none":false)||(r.containerType?r.containerType!=="normal":false)||!t&&(r.backdropFilter?r.backdropFilter!=="none":false)||!t&&(r.filter?r.filter!=="none":false)||NS.some(n=>(r.willChange||"").includes(n))||LS.some(n=>(r.contain||"").includes(n))}function bg(e){let t=Hr(e);for(;fr(t)&&!In(t);){if(ks(t))return t;if(Fi(t))return null;t=Hr(t);}return null}function Ps(){return typeof CSS>"u"||!CSS.supports?false:CSS.supports("-webkit-backdrop-filter","none")}var FS=new Set(["html","body","#document"]);function In(e){return FS.has(En(e))}function Kt(e){return Mt(e).getComputedStyle(e)}function Bi(e){return Yt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hr(e){if(En(e)==="html")return e;let t=e.assignedSlot||e.parentNode||mg(e)&&e.host||dr(e);return mg(t)?t.host:t}function yg(e){let t=Hr(e);return In(t)?e.ownerDocument?e.ownerDocument.body:e.body:fr(t)&&Fo(t)?t:yg(t)}function Lo(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=true);let o=yg(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),a=Mt(o);if(i){let s=Es(a);return t.concat(a,a.visualViewport||[],Fo(o)?o:[],s&&r?Lo(s):[])}return t.concat(o,Lo(o,[],r))}function Es(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wg(e){let t=Kt(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=fr(e),i=o?e.offsetWidth:r,a=o?e.offsetHeight:n,s=Ni(r)!==i||Ni(n)!==a;return s&&(r=i,n=a),{width:r,height:n,$:s}}function Bc(e){return Yt(e)?e:e.contextElement}function Bo(e){let t=Bc(e);if(!fr(t))return cr(1);let r=t.getBoundingClientRect(),{width:n,height:o,$:i}=wg(t),a=(i?Ni(r.width):r.width)/n,s=(i?Ni(r.height):r.height)/o;return (!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var BS=cr(0);function Tg(e){let t=Mt(e);return !Ps()||!t.visualViewport?BS:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function US(e,t,r){return t===void 0&&(t=false),!r||t&&r!==Mt(e)?false:t}function An(e,t,r,n){t===void 0&&(t=false),r===void 0&&(r=false);let o=e.getBoundingClientRect(),i=Bc(e),a=cr(1);t&&(n?Yt(n)&&(a=Bo(n)):a=Bo(e));let s=US(i,r,n)?Tg(i):cr(0),l=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){let p=Mt(i),f=n&&Yt(n)?Mt(n):n,b=p,g=Es(b);for(;g&&n&&f!==b;){let y=Bo(g),T=g.getBoundingClientRect(),S=Kt(g),E=T.left+(g.clientLeft+parseFloat(S.paddingLeft))*y.x,h=T.top+(g.clientTop+parseFloat(S.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=E,u+=h,b=Mt(g),g=Es(b);}}return Pn({width:c,height:d,x:l,y:u})}function Uc(e,t){let r=Bi(e).scrollLeft;return t?t.left+r:An(dr(e)).left+r}function Cg(e,t,r){r===void 0&&(r=false);let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:Uc(e,n)),i=n.top+t.scrollTop;return {x:o,y:i}}function VS(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,i=o==="fixed",a=dr(n),s=t?Fi(t.floating):false;if(n===a||s&&i)return r;let l={scrollLeft:0,scrollTop:0},u=cr(1),c=cr(0),d=fr(n);if((d||!d&&!i)&&((En(n)!=="body"||Fo(a))&&(l=Bi(n)),fr(n))){let f=An(n);u=Bo(n),c.x=f.x+n.clientLeft,c.y=f.y+n.clientTop;}let p=a&&!d&&!i?Cg(a,l,true):cr(0);return {width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:r.y*u.y-l.scrollTop*u.y+c.y+p.y}}function HS(e){return Array.from(e.getClientRects())}function WS(e){let t=dr(e),r=Bi(e),n=e.ownerDocument.body,o=St(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=St(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),a=-r.scrollLeft+Uc(e),s=-r.scrollTop;return Kt(n).direction==="rtl"&&(a+=St(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:s}}function jS(e,t){let r=Mt(e),n=dr(e),o=r.visualViewport,i=n.clientWidth,a=n.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;let u=Ps();(!u||u&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop);}return {width:i,height:a,x:s,y:l}}function zS(e,t){let r=An(e,true,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=fr(e)?Bo(e):cr(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=o*i.x,u=n*i.y;return {width:a,height:s,x:l,y:u}}function xg(e,t,r){let n;if(t==="viewport")n=jS(e,r);else if(t==="document")n=WS(dr(e));else if(Yt(t))n=zS(t,r);else {let o=Tg(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height};}return Pn(n)}function _g(e,t){let r=Hr(e);return r===t||!Yt(r)||In(r)?false:Kt(r).position==="fixed"||_g(r,t)}function GS(e,t){let r=t.get(e);if(r)return r;let n=Lo(e,[],false).filter(s=>Yt(s)&&En(s)!=="body"),o=null,i=Kt(e).position==="fixed",a=i?Hr(e):e;for(;Yt(a)&&!In(a);){let s=Kt(a),l=ks(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Fo(a)&&!l&&_g(e,a))?n=n.filter(c=>c!==a):o=s,a=Hr(a);}return t.set(e,n),n}function qS(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,a=[...r==="clippingAncestors"?Fi(t)?[]:GS(t,this._c):[].concat(r),n],s=a[0],l=a.reduce((u,c)=>{let d=xg(t,c,o);return u.top=St(d.top,u.top),u.right=Er(d.right,u.right),u.bottom=Er(d.bottom,u.bottom),u.left=St(d.left,u.left),u},xg(t,s,o));return {width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function YS(e){let{width:t,height:r}=wg(e);return {width:t,height:r}}function KS(e,t,r){let n=fr(t),o=dr(t),i=r==="fixed",a=An(e,true,i,t),s={scrollLeft:0,scrollTop:0},l=cr(0);function u(){l.x=Uc(o);}if(n||!n&&!i)if((En(t)!=="body"||Fo(o))&&(s=Bi(t)),n){let f=An(t,true,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop;}else o&&u();i&&!n&&o&&u();let c=o&&!n&&!i?Cg(o,s):cr(0),d=a.left+s.scrollLeft-l.x-c.x,p=a.top+s.scrollTop-l.y-c.y;return {x:d,y:p,width:a.width,height:a.height}}function Fc(e){return Kt(e).position==="static"}function vg(e,t){if(!fr(e)||Kt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return dr(e)===r&&(r=r.ownerDocument.body),r}function Sg(e,t){let r=Mt(e);if(Fi(e))return r;if(!fr(e)){let o=Hr(e);for(;o&&!In(o);){if(Yt(o)&&!Fc(o))return o;o=Hr(o);}return r}let n=vg(e,t);for(;n&&hg(n)&&Fc(n);)n=vg(n,t);return n&&In(n)&&Fc(n)&&!ks(n)?r:n||bg(e)||r}var XS=async function(e){let t=this.getOffsetParent||Sg,r=this.getDimensions,n=await r(e.floating);return {reference:KS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ZS(e){return Kt(e).direction==="rtl"}var QS={convertOffsetParentRelativeRectToViewportRelativeRect:VS,getDocumentElement:dr,getClippingRect:qS,getOffsetParent:Sg,getElementRects:XS,getClientRects:HS,getDimensions:YS,getScale:Bo,isElement:Yt,isRTL:ZS};function kg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function JS(e,t){let r=null,n,o=dr(e);function i(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null;}function a(s,l){s===void 0&&(s=false),l===void 0&&(l=1),i();let u=e.getBoundingClientRect(),{left:c,top:d,width:p,height:f}=u;if(s||t(),!p||!f)return;let b=Li(d),g=Li(o.clientWidth-(c+p)),y=Li(o.clientHeight-(d+f)),T=Li(c),E={rootMargin:-b+"px "+-g+"px "+-y+"px "+-T+"px",threshold:St(0,Er(1,l))||1},h=true;function C($){let H=$[0].intersectionRatio;if(H!==l){if(!h)return a();H?a(false,H):n=setTimeout(()=>{a(false,1e-7);},1e3);}H===1&&!kg(u,e.getBoundingClientRect())&&a(),h=false;}try{r=new IntersectionObserver(C,{...E,root:o.ownerDocument});}catch{r=new IntersectionObserver(C,E);}r.observe(e);}return a(true),i}function Pg(e,t,r,n){n===void 0&&(n={});let{ancestorScroll:o=true,ancestorResize:i=true,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=false}=n,u=Bc(e),c=o||i?[...u?Lo(u):[],...Lo(t)]:[];c.forEach(T=>{o&&T.addEventListener("scroll",r,{passive:true}),i&&T.addEventListener("resize",r);});let d=u&&s?JS(u,r):null,p=-1,f=null;a&&(f=new ResizeObserver(T=>{let[S]=T;S&&S.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var E;(E=f)==null||E.observe(t);})),r();}),u&&!l&&f.observe(u),f.observe(t));let b,g=l?An(e):null;l&&y();function y(){let T=An(e);g&&!kg(g,T)&&r(),g=T,b=requestAnimationFrame(y);}return r(),()=>{var T;c.forEach(S=>{o&&S.removeEventListener("scroll",r),i&&S.removeEventListener("resize",r);}),d?.(),(T=f)==null||T.disconnect(),f=null,l&&cancelAnimationFrame(b);}}var Eg=ug;var Ig=dg,Ag=sg,Og=pg,Rg=lg,Dg=ag;var Mg=fg,$g=(e,t,r)=>{let n=new Map,o={platform:QS,...r},i={...o.platform,_c:n};return ig(e,t,{...o,platform:i})};function Ng(e=0,t=0,r=0,n=0){if(typeof DOMRect=="function")return new DOMRect(e,t,r,n);let o={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return {...o,toJSON:()=>o}}function ek(e){if(!e)return Ng();let{x:t,y:r,width:n,height:o}=e;return Ng(t,r,n,o)}function tk(e,t){return {contextElement:it(e)?e:void 0,getBoundingClientRect:()=>{let r=e,n=t?.(r);return n||!r?ek(n):r.getBoundingClientRect()}}}var Ui=e=>({variable:e,reference:`var(${e})`}),Wr={arrowSize:Ui("--arrow-size"),arrowSizeHalf:Ui("--arrow-size-half"),arrowBg:Ui("--arrow-background"),transformOrigin:Ui("--transform-origin"),arrowOffset:Ui("--arrow-offset")},rk=e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}),nk={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:r}){let{arrow:n}=r,o=rk(n)[e],{floating:i}=t;return i.style.setProperty(Wr.transformOrigin.variable,o),{data:{transformOrigin:o}}}},ok={name:"rects",fn({rects:e}){return {data:e}}},ik=e=>{if(e)return {name:"shiftArrow",fn({placement:t,middlewareData:r}){if(!r.arrow)return {};let{x:n,y:o}=r.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:n!=null?`${n}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${Wr.arrowOffset.reference})`}),{}}}};function ak(e){let[t,r]=e.split("-");return {side:t,align:r,hasAlign:r!=null}}function Fg(e){return e.split("-")[0]}var sk={strategy:"absolute",placement:"bottom",listeners:true,gutter:8,flip:true,slide:true,overlap:false,sameWidth:false,fitViewport:false,overflowPadding:8,arrowPadding:4};function Lg(e,t){let r=e.devicePixelRatio||1;return Math.round(t*r)/r}function Bg(e){return vn(e.boundary)}function lk(e,t){if(e)return Dg({element:e,padding:t.arrowPadding})}function ck(e,t){if(!bm(t.offset??t.gutter))return Eg(({placement:r})=>{let n=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+n:o??n,{hasAlign:a}=ak(r),s=a?void 0:t.shift,l=t.offset?.crossAxis??s;return wn({crossAxis:l,mainAxis:i,alignmentAxis:t.shift})})}function uk(e){if(e.flip)return Ag({boundary:Bg(e),padding:e.overflowPadding,fallbackPlacements:e.flip===true?void 0:e.flip})}function dk(e){if(!(!e.slide&&!e.overlap))return Ig({boundary:Bg(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Mg()})}function fk(e){return Og({padding:e.overflowPadding,apply({elements:t,rects:r,availableHeight:n,availableWidth:o}){let i=t.floating,a=Math.round(r.reference.width);o=Math.floor(o),n=Math.floor(n),i.style.setProperty("--reference-width",`${a}px`),i.style.setProperty("--available-width",`${o}px`),i.style.setProperty("--available-height",`${n}px`);}})}function pk(e){if(e.hideWhenDetached)return Rg({strategy:"referenceHidden",boundary:e.boundary?.()??"clippingAncestors"})}function mk(e){return e?e===true?{ancestorResize:true,ancestorScroll:true,elementResize:true,layoutShift:true}:e:{}}function gk(e,t,r={}){let n=tk(e,r.getAnchorRect);if(!t||!n)return;let o=Object.assign({},sk,r),i=t.querySelector("[data-part=arrow]"),a=[ck(i,o),uk(o),dk(o),lk(i,o),ik(i),nk,fk(o),pk(o),ok],{placement:s,strategy:l,onComplete:u,onPositioned:c}=o,d=async()=>{if(!n||!t)return;let g=await $g(n,t,{placement:s,middleware:a,strategy:l});u?.(g),c?.({placed:true});let y=ir(t),T=Lg(y,g.x),S=Lg(y,g.y);t.style.setProperty("--x",`${T}px`),t.style.setProperty("--y",`${S}px`),o.hideWhenDetached&&(g.middlewareData.hide?.referenceHidden?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));let E=t.firstElementChild;if(E){let h=Oo(E);t.style.setProperty("--z-index",h.zIndex);}},p=async()=>{r.updatePosition?(await r.updatePosition({updatePosition:d}),c?.({placed:true})):await d();},f=mk(o.listeners),b=o.listeners?Pg(n,t,p,f):ym;return p(),()=>{b?.(),c?.({placed:false});}}function Vc(e,t,r={}){let{defer:n,...o}=r,i=n?je:s=>s(),a=[];return a.push(i(()=>{let s=typeof e=="function"?e():e,l=typeof t=="function"?t():t;a.push(gk(s,l,o));})),()=>{a.forEach(s=>s?.());}}var hk={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function Ug(e={}){let{placement:t,sameWidth:r,fitViewport:n,strategy:o="absolute"}=e;return {arrow:{position:"absolute",width:Wr.arrowSize.reference,height:Wr.arrowSize.reference,[Wr.arrowSizeHalf.variable]:`calc(${Wr.arrowSize.reference} / 2)`,[Wr.arrowOffset.variable]:`calc(${Wr.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?hk[t.split("-")[0]]:void 0,background:Wr.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:r?void 0:"max-content",width:r?"var(--reference-width)":void 0,maxWidth:n?"var(--available-width)":void 0,maxHeight:n?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function bk(e){let t={each(r){for(let n=0;n<e.frames?.length;n+=1){let o=e.frames[n];o&&r(o);}},addEventListener(r,n,o){return t.each(i=>{try{i.document.addEventListener(r,n,o);}catch{}}),()=>{try{t.removeEventListener(r,n,o);}catch{}}},removeEventListener(r,n,o){t.each(i=>{try{i.document.removeEventListener(r,n,o);}catch{}});}};return t}function yk(e){let t=e.frameElement!=null?e.parent:null;return {addEventListener:(r,n,o)=>{try{t?.addEventListener(r,n,o);}catch{}return ()=>{try{t?.removeEventListener(r,n,o);}catch{}}},removeEventListener:(r,n,o)=>{try{t?.removeEventListener(r,n,o);}catch{}}}}var Vg="pointerdown.outside",Hg="focus.outside";function xk(e){for(let t of e)if(it(t)&&Sr(t))return true;return false}var zg=e=>"clientY"in e;function vk(e,t){if(!zg(t)||!e)return false;let r=e.getBoundingClientRect();return r.width===0||r.height===0?false:r.top<=t.clientY&&t.clientY<=r.top+r.height&&r.left<=t.clientX&&t.clientX<=r.left+r.width}function wk(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function Wg(e,t){if(!t||!zg(e))return false;let r=t.scrollHeight>t.clientHeight,n=r&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,i=o&&e.clientY>t.offsetTop+t.clientHeight,a={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(r?16:0),height:t.clientHeight+(o?16:0)},s={x:e.clientX,y:e.clientY};return wk(a,s)?n||i:false}function Tk(e,t){let{exclude:r,onFocusOutside:n,onPointerDownOutside:o,onInteractOutside:i,defer:a}=t;if(!e)return;let s=Dt(e),l=ir(e),u=bk(l),c=yk(l);function d(S,E){if(!it(E)||!E.isConnected||Gt(e,E)||vk(e,S))return false;let h=s.querySelector(`[aria-controls="${e.id}"]`);if(h){let $=ms(h);if(Wg(S,$))return false}let C=ms(e);return Wg(S,C)?false:!r?.(E)}let p=new Set,f=Ao(e?.getRootNode());function b(S){function E(h){let C=a&&!Cc()?je:N=>N(),$=h??S,H=$?.composedPath?.()??[$?.target];C(()=>{let N=f?H[0]:ht(S);if(!(!e||!d(S,N))){if(o||i){let _=Ri(o,i);e.addEventListener(Vg,_,{once:true});}jg(e,Vg,{bubbles:false,cancelable:true,detail:{originalEvent:$,contextmenu:ps($),focusable:xk(H),target:N}});}});}S.pointerType==="touch"?(p.forEach(h=>h()),p.add(pt(s,"click",E,{once:true})),p.add(c.addEventListener("click",E,{once:true})),p.add(u.addEventListener("click",E,{once:true}))):E();}let g=new Set,y=setTimeout(()=>{g.add(pt(s,"pointerdown",b,true)),g.add(c.addEventListener("pointerdown",b,true)),g.add(u.addEventListener("pointerdown",b,true));},0);function T(S){(a?je:h=>h())(()=>{let h=ht(S);if(!(!e||!d(S,h))){if(n||i){let C=Ri(n,i);e.addEventListener(Hg,C,{once:true});}jg(e,Hg,{bubbles:false,cancelable:true,detail:{originalEvent:S,contextmenu:false,focusable:Sr(h),target:h}});}});}return Cc()||(g.add(pt(s,"focusin",T,true)),g.add(c.addEventListener("focusin",T,true)),g.add(u.addEventListener("focusin",T,true))),()=>{clearTimeout(y),p.forEach(S=>S()),g.forEach(S=>S());}}function Gg(e,t){let{defer:r}=t,n=r?je:i=>i(),o=[];return o.push(n(()=>{let i=typeof e=="function"?e():e;o.push(Tk(i,t));})),()=>{o.forEach(i=>i?.());}}function jg(e,t,r){let n=e.ownerDocument.defaultView||window,o=new n.CustomEvent(t,r);return e.dispatchEvent(o)}function Ck(e,t){let r=n=>{n.key==="Escape"&&(n.isComposing||t?.(n));};return pt(Dt(e),"keydown",r,{capture:true})}var Lt={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return [...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){let t=this.indexOf(e),r=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<r},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(r=>Gt(r.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>Gt(t,e))},add(e){let t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`);},addBranch(e){this.branches.push(e);},remove(e){let t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(n=>n.dismiss()),this.layers.splice(t,1),e.style.removeProperty("--layer-index"));},removeBranch(e){let t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1);},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){this.layers[this.indexOf(e)]?.dismiss();},clear(){this.remove(this.layers[0].node);}},qg;function Yg(){Lt.layers.forEach(({node:e})=>{e.style.pointerEvents=Lt.isBelowPointerBlockingLayer(e)?"none":"auto";});}function _k(e){e.style.pointerEvents="";}function Sk(e,t){let r=Dt(e),n=[];if(Lt.hasPointerBlockingLayer()&&!r.body.hasAttribute("data-inert")&&(qg=document.body.style.pointerEvents,queueMicrotask(()=>{r.body.style.pointerEvents="none",r.body.setAttribute("data-inert","");})),t){let o=Vm(t,i=>{n.push(Tn(i,{pointerEvents:"auto"}));});n.push(o);}return ()=>{Lt.hasPointerBlockingLayer()||(queueMicrotask(()=>{r.body.style.pointerEvents=qg,r.body.removeAttribute("data-inert"),r.body.style.length===0&&r.body.removeAttribute("style");}),n.forEach(o=>o()));}}function kk(e,t){let{warnOnMissingNode:r=true}=t;if(r&&!e){Io("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;let{onDismiss:n,pointerBlocking:o,exclude:i,debug:a}=t,s={dismiss:n,node:e,pointerBlocking:o};Lt.add(s),Yg();function l(f){let b=ht(f.detail.originalEvent);Lt.isBelowPointerBlockingLayer(e)||Lt.isInBranch(b)||(t.onPointerDownOutside?.(f),t.onInteractOutside?.(f),!f.defaultPrevented&&(a&&console.log("onPointerDownOutside:",f.detail.originalEvent),n?.()));}function u(f){let b=ht(f.detail.originalEvent);Lt.isInBranch(b)||(t.onFocusOutside?.(f),t.onInteractOutside?.(f),!f.defaultPrevented&&(a&&console.log("onFocusOutside:",f.detail.originalEvent),n?.()));}function c(f){Lt.isTopMost(e)&&(t.onEscapeKeyDown?.(f),!f.defaultPrevented&&n&&(f.preventDefault(),n()));}function d(f){if(!e)return false;let b=typeof i=="function"?i():i,g=Array.isArray(b)?b:[b],y=t.persistentElements?.map(T=>T()).filter(it);return y&&g.push(...y),g.some(T=>Gt(T,f))||Lt.isInNestedLayer(e,f)}let p=[o?Sk(e,t.persistentElements):void 0,Ck(e,c),Gg(e,{exclude:d,onFocusOutside:u,onPointerDownOutside:l,defer:t.defer})];return ()=>{Lt.remove(e),Yg(),_k(e),p.forEach(f=>f?.());}}function Is(e,t){let{defer:r}=t,n=r?je:i=>i(),o=[];return o.push(n(()=>{let i=zt(e)?e():e;o.push(kk(i,t));})),()=>{o.forEach(i=>i?.());}}function Kg(e,t={}){let{defer:r}=t,n=r?je:i=>i(),o=[];return o.push(n(()=>{let i=zt(e)?e():e;if(!i){Io("[@zag-js/dismissable] branch node is `null` or `undefined`");return}Lt.addBranch(i),o.push(()=>{Lt.removeBranch(i);});})),()=>{o.forEach(i=>i?.());}}var Pk=Object.defineProperty,Ek=(e,t,r)=>t in e?Pk(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,et=(e,t,r)=>Ek(e,typeof t!="symbol"?t+"":t,r),Xg={activateTrap(e,t){if(e.length>0){let n=e[e.length-1];n!==t&&n.pause();}let r=e.indexOf(t);r===-1||e.splice(r,1),e.push(t);},deactivateTrap(e,t){let r=e.indexOf(t);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause();}},Ik=[],Ak=class{constructor(e,t){et(this,"trapStack"),et(this,"config"),et(this,"doc"),et(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:false,paused:false,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),et(this,"listenerCleanups",[]),et(this,"handleFocus",n=>{let o=ht(n),i=this.findContainerIndex(o,n)>=0;if(i||us(o))i&&(this.state.mostRecentlyFocusedNode=o);else {n.stopImmediatePropagation();let a,s=true;if(this.state.mostRecentlyFocusedNode)if(Ro(this.state.mostRecentlyFocusedNode)>0){let l=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:u}=this.state.containerGroups[l];if(u.length>0){let c=u.findIndex(d=>d===this.state.mostRecentlyFocusedNode);c>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?c+1<u.length&&(a=u[c+1],s=false):c-1>=0&&(a=u[c-1],s=false));}}else this.state.containerGroups.some(l=>l.tabbableNodes.some(u=>Ro(u)>0))||(s=false);else s=false;s&&(a=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),a?this.tryFocus(a):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode());}this.state.recentNavEvent=void 0;}),et(this,"handlePointerDown",n=>{let o=ht(n);if(!(this.findContainerIndex(o,n)>=0)){if(Hi(this.config.clickOutsideDeactivates,n)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}Hi(this.config.allowOutsideClick,n)||n.preventDefault();}}),et(this,"handleClick",n=>{let o=ht(n);this.findContainerIndex(o,n)>=0||Hi(this.config.clickOutsideDeactivates,n)||Hi(this.config.allowOutsideClick,n)||(n.preventDefault(),n.stopImmediatePropagation());}),et(this,"handleTabKey",n=>{if(this.config.isKeyForward(n)||this.config.isKeyBackward(n)){this.state.recentNavEvent=n;let o=this.config.isKeyBackward(n),i=this.findNextNavNode({event:n,isBackward:o});if(!i)return;Vi(n)&&n.preventDefault(),this.tryFocus(i);}}),et(this,"handleEscapeKey",n=>{Ok(n)&&Hi(this.config.escapeDeactivates,n)!==false&&(n.preventDefault(),this.deactivate());}),et(this,"_mutationObserver"),et(this,"setupMutationObserver",()=>{let n=this.doc.defaultView||window;this._mutationObserver=new n.MutationObserver(o=>{o.some(a=>Array.from(a.removedNodes).some(l=>l===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode());});}),et(this,"updateObservedNodes",()=>{this._mutationObserver?.disconnect(),this.state.active&&!this.state.paused&&this.state.containers.map(n=>{this._mutationObserver?.observe(n,{subtree:true,childList:true});});}),et(this,"getInitialFocusNode",()=>{let n=this.getNodeForOption("initialFocus",{hasFallback:true});if(n===false)return false;if(n===void 0||n&&!Sr(n))if(this.findContainerIndex(this.doc.activeElement)>=0)n=this.doc.activeElement;else {let o=this.state.tabbableGroups[0];n=o&&o.firstTabbableNode||this.getNodeForOption("fallbackFocus");}else n===null&&(n=this.getNodeForOption("fallbackFocus"));if(!n)throw new Error("Your focus-trap needs to have at least one focusable element");return n.isConnected||(n=this.getNodeForOption("fallbackFocus")),n}),et(this,"tryFocus",n=>{if(n!==false&&n!==fs(this.doc)){if(!n||!n.focus){this.tryFocus(this.getInitialFocusNode());return}n.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=n,Rk(n)&&n.select();}}),et(this,"deactivate",n=>{if(!this.state.active)return this;let o={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...n};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=false,this.state.paused=false,this.updateObservedNodes(),Xg.deactivateTrap(this.trapStack,this);let i=this.getOption(o,"onDeactivate"),a=this.getOption(o,"onPostDeactivate"),s=this.getOption(o,"checkCanReturnFocus"),l=this.getOption(o,"returnFocus","returnFocusOnDeactivate");i?.();let u=()=>{Zg(()=>{if(l){let c=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(c);}a?.();});};if(l&&s){let c=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return s(c).then(u,u),this}return u(),this}),et(this,"pause",n=>{if(this.state.paused||!this.state.active)return this;let o=this.getOption(n,"onPause"),i=this.getOption(n,"onPostPause");return this.state.paused=true,o?.(),this.removeListeners(),this.updateObservedNodes(),i?.(),this}),et(this,"unpause",n=>{if(!this.state.paused||!this.state.active)return this;let o=this.getOption(n,"onUnpause"),i=this.getOption(n,"onPostUnpause");return this.state.paused=false,o?.(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),i?.(),this}),et(this,"updateContainerElements",n=>(this.state.containers=Array.isArray(n)?n.filter(Boolean):[n].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),et(this,"getReturnFocusNode",n=>{let o=this.getNodeForOption("setReturnFocus",{params:[n]});return o||(o===false?false:n)}),et(this,"getOption",(n,o,i)=>n&&n[o]!==void 0?n[o]:this.config[i||o]),et(this,"getNodeForOption",(n,{hasFallback:o=false,params:i=[]}={})=>{let a=this.config[n];if(typeof a=="function"&&(a=a(...i)),a===true&&(a=void 0),!a){if(a===void 0||a===false)return a;throw new Error(`\`${n}\` was specified but was not a node, or did not return a node`)}let s=a;if(typeof a=="string"){try{s=this.doc.querySelector(a);}catch(l){throw new Error(`\`${n}\` appears to be an invalid selector; error="${l.message}"`)}if(!s&&!o)throw new Error(`\`${n}\` as selector refers to no known node`)}return s}),et(this,"findNextNavNode",n=>{let{event:o,isBackward:i=false}=n,a=n.target||ht(o);this.updateTabbableNodes();let s=null;if(this.state.tabbableGroups.length>0){let l=this.findContainerIndex(a,o),u=l>=0?this.state.containerGroups[l]:void 0;if(l<0)i?s=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:s=this.state.tabbableGroups[0].firstTabbableNode;else if(i){let c=this.state.tabbableGroups.findIndex(({firstTabbableNode:d})=>a===d);if(c<0&&(u?.container===a||Sr(a)&&!Vr(a)&&!u?.nextTabbableNode(a,false))&&(c=l),c>=0){let d=c===0?this.state.tabbableGroups.length-1:c-1,p=this.state.tabbableGroups[d];s=Ro(a)>=0?p.lastTabbableNode:p.lastDomTabbableNode;}else Vi(o)||(s=u?.nextTabbableNode(a,false));}else {let c=this.state.tabbableGroups.findIndex(({lastTabbableNode:d})=>a===d);if(c<0&&(u?.container===a||Sr(a)&&!Vr(a)&&!u?.nextTabbableNode(a))&&(c=l),c>=0){let d=c===this.state.tabbableGroups.length-1?0:c+1,p=this.state.tabbableGroups[d];s=Ro(a)>=0?p.firstTabbableNode:p.firstDomTabbableNode;}else Vi(o)||(s=u?.nextTabbableNode(a));}}else s=this.getNodeForOption("fallbackFocus");return s}),this.trapStack=t.trapStack||Ik;let r={returnFocusOnDeactivate:true,escapeDeactivates:true,delayInitialFocus:true,isKeyForward(n){return Vi(n)&&!n.shiftKey},isKeyBackward(n){return Vi(n)&&n.shiftKey},...t};this.doc=r.document||Dt(Array.isArray(e)?e[0]:e),this.config=r,this.updateContainerElements(e),this.setupMutationObserver();}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){let r=typeof t?.composedPath=="function"?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:n,tabbableNodes:o})=>n.contains(e)||r?.includes(n)||o.find(i=>i===e))}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{let t=Mi(e),r=Ac(e),n=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,i=r.find(u=>Vr(u)),a=r.slice().reverse().find(u=>Vr(u)),s=!!t.find(u=>Ro(u)>0);function l(u,c=true){let d=t.indexOf(u);return d<0?c?r.slice(r.indexOf(u)+1).find(p=>Vr(p)):r.slice(0,r.indexOf(u)).reverse().find(p=>Vr(p)):t[d+(c?1:-1)]}return {container:e,tabbableNodes:t,focusableNodes:r,posTabIndexesFound:s,firstTabbableNode:n,lastTabbableNode:o,firstDomTabbableNode:i,lastDomTabbableNode:a,nextTabbableNode:l}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return Xg.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?Zg(()=>{this.tryFocus(this.getInitialFocusNode());}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(pt(this.doc,"focusin",this.handleFocus,true),pt(this.doc,"mousedown",this.handlePointerDown,{capture:true,passive:false}),pt(this.doc,"touchstart",this.handlePointerDown,{capture:true,passive:false}),pt(this.doc,"click",this.handleClick,{capture:true,passive:false}),pt(this.doc,"keydown",this.handleTabKey,{capture:true,passive:false}),pt(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;let t=this.getOption(e,"onActivate"),r=this.getOption(e,"onPostActivate"),n=this.getOption(e,"checkCanFocusTrap");n||this.updateTabbableNodes(),this.state.active=true,this.state.paused=false,this.state.nodeFocusedBeforeActivation=this.doc.activeElement||null,t?.();let o=()=>{n&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),r?.();};return n?(n(this.state.containers.concat()).then(o,o),this):(o(),this)}},Vi=e=>e.key==="Tab",Hi=(e,...t)=>typeof e=="function"?e(...t):e,Ok=e=>!e.isComposing&&e.key==="Escape",Zg=e=>setTimeout(e,0),Rk=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function Qg(e,t={}){let r,n=je(()=>{let o=typeof e=="function"?e():e;if(o){r=new Ak(o,{escapeDeactivates:false,allowOutsideClick:true,preventScroll:true,returnFocusOnDeactivate:true,delayInitialFocus:false,fallbackFocus:o,...t,document:Dt(o)});try{r.activate();}catch{}}});return function(){r?.deactivate(),n();}}var ah=lr("toast").parts("group","root","title","description","actionTrigger","closeTrigger"),Uo=ah.build(),Dk=e=>`toast-group:${e}`,Jg=(e,t)=>e.getById(`toast-group:${t}`),sh=e=>`toast:${e.id}`,eh=e=>e.getById(sh(e)),th=e=>`toast:${e.id}:title`,rh=e=>`toast:${e.id}:description`,Mk=e=>`toast${e.id}:close`,nh={info:5e3,error:5e3,success:2e3,loading:1/0,DEFAULT:5e3};function Hc(e,t){return e??nh[t]??nh.DEFAULT}var $k=e=>typeof e=="string"?{left:e,right:e,bottom:e,top:e}:e;function Nk(e,t){let{prop:r,computed:n,context:o}=e,{offsets:i,gap:a}=r("store").attrs,s=o.get("heights"),l=$k(i),u=r("dir")==="rtl",c=t.replace("-start",u?"-right":"-left").replace("-end",u?"-left":"-right"),d=c.includes("right"),p=c.includes("left"),f={position:"fixed",pointerEvents:n("count")>0?void 0:"none",display:"flex",flexDirection:"column","--gap":`${a}px`,"--first-height":`${s[0]?.height||0}px`,zIndex:_m},b="center";if(d&&(b="flex-end"),p&&(b="flex-start"),f.alignItems=b,c.includes("top")){let g=l.top;f.top=`max(env(safe-area-inset-top, 0px), ${g})`;}if(c.includes("bottom")){let g=l.bottom;f.bottom=`max(env(safe-area-inset-bottom, 0px), ${g})`;}if(!c.includes("left")){let g=l.right;f.insetInlineEnd=`calc(env(safe-area-inset-right, 0px) + ${g})`;}if(!c.includes("right")){let g=l.left;f.insetInlineStart=`calc(env(safe-area-inset-left, 0px) + ${g})`;}return f}function Lk(e,t){let{prop:r,context:n,computed:o}=e,i=r("parent"),a=i.computed("placement"),{gap:s}=i.prop("store").attrs,[l]=a.split("-"),u=n.get("mounted"),c=n.get("remainingTime"),d=o("height"),p=o("frontmost"),f=!p,b=!r("stacked"),g=r("stacked"),T=r("type")==="loading"?Number.MAX_SAFE_INTEGER:c,S=o("heightIndex")*s+o("heightBefore"),E={position:"absolute",pointerEvents:"auto","--opacity":"0","--remove-delay":`${r("removeDelay")}ms`,"--duration":`${T}ms`,"--initial-height":`${d}px`,"--offset":`${S}px`,"--index":r("index"),"--z-index":o("zIndex"),"--lift-amount":"calc(var(--lift) * var(--gap))","--y":"100%","--x":"0"},h=C=>Object.assign(E,C);return l==="top"?h({top:"0","--sign":"-1","--y":"-100%","--lift":"1"}):l==="bottom"&&h({bottom:"0","--sign":"1","--y":"100%","--lift":"-1"}),u&&(h({"--y":"0","--opacity":"1"}),g&&h({"--y":"calc(var(--lift) * var(--offset))","--height":"var(--initial-height)"})),t||h({"--opacity":"0",pointerEvents:"none"}),f&&b&&(h({"--base-scale":"var(--index) * 0.05 + 1","--y":"calc(var(--lift-amount) * var(--index))","--scale":"calc(-1 * var(--base-scale))","--height":"var(--first-height)"}),t||h({"--y":"calc(var(--sign) * 40%)"})),f&&g&&!t&&h({"--y":"calc(var(--lift) * var(--offset) + var(--lift) * -100%)"}),p&&!t&&h({"--y":"calc(var(--lift) * -100%)"}),E}function Fk(e,t){let{computed:r}=e,n={position:"absolute",inset:"0",scale:"1 2",pointerEvents:t?"none":"auto"},o=i=>Object.assign(n,i);return r("frontmost")&&!t&&o({height:"calc(var(--initial-height) + 80%)"}),n}function Bk(){return {position:"absolute",left:"0",height:"calc(var(--gap) + 2px)",bottom:"100%",width:"100%"}}function Uk(e,t){let{context:r,prop:n,send:o,refs:i,computed:a}=e;return {getCount(){return r.get("toasts").length},getToasts(){return r.get("toasts")},getGroupProps(s={}){let{label:l="Notifications"}=s,{hotkey:u}=n("store").attrs,c=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),d=a("placement"),[p,f="center"]=d.split("-");return t.element({...Uo.group.attrs,dir:n("dir"),tabIndex:-1,"aria-label":`${d} ${l} ${c}`,id:Dk(d),"data-placement":d,"data-side":p,"data-align":f,"aria-live":"polite",role:"region",style:Nk(e,d),onMouseMove(){o({type:"REGION.POINTER_ENTER",placement:d});},onMouseLeave(){o({type:"REGION.POINTER_LEAVE",placement:d});},onFocus(b){o({type:"REGION.FOCUS",target:b.relatedTarget});},onBlur(b){i.get("isFocusWithin")&&!Gt(b.currentTarget,b.relatedTarget)&&queueMicrotask(()=>o({type:"REGION.BLUR"}));}})},subscribe(s){return n("store").subscribe(()=>s(r.get("toasts")))}}}var Vk={props({props:e}){return {dir:"ltr",id:xc(),...e,store:e.store}},initialState({prop:e}){return e("store").attrs.overlap?"overlap":"stack"},refs(){return {lastFocusedEl:null,isFocusWithin:false,dismissableCleanup:void 0}},context({bindable:e}){return {toasts:e(()=>({defaultValue:[],sync:true,hash:t=>t.map(r=>r.id).join(",")})),heights:e(()=>({defaultValue:[],sync:true}))}},computed:{count:({context:e})=>e.get("toasts").length,overlap:({prop:e})=>e("store").attrs.overlap,placement:({prop:e})=>e("store").attrs.placement},effects:["subscribeToStore","trackDocumentVisibility","trackHotKeyPress"],watch({track:e,context:t,action:r}){e([()=>t.hash("toasts")],()=>{queueMicrotask(()=>{r(["collapsedIfEmpty","setDismissableBranch"]);});});},exit:["clearDismissableBranch","clearLastFocusedEl"],on:{"DOC.HOTKEY":{actions:["focusRegionEl"]},"REGION.BLUR":[{guard:"isOverlapping",target:"overlap",actions:["collapseToasts","resumeToasts","restoreLastFocusedEl"]},{target:"stack",actions:["resumeToasts","restoreLastFocusedEl"]}],"TOAST.REMOVE":{actions:["removeToast","removeHeight"]},"TOAST.PAUSE":{actions:["pauseToasts"]}},states:{stack:{on:{"REGION.POINTER_LEAVE":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts","collapseToasts"]},{actions:["resumeToasts"]}],"REGION.OVERLAP":{target:"overlap",actions:["collapseToasts"]},"REGION.FOCUS":{actions:["setLastFocusedEl","pauseToasts"]},"REGION.POINTER_ENTER":{actions:["pauseToasts"]}}},overlap:{on:{"REGION.STACK":{target:"stack",actions:["expandToasts"]},"REGION.POINTER_ENTER":{target:"stack",actions:["pauseToasts","expandToasts"]},"REGION.FOCUS":{target:"stack",actions:["setLastFocusedEl","pauseToasts","expandToasts"]}}}},implementations:{guards:{isOverlapping:({computed:e})=>e("overlap")},effects:{subscribeToStore({context:e,prop:t}){return t("store").subscribe(r=>{if(r.dismiss){e.set("toasts",n=>n.filter(o=>o.id!==r.id));return}e.set("toasts",n=>{let o=n.findIndex(i=>i.id===r.id);return o!==-1?[...n.slice(0,o),{...n[o],...r},...n.slice(o+1)]:[r,...n]});})},trackHotKeyPress({prop:e,send:t}){return pt(document,"keydown",n=>{let{hotkey:o}=e("store").attrs;o.every(a=>n[a]||n.code===a)&&t({type:"DOC.HOTKEY"});},{capture:true})},trackDocumentVisibility({prop:e,send:t,scope:r}){let{pauseOnPageIdle:n}=e("store").attrs;if(!n)return;let o=r.getDoc();return pt(o,"visibilitychange",()=>{let i=o.visibilityState==="hidden";t({type:i?"PAUSE_ALL":"RESUME_ALL"});})}},actions:{setDismissableBranch({refs:e,context:t,computed:r,scope:n}){let o=t.get("toasts"),i=r("placement"),a=o.length>0;if(!a){e.get("dismissableCleanup")?.();return}if(a&&e.get("dismissableCleanup"))return;let l=Kg(()=>Jg(n,i),{defer:true});e.set("dismissableCleanup",l);},clearDismissableBranch({refs:e}){e.get("dismissableCleanup")?.();},focusRegionEl({scope:e,computed:t}){queueMicrotask(()=>{Jg(e,t("placement"))?.focus();});},pauseToasts({prop:e}){e("store").pause();},resumeToasts({prop:e}){e("store").resume();},expandToasts({prop:e}){e("store").expand();},collapseToasts({prop:e}){e("store").collapse();},removeToast({prop:e,event:t}){e("store").remove(t.id);},removeHeight({event:e,context:t}){e?.id!=null&&queueMicrotask(()=>{t.set("heights",r=>r.filter(n=>n.id!==e.id));});},collapsedIfEmpty({send:e,computed:t}){!t("overlap")||t("count")>1||e({type:"REGION.OVERLAP"});},setLastFocusedEl({refs:e,event:t}){e.get("isFocusWithin")||!t.target||(e.set("isFocusWithin",true),e.set("lastFocusedEl",t.target));},restoreLastFocusedEl({refs:e}){e.get("lastFocusedEl")&&(e.get("lastFocusedEl")?.focus({preventScroll:true}),e.set("lastFocusedEl",null),e.set("isFocusWithin",false));},clearLastFocusedEl({refs:e}){e.get("lastFocusedEl")&&(e.get("lastFocusedEl")?.focus({preventScroll:true}),e.set("lastFocusedEl",null),e.set("isFocusWithin",false));}}}};function lh(e,t){let{state:r,send:n,prop:o,scope:i,context:a,computed:s}=e,l=r.hasTag("visible"),u=r.hasTag("paused"),c=a.get("mounted"),d=s("frontmost"),p=o("parent").computed("placement"),f=o("type"),b=o("stacked"),g=o("title"),y=o("description"),T=o("action"),[S,E="center"]=p.split("-");return {type:f,title:g,description:y,placement:p,visible:l,paused:u,closable:!!o("closable"),pause(){n({type:"PAUSE"});},resume(){n({type:"RESUME"});},dismiss(){n({type:"DISMISS",src:"programmatic"});},getRootProps(){return t.element({...Uo.root.attrs,dir:o("dir"),id:sh(i),"data-state":l?"open":"closed","data-type":f,"data-placement":p,"data-align":E,"data-side":S,"data-mounted":Rt(c),"data-paused":Rt(u),"data-first":Rt(d),"data-sibling":Rt(!d),"data-stack":Rt(b),"data-overlap":Rt(!b),role:"status","aria-atomic":"true","aria-describedby":y?rh(i):void 0,"aria-labelledby":g?th(i):void 0,tabIndex:0,style:Lk(e,l),onKeyDown(h){h.defaultPrevented||h.key=="Escape"&&(n({type:"DISMISS",src:"keyboard"}),h.preventDefault());}})},getGhostBeforeProps(){return t.element({"data-ghost":"before",style:Fk(e,l)})},getGhostAfterProps(){return t.element({"data-ghost":"after",style:Bk()})},getTitleProps(){return t.element({...Uo.title.attrs,id:th(i)})},getDescriptionProps(){return t.element({...Uo.description.attrs,id:rh(i)})},getActionTriggerProps(){return t.button({...Uo.actionTrigger.attrs,type:"button",onClick(h){h.defaultPrevented||(T?.onClick?.(),n({type:"DISMISS",src:"user"}));}})},getCloseTriggerProps(){return t.button({id:Mk(i),...Uo.closeTrigger.attrs,type:"button","aria-label":"Dismiss notification",onClick(h){h.defaultPrevented||n({type:"DISMISS",src:"user"});}})}}}var{not:Hk}=hs(),ch={props({props:e}){return wm(e,["id","type","parent","removeDelay"],"toast"),{closable:true,...e,duration:Hc(e.duration,e.type)}},initialState({prop:e}){return e("type")==="loading"||e("duration")===1/0?"visible:persist":"visible"},context({prop:e,bindable:t}){return {remainingTime:t(()=>({defaultValue:Hc(e("duration"),e("type"))})),createdAt:t(()=>({defaultValue:Date.now()})),mounted:t(()=>({defaultValue:false})),initialHeight:t(()=>({defaultValue:0}))}},refs(){return {closeTimerStartTime:Date.now(),lastCloseStartTimerStartTime:0}},computed:{zIndex:({prop:e})=>{let t=e("parent").context.get("toasts"),r=t.findIndex(n=>n.id===e("id"));return t.length-r},height:({prop:e})=>e("parent").context.get("heights").find(n=>n.id===e("id"))?.height??0,heightIndex:({prop:e})=>e("parent").context.get("heights").findIndex(r=>r.id===e("id")),frontmost:({prop:e})=>e("index")===0,heightBefore:({prop:e})=>{let t=e("parent").context.get("heights"),r=t.findIndex(n=>n.id===e("id"));return t.reduce((n,o,i)=>i>=r?n:n+o.height,0)},shouldPersist:({prop:e})=>e("type")==="loading"||e("duration")===1/0},watch({track:e,prop:t,send:r}){e([()=>t("message")],()=>{let n=t("message");n&&r({type:n,src:"programmatic"});}),e([()=>t("type"),()=>t("duration")],()=>{r({type:"UPDATE"});});},on:{UPDATE:[{guard:"shouldPersist",target:"visible:persist",actions:["resetCloseTimer"]},{target:"visible:updating",actions:["resetCloseTimer"]}],MEASURE:{actions:["measureHeight"]}},entry:["setMounted","measureHeight","invokeOnVisible"],effects:["trackHeight"],states:{"visible:updating":{tags:["visible","updating"],effects:["waitForNextTick"],on:{SHOW:{target:"visible"}}},"visible:persist":{tags:["visible","paused"],on:{RESUME:{guard:Hk("isLoadingType"),target:"visible",actions:["setCloseTimer"]},DISMISS:{target:"dismissing"}}},visible:{tags:["visible"],effects:["waitForDuration"],on:{DISMISS:{target:"dismissing"},PAUSE:{target:"visible:persist",actions:["syncRemainingTime"]}}},dismissing:{entry:["invokeOnDismiss"],effects:["waitForRemoveDelay"],on:{REMOVE:{target:"unmounted",actions:["notifyParentToRemove"]}}},unmounted:{entry:["invokeOnUnmount"]}},implementations:{effects:{waitForRemoveDelay({prop:e,send:t}){return ls(()=>{t({type:"REMOVE",src:"timer"});},e("removeDelay"))},waitForDuration({send:e,context:t,computed:r}){if(!r("shouldPersist"))return ls(()=>{e({type:"DISMISS",src:"timer"});},t.get("remainingTime"))},waitForNextTick({send:e}){return ls(()=>{e({type:"SHOW",src:"timer"});},0)},trackHeight({scope:e,prop:t}){let r;return je(()=>{let n=eh(e);if(!n)return;let o=()=>{let s=n.style.height;n.style.height="auto";let l=n.getBoundingClientRect().height;n.style.height=s;let u={id:t("id"),height:l};oh(t("parent"),u);},i=e.getWin(),a=new i.MutationObserver(o);a.observe(n,{childList:true,subtree:true,characterData:true}),r=()=>a.disconnect();}),()=>r?.()}},guards:{isLoadingType:({prop:e})=>e("type")==="loading",shouldPersist:({computed:e})=>e("shouldPersist")},actions:{setMounted({context:e}){je(()=>{e.set("mounted",true);});},measureHeight({scope:e,prop:t,context:r}){queueMicrotask(()=>{let n=eh(e);if(!n)return;let o=n.style.height;n.style.height="auto";let i=n.getBoundingClientRect().height;n.style.height=o,r.set("initialHeight",i);let a={id:t("id"),height:i};oh(t("parent"),a);});},setCloseTimer({refs:e}){e.set("closeTimerStartTime",Date.now());},resetCloseTimer({context:e,refs:t,prop:r}){t.set("closeTimerStartTime",Date.now()),e.set("remainingTime",Hc(r("duration"),r("type")));},syncRemainingTime({context:e,refs:t}){e.set("remainingTime",r=>{let n=t.get("closeTimerStartTime"),o=Date.now()-n;return t.set("lastCloseStartTimerStartTime",Date.now()),r-o});},notifyParentToRemove({prop:e}){e("parent").send({type:"TOAST.REMOVE",id:e("id")});},invokeOnDismiss({prop:e,event:t}){e("onStatusChange")?.({status:"dismissing",src:t.src});},invokeOnUnmount({prop:e}){e("onStatusChange")?.({status:"unmounted"});},invokeOnVisible({prop:e}){e("onStatusChange")?.({status:"visible"});}}}};function oh(e,t){let{id:r,height:n}=t;e.context.set("heights",o=>o.find(a=>a.id===r)?o.map(a=>a.id===r?{...a,height:n}:a):[{id:r,height:n},...o]);}var Wk=(e,t)=>({...t,...wn(e)});function uh(e){let t=Wk(e,{placement:"bottom",overlap:false,max:24,gap:16,offsets:"1rem",hotkey:["altKey","KeyT"],removeDelay:200,pauseOnPageIdle:true}),r=[],n=[],o=new Set,i=[],a=k=>(r.push(k),()=>{let O=r.indexOf(k);r.splice(O,1);}),s=k=>(r.forEach(O=>O(k)),k),l=k=>{if(n.length>=t.max){i.push(k);return}s(k),n.unshift(k);},u=()=>{for(;i.length>0&&n.length<t.max;){let k=i.shift();k&&(s(k),n.unshift(k));}},c=k=>{let O=k.id??`toast:${xc()}`,D=n.find(F=>F.id===O);return o.has(O)&&o.delete(O),D?n=n.map(F=>F.id===O?s({...F,...k,id:O}):F):l({id:O,duration:t.duration,removeDelay:t.removeDelay,type:"info",...k,stacked:!t.overlap,gap:t.gap}),O},d=k=>(o.add(k),k?(r.forEach(O=>O({id:k,dismiss:true})),n=n.filter(O=>O.id!==k),u()):(n.forEach(O=>{r.forEach(D=>D({id:O.id,dismiss:true}));}),n=[],i=[]),k);return {attrs:t,subscribe:a,create:c,update:(k,O)=>c({id:k,...O}),remove:d,dismiss:k=>{k!=null?n=n.map(O=>O.id===k?s({...O,message:"DISMISS"}):O):n=n.map(O=>s({...O,message:"DISMISS"}));},error:k=>c({...k,type:"error"}),success:k=>c({...k,type:"success"}),info:k=>c({...k,type:"info"}),warning:k=>c({...k,type:"warning"}),loading:k=>c({...k,type:"loading"}),getVisibleToasts:()=>n.filter(k=>!o.has(k.id)),getCount:()=>n.length,promise:(k,O,D={})=>{if(!O)return;let F;O.loading!==void 0&&(F=c({...D,...O.loading,promise:k,type:"loading"}));let j=F!==void 0,ne,ve=vn(k).then(async Be=>{if(ne=["resolve",Be],jk(Be)&&!Be.ok){j=false;let pe=vn(O.error,`HTTP Error! status: ${Be.status}`);c({...D,...pe,id:F,type:"error"});}else if(O.success!==void 0){j=false;let pe=vn(O.success,Be);c({...D,...pe,id:F,type:"success"});}}).catch(async Be=>{if(ne=["reject",Be],O.error!==void 0){j=false;let pe=vn(O.error,Be);c({...D,...pe,id:F,type:"error"});}}).finally(()=>{j&&(d(F),F=void 0),O.finally?.();});return {id:F,unwrap:()=>new Promise((Be,pe)=>ve.then(()=>ne[0]==="reject"?pe(ne[1]):Be(ne[1])).catch(pe))}},pause:k=>{k!=null?n=n.map(O=>O.id===k?s({...O,message:"PAUSE"}):O):n=n.map(O=>s({...O,message:"PAUSE"}));},resume:k=>{k!=null?n=n.map(O=>O.id===k?s({...O,message:"RESUME"}):O):n=n.map(O=>s({...O,message:"RESUME"}));},isVisible:k=>!o.has(k)&&!!n.find(O=>O.id===k),isDismissed:k=>o.has(k),expand:()=>{n=n.map(k=>s({...k,stacked:true}));},collapse:()=>{n=n.map(k=>s({...k,stacked:false}));}}}var jk=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Wc={connect:Uk,machine:Vk};var jc=e=>uh(e),[Gk,On]=ot({hookName:"useToastContext",providerName:"<ToastProvider />"}),dh=e=>{let t=On(),r=se(()=>t().getActionTriggerProps(),e);return m(he.button,r)},fh=e=>{let t=On(),r=se(()=>t().getCloseTriggerProps(),e);return m(he.button,r)},ph=e=>e.children(On()),mh=e=>{let t=On(),r=se(()=>t().getDescriptionProps(),e);return m(he.div,r)},qk=w("<div><div></div><div>"),gh=e=>{let t=On(),r=se(()=>t().getRootProps(),e);return (()=>{var n=qk(),o=n.firstChild,i=o.nextSibling;return Pe(n,r,false,true),Pe(o,be(()=>t().getGhostBeforeProps()),false,false),x(n,()=>e.children,i),Pe(i,be(()=>t().getGhostAfterProps()),false,false),n})()},hh=e=>{let t=On(),r=se(()=>t().getTitleProps(),e);return m(he.div,r)},zc=e=>{let[t,r]=Je(e,["toaster","children"]),n=cn(),o=Pr(),i=ar(Wc.machine,()=>({store:t.toaster,id:Wt(),dir:n()?.dir,getRootNode:o()?.getRootNode})),a=L(()=>Wc.connect(i,sr)),s=L(()=>a().getToasts()),l=se(()=>a().getGroupProps(),r);return m(he.div,be(l,{get children(){return m(yc,{get each(){return s()},by:"id",children:(u,c)=>m(Yk,{value:u,index:c,parent:i,children:d=>t.children(d)})})}}))},Yk=e=>{let t=Pr(),r=L(()=>({...e.value(),parent:e.parent,index:e.index(),getRootNode:t().getRootNode})),n=ar(ch,r),o=L(()=>lh(n,sr));return m(Gk,{value:o,get children(){return e.children(e.value)}})},Rn={};un(Rn,{ActionTrigger:()=>dh,CloseTrigger:()=>fh,Context:()=>ph,Description:()=>mh,Root:()=>gh,Title:()=>hh});var Wi=(e,t)=>({x:e,y:t});function Kk(e){let{x:t,y:r,width:n,height:o}=e,i=t+n/2,a=r+o/2;return {x:t,y:r,width:n,height:o,minX:t,minY:r,maxX:t+n,maxY:r+o,midX:i,midY:a,center:Wi(i,a)}}function Xk(e){let t=Wi(e.minX,e.minY),r=Wi(e.maxX,e.minY),n=Wi(e.maxX,e.maxY),o=Wi(e.minX,e.maxY);return {top:t,right:r,bottom:n,left:o}}function bh(e,t){let r=Kk(e),{top:n,right:o,left:i,bottom:a}=Xk(r),[s]=t.split("-");return {top:[i,n,o,a],right:[n,o,a,i],bottom:[n,i,a,o],left:[o,n,i,a]}[s]}function yh(e,t){let{x:r,y:n}=t,o=false;for(let i=0,a=e.length-1;i<e.length;a=i++){let s=e[i].x,l=e[i].y,u=e[a].x,c=e[a].y;l>n!=c>n&&r<(u-s)*(n-l)/(c-l)+s&&(o=!o);}return o}var Ch=lr("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem"),kt=Ch.build(),Rs=e=>e.ids?.trigger??`menu:${e.id}:trigger`,_h=e=>e.ids?.contextTrigger??`menu:${e.id}:ctx-trigger`,ji=e=>e.ids?.content??`menu:${e.id}:content`,Zk=e=>e.ids?.arrow??`menu:${e.id}:arrow`,Sh=e=>e.ids?.positioner??`menu:${e.id}:popper`,Qk=(e,t)=>e.ids?.group?.(t)??`menu:${e.id}:group:${t}`,zi=(e,t)=>`${e.id}/${t}`,Dn=e=>e?.dataset.value??null,xh=(e,t)=>e.ids?.groupLabel?.(t)??`menu:${e.id}:group-label:${t}`,dn=e=>e.getById(ji(e)),vh=e=>e.getById(Sh(e)),As=e=>e.getById(Rs(e)),kh=(e,t)=>t?e.getById(zi(e,t)):null,wh=e=>e.getById(_h(e)),Gi=e=>{let r=`[role^="menuitem"][data-ownedby=${CSS.escape(ji(e))}]:not([data-disabled])`;return Bm(dn(e),r)},Jk=e=>dm(Gi(e)),eP=e=>fm(Gi(e)),qc=(e,t)=>t?e.id===t||e.dataset.value===t:false,tP=(e,t)=>{let r=Gi(e),n=r.findIndex(o=>qc(o,t.value));return mm(r,n,{loop:t.loop??t.loopFocus})},rP=(e,t)=>{let r=Gi(e),n=r.findIndex(o=>qc(o,t.value));return gm(r,n,{loop:t.loop??t.loopFocus})},nP=(e,t)=>{let r=Gi(e),n=r.find(o=>qc(o,t.value));return Rc(r,{state:t.typeaheadState,key:t.key,activeId:n?.id??null})},Os=e=>it(e)&&(e.dataset.disabled===""||e.hasAttribute("disabled")),oP=e=>!!e?.getAttribute("role")?.startsWith("menuitem")&&!!e?.hasAttribute("aria-controls"),Gc="menu:select";function iP(e,t){if(!e)return;let r=ir(e),n=new r.CustomEvent(Gc,{detail:{value:t}});e.dispatchEvent(n);}function Ph(e,t){let{context:r,send:n,state:o,computed:i,prop:a,scope:s}=e,l=o.hasTag("open"),u=i("isSubmenu"),c=i("isTypingAhead"),d=a("composite"),p=r.get("currentPlacement"),f=r.get("anchorPoint"),b=r.get("highlightedValue"),g=Ug({...a("positioning"),placement:f?"bottom":p});function y(h){return {id:zi(s,h.value),disabled:!!h.disabled,highlighted:b===h.value}}function T(h){let C=h.valueText??h.value;return {...h,id:h.value,valueText:C}}function S(h){return {...y(T(h)),checked:!!h.checked}}function E(h){let{closeOnSelect:C,valueText:$,value:H}=h,N=y(h),_=zi(s,H);return t.element({...kt.item.attrs,id:_,role:"menuitem","aria-disabled":Sm(N.disabled),"data-disabled":Rt(N.disabled),"data-ownedby":ji(s),"data-highlighted":Rt(N.highlighted),"data-value":H,"data-valuetext":$,onDragStart(A){A.currentTarget.matches("a[href]")&&A.preventDefault();},onPointerMove(A){if(N.disabled||A.pointerType!=="mouse")return;let I=A.currentTarget;N.highlighted||n({type:"ITEM_POINTERMOVE",id:_,target:I,closeOnSelect:C});},onPointerLeave(A){if(N.disabled||A.pointerType!=="mouse"||!e.event.previous()?.type.includes("POINTER"))return;let k=A.currentTarget;n({type:"ITEM_POINTERLEAVE",id:_,target:k,closeOnSelect:C});},onPointerDown(A){if(N.disabled)return;let I=A.currentTarget;n({type:"ITEM_POINTERDOWN",target:I,id:_,closeOnSelect:C});},onClick(A){if(Pc(A)||kc(A)||N.disabled)return;let I=A.currentTarget;n({type:"ITEM_CLICK",target:I,id:_,closeOnSelect:C});}})}return {highlightedValue:b,open:l,setOpen(h){o.hasTag("open")!==h&&n({type:h?"OPEN":"CLOSE"});},setHighlightedValue(h){n({type:"HIGHLIGHTED.SET",value:h});},setParent(h){n({type:"PARENT.SET",value:h,id:h.prop("id")});},setChild(h){n({type:"CHILD.SET",value:h,id:h.prop("id")});},reposition(h={}){n({type:"POSITIONING.SET",options:h});},addItemListener(h){let C=s.getById(h.id);if(!C)return;let $=()=>h.onSelect?.();return C.addEventListener(Gc,$),()=>C.removeEventListener(Gc,$)},getContextTriggerProps(){return t.element({...kt.contextTrigger.attrs,dir:a("dir"),id:_h(s),onPointerDown(h){if(h.pointerType==="mouse")return;let C=Di(h);n({type:"CONTEXT_MENU_START",point:C});},onPointerCancel(h){h.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"});},onPointerMove(h){h.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"});},onPointerUp(h){h.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"});},onContextMenu(h){let C=Di(h);n({type:"CONTEXT_MENU",point:C}),h.preventDefault();},style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"}})},getTriggerItemProps(h){let C=h.getTriggerProps();return gs(E({value:C.id}),C)},getTriggerProps(){return t.button({...u?kt.triggerItem.attrs:kt.trigger.attrs,"data-placement":r.get("currentPlacement"),type:"button",dir:a("dir"),id:Rs(s),"data-uid":a("id"),"aria-haspopup":d?"menu":"dialog","aria-controls":ji(s),"aria-expanded":l||void 0,"data-state":l?"open":"closed",onPointerMove(h){if(h.pointerType!=="mouse"||Os(h.currentTarget)||!u)return;let $=Di(h);n({type:"TRIGGER_POINTERMOVE",target:h.currentTarget,point:$});},onPointerLeave(h){if(Os(h.currentTarget)||h.pointerType!=="mouse"||!u)return;let C=Di(h);n({type:"TRIGGER_POINTERLEAVE",target:h.currentTarget,point:C});},onPointerDown(h){Os(h.currentTarget)||ps(h)||h.preventDefault();},onClick(h){h.defaultPrevented||Os(h.currentTarget)||n({type:"TRIGGER_CLICK",target:h.currentTarget});},onBlur(){n({type:"TRIGGER_BLUR"});},onFocus(){n({type:"TRIGGER_FOCUS"});},onKeyDown(h){if(h.defaultPrevented)return;let C={ArrowDown(){n({type:"ARROW_DOWN"});},ArrowUp(){n({type:"ARROW_UP"});},Enter(){n({type:"ARROW_DOWN",src:"enter"});},Space(){n({type:"ARROW_DOWN",src:"space"});}},$=Ec(h,{orientation:"vertical",dir:a("dir")}),H=C[$];H&&(h.preventDefault(),H(h));}})},getIndicatorProps(){return t.element({...kt.indicator.attrs,dir:a("dir"),"data-state":l?"open":"closed"})},getPositionerProps(){return t.element({...kt.positioner.attrs,dir:a("dir"),id:Sh(s),style:g.floating})},getArrowProps(){return t.element({id:Zk(s),...kt.arrow.attrs,dir:a("dir"),style:g.arrow})},getArrowTipProps(){return t.element({...kt.arrowTip.attrs,dir:a("dir"),style:g.arrowTip})},getContentProps(){return t.element({...kt.content.attrs,id:ji(s),"aria-label":a("aria-label"),hidden:!l,"data-state":l?"open":"closed",role:d?"menu":"dialog",tabIndex:0,dir:a("dir"),"aria-activedescendant":i("highlightedId")||void 0,"aria-labelledby":Rs(s),"data-placement":p,onPointerEnter(h){h.pointerType==="mouse"&&n({type:"MENU_POINTERENTER"});},onKeyDown(h){if(h.defaultPrevented||!Em(h))return;let C=ht(h);if(!(C?.closest("[role=menu]")===h.currentTarget||C===h.currentTarget))return;if(h.key==="Tab"&&!Dm(h)){h.preventDefault();return}let H=kh(s,b),N={ArrowDown(){n({type:"ARROW_DOWN"});},ArrowUp(){n({type:"ARROW_UP"});},ArrowLeft(){n({type:"ARROW_LEFT"});},ArrowRight(){n({type:"ARROW_RIGHT"});},Enter(){n({type:"ENTER"}),b!=null&&Pm(H)&&a("navigate")?.({value:b,node:H,href:H.href});},Space(I){c?n({type:"TYPEAHEAD",key:I.key}):N.Enter?.(I);},Home(){n({type:"HOME"});},End(){n({type:"END"});}},_=Ec(h,{dir:a("dir")}),A=N[_];if(A){A(h),h.stopPropagation(),h.preventDefault();return}a("typeahead")&&Im(h)&&(Am(h)||ds(C)||(n({type:"TYPEAHEAD",key:h.key}),h.preventDefault()));}})},getSeparatorProps(){return t.element({...kt.separator.attrs,role:"separator",dir:a("dir"),"aria-orientation":"horizontal"})},getItemState:y,getItemProps:E,getOptionItemState:S,getOptionItemProps(h){let{type:C,disabled:$,onCheckedChange:H,closeOnSelect:N}=h,_=T(h),A=S(h);return {...E(_),...t.element({"data-type":C,...kt.item.attrs,dir:a("dir"),"data-value":_.value,role:`menuitem${C}`,"aria-checked":!!A.checked,"data-state":A.checked?"checked":"unchecked",onClick(I){if($||Pc(I)||kc(I))return;let k=I.currentTarget;n({type:"ITEM_CLICK",target:k,option:_,closeOnSelect:N}),H?.(!A.checked);}})}},getItemIndicatorProps(h){let C=S(h);return t.element({...kt.itemIndicator.attrs,dir:a("dir"),"data-disabled":Rt(C.disabled),"data-highlighted":Rt(C.highlighted),"data-state":C.checked?"checked":"unchecked",hidden:!C.checked})},getItemTextProps(h){let C=S(h);return t.element({...kt.itemText.attrs,dir:a("dir"),"data-disabled":Rt(C.disabled),"data-highlighted":Rt(C.highlighted),"data-state":C.checked?"checked":"unchecked"})},getItemGroupLabelProps(h){return t.element({...kt.itemGroupLabel.attrs,id:xh(s,h.htmlFor),dir:a("dir")})},getItemGroupProps(h){return t.element({id:Qk(s,h.id),...kt.itemGroup.attrs,dir:a("dir"),"aria-labelledby":xh(s,h.id),role:"group"})}}}var{not:Xt,and:Vo,or:aP}=hs(),Eh={props({props:e}){return {closeOnSelect:true,typeahead:true,composite:true,loopFocus:false,navigate(t){Nm(t.node);},...e,positioning:{placement:"bottom-start",gutter:8,...e.positioning}}},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"idle"},context({bindable:e,prop:t}){return {suspendPointer:e(()=>({defaultValue:false})),highlightedValue:e(()=>({defaultValue:t("defaultHighlightedValue")||null,value:t("highlightedValue"),onChange(r){t("onHighlightChange")?.({highlightedValue:r});}})),lastHighlightedValue:e(()=>({defaultValue:null})),currentPlacement:e(()=>({defaultValue:void 0})),intentPolygon:e(()=>({defaultValue:null})),anchorPoint:e(()=>({defaultValue:null,hash(r){return `x: ${r?.x}, y: ${r?.y}`}}))}},refs(){return {parent:null,children:{},typeaheadState:{...Rc.defaultOptions},positioningOverride:{}}},computed:{isSubmenu:({refs:e})=>e.get("parent")!=null,isRtl:({prop:e})=>e("dir")==="rtl",isTypingAhead:({refs:e})=>e.get("typeaheadState").keysSoFar!=="",highlightedId:({context:e,scope:t,refs:r})=>lP(r.get("children"),e.get("highlightedValue"),t)},watch({track:e,action:t,context:r,computed:n,prop:o}){e([()=>n("isSubmenu")],()=>{t(["setSubmenuPlacement"]);}),e([()=>r.hash("anchorPoint")],()=>{t(["reposition"]);}),e([()=>o("open")],()=>{t(["toggleVisibility"]);});},on:{"PARENT.SET":{actions:["setParentMenu"]},"CHILD.SET":{actions:["setChildMenu"]},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],OPEN_AUTOFOCUS:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"HIGHLIGHTED.RESTORE":{actions:["restoreHighlightedItem"]},"HIGHLIGHTED.SET":{actions:["setHighlightedItem"]}},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},CONTEXT_MENU_START:{target:"opening:contextmenu",actions:["setAnchorPoint"]},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TRIGGER_FOCUS:{guard:Xt("isSubmenu"),target:"closed"},TRIGGER_POINTERMOVE:{guard:"isSubmenu",target:"opening"}}},"opening:contextmenu":{tags:["closed"],effects:["waitForLongPress"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},CONTEXT_MENU_CANCEL:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"LONG_PRESS.OPEN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}},opening:{tags:["closed"],effects:["waitForOpenDelay"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},BLUR:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_POINTERLEAVE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"DELAY.OPEN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}},closing:{tags:["open"],effects:["trackPointerMove","trackInteractOutside","waitForCloseDelay"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem"]},MENU_POINTERENTER:{target:"open",actions:["clearIntentPolygon"]},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem"]}],"DELAY.CLOSE":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem","invokeOnClose"]}]}},closed:{tags:["closed"],entry:["clearHighlightedItem","focusTrigger","resumePointer"],on:{"CONTROLLED.OPEN":[{guard:aP("isOpenAutoFocusEvent","isArrowDownEvent"),target:"open",actions:["highlightFirstItem"]},{guard:"isArrowUpEvent",target:"open",actions:["highlightLastItem"]},{target:"open"}],CONTEXT_MENU_START:{target:"opening:contextmenu",actions:["setAnchorPoint"]},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",target:"opening"},TRIGGER_BLUR:{target:"idle"},ARROW_DOWN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],ARROW_UP:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightLastItem","invokeOnOpen"]}]}},open:{tags:["open"],effects:["trackInteractOutside","trackPositioning","scrollToHighlightedItem"],entry:["focusMenu","resumePointer"],on:{"CONTROLLED.CLOSE":[{target:"closed",guard:"isArrowLeftEvent",actions:["focusParentMenu"]},{target:"closed"}],TRIGGER_CLICK:[{guard:Vo(Xt("isTriggerItem"),"isOpenControlled"),actions:["invokeOnClose"]},{guard:Xt("isTriggerItem"),target:"closed",actions:["invokeOnClose"]}],CONTEXT_MENU:{actions:["setAnchorPoint","focusMenu"]},ARROW_UP:{actions:["highlightPrevItem","focusMenu"]},ARROW_DOWN:{actions:["highlightNextItem","focusMenu"]},ARROW_LEFT:[{guard:Vo("isSubmenu","isOpenControlled"),actions:["invokeOnClose"]},{guard:"isSubmenu",target:"closed",actions:["focusParentMenu","invokeOnClose"]}],HOME:{actions:["highlightFirstItem","focusMenu"]},END:{actions:["highlightLastItem","focusMenu"]},ARROW_RIGHT:{guard:"isTriggerItemHighlighted",actions:["openSubmenu"]},ENTER:[{guard:"isTriggerItemHighlighted",actions:["openSubmenu"]},{actions:["clickHighlightedItem"]}],ITEM_POINTERMOVE:[{guard:Xt("isPointerSuspended"),actions:["setHighlightedItem","focusMenu"]},{actions:["setLastHighlightedItem"]}],ITEM_POINTERLEAVE:{guard:Vo(Xt("isPointerSuspended"),Xt("isTriggerItem")),actions:["clearHighlightedItem"]},ITEM_CLICK:[{guard:Vo(Xt("isTriggerItemHighlighted"),Xt("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Vo(Xt("isTriggerItemHighlighted"),Xt("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Vo(Xt("isTriggerItemHighlighted"),Xt("isHighlightedItemEditable")),actions:["invokeOnSelect","setOptionState"]},{actions:["setHighlightedItem"]}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",actions:["setIntentPolygon"]},TRIGGER_POINTERLEAVE:{target:"closing"},ITEM_POINTERDOWN:{actions:["setHighlightedItem"]},TYPEAHEAD:{actions:["highlightMatchedItem"]},FOCUS_MENU:{actions:["focusMenu"]},"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{closeOnSelect:({prop:e,event:t})=>!!(t?.closeOnSelect??e("closeOnSelect")),isTriggerItem:({event:e})=>oP(e.target),isTriggerItemHighlighted:({event:e,scope:t,computed:r})=>!!(e.target??t.getById(r("highlightedId")))?.hasAttribute("aria-controls"),isSubmenu:({computed:e})=>e("isSubmenu"),isPointerSuspended:({context:e})=>e.get("suspendPointer"),isHighlightedItemEditable:({scope:e,computed:t})=>ds(e.getById(t("highlightedId"))),isOpenControlled:({prop:e})=>e("open")!==void 0,isArrowLeftEvent:({event:e})=>e.previousEvent?.type==="ARROW_LEFT",isArrowUpEvent:({event:e})=>e.previousEvent?.type==="ARROW_UP",isArrowDownEvent:({event:e})=>e.previousEvent?.type==="ARROW_DOWN",isOpenAutoFocusEvent:({event:e})=>e.previousEvent?.type==="OPEN_AUTOFOCUS"},effects:{waitForOpenDelay({send:e}){let t=setTimeout(()=>{e({type:"DELAY.OPEN"});},100);return ()=>clearTimeout(t)},waitForCloseDelay({send:e}){let t=setTimeout(()=>{e({type:"DELAY.CLOSE"});},300);return ()=>clearTimeout(t)},waitForLongPress({send:e}){let t=setTimeout(()=>{e({type:"LONG_PRESS.OPEN"});},700);return ()=>clearTimeout(t)},trackPositioning({context:e,prop:t,scope:r,refs:n}){if(wh(r))return;let o={...t("positioning"),...n.get("positioningOverride")};e.set("currentPlacement",o.placement);let i=()=>vh(r);return Vc(As(r),i,{...o,defer:true,onComplete(a){e.set("currentPlacement",a.placement);}})},trackInteractOutside({refs:e,scope:t,prop:r,computed:n,send:o}){let i=()=>dn(t),a=true;return Is(i,{defer:true,exclude:[As(t)],onInteractOutside:r("onInteractOutside"),onFocusOutside:r("onFocusOutside"),onEscapeKeyDown(s){r("onEscapeKeyDown")?.(s),n("isSubmenu")&&s.preventDefault(),Th({parent:e.get("parent")});},onPointerDownOutside(s){let l=ht(s.detail.originalEvent);if(Gt(wh(t),l)&&s.detail.contextmenu){s.preventDefault();return}a=!s.detail.focusable,r("onPointerDownOutside")?.(s);},onDismiss(){o({type:"CLOSE",src:"interact-outside",restoreFocus:a});}})},trackPointerMove({context:e,scope:t,send:r,refs:n,flush:o}){let i=n.get("parent");o(()=>{i.context.set("suspendPointer",true);});let a=t.getDoc();return pt(a,"pointermove",s=>{sP(e.get("intentPolygon"),{x:s.clientX,y:s.clientY})||(r({type:"POINTER_MOVED_AWAY_FROM_SUBMENU"}),i.context.set("suspendPointer",false));})},scrollToHighlightedItem({event:e,scope:t,computed:r}){let n=()=>{if(e.type.startsWith("ITEM_POINTER"))return;let i=t.getById(r("highlightedId")),a=dn(t);Fm(i,{rootEl:a,block:"nearest"});};return je(()=>n()),$m(()=>dn(t),{attributes:["aria-activedescendant"],callback:n})}},actions:{setAnchorPoint({context:e,event:t}){e.set("anchorPoint",t.point);},setSubmenuPlacement({computed:e,refs:t}){if(!e("isSubmenu"))return;let r=e("isRtl")?"left-start":"right-start";t.set("positioningOverride",{placement:r,gutter:0});},reposition({context:e,scope:t,prop:r,event:n,refs:o}){let i=()=>vh(t),a=e.get("anchorPoint"),s=a?()=>({width:0,height:0,...a}):void 0,l={...r("positioning"),...o.get("positioningOverride")};Vc(As(t),i,{...l,defer:true,getAnchorRect:s,...n.options??{},listeners:false,onComplete(u){e.set("currentPlacement",u.placement);}});},setOptionState({event:e}){if(!e.option)return;let{checked:t,onCheckedChange:r,type:n}=e.option;n==="radio"?r?.(true):n==="checkbox"&&r?.(!t);},clickHighlightedItem({scope:e,computed:t}){let r=e.getById(t("highlightedId"));!r||r.dataset.disabled||queueMicrotask(()=>r.click());},setIntentPolygon({context:e,scope:t,event:r}){let n=dn(t),o=e.get("currentPlacement");if(!n||!o)return;let i=n.getBoundingClientRect(),a=bh(i,o);if(!a)return;let l=Fg(o)==="right"?-5:5;e.set("intentPolygon",[{...r.point,x:r.point.x+l},...a]);},clearIntentPolygon({context:e}){e.set("intentPolygon",null);},resumePointer({refs:e,flush:t}){let r=e.get("parent");r&&t(()=>{r.context.set("suspendPointer",false);});},setHighlightedItem({context:e,event:t}){let r=t.value||Dn(t.target);e.set("highlightedValue",r);},clearHighlightedItem({context:e}){e.set("highlightedValue",null);},focusMenu({scope:e}){je(()=>{let t=dn(e);Rm({root:t,enabled:!Gt(t,e.getActiveElement()),filter(n){return !n.role?.startsWith("menuitem")}})?.focus({preventScroll:true});});},highlightFirstItem({context:e,scope:t}){(dn(t)?queueMicrotask:je)(()=>{let n=Jk(t);n&&e.set("highlightedValue",Dn(n));});},highlightLastItem({context:e,scope:t}){(dn(t)?queueMicrotask:je)(()=>{let n=eP(t);n&&e.set("highlightedValue",Dn(n));});},highlightNextItem({context:e,scope:t,event:r,prop:n}){let o=tP(t,{loop:r.loop,value:e.get("highlightedValue"),loopFocus:n("loopFocus")});e.set("highlightedValue",Dn(o));},highlightPrevItem({context:e,scope:t,event:r,prop:n}){let o=rP(t,{loop:r.loop,value:e.get("highlightedValue"),loopFocus:n("loopFocus")});e.set("highlightedValue",Dn(o));},invokeOnSelect({context:e,prop:t,scope:r}){let n=e.get("highlightedValue");if(n==null)return;let o=kh(r,n);iP(o,n),t("onSelect")?.({value:n});},focusTrigger({scope:e,context:t,event:r,computed:n}){n("isSubmenu")||t.get("anchorPoint")||r.restoreFocus===false||queueMicrotask(()=>As(e)?.focus({preventScroll:true}));},highlightMatchedItem({scope:e,context:t,event:r,refs:n}){let o=nP(e,{key:r.key,value:t.get("highlightedValue"),typeaheadState:n.get("typeaheadState")});o&&t.set("highlightedValue",Dn(o));},setParentMenu({refs:e,event:t}){e.set("parent",t.value);},setChildMenu({refs:e,event:t}){let r=e.get("children");r[t.id]=t.value,e.set("children",r);},closeRootMenu({refs:e}){Th({parent:e.get("parent")});},openSubmenu({refs:e,scope:t,computed:r}){let o=t.getById(r("highlightedId"))?.getAttribute("data-uid"),i=e.get("children");(o?i[o]:null)?.send({type:"OPEN_AUTOFOCUS"});},focusParentMenu({refs:e}){e.get("parent")?.send({type:"FOCUS_MENU"});},setLastHighlightedItem({context:e,event:t}){e.set("lastHighlightedValue",Dn(t.target));},restoreHighlightedItem({context:e}){e.get("lastHighlightedValue")&&(e.set("highlightedValue",e.get("lastHighlightedValue")),e.set("lastHighlightedValue",null));},restoreParentHighlightedItem({refs:e}){e.get("parent")?.send({type:"HIGHLIGHTED.RESTORE"});},invokeOnOpen({prop:e}){e("onOpenChange")?.({open:true});},invokeOnClose({prop:e}){e("onOpenChange")?.({open:false});},toggleVisibility({prop:e,event:t,send:r}){r({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t});}}}};function Th(e){let t=e.parent;for(;t&&t.computed("isSubmenu");)t=t.refs.get("parent");t?.send({type:"CLOSE"});}function sP(e,t){return e?yh(e,t):false}function lP(e,t,r){let n=Object.keys(e).length>0;if(!t)return null;if(!n)return zi(r,t);for(let o in e){let i=e[o],a=Rs(i.scope);if(a===t)return a}return zi(r,t)}qt()(["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","dir","getRootNode","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]);qt()(["closeOnSelect","disabled","value","valueText"]);qt()(["htmlFor"]);qt()(["id"]);qt()(["checked","closeOnSelect","disabled","onCheckedChange","type","value","valueText"]);var[Ih,st]=ot({hookName:"useMenuContext",providerName:"<MenuProvider />",strict:false}),Ah=e=>{let t=st(),r=se(()=>t().getArrowProps(),e);return m(he.div,r)},Oh=e=>{let t=st(),r=se(()=>t().getArrowTipProps(),e);return m(he.div,r)},[Yc,Rh]=ot({hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[Dh,Mh]=ot({hookName:"useMenuOptionItemPropsContext",providerName:"<MenuOptionItemPropsProvider />"}),$h=e=>{let[t,r]=gt()(e,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),n=se(t,{type:"checkbox"}),o=st(),i=se(()=>o().getOptionItemProps(n),r),a=L(()=>o().getItemState(n));return m(Dh,{value:n,get children(){return m(Yc,{value:a,get children(){return m(he.div,i)}})}})},Nh=e=>{let t=st(),r=ln(),n=se(()=>t().getContentProps(),()=>r().presenceProps,e);return m(W,{get when(){return !r().unmounted},get children(){return m(he.div,be(n,{ref(o){var i=Ii(r().ref,e.ref);typeof i=="function"&&i(o);}}))}})},Lh=e=>e.children(st()),Fh=e=>{let t=st(),r=se(()=>t().getContextTriggerProps(),e);return m(he.button,r)},Bh=e=>{let t=st(),r=se(()=>t().getIndicatorProps(),e);return m(he.div,r)},Uh=e=>{let[t,r]=gt()(e,["closeOnSelect","disabled","value","valueText","onSelect"]),n=st(),o=se(()=>n().getItemProps(t),r),i=L(()=>n().getItemState(t));return Ce(()=>{let a=n().addItemListener({id:i().id,onSelect:t.onSelect});ae(()=>a?.());}),m(Yc,{value:i,get children(){return m(he.div,o)}})},Vh=e=>e.children(Rh()),[Hh,Wh]=ot({hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),jh=e=>{let[t,r]=gt()(e,["id"]),n=se({id:Wt()},t),o=st(),i=se(()=>o().getItemGroupProps(n),r);return m(Hh,{value:n,get children(){return m(he.div,i)}})},zh=e=>{let t=st(),r=Wh(),n=se(t().getItemGroupLabelProps({htmlFor:r.id}),e);return m(he.div,n)},Gh=e=>{let t=st(),r=Mh(),n=se(()=>t().getItemIndicatorProps(r),e);return m(he.div,n)},qh=e=>{let t=st(),r=Mh(),n=se(()=>t().getItemTextProps(r),e);return m(he.div,n)},Yh=e=>{let t=st(),r=ln(),n=se(()=>t().getPositionerProps(),e);return m(W,{get when(){return !r().unmounted},get children(){return m(he.div,n)}})},Kh=e=>{let[t,r]=gt()(e,["closeOnSelect","disabled","value","valueText"]),n=st(),o=Wh(),i=se(t,()=>({type:"radio",checked:o.value===t.value,onCheckedChange:()=>o.onValueChange?.({value:t.value})})),a=se(()=>n().getOptionItemProps(i),r),s=L(()=>n().getOptionItemState(i));return m(Dh,{value:i,get children(){return m(Yc,{value:s,get children(){return m(he.div,a)}})}})},Xh=e=>{let[t,r]=gt()(e,["id","onValueChange","value"]),n=st(),o=se({id:Wt()},t),i=se(()=>n().getItemGroupProps(o),r);return m(Hh,{value:o,get children(){return m(he.div,i)}})},Zh=e=>{let t=Wt(),r=cn(),n=Pr(),o=L(()=>({id:t,dir:r().dir,getRootNode:n().getRootNode,...kr(e)})),i=ar(Eh,o);return {api:L(()=>Ph(i,sr)),service:i}},[Qh,Jh]=ot({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:false}),[eb,gP]=ot({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:false}),tb=e=>{let[t,r]=Do(e),[n,o]=gt()(r,["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),i=st(),a=Jh(),s=Zh(n),l=_n(se(t,()=>({present:s.api().open})));return ie(()=>{a&&(i?.().setChild(s.service),s.api().setParent(a));}),m(eb,{value:()=>i?.().getTriggerItemProps(s.api()),get children(){return m(Qh,{get value(){return s.service},get children(){return m(Ih,{get value(){return s.api},get children(){return m(Mo,{value:l,get children(){return o.children}})}})}})}})},rb=e=>{let t=st(),r=Jh(),[n,o]=Do(e),i=_n(se(n,()=>({present:o.value.api().open})));return Ce(()=>{r&&(t?.().setChild(o.value.service),o.value.api().setParent(r));}),m(eb,{value:()=>t?.().getTriggerItemProps(o.value.api()),get children(){return m(Qh,{get value(){return o.value.service},get children(){return m(Ih,{get value(){return o.value.api},get children(){return m(Mo,{value:i,get children(){return o.children}})}})}})}})},nb=e=>{let t=st(),r=se(()=>t().getSeparatorProps(),e);return m(he.hr,r)},ob=e=>{let t=st(),r=ln(),n=se(()=>t().getTriggerProps(),()=>({"aria-controls":r().unmounted&&null}),e);return m(he.button,n)},ib=e=>{let t=gP(),r=se(()=>t?.(),e);return m(he.div,r)},jr={};un(jr,{Arrow:()=>Ah,ArrowTip:()=>Oh,CheckboxItem:()=>$h,Content:()=>Nh,Context:()=>Lh,ContextTrigger:()=>Fh,Indicator:()=>Bh,Item:()=>Uh,ItemContext:()=>Vh,ItemGroup:()=>jh,ItemGroupLabel:()=>zh,ItemIndicator:()=>Gh,ItemText:()=>qh,Positioner:()=>Yh,RadioItem:()=>Kh,RadioItemGroup:()=>Xh,Root:()=>tb,RootProvider:()=>rb,Separator:()=>nb,Trigger:()=>ob,TriggerItem:()=>ib});var Ho=new WeakMap,Ds=new WeakMap,Ms={},Kc=0,ab=e=>e&&(e.host||ab(e.parentNode)),hP=(e,t)=>t.map(r=>{if(e.contains(r))return r;let n=ab(r);return n&&e.contains(n)?n:(console.error("[zag-js > ariaHidden] target",r,"in not contained inside",e,". Doing nothing"),null)}).filter(r=>!!r),bP=e=>e.localName==="next-route-announcer"||e.localName==="script"||e.hasAttribute("aria-live")?true:e.matches("[data-live-announcer]"),yP=(e,t)=>{let{parentNode:r,markerName:n,controlAttribute:o}=t,i=hP(r,Array.isArray(e)?e:[e]);Ms[n]||(Ms[n]=new WeakMap);let a=Ms[n],s=[],l=new Set,u=new Set(i),c=p=>{!p||l.has(p)||(l.add(p),c(p.parentNode));};i.forEach(c);let d=p=>{!p||u.has(p)||Array.prototype.forEach.call(p.children,f=>{if(l.has(f))d(f);else try{if(bP(f))return;let g=f.getAttribute(o)==="true",y=(Ho.get(f)||0)+1,T=(a.get(f)||0)+1;Ho.set(f,y),a.set(f,T),s.push(f),y===1&&g&&Ds.set(f,!0),T===1&&f.setAttribute(n,""),g||f.setAttribute(o,"true");}catch(b){console.error("[zag-js > ariaHidden] cannot operate on ",f,b);}});};return d(r),l.clear(),Kc++,()=>{s.forEach(p=>{let f=Ho.get(p)-1,b=a.get(p)-1;Ho.set(p,f),a.set(p,b),f||(Ds.has(p)||p.removeAttribute(o),Ds.delete(p)),b||p.removeAttribute(n);}),Kc--,Kc||(Ho=new WeakMap,Ho=new WeakMap,Ds=new WeakMap,Ms={});}},xP=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,vP=(e,t=xP(e),r="data-aria-hidden")=>{if(t)return yP(e,{parentNode:t,markerName:r,controlAttribute:"aria-hidden"})},wP=e=>{let t=requestAnimationFrame(()=>e());return ()=>cancelAnimationFrame(t)};function sb(e,t={}){let{defer:r=true}=t,n=r?wP:i=>i(),o=[];return o.push(n(()=>{let a=(typeof e=="function"?e():e).filter(Boolean);a.length!==0&&o.push(vP(a));})),()=>{o.forEach(i=>i?.());}}var Xc="data-scroll-lock";function TP(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function lb(e){let t=e??document,r=t.defaultView??window,{documentElement:n,body:o}=t;if(o.hasAttribute(Xc))return;o.setAttribute(Xc,"");let a=r.innerWidth-n.clientWidth,s=()=>Um(n,"--scrollbar-width",`${a}px`),l=TP(n),u=()=>Tn(o,{overflow:"hidden",[l]:`${a}px`}),c=()=>{let{scrollX:p,scrollY:f,visualViewport:b}=r,g=b?.offsetLeft??0,y=b?.offsetTop??0,T=Tn(o,{position:"fixed",overflow:"hidden",top:`${-(f-Math.floor(y))}px`,left:`${-(p-Math.floor(g))}px`,right:"0",[l]:`${a}px`});return ()=>{T?.(),r.scrollTo({left:p,top:f,behavior:"instant"});}},d=[s(),_c()?c():u()];return ()=>{d.forEach(p=>p?.()),o.removeAttribute(Xc);}}var ub=lr("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange"),zr=ub.build(),CP=e=>e.ids?.root??`progress-${e.id}`,_P=e=>e.ids?.track??`progress-${e.id}-track`,SP=e=>e.ids?.label??`progress-${e.id}-label`,kP=e=>e.ids?.circle??`progress-${e.id}-circle`;function db(e,t){let{context:r,computed:n,prop:o,send:i,scope:a}=e,s=n("percent"),l=n("isIndeterminate")?"":n("formatter").format(n("percent")/100),u=o("max"),c=o("min"),d=o("orientation"),p=o("translations"),f=n("isIndeterminate"),b=r.get("value"),g=p?.value({value:b,max:u,percent:s,min:c})??"",y=PP(b,u),T={role:"progressbar","aria-label":g,"data-max":u,"aria-valuemin":c,"aria-valuemax":u,"aria-valuenow":b??void 0,"data-orientation":d,"data-state":y},S=IP(e);return {value:b,valueAsString:g,min:c,max:u,percent:s,percentAsString:l,indeterminate:f,setValue(E){i({type:"VALUE.SET",value:E});},setToMax(){i({type:"VALUE.SET",value:u});},setToMin(){i({type:"VALUE.SET",value:c});},getRootProps(){return t.element({dir:o("dir"),...zr.root.attrs,id:CP(a),"data-max":u,"data-value":b??void 0,"data-state":y,"data-orientation":d,style:{"--percent":f?void 0:s}})},getLabelProps(){return t.element({dir:o("dir"),id:SP(a),...zr.label.attrs,"data-orientation":d})},getValueTextProps(){return t.element({dir:o("dir"),"aria-live":"polite",...zr.valueText.attrs})},getTrackProps(){return t.element({dir:o("dir"),id:_P(a),...zr.track.attrs,...T})},getRangeProps(){return t.element({dir:o("dir"),...zr.range.attrs,"data-orientation":d,"data-state":y,style:{[n("isHorizontal")?"width":"height"]:f?void 0:`${s}%`}})},getCircleProps(){return t.element({dir:o("dir"),id:kP(a),...zr.circle.attrs,...T,...S.root})},getCircleTrackProps(){return t.element({dir:o("dir"),"data-orientation":d,...zr.circleTrack.attrs,...S.track})},getCircleRangeProps(){return t.element({dir:o("dir"),...zr.circleRange.attrs,...S.range,"data-state":y})},getViewProps(E){return t.element({dir:o("dir"),...zr.view.attrs,"data-state":E.state,hidden:E.state!==y})}}}function PP(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}var cb={style:{"--radius":"calc(var(--size) / 2 - var(--thickness) / 2)",cx:"calc(var(--size) / 2)",cy:"calc(var(--size) / 2)",r:"var(--radius)",fill:"transparent",strokeWidth:"var(--thickness)"}},EP={style:{width:"var(--size)",height:"var(--size)"}};function IP(e){let{context:t,computed:r}=e;return {root:EP,track:cb,range:{opacity:t.get("value")===0?0:void 0,style:{...cb.style,"--percent":r("percent"),"--circumference":"calc(2 * 3.14159 * var(--radius))","--offset":"calc(var(--circumference) * (100 - var(--percent)) / 100)",strokeDashoffset:"calc(var(--circumference) * ((100 - var(--percent)) / 100))",strokeDasharray:r("isIndeterminate")?void 0:"var(--circumference)",transformOrigin:"center",transform:"rotate(-90deg)"}}}}var fb={props({props:e}){let t=e.min??0,r=e.max??100;return {...e,max:r,min:t,defaultValue:e.defaultValue??RP(t,r),orientation:"horizontal",formatOptions:{style:"percent",...e.formatOptions},translations:{value:({percent:n})=>n===-1?"loading...":`${n} percent`,...e.translations}}},initialState(){return "idle"},entry:["validateContext"],context({bindable:e,prop:t}){return {value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),onChange(r){t("onValueChange")?.({value:r});}}))}},computed:{isIndeterminate:({context:e})=>e.get("value")===null,percent({context:e,prop:t}){let r=e.get("value");return Oi(r)?xm(r,t("min"),t("max"))*100:-1},formatter:Wm(({prop:e})=>[e("locale"),e("formatOptions")],(e,t)=>new Intl.NumberFormat(e,t)),isHorizontal:({prop:e})=>e("orientation")==="horizontal"},states:{idle:{on:{"VALUE.SET":{actions:["setValue"]}}}},implementations:{actions:{setValue:({context:e,event:t,prop:r})=>{let n=t.value===null?null:Math.max(0,Math.min(t.value,r("max")));e.set("value",n);},validateContext:({context:e,prop:t})=>{let r=t("max"),n=t("min"),o=e.get("value");if(o!=null){if(!Zc(r))throw new Error(`[progress] The max value passed \`${r}\` is not a valid number`);if(!AP(o,r))throw new Error(`[progress] The value passed \`${o}\` exceeds the max value \`${r}\``);if(!OP(o,n))throw new Error(`[progress] The value passed \`${o}\` exceeds the min value \`${n}\``)}}}}},Zc=e=>Oi(e)&&!isNaN(e),AP=(e,t)=>Zc(e)&&e<=t,OP=(e,t)=>Zc(e)&&e>=t,RP=(e,t)=>e+(t-e)/2;qt()(["dir","getRootNode","id","ids","max","min","orientation","translations","value","onValueChange","defaultValue","formatOptions","locale"]);var[pb,Or]=ot({hookName:"useProgressContext",providerName:"<ProgressProvider />"}),mb=e=>{let t=Or(),r=se(()=>t().getCircleProps(),e);return m(he.svg,r)},gb=e=>{let t=Or(),r=se(()=>t().getCircleRangeProps(),e);return m(he.circle,r)},hb=e=>{let t=Or(),r=se(()=>t().getCircleTrackProps(),e);return m(he.circle,r)},bb=e=>e.children(Or()),yb=e=>{let t=Or(),r=se(()=>t().getLabelProps(),e);return m(he.label,r)},xb=e=>{let t=Or(),r=se(()=>t().getRangeProps(),e);return m(he.div,r)},vb=e=>{let t=Wt(),r=cn(),n=Pr(),o=L(()=>({id:t,dir:r().dir,locale:r().locale,getRootNode:n().getRootNode,...kr(e)})),i=ar(fb,o);return L(()=>db(i,sr))},wb=e=>{let[t,r]=gt()(e,["defaultValue","formatOptions","id","ids","locale","max","min","onValueChange","orientation","translations","value"]),n=vb(t),o=se(()=>n().getRootProps(),r);return m(pb,{value:n,get children(){return m(he.div,o)}})},Tb=e=>{let[{value:t},r]=gt()(e,["value"]),n=se(()=>t().getRootProps(),r);return m(pb,{value:t,get children(){return m(he.div,n)}})},Cb=e=>{let t=Or(),r=se(()=>t().getTrackProps(),e);return m(he.div,r)},_b=e=>{let t=Or(),r=se(()=>t().getValueTextProps(),e);return m(he.span,be(r,{get children(){return e.children||t().percentAsString}}))},Sb=e=>{let[t,r]=gt()(e,["state"]),n=Or(),o=se(()=>n().getViewProps(t),r);return m(he.span,o)},Mn={};un(Mn,{Circle:()=>mb,CircleRange:()=>gb,CircleTrack:()=>hb,Context:()=>bb,Label:()=>yb,Range:()=>xb,Root:()=>wb,RootProvider:()=>Tb,Track:()=>Cb,ValueText:()=>_b,View:()=>Sb});var kb=lr("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),$n=kb.build(),Pb=e=>e.ids?.positioner??`dialog:${e.id}:positioner`,Eb=e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,Qc=e=>e.ids?.content??`dialog:${e.id}:content`,Ib=e=>e.ids?.trigger??`dialog:${e.id}:trigger`,Jc=e=>e.ids?.title??`dialog:${e.id}:title`,eu=e=>e.ids?.description??`dialog:${e.id}:description`,Ab=e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,$s=e=>e.getById(Qc(e)),$P=e=>e.getById(Pb(e)),NP=e=>e.getById(Eb(e)),LP=e=>e.getById(Ib(e)),FP=e=>e.getById(Jc(e)),BP=e=>e.getById(eu(e)),UP=e=>e.getById(Ab(e));function Ob(e,t){let{state:r,send:n,context:o,prop:i,scope:a}=e,s=i("aria-label"),l=r.matches("open");return {open:l,setOpen(u){r.matches("open")!==u&&n({type:u?"OPEN":"CLOSE"});},getTriggerProps(){return t.button({...$n.trigger.attrs,dir:i("dir"),id:Ib(a),"aria-haspopup":"dialog",type:"button","aria-expanded":l,"data-state":l?"open":"closed","aria-controls":Qc(a),onClick(u){u.defaultPrevented||n({type:"TOGGLE"});}})},getBackdropProps(){return t.element({...$n.backdrop.attrs,dir:i("dir"),hidden:!l,id:Eb(a),"data-state":l?"open":"closed"})},getPositionerProps(){return t.element({...$n.positioner.attrs,dir:i("dir"),id:Pb(a),style:{pointerEvents:l?void 0:"none"}})},getContentProps(){let u=o.get("rendered");return t.element({...$n.content.attrs,dir:i("dir"),role:i("role"),hidden:!l,id:Qc(a),tabIndex:-1,"data-state":l?"open":"closed","aria-modal":true,"aria-label":s||void 0,"aria-labelledby":s||!u.title?void 0:Jc(a),"aria-describedby":u.description?eu(a):void 0})},getTitleProps(){return t.element({...$n.title.attrs,dir:i("dir"),id:Jc(a)})},getDescriptionProps(){return t.element({...$n.description.attrs,dir:i("dir"),id:eu(a)})},getCloseTriggerProps(){return t.button({...$n.closeTrigger.attrs,dir:i("dir"),id:Ab(a),type:"button",onClick(u){u.defaultPrevented||(u.stopPropagation(),n({type:"CLOSE"}));}})}}}var Rb={props({props:e,scope:t}){let r=e.role==="alertdialog";return {role:"dialog",modal:true,trapFocus:true,preventScroll:true,closeOnInteractOutside:!r,closeOnEscape:true,restoreFocus:true,initialFocusEl:r?()=>UP(t):void 0,...e}},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return {rendered:e(()=>({defaultValue:{title:true,description:true}}))}},watch({track:e,action:t,prop:r}){e([()=>r("open")],()=>{t(["toggleVisibility"]);});},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:r}){return Is(()=>$s(e),{defer:true,pointerBlocking:r("modal"),exclude:[LP(e)],onInteractOutside(o){r("onInteractOutside")?.(o),r("closeOnInteractOutside")||o.preventDefault();},persistentElements:r("persistentElements"),onFocusOutside:r("onFocusOutside"),onPointerDownOutside:r("onPointerDownOutside"),onEscapeKeyDown(o){r("onEscapeKeyDown")?.(o),r("closeOnEscape")||o.preventDefault();},onDismiss(){t({type:"CLOSE",src:"interact-outside"});}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return lb(e.getDoc())},trapFocus({scope:e,prop:t}){return !t("trapFocus")||!t("modal")?void 0:Qg(()=>$s(e),{preventScroll:true,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:n=>t("finalFocusEl")?.()??n})},hideContentBelow({scope:e,prop:t}){return t("modal")?sb(()=>[$s(e)],{defer:true}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){je(()=>{e.set("rendered",{title:!!FP(t),description:!!BP(t)});});},syncZIndex({scope:e}){je(()=>{let t=$s(e);if(!t)return;let r=Oo(t);[$P(e),NP(e)].forEach(o=>{o?.style.setProperty("--z-index",r.zIndex);});});},invokeOnClose({prop:e}){e("onOpenChange")?.({open:false});},invokeOnOpen({prop:e}){e("onOpenChange")?.({open:true});},toggleVisibility({prop:e,send:t,event:r}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r});}}}};qt()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);var[Db,Gr]=ot({hookName:"useDialogContext",providerName:"<DialogProvider />"}),Mb=e=>{let t=Gr(),r=sm(),n=_n(se(r,()=>({present:t().open}))),o=se(()=>t().getBackdropProps(),()=>n().presenceProps,e);return m(W,{get when(){return !n().unmounted},get children(){return m(he.div,be(o,{ref(i){var a=Ii(n().ref,e.ref);typeof a=="function"&&a(i);}}))}})},$b=e=>{let t=Gr(),r=se(()=>t().getCloseTriggerProps(),e);return m(he.button,r)},Nb=e=>{let t=Gr(),r=ln(),n=se(()=>t().getContentProps(),()=>r().presenceProps,e);return m(W,{get when(){return !r().unmounted},get children(){return m(he.div,be(n,{ref(o){var i=Ii(r().ref,e.ref);typeof i=="function"&&i(o);}}))}})},Lb=e=>e.children(Gr()),Fb=e=>{let t=Gr(),r=se(()=>t().getDescriptionProps(),e);return m(he.div,r)},Bb=e=>{let t=Gr(),r=ln(),n=se(()=>t().getPositionerProps(),e);return m(W,{get when(){return !r().unmounted},get children(){return m(he.div,n)}})},Ub=e=>{let t=Wt(),r=cn(),n=Pr(),o=L(()=>({id:t,dir:r().dir,getRootNode:n().getRootNode,...kr(e)})),i=ar(Rb,o);return L(()=>Ob(i,sr))},Vb=e=>{let[t,r]=Do(e),[n]=Ai(t),[o,i]=gt()(r,["aria-label","closeOnEscape","closeOnInteractOutside","defaultOpen","finalFocusEl","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),a=Ub(o),s=_n(se(t,()=>({present:a().open})));return m(Db,{value:a,get children(){return m(hc,{value:n,get children(){return m(Mo,{value:s,get children(){return i.children}})}})}})},Hb=e=>{let[t,r]=Do(e),[n]=Ai(t),o=_n(se(t,()=>({present:r.value().open})));return m(Db,{get value(){return r.value},get children(){return m(hc,{value:n,get children(){return m(Mo,{value:o,get children(){return r.children}})}})}})},Wb=e=>{let t=Gr(),r=se(()=>t().getTitleProps(),e);return m(he.h2,r)},jb=e=>{let t=Gr(),r=ln(),n=se(()=>t().getTriggerProps(),()=>({"aria-controls":r().unmounted&&null}),e);return m(he.button,n)},fn={};un(fn,{Backdrop:()=>Mb,CloseTrigger:()=>$b,Content:()=>Nb,Context:()=>Lb,Description:()=>Fb,Positioner:()=>Bb,Root:()=>Vb,RootProvider:()=>Hb,Title:()=>Wb,Trigger:()=>jb});var Rr=jc({placement:"bottom-end",gap:24});var zb="#brand-mark{background-color:#c2c2c6!important;border-color:#ebebf4!important;border-radius:5px!important;border-width:1px!important;bottom:20px!important;color:#000!important;cursor:pointer;display:flex!important;font-size:14px!important;font-weight:600!important;gap:8px!important;left:auto!important;line-height:20px!important;opacity:1!important;padding:5px 10px!important;position:absolute!important;right:auto!important;text-decoration:none!important;top:auto!important;transition:background-color .2s ease-in-out!important;visibility:visible!important;z-index:50!important}#brand-mark:hover{background-color:#000!important;border-color:#282828!important;color:#fff!important}";var Gb=async({apiHost:e,message:t,sessionId:r})=>{try{return {data:await on.post(`${Re(e)?e:dt()}/api/v1/sessions/${r}/continue`,{headers:{"x-original-referrer":document.referrer},json:{message:t},timeout:!1}).json()}}catch(n){return {error:n}}};var tu=async({apiHost:e,sessionId:t,clientLogs:r})=>{try{await on.post(`${Re(e)?e:dt()}/api/v1/sessions/${t}/clientLogs`,{json:{clientLogs:r}});}catch(n){console.log(n);}};var Ns=e=>typeof e=="string"?e:e instanceof Error?e.name+": "+e.message:JSON.stringify(e);var qb=Object.getPrototypeOf(async()=>{}).constructor,Ls=async({content:e,args:t})=>{try{let n=await qb(...t.map(o=>o.id),jP(e))(...t.map(o=>o.value));if(n&&typeof n=="string")return {scriptCallbackMessage:n}}catch(r){return console.log(r),{logs:[{status:"error",description:"Script block failed to execute",details:Ns(r)}]}}},jP=e=>e.replace(/<script>/g,"").replace(/<\/script>/g,""),qi=async({args:e,content:t})=>{try{let n=await qb(...Object.keys(e),t)(...Object.keys(e).map(o=>e[o]));if(n&&typeof n=="string")return {scriptCallbackMessage:n}}catch(r){console.warn("Script threw an error:",r);}};var Wo="Chatwoot Web Widget Opened";var Yb=e=>(Ls(e.scriptToExecute),{scriptCallbackMessage:Wo});var Kb=e=>ue(window.gtag)?Promise.resolve():new Promise(t=>{let r=document.getElementById("gtag");if(!r){let n=document.createElement("script");n.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,n.id="gtag";let o=document.createElement("script");o.innerHTML=`window.dataLayer = window.dataLayer || [];
11
10
  function gtag(){dataLayer.push(arguments);}
12
11
  gtag('js', new Date());
13
12
 
14
13
  gtag('config', '${e}');
15
- `,document.body.appendChild(n),document.body.appendChild(o),n.onload=()=>{t();};}r&&t();}),Ly=e=>{e&&window.gtag&&window.gtag("event",e.action,{event_category:tt(e.category)?void 0:e.category,event_label:tt(e.label)?void 0:e.label,value:e.value,send_to:tt(e.sendTo)?void 0:e.sendTo});};var Ny=async e=>{e?.trackingId&&Ly(e);};var By=async e=>{let{url:t,method:r,body:n,headers:o}=e;try{let i=await fetch(t,{method:r,body:r!=="GET"&&n?JSON.stringify(n):void 0,headers:o}),a=i.status,s=await i.json();return JSON.stringify({statusCode:a,data:s})}catch{return JSON.stringify({statusCode:500,data:"An error occured while executing the webhook on the client"})}};wo(Wy());var pa={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return {type:"text",value:e}}},ma={code:"1",name:"function_call",parse:e=>{if(e==null||typeof e!="object"||!("function_call"in e)||typeof e.function_call!="object"||e.function_call==null||!("name"in e.function_call)||!("arguments"in e.function_call)||typeof e.function_call.name!="string"||typeof e.function_call.arguments!="string")throw new Error('"function_call" parts expect an object with a "function_call" property.');return {type:"function_call",value:e}}},ga={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return {type:"data",value:e}}},ha={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return {type:"error",value:e}}},ba={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return {type:"assistant_message",value:e}}},ya={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return {type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},va={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return {type:"data_message",value:e}}},xa={code:"7",name:"tool_calls",parse:e=>{if(e==null||typeof e!="object"||!("tool_calls"in e)||typeof e.tool_calls!="object"||e.tool_calls==null||!Array.isArray(e.tool_calls)||e.tool_calls.some(t=>t==null||typeof t!="object"||!("id"in t)||typeof t.id!="string"||!("type"in t)||typeof t.type!="string"||!("function"in t)||t.function==null||typeof t.function!="object"||!("arguments"in t.function)||typeof t.function.name!="string"||typeof t.function.arguments!="string"))throw new Error('"tool_calls" parts expect an object with a ToolCallPayload.');return {type:"tool_calls",value:e}}},wa={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return {type:"message_annotations",value:e}}},Ta={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return {type:"tool_call",value:e}}},_a={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return {type:"tool_result",value:e}}},Ca={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return {type:"tool_call_streaming_start",value:e}}},Sa={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return {type:"tool_call_delta",value:e}}},ka={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason};return "usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),{type:"finish_message",value:t}}},Pa={code:"e",name:"finish_step",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason,isContinued:false};return "usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),"isContinued"in e&&typeof e.isContinued=="boolean"&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},AE=[pa,ma,ga,ha,ba,ya,va,xa,wa,Ta,_a,Ca,Sa,ka,Pa],OE={[pa.code]:pa,[ma.code]:ma,[ga.code]:ga,[ha.code]:ha,[ba.code]:ba,[ya.code]:ya,[va.code]:va,[xa.code]:xa,[wa.code]:wa,[Ta.code]:Ta,[_a.code]:_a,[Ca.code]:Ca,[Sa.code]:Sa,[ka.code]:ka,[Pa.code]:Pa};({[pa.name]:pa.code,[ma.name]:ma.code,[ga.name]:ga.code,[ha.name]:ha.code,[ba.name]:ba.code,[ya.name]:ya.code,[va.name]:va.code,[xa.name]:xa.code,[wa.name]:wa.code,[Ta.name]:Ta.code,[_a.name]:_a.code,[Ca.name]:Ca.code,[Sa.name]:Sa.code,[ka.name]:ka.code,[Pa.name]:Pa.code});var RE=AE.map(e=>e.code),DE=e=>{let t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");let r=e.slice(0,t);if(!RE.includes(r))throw new Error(`Failed to parse stream string. Invalid code ${r}.`);let n=r,o=e.slice(t+1),i=JSON.parse(o);return OE[n].parse(i)};var ME=10;function $E(e,t){let r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return e.length=0,r}async function*Vy(e,{isAborted:t}={}){let r=new TextDecoder,n=[],o=0;for(;;){let{value:i}=await e.read();if(i&&(n.push(i),o+=i.length,i[i.length-1]!==ME))continue;if(n.length===0)break;let a=$E(n,o);o=0;let s=r.decode(a,{stream:true}).split(`
16
- `).filter(l=>l!=="").map(DE);for(let l of s)yield l;if(t?.()){e.cancel();break}}}var Ea=null,LE=3,NE=1,Lu=e=>async({messages:t,onMessageStream:r})=>{try{Ea=new AbortController;let n=e.apiHost,o=await fetch((Ne(n)?n:yt())+`/api/v2/sessions/${e.sessionId}/streamMessage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t}),signal:Ea.signal});if(!o.ok)return (e.retryAttempt??0)<NE&&(o.status===403||o.status===500||o.status===503)?(await new Promise(l=>setTimeout(l,LE*1e3)),Lu({...e,retryAttempt:(e.retryAttempt??0)+1})({messages:t,onMessageStream:r})):{error:await o.json()||"Failed to fetch the chat response."};if(!o.body)throw new Error("The response body is empty.");let i="",a=o.body.getReader(),s=Pr();for await(let{type:l,value:c}of Vy(a,{isAborted:()=>Ea===null}))l==="text"&&(i+=c,r&&r({id:s,message:i}));return Ea=null,{message:i}}catch(n){return n.name==="AbortError"?(Ea=null,{error:{message:"Request aborted"}}):n instanceof Error?{error:{message:n.message}}:{error:{message:"Failed to fetch the chat response."}}}};var zy=e=>{let t=document.createElement("script");t.innerHTML=`!function(f,b,e,v,n,t,s)
14
+ `,document.body.appendChild(n),document.body.appendChild(o),n.onload=()=>{t();};}r&&t();}),Xb=e=>{if(e){if(!window.gtag){console.error("Google Analytics was not properly initialized");return}window.gtag("event",e.action,{event_category:Ze(e.category)?void 0:e.category,event_label:Ze(e.label)?void 0:e.label,value:e.value,send_to:Ze(e.sendTo)?void 0:e.sendTo});}};var Zb=async e=>{e?.trackingId&&Xb(e);};var Qb=async e=>{let{url:t,method:r,body:n,headers:o}=e;try{let i=await fetch(t,{method:r,body:r!=="GET"&&n?JSON.stringify(n):void 0,headers:o}),a=i.status,s=await i.json();return JSON.stringify({statusCode:a,data:s})}catch(i){return console.error(i),JSON.stringify({statusCode:500,data:"An error occured while executing the webhook on the client"})}};new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Ki={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return {type:"text",value:e}}},Xi={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return {type:"error",value:e}}},Zi={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return {type:"assistant_message",value:e}}},Qi={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return {type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},Ji={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return {type:"data_message",value:e}}},XP=[Ki,Xi,Zi,Qi,Ji];({[Ki.code]:Ki,[Xi.code]:Xi,[Zi.code]:Zi,[Qi.code]:Qi,[Ji.code]:Ji});({[Ki.name]:Ki.code,[Xi.name]:Xi.code,[Zi.name]:Zi.code,[Qi.name]:Qi.code,[Ji.name]:Ji.code});XP.map(e=>e.code);var ZP={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return {type:"text",value:e}}},QP={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return {type:"data",value:e}}},JP={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return {type:"error",value:e}}},eE={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return {type:"message_annotations",value:e}}},tE={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return {type:"tool_call",value:e}}},rE={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return {type:"tool_result",value:e}}},nE={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return {type:"tool_call_streaming_start",value:e}}},oE={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return {type:"tool_call_delta",value:e}}},iE={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason};return "usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),{type:"finish_message",value:t}}},aE={code:"e",name:"finish_step",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason,isContinued:false};return "usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),"isContinued"in e&&typeof e.isContinued=="boolean"&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},sE={code:"f",name:"start_step",parse:e=>{if(e==null||typeof e!="object"||!("messageId"in e)||typeof e.messageId!="string")throw new Error('"start_step" parts expect an object with an "id" property.');return {type:"start_step",value:{messageId:e.messageId}}}},lE={code:"g",name:"reasoning",parse:e=>{if(typeof e!="string")throw new Error('"reasoning" parts expect a string value.');return {type:"reasoning",value:e}}},cE={code:"h",name:"source",parse:e=>{if(e==null||typeof e!="object")throw new Error('"source" parts expect a Source object.');return {type:"source",value:e}}},uE={code:"i",name:"redacted_reasoning",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string")throw new Error('"redacted_reasoning" parts expect an object with a "data" property.');return {type:"redacted_reasoning",value:{data:e.data}}}},dE={code:"j",name:"reasoning_signature",parse:e=>{if(e==null||typeof e!="object"||!("signature"in e)||typeof e.signature!="string")throw new Error('"reasoning_signature" parts expect an object with a "signature" property.');return {type:"reasoning_signature",value:{signature:e.signature}}}},fE={code:"k",name:"file",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string"||!("mimeType"in e)||typeof e.mimeType!="string")throw new Error('"file" parts expect an object with a "data" and "mimeType" property.');return {type:"file",value:e}}},ru=[ZP,QP,JP,eE,tE,rE,nE,oE,iE,aE,sE,lE,cE,uE,dE,fE],pE=Object.fromEntries(ru.map(e=>[e.code,e]));Object.fromEntries(ru.map(e=>[e.name,e.code]));var mE=ru.map(e=>e.code),gE=e=>{let t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");let r=e.slice(0,t);if(!mE.includes(r))throw new Error(`Failed to parse stream string. Invalid code ${r}.`);let n=r,o=e.slice(t+1),i=JSON.parse(o);return pE[n].parse(i)};var hE=10;function bE(e,t){let r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return e.length=0,r}async function Jb({stream:e,onTextPart:t,onReasoningPart:r,onReasoningSignaturePart:n,onRedactedReasoningPart:o,onSourcePart:i,onFilePart:a,onDataPart:s,onErrorPart:l,onToolCallStreamingStartPart:u,onToolCallDeltaPart:c,onToolCallPart:d,onToolResultPart:p,onMessageAnnotationsPart:f,onFinishMessagePart:b,onFinishStepPart:g,onStartStepPart:y}){let T=e.getReader(),S=new TextDecoder,E=[],h=0;for(;;){let{value:C}=await T.read();if(C&&(E.push(C),h+=C.length,C[C.length-1]!==hE))continue;if(E.length===0)break;let $=bE(E,h);h=0;let H=S.decode($,{stream:true}).split(`
15
+ `).filter(N=>N!=="").map(gE);for(let{type:N,value:_}of H)switch(N){case "text":await t?.(_);break;case "reasoning":await r?.(_);break;case "reasoning_signature":await n?.(_);break;case "redacted_reasoning":await o?.(_);break;case "file":await a?.(_);break;case "source":await i?.(_);break;case "data":await s?.(_);break;case "error":await l?.(_);break;case "message_annotations":await f?.(_);break;case "tool_call_streaming_start":await u?.(_);break;case "tool_call_delta":await c?.(_);break;case "tool_call":await d?.(_);break;case "tool_result":await p?.(_);break;case "finish_message":await b?.(_);break;case "finish_step":await g?.(_);break;case "start_step":await y?.(_);break;default:{let A=N;throw new Error(`Unknown stream part type: ${A}`)}}}}var ey=async({err:e,context:t})=>{try{return typeof e=="string"?{context:t,description:e,details:void 0}:e instanceof Error?"response"in e&&typeof e.response=="object"&&e.response&&"text"in e.response&&typeof e.response.text=="function"?{context:t,description:e.message,details:JSON.stringify(await e.response.text())}:{context:t,description:e.message,details:typeof e.cause=="string"?e.cause:JSON.stringify(e.cause)}:{context:t,description:JSON.stringify(e)}}catch{return {context:t,description:"Unknown error (failed to parse)"}}};var Fs=null,yE=3,xE=1,nu=e=>async({messages:t,onMessageStream:r,onError:n})=>{try{Fs=new AbortController;let o=e.apiHost,i=await fetch((Re(o)?o:dt())+`/api/v2/sessions/${e.sessionId}/streamMessage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t}),signal:Fs.signal});if(!i.ok)return (e.retryAttempt??0)<xE&&(i.status===403||i.status===500||i.status===503)?(await new Promise(l=>setTimeout(l,yE*1e3)),nu({...e,retryAttempt:(e.retryAttempt??0)+1})({messages:t,onMessageStream:r})):{error:{description:"Failed to fetch chat streaming",details:await i.text(),context:"While streaming chat"}};if(!i.body)return {error:{description:"The chat stream response body is empty"}};let a="",s=Wt();return await Jb({stream:i.body,onTextPart:async l=>{a+=l,r&&r({id:s,message:a});},onErrorPart:l=>{n?.(JSON.parse(l));}}),Fs=null,{message:a}}catch(o){return console.error(o),o.name==="AbortError"?(Fs=null,{error:{description:"Request aborted"}}):{error:await ey({err:o,context:"While streaming chat"})}}};var ty=e=>{let t=document.createElement("script");t.innerHTML=`!function(f,b,e,v,n,t,s)
17
16
  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
18
17
  n.callMethod.apply(n,arguments):n.queue.push(arguments)};
19
18
  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
@@ -23,11 +22,34 @@ but received
23
22
  'https://connect.facebook.net/en_US/fbevents.js');
24
23
  ${e.map(r=>`fbq('init', '${r}');`).join(`
25
24
  `)}
26
- fbq('track', 'PageView');`,document.head.appendChild(t);},Gy=e=>{if(!e?.eventType||!e.pixelId||!window.fbq)return;let t=e.params?.length?e.params.reduce((r,n)=>!n.key||!n.value?r:{...r,[n.key]:n.value},{}):void 0;if(e.eventType==="Custom"){if(!e.name)return;window.fbq("trackSingleCustom",e.pixelId,e.name,t);}window.fbq("trackSingle",e.pixelId,e.eventType,t);};var qy=async e=>{tt(e?.pixelId)||Gy(e);};var Yy=({url:e,isNewTab:t}={})=>{if(!e)return;if(!window.open(e,t?"_blank":"_top"))return {blockedPopupUrl:e}};var Nu=e=>{if(ut(e))return null;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return null}};var BE=Object.getPrototypeOf(async()=>{}).constructor,Ky=async({content:e,args:t,isCode:r})=>{try{if(!isNaN(e)&&/0[^.].+/.test(e))return {replyToSend:e};let o=await BE(...t.map(i=>i.id),e.includes("return ")?e:`return ${e}`)(...t.map(i=>i.value));return {replyToSend:Nu(o)??void 0}}catch(n){return {replyToSend:Nu(e)??void 0,logs:r?[{status:"error",description:"Failed to execute Set Variable code",details:dl(n)}]:void 0}}};var Xy=async({secondsToWaitFor:e})=>{await new Promise(t=>setTimeout(t,e*1e3));};var Qy=class extends Event{message;error;constructor(e,t){super("error",t),this.message=e.message,this.error=e;}},Jy=class extends Event{code;reason;wasClean=true;constructor(e=1e3,t="",r){super("close",r),this.code=e,this.reason=t;}},Bu={Event,ErrorEvent:Qy,CloseEvent:Jy};function FE(e,t){if(!e)throw new Error(t)}function UE(e){return new e.constructor(e.type,e)}function jE(e){return "data"in e?new MessageEvent(e.type,e):"code"in e||"reason"in e?new Jy(e.code||1999,e.reason||"unknown reason",e):"error"in e?new Qy(e.error,e):new Event(e.type,e)}var HE=typeof process<"u"&&typeof process.versions?.node<"u"&&typeof document>"u",pl=HE?jE:UE,Xn={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0},Zy=false,Fu=class Zn extends EventTarget{_ws;_retryCount=-1;_uptimeTimeout;_connectTimeout;_shouldReconnect=true;_connectLock=false;_binaryType="blob";_closeCalled=false;_messageQueue=[];_debugLogger=void 0;_url;_protocols;_options;constructor(t,r,n={}){super(),this._url=t,this._protocols=r,this._options=n,this._options.startClosed&&(this._shouldReconnect=false),this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect();}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return Zn.CONNECTING}get OPEN(){return Zn.OPEN}get CLOSING(){return Zn.CLOSING}get CLOSED(){return Zn.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t);}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((r,n)=>(typeof n=="string"?r+=n.length:n instanceof Blob?r+=n.size:r+=n.byteLength,r),0)+(this._ws?this._ws.bufferedAmount:0)}get extensions(){return this._ws?this._ws.extensions:""}get protocol(){return this._ws?this._ws.protocol:""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?Zn.CLOSED:Zn.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}onclose=null;onerror=null;onmessage=null;onopen=null;close(t=1e3,r){if(this._closeCalled=true,this._shouldReconnect=false,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(t,r);}reconnect(t,r){this._shouldReconnect=true,this._closeCalled=false,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(t,r),this._connect());}send(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else {let{maxEnqueuedMessages:r=Xn.maxEnqueuedMessages}=this._options;this._messageQueue.length<r&&(this._debug("enqueue",t),this._messageQueue.push(t));}}_debug(...t){this._options.debug&&this._debugLogger("RWS>",...t);}_getNextDelay(){let{reconnectionDelayGrowFactor:t=Xn.reconnectionDelayGrowFactor,minReconnectionDelay:r=Xn.minReconnectionDelay,maxReconnectionDelay:n=Xn.maxReconnectionDelay}=this._options,o=0;return this._retryCount>0&&(o=r*Math.pow(t,this._retryCount-1),o>n&&(o=n)),this._debug("next delay",o),o}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay());})}_getNextProtocols(t){if(!t)return Promise.resolve(null);if(typeof t=="string"||Array.isArray(t))return Promise.resolve(t);if(typeof t=="function"){let r=t();if(!r)return Promise.resolve(null);if(typeof r=="string"||Array.isArray(r))return Promise.resolve(r);if(r.then)return r}throw Error("Invalid protocols")}_getNextUrl(t){if(typeof t=="string")return Promise.resolve(t);if(typeof t=="function"){let r=t();if(typeof r=="string")return Promise.resolve(r);if(r.then)return r}throw Error("Invalid URL")}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=true;let{maxRetries:t=Xn.maxRetries,connectionTimeout:r=Xn.connectionTimeout}=this._options;if(this._retryCount>=t){this._debug("max retries reached",this._retryCount,">=",t);return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>Promise.all([this._getNextUrl(this._url),this._getNextProtocols(this._protocols||null)])).then(([n,o])=>{if(this._closeCalled){this._connectLock=false;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!Zy&&(Zy=true);let i=this._options.WebSocket||WebSocket;this._debug("connect",{url:n,protocols:o}),this._ws=o?new i(n,o):new i(n),this._ws.binaryType=this._binaryType,this._connectLock=false,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),r);}).catch(n=>{this._connectLock=false,this._handleError(new Bu.ErrorEvent(Error(n.message),this));});}_handleTimeout(){this._debug("timeout event"),this._handleError(new Bu.ErrorEvent(Error("TIMEOUT"),this));}_disconnect(t=1e3,r){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,r),this._handleClose(new Bu.CloseEvent(t,r,this));}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0;}_handleOpen=t=>{this._debug("open event");let{minUptime:r=Xn.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),r),FE(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(n=>this._ws?.send(n)),this._messageQueue=[],this.onopen&&this.onopen(t),this.dispatchEvent(pl(t));};_handleMessage=t=>{this._debug("message event"),this.onmessage&&this.onmessage(t),this.dispatchEvent(pl(t));};_handleError=t=>{this._debug("error event",t.message),this._disconnect(void 0,t.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(t),this._debug("exec error listeners"),this.dispatchEvent(pl(t)),this._connect();};_handleClose=t=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(t),this.dispatchEvent(pl(t));};_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError));}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError));}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout);}};var WE=e=>e[1]!==null&&e[1]!==void 0;function VE(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();let e=new Date().getTime(),t=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let n=Math.random()*16;return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),(r==="x"?n:n&3|8).toString(16)})}function tv(e,t,r={}){let{host:n,path:o,protocol:i,room:a,party:s,prefix:l,query:c}=e,u=n.replace(/^(http|https|ws|wss):\/\//,"");if(u.endsWith("/")&&(u=u.slice(0,-1)),o&&o.startsWith("/"))throw new Error("path must not start with a slash");let d=s??"main",f=o?`/${o}`:"",p=i||(u.startsWith("localhost:")||u.startsWith("127.0.0.1:")||u.startsWith("192.168.")||u.startsWith("10.")||u.startsWith("172.")&&u.split(".")[1]>="16"&&u.split(".")[1]<="31"||u.startsWith("[::ffff:7f00:1]:")?t:t+"s"),g=`${p}://${u}/${l||`parties/${d}/${a}`}${f}`,h=(y={})=>`${g}?${new URLSearchParams([...Object.entries(r),...Object.entries(y).filter(WE)])}`,b=typeof c=="function"?async()=>h(await c()):h(c);return {host:u,path:f,room:a,name:d,protocol:p,partyUrl:g,urlProvider:b}}var Uu=class extends Fu{constructor(e){let t=ev(e);super(t.urlProvider,t.protocols,t.socketOptions),this.partySocketOptions=e,this.setWSProperties(t);}_pk;_pkurl;name;room;host;path;updateProperties(e){let t=ev({...this.partySocketOptions,...e,host:e.host??this.host,room:e.room??this.room,path:e.path??this.path});this._url=t.urlProvider,this._protocols=t.protocols,this._options=t.socketOptions,this.setWSProperties(t);}setWSProperties(e){let{_pk:t,_pkurl:r,name:n,room:o,host:i,path:a}=e;this._pk=t,this._pkurl=r,this.name=n,this.room=o,this.host=i,this.path=a;}reconnect(e,t){if(!this.room||!this.host)throw new Error("The room and host must be set before connecting, use `updateProperties` method to set them or pass them to the constructor.");super.reconnect(e,t);}get id(){return this._pk}get roomUrl(){return this._pkurl}static async fetch(e,t){let r=tv(e,"http"),n=typeof r.urlProvider=="string"?r.urlProvider:await r.urlProvider();return (e.fetch??fetch)(n,t)}};function ev(e){let{id:t,host:r,path:n,party:o,room:i,protocol:a,query:s,protocols:l,...c}=e,u=t||VE(),d=tv(e,"ws",{_pk:u});return {_pk:u,_pkurl:d.partyUrl,name:d.name,room:d.room,host:d.host,path:d.path,protocols:l,socketOptions:c,urlProvider:d.urlProvider}}var rv=({sessionId:e,resultId:t})=>{let r=Er("NEXT_PUBLIC_PARTYKIT_HOST");if(!r)return;let n=new Uu({host:r,room:zE({sessionId:e,resultId:t})});return new Promise(o=>{n.addEventListener("message",i=>{n.close(),o({replyToSend:i.data});}),n.addEventListener("error",i=>{o({logs:[{status:"error",description:"Websocket returned an error",details:JSON.stringify(i,null,2)}],replyToSend:void 0});});})},zE=({sessionId:e,resultId:t})=>{if(t)return `${t}/webhooks`;let[r,n]=e.split("-");return `${n}/${r}/webhooks`};var nv=e=>{if(document.getElementById("gtm-noscript"))return "";let t=document.createElement("noscript");t.id="gtm-noscript";let r=document.createElement("iframe");return r.src=`https://www.googletagmanager.com/ns.html?id=${e}`,r.height="0",r.width="0",r.style.display="none",r.style.visibility="hidden",t.appendChild(r),t};var ov=async e=>{let t=e.customHeadCode;Ne(t)&&tm(t);let r=e.gtmId;Ne(r)&&document.body.prepend(nv(r));let n=e.googleAnalyticsId;Ne(n)&&await $y(n);let o=e.pixelIds;pe(o)&&zy(o);};var iv=async({clientSideAction:e,context:t,onMessageStream:r})=>{if("chatwoot"in e)return My(e.chatwoot);if("googleAnalytics"in e)return Ny(e.googleAnalytics);if("scriptToExecute"in e)return fl(e.scriptToExecute);if("redirect"in e)return Yy(e.redirect);if("wait"in e)return await Xy(e.wait),e.expectsDedicatedReply?{replyToSend:void 0}:void 0;if("setVariable"in e)return Ky(e.setVariable.scriptToExecute);if("streamOpenAiChatCompletion"in e||"stream"in e){let{error:n,message:o}=await Lu(t)({messages:"streamOpenAiChatCompletion"in e?e.streamOpenAiChatCompletion?.messages:void 0,onMessageStream:r});return n?{replyToSend:void 0,logs:[{status:"error",description:"Message streaming returned an error",details:JSON.stringify(n,null,2)}]}:{replyToSend:o}}if("httpRequestToExecute"in e)return {replyToSend:await By(e.httpRequestToExecute)};if("startPropsToInject"in e)return ov(e.startPropsToInject);if("pixel"in e)return qy(e.pixel);if("codeToExecute"in e)return da(e.codeToExecute);if(e.type==="listenForWebhook")return rv({sessionId:t.sessionId,resultId:t.resultId})};var[ml,ju]=M([]);var av=e=>e.type==="text"?e.label??e.value:e.url;var[Hu,Wu]=M();var GE=w('<svg><circle class=opacity-25 cx=12 cy=12 r=10 stroke=currentColor stroke-width=4></circle><path class=opacity-75 fill=currentColor d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">'),ni=e=>(()=>{var t=GE();return De(t,Re(e,{get class(){return "animate-spin h-6 w-6 "+e.class},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),true,true),t})();var qE=w("<button>"),Tr=e=>{let t=us(()=>e.children),[r,n]=rt(e,["variant","isDisabled","isLoading"]);return (()=>{var o=qE();return De(o,Re(n,{get disabled(){return r.isDisabled||r.isLoading},get class(){return xe("py-2 px-4 font-semibold focus:outline-none filter hover:brightness-90 active:brightness-75 disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 flex justify-center flex-shrink-0",r.variant==="secondary"?" secondary-button":" agent-button",n.class)}}),false,true),v(o,m(W,{get when(){return !r.isLoading},get fallback(){return m(ni,{})},get children(){return t()}})),o})()};var YE=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),Ur=e=>(()=>{var t=YE();return De(t,e,true,true),t})();var KE=w('<button class="w-5 h-5">'),XE=w('<div class="flex justify-between items-center gap-2 w-full pr-4"><input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"type=text>'),Cn=e=>{let[t,r]=M(""),[n,o]=rt(e,["onInput","ref"]),i=s=>{r(s),n.onInput(s);},a=()=>{r(""),e.onClear();};return (()=>{var s=XE(),l=s.firstChild;l.$$input=u=>i(u.currentTarget.value);var c=e.ref;return typeof c=="function"?be(c,l):e.ref=l,De(l,Re({get value(){return t()}},o),false,false),v(s,m(W,{get when(){return t().length>0},get children(){var u=KE();return ot(u,"click",a),v(u,m(Ur,{})),u}}),null),s})()};Ge(["input"]);var it="Send";var Ia={buttonLabel:it,searchInputPlaceholder:"Filter the options..."};var ZE=w('<div class="flex items-end agent-input w-full">'),QE=w('<div class="flex flex-col gap-2 w-full"><div>'),JE=w("<span>"),eI=w('<span class="flex h-3 w-3 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-3 w-3 brightness-150">'),sv=e=>{let t,[r,n]=M(e.options?.isSearchable&&!e.options?.areInitialSearchButtonsVisible?[]:e.defaultItems);ce(()=>{!X()&&t&&t.focus({preventScroll:true});});let o=a=>e.onSubmit({type:"text",value:r()[a]?.content??""}),i=a=>{if(a===""||a.trim().length===0){n(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[]);return}n(e.defaultItems.filter(s=>s.content?.toLowerCase().includes(a.toLowerCase())));};return (()=>{var a=QE(),s=a.firstChild;return v(a,m(W,{get when(){return e.options?.isSearchable},get children(){var l=ZE();return v(l,m(Cn,{ref(c){var u=t;typeof u=="function"?u(c):t=c;},onInput:i,get placeholder(){return e.options?.searchInputPlaceholder??Ia.searchInputPlaceholder},onClear:()=>n(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[])})),l}}),s),v(s,m(ke,{get each(){return r()},children:(l,c)=>(()=>{var u=JE();return v(u,m(Tr,{"on:click":()=>o(c()),get"data-itemid"(){return l.id},class:"w-full",get children(){return l.content}}),null),v(u,(()=>{var d=B(()=>e.chunkIndex===0&&e.defaultItems.length===1);return ()=>d()&&eI()})(),null),$(()=>j(u,"relative"+(X()?" w-full":""))),u})()})),$(()=>j(s,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-80 rounded-md":""))),a})()};var tI=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 512 512"width=19px color=white><path d="M476.59 227.05l-.16-.07L49.35 49.84A23.56 23.56 0 0027.14 52 24.65 24.65 0 0016 72.59v113.29a24 24 0 0019.52 23.57l232.93 43.07a4 4 0 010 7.86L35.53 303.45A24 24 0 0016 327v113.31A23.57 23.57 0 0026.59 460a23.94 23.94 0 0013.22 4 24.55 24.55 0 009.52-1.93L476.4 285.94l.19-.09a32 32 0 000-58.8z">'),lv=e=>(()=>{var t=tI();return De(t,e,true,true),t})();var Xe=e=>{let[t,r]=rt(e,["isDisabled","isLoading","disableIcon"]),n=X()&&!t.disableIcon||!r.children||typeof r.children=="string"&&tt(r.children);return m(Tr,Re(r,{type:"submit",get class(){return xe(r.class,"flex items-center")},"aria-label":n?"Send":void 0,get children(){return m(He,{get children(){return [m(J,{when:n,get children(){return m(lv,{get class(){return "send-icon flex w-6 h-6 "+(t.disableIcon?"hidden":"")}})}}),m(J,{when:!n,get children(){return e.children}})]}})}}))};var rI=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3px stroke-linecap=round stroke-linejoin=round><polyline points="20 6 9 17 4 12">'),cv=e=>(()=>{var t=rI();return De(t,e,true,true),t})();var nI=w("<div>"),oi=e=>(()=>{var t=nI();return v(t,m(W,{get when(){return e.isChecked},get children(){return m(cv,{})}})),$(()=>j(t,"w-4 h-4 agent-checkbox"+(e.isChecked?" checked":"")+(e.class?` ${e.class}`:""))),t})();var oI=w('<div class="flex items-end agent-input w-full">'),iI=w('<form class="flex flex-col items-end gap-2 w-full"><div>'),aI=w('<span><div role=checkbox><div class="flex items-center gap-2"><span>'),sI=w('<span><div role=checkbox aria-checked class="w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none agent-selectable selected"><div class="flex items-center gap-2"><span>'),uv=e=>{let t,[r,n]=M(e.options?.isSearchable&&!e.options?.areInitialSearchButtonsVisible?[]:e.defaultItems),[o,i]=M([]);ce(()=>{!X()&&t&&t.focus({preventScroll:true});});let a=u=>{s(u);},s=u=>{let d=o().indexOf(u);i(d!==-1?f=>f.filter(p=>p!==u):f=>[...f,u]);},l=()=>e.onSubmit({type:"text",value:o().map(u=>e.defaultItems.find(d=>d.id===u)?.content).join(", ")}),c=u=>{if(u===""||u.trim().length===0){n(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[]);return}n(e.defaultItems.filter(d=>d.content?.toLowerCase().includes(u.toLowerCase())));};return (()=>{var u=iI(),d=u.firstChild;return u.addEventListener("submit",l),v(u,m(W,{get when(){return e.options?.isSearchable},get children(){var f=oI();return v(f,m(Cn,{ref(p){var g=t;typeof g=="function"?g(p):t=p;},onInput:c,get placeholder(){return e.options?.searchInputPlaceholder??Ia.searchInputPlaceholder},onClear:()=>n(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[])})),f}}),d),v(d,m(ke,{get each(){return r()},children:f=>(()=>{var p=aI(),g=p.firstChild,h=g.firstChild,b=h.firstChild;return ot(g,"click",()=>a(f.id)),v(h,m(oi,{get isChecked(){return o().some(y=>y===f.id)},class:"flex-shrink-0"}),b),v(b,()=>f.content),$(y=>{var S="relative"+(X()?" w-full":""),C=o().some(U=>U===f.id),k="w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none agent-selectable"+(o().some(U=>U===f.id)?" selected":""),D=f.id;return S!==y.e&&j(p,y.e=S),C!==y.t&&G(g,"aria-checked",y.t=C),k!==y.a&&j(g,y.a=k),D!==y.o&&G(g,"data-itemid",y.o=D),y},{e:void 0,t:void 0,a:void 0,o:void 0}),p})()}),null),v(d,m(ke,{get each(){return o().filter(f=>r().every(p=>p.id!==f))},children:f=>(()=>{var p=sI(),g=p.firstChild,h=g.firstChild,b=h.firstChild;return ot(g,"click",()=>a(f)),G(g,"data-itemid",f),v(h,m(oi,{isChecked:true}),b),v(b,()=>e.defaultItems.find(y=>y.id===f)?.content),$(()=>j(p,"relative"+(X()?" w-full":""))),p})()}),null),v(u,(()=>{var f=B(()=>o().length>0);return ()=>f()&&m(Xe,{disableIcon:true,get children(){return e.options?.buttonLabel??Ia.buttonLabel}})})(),null),$(()=>j(d,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-80 rounded-md":""))),u})()};var Qn={hasTime:false,isRange:false,labels:{button:it,from:"From:",to:"To:"},format:"dd/MM/yyyy",formatWithTime:"dd/MM/yyyy HH:mm"};function $t(e){"@babel/helpers - typeof";return $t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t(e)}function Ze(e){if(e===null||e===true||e===false)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function _e(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Be(e){_e(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||$t(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):new Date(NaN)}function Vu(e,t){_e(2,arguments);var r=Be(e).getTime(),n=Ze(t);return new Date(r+n)}var lI={};function sr(){return lI}function Aa(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var dv=6e4,fv=36e5,pv=1e3;function zu(e){return _e(1,arguments),e instanceof Date||$t(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Gu(e){if(_e(1,arguments),!zu(e)&&typeof e!="number")return false;var t=Be(e);return !isNaN(Number(t))}function Oa(e,t){_e(2,arguments);var r=Ze(t);return Vu(e,-r)}var mI=864e5;function qu(e){_e(1,arguments);var t=Be(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),o=r-n;return Math.floor(o/mI)+1}function lr(e){_e(1,arguments);var t=1,r=Be(e),n=r.getUTCDay(),o=(n<t?7:0)+n-t;return r.setUTCDate(r.getUTCDate()-o),r.setUTCHours(0,0,0,0),r}function Ra(e){_e(1,arguments);var t=Be(e),r=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(r+1,0,4),n.setUTCHours(0,0,0,0);var o=lr(n),i=new Date(0);i.setUTCFullYear(r,0,4),i.setUTCHours(0,0,0,0);var a=lr(i);return t.getTime()>=o.getTime()?r+1:t.getTime()>=a.getTime()?r:r-1}function Yu(e){_e(1,arguments);var t=Ra(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=lr(r);return n}var gI=6048e5;function Da(e){_e(1,arguments);var t=Be(e),r=lr(t).getTime()-Yu(t).getTime();return Math.round(r/gI)+1}function qt(e,t){var r,n,o,i,a,s,l,c;_e(1,arguments);var u=sr(),d=Ze((r=(n=(o=(i=t?.weekStartsOn)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&o!==void 0?o:u.weekStartsOn)!==null&&n!==void 0?n:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Be(e),p=f.getUTCDay(),g=(p<d?7:0)+p-d;return f.setUTCDate(f.getUTCDate()-g),f.setUTCHours(0,0,0,0),f}function Jn(e,t){var r,n,o,i,a,s,l,c;_e(1,arguments);var u=Be(e),d=u.getUTCFullYear(),f=sr(),p=Ze((r=(n=(o=(i=t?.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&o!==void 0?o:f.firstWeekContainsDate)!==null&&n!==void 0?n:(l=f.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&r!==void 0?r:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var g=new Date(0);g.setUTCFullYear(d+1,0,p),g.setUTCHours(0,0,0,0);var h=qt(g,t),b=new Date(0);b.setUTCFullYear(d,0,p),b.setUTCHours(0,0,0,0);var y=qt(b,t);return u.getTime()>=h.getTime()?d+1:u.getTime()>=y.getTime()?d:d-1}function Ku(e,t){var r,n,o,i,a,s,l,c;_e(1,arguments);var u=sr(),d=Ze((r=(n=(o=(i=t?.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&o!==void 0?o:u.firstWeekContainsDate)!==null&&n!==void 0?n:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&r!==void 0?r:1),f=Jn(e,t),p=new Date(0);p.setUTCFullYear(f,0,d),p.setUTCHours(0,0,0,0);var g=qt(p,t);return g}var hI=6048e5;function Ma(e,t){_e(1,arguments);var r=Be(e),n=qt(r,t).getTime()-Ku(r,t).getTime();return Math.round(n/hI)+1}function Fe(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return r+n}var bI={y:function(t,r){var n=t.getUTCFullYear(),o=n>0?n:1-n;return Fe(r==="yy"?o%100:o,r.length)},M:function(t,r){var n=t.getUTCMonth();return r==="M"?String(n+1):Fe(n+1,2)},d:function(t,r){return Fe(t.getUTCDate(),r.length)},a:function(t,r){var n=t.getUTCHours()/12>=1?"pm":"am";switch(r){case "a":case "aa":return n.toUpperCase();case "aaa":return n;case "aaaaa":return n[0];case "aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(t,r){return Fe(t.getUTCHours()%12||12,r.length)},H:function(t,r){return Fe(t.getUTCHours(),r.length)},m:function(t,r){return Fe(t.getUTCMinutes(),r.length)},s:function(t,r){return Fe(t.getUTCSeconds(),r.length)},S:function(t,r){var n=r.length,o=t.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,n-3));return Fe(i,r.length)}},tn=bI;var ii={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},yI={G:function(t,r,n){var o=t.getUTCFullYear()>0?1:0;switch(r){case "G":case "GG":case "GGG":return n.era(o,{width:"abbreviated"});case "GGGGG":return n.era(o,{width:"narrow"});case "GGGG":default:return n.era(o,{width:"wide"})}},y:function(t,r,n){if(r==="yo"){var o=t.getUTCFullYear(),i=o>0?o:1-o;return n.ordinalNumber(i,{unit:"year"})}return tn.y(t,r)},Y:function(t,r,n,o){var i=Jn(t,o),a=i>0?i:1-i;if(r==="YY"){var s=a%100;return Fe(s,2)}return r==="Yo"?n.ordinalNumber(a,{unit:"year"}):Fe(a,r.length)},R:function(t,r){var n=Ra(t);return Fe(n,r.length)},u:function(t,r){var n=t.getUTCFullYear();return Fe(n,r.length)},Q:function(t,r,n){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(r){case "Q":return String(o);case "QQ":return Fe(o,2);case "Qo":return n.ordinalNumber(o,{unit:"quarter"});case "QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case "QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});case "QQQQ":default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,r,n){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(r){case "q":return String(o);case "qq":return Fe(o,2);case "qo":return n.ordinalNumber(o,{unit:"quarter"});case "qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case "qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});case "qqqq":default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,r,n){var o=t.getUTCMonth();switch(r){case "M":case "MM":return tn.M(t,r);case "Mo":return n.ordinalNumber(o+1,{unit:"month"});case "MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case "MMMMM":return n.month(o,{width:"narrow",context:"formatting"});case "MMMM":default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(t,r,n){var o=t.getUTCMonth();switch(r){case "L":return String(o+1);case "LL":return Fe(o+1,2);case "Lo":return n.ordinalNumber(o+1,{unit:"month"});case "LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case "LLLLL":return n.month(o,{width:"narrow",context:"standalone"});case "LLLL":default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(t,r,n,o){var i=Ma(t,o);return r==="wo"?n.ordinalNumber(i,{unit:"week"}):Fe(i,r.length)},I:function(t,r,n){var o=Da(t);return r==="Io"?n.ordinalNumber(o,{unit:"week"}):Fe(o,r.length)},d:function(t,r,n){return r==="do"?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):tn.d(t,r)},D:function(t,r,n){var o=qu(t);return r==="Do"?n.ordinalNumber(o,{unit:"dayOfYear"}):Fe(o,r.length)},E:function(t,r,n){var o=t.getUTCDay();switch(r){case "E":case "EE":case "EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case "EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case "EEEEEE":return n.day(o,{width:"short",context:"formatting"});case "EEEE":default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(t,r,n,o){var i=t.getUTCDay(),a=(i-o.weekStartsOn+8)%7||7;switch(r){case "e":return String(a);case "ee":return Fe(a,2);case "eo":return n.ordinalNumber(a,{unit:"day"});case "eee":return n.day(i,{width:"abbreviated",context:"formatting"});case "eeeee":return n.day(i,{width:"narrow",context:"formatting"});case "eeeeee":return n.day(i,{width:"short",context:"formatting"});case "eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,r,n,o){var i=t.getUTCDay(),a=(i-o.weekStartsOn+8)%7||7;switch(r){case "c":return String(a);case "cc":return Fe(a,r.length);case "co":return n.ordinalNumber(a,{unit:"day"});case "ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case "ccccc":return n.day(i,{width:"narrow",context:"standalone"});case "cccccc":return n.day(i,{width:"short",context:"standalone"});case "cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,r,n){var o=t.getUTCDay(),i=o===0?7:o;switch(r){case "i":return String(i);case "ii":return Fe(i,r.length);case "io":return n.ordinalNumber(i,{unit:"day"});case "iii":return n.day(o,{width:"abbreviated",context:"formatting"});case "iiiii":return n.day(o,{width:"narrow",context:"formatting"});case "iiiiii":return n.day(o,{width:"short",context:"formatting"});case "iiii":default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(t,r,n){var o=t.getUTCHours(),i=o/12>=1?"pm":"am";switch(r){case "a":case "aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case "aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case "aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case "aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,r,n){var o=t.getUTCHours(),i;switch(o===12?i=ii.noon:o===0?i=ii.midnight:i=o/12>=1?"pm":"am",r){case "b":case "bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case "bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case "bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case "bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,r,n){var o=t.getUTCHours(),i;switch(o>=17?i=ii.evening:o>=12?i=ii.afternoon:o>=4?i=ii.morning:i=ii.night,r){case "B":case "BB":case "BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case "BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case "BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,r,n){if(r==="ho"){var o=t.getUTCHours()%12;return o===0&&(o=12),n.ordinalNumber(o,{unit:"hour"})}return tn.h(t,r)},H:function(t,r,n){return r==="Ho"?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):tn.H(t,r)},K:function(t,r,n){var o=t.getUTCHours()%12;return r==="Ko"?n.ordinalNumber(o,{unit:"hour"}):Fe(o,r.length)},k:function(t,r,n){var o=t.getUTCHours();return o===0&&(o=24),r==="ko"?n.ordinalNumber(o,{unit:"hour"}):Fe(o,r.length)},m:function(t,r,n){return r==="mo"?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):tn.m(t,r)},s:function(t,r,n){return r==="so"?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):tn.s(t,r)},S:function(t,r){return tn.S(t,r)},X:function(t,r,n,o){var i=o._originalDate||t,a=i.getTimezoneOffset();if(a===0)return "Z";switch(r){case "X":return hv(a);case "XXXX":case "XX":return eo(a);case "XXXXX":case "XXX":default:return eo(a,":")}},x:function(t,r,n,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(r){case "x":return hv(a);case "xxxx":case "xx":return eo(a);case "xxxxx":case "xxx":default:return eo(a,":")}},O:function(t,r,n,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(r){case "O":case "OO":case "OOO":return "GMT"+gv(a,":");case "OOOO":default:return "GMT"+eo(a,":")}},z:function(t,r,n,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(r){case "z":case "zz":case "zzz":return "GMT"+gv(a,":");case "zzzz":default:return "GMT"+eo(a,":")}},t:function(t,r,n,o){var i=o._originalDate||t,a=Math.floor(i.getTime()/1e3);return Fe(a,r.length)},T:function(t,r,n,o){var i=o._originalDate||t,a=i.getTime();return Fe(a,r.length)}};function gv(e,t){var r=e>0?"-":"+",n=Math.abs(e),o=Math.floor(n/60),i=n%60;if(i===0)return r+String(o);var a=t;return r+String(o)+a+Fe(i,2)}function hv(e,t){if(e%60===0){var r=e>0?"-":"+";return r+Fe(Math.abs(e)/60,2)}return eo(e,t)}function eo(e,t){var r=t||"",n=e>0?"-":"+",o=Math.abs(e),i=Fe(Math.floor(o/60),2),a=Fe(o%60,2);return n+i+r+a}var bv=yI;var yv=function(t,r){switch(t){case "P":return r.date({width:"short"});case "PP":return r.date({width:"medium"});case "PPP":return r.date({width:"long"});case "PPPP":default:return r.date({width:"full"})}},vv=function(t,r){switch(t){case "p":return r.time({width:"short"});case "pp":return r.time({width:"medium"});case "ppp":return r.time({width:"long"});case "pppp":default:return r.time({width:"full"})}},vI=function(t,r){var n=t.match(/(P+)(p+)?/)||[],o=n[1],i=n[2];if(!i)return yv(t,r);var a;switch(o){case "P":a=r.dateTime({width:"short"});break;case "PP":a=r.dateTime({width:"medium"});break;case "PPP":a=r.dateTime({width:"long"});break;case "PPPP":default:a=r.dateTime({width:"full"});break}return a.replace("{{date}}",yv(o,r)).replace("{{time}}",vv(i,r))},xI={p:vv,P:vI},$a=xI;var wI=["D","DD"],TI=["YY","YYYY"];function gl(e){return wI.indexOf(e)!==-1}function hl(e){return TI.indexOf(e)!==-1}function ai(e,t,r){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var _I={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},CI=function(t,r,n){var o,i=_I[t];return typeof i=="string"?o=i:r===1?o=i.one:o=i.other.replace("{{count}}",r.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o},xv=CI;function La(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.width?String(t.width):e.defaultWidth,n=e.formats[r]||e.formats[e.defaultWidth];return n}}var SI={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},kI={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},PI={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},EI={date:La({formats:SI,defaultWidth:"full"}),time:La({formats:kI,defaultWidth:"full"}),dateTime:La({formats:PI,defaultWidth:"full"})},wv=EI;var II={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},AI=function(t,r,n,o){return II[t]},Tv=AI;function to(e){return function(t,r){var n=r!=null&&r.context?String(r.context):"standalone",o;if(n==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=r!=null&&r.width?String(r.width):i;o=e.formattingValues[a]||e.formattingValues[i];}else {var s=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;o=e.values[l]||e.values[s];}var c=e.argumentCallback?e.argumentCallback(t):t;return o[c]}}var OI={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},RI={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},DI={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},MI={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},$I={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},LI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},NI=function(t,r){var n=Number(t),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},BI={ordinalNumber:NI,era:to({values:OI,defaultWidth:"wide"}),quarter:to({values:RI,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:to({values:DI,defaultWidth:"wide"}),day:to({values:MI,defaultWidth:"wide"}),dayPeriod:to({values:$I,defaultWidth:"wide",formattingValues:LI,defaultFormattingWidth:"wide"})},_v=BI;function ro(e){return function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a=i[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?UI(s,function(d){return d.test(a)}):FI(s,function(d){return d.test(a)}),c;c=e.valueCallback?e.valueCallback(l):l,c=r.valueCallback?r.valueCallback(c):c;var u=t.slice(a.length);return {value:c,rest:u}}}function FI(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}function UI(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r}function Xu(e){return function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.match(e.matchPattern);if(!n)return null;var o=n[0],i=t.match(e.parsePattern);if(!i)return null;var a=e.valueCallback?e.valueCallback(i[0]):i[0];a=r.valueCallback?r.valueCallback(a):a;var s=t.slice(o.length);return {value:a,rest:s}}}var jI=/^(\d+)(th|st|nd|rd)?/i,HI=/\d+/i,WI={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},VI={any:[/^b/i,/^(a|c)/i]},zI={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},GI={any:[/1/i,/2/i,/3/i,/4/i]},qI={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},YI={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},KI={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},XI={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ZI={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},QI={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},JI={ordinalNumber:Xu({matchPattern:jI,parsePattern:HI,valueCallback:function(t){return parseInt(t,10)}}),era:ro({matchPatterns:WI,defaultMatchWidth:"wide",parsePatterns:VI,defaultParseWidth:"any"}),quarter:ro({matchPatterns:zI,defaultMatchWidth:"wide",parsePatterns:GI,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:ro({matchPatterns:qI,defaultMatchWidth:"wide",parsePatterns:YI,defaultParseWidth:"any"}),day:ro({matchPatterns:KI,defaultMatchWidth:"wide",parsePatterns:XI,defaultParseWidth:"any"}),dayPeriod:ro({matchPatterns:ZI,defaultMatchWidth:"any",parsePatterns:QI,defaultParseWidth:"any"})},Cv=JI;var e1={code:"en-US",formatDistance:xv,formatLong:wv,formatRelative:Tv,localize:_v,match:Cv,options:{weekStartsOn:0,firstWeekContainsDate:1}},Sv=e1;var bl=Sv;var t1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,r1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,n1=/^'([^]*?)'?$/,o1=/''/g,i1=/[a-zA-Z]/;function yl(e,t,r){var n,o,i,a,s,l,d,f,p,g,h,b,C,k;_e(2,arguments);var D=String(t),U=sr(),N=(n=(o=r?.locale)!==null&&o!==void 0?o:U.locale)!==null&&n!==void 0?n:bl,ie=Ze((i=(a=(s=(l=r?.firstWeekContainsDate)!==null&&l!==void 0?l:void 0)!==null&&s!==void 0?s:U.firstWeekContainsDate)!==null&&a!==void 0?a:(d=U.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(ie>=1&&ie<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var I=Ze((p=(g=(h=(b=r?.weekStartsOn)!==null&&b!==void 0?b:void 0)!==null&&h!==void 0?h:U.weekStartsOn)!==null&&g!==void 0?g:(C=U.locale)===null||C===void 0||(k=C.options)===null||k===void 0?void 0:k.weekStartsOn)!==null&&p!==void 0?p:0);if(!(I>=0&&I<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!N.localize)throw new RangeError("locale must contain localize property");if(!N.formatLong)throw new RangeError("locale must contain formatLong property");var A=Be(e);if(!Gu(A))throw new RangeError("Invalid time value");var R=Aa(A),E=Oa(A,R),_={firstWeekContainsDate:ie,weekStartsOn:I,locale:N,_originalDate:A},T=D.match(r1).map(function(O){var L=O[0];if(L==="p"||L==="P"){var z=$a[L];return z(O,N.formatLong)}return O}).join("").match(t1).map(function(O){if(O==="''")return "'";var L=O[0];if(L==="'")return a1(O);var z=bv[L];if(z)return hl(O)&&ai(O,t,String(e)),gl(O)&&ai(O,t,String(e)),z(E,O,N.localize,_);if(L.match(i1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+L+"`");return O}).join("");return T}function a1(e){var t=e.match(n1);return t?t[1].replace(o1,"'"):e}function Zu(e,t){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}function Qu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function kv(e,t){if(e){if(typeof e=="string")return Qu(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Qu(e,t):void 0}}function Ju(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=kv(e))||t){r&&(e=r);var n=0,o=function(){};return {s:o,n:function(){return n>=e.length?{done:true}:{done:false,value:e[n++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
27
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=true,s=false;return {s:function(){r=r.call(e);},n:function(){var c=r.next();return a=c.done,c},e:function(c){s=true,i=c;},f:function(){try{a||r.return==null||r.return();}finally{if(s)throw i}}}}function H(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vl(e,t){return vl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},vl(e,t)}function te(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}}),Object.defineProperty(e,"prototype",{writable:false}),t&&vl(e,t);}function Na(e){return Na=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Na(e)}function ed(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch{}return (ed=function(){return !!e})()}function Pv(e,t){if(t&&($t(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return H(e)}function re(e){var t=ed();return function(){var r,n=Na(e);if(t){var o=Na(this).constructor;r=Reflect.construct(n,arguments,o);}else r=n.apply(this,arguments);return Pv(this,r)}}function Z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ev(e,t){if($t(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if($t(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}function xl(e){var t=Ev(e,"string");return $t(t)=="symbol"?t:t+""}function Iv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,xl(n.key),n);}}function Q(e,t,r){return t&&Iv(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function F(e,t,r){return (t=xl(t))in e?Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true}):e[t]=r,e}var s1=10,Av=function(){function e(){Z(this,e),F(this,"priority",void 0),F(this,"subPriority",0);}return Q(e,[{key:"validate",value:function(r,n){return true}}]),e}(),Ov=function(e){te(r,e);var t=re(r);function r(n,o,i,a,s){var l;return Z(this,r),l=t.call(this),l.value=n,l.validateValue=o,l.setValue=i,l.priority=a,s&&(l.subPriority=s),l}return Q(r,[{key:"validate",value:function(o,i){return this.validateValue(o,this.value,i)}},{key:"set",value:function(o,i,a){return this.setValue(o,i,this.value,a)}}]),r}(Av),Rv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",s1),F(H(n),"subPriority",-1),n}return Q(r,[{key:"set",value:function(o,i){if(i.timestampIsSet)return o;var a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}}]),r}(Av);var oe=function(){function e(){Z(this,e),F(this,"incompatibleTokens",void 0),F(this,"priority",void 0),F(this,"subPriority",void 0);}return Q(e,[{key:"run",value:function(r,n,o,i){var a=this.parse(r,n,o,i);return a?{setter:new Ov(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}},{key:"validate",value:function(r,n,o){return true}}]),e}();var Dv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",140),F(H(n),"incompatibleTokens",["R","u","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "G":case "GG":case "GGG":return a.era(o,{width:"abbreviated"})||a.era(o,{width:"narrow"});case "GGGGG":return a.era(o,{width:"narrow"});case "GGGG":default:return a.era(o,{width:"wide"})||a.era(o,{width:"abbreviated"})||a.era(o,{width:"narrow"})}}},{key:"set",value:function(o,i,a){return i.era=a,o.setUTCFullYear(a,0,1),o.setUTCHours(0,0,0,0),o}}]),r}(oe);var Me={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},cr={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function qe(e,t){return e&&{value:t(e.value),rest:e.rest}}function Oe(e,t){var r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}function ur(e,t){var r=t.match(e);if(!r)return null;if(r[0]==="Z")return {value:0,rest:t.slice(1)};var n=r[1]==="+"?1:-1,o=r[2]?parseInt(r[2],10):0,i=r[3]?parseInt(r[3],10):0,a=r[5]?parseInt(r[5],10):0;return {value:n*(o*fv+i*dv+a*pv),rest:t.slice(r[0].length)}}function wl(e){return Oe(Me.anyDigitsSigned,e)}function we(e,t){switch(e){case 1:return Oe(Me.singleDigit,t);case 2:return Oe(Me.twoDigits,t);case 3:return Oe(Me.threeDigits,t);case 4:return Oe(Me.fourDigits,t);default:return Oe(new RegExp("^\\d{1,"+e+"}"),t)}}function si(e,t){switch(e){case 1:return Oe(Me.singleDigitSigned,t);case 2:return Oe(Me.twoDigitsSigned,t);case 3:return Oe(Me.threeDigitsSigned,t);case 4:return Oe(Me.fourDigitsSigned,t);default:return Oe(new RegExp("^-?\\d{1,"+e+"}"),t)}}function li(e){switch(e){case "morning":return 4;case "evening":return 17;case "pm":case "noon":case "afternoon":return 12;case "am":case "midnight":case "night":default:return 0}}function Tl(e,t){var r=t>0,n=r?t:1-t,o;if(n<=50)o=e||100;else {var i=n+50,a=Math.floor(i/100)*100,s=e>=i%100;o=e+a-(s?100:0);}return r?o:1-o}function _l(e){return e%400===0||e%4===0&&e%100!==0}var Mv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",130),F(H(n),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){var s=function(c){return {year:c,isTwoDigitYear:i==="yy"}};switch(i){case "y":return qe(we(4,o),s);case "yo":return qe(a.ordinalNumber(o,{unit:"year"}),s);default:return qe(we(i.length,o),s)}}},{key:"validate",value:function(o,i){return i.isTwoDigitYear||i.year>0}},{key:"set",value:function(o,i,a){var s=o.getUTCFullYear();if(a.isTwoDigitYear){var l=Tl(a.year,s);return o.setUTCFullYear(l,0,1),o.setUTCHours(0,0,0,0),o}var c=!("era"in i)||i.era===1?a.year:1-a.year;return o.setUTCFullYear(c,0,1),o.setUTCHours(0,0,0,0),o}}]),r}(oe);var $v=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",130),F(H(n),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){var s=function(c){return {year:c,isTwoDigitYear:i==="YY"}};switch(i){case "Y":return qe(we(4,o),s);case "Yo":return qe(a.ordinalNumber(o,{unit:"year"}),s);default:return qe(we(i.length,o),s)}}},{key:"validate",value:function(o,i){return i.isTwoDigitYear||i.year>0}},{key:"set",value:function(o,i,a,s){var l=Jn(o,s);if(a.isTwoDigitYear){var c=Tl(a.year,l);return o.setUTCFullYear(c,0,s.firstWeekContainsDate),o.setUTCHours(0,0,0,0),qt(o,s)}var u=!("era"in i)||i.era===1?a.year:1-a.year;return o.setUTCFullYear(u,0,s.firstWeekContainsDate),o.setUTCHours(0,0,0,0),qt(o,s)}}]),r}(oe);var Lv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",130),F(H(n),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i){return i==="R"?si(4,o):si(i.length,o)}},{key:"set",value:function(o,i,a){var s=new Date(0);return s.setUTCFullYear(a,0,4),s.setUTCHours(0,0,0,0),lr(s)}}]),r}(oe);var Nv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",130),F(H(n),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i){return i==="u"?si(4,o):si(i.length,o)}},{key:"set",value:function(o,i,a){return o.setUTCFullYear(a,0,1),o.setUTCHours(0,0,0,0),o}}]),r}(oe);var Bv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",120),F(H(n),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "Q":case "QQ":return we(i.length,o);case "Qo":return a.ordinalNumber(o,{unit:"quarter"});case "QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"})||a.quarter(o,{width:"narrow",context:"formatting"});case "QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});case "QQQQ":default:return a.quarter(o,{width:"wide",context:"formatting"})||a.quarter(o,{width:"abbreviated",context:"formatting"})||a.quarter(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=1&&i<=4}},{key:"set",value:function(o,i,a){return o.setUTCMonth((a-1)*3,1),o.setUTCHours(0,0,0,0),o}}]),r}(oe);var Fv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",120),F(H(n),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "q":case "qq":return we(i.length,o);case "qo":return a.ordinalNumber(o,{unit:"quarter"});case "qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"})||a.quarter(o,{width:"narrow",context:"standalone"});case "qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});case "qqqq":default:return a.quarter(o,{width:"wide",context:"standalone"})||a.quarter(o,{width:"abbreviated",context:"standalone"})||a.quarter(o,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(o,i){return i>=1&&i<=4}},{key:"set",value:function(o,i,a){return o.setUTCMonth((a-1)*3,1),o.setUTCHours(0,0,0,0),o}}]),r}(oe);var Uv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),F(H(n),"priority",110),n}return Q(r,[{key:"parse",value:function(o,i,a){var s=function(c){return c-1};switch(i){case "M":return qe(Oe(Me.month,o),s);case "MM":return qe(we(2,o),s);case "Mo":return qe(a.ordinalNumber(o,{unit:"month"}),s);case "MMM":return a.month(o,{width:"abbreviated",context:"formatting"})||a.month(o,{width:"narrow",context:"formatting"});case "MMMMM":return a.month(o,{width:"narrow",context:"formatting"});case "MMMM":default:return a.month(o,{width:"wide",context:"formatting"})||a.month(o,{width:"abbreviated",context:"formatting"})||a.month(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=11}},{key:"set",value:function(o,i,a){return o.setUTCMonth(a,1),o.setUTCHours(0,0,0,0),o}}]),r}(oe);var jv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",110),F(H(n),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){var s=function(c){return c-1};switch(i){case "L":return qe(Oe(Me.month,o),s);case "LL":return qe(we(2,o),s);case "Lo":return qe(a.ordinalNumber(o,{unit:"month"}),s);case "LLL":return a.month(o,{width:"abbreviated",context:"standalone"})||a.month(o,{width:"narrow",context:"standalone"});case "LLLLL":return a.month(o,{width:"narrow",context:"standalone"});case "LLLL":default:return a.month(o,{width:"wide",context:"standalone"})||a.month(o,{width:"abbreviated",context:"standalone"})||a.month(o,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=11}},{key:"set",value:function(o,i,a){return o.setUTCMonth(a,1),o.setUTCHours(0,0,0,0),o}}]),r}(oe);function td(e,t,r){_e(2,arguments);var n=Be(e),o=Ze(t),i=Ma(n,r)-o;return n.setUTCDate(n.getUTCDate()-i*7),n}var Hv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",100),F(H(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "w":return Oe(Me.week,o);case "wo":return a.ordinalNumber(o,{unit:"week"});default:return we(i.length,o)}}},{key:"validate",value:function(o,i){return i>=1&&i<=53}},{key:"set",value:function(o,i,a,s){return qt(td(o,a,s),s)}}]),r}(oe);function rd(e,t){_e(2,arguments);var r=Be(e),n=Ze(t),o=Da(r)-n;return r.setUTCDate(r.getUTCDate()-o*7),r}var Wv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",100),F(H(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "I":return Oe(Me.week,o);case "Io":return a.ordinalNumber(o,{unit:"week"});default:return we(i.length,o)}}},{key:"validate",value:function(o,i){return i>=1&&i<=53}},{key:"set",value:function(o,i,a){return lr(rd(o,a))}}]),r}(oe);var l1=[31,28,31,30,31,30,31,31,30,31,30,31],c1=[31,29,31,30,31,30,31,31,30,31,30,31],Vv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",90),F(H(n),"subPriority",1),F(H(n),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "d":return Oe(Me.date,o);case "do":return a.ordinalNumber(o,{unit:"date"});default:return we(i.length,o)}}},{key:"validate",value:function(o,i){var a=o.getUTCFullYear(),s=_l(a),l=o.getUTCMonth();return s?i>=1&&i<=c1[l]:i>=1&&i<=l1[l]}},{key:"set",value:function(o,i,a){return o.setUTCDate(a),o.setUTCHours(0,0,0,0),o}}]),r}(oe);var zv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",90),F(H(n),"subpriority",1),F(H(n),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "D":case "DD":return Oe(Me.dayOfYear,o);case "Do":return a.ordinalNumber(o,{unit:"date"});default:return we(i.length,o)}}},{key:"validate",value:function(o,i){var a=o.getUTCFullYear(),s=_l(a);return s?i>=1&&i<=366:i>=1&&i<=365}},{key:"set",value:function(o,i,a){return o.setUTCMonth(0,a),o.setUTCHours(0,0,0,0),o}}]),r}(oe);function no(e,t,r){var n,o,i,a,s,l,c,u;_e(2,arguments);var d=sr(),f=Ze((n=(o=(i=(a=r?.weekStartsOn)!==null&&a!==void 0?a:r==null||(s=r.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&i!==void 0?i:d.weekStartsOn)!==null&&o!==void 0?o:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=Be(e),g=Ze(t),h=p.getUTCDay(),b=g%7,y=(b+7)%7,S=(y<f?7:0)+g-h;return p.setUTCDate(p.getUTCDate()+S),p}var Gv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",90),F(H(n),"incompatibleTokens",["D","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "E":case "EE":case "EEE":return a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"});case "EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case "EEEEEE":return a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"});case "EEEE":default:return a.day(o,{width:"wide",context:"formatting"})||a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=6}},{key:"set",value:function(o,i,a,s){return o=no(o,a,s),o.setUTCHours(0,0,0,0),o}}]),r}(oe);var qv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",90),F(H(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a,s){var l=function(u){var d=Math.floor((u-1)/7)*7;return (u+s.weekStartsOn+6)%7+d};switch(i){case "e":case "ee":return qe(we(i.length,o),l);case "eo":return qe(a.ordinalNumber(o,{unit:"day"}),l);case "eee":return a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"});case "eeeee":return a.day(o,{width:"narrow",context:"formatting"});case "eeeeee":return a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"});case "eeee":default:return a.day(o,{width:"wide",context:"formatting"})||a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=6}},{key:"set",value:function(o,i,a,s){return o=no(o,a,s),o.setUTCHours(0,0,0,0),o}}]),r}(oe);var Yv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",90),F(H(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a,s){var l=function(u){var d=Math.floor((u-1)/7)*7;return (u+s.weekStartsOn+6)%7+d};switch(i){case "c":case "cc":return qe(we(i.length,o),l);case "co":return qe(a.ordinalNumber(o,{unit:"day"}),l);case "ccc":return a.day(o,{width:"abbreviated",context:"standalone"})||a.day(o,{width:"short",context:"standalone"})||a.day(o,{width:"narrow",context:"standalone"});case "ccccc":return a.day(o,{width:"narrow",context:"standalone"});case "cccccc":return a.day(o,{width:"short",context:"standalone"})||a.day(o,{width:"narrow",context:"standalone"});case "cccc":default:return a.day(o,{width:"wide",context:"standalone"})||a.day(o,{width:"abbreviated",context:"standalone"})||a.day(o,{width:"short",context:"standalone"})||a.day(o,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=6}},{key:"set",value:function(o,i,a,s){return o=no(o,a,s),o.setUTCHours(0,0,0,0),o}}]),r}(oe);function nd(e,t){_e(2,arguments);var r=Ze(t);r%7===0&&(r=r-7);var n=1,o=Be(e),i=o.getUTCDay(),a=r%7,s=(a+7)%7,l=(s<n?7:0)+r-i;return o.setUTCDate(o.getUTCDate()+l),o}var Kv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",90),F(H(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){var s=function(c){return c===0?7:c};switch(i){case "i":case "ii":return we(i.length,o);case "io":return a.ordinalNumber(o,{unit:"day"});case "iii":return qe(a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"}),s);case "iiiii":return qe(a.day(o,{width:"narrow",context:"formatting"}),s);case "iiiiii":return qe(a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"}),s);case "iiii":default:return qe(a.day(o,{width:"wide",context:"formatting"})||a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"}),s)}}},{key:"validate",value:function(o,i){return i>=1&&i<=7}},{key:"set",value:function(o,i,a){return o=nd(o,a),o.setUTCHours(0,0,0,0),o}}]),r}(oe);var Xv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",80),F(H(n),"incompatibleTokens",["b","B","H","k","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "a":case "aa":case "aaa":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"});case "aaaaa":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case "aaaa":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})||a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(o,i,a){return o.setUTCHours(li(a),0,0,0),o}}]),r}(oe);var Zv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",80),F(H(n),"incompatibleTokens",["a","B","H","k","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "b":case "bb":case "bbb":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"});case "bbbbb":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case "bbbb":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})||a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(o,i,a){return o.setUTCHours(li(a),0,0,0),o}}]),r}(oe);var Qv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",80),F(H(n),"incompatibleTokens",["a","b","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "B":case "BB":case "BBB":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"});case "BBBBB":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case "BBBB":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})||a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(o,i,a){return o.setUTCHours(li(a),0,0,0),o}}]),r}(oe);var Jv=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",70),F(H(n),"incompatibleTokens",["H","K","k","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "h":return Oe(Me.hour12h,o);case "ho":return a.ordinalNumber(o,{unit:"hour"});default:return we(i.length,o)}}},{key:"validate",value:function(o,i){return i>=1&&i<=12}},{key:"set",value:function(o,i,a){var s=o.getUTCHours()>=12;return s&&a<12?o.setUTCHours(a+12,0,0,0):!s&&a===12?o.setUTCHours(0,0,0,0):o.setUTCHours(a,0,0,0),o}}]),r}(oe);var ex=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",70),F(H(n),"incompatibleTokens",["a","b","h","K","k","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "H":return Oe(Me.hour23h,o);case "Ho":return a.ordinalNumber(o,{unit:"hour"});default:return we(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=23}},{key:"set",value:function(o,i,a){return o.setUTCHours(a,0,0,0),o}}]),r}(oe);var tx=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",70),F(H(n),"incompatibleTokens",["h","H","k","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "K":return Oe(Me.hour11h,o);case "Ko":return a.ordinalNumber(o,{unit:"hour"});default:return we(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=11}},{key:"set",value:function(o,i,a){var s=o.getUTCHours()>=12;return s&&a<12?o.setUTCHours(a+12,0,0,0):o.setUTCHours(a,0,0,0),o}}]),r}(oe);var rx=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",70),F(H(n),"incompatibleTokens",["a","b","h","H","K","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "k":return Oe(Me.hour24h,o);case "ko":return a.ordinalNumber(o,{unit:"hour"});default:return we(i.length,o)}}},{key:"validate",value:function(o,i){return i>=1&&i<=24}},{key:"set",value:function(o,i,a){var s=a<=24?a%24:a;return o.setUTCHours(s,0,0,0),o}}]),r}(oe);var nx=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",60),F(H(n),"incompatibleTokens",["t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "m":return Oe(Me.minute,o);case "mo":return a.ordinalNumber(o,{unit:"minute"});default:return we(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=59}},{key:"set",value:function(o,i,a){return o.setUTCMinutes(a,0,0),o}}]),r}(oe);var ox=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",50),F(H(n),"incompatibleTokens",["t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "s":return Oe(Me.second,o);case "so":return a.ordinalNumber(o,{unit:"second"});default:return we(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=59}},{key:"set",value:function(o,i,a){return o.setUTCSeconds(a,0),o}}]),r}(oe);var ix=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",30),F(H(n),"incompatibleTokens",["t","T"]),n}return Q(r,[{key:"parse",value:function(o,i){var a=function(l){return Math.floor(l*Math.pow(10,-i.length+3))};return qe(we(i.length,o),a)}},{key:"set",value:function(o,i,a){return o.setUTCMilliseconds(a),o}}]),r}(oe);var ax=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",10),F(H(n),"incompatibleTokens",["t","T","x"]),n}return Q(r,[{key:"parse",value:function(o,i){switch(i){case "X":return ur(cr.basicOptionalMinutes,o);case "XX":return ur(cr.basic,o);case "XXXX":return ur(cr.basicOptionalSeconds,o);case "XXXXX":return ur(cr.extendedOptionalSeconds,o);case "XXX":default:return ur(cr.extended,o)}}},{key:"set",value:function(o,i,a){return i.timestampIsSet?o:new Date(o.getTime()-a)}}]),r}(oe);var sx=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",10),F(H(n),"incompatibleTokens",["t","T","X"]),n}return Q(r,[{key:"parse",value:function(o,i){switch(i){case "x":return ur(cr.basicOptionalMinutes,o);case "xx":return ur(cr.basic,o);case "xxxx":return ur(cr.basicOptionalSeconds,o);case "xxxxx":return ur(cr.extendedOptionalSeconds,o);case "xxx":default:return ur(cr.extended,o)}}},{key:"set",value:function(o,i,a){return i.timestampIsSet?o:new Date(o.getTime()-a)}}]),r}(oe);var lx=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",40),F(H(n),"incompatibleTokens","*"),n}return Q(r,[{key:"parse",value:function(o){return wl(o)}},{key:"set",value:function(o,i,a){return [new Date(a*1e3),{timestampIsSet:true}]}}]),r}(oe);var cx=function(e){te(r,e);var t=re(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),F(H(n),"priority",20),F(H(n),"incompatibleTokens","*"),n}return Q(r,[{key:"parse",value:function(o){return wl(o)}},{key:"set",value:function(o,i,a){return [new Date(a),{timestampIsSet:true}]}}]),r}(oe);var ux={G:new Dv,y:new Mv,Y:new $v,R:new Lv,u:new Nv,Q:new Bv,q:new Fv,M:new Uv,L:new jv,w:new Hv,I:new Wv,d:new Vv,D:new zv,E:new Gv,e:new qv,c:new Yv,i:new Kv,a:new Xv,b:new Zv,B:new Qv,h:new Jv,H:new ex,K:new tx,k:new rx,m:new nx,s:new ox,S:new ix,X:new ax,x:new sx,t:new lx,T:new cx};var u1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,d1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,f1=/^'([^]*?)'?$/,p1=/''/g,m1=/\S/,g1=/[a-zA-Z]/;function Cl(e,t,r,n){var o,i,a,s,l,c,f,p,g,h,b,y,k,D;_e(3,arguments);var U=String(e),N=String(t),ie=sr(),I=(o=(i=n?.locale)!==null&&i!==void 0?i:ie.locale)!==null&&o!==void 0?o:bl;if(!I.match)throw new RangeError("locale must contain match property");var A=Ze((a=(s=(l=(c=n?.firstWeekContainsDate)!==null&&c!==void 0?c:void 0)!==null&&l!==void 0?l:ie.firstWeekContainsDate)!==null&&s!==void 0?s:(f=ie.locale)===null||f===void 0||(p=f.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(A>=1&&A<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var R=Ze((g=(h=(b=(y=n?.weekStartsOn)!==null&&y!==void 0?y:void 0)!==null&&b!==void 0?b:ie.weekStartsOn)!==null&&h!==void 0?h:(k=ie.locale)===null||k===void 0||(D=k.options)===null||D===void 0?void 0:D.weekStartsOn)!==null&&g!==void 0?g:0);if(!(R>=0&&R<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(N==="")return U===""?Be(r):new Date(NaN);var E={firstWeekContainsDate:A,weekStartsOn:R,locale:I},_=[new Rv],T=N.match(d1).map(function(Ye){var $e=Ye[0];if($e in $a){var It=$a[$e];return It(Ye,I.formatLong)}return Ye}).join("").match(u1),O=[],L=Ju(T),z;try{var ne=function(){var $e=z.value;!(n!=null&&n.useAdditionalWeekYearTokens)&&hl($e)&&ai($e,N,e),!(n!=null&&n.useAdditionalDayOfYearTokens)&&gl($e)&&ai($e,N,e);var It=$e[0],po=ux[It];if(po){var Ya=po.incompatibleTokens;if(Array.isArray(Ya)){var bi=O.find(function(Le){return Ya.includes(Le.token)||Le.token===It});if(bi)throw new RangeError("The format string mustn't contain `".concat(bi.fullToken,"` and `").concat($e,"` at the same time"))}else if(po.incompatibleTokens==="*"&&O.length>0)throw new RangeError("The format string mustn't contain `".concat($e,"` and any other token at the same time"));O.push({token:It,fullToken:$e});var yi=po.run(U,$e,I.match,E);if(!yi)return {v:new Date(NaN)};_.push(yi.setter),U=yi.rest;}else {if(It.match(g1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+It+"`");if($e==="''"?$e="'":It==="'"&&($e=h1($e)),U.indexOf($e)===0)U=U.slice($e.length);else return {v:new Date(NaN)}}};for(L.s();!(z=L.n()).done;){var K=ne();if($t(K)==="object")return K.v}}catch(Ye){L.e(Ye);}finally{L.f();}if(U.length>0&&m1.test(U))return new Date(NaN);var Ie=_.map(function(Ye){return Ye.priority}).sort(function(Ye,$e){return $e-Ye}).filter(function(Ye,$e,It){return It.indexOf(Ye)===$e}).map(function(Ye){return _.filter(function($e){return $e.priority===Ye}).sort(function($e,It){return It.subPriority-$e.subPriority})}).map(function(Ye){return Ye[0]}),Ce=Be(r);if(isNaN(Ce.getTime()))return new Date(NaN);var nt=Oa(Ce,Aa(Ce)),Lt={},ft=Ju(Ie),Nt;try{for(ft.s();!(Nt=ft.n()).done;){var Kt=Nt.value;if(!Kt.validate(nt,E))return new Date(NaN);var Bt=Kt.set(nt,Lt,E);Array.isArray(Bt)?(nt=Bt[0],Zu(Lt,Bt[1])):nt=Bt;}}catch(Ye){ft.e(Ye);}finally{ft.f();}return nt}function h1(e){return e.match(f1)[1].replace(p1,"'")}var b1=w('<div class="agent-input-form flex gap-2 items-end"><form><div class="flex flex-col"><div><input class="focus:outline-none flex-1 w-full text-input agent-date-input"data-testid=from-date>'),dx=w("<p class=font-semibold>"),y1=w('<div class="flex items-center p-4"><input class="focus:outline-none flex-1 w-full text-input ml-2 agent-date-input"data-testid=to-date>'),fx=e=>{let[t,r]=M(v1(e.defaultValue??"",e.options)),n=()=>{if(t().from===""&&t().to==="")return;let o=e.options?.format??(e.options?.hasTime?Qn.formatWithTime:Qn.format),i=l=>{if(!l)return "";try{let c;if(l.includes("T"))c=new Date(l);else {let[u,d,f]=l.split("-").map(Number);c=new Date(u,d-1,f);}return isNaN(c.getTime())?l:yl(c,o)}catch{return l}},a=i(t().from),s=i(t().to);e.onSubmit({type:"text",value:`${a}${e.options?.isRange?` to ${s}`:""}`});};return (()=>{var o=b1(),i=o.firstChild,a=i.firstChild,s=a.firstChild,l=s.firstChild;return i.addEventListener("submit",c=>{c.preventDefault(),n();}),v(s,(()=>{var c=B(()=>!!e.options?.isRange);return ()=>c()&&(()=>{var u=dx();return v(u,()=>e.options.labels?.from??Qn.labels.from),u})()})(),l),l.addEventListener("change",c=>r({...t(),from:c.currentTarget.value})),l.style.setProperty("min-height","32px"),l.style.setProperty("min-width","100px"),l.style.setProperty("font-size","16px"),v(a,(()=>{var c=B(()=>!!e.options?.isRange);return ()=>c()&&(()=>{var u=y1(),d=u.firstChild;return v(u,(()=>{var f=B(()=>!!e.options.isRange);return ()=>f()&&(()=>{var p=dx();return v(p,()=>e.options.labels?.to??Qn.labels.to),p})()})(),d),d.addEventListener("change",f=>r({...t(),to:f.currentTarget.value})),d.style.setProperty("min-height","32px"),d.style.setProperty("min-width","100px"),d.style.setProperty("font-size","16px"),$(f=>{var p=e.options.hasTime?"datetime-local":"date",g=e.options?.min,h=e.options?.max;return p!==f.e&&G(d,"type",f.e=p),g!==f.t&&G(d,"min",f.t=g),h!==f.a&&G(d,"max",f.a=h),f},{e:void 0,t:void 0,a:void 0}),$(()=>d.value=t().to),u})()})(),null),v(o,m(Xe,{class:"h-[56px]","on:click":n,get children(){return e.options?.labels?.button}}),null),$(c=>{var u=xe("flex agent-input",e.options?.isRange?"items-end":"items-center"),d="flex items-center p-4 "+(e.options?.isRange?"pb-0 gap-2":""),f=e.options?.hasTime?"datetime-local":"date",p=e.options?.min,g=e.options?.max;return u!==c.e&&j(i,c.e=u),d!==c.t&&j(s,c.t=d),f!==c.a&&G(l,"type",c.a=f),p!==c.o&&G(l,"min",c.o=p),g!==c.i&&G(l,"max",c.i=g),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),$(()=>l.value=t().from),o})()},v1=(e,t)=>{let r=i=>{if(!i||!t?.format)return i;try{if(/^\d{4}-\d{2}-\d{2}/.test(i))return i;let a=t.format??(t.hasTime?Qn.formatWithTime:Qn.format),s=Cl(i,a,new Date);if(!isNaN(s.getTime()))if(t.hasTime){let l=s.getFullYear(),c=String(s.getMonth()+1).padStart(2,"0"),u=String(s.getDate()).padStart(2,"0"),d=String(s.getHours()).padStart(2,"0"),f=String(s.getMinutes()).padStart(2,"0");return `${l}-${c}-${u}T${d}:${f}`}else {let l=s.getFullYear(),c=String(s.getMonth()+1).padStart(2,"0"),u=String(s.getDate()).padStart(2,"0");return `${l}-${c}-${u}`}return i}catch{return i}};if(!e.includes("to"))return {from:r(e),to:""};let[n,o]=e.split(" to ");return {from:r(n),to:r(o)}};var x1=w('<input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"type=text>'),dr=e=>{let[t,r]=rt(e,["ref","onInput"]);return (()=>{var n=x1();n.$$input=i=>t.onInput(i.currentTarget.value);var o=e.ref;return typeof o=="function"?be(o,n):e.ref=n,De(n,r,false,false),n})()};Ge(["input"]);var Sl={labels:{placeholder:"Type your email..."},isRequired:true};var w1=w('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex relative agent-input w-full">'),T1=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),px=e=>{let[t,r]=M(e.defaultValue??""),n,o=u=>r(u),i=()=>n?.value!==""&&n?.reportValidity(),a=()=>{let u=e.block.options?.isRequired??Sl.isRequired,d=n?.value??t();!u&&!d&&(d="** omited **"),!u||i()?e.onSubmit({type:"text",value:d,isRequired:u}):n?.focus();},s=u=>{u.key==="Enter"&&a();};ce(()=>{!X()&&n&&n.focus({preventScroll:true}),window.addEventListener("message",l);}),me(()=>{window.removeEventListener("message",l);});let l=u=>{let{data:d}=u;d.isFromAgent&&d.command==="setInputValue"&&r(d.value);},c=e.block.options?.isRequired??Sl.isRequired;return (()=>{var u=w1(),d=u.firstChild;return u.$$keydown=s,v(d,m(dr,{ref(f){var p=n;typeof p=="function"?p(f):n=f;},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??Sl.labels.placeholder},onInput:o,type:"email",autocomplete:"email"}),null),v(d,!c&&T1(),null),v(u,m(Xe,{type:"button",class:"h-[56px]","on:click":a,get children(){return e.block.options?.labels?.button}}),null),u})()};Ge(["keydown"]);var _r={isMultipleAllowed:false,labels:{placeholder:`<strong>
25
+ fbq('track', 'PageView');`,document.head.appendChild(t);},ry=e=>{if(!e?.eventType||!e.pixelId)return;if(!window.fbq){console.error("Facebook Pixel was not properly initialized");return}let t=e.params?.length?e.params.reduce((r,n)=>!n.key||!n.value?r:{...r,[n.key]:n.value},{}):void 0;if(e.eventType==="Custom"){if(!e.name)return;window.fbq("trackSingleCustom",e.pixelId,e.name,t);}window.fbq("trackSingle",e.pixelId,e.eventType,t);};var ny=async e=>{Ze(e?.pixelId)||ry(e);};var oy=({url:e,isNewTab:t}={})=>{if(!e)return;if(!window.open(e,t?"_blank":"_top"))return {blockedPopupUrl:e}};var ou=e=>{if(at(e))return null;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return console.warn("Failed to safely stringify variable value",e),null}};var vE=Object.getPrototypeOf(async()=>{}).constructor,iy=async({content:e,args:t,isCode:r})=>{try{if(!isNaN(e)&&/0[^.].+/.test(e))return {replyToSend:e};let o=await vE(...t.map(i=>i.id),e.includes("return ")?e:`return ${e}`)(...t.map(i=>i.value));return {replyToSend:ou(o)??void 0}}catch(n){return console.error(n),{replyToSend:ou(e)??void 0,logs:r?[{status:"error",description:"Failed to execute Set Variable code",details:Ns(n)}]:void 0}}};var ay=async({secondsToWaitFor:e})=>{await new Promise(t=>setTimeout(t,e*1e3));};(!globalThis.EventTarget||!globalThis.Event)&&console.error(`
26
+ PartySocket requires a global 'EventTarget' class to be available!
27
+ You can polyfill this global by adding this to your code before any partysocket imports:
28
+
29
+ \`\`\`
30
+ import 'partysocket/event-target-polyfill';
31
+ \`\`\`
32
+ Please file an issue at https://github.com/partykit/partykit if you're still having trouble.
33
+ `);var ly=class extends Event{message;error;constructor(e,t){super("error",t),this.message=e.message,this.error=e;}},cy=class extends Event{code;reason;wasClean=true;constructor(e=1e3,t="",r){super("close",r),this.code=e,this.reason=t;}},iu={Event,ErrorEvent:ly,CloseEvent:cy};function wE(e,t){if(!e)throw new Error(t)}function TE(e){return new e.constructor(e.type,e)}function CE(e){return "data"in e?new MessageEvent(e.type,e):"code"in e||"reason"in e?new cy(e.code||1999,e.reason||"unknown reason",e):"error"in e?new ly(e.error,e):new Event(e.type,e)}var _E=typeof process<"u"&&typeof process.versions?.node<"u"&&typeof document>"u",Bs=_E?CE:TE,Nn={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0},sy=false,au=class Ln extends EventTarget{_ws;_retryCount=-1;_uptimeTimeout;_connectTimeout;_shouldReconnect=true;_connectLock=false;_binaryType="blob";_closeCalled=false;_messageQueue=[];_debugLogger=console.log.bind(console);_url;_protocols;_options;constructor(t,r,n={}){super(),this._url=t,this._protocols=r,this._options=n,this._options.startClosed&&(this._shouldReconnect=false),this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect();}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return Ln.CONNECTING}get OPEN(){return Ln.OPEN}get CLOSING(){return Ln.CLOSING}get CLOSED(){return Ln.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t);}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((r,n)=>(typeof n=="string"?r+=n.length:n instanceof Blob?r+=n.size:r+=n.byteLength,r),0)+(this._ws?this._ws.bufferedAmount:0)}get extensions(){return this._ws?this._ws.extensions:""}get protocol(){return this._ws?this._ws.protocol:""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?Ln.CLOSED:Ln.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}onclose=null;onerror=null;onmessage=null;onopen=null;close(t=1e3,r){if(this._closeCalled=true,this._shouldReconnect=false,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(t,r);}reconnect(t,r){this._shouldReconnect=true,this._closeCalled=false,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(t,r),this._connect());}send(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else {let{maxEnqueuedMessages:r=Nn.maxEnqueuedMessages}=this._options;this._messageQueue.length<r&&(this._debug("enqueue",t),this._messageQueue.push(t));}}_debug(...t){this._options.debug&&this._debugLogger("RWS>",...t);}_getNextDelay(){let{reconnectionDelayGrowFactor:t=Nn.reconnectionDelayGrowFactor,minReconnectionDelay:r=Nn.minReconnectionDelay,maxReconnectionDelay:n=Nn.maxReconnectionDelay}=this._options,o=0;return this._retryCount>0&&(o=r*Math.pow(t,this._retryCount-1),o>n&&(o=n)),this._debug("next delay",o),o}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay());})}_getNextProtocols(t){if(!t)return Promise.resolve(null);if(typeof t=="string"||Array.isArray(t))return Promise.resolve(t);if(typeof t=="function"){let r=t();if(!r)return Promise.resolve(null);if(typeof r=="string"||Array.isArray(r))return Promise.resolve(r);if(r.then)return r}throw Error("Invalid protocols")}_getNextUrl(t){if(typeof t=="string")return Promise.resolve(t);if(typeof t=="function"){let r=t();if(typeof r=="string")return Promise.resolve(r);if(r.then)return r}throw Error("Invalid URL")}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=true;let{maxRetries:t=Nn.maxRetries,connectionTimeout:r=Nn.connectionTimeout}=this._options;if(this._retryCount>=t){this._debug("max retries reached",this._retryCount,">=",t);return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>Promise.all([this._getNextUrl(this._url),this._getNextProtocols(this._protocols||null)])).then(([n,o])=>{if(this._closeCalled){this._connectLock=false;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!sy&&(console.error(`\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket.
34
+
35
+ For example, if you're using node.js, run \`npm install ws\`, and then in your code:
36
+
37
+ import PartySocket from 'partysocket';
38
+ import WS from 'ws';
39
+
40
+ const partysocket = new PartySocket({
41
+ host: "127.0.0.1:1999",
42
+ room: "test-room",
43
+ WebSocket: WS
44
+ });
45
+
46
+ `),sy=true);let i=this._options.WebSocket||WebSocket;this._debug("connect",{url:n,protocols:o}),this._ws=o?new i(n,o):new i(n),this._ws.binaryType=this._binaryType,this._connectLock=false,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),r);}).catch(n=>{this._connectLock=false,this._handleError(new iu.ErrorEvent(Error(n.message),this));});}_handleTimeout(){this._debug("timeout event"),this._handleError(new iu.ErrorEvent(Error("TIMEOUT"),this));}_disconnect(t=1e3,r){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,r),this._handleClose(new iu.CloseEvent(t,r,this));}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0;}_handleOpen=t=>{this._debug("open event");let{minUptime:r=Nn.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),r),wE(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(n=>this._ws?.send(n)),this._messageQueue=[],this.onopen&&this.onopen(t),this.dispatchEvent(Bs(t));};_handleMessage=t=>{this._debug("message event"),this.onmessage&&this.onmessage(t),this.dispatchEvent(Bs(t));};_handleError=t=>{this._debug("error event",t.message),this._disconnect(void 0,t.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(t),this._debug("exec error listeners"),this.dispatchEvent(Bs(t)),this._connect();};_handleClose=t=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(t),this.dispatchEvent(Bs(t));};_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError));}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError));}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout);}};var SE=e=>e[1]!==null&&e[1]!==void 0;function kE(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();let e=new Date().getTime(),t=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let n=Math.random()*16;return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),(r==="x"?n:n&3|8).toString(16)})}function dy(e,t,r={}){let{host:n,path:o,protocol:i,room:a,party:s,prefix:l,query:u}=e,c=n.replace(/^(http|https|ws|wss):\/\//,"");if(c.endsWith("/")&&(c=c.slice(0,-1)),o&&o.startsWith("/"))throw new Error("path must not start with a slash");let d=s??"main",p=o?`/${o}`:"",f=i||(c.startsWith("localhost:")||c.startsWith("127.0.0.1:")||c.startsWith("192.168.")||c.startsWith("10.")||c.startsWith("172.")&&c.split(".")[1]>="16"&&c.split(".")[1]<="31"||c.startsWith("[::ffff:7f00:1]:")?t:t+"s"),b=`${f}://${c}/${l||`parties/${d}/${a}`}${p}`,g=(T={})=>`${b}?${new URLSearchParams([...Object.entries(r),...Object.entries(T).filter(SE)])}`,y=typeof u=="function"?async()=>g(await u()):g(u);return {host:c,path:p,room:a,name:d,protocol:f,partyUrl:b,urlProvider:y}}var su=class extends au{constructor(e){let t=uy(e);super(t.urlProvider,t.protocols,t.socketOptions),this.partySocketOptions=e,this.setWSProperties(t);}_pk;_pkurl;name;room;host;path;updateProperties(e){let t=uy({...this.partySocketOptions,...e,host:e.host??this.host,room:e.room??this.room,path:e.path??this.path});this._url=t.urlProvider,this._protocols=t.protocols,this._options=t.socketOptions,this.setWSProperties(t);}setWSProperties(e){let{_pk:t,_pkurl:r,name:n,room:o,host:i,path:a}=e;this._pk=t,this._pkurl=r,this.name=n,this.room=o,this.host=i,this.path=a;}reconnect(e,t){if(!this.room||!this.host)throw new Error("The room and host must be set before connecting, use `updateProperties` method to set them or pass them to the constructor.");super.reconnect(e,t);}get id(){return this._pk}get roomUrl(){return this._pkurl}static async fetch(e,t){let r=dy(e,"http"),n=typeof r.urlProvider=="string"?r.urlProvider:await r.urlProvider();return (e.fetch??fetch)(n,t)}};function uy(e){let{id:t,host:r,path:n,party:o,room:i,protocol:a,query:s,protocols:l,...u}=e,c=t||kE(),d=dy(e,"ws",{_pk:c});return {_pk:c,_pkurl:d.partyUrl,name:d.name,room:d.room,host:d.host,path:d.path,protocols:l,socketOptions:u,urlProvider:d.urlProvider}}var fy=({sessionId:e,resultId:t})=>{let r=Lr("NEXT_PUBLIC_PARTYKIT_HOST");if(!r)return;let n=new su({host:r,room:PE({sessionId:e,resultId:t})});return new Promise(o=>{n.addEventListener("message",i=>{n.close(),o({replyToSend:i.data});}),n.addEventListener("error",i=>{o({logs:[{status:"error",description:"Websocket returned an error",details:JSON.stringify(i,null,2)}],replyToSend:void 0});});})},PE=({sessionId:e,resultId:t})=>{if(t)return `${t}/webhooks`;let[r,n]=e.split("-");return `${n}/${r}/webhooks`};var py=e=>{if(document.getElementById("gtm-noscript"))return "";let t=document.createElement("noscript");t.id="gtm-noscript";let r=document.createElement("iframe");return r.src=`https://www.googletagmanager.com/ns.html?id=${e}`,r.height="0",r.width="0",r.style.display="none",r.style.visibility="hidden",t.appendChild(r),t};var my=async e=>{let t=e.customHeadCode;Re(t)&&xp(t);let r=e.gtmId;Re(r)&&document.body.prepend(py(r));let n=e.googleAnalyticsId;Re(n)&&await Kb(n);let o=e.pixelIds;ue(o)&&ty(o);};var gy=async({clientSideAction:e,context:t,onMessageStream:r,onStreamError:n})=>{if("chatwoot"in e)return Yb(e.chatwoot);if("googleAnalytics"in e)return Zb(e.googleAnalytics);if("scriptToExecute"in e)return Ls(e.scriptToExecute);if("redirect"in e)return oy(e.redirect);if("wait"in e)return await ay(e.wait),e.expectsDedicatedReply?{replyToSend:void 0}:void 0;if("setVariable"in e)return iy(e.setVariable.scriptToExecute);if("streamOpenAiChatCompletion"in e||"stream"in e){let{error:o,message:i}=await nu(t)({messages:"streamOpenAiChatCompletion"in e?e.streamOpenAiChatCompletion?.messages:void 0,onMessageStream:r,onError:n});return o?{replyToSend:void 0,logs:[{status:"error",description:"Message streaming returned an error",details:JSON.stringify(o,null,2)}]}:{replyToSend:i}}if("httpRequestToExecute"in e)return {replyToSend:await Qb(e.httpRequestToExecute)};if("startPropsToInject"in e)return my(e.startPropsToInject);if("pixel"in e)return ny(e.pixel);if("codeToExecute"in e)return qi(e.codeToExecute);if(e.type==="listenForWebhook")return fy({sessionId:t.sessionId,resultId:t.resultId})};var[Us,lu]=R([]);var hy=e=>e.type==="text"?e.label??e.value:e.url;var[cu,uu]=R();var EE=w('<svg><circle class=opacity-25 cx=12 cy=12 r=10 stroke=currentColor stroke-width=4></circle><path class=opacity-75 fill=currentColor d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">'),jo=e=>(()=>{var t=EE();return Pe(t,be(e,{get class(){return "animate-spin h-6 w-6 "+e.class},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),true,true),t})();var IE=w("<button>"),pr=e=>{let t=Va(()=>e.children),[r,n]=Je(e,["variant","isDisabled","isLoading"]);return (()=>{var o=IE();return Pe(o,be(n,{get disabled(){return r.isDisabled||r.isLoading},get class(){return ye("py-2 px-4 font-semibold focus:outline-none filter hover:brightness-90 active:brightness-75 disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 flex justify-center flex-shrink-0",r.variant==="secondary"?" secondary-button":" agent-button",n.class)}}),false,true),x(o,m(W,{get when(){return !r.isLoading},get fallback(){return m(jo,{})},get children(){return t()}})),o})()};var AE=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),Dr=e=>(()=>{var t=AE();return Pe(t,e,true,true),t})();var OE=w('<button class="w-5 h-5">'),RE=w('<div class="flex justify-between items-center gap-2 w-full pr-4"><input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"type=text>'),pn=e=>{let[t,r]=R(""),[n,o]=Je(e,["onInput","ref"]),i=s=>{r(s),n.onInput(s);},a=()=>{r(""),e.onClear();};return (()=>{var s=RE(),l=s.firstChild;l.$$input=c=>i(c.currentTarget.value);var u=e.ref;return typeof u=="function"?me(u,l):e.ref=l,Pe(l,be({get value(){return t()}},o),false,false),x(s,m(W,{get when(){return t().length>0},get children(){var c=OE();return nt(c,"click",a),x(c,m(Dr,{})),c}}),null),s})()};Ne(["input"]);var Qe="Send";var ea={buttonLabel:Qe,searchInputPlaceholder:"Filter the options..."};var DE=w('<div class="flex items-end agent-input w-full">'),ME=w('<div class="flex flex-col gap-2 w-full"><div>'),$E=w("<span>"),NE=w('<span class="flex h-3 w-3 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-3 w-3 brightness-150">'),by=e=>{let t,[r,n]=R(e.options?.isSearchable&&!e.options?.areInitialSearchButtonsVisible?[]:e.defaultItems);ie(()=>{!K()&&t&&t.focus({preventScroll:true});});let o=a=>e.onSubmit({type:"text",value:r()[a]?.content??""}),i=a=>{if(a===""||a.trim().length===0){n(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[]);return}n(e.defaultItems.filter(s=>s.content?.toLowerCase().includes(a.toLowerCase())));};return (()=>{var a=ME(),s=a.firstChild;return x(a,m(W,{get when(){return e.options?.isSearchable},get children(){var l=DE();return x(l,m(pn,{ref(u){var c=t;typeof c=="function"?c(u):t=u;},onInput:i,get placeholder(){return e.options?.searchInputPlaceholder??ea.searchInputPlaceholder},onClear:()=>n(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[])})),l}}),s),x(s,m(ke,{get each(){return r()},children:(l,u)=>(()=>{var c=$E();return x(c,m(pr,{"on:click":()=>o(u()),get"data-itemid"(){return l.id},class:"w-full",get children(){return l.content}}),null),x(c,(()=>{var d=L(()=>e.chunkIndex===0&&e.defaultItems.length===1);return ()=>d()&&NE()})(),null),M(()=>U(c,"relative"+(K()?" w-full":""))),c})()})),M(()=>U(s,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-80 rounded-md":""))),a})()};var LE=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 512 512"width=19px color=white><path d="M476.59 227.05l-.16-.07L49.35 49.84A23.56 23.56 0 0027.14 52 24.65 24.65 0 0016 72.59v113.29a24 24 0 0019.52 23.57l232.93 43.07a4 4 0 010 7.86L35.53 303.45A24 24 0 0016 327v113.31A23.57 23.57 0 0026.59 460a23.94 23.94 0 0013.22 4 24.55 24.55 0 009.52-1.93L476.4 285.94l.19-.09a32 32 0 000-58.8z">'),yy=e=>(()=>{var t=LE();return Pe(t,e,true,true),t})();var FE=w(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 448 512"width=19px color=white><path d="M400 224H384V144C384 64.6 319.4 0 240 0S96 64.6 96 144v80H80c-26.5 0-48 21.5-48 48v192c0
47
+ 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zM144 144c0-52.9
48
+ 43.1-96 96-96s96 43.1 96 96v80H144V144z">`),xy=e=>(()=>{var t=FE();return Pe(t,e,true,true),t})();var We=e=>{let[t,r]=Je(e,["isDisabled","isLoading","disableIcon"]),n=K()&&!t.disableIcon||!r.children||typeof r.children=="string"&&Ze(r.children);return m(pr,be(r,{type:"submit",get class(){return ye(r.class,"flex items-center")},"aria-label":n?"Send":void 0,get children(){return m(Le,{get children(){return [m(X,{get when(){return n&&!e.isPassword},get children(){return m(yy,{get class(){return "send-icon flex w-6 h-6 "+(t.disableIcon?"hidden":"")}})}}),m(X,{get when(){return n&&e.isPassword},get children(){return m(xy,{get class(){return "send-icon flex w-6 h-6 "+(t.disableIcon?"hidden":"")}})}}),m(X,{when:!n,get children(){return e.children}})]}})}}))};var BE=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3px stroke-linecap=round stroke-linejoin=round><polyline points="20 6 9 17 4 12">'),vy=e=>(()=>{var t=BE();return Pe(t,e,true,true),t})();var UE=w("<div>"),zo=e=>(()=>{var t=UE();return x(t,m(W,{get when(){return e.isChecked},get children(){return m(vy,{})}})),M(()=>U(t,"w-4 h-4 agent-checkbox"+(e.isChecked?" checked":"")+(e.class?` ${e.class}`:""))),t})();var VE=w('<div class="flex items-end agent-input w-full">'),HE=w('<form class="flex flex-col items-end gap-2 w-full"><div>'),WE=w('<span><div role=checkbox><div class="flex items-center gap-2"><span>'),jE=w('<span><div role=checkbox aria-checked class="w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none agent-selectable selected"><div class="flex items-center gap-2"><span>'),wy=e=>{let t,[r,n]=R(e.options?.isSearchable&&!e.options?.areInitialSearchButtonsVisible?[]:e.defaultItems),[o,i]=R([]);ie(()=>{!K()&&t&&t.focus({preventScroll:true});});let a=c=>{s(c);},s=c=>{let d=o().indexOf(c);i(d!==-1?p=>p.filter(f=>f!==c):p=>[...p,c]);},l=()=>e.onSubmit({type:"text",value:o().map(c=>e.defaultItems.find(d=>d.id===c)?.content).join(", ")}),u=c=>{if(c===""||c.trim().length===0){n(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[]);return}n(e.defaultItems.filter(d=>d.content?.toLowerCase().includes(c.toLowerCase())));};return (()=>{var c=HE(),d=c.firstChild;return c.addEventListener("submit",l),x(c,m(W,{get when(){return e.options?.isSearchable},get children(){var p=VE();return x(p,m(pn,{ref(f){var b=t;typeof b=="function"?b(f):t=f;},onInput:u,get placeholder(){return e.options?.searchInputPlaceholder??ea.searchInputPlaceholder},onClear:()=>n(e.options?.areInitialSearchButtonsVisible?e.defaultItems:[])})),p}}),d),x(d,m(ke,{get each(){return r()},children:p=>(()=>{var f=WE(),b=f.firstChild,g=b.firstChild,y=g.firstChild;return nt(b,"click",()=>a(p.id)),x(g,m(zo,{get isChecked(){return o().some(T=>T===p.id)},class:"flex-shrink-0"}),y),x(y,()=>p.content),M(T=>{var S="relative"+(K()?" w-full":""),E=o().some($=>$===p.id),h="w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none agent-selectable"+(o().some($=>$===p.id)?" selected":""),C=p.id;return S!==T.e&&U(f,T.e=S),E!==T.t&&G(b,"aria-checked",T.t=E),h!==T.a&&U(b,T.a=h),C!==T.o&&G(b,"data-itemid",T.o=C),T},{e:void 0,t:void 0,a:void 0,o:void 0}),f})()}),null),x(d,m(ke,{get each(){return o().filter(p=>r().every(f=>f.id!==p))},children:p=>(()=>{var f=jE(),b=f.firstChild,g=b.firstChild,y=g.firstChild;return nt(b,"click",()=>a(p)),G(b,"data-itemid",p),x(g,m(zo,{isChecked:true}),y),x(y,()=>e.defaultItems.find(T=>T.id===p)?.content),M(()=>U(f,"relative"+(K()?" w-full":""))),f})()}),null),x(c,(()=>{var p=L(()=>o().length>0);return ()=>p()&&m(We,{disableIcon:true,get children(){return e.options?.buttonLabel??ea.buttonLabel}})})(),null),M(()=>U(d,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-80 rounded-md":""))),c})()};var Fn={hasTime:false,isRange:false,labels:{button:Qe,from:"From:",to:"To:"},format:"dd/MM/yyyy",formatWithTime:"dd/MM/yyyy HH:mm"};function Pt(e){"@babel/helpers - typeof";return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pt(e)}function ze(e){if(e===null||e===true||e===false)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Te(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function De(e){Te(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Pt(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function du(e,t){Te(2,arguments);var r=De(e).getTime(),n=ze(t);return new Date(r+n)}var zE={};function Zt(){return zE}function ta(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var Ty=6e4,Cy=36e5,_y=1e3;function fu(e){return Te(1,arguments),e instanceof Date||Pt(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function pu(e){if(Te(1,arguments),!fu(e)&&typeof e!="number")return false;var t=De(e);return !isNaN(Number(t))}function ra(e,t){Te(2,arguments);var r=ze(t);return du(e,-r)}var ZE=864e5;function mu(e){Te(1,arguments);var t=De(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),o=r-n;return Math.floor(o/ZE)+1}function Qt(e){Te(1,arguments);var t=1,r=De(e),n=r.getUTCDay(),o=(n<t?7:0)+n-t;return r.setUTCDate(r.getUTCDate()-o),r.setUTCHours(0,0,0,0),r}function na(e){Te(1,arguments);var t=De(e),r=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(r+1,0,4),n.setUTCHours(0,0,0,0);var o=Qt(n),i=new Date(0);i.setUTCFullYear(r,0,4),i.setUTCHours(0,0,0,0);var a=Qt(i);return t.getTime()>=o.getTime()?r+1:t.getTime()>=a.getTime()?r:r-1}function gu(e){Te(1,arguments);var t=na(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=Qt(r);return n}var QE=6048e5;function oa(e){Te(1,arguments);var t=De(e),r=Qt(t).getTime()-gu(t).getTime();return Math.round(r/QE)+1}function Ft(e,t){var r,n,o,i,a,s,l,u;Te(1,arguments);var c=Zt(),d=ze((r=(n=(o=(i=t?.weekStartsOn)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&o!==void 0?o:c.weekStartsOn)!==null&&n!==void 0?n:(l=c.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=De(e),f=p.getUTCDay(),b=(f<d?7:0)+f-d;return p.setUTCDate(p.getUTCDate()-b),p.setUTCHours(0,0,0,0),p}function Bn(e,t){var r,n,o,i,a,s,l,u;Te(1,arguments);var c=De(e),d=c.getUTCFullYear(),p=Zt(),f=ze((r=(n=(o=(i=t?.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&o!==void 0?o:p.firstWeekContainsDate)!==null&&n!==void 0?n:(l=p.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(d+1,0,f),b.setUTCHours(0,0,0,0);var g=Ft(b,t),y=new Date(0);y.setUTCFullYear(d,0,f),y.setUTCHours(0,0,0,0);var T=Ft(y,t);return c.getTime()>=g.getTime()?d+1:c.getTime()>=T.getTime()?d:d-1}function hu(e,t){var r,n,o,i,a,s,l,u;Te(1,arguments);var c=Zt(),d=ze((r=(n=(o=(i=t?.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&o!==void 0?o:c.firstWeekContainsDate)!==null&&n!==void 0?n:(l=c.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:1),p=Bn(e,t),f=new Date(0);f.setUTCFullYear(p,0,d),f.setUTCHours(0,0,0,0);var b=Ft(f,t);return b}var JE=6048e5;function ia(e,t){Te(1,arguments);var r=De(e),n=Ft(r,t).getTime()-hu(r,t).getTime();return Math.round(n/JE)+1}function Me(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return r+n}var eI={y:function(t,r){var n=t.getUTCFullYear(),o=n>0?n:1-n;return Me(r==="yy"?o%100:o,r.length)},M:function(t,r){var n=t.getUTCMonth();return r==="M"?String(n+1):Me(n+1,2)},d:function(t,r){return Me(t.getUTCDate(),r.length)},a:function(t,r){var n=t.getUTCHours()/12>=1?"pm":"am";switch(r){case "a":case "aa":return n.toUpperCase();case "aaa":return n;case "aaaaa":return n[0];case "aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(t,r){return Me(t.getUTCHours()%12||12,r.length)},H:function(t,r){return Me(t.getUTCHours(),r.length)},m:function(t,r){return Me(t.getUTCMinutes(),r.length)},s:function(t,r){return Me(t.getUTCSeconds(),r.length)},S:function(t,r){var n=r.length,o=t.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,n-3));return Me(i,r.length)}},Yr=eI;var Go={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tI={G:function(t,r,n){var o=t.getUTCFullYear()>0?1:0;switch(r){case "G":case "GG":case "GGG":return n.era(o,{width:"abbreviated"});case "GGGGG":return n.era(o,{width:"narrow"});case "GGGG":default:return n.era(o,{width:"wide"})}},y:function(t,r,n){if(r==="yo"){var o=t.getUTCFullYear(),i=o>0?o:1-o;return n.ordinalNumber(i,{unit:"year"})}return Yr.y(t,r)},Y:function(t,r,n,o){var i=Bn(t,o),a=i>0?i:1-i;if(r==="YY"){var s=a%100;return Me(s,2)}return r==="Yo"?n.ordinalNumber(a,{unit:"year"}):Me(a,r.length)},R:function(t,r){var n=na(t);return Me(n,r.length)},u:function(t,r){var n=t.getUTCFullYear();return Me(n,r.length)},Q:function(t,r,n){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(r){case "Q":return String(o);case "QQ":return Me(o,2);case "Qo":return n.ordinalNumber(o,{unit:"quarter"});case "QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case "QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});case "QQQQ":default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,r,n){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(r){case "q":return String(o);case "qq":return Me(o,2);case "qo":return n.ordinalNumber(o,{unit:"quarter"});case "qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case "qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});case "qqqq":default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,r,n){var o=t.getUTCMonth();switch(r){case "M":case "MM":return Yr.M(t,r);case "Mo":return n.ordinalNumber(o+1,{unit:"month"});case "MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case "MMMMM":return n.month(o,{width:"narrow",context:"formatting"});case "MMMM":default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(t,r,n){var o=t.getUTCMonth();switch(r){case "L":return String(o+1);case "LL":return Me(o+1,2);case "Lo":return n.ordinalNumber(o+1,{unit:"month"});case "LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case "LLLLL":return n.month(o,{width:"narrow",context:"standalone"});case "LLLL":default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(t,r,n,o){var i=ia(t,o);return r==="wo"?n.ordinalNumber(i,{unit:"week"}):Me(i,r.length)},I:function(t,r,n){var o=oa(t);return r==="Io"?n.ordinalNumber(o,{unit:"week"}):Me(o,r.length)},d:function(t,r,n){return r==="do"?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):Yr.d(t,r)},D:function(t,r,n){var o=mu(t);return r==="Do"?n.ordinalNumber(o,{unit:"dayOfYear"}):Me(o,r.length)},E:function(t,r,n){var o=t.getUTCDay();switch(r){case "E":case "EE":case "EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case "EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case "EEEEEE":return n.day(o,{width:"short",context:"formatting"});case "EEEE":default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(t,r,n,o){var i=t.getUTCDay(),a=(i-o.weekStartsOn+8)%7||7;switch(r){case "e":return String(a);case "ee":return Me(a,2);case "eo":return n.ordinalNumber(a,{unit:"day"});case "eee":return n.day(i,{width:"abbreviated",context:"formatting"});case "eeeee":return n.day(i,{width:"narrow",context:"formatting"});case "eeeeee":return n.day(i,{width:"short",context:"formatting"});case "eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,r,n,o){var i=t.getUTCDay(),a=(i-o.weekStartsOn+8)%7||7;switch(r){case "c":return String(a);case "cc":return Me(a,r.length);case "co":return n.ordinalNumber(a,{unit:"day"});case "ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case "ccccc":return n.day(i,{width:"narrow",context:"standalone"});case "cccccc":return n.day(i,{width:"short",context:"standalone"});case "cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,r,n){var o=t.getUTCDay(),i=o===0?7:o;switch(r){case "i":return String(i);case "ii":return Me(i,r.length);case "io":return n.ordinalNumber(i,{unit:"day"});case "iii":return n.day(o,{width:"abbreviated",context:"formatting"});case "iiiii":return n.day(o,{width:"narrow",context:"formatting"});case "iiiiii":return n.day(o,{width:"short",context:"formatting"});case "iiii":default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(t,r,n){var o=t.getUTCHours(),i=o/12>=1?"pm":"am";switch(r){case "a":case "aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case "aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case "aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case "aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,r,n){var o=t.getUTCHours(),i;switch(o===12?i=Go.noon:o===0?i=Go.midnight:i=o/12>=1?"pm":"am",r){case "b":case "bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case "bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case "bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case "bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,r,n){var o=t.getUTCHours(),i;switch(o>=17?i=Go.evening:o>=12?i=Go.afternoon:o>=4?i=Go.morning:i=Go.night,r){case "B":case "BB":case "BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case "BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case "BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,r,n){if(r==="ho"){var o=t.getUTCHours()%12;return o===0&&(o=12),n.ordinalNumber(o,{unit:"hour"})}return Yr.h(t,r)},H:function(t,r,n){return r==="Ho"?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Yr.H(t,r)},K:function(t,r,n){var o=t.getUTCHours()%12;return r==="Ko"?n.ordinalNumber(o,{unit:"hour"}):Me(o,r.length)},k:function(t,r,n){var o=t.getUTCHours();return o===0&&(o=24),r==="ko"?n.ordinalNumber(o,{unit:"hour"}):Me(o,r.length)},m:function(t,r,n){return r==="mo"?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Yr.m(t,r)},s:function(t,r,n){return r==="so"?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Yr.s(t,r)},S:function(t,r){return Yr.S(t,r)},X:function(t,r,n,o){var i=o._originalDate||t,a=i.getTimezoneOffset();if(a===0)return "Z";switch(r){case "X":return Py(a);case "XXXX":case "XX":return Un(a);case "XXXXX":case "XXX":default:return Un(a,":")}},x:function(t,r,n,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(r){case "x":return Py(a);case "xxxx":case "xx":return Un(a);case "xxxxx":case "xxx":default:return Un(a,":")}},O:function(t,r,n,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(r){case "O":case "OO":case "OOO":return "GMT"+ky(a,":");case "OOOO":default:return "GMT"+Un(a,":")}},z:function(t,r,n,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(r){case "z":case "zz":case "zzz":return "GMT"+ky(a,":");case "zzzz":default:return "GMT"+Un(a,":")}},t:function(t,r,n,o){var i=o._originalDate||t,a=Math.floor(i.getTime()/1e3);return Me(a,r.length)},T:function(t,r,n,o){var i=o._originalDate||t,a=i.getTime();return Me(a,r.length)}};function ky(e,t){var r=e>0?"-":"+",n=Math.abs(e),o=Math.floor(n/60),i=n%60;if(i===0)return r+String(o);var a=t;return r+String(o)+a+Me(i,2)}function Py(e,t){if(e%60===0){var r=e>0?"-":"+";return r+Me(Math.abs(e)/60,2)}return Un(e,t)}function Un(e,t){var r=t||"",n=e>0?"-":"+",o=Math.abs(e),i=Me(Math.floor(o/60),2),a=Me(o%60,2);return n+i+r+a}var Ey=tI;var Iy=function(t,r){switch(t){case "P":return r.date({width:"short"});case "PP":return r.date({width:"medium"});case "PPP":return r.date({width:"long"});case "PPPP":default:return r.date({width:"full"})}},Ay=function(t,r){switch(t){case "p":return r.time({width:"short"});case "pp":return r.time({width:"medium"});case "ppp":return r.time({width:"long"});case "pppp":default:return r.time({width:"full"})}},rI=function(t,r){var n=t.match(/(P+)(p+)?/)||[],o=n[1],i=n[2];if(!i)return Iy(t,r);var a;switch(o){case "P":a=r.dateTime({width:"short"});break;case "PP":a=r.dateTime({width:"medium"});break;case "PPP":a=r.dateTime({width:"long"});break;case "PPPP":default:a=r.dateTime({width:"full"});break}return a.replace("{{date}}",Iy(o,r)).replace("{{time}}",Ay(i,r))},nI={p:Ay,P:rI},aa=nI;var oI=["D","DD"],iI=["YY","YYYY"];function Vs(e){return oI.indexOf(e)!==-1}function Hs(e){return iI.indexOf(e)!==-1}function qo(e,t,r){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var aI={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},sI=function(t,r,n){var o,i=aI[t];return typeof i=="string"?o=i:r===1?o=i.one:o=i.other.replace("{{count}}",r.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o},Oy=sI;function sa(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.width?String(t.width):e.defaultWidth,n=e.formats[r]||e.formats[e.defaultWidth];return n}}var lI={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},cI={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},uI={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dI={date:sa({formats:lI,defaultWidth:"full"}),time:sa({formats:cI,defaultWidth:"full"}),dateTime:sa({formats:uI,defaultWidth:"full"})},Ry=dI;var fI={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},pI=function(t,r,n,o){return fI[t]},Dy=pI;function Vn(e){return function(t,r){var n=r!=null&&r.context?String(r.context):"standalone",o;if(n==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=r!=null&&r.width?String(r.width):i;o=e.formattingValues[a]||e.formattingValues[i];}else {var s=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;o=e.values[l]||e.values[s];}var u=e.argumentCallback?e.argumentCallback(t):t;return o[u]}}var mI={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},gI={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},hI={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},bI={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},yI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},xI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vI=function(t,r){var n=Number(t),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},wI={ordinalNumber:vI,era:Vn({values:mI,defaultWidth:"wide"}),quarter:Vn({values:gI,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Vn({values:hI,defaultWidth:"wide"}),day:Vn({values:bI,defaultWidth:"wide"}),dayPeriod:Vn({values:yI,defaultWidth:"wide",formattingValues:xI,defaultFormattingWidth:"wide"})},My=wI;function Hn(e){return function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a=i[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?CI(s,function(d){return d.test(a)}):TI(s,function(d){return d.test(a)}),u;u=e.valueCallback?e.valueCallback(l):l,u=r.valueCallback?r.valueCallback(u):u;var c=t.slice(a.length);return {value:u,rest:c}}}function TI(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}function CI(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r}function bu(e){return function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.match(e.matchPattern);if(!n)return null;var o=n[0],i=t.match(e.parsePattern);if(!i)return null;var a=e.valueCallback?e.valueCallback(i[0]):i[0];a=r.valueCallback?r.valueCallback(a):a;var s=t.slice(o.length);return {value:a,rest:s}}}var _I=/^(\d+)(th|st|nd|rd)?/i,SI=/\d+/i,kI={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},PI={any:[/^b/i,/^(a|c)/i]},EI={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},II={any:[/1/i,/2/i,/3/i,/4/i]},AI={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},OI={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},RI={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},DI={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},MI={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},$I={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},NI={ordinalNumber:bu({matchPattern:_I,parsePattern:SI,valueCallback:function(t){return parseInt(t,10)}}),era:Hn({matchPatterns:kI,defaultMatchWidth:"wide",parsePatterns:PI,defaultParseWidth:"any"}),quarter:Hn({matchPatterns:EI,defaultMatchWidth:"wide",parsePatterns:II,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Hn({matchPatterns:AI,defaultMatchWidth:"wide",parsePatterns:OI,defaultParseWidth:"any"}),day:Hn({matchPatterns:RI,defaultMatchWidth:"wide",parsePatterns:DI,defaultParseWidth:"any"}),dayPeriod:Hn({matchPatterns:MI,defaultMatchWidth:"any",parsePatterns:$I,defaultParseWidth:"any"})},$y=NI;var LI={code:"en-US",formatDistance:Oy,formatLong:Ry,formatRelative:Dy,localize:My,match:$y,options:{weekStartsOn:0,firstWeekContainsDate:1}},Ny=LI;var Ws=Ny;var FI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,BI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,UI=/^'([^]*?)'?$/,VI=/''/g,HI=/[a-zA-Z]/;function la(e,t,r){var n,o,i,a,s,l,d,p,f,b,g,y,E,h;Te(2,arguments);var C=String(t),$=Zt(),H=(n=(o=r?.locale)!==null&&o!==void 0?o:$.locale)!==null&&n!==void 0?n:Ws,N=ze((i=(a=(s=(l=r?.firstWeekContainsDate)!==null&&l!==void 0?l:void 0)!==null&&s!==void 0?s:$.firstWeekContainsDate)!==null&&a!==void 0?a:(d=$.locale)===null||d===void 0||(p=d.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(N>=1&&N<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var _=ze((f=(b=(g=(y=r?.weekStartsOn)!==null&&y!==void 0?y:void 0)!==null&&g!==void 0?g:$.weekStartsOn)!==null&&b!==void 0?b:(E=$.locale)===null||E===void 0||(h=E.options)===null||h===void 0?void 0:h.weekStartsOn)!==null&&f!==void 0?f:0);if(!(_>=0&&_<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!H.localize)throw new RangeError("locale must contain localize property");if(!H.formatLong)throw new RangeError("locale must contain formatLong property");var A=De(e);if(!pu(A))throw new RangeError("Invalid time value");var I=ta(A),k=ra(A,I),O={firstWeekContainsDate:N,weekStartsOn:_,locale:H,_originalDate:A},D=C.match(BI).map(function(F){var j=F[0];if(j==="p"||j==="P"){var ne=aa[j];return ne(F,H.formatLong)}return F}).join("").match(FI).map(function(F){if(F==="''")return "'";var j=F[0];if(j==="'")return WI(F);var ne=Ey[j];if(ne)return Hs(F)&&qo(F,t,String(e)),Vs(F)&&qo(F,t,String(e)),ne(k,F,H.localize,O);if(j.match(HI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+j+"`");return F}).join("");return D}function WI(e){var t=e.match(UI);return t?t[1].replace(VI,"'"):e}function yu(e,t){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}function xu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Ly(e,t){if(e){if(typeof e=="string")return xu(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xu(e,t):void 0}}function vu(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ly(e))||t){r&&(e=r);var n=0,o=function(){};return {s:o,n:function(){return n>=e.length?{done:true}:{done:false,value:e[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
49
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=true,s=false;return {s:function(){r=r.call(e);},n:function(){var u=r.next();return a=u.done,u},e:function(u){s=true,i=u;},f:function(){try{a||r.return==null||r.return();}finally{if(s)throw i}}}}function V(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function js(e,t){return js=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},js(e,t)}function ee(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}}),Object.defineProperty(e,"prototype",{writable:false}),t&&js(e,t);}function ca(e){return ca=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ca(e)}function wu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch{}return (wu=function(){return !!e})()}function Fy(e,t){if(t&&(Pt(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return V(e)}function te(e){var t=wu();return function(){var r,n=ca(e);if(t){var o=ca(this).constructor;r=Reflect.construct(n,arguments,o);}else r=n.apply(this,arguments);return Fy(this,r)}}function Z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function By(e,t){if(Pt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Pt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}function zs(e){var t=By(e,"string");return Pt(t)=="symbol"?t:t+""}function Uy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,zs(n.key),n);}}function Q(e,t,r){return t&&Uy(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function B(e,t,r){return (t=zs(t))in e?Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true}):e[t]=r,e}var jI=10,Vy=(function(){function e(){Z(this,e),B(this,"priority",void 0),B(this,"subPriority",0);}return Q(e,[{key:"validate",value:function(r,n){return true}}]),e})(),Hy=(function(e){ee(r,e);var t=te(r);function r(n,o,i,a,s){var l;return Z(this,r),l=t.call(this),l.value=n,l.validateValue=o,l.setValue=i,l.priority=a,s&&(l.subPriority=s),l}return Q(r,[{key:"validate",value:function(o,i){return this.validateValue(o,this.value,i)}},{key:"set",value:function(o,i,a){return this.setValue(o,i,this.value,a)}}]),r})(Vy),Wy=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",jI),B(V(n),"subPriority",-1),n}return Q(r,[{key:"set",value:function(o,i){if(i.timestampIsSet)return o;var a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}}]),r})(Vy);var re=(function(){function e(){Z(this,e),B(this,"incompatibleTokens",void 0),B(this,"priority",void 0),B(this,"subPriority",void 0);}return Q(e,[{key:"run",value:function(r,n,o,i){var a=this.parse(r,n,o,i);return a?{setter:new Hy(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}},{key:"validate",value:function(r,n,o){return true}}]),e})();var jy=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",140),B(V(n),"incompatibleTokens",["R","u","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "G":case "GG":case "GGG":return a.era(o,{width:"abbreviated"})||a.era(o,{width:"narrow"});case "GGGGG":return a.era(o,{width:"narrow"});case "GGGG":default:return a.era(o,{width:"wide"})||a.era(o,{width:"abbreviated"})||a.era(o,{width:"narrow"})}}},{key:"set",value:function(o,i,a){return i.era=a,o.setUTCFullYear(a,0,1),o.setUTCHours(0,0,0,0),o}}]),r})(re);var Ae={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Jt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Ue(e,t){return e&&{value:t(e.value),rest:e.rest}}function Ie(e,t){var r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}function er(e,t){var r=t.match(e);if(!r)return null;if(r[0]==="Z")return {value:0,rest:t.slice(1)};var n=r[1]==="+"?1:-1,o=r[2]?parseInt(r[2],10):0,i=r[3]?parseInt(r[3],10):0,a=r[5]?parseInt(r[5],10):0;return {value:n*(o*Cy+i*Ty+a*_y),rest:t.slice(r[0].length)}}function Gs(e){return Ie(Ae.anyDigitsSigned,e)}function xe(e,t){switch(e){case 1:return Ie(Ae.singleDigit,t);case 2:return Ie(Ae.twoDigits,t);case 3:return Ie(Ae.threeDigits,t);case 4:return Ie(Ae.fourDigits,t);default:return Ie(new RegExp("^\\d{1,"+e+"}"),t)}}function Yo(e,t){switch(e){case 1:return Ie(Ae.singleDigitSigned,t);case 2:return Ie(Ae.twoDigitsSigned,t);case 3:return Ie(Ae.threeDigitsSigned,t);case 4:return Ie(Ae.fourDigitsSigned,t);default:return Ie(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Ko(e){switch(e){case "morning":return 4;case "evening":return 17;case "pm":case "noon":case "afternoon":return 12;case "am":case "midnight":case "night":default:return 0}}function qs(e,t){var r=t>0,n=r?t:1-t,o;if(n<=50)o=e||100;else {var i=n+50,a=Math.floor(i/100)*100,s=e>=i%100;o=e+a-(s?100:0);}return r?o:1-o}function Ys(e){return e%400===0||e%4===0&&e%100!==0}var zy=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",130),B(V(n),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){var s=function(u){return {year:u,isTwoDigitYear:i==="yy"}};switch(i){case "y":return Ue(xe(4,o),s);case "yo":return Ue(a.ordinalNumber(o,{unit:"year"}),s);default:return Ue(xe(i.length,o),s)}}},{key:"validate",value:function(o,i){return i.isTwoDigitYear||i.year>0}},{key:"set",value:function(o,i,a){var s=o.getUTCFullYear();if(a.isTwoDigitYear){var l=qs(a.year,s);return o.setUTCFullYear(l,0,1),o.setUTCHours(0,0,0,0),o}var u=!("era"in i)||i.era===1?a.year:1-a.year;return o.setUTCFullYear(u,0,1),o.setUTCHours(0,0,0,0),o}}]),r})(re);var Gy=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",130),B(V(n),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){var s=function(u){return {year:u,isTwoDigitYear:i==="YY"}};switch(i){case "Y":return Ue(xe(4,o),s);case "Yo":return Ue(a.ordinalNumber(o,{unit:"year"}),s);default:return Ue(xe(i.length,o),s)}}},{key:"validate",value:function(o,i){return i.isTwoDigitYear||i.year>0}},{key:"set",value:function(o,i,a,s){var l=Bn(o,s);if(a.isTwoDigitYear){var u=qs(a.year,l);return o.setUTCFullYear(u,0,s.firstWeekContainsDate),o.setUTCHours(0,0,0,0),Ft(o,s)}var c=!("era"in i)||i.era===1?a.year:1-a.year;return o.setUTCFullYear(c,0,s.firstWeekContainsDate),o.setUTCHours(0,0,0,0),Ft(o,s)}}]),r})(re);var qy=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",130),B(V(n),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i){return i==="R"?Yo(4,o):Yo(i.length,o)}},{key:"set",value:function(o,i,a){var s=new Date(0);return s.setUTCFullYear(a,0,4),s.setUTCHours(0,0,0,0),Qt(s)}}]),r})(re);var Yy=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",130),B(V(n),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i){return i==="u"?Yo(4,o):Yo(i.length,o)}},{key:"set",value:function(o,i,a){return o.setUTCFullYear(a,0,1),o.setUTCHours(0,0,0,0),o}}]),r})(re);var Ky=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",120),B(V(n),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "Q":case "QQ":return xe(i.length,o);case "Qo":return a.ordinalNumber(o,{unit:"quarter"});case "QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"})||a.quarter(o,{width:"narrow",context:"formatting"});case "QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});case "QQQQ":default:return a.quarter(o,{width:"wide",context:"formatting"})||a.quarter(o,{width:"abbreviated",context:"formatting"})||a.quarter(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=1&&i<=4}},{key:"set",value:function(o,i,a){return o.setUTCMonth((a-1)*3,1),o.setUTCHours(0,0,0,0),o}}]),r})(re);var Xy=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",120),B(V(n),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "q":case "qq":return xe(i.length,o);case "qo":return a.ordinalNumber(o,{unit:"quarter"});case "qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"})||a.quarter(o,{width:"narrow",context:"standalone"});case "qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});case "qqqq":default:return a.quarter(o,{width:"wide",context:"standalone"})||a.quarter(o,{width:"abbreviated",context:"standalone"})||a.quarter(o,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(o,i){return i>=1&&i<=4}},{key:"set",value:function(o,i,a){return o.setUTCMonth((a-1)*3,1),o.setUTCHours(0,0,0,0),o}}]),r})(re);var Zy=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),B(V(n),"priority",110),n}return Q(r,[{key:"parse",value:function(o,i,a){var s=function(u){return u-1};switch(i){case "M":return Ue(Ie(Ae.month,o),s);case "MM":return Ue(xe(2,o),s);case "Mo":return Ue(a.ordinalNumber(o,{unit:"month"}),s);case "MMM":return a.month(o,{width:"abbreviated",context:"formatting"})||a.month(o,{width:"narrow",context:"formatting"});case "MMMMM":return a.month(o,{width:"narrow",context:"formatting"});case "MMMM":default:return a.month(o,{width:"wide",context:"formatting"})||a.month(o,{width:"abbreviated",context:"formatting"})||a.month(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=11}},{key:"set",value:function(o,i,a){return o.setUTCMonth(a,1),o.setUTCHours(0,0,0,0),o}}]),r})(re);var Qy=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",110),B(V(n),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){var s=function(u){return u-1};switch(i){case "L":return Ue(Ie(Ae.month,o),s);case "LL":return Ue(xe(2,o),s);case "Lo":return Ue(a.ordinalNumber(o,{unit:"month"}),s);case "LLL":return a.month(o,{width:"abbreviated",context:"standalone"})||a.month(o,{width:"narrow",context:"standalone"});case "LLLLL":return a.month(o,{width:"narrow",context:"standalone"});case "LLLL":default:return a.month(o,{width:"wide",context:"standalone"})||a.month(o,{width:"abbreviated",context:"standalone"})||a.month(o,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=11}},{key:"set",value:function(o,i,a){return o.setUTCMonth(a,1),o.setUTCHours(0,0,0,0),o}}]),r})(re);function Tu(e,t,r){Te(2,arguments);var n=De(e),o=ze(t),i=ia(n,r)-o;return n.setUTCDate(n.getUTCDate()-i*7),n}var Jy=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",100),B(V(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "w":return Ie(Ae.week,o);case "wo":return a.ordinalNumber(o,{unit:"week"});default:return xe(i.length,o)}}},{key:"validate",value:function(o,i){return i>=1&&i<=53}},{key:"set",value:function(o,i,a,s){return Ft(Tu(o,a,s),s)}}]),r})(re);function Cu(e,t){Te(2,arguments);var r=De(e),n=ze(t),o=oa(r)-n;return r.setUTCDate(r.getUTCDate()-o*7),r}var ex=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",100),B(V(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "I":return Ie(Ae.week,o);case "Io":return a.ordinalNumber(o,{unit:"week"});default:return xe(i.length,o)}}},{key:"validate",value:function(o,i){return i>=1&&i<=53}},{key:"set",value:function(o,i,a){return Qt(Cu(o,a))}}]),r})(re);var zI=[31,28,31,30,31,30,31,31,30,31,30,31],GI=[31,29,31,30,31,30,31,31,30,31,30,31],tx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",90),B(V(n),"subPriority",1),B(V(n),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "d":return Ie(Ae.date,o);case "do":return a.ordinalNumber(o,{unit:"date"});default:return xe(i.length,o)}}},{key:"validate",value:function(o,i){var a=o.getUTCFullYear(),s=Ys(a),l=o.getUTCMonth();return s?i>=1&&i<=GI[l]:i>=1&&i<=zI[l]}},{key:"set",value:function(o,i,a){return o.setUTCDate(a),o.setUTCHours(0,0,0,0),o}}]),r})(re);var rx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",90),B(V(n),"subpriority",1),B(V(n),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "D":case "DD":return Ie(Ae.dayOfYear,o);case "Do":return a.ordinalNumber(o,{unit:"date"});default:return xe(i.length,o)}}},{key:"validate",value:function(o,i){var a=o.getUTCFullYear(),s=Ys(a);return s?i>=1&&i<=366:i>=1&&i<=365}},{key:"set",value:function(o,i,a){return o.setUTCMonth(0,a),o.setUTCHours(0,0,0,0),o}}]),r})(re);function Wn(e,t,r){var n,o,i,a,s,l,u,c;Te(2,arguments);var d=Zt(),p=ze((n=(o=(i=(a=r?.weekStartsOn)!==null&&a!==void 0?a:r==null||(s=r.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&i!==void 0?i:d.weekStartsOn)!==null&&o!==void 0?o:(u=d.locale)===null||u===void 0||(c=u.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=De(e),b=ze(t),g=f.getUTCDay(),y=b%7,T=(y+7)%7,S=(T<p?7:0)+b-g;return f.setUTCDate(f.getUTCDate()+S),f}var nx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",90),B(V(n),"incompatibleTokens",["D","i","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "E":case "EE":case "EEE":return a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"});case "EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case "EEEEEE":return a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"});case "EEEE":default:return a.day(o,{width:"wide",context:"formatting"})||a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=6}},{key:"set",value:function(o,i,a,s){return o=Wn(o,a,s),o.setUTCHours(0,0,0,0),o}}]),r})(re);var ox=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",90),B(V(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a,s){var l=function(c){var d=Math.floor((c-1)/7)*7;return (c+s.weekStartsOn+6)%7+d};switch(i){case "e":case "ee":return Ue(xe(i.length,o),l);case "eo":return Ue(a.ordinalNumber(o,{unit:"day"}),l);case "eee":return a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"});case "eeeee":return a.day(o,{width:"narrow",context:"formatting"});case "eeeeee":return a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"});case "eeee":default:return a.day(o,{width:"wide",context:"formatting"})||a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=6}},{key:"set",value:function(o,i,a,s){return o=Wn(o,a,s),o.setUTCHours(0,0,0,0),o}}]),r})(re);var ix=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",90),B(V(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a,s){var l=function(c){var d=Math.floor((c-1)/7)*7;return (c+s.weekStartsOn+6)%7+d};switch(i){case "c":case "cc":return Ue(xe(i.length,o),l);case "co":return Ue(a.ordinalNumber(o,{unit:"day"}),l);case "ccc":return a.day(o,{width:"abbreviated",context:"standalone"})||a.day(o,{width:"short",context:"standalone"})||a.day(o,{width:"narrow",context:"standalone"});case "ccccc":return a.day(o,{width:"narrow",context:"standalone"});case "cccccc":return a.day(o,{width:"short",context:"standalone"})||a.day(o,{width:"narrow",context:"standalone"});case "cccc":default:return a.day(o,{width:"wide",context:"standalone"})||a.day(o,{width:"abbreviated",context:"standalone"})||a.day(o,{width:"short",context:"standalone"})||a.day(o,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=6}},{key:"set",value:function(o,i,a,s){return o=Wn(o,a,s),o.setUTCHours(0,0,0,0),o}}]),r})(re);function _u(e,t){Te(2,arguments);var r=ze(t);r%7===0&&(r=r-7);var n=1,o=De(e),i=o.getUTCDay(),a=r%7,s=(a+7)%7,l=(s<n?7:0)+r-i;return o.setUTCDate(o.getUTCDate()+l),o}var ax=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",90),B(V(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){var s=function(u){return u===0?7:u};switch(i){case "i":case "ii":return xe(i.length,o);case "io":return a.ordinalNumber(o,{unit:"day"});case "iii":return Ue(a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"}),s);case "iiiii":return Ue(a.day(o,{width:"narrow",context:"formatting"}),s);case "iiiiii":return Ue(a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"}),s);case "iiii":default:return Ue(a.day(o,{width:"wide",context:"formatting"})||a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"}),s)}}},{key:"validate",value:function(o,i){return i>=1&&i<=7}},{key:"set",value:function(o,i,a){return o=_u(o,a),o.setUTCHours(0,0,0,0),o}}]),r})(re);var sx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",80),B(V(n),"incompatibleTokens",["b","B","H","k","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "a":case "aa":case "aaa":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"});case "aaaaa":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case "aaaa":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})||a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(o,i,a){return o.setUTCHours(Ko(a),0,0,0),o}}]),r})(re);var lx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",80),B(V(n),"incompatibleTokens",["a","B","H","k","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "b":case "bb":case "bbb":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"});case "bbbbb":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case "bbbb":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})||a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(o,i,a){return o.setUTCHours(Ko(a),0,0,0),o}}]),r})(re);var cx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",80),B(V(n),"incompatibleTokens",["a","b","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "B":case "BB":case "BBB":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"});case "BBBBB":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case "BBBB":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})||a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(o,i,a){return o.setUTCHours(Ko(a),0,0,0),o}}]),r})(re);var ux=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",70),B(V(n),"incompatibleTokens",["H","K","k","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "h":return Ie(Ae.hour12h,o);case "ho":return a.ordinalNumber(o,{unit:"hour"});default:return xe(i.length,o)}}},{key:"validate",value:function(o,i){return i>=1&&i<=12}},{key:"set",value:function(o,i,a){var s=o.getUTCHours()>=12;return s&&a<12?o.setUTCHours(a+12,0,0,0):!s&&a===12?o.setUTCHours(0,0,0,0):o.setUTCHours(a,0,0,0),o}}]),r})(re);var dx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",70),B(V(n),"incompatibleTokens",["a","b","h","K","k","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "H":return Ie(Ae.hour23h,o);case "Ho":return a.ordinalNumber(o,{unit:"hour"});default:return xe(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=23}},{key:"set",value:function(o,i,a){return o.setUTCHours(a,0,0,0),o}}]),r})(re);var fx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",70),B(V(n),"incompatibleTokens",["h","H","k","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "K":return Ie(Ae.hour11h,o);case "Ko":return a.ordinalNumber(o,{unit:"hour"});default:return xe(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=11}},{key:"set",value:function(o,i,a){var s=o.getUTCHours()>=12;return s&&a<12?o.setUTCHours(a+12,0,0,0):o.setUTCHours(a,0,0,0),o}}]),r})(re);var px=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",70),B(V(n),"incompatibleTokens",["a","b","h","H","K","t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "k":return Ie(Ae.hour24h,o);case "ko":return a.ordinalNumber(o,{unit:"hour"});default:return xe(i.length,o)}}},{key:"validate",value:function(o,i){return i>=1&&i<=24}},{key:"set",value:function(o,i,a){var s=a<=24?a%24:a;return o.setUTCHours(s,0,0,0),o}}]),r})(re);var mx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",60),B(V(n),"incompatibleTokens",["t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "m":return Ie(Ae.minute,o);case "mo":return a.ordinalNumber(o,{unit:"minute"});default:return xe(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=59}},{key:"set",value:function(o,i,a){return o.setUTCMinutes(a,0,0),o}}]),r})(re);var gx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",50),B(V(n),"incompatibleTokens",["t","T"]),n}return Q(r,[{key:"parse",value:function(o,i,a){switch(i){case "s":return Ie(Ae.second,o);case "so":return a.ordinalNumber(o,{unit:"second"});default:return xe(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=59}},{key:"set",value:function(o,i,a){return o.setUTCSeconds(a,0),o}}]),r})(re);var hx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",30),B(V(n),"incompatibleTokens",["t","T"]),n}return Q(r,[{key:"parse",value:function(o,i){var a=function(l){return Math.floor(l*Math.pow(10,-i.length+3))};return Ue(xe(i.length,o),a)}},{key:"set",value:function(o,i,a){return o.setUTCMilliseconds(a),o}}]),r})(re);var bx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",10),B(V(n),"incompatibleTokens",["t","T","x"]),n}return Q(r,[{key:"parse",value:function(o,i){switch(i){case "X":return er(Jt.basicOptionalMinutes,o);case "XX":return er(Jt.basic,o);case "XXXX":return er(Jt.basicOptionalSeconds,o);case "XXXXX":return er(Jt.extendedOptionalSeconds,o);case "XXX":default:return er(Jt.extended,o)}}},{key:"set",value:function(o,i,a){return i.timestampIsSet?o:new Date(o.getTime()-a)}}]),r})(re);var yx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",10),B(V(n),"incompatibleTokens",["t","T","X"]),n}return Q(r,[{key:"parse",value:function(o,i){switch(i){case "x":return er(Jt.basicOptionalMinutes,o);case "xx":return er(Jt.basic,o);case "xxxx":return er(Jt.basicOptionalSeconds,o);case "xxxxx":return er(Jt.extendedOptionalSeconds,o);case "xxx":default:return er(Jt.extended,o)}}},{key:"set",value:function(o,i,a){return i.timestampIsSet?o:new Date(o.getTime()-a)}}]),r})(re);var xx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",40),B(V(n),"incompatibleTokens","*"),n}return Q(r,[{key:"parse",value:function(o){return Gs(o)}},{key:"set",value:function(o,i,a){return [new Date(a*1e3),{timestampIsSet:true}]}}]),r})(re);var vx=(function(e){ee(r,e);var t=te(r);function r(){var n;Z(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),B(V(n),"priority",20),B(V(n),"incompatibleTokens","*"),n}return Q(r,[{key:"parse",value:function(o){return Gs(o)}},{key:"set",value:function(o,i,a){return [new Date(a),{timestampIsSet:true}]}}]),r})(re);var wx={G:new jy,y:new zy,Y:new Gy,R:new qy,u:new Yy,Q:new Ky,q:new Xy,M:new Zy,L:new Qy,w:new Jy,I:new ex,d:new tx,D:new rx,E:new nx,e:new ox,c:new ix,i:new ax,a:new sx,b:new lx,B:new cx,h:new ux,H:new dx,K:new fx,k:new px,m:new mx,s:new gx,S:new hx,X:new bx,x:new yx,t:new xx,T:new vx};var qI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,YI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,KI=/^'([^]*?)'?$/,XI=/''/g,ZI=/\S/,QI=/[a-zA-Z]/;function Ks(e,t,r,n){var o,i,a,s,l,u,p,f,b,g,y,T,h,C;Te(3,arguments);var $=String(e),H=String(t),N=Zt(),_=(o=(i=n?.locale)!==null&&i!==void 0?i:N.locale)!==null&&o!==void 0?o:Ws;if(!_.match)throw new RangeError("locale must contain match property");var A=ze((a=(s=(l=(u=n?.firstWeekContainsDate)!==null&&u!==void 0?u:void 0)!==null&&l!==void 0?l:N.firstWeekContainsDate)!==null&&s!==void 0?s:(p=N.locale)===null||p===void 0||(f=p.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(A>=1&&A<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var I=ze((b=(g=(y=(T=n?.weekStartsOn)!==null&&T!==void 0?T:void 0)!==null&&y!==void 0?y:N.weekStartsOn)!==null&&g!==void 0?g:(h=N.locale)===null||h===void 0||(C=h.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&b!==void 0?b:0);if(!(I>=0&&I<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(H==="")return $===""?De(r):new Date(NaN);var k={firstWeekContainsDate:A,weekStartsOn:I,locale:_},O=[new Wy],D=H.match(YI).map(function(Ke){var Oe=Ke[0];if(Oe in aa){var Tt=aa[Oe];return Tt(Ke,_.formatLong)}return Ke}).join("").match(qI),F=[],j=vu(D),ne;try{var ve=function(){var Oe=ne.value;!(n!=null&&n.useAdditionalWeekYearTokens)&&Hs(Oe)&&qo(Oe,H,e),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Vs(Oe)&&qo(Oe,H,e);var Tt=Oe[0],gn=wx[Tt];if(gn){var Mr=gn.incompatibleTokens;if(Array.isArray(Mr)){var Jn=F.find(function(eo){return Mr.includes(eo.token)||eo.token===Tt});if(Jn)throw new RangeError("The format string mustn't contain `".concat(Jn.fullToken,"` and `").concat(Oe,"` at the same time"))}else if(gn.incompatibleTokens==="*"&&F.length>0)throw new RangeError("The format string mustn't contain `".concat(Oe,"` and any other token at the same time"));F.push({token:Tt,fullToken:Oe});var nr=gn.run($,Oe,_.match,k);if(!nr)return {v:new Date(NaN)};O.push(nr.setter),$=nr.rest;}else {if(Tt.match(QI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Tt+"`");if(Oe==="''"?Oe="'":Tt==="'"&&(Oe=JI(Oe)),$.indexOf(Oe)===0)$=$.slice(Oe.length);else return {v:new Date(NaN)}}};for(j.s();!(ne=j.n()).done;){var fe=ve();if(Pt(fe)==="object")return fe.v}}catch(Ke){j.e(Ke);}finally{j.f();}if($.length>0&&ZI.test($))return new Date(NaN);var Be=O.map(function(Ke){return Ke.priority}).sort(function(Ke,Oe){return Oe-Ke}).filter(function(Ke,Oe,Tt){return Tt.indexOf(Ke)===Oe}).map(function(Ke){return O.filter(function(Oe){return Oe.priority===Ke}).sort(function(Oe,Tt){return Tt.subPriority-Oe.subPriority})}).map(function(Ke){return Ke[0]}),pe=De(r);if(isNaN(pe.getTime()))return new Date(NaN);var wt=ra(pe,ta(pe)),Ye={},rr=vu(Be),Ve;try{for(rr.s();!(Ve=rr.n()).done;){var Ut=Ve.value;if(!Ut.validate(wt,k))return new Date(NaN);var Vt=Ut.set(wt,Ye,k);Array.isArray(Vt)?(wt=Vt[0],yu(Ye,Vt[1])):wt=Vt;}}catch(Ke){rr.e(Ke);}finally{rr.f();}return wt}function JI(e){return e.match(KI)[1].replace(XI,"'")}var e1=w('<div class="agent-input-form flex gap-2 items-end"><form><div class="flex flex-col"><div><input class="focus:outline-none flex-1 w-full text-input agent-date-input"data-testid=from-date>'),Tx=w("<p class=font-semibold>"),t1=w('<div class="flex items-center p-4"><input class="focus:outline-none flex-1 w-full text-input ml-2 agent-date-input"data-testid=to-date>'),Cx=e=>{let[t,r]=R(r1(e.defaultValue??"",e.options)),n=()=>{if(t().from===""&&t().to==="")return;let o=e.options?.format??(e.options?.hasTime?Fn.formatWithTime:Fn.format),i=l=>{if(!l)return "";try{let u;if(l.includes("T"))u=new Date(l);else {let[c,d,p]=l.split("-").map(Number);u=new Date(c,d-1,p);}return console.log("formatValue:",{input:l,parsedDate:u,formatted:la(u,o)}),isNaN(u.getTime())?l:la(u,o)}catch{return l}},a=i(t().from),s=i(t().to);console.log("DateForm - Sending:",{originalFrom:t().from,originalTo:t().to,formattedFrom:a,formattedTo:s,formatString:o}),e.onSubmit({type:"text",value:`${a}${e.options?.isRange?` to ${s}`:""}`});};return (()=>{var o=e1(),i=o.firstChild,a=i.firstChild,s=a.firstChild,l=s.firstChild;return i.addEventListener("submit",u=>{u.preventDefault(),n();}),x(s,(()=>{var u=L(()=>!!e.options?.isRange);return ()=>u()&&(()=>{var c=Tx();return x(c,()=>e.options.labels?.from??Fn.labels.from),c})()})(),l),l.addEventListener("change",u=>r({...t(),from:u.currentTarget.value})),l.style.setProperty("min-height","32px"),l.style.setProperty("min-width","100px"),l.style.setProperty("font-size","16px"),x(a,(()=>{var u=L(()=>!!e.options?.isRange);return ()=>u()&&(()=>{var c=t1(),d=c.firstChild;return x(c,(()=>{var p=L(()=>!!e.options.isRange);return ()=>p()&&(()=>{var f=Tx();return x(f,()=>e.options.labels?.to??Fn.labels.to),f})()})(),d),d.addEventListener("change",p=>r({...t(),to:p.currentTarget.value})),d.style.setProperty("min-height","32px"),d.style.setProperty("min-width","100px"),d.style.setProperty("font-size","16px"),M(p=>{var f=e.options.hasTime?"datetime-local":"date",b=e.options?.min,g=e.options?.max;return f!==p.e&&G(d,"type",p.e=f),b!==p.t&&G(d,"min",p.t=b),g!==p.a&&G(d,"max",p.a=g),p},{e:void 0,t:void 0,a:void 0}),M(()=>d.value=t().to),c})()})(),null),x(o,m(We,{class:"h-[56px]","on:click":n,get children(){return e.options?.labels?.button}}),null),M(u=>{var c=ye("flex agent-input",e.options?.isRange?"items-end":"items-center"),d="flex items-center p-4 "+(e.options?.isRange?"pb-0 gap-2":""),p=e.options?.hasTime?"datetime-local":"date",f=e.options?.min,b=e.options?.max;return c!==u.e&&U(i,u.e=c),d!==u.t&&U(s,u.t=d),p!==u.a&&G(l,"type",u.a=p),f!==u.o&&G(l,"min",u.o=f),b!==u.i&&G(l,"max",u.i=b),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),M(()=>l.value=t().from),o})()},r1=(e,t)=>{let r=i=>{if(!i||!t?.format)return i;try{if(/^\d{4}-\d{2}-\d{2}/.test(i))return i;let a=t.format??(t.hasTime?Fn.formatWithTime:Fn.format),s=Ks(i,a,new Date);if(!isNaN(s.getTime()))if(t.hasTime){let l=s.getFullYear(),u=String(s.getMonth()+1).padStart(2,"0"),c=String(s.getDate()).padStart(2,"0"),d=String(s.getHours()).padStart(2,"0"),p=String(s.getMinutes()).padStart(2,"0");return `${l}-${u}-${c}T${d}:${p}`}else {let l=s.getFullYear(),u=String(s.getMonth()+1).padStart(2,"0"),c=String(s.getDate()).padStart(2,"0");return `${l}-${u}-${c}`}return i}catch{return i}};if(!e.includes("to"))return {from:r(e),to:""};let[n,o]=e.split(" to ");return {from:r(n),to:r(o)}};var mr={isMultipleAllowed:false,labels:{placeholder:`<strong>
28
50
  Click to upload
29
51
  </strong> or drag and drop here<br>
30
- (max 10MB)`,button:"Upload",clear:"Clear",skip:"Skip",success:{single:"File uploaded",multiple:"{total} files uploaded"}}};var kl=({newFile:e,existingFiles:t,params:r,onError:n})=>{let o=r.sizeLimit??Er("NEXT_PUBLIC_AGENT_FILE_UPLOAD_MAX_SIZE");if(o&&e.size>o*1024*1024){n({title:"File too large",description:`${e.name} is larger than ${o}MB`});return}if(t.length===0)return e;let i=e.name,a=1;for(;t.some(s=>s.name===i);){let s=e.name.lastIndexOf("."),l=s!==-1?e.name.slice(s):"";i=`${e.name.slice(0,s)}(${a})${l}`,a++;}return new File([e],i,{type:e.type})};var ci=async({apiHost:e,files:t,onUploadProgress:r})=>{let n=[],o=0;for(let{input:i,file:a}of t){r&&r({progress:o/t.length*100,fileIndex:o}),o+=1;let{data:s}=await em({method:"POST",url:`${e}/api/v3/generate-upload-url`,body:{fileName:i.fileName,sessionId:i.sessionId,fileType:a.type,blockId:i.blockId}});if(s?.presignedUrl){let l=new FormData;if(Object.entries(s.formData).forEach(([u,d])=>{l.append(u,d);}),l.append("file",a),!(await fetch(s.presignedUrl,{method:"PUT",body:a,headers:{"Content-Type":a.type}})).ok)continue;n.push({url:s.fileUrl,type:a.type});}else continue}return n};var _1=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4">'),Pl=e=>(()=>{var t=_1();return De(t,e,true,true),t})();var C1=w('<div class="flex items-center gap-4 border bg-white border-gray-200 rounded-md p-2 text-gray-900 min-w-[250px]"><div></div><div class="flex flex-col"><span class="text-md font-semibold text-sm"></span><span class="text-gray-500 text-xs">'),El=e=>{let t=k1(e.file);return (()=>{var r=C1(),n=r.firstChild,o=n.nextSibling,i=o.firstChild,a=i.nextSibling;return v(n,m(Pl,{class:"w-6 h-6"})),v(i,()=>e.file.name),v(a,()=>S1(e.file)),$(()=>j(n,xe("rounded-md text-white p-2 flex items-center",t==="pink"&&"bg-pink-400",t==="blue"&&"bg-blue-400",t==="green"&&"bg-green-400",t==="gray"&&"bg-gray-400",t==="orange"&&"bg-orange-400"))),r})()},S1=e=>{switch(e.name.split(".").pop()){case "pdf":return "PDF";case "doc":case "docx":return "Word";case "xls":case "xlsx":case "csv":return "Sheet";case "json":return "JSON";case "md":return "Markdown";default:return "DOCUMENT"}},k1=e=>{let t=e.name.split(".").pop();if(!t)return "gray";switch(t){case "pdf":return "pink";case "doc":case "docx":return "blue";case "xls":case "xlsx":case "csv":return "green";case "json":return "orange";default:return "gray"}};var P1=w('<img class="rounded-md object-cover w-[58px] h-[58px]">'),E1=w('<div class="relative group flex-shrink-0"><button class="absolute -right-2 p-0.5 -top-2 rounded-full bg-gray-200 text-black border border-gray-400 opacity-1 sm:opacity-0 group-hover:opacity-100 transition-opacity"aria-label="Remove attachment">'),I1=w('<div class="absolute w-full h-full inset-0 bg-black/20 rounded-md">'),Il=e=>(()=>{var t=E1(),r=t.firstChild;return v(t,m(He,{get children(){return [m(J,{get when(){return e.file.type.startsWith("image")},get children(){var n=P1();return $(o=>{var i=URL.createObjectURL(e.file),a=e.file.name;return i!==o.e&&G(n,"src",o.e=i),a!==o.t&&G(n,"alt",o.t=a),o},{e:void 0,t:void 0}),n}}),m(J,{when:true,get children(){return m(El,{get file(){return e.file}})}})]}}),r),ot(r,"click",e.onRemoveClick),v(r,m(Ur,{class:"w-4"})),v(t,m(W,{get when(){return pe(e.uploadProgressPercent)&&e.uploadProgressPercent!==100},get children(){return m(A1,{get progressPercent(){return e.uploadProgressPercent}})}}),null),t})(),A1=e=>{let[t,r]=M(e.progressPercent??0),n;return Se(()=>{e.progressPercent===20&&(n=setInterval(()=>{t()<100&&r(i=>i+(Math.floor(Math.random()*10)+1));},1e3));}),me(()=>{clearInterval(n);}),(()=>{var o=I1();return v(o,m(Gn.Root,{get value(){return t()},class:"flex items-center justify-center",get children(){return m(Gn.Circle,{get children(){return [m(Gn.CircleTrack,{}),m(Gn.CircleRange,{})]}})}})),o})()};var O1=w('<div class="w-full bg-gray-200 rounded-full h-2.5"><div class="upload-progress-bar h-2.5 rounded-full">'),R1=w('<div class="p-4 flex gap-2 border-gray-200 border overflow-auto bg-white rounded-md w-full">'),D1=w('<div class="flex flex-col justify-center items-center gap-4 max-w-[90%]"><p class="text-sm text-center">'),M1=w("<input id=dropzone-file type=file class=hidden>"),$1=w('<div class="flex justify-end">'),L1=w('<div class="flex justify-end"><div class="flex gap-2">'),N1=w('<form class="flex flex-col relative w-full gap-2 rounded-md agent-host-bubble upload"><span class="flex h-5 w-5 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-5 w-5 brightness-150"></span></span><label for=dropzone-file>'),B1=w('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><polyline points="16 16 12 12 8 16"></polyline><line x1=12 y1=12 x2=12 y2=21></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16">'),gx=e=>{let[t,r]=M([]),[n,o]=M(false),[i,a]=M(0),[s,l]=M(false),c=C=>{let k=Array.from(C).map(D=>kl({existingFiles:t(),newFile:D,params:{sizeLimit:e.block.options&&"sizeLimit"in e.block.options?e.block.options.sizeLimit:void 0},onError:({description:U,title:N})=>Fr.create({title:N,description:U})})).filter(pe);if(k.length!==0){if(!e.block.options?.isMultipleAllowed)return d(k[0]);r([...t(),...k]);}},u=async C=>{C.preventDefault(),t().length!==0&&f(t());},d=async C=>{o(true);let k=await ci({apiHost:e.context.apiHost??yt({ignoreChatApiUrl:true}),files:[{file:C,input:{sessionId:e.context.sessionId,blockId:e.block.id,fileName:C.name}}]});if(o(false),k.length&&k[0])return e.onSubmit({type:"text",label:e.block.options?.labels?.success?.single??_r.labels.success.single,value:k[0]?mx(k[0].url):"",attachments:[{type:C.type,url:k[0].url,blobUrl:URL.createObjectURL(C)}]});Fr.create({description:"An error occured while uploading the file"});},f=async C=>{o(true);let k=await ci({apiHost:e.context.apiHost??yt({ignoreChatApiUrl:true}),files:C.map(D=>({file:D,input:{sessionId:e.context.sessionId,blockId:e.block.id,fileName:D.name}})),onUploadProgress:a});if(o(false),a(0),k.length!==C.length)return Fr.create({description:"An error occured while uploading the files"});e.onSubmit({type:"text",label:k.length>1?(e.block.options?.labels?.success?.multiple??_r.labels.success.multiple).replaceAll("{total}",k.length.toString()):e.block.options?.labels?.success?.single??_r.labels.success.single,value:k.filter(pe).map(({url:D})=>mx(D)).join(", "),attachments:k.map((D,U)=>D?{...D,blobUrl:URL.createObjectURL(t()[U])}:null).filter(pe)});},p=C=>{C.preventDefault(),l(true);},g=()=>l(false),h=C=>{C.preventDefault(),C.stopPropagation(),C.dataTransfer?.files&&c(C.dataTransfer.files);},b=()=>r([]),y=()=>e.onSkip(e.block.options?.labels?.skip??_r.labels.skip),S=C=>{r(k=>k.filter((D,U)=>U!==C));};return (()=>{var C=N1(),k=C.firstChild,D=k.nextSibling;return C.addEventListener("submit",u),D.addEventListener("drop",h),D.addEventListener("dragleave",g),D.addEventListener("dragover",p),v(D,m(He,{get children(){return [m(J,{get when(){return n()},get children(){return m(W,{get when(){return t().length>1},get fallback(){return m(ni,{})},get children(){var U=O1(),N=U.firstChild;return N.style.setProperty("transition","width 150ms cubic-bezier(0.4, 0, 0.2, 1)"),$(ie=>(ie=`${i()>0?i:10}%`)!=null?N.style.setProperty("width",ie):N.style.removeProperty("width")),U}})}}),m(J,{get when(){return !n()},get children(){return [(()=>{var U=D1(),N=U.firstChild;return v(U,m(W,{get when(){return t().length},get fallback(){return m(F1,{})},get children(){var ie=R1();return ot(ie,"click",I=>{I.preventDefault(),I.stopPropagation();}),v(ie,m(ke,{get each(){return t()},children:(I,A)=>m(Il,{file:I,onRemoveClick:()=>S(A())})})),ie}}),N),$(()=>N.innerHTML=e.block.options?.labels?.placeholder??_r.labels.placeholder),U})(),(()=>{var U=M1();return U.addEventListener("change",N=>{N.currentTarget.files&&c(N.currentTarget.files);}),$(()=>U.multiple=e.block.options?.isMultipleAllowed??_r.isMultipleAllowed),U})()]}})]}})),v(C,m(W,{get when(){return t().length===0&&e.block.options?.isRequired===false},get children(){var U=$1();return v(U,m(Tr,{"on:click":y,get children(){return e.block.options?.labels?.skip??_r.labels.skip}})),U}}),null),v(C,m(W,{get when(){return B(()=>!!(e.block.options?.isMultipleAllowed&&t().length>0))()&&!n()},get children(){var U=L1(),N=U.firstChild;return v(N,m(W,{get when(){return t().length},get children(){return m(Tr,{variant:"secondary","on:click":b,get children(){return e.block.options?.labels?.clear??_r.labels.clear}})}}),null),v(N,m(Xe,{type:"submit",disableIcon:true,get children(){return B(()=>(e.block.options?.labels?.button??_r.labels.button)===_r.labels.button)()?`Upload ${t().length} file${t().length>1?"s":""}`:e.block.options?.labels?.button}}),null),U}}),null),$(()=>j(D,"agent-upload-input py-6 flex flex-col justify-center items-center w-full bubble-typing cursor-pointer px-8 "+(s()?"dragging-over":""))),C})()},F1=()=>B1(),mx=e=>{let t=e.split("/").pop();if(!t)return e;let r=encodeURIComponent(t);return e.replace(t,r)};var Al={labels:{placeholder:"Type a number..."},isRequired:true};var hx=e=>{let t=n=>{Se(()=>{let o=e();if(o==null){n.value=o;return}let i=n.value;(o===0&&i===""||o!==i)&&(n.value=o+"");});},r=n=>{if(n.validity.badInput)return e();if(n.value!=="")return n.valueAsNumber};return [ct(e),t,r]};var U1=w('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex relative agent-input w-full"><input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"type=number>'),j1=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),bx=e=>{let[t,r]=M(e.defaultValue??""),[n,o,i]=hx(()=>t()),a,s=()=>a?.value!==""&&a?.reportValidity(),l=()=>{let f=e.block.options?.isRequired??Al.isRequired,p=a?.value??t().toString();!f&&!p&&(p="** omited **"),!f||s()?e.onSubmit({type:"text",isRequired:f,value:p}):a?.focus();},c=f=>{f.key==="Enter"&&l();};ce(()=>{!X()&&a&&a.focus({preventScroll:true}),window.addEventListener("message",u);}),me(()=>{window.removeEventListener("message",u);});let u=f=>{let{data:p}=f;p.isFromAgent&&p.command==="setInputValue"&&r(p.value);},d=e.block.options?.isRequired??Al.isRequired;return (()=>{var f=U1(),p=f.firstChild,g=p.firstChild;f.$$keydown=c,g.$$input=b=>{r(i(b.currentTarget));},be(o,g,()=>true);var h=a;return typeof h=="function"?be(h,g):a=g,g.style.setProperty("font-size","16px"),g.style.setProperty("appearance","auto"),g.value=n,v(p,!d&&j1(),null),v(f,m(Xe,{type:"button",class:"h-[56px]","on:click":l,get children(){return e.block.options?.labels?.button}}),null),$(b=>{var y=e.block.options?.labels?.placeholder??Al.labels.placeholder,S=e.block.options?.min,C=e.block.options?.max,k=e.block.options?.step??"any";return y!==b.e&&G(g,"placeholder",b.e=y),S!==b.t&&G(g,"min",b.t=S),C!==b.a&&G(g,"max",b.a=C),k!==b.o&&G(g,"step",b.o=k),b},{e:void 0,t:void 0,a:void 0,o:void 0}),f})()};Ge(["keydown","input"]);var Cx=wo(_x());var Ml={labels:{button:"Pay",success:"Success"}};var Y1=w('<div class="agent-input-error-message mt-4 text-center animate-fade-in">'),K1=w('<form id=payment-form class="flex flex-col p-4 agent-input w-full items-center"><slot name=stripe-payment-form>'),X1="stripe-payment-form",ad,Ba=null,$l=null,Sx=e=>{let[t,r]=M(),[n,o]=M(false),[i,a]=M(false);ce(async()=>{if(Z1(ad),!e.options?.publicKey)return r("Missing Stripe public key");if(Ba=await(0, Cx.loadStripe)(e.options?.publicKey),!Ba)return;$l=Ba.elements({appearance:{theme:"stripe",variables:{colorPrimary:getComputedStyle(ad).getPropertyValue("--agent-button-bg-color")}},clientSecret:e.options.paymentIntentSecret}),$l.create("payment",{layout:"tabs"}).mount("#payment-element"),setTimeout(()=>{o(true),e.onTransitionEnd();},1e3);});let s=async l=>{if(l.preventDefault(),!Ba||!$l)return;a(true),qf({sessionId:e.context.sessionId,resultId:e.context.resultId,agent:e.context.agent});let{postalCode:c,...u}=e.options?.additionalInformation?.address??{},{error:d,paymentIntent:f}=await Ba.confirmPayment({elements:$l,confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:{name:e.options?.additionalInformation?.name,email:e.options?.additionalInformation?.email,phone:e.options?.additionalInformation?.phoneNumber,address:{...u,postal_code:c}}}},redirect:"if_required"});if(ms(),a(false),d?.type!=="validation_error"){if(d?.type==="card_error")return r(d.message);if(!d&&f.status==="succeeded")return e.onSuccess()}};return (()=>{var l=K1(),c=l.firstChild;return l.addEventListener("submit",s),be(u=>ad=u,c),c._$owner=_o(),v(l,m(W,{get when(){return n()},get children(){return m(Xe,{get isLoading(){return i()},class:"mt-4 w-full max-w-lg animate-fade-in",disableIcon:true,get children(){return [B(()=>e.options?.labels?.button??Ml.labels.button)," ",B(()=>e.options?.amountLabel)]}})}}),null),v(l,m(W,{get when(){return t()},get children(){var u=Y1();return v(u,t),u}}),null),l})()},Z1=e=>{let r=e.getRootNode().host,n=document.createElement("div");n.style.width="100%",n.slot=X1,r.appendChild(n);let o=document.createElement("div");o.id="payment-element",n.appendChild(o);};var kx=e=>m(Sx,{get onSuccess(){return e.onSuccess},get options(){return e.options},get context(){return e.context},get onTransitionEnd(){return e.onTransitionEnd}});var Q1=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><polyline points="6 9 12 15 18 9">'),Px=e=>(()=>{var t=Q1();return De(t,e,true,true),t})();var Ll={labels:{placeholder:"Type your phone number..."},isRequired:true};var oo=[{name:"International",flag:"\u{1F310}",code:"INT",dial_code:""},{name:"Afghanistan",flag:"\u{1F1E6}\u{1F1EB}",code:"AF",dial_code:"+93"},{name:"\xC5land Islands",flag:"\u{1F1E6}\u{1F1FD}",code:"AX",dial_code:"+358"},{name:"Albania",flag:"\u{1F1E6}\u{1F1F1}",code:"AL",dial_code:"+355"},{name:"Algeria",flag:"\u{1F1E9}\u{1F1FF}",code:"DZ",dial_code:"+213"},{name:"American Samoa",flag:"\u{1F1E6}\u{1F1F8}",code:"AS",dial_code:"+1684"},{name:"Andorra",flag:"\u{1F1E6}\u{1F1E9}",code:"AD",dial_code:"+376"},{name:"Angola",flag:"\u{1F1E6}\u{1F1F4}",code:"AO",dial_code:"+244"},{name:"Anguilla",flag:"\u{1F1E6}\u{1F1EE}",code:"AI",dial_code:"+1264"},{name:"Antarctica",flag:"\u{1F1E6}\u{1F1F6}",code:"AQ",dial_code:"+672"},{name:"Antigua and Barbuda",flag:"\u{1F1E6}\u{1F1EC}",code:"AG",dial_code:"+1268"},{name:"Argentina",flag:"\u{1F1E6}\u{1F1F7}",code:"AR",dial_code:"+54"},{name:"Armenia",flag:"\u{1F1E6}\u{1F1F2}",code:"AM",dial_code:"+374"},{name:"Aruba",flag:"\u{1F1E6}\u{1F1FC}",code:"AW",dial_code:"+297"},{name:"Australia",flag:"\u{1F1E6}\u{1F1FA}",code:"AU",dial_code:"+61"},{name:"Austria",flag:"\u{1F1E6}\u{1F1F9}",code:"AT",dial_code:"+43"},{name:"Azerbaijan",flag:"\u{1F1E6}\u{1F1FF}",code:"AZ",dial_code:"+994"},{name:"Bahamas",flag:"\u{1F1E7}\u{1F1F8}",code:"BS",dial_code:"+1242"},{name:"Bahrain",flag:"\u{1F1E7}\u{1F1ED}",code:"BH",dial_code:"+973"},{name:"Bangladesh",flag:"\u{1F1E7}\u{1F1E9}",code:"BD",dial_code:"+880"},{name:"Barbados",flag:"\u{1F1E7}\u{1F1E7}",code:"BB",dial_code:"+1246"},{name:"Belarus",flag:"\u{1F1E7}\u{1F1FE}",code:"BY",dial_code:"+375"},{name:"Belgium",flag:"\u{1F1E7}\u{1F1EA}",code:"BE",dial_code:"+32"},{name:"Belize",flag:"\u{1F1E7}\u{1F1FF}",code:"BZ",dial_code:"+501"},{name:"Benin",flag:"\u{1F1E7}\u{1F1EF}",code:"BJ",dial_code:"+229"},{name:"Bermuda",flag:"\u{1F1E7}\u{1F1F2}",code:"BM",dial_code:"+1441"},{name:"Bhutan",flag:"\u{1F1E7}\u{1F1F9}",code:"BT",dial_code:"+975"},{name:"Bolivia, Plurinational State of bolivia",flag:"\u{1F1E7}\u{1F1F4}",code:"BO",dial_code:"+591"},{name:"Bosnia and Herzegovina",flag:"\u{1F1E7}\u{1F1E6}",code:"BA",dial_code:"+387"},{name:"Botswana",flag:"\u{1F1E7}\u{1F1FC}",code:"BW",dial_code:"+267"},{name:"Bouvet Island",flag:"\u{1F1E7}\u{1F1FB}",code:"BV",dial_code:"+47"},{name:"Brazil",flag:"\u{1F1E7}\u{1F1F7}",code:"BR",dial_code:"+55"},{name:"British Indian Ocean Territory",flag:"\u{1F1EE}\u{1F1F4}",code:"IO",dial_code:"+246"},{name:"Brunei Darussalam",flag:"\u{1F1E7}\u{1F1F3}",code:"BN",dial_code:"+673"},{name:"Bulgaria",flag:"\u{1F1E7}\u{1F1EC}",code:"BG",dial_code:"+359"},{name:"Burkina Faso",flag:"\u{1F1E7}\u{1F1EB}",code:"BF",dial_code:"+226"},{name:"Burundi",flag:"\u{1F1E7}\u{1F1EE}",code:"BI",dial_code:"+257"},{name:"Cambodia",flag:"\u{1F1F0}\u{1F1ED}",code:"KH",dial_code:"+855"},{name:"Cameroon",flag:"\u{1F1E8}\u{1F1F2}",code:"CM",dial_code:"+237"},{name:"Canada",flag:"\u{1F1E8}\u{1F1E6}",code:"CA",dial_code:"+1"},{name:"Cape Verde",flag:"\u{1F1E8}\u{1F1FB}",code:"CV",dial_code:"+238"},{name:"Cayman Islands",flag:"\u{1F1F0}\u{1F1FE}",code:"KY",dial_code:"+345"},{name:"Central African Republic",flag:"\u{1F1E8}\u{1F1EB}",code:"CF",dial_code:"+236"},{name:"Chad",flag:"\u{1F1F9}\u{1F1E9}",code:"TD",dial_code:"+235"},{name:"Chile",flag:"\u{1F1E8}\u{1F1F1}",code:"CL",dial_code:"+56"},{name:"China",flag:"\u{1F1E8}\u{1F1F3}",code:"CN",dial_code:"+86"},{name:"Christmas Island",flag:"\u{1F1E8}\u{1F1FD}",code:"CX",dial_code:"+61"},{name:"Cocos (Keeling) Islands",flag:"\u{1F1E8}\u{1F1E8}",code:"CC",dial_code:"+61"},{name:"Colombia",flag:"\u{1F1E8}\u{1F1F4}",code:"CO",dial_code:"+57"},{name:"Comoros",flag:"\u{1F1F0}\u{1F1F2}",code:"KM",dial_code:"+269"},{name:"Congo",flag:"\u{1F1E8}\u{1F1EC}",code:"CG",dial_code:"+242"},{name:"Congo, The Democratic Republic of the Congo",flag:"\u{1F1E8}\u{1F1E9}",code:"CD",dial_code:"+243"},{name:"Cook Islands",flag:"\u{1F1E8}\u{1F1F0}",code:"CK",dial_code:"+682"},{name:"Costa Rica",flag:"\u{1F1E8}\u{1F1F7}",code:"CR",dial_code:"+506"},{name:"Cote d'Ivoire",flag:"\u{1F1E8}\u{1F1EE}",code:"CI",dial_code:"+225"},{name:"Croatia",flag:"\u{1F1ED}\u{1F1F7}",code:"HR",dial_code:"+385"},{name:"Cuba",flag:"\u{1F1E8}\u{1F1FA}",code:"CU",dial_code:"+53"},{name:"Cyprus",flag:"\u{1F1E8}\u{1F1FE}",code:"CY",dial_code:"+357"},{name:"Czech Republic",flag:"\u{1F1E8}\u{1F1FF}",code:"CZ",dial_code:"+420"},{name:"Denmark",flag:"\u{1F1E9}\u{1F1F0}",code:"DK",dial_code:"+45"},{name:"Djibouti",flag:"\u{1F1E9}\u{1F1EF}",code:"DJ",dial_code:"+253"},{name:"Dominica",flag:"\u{1F1E9}\u{1F1F2}",code:"DM",dial_code:"+1767"},{name:"Dominican Republic",flag:"\u{1F1E9}\u{1F1F4}",code:"DO",dial_code:"+1849"},{name:"Dominican Republic",flag:"\u{1F1E9}\u{1F1F4}",code:"DO",dial_code:"+1829"},{name:"Dominican Republic",flag:"\u{1F1E9}\u{1F1F4}",code:"DO",dial_code:"+1809"},{name:"Ecuador",flag:"\u{1F1EA}\u{1F1E8}",code:"EC",dial_code:"+593"},{name:"Egypt",flag:"\u{1F1EA}\u{1F1EC}",code:"EG",dial_code:"+20"},{name:"El Salvador",flag:"\u{1F1F8}\u{1F1FB}",code:"SV",dial_code:"+503"},{name:"Equatorial Guinea",flag:"\u{1F1EC}\u{1F1F6}",code:"GQ",dial_code:"+240"},{name:"Eritrea",flag:"\u{1F1EA}\u{1F1F7}",code:"ER",dial_code:"+291"},{name:"Estonia",flag:"\u{1F1EA}\u{1F1EA}",code:"EE",dial_code:"+372"},{name:"Ethiopia",flag:"\u{1F1EA}\u{1F1F9}",code:"ET",dial_code:"+251"},{name:"Falkland Islands (Malvinas)",flag:"\u{1F1EB}\u{1F1F0}",code:"FK",dial_code:"+500"},{name:"Faroe Islands",flag:"\u{1F1EB}\u{1F1F4}",code:"FO",dial_code:"+298"},{name:"Fiji",flag:"\u{1F1EB}\u{1F1EF}",code:"FJ",dial_code:"+679"},{name:"Finland",flag:"\u{1F1EB}\u{1F1EE}",code:"FI",dial_code:"+358"},{name:"France",flag:"\u{1F1EB}\u{1F1F7}",code:"FR",dial_code:"+33"},{name:"French Guiana",flag:"\u{1F1EC}\u{1F1EB}",code:"GF",dial_code:"+594"},{name:"French Polynesia",flag:"\u{1F1F5}\u{1F1EB}",code:"PF",dial_code:"+689"},{name:"French Southern Territories",flag:"\u{1F1F9}\u{1F1EB}",code:"TF",dial_code:"+262"},{name:"Gabon",flag:"\u{1F1EC}\u{1F1E6}",code:"GA",dial_code:"+241"},{name:"Gambia",flag:"\u{1F1EC}\u{1F1F2}",code:"GM",dial_code:"+220"},{name:"Georgia",flag:"\u{1F1EC}\u{1F1EA}",code:"GE",dial_code:"+995"},{name:"Germany",flag:"\u{1F1E9}\u{1F1EA}",code:"DE",dial_code:"+49"},{name:"Ghana",flag:"\u{1F1EC}\u{1F1ED}",code:"GH",dial_code:"+233"},{name:"Gibraltar",flag:"\u{1F1EC}\u{1F1EE}",code:"GI",dial_code:"+350"},{name:"Greece",flag:"\u{1F1EC}\u{1F1F7}",code:"GR",dial_code:"+30"},{name:"Greenland",flag:"\u{1F1EC}\u{1F1F1}",code:"GL",dial_code:"+299"},{name:"Grenada",flag:"\u{1F1EC}\u{1F1E9}",code:"GD",dial_code:"+1473"},{name:"Guadeloupe",flag:"\u{1F1EC}\u{1F1F5}",code:"GP",dial_code:"+590"},{name:"Guam",flag:"\u{1F1EC}\u{1F1FA}",code:"GU",dial_code:"+1671"},{name:"Guatemala",flag:"\u{1F1EC}\u{1F1F9}",code:"GT",dial_code:"+502"},{name:"Guernsey",flag:"\u{1F1EC}\u{1F1EC}",code:"GG",dial_code:"+44"},{name:"Guinea",flag:"\u{1F1EC}\u{1F1F3}",code:"GN",dial_code:"+224"},{name:"Guinea-Bissau",flag:"\u{1F1EC}\u{1F1FC}",code:"GW",dial_code:"+245"},{name:"Guyana",flag:"\u{1F1EC}\u{1F1FE}",code:"GY",dial_code:"+592"},{name:"Haiti",flag:"\u{1F1ED}\u{1F1F9}",code:"HT",dial_code:"+509"},{name:"Heard Island and Mcdonald Islands",flag:"\u{1F1ED}\u{1F1F2}",code:"HM",dial_code:"+672"},{name:"Holy See (Vatican City State)",flag:"\u{1F1FB}\u{1F1E6}",code:"VA",dial_code:"+379"},{name:"Honduras",flag:"\u{1F1ED}\u{1F1F3}",code:"HN",dial_code:"+504"},{name:"Hong Kong",flag:"\u{1F1ED}\u{1F1F0}",code:"HK",dial_code:"+852"},{name:"Hungary",flag:"\u{1F1ED}\u{1F1FA}",code:"HU",dial_code:"+36"},{name:"Iceland",flag:"\u{1F1EE}\u{1F1F8}",code:"IS",dial_code:"+354"},{name:"India",flag:"\u{1F1EE}\u{1F1F3}",code:"IN",dial_code:"+91"},{name:"Indonesia",flag:"\u{1F1EE}\u{1F1E9}",code:"ID",dial_code:"+62"},{name:"Iran, Islamic Republic of Persian Gulf",flag:"\u{1F1EE}\u{1F1F7}",code:"IR",dial_code:"+98"},{name:"Iraq",flag:"\u{1F1EE}\u{1F1F6}",code:"IQ",dial_code:"+964"},{name:"Ireland",flag:"\u{1F1EE}\u{1F1EA}",code:"IE",dial_code:"+353"},{name:"Isle of Man",flag:"\u{1F1EE}\u{1F1F2}",code:"IM",dial_code:"+44"},{name:"Israel",flag:"\u{1F1EE}\u{1F1F1}",code:"IL",dial_code:"+972"},{name:"Italy",flag:"\u{1F1EE}\u{1F1F9}",code:"IT",dial_code:"+39"},{name:"Jamaica",flag:"\u{1F1EF}\u{1F1F2}",code:"JM",dial_code:"+1876"},{name:"Japan",flag:"\u{1F1EF}\u{1F1F5}",code:"JP",dial_code:"+81"},{name:"Jersey",flag:"\u{1F1EF}\u{1F1EA}",code:"JE",dial_code:"+44"},{name:"Jordan",flag:"\u{1F1EF}\u{1F1F4}",code:"JO",dial_code:"+962"},{name:"Kazakhstan",flag:"\u{1F1F0}\u{1F1FF}",code:"KZ",dial_code:"+7"},{name:"Kenya",flag:"\u{1F1F0}\u{1F1EA}",code:"KE",dial_code:"+254"},{name:"Kiribati",flag:"\u{1F1F0}\u{1F1EE}",code:"KI",dial_code:"+686"},{name:"Korea, Democratic People's Republic of Korea",flag:"\u{1F1F0}\u{1F1F5}",code:"KP",dial_code:"+850"},{name:"Korea, Republic of South Korea",flag:"\u{1F1F0}\u{1F1F7}",code:"KR",dial_code:"+82"},{name:"Kosovo",flag:"\u{1F1FD}\u{1F1F0}",code:"XK",dial_code:"+383"},{name:"Kuwait",flag:"\u{1F1F0}\u{1F1FC}",code:"KW",dial_code:"+965"},{name:"Kyrgyzstan",flag:"\u{1F1F0}\u{1F1EC}",code:"KG",dial_code:"+996"},{name:"Laos",flag:"\u{1F1F1}\u{1F1E6}",code:"LA",dial_code:"+856"},{name:"Latvia",flag:"\u{1F1F1}\u{1F1FB}",code:"LV",dial_code:"+371"},{name:"Lebanon",flag:"\u{1F1F1}\u{1F1E7}",code:"LB",dial_code:"+961"},{name:"Lesotho",flag:"\u{1F1F1}\u{1F1F8}",code:"LS",dial_code:"+266"},{name:"Liberia",flag:"\u{1F1F1}\u{1F1F7}",code:"LR",dial_code:"+231"},{name:"Libyan Arab Jamahiriya",flag:"\u{1F1F1}\u{1F1FE}",code:"LY",dial_code:"+218"},{name:"Liechtenstein",flag:"\u{1F1F1}\u{1F1EE}",code:"LI",dial_code:"+423"},{name:"Lithuania",flag:"\u{1F1F1}\u{1F1F9}",code:"LT",dial_code:"+370"},{name:"Luxembourg",flag:"\u{1F1F1}\u{1F1FA}",code:"LU",dial_code:"+352"},{name:"Macao",flag:"\u{1F1F2}\u{1F1F4}",code:"MO",dial_code:"+853"},{name:"Macedonia",flag:"\u{1F1F2}\u{1F1F0}",code:"MK",dial_code:"+389"},{name:"Madagascar",flag:"\u{1F1F2}\u{1F1EC}",code:"MG",dial_code:"+261"},{name:"Malawi",flag:"\u{1F1F2}\u{1F1FC}",code:"MW",dial_code:"+265"},{name:"Malaysia",flag:"\u{1F1F2}\u{1F1FE}",code:"MY",dial_code:"+60"},{name:"Maldives",flag:"\u{1F1F2}\u{1F1FB}",code:"MV",dial_code:"+960"},{name:"Mali",flag:"\u{1F1F2}\u{1F1F1}",code:"ML",dial_code:"+223"},{name:"Malta",flag:"\u{1F1F2}\u{1F1F9}",code:"MT",dial_code:"+356"},{name:"Marshall Islands",flag:"\u{1F1F2}\u{1F1ED}",code:"MH",dial_code:"+692"},{name:"Martinique",flag:"\u{1F1F2}\u{1F1F6}",code:"MQ",dial_code:"+596"},{name:"Mauritania",flag:"\u{1F1F2}\u{1F1F7}",code:"MR",dial_code:"+222"},{name:"Mauritius",flag:"\u{1F1F2}\u{1F1FA}",code:"MU",dial_code:"+230"},{name:"Mayotte",flag:"\u{1F1FE}\u{1F1F9}",code:"YT",dial_code:"+262"},{name:"Mexico",flag:"\u{1F1F2}\u{1F1FD}",code:"MX",dial_code:"+52"},{name:"Micronesia, Federated States of Micronesia",flag:"\u{1F1EB}\u{1F1F2}",code:"FM",dial_code:"+691"},{name:"Moldova",flag:"\u{1F1F2}\u{1F1E9}",code:"MD",dial_code:"+373"},{name:"Monaco",flag:"\u{1F1F2}\u{1F1E8}",code:"MC",dial_code:"+377"},{name:"Mongolia",flag:"\u{1F1F2}\u{1F1F3}",code:"MN",dial_code:"+976"},{name:"Montenegro",flag:"\u{1F1F2}\u{1F1EA}",code:"ME",dial_code:"+382"},{name:"Montserrat",flag:"\u{1F1F2}\u{1F1F8}",code:"MS",dial_code:"+1664"},{name:"Morocco",flag:"\u{1F1F2}\u{1F1E6}",code:"MA",dial_code:"+212"},{name:"Mozambique",flag:"\u{1F1F2}\u{1F1FF}",code:"MZ",dial_code:"+258"},{name:"Myanmar",flag:"\u{1F1F2}\u{1F1F2}",code:"MM",dial_code:"+95"},{name:"Namibia",flag:"\u{1F1F3}\u{1F1E6}",code:"NA",dial_code:"+264"},{name:"Nauru",flag:"\u{1F1F3}\u{1F1F7}",code:"NR",dial_code:"+674"},{name:"Nepal",flag:"\u{1F1F3}\u{1F1F5}",code:"NP",dial_code:"+977"},{name:"Netherlands",flag:"\u{1F1F3}\u{1F1F1}",code:"NL",dial_code:"+31"},{name:"Netherlands Antilles",flag:"",code:"AN",dial_code:"+599"},{name:"New Caledonia",flag:"\u{1F1F3}\u{1F1E8}",code:"NC",dial_code:"+687"},{name:"New Zealand",flag:"\u{1F1F3}\u{1F1FF}",code:"NZ",dial_code:"+64"},{name:"Nicaragua",flag:"\u{1F1F3}\u{1F1EE}",code:"NI",dial_code:"+505"},{name:"Niger",flag:"\u{1F1F3}\u{1F1EA}",code:"NE",dial_code:"+227"},{name:"Nigeria",flag:"\u{1F1F3}\u{1F1EC}",code:"NG",dial_code:"+234"},{name:"Niue",flag:"\u{1F1F3}\u{1F1FA}",code:"NU",dial_code:"+683"},{name:"Norfolk Island",flag:"\u{1F1F3}\u{1F1EB}",code:"NF",dial_code:"+672"},{name:"Northern Mariana Islands",flag:"\u{1F1F2}\u{1F1F5}",code:"MP",dial_code:"+1670"},{name:"Norway",flag:"\u{1F1F3}\u{1F1F4}",code:"NO",dial_code:"+47"},{name:"Oman",flag:"\u{1F1F4}\u{1F1F2}",code:"OM",dial_code:"+968"},{name:"Pakistan",flag:"\u{1F1F5}\u{1F1F0}",code:"PK",dial_code:"+92"},{name:"Palau",flag:"\u{1F1F5}\u{1F1FC}",code:"PW",dial_code:"+680"},{name:"Palestinian Territory, Occupied",flag:"\u{1F1F5}\u{1F1F8}",code:"PS",dial_code:"+970"},{name:"Panama",flag:"\u{1F1F5}\u{1F1E6}",code:"PA",dial_code:"+507"},{name:"Papua New Guinea",flag:"\u{1F1F5}\u{1F1EC}",code:"PG",dial_code:"+675"},{name:"Paraguay",flag:"\u{1F1F5}\u{1F1FE}",code:"PY",dial_code:"+595"},{name:"Peru",flag:"\u{1F1F5}\u{1F1EA}",code:"PE",dial_code:"+51"},{name:"Philippines",flag:"\u{1F1F5}\u{1F1ED}",code:"PH",dial_code:"+63"},{name:"Pitcairn",flag:"\u{1F1F5}\u{1F1F3}",code:"PN",dial_code:"+64"},{name:"Poland",flag:"\u{1F1F5}\u{1F1F1}",code:"PL",dial_code:"+48"},{name:"Portugal",flag:"\u{1F1F5}\u{1F1F9}",code:"PT",dial_code:"+351"},{name:"Puerto Rico",flag:"\u{1F1F5}\u{1F1F7}",code:"PR",dial_code:"+1939"},{name:"Qatar",flag:"\u{1F1F6}\u{1F1E6}",code:"QA",dial_code:"+974"},{name:"Romania",flag:"\u{1F1F7}\u{1F1F4}",code:"RO",dial_code:"+40"},{name:"Russia",flag:"\u{1F1F7}\u{1F1FA}",code:"RU",dial_code:"+7"},{name:"Rwanda",flag:"\u{1F1F7}\u{1F1FC}",code:"RW",dial_code:"+250"},{name:"Reunion",flag:"\u{1F1F7}\u{1F1EA}",code:"RE",dial_code:"+262"},{name:"Saint Barthelemy",flag:"\u{1F1E7}\u{1F1F1}",code:"BL",dial_code:"+590"},{name:"Saint Helena, Ascension and Tristan Da Cunha",flag:"\u{1F1F8}\u{1F1ED}",code:"SH",dial_code:"+290"},{name:"Saint Kitts and Nevis",flag:"\u{1F1F0}\u{1F1F3}",code:"KN",dial_code:"+1869"},{name:"Saint Lucia",flag:"\u{1F1F1}\u{1F1E8}",code:"LC",dial_code:"+1758"},{name:"Saint Martin",flag:"\u{1F1F2}\u{1F1EB}",code:"MF",dial_code:"+590"},{name:"Saint Pierre and Miquelon",flag:"\u{1F1F5}\u{1F1F2}",code:"PM",dial_code:"+508"},{name:"Saint Vincent and the Grenadines",flag:"\u{1F1FB}\u{1F1E8}",code:"VC",dial_code:"+1784"},{name:"Samoa",flag:"\u{1F1FC}\u{1F1F8}",code:"WS",dial_code:"+685"},{name:"San Marino",flag:"\u{1F1F8}\u{1F1F2}",code:"SM",dial_code:"+378"},{name:"Sao Tome and Principe",flag:"\u{1F1F8}\u{1F1F9}",code:"ST",dial_code:"+239"},{name:"Saudi Arabia",flag:"\u{1F1F8}\u{1F1E6}",code:"SA",dial_code:"+966"},{name:"Senegal",flag:"\u{1F1F8}\u{1F1F3}",code:"SN",dial_code:"+221"},{name:"Serbia",flag:"\u{1F1F7}\u{1F1F8}",code:"RS",dial_code:"+381"},{name:"Seychelles",flag:"\u{1F1F8}\u{1F1E8}",code:"SC",dial_code:"+248"},{name:"Sierra Leone",flag:"\u{1F1F8}\u{1F1F1}",code:"SL",dial_code:"+232"},{name:"Singapore",flag:"\u{1F1F8}\u{1F1EC}",code:"SG",dial_code:"+65"},{name:"Slovakia",flag:"\u{1F1F8}\u{1F1F0}",code:"SK",dial_code:"+421"},{name:"Slovenia",flag:"\u{1F1F8}\u{1F1EE}",code:"SI",dial_code:"+386"},{name:"Solomon Islands",flag:"\u{1F1F8}\u{1F1E7}",code:"SB",dial_code:"+677"},{name:"Somalia",flag:"\u{1F1F8}\u{1F1F4}",code:"SO",dial_code:"+252"},{name:"South Africa",flag:"\u{1F1FF}\u{1F1E6}",code:"ZA",dial_code:"+27"},{name:"South Sudan",flag:"\u{1F1F8}\u{1F1F8}",code:"SS",dial_code:"+211"},{name:"South Georgia and the South Sandwich Islands",flag:"\u{1F1EC}\u{1F1F8}",code:"GS",dial_code:"+500"},{name:"Spain",flag:"\u{1F1EA}\u{1F1F8}",code:"ES",dial_code:"+34"},{name:"Sri Lanka",flag:"\u{1F1F1}\u{1F1F0}",code:"LK",dial_code:"+94"},{name:"Sudan",flag:"\u{1F1F8}\u{1F1E9}",code:"SD",dial_code:"+249"},{name:"Suriname",flag:"\u{1F1F8}\u{1F1F7}",code:"SR",dial_code:"+597"},{name:"Svalbard and Jan Mayen",flag:"\u{1F1F8}\u{1F1EF}",code:"SJ",dial_code:"+47"},{name:"Swaziland",flag:"\u{1F1F8}\u{1F1FF}",code:"SZ",dial_code:"+268"},{name:"Sweden",flag:"\u{1F1F8}\u{1F1EA}",code:"SE",dial_code:"+46"},{name:"Switzerland",flag:"\u{1F1E8}\u{1F1ED}",code:"CH",dial_code:"+41"},{name:"Syrian Arab Republic",flag:"\u{1F1F8}\u{1F1FE}",code:"SY",dial_code:"+963"},{name:"Taiwan",flag:"\u{1F1F9}\u{1F1FC}",code:"TW",dial_code:"+886"},{name:"Tajikistan",flag:"\u{1F1F9}\u{1F1EF}",code:"TJ",dial_code:"+992"},{name:"Tanzania, United Republic of Tanzania",flag:"\u{1F1F9}\u{1F1FF}",code:"TZ",dial_code:"+255"},{name:"Thailand",flag:"\u{1F1F9}\u{1F1ED}",code:"TH",dial_code:"+66"},{name:"Timor-Leste",flag:"\u{1F1F9}\u{1F1F1}",code:"TL",dial_code:"+670"},{name:"Togo",flag:"\u{1F1F9}\u{1F1EC}",code:"TG",dial_code:"+228"},{name:"Tokelau",flag:"\u{1F1F9}\u{1F1F0}",code:"TK",dial_code:"+690"},{name:"Tonga",flag:"\u{1F1F9}\u{1F1F4}",code:"TO",dial_code:"+676"},{name:"Trinidad and Tobago",flag:"\u{1F1F9}\u{1F1F9}",code:"TT",dial_code:"+1868"},{name:"Tunisia",flag:"\u{1F1F9}\u{1F1F3}",code:"TN",dial_code:"+216"},{name:"Turkey",flag:"\u{1F1F9}\u{1F1F7}",code:"TR",dial_code:"+90"},{name:"Turkmenistan",flag:"\u{1F1F9}\u{1F1F2}",code:"TM",dial_code:"+993"},{name:"Turks and Caicos Islands",flag:"\u{1F1F9}\u{1F1E8}",code:"TC",dial_code:"+1649"},{name:"Tuvalu",flag:"\u{1F1F9}\u{1F1FB}",code:"TV",dial_code:"+688"},{name:"Uganda",flag:"\u{1F1FA}\u{1F1EC}",code:"UG",dial_code:"+256"},{name:"Ukraine",flag:"\u{1F1FA}\u{1F1E6}",code:"UA",dial_code:"+380"},{name:"United Arab Emirates",flag:"\u{1F1E6}\u{1F1EA}",code:"AE",dial_code:"+971"},{name:"United Kingdom",flag:"\u{1F1EC}\u{1F1E7}",code:"GB",dial_code:"+44"},{name:"United States",flag:"\u{1F1FA}\u{1F1F8}",code:"US",dial_code:"+1"},{name:"Uruguay",flag:"\u{1F1FA}\u{1F1FE}",code:"UY",dial_code:"+598"},{name:"Uzbekistan",flag:"\u{1F1FA}\u{1F1FF}",code:"UZ",dial_code:"+998"},{name:"Vanuatu",flag:"\u{1F1FB}\u{1F1FA}",code:"VU",dial_code:"+678"},{name:"Venezuela, Bolivarian Republic of Venezuela",flag:"\u{1F1FB}\u{1F1EA}",code:"VE",dial_code:"+58"},{name:"Vietnam",flag:"\u{1F1FB}\u{1F1F3}",code:"VN",dial_code:"+84"},{name:"Virgin Islands, British",flag:"\u{1F1FB}\u{1F1EC}",code:"VG",dial_code:"+1284"},{name:"Virgin Islands, U.S.",flag:"\u{1F1FB}\u{1F1EE}",code:"VI",dial_code:"+1340"},{name:"Wallis and Futuna",flag:"\u{1F1FC}\u{1F1EB}",code:"WF",dial_code:"+681"},{name:"Yemen",flag:"\u{1F1FE}\u{1F1EA}",code:"YE",dial_code:"+967"},{name:"Zambia",flag:"\u{1F1FF}\u{1F1F2}",code:"ZM",dial_code:"+260"},{name:"Zimbabwe",flag:"\u{1F1FF}\u{1F1FC}",code:"ZW",dial_code:"+263"}];var J1=w('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex relative agent-input w-full"><div class="relative agent-country-select flex justify-center items-center"><div class="pl-2 pr-1 flex items-center gap-2"><span></span></div><select class="absolute top-0 left-0 w-full h-full cursor-pointer opacity-0">'),eA=w("<option> "),tA=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),Ex=e=>{let[t,r]=M(tt(e.defaultCountryCode)?"INT":e.defaultCountryCode),[n,o]=M(e.defaultValue??""),i,a=p=>{o(p),(p===""||p==="+")&&t()!=="INT"&&r("INT");let g=p?.startsWith("+")&&p.length>2&&oo.reduce((h,b)=>!b?.dial_code||h!==null&&!h.dial_code?h:p?.startsWith(b.dial_code)&&b.dial_code.length>(h?.dial_code.length??0)?b:h,null);g&&r(g.code);},s=()=>i?.value!==""&&i?.reportValidity(),l=()=>{let p=oo.find(b=>b.code===t())?.dial_code,g=e?.isRequired??Ll.isRequired,h=i?.value??n();!g&&!h?h="** omited **":!h.startsWith("+")&&p&&(h=`${p??""}${h}`),!g||s()?e.onSubmit({type:"text",value:h,isRequired:g}):i?.focus();},c=p=>{p.key==="Enter"&&l();},u=p=>{let g=oo.find(b=>b.code===p.currentTarget.value);if(!g)return;let h=oo.find(b=>b.code===t());(n()===""||h&&n()===h.dial_code)&&o(g.dial_code),r(g.code),i?.focus();};ce(()=>{!X()&&i&&i.focus({preventScroll:true}),window.addEventListener("message",d);}),me(()=>{window.removeEventListener("message",d);});let d=p=>{let{data:g}=p;g.isFromAgent&&g.command==="setInputValue"&&o(g.value);},f=e?.isRequired??Ll.isRequired;return (()=>{var p=J1(),g=p.firstChild,h=g.firstChild,b=h.firstChild,y=b.firstChild,S=b.nextSibling;return p.$$keydown=c,v(y,()=>oo.find(C=>t()===C.code)?.flag),v(b,m(Px,{class:"w-3"}),null),S.addEventListener("change",u),v(S,m(ke,{each:oo,children:C=>(()=>{var k=eA(),D=k.firstChild;return v(k,()=>C.name,D),v(k,()=>C.dial_code?`(${C.dial_code})`:"",null),$(()=>k.selected=C.code===t()),$(()=>k.value=C.code),k})()})),v(g,m(dr,{type:"tel",ref(C){var k=i;typeof k=="function"?k(C):i=C;},get value(){return n()},onInput:a,get placeholder(){return e.labels?.placeholder??Ll.labels.placeholder},get autofocus(){return !X()}}),null),v(g,!f&&tA(),null),v(p,m(Xe,{type:"button",class:"h-[56px]","on:click":l,get children(){return e.labels?.button}}),null),p})()};Ge(["keydown"]);var Fa={buttonLabel:it,searchInputPlaceholder:"Filter the options...",showTitle:true};var rA=w('<div class="flex items-end agent-input w-full">'),nA=w('<form class="flex flex-col gap-2 w-full items-end"><div>'),Ix=w("<span class=font-semibold>"),Ax=w('<span class="text-sm whitespace-pre-wrap text-left">'),Ox=w('<div class="flex flex-col gap-1 ">'),oA=w("<div role=checkbox><img fetchpriority=high class=m-auto><div>"),iA=w('<div role=checkbox aria-checked class="flex flex-col focus:outline-none cursor-pointer select-none agent-selectable-picture selected"><img fetchpriority=high><div>'),Rx=e=>{let t,[r,n]=M(e.defaultItems),[o,i]=M([]),[a,s]=M(0);ce(()=>{!X()&&t&&t.focus({preventScroll:true});});let l=p=>{c(p);},c=p=>{let g=o().indexOf(p);i(g!==-1?h=>h.filter(b=>b!==p):h=>[...h,p]);},u=()=>e.onSubmit({type:"text",value:o().map(p=>{let g=e.defaultItems.find(h=>h.id===p);return Ne(g?.title)?g.title:g?.pictureSrc}).join(", "),imgSrc:o().map(p=>e.defaultItems.find(h=>h.id===p)?.pictureSrc).filter(pe).join(",")}),d=p=>{n(e.defaultItems.filter(g=>g.title?.toLowerCase().includes((p??"").toLowerCase())||g.description?.toLowerCase().includes((p??"").toLowerCase())));};Se(()=>{a()===e.defaultItems.filter(p=>pe(p.pictureSrc)).length&&e.onTransitionEnd();});let f=()=>{s(p=>p+1);};return (()=>{var p=nA(),g=p.firstChild;return p.addEventListener("submit",u),v(p,m(W,{get when(){return e.options?.isSearchable},get children(){var h=rA();return v(h,m(Cn,{ref(b){var y=t;typeof y=="function"?y(b):t=b;},onInput:d,get placeholder(){return e.options?.searchInputPlaceholder??Fa.searchInputPlaceholder},onClear:()=>n(e.defaultItems)})),h}}),g),v(g,m(ke,{get each(){return r()},children:(h,b)=>(()=>{var y=oA(),S=y.firstChild,C=S.nextSibling;return ot(y,"click",()=>l(h.id)),S.addEventListener("load",f),v(C,m(oi,{get isChecked(){return o().some(k=>k===h.id)},get class(){return "flex-shrink-0"+(h.title||h.description?" mt-1":void 0)}}),null),v(C,m(W,{get when(){return (h.title||h.description)&&e.options?.showTitle},get children(){var k=Ox();return v(k,m(W,{get when(){return h.title},get children(){var D=Ix();return v(D,()=>h.title),D}}),null),v(k,m(W,{get when(){return h.description},get children(){var D=Ax();return v(D,()=>h.description),D}}),null),k}}),null),$(k=>{var D=o().some(E=>E===h.id),U="flex flex-col focus:outline-none cursor-pointer select-none agent-selectable-picture"+(o().some(E=>E===h.id)?" selected":"")+(pr(h.pictureSrc)?" has-svg":""),N=h.id,ie=h.pictureSrc,I=h.title??`Picture ${b()+1}`,A=`Picture choice ${b()+1}`,R="flex gap-3 py-2 flex-shrink-0"+(tt(h.title)&&tt(h.description)||!e.options?.showTitle?" justify-center":" px-3");return D!==k.e&&G(y,"aria-checked",k.e=D),U!==k.t&&j(y,k.t=U),N!==k.a&&G(y,"data-itemid",k.a=N),ie!==k.o&&G(S,"src",k.o=ie),I!==k.i&&G(S,"alt",k.i=I),A!==k.n&&G(S,"elementtiming",k.n=A),R!==k.s&&j(C,k.s=R),k},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),y})()}),null),v(g,m(ke,{get each(){return o().filter(h=>r().every(b=>b.id!==h)).map(h=>e.defaultItems.find(b=>b.id===h)).filter(pe)},children:(h,b)=>(()=>{var y=iA(),S=y.firstChild,C=S.nextSibling;return ot(y,"click",()=>l(h.id)),v(C,m(oi,{get isChecked(){return o().some(k=>k===h.id)},get class(){return "flex-shrink-0"+(h.title||h.description?" mt-1":void 0)}}),null),v(C,m(W,{get when(){return h.title||h.description},get children(){var k=Ox();return v(k,m(W,{get when(){return h.title},get children(){var D=Ix();return v(D,()=>h.title),D}}),null),v(k,m(W,{get when(){return h.description},get children(){var D=Ax();return v(D,()=>h.description),D}}),null),k}}),null),$(k=>{var D=h.id,U=e.defaultItems.find(A=>A.id===h.id)?.pictureSrc,N=h.title??`Selected picture ${b()+1}`,ie=`Selected picture choice ${b()+1}`,I="flex gap-3 py-2 flex-shrink-0"+(tt(h.title)&&tt(h.description)?" justify-center":" pl-4");return D!==k.e&&G(y,"data-itemid",k.e=D),U!==k.t&&G(S,"src",k.t=U),N!==k.a&&G(S,"alt",k.a=N),ie!==k.o&&G(S,"elementtiming",k.o=ie),I!==k.i&&j(C,k.i=I),k},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),y})()}),null),v(p,(()=>{var h=B(()=>o().length>0);return ()=>h()&&m(Xe,{disableIcon:true,get children(){return e.options?.buttonLabel??Fa.buttonLabel}})})(),null),$(()=>j(g,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-[464px] rounded-md":""))),p})()};var aA=w('<div class="flex items-end agent-input w-full">'),sA=w('<div class="flex flex-col gap-2 w-full"><div>'),lA=w("<button><img fetchpriority=high class=m-auto>"),cA=w("<div>"),uA=w("<span>"),dA=w('<span class="text-sm mt-1 whitespace-pre-wrap text-left">'),Dx=e=>{let t,[r,n]=M(e.defaultItems),[o,i]=M(0);ce(()=>{!X()&&t&&t.focus({preventScroll:true});});let a=c=>{let u=r()[c];if(u)return e.onSubmit({type:"text",label:Ne(u.title)?u.title:u.pictureSrc??u.id,value:u.id,imgSrc:u.pictureSrc})},s=c=>{n(e.defaultItems.filter(u=>u.title?.toLowerCase().includes((c??"").toLowerCase())||u.description?.toLowerCase().includes((c??"").toLowerCase())));};Se(()=>{o()===e.defaultItems.filter(c=>pe(c.pictureSrc)).length&&e.onTransitionEnd();});let l=()=>{i(c=>c+1);};return (()=>{var c=sA(),u=c.firstChild;return v(c,m(W,{get when(){return e.options?.isSearchable},get children(){var d=aA();return v(d,m(Cn,{ref(f){var p=t;typeof p=="function"?p(f):t=f;},onInput:s,get placeholder(){return e.options?.searchInputPlaceholder??""},onClear:()=>n(e.defaultItems)})),d}}),u),v(u,m(ke,{get each(){return r()},children:(d,f)=>(()=>{var p=lA(),g=p.firstChild;return ot(p,"click",()=>a(f())),g.addEventListener("load",l),v(p,(()=>{var h=B(()=>!!((e.options?.showTitle??Fa.showTitle)&&d.title&&d.title?.length>0||d.description&&d.description?.length>0));return ()=>h()&&(()=>{var b=cA();return v(b,(()=>{var y=B(()=>!!(d.title&&d.title?.length>0));return ()=>y()&&(()=>{var S=uA();return v(S,()=>d.title),S})()})(),null),v(b,(()=>{var y=B(()=>!!(d.description&&d.description?.length>0));return ()=>y()&&(()=>{var S=dA();return v(S,()=>d.description),S})()})(),null),$(()=>j(b,"flex flex-col gap-1 py-2 flex-shrink-0 px-4 w-full"+(d.description?" items-start":""))),b})()})(),null),$(h=>{var b=d.id,y="flex flex-col agent-picture-button focus:outline-none filter hover:brightness-90 active:brightness-75 justify-between "+(pr(d.pictureSrc)?"has-svg":""),S=d.pictureSrc,C=d.title??`Picture ${f()+1}`,k=`Picture choice ${f()+1}`;return b!==h.e&&G(p,"data-itemid",h.e=b),y!==h.t&&j(p,h.t=y),S!==h.a&&G(g,"src",h.a=S),C!==h.o&&G(g,"alt",h.o=C),k!==h.i&&G(g,"elementtiming",h.i=k),h},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),p})()})),$(()=>j(u,"gap-2 flex flex-wrap justify-end"+(e.options?.isSearchable?" overflow-y-scroll max-h-[464px] rounded-md":""))),c})()};var rn={buttonType:"Numbers",length:10,labels:{button:it},startsAt:0};var fA=w('<form class="flex flex-col gap-2"><div class="flex flex-wrap justify-center gap-2"></div><div class="flex justify-end">'),pA=w('<span class="text-sm w-full rating-label">'),mA=w('<span class="text-sm w-full text-right pr-2 rating-label">'),gA=w("<div role=checkbox>"),hA=w("<div>"),Mx=e=>{let[t,r]=M(e.defaultValue?Number(e.defaultValue):void 0),n=i=>{i.preventDefault();let a=t();ut(a)||e.onSubmit({type:"text",value:a.toString()});},o=i=>{e.block.options?.isOneClickSubmitEnabled&&e.onSubmit({type:"text",value:i.toString()}),r(i);};return (()=>{var i=fA(),a=i.firstChild,s=a.nextSibling;return i.addEventListener("submit",n),v(i,(()=>{var l=B(()=>!!e.block.options?.labels?.left);return ()=>l()&&(()=>{var c=pA();return v(c,()=>e.block.options.labels.left),c})()})(),a),v(a,m(ke,{get each(){return Array.from(Array((e.block.options?.length??rn.length)+((e.block.options?.buttonType??rn.buttonType)==="Numbers"?-((e.block.options?.startsAt??rn.startsAt)-1):0)))},children:(l,c)=>m(bA,Re(()=>e.block.options,{get rating(){return t()},get idx(){return c()+((e.block.options?.buttonType??rn.buttonType)==="Numbers"?e.block.options?.startsAt??rn.startsAt:1)},onClick:o}))})),v(i,(()=>{var l=B(()=>!!e.block.options?.labels?.right);return ()=>l()&&(()=>{var c=mA();return v(c,()=>e.block.options.labels.right),c})()})(),s),v(s,(()=>{var l=B(()=>!!pe(t()));return ()=>l()&&m(Xe,{disableIcon:true,get children(){return e.block.options?.labels?.button??rn.labels.button}})})()),i})()},bA=e=>{let t=r=>{r.preventDefault(),e.onClick(e.idx);};return m(He,{get children(){return [m(J,{get when(){return (e.buttonType??rn.buttonType)==="Numbers"},get children(){return [m(W,{get when(){return e.isOneClickSubmitEnabled},get children(){return m(Tr,{"on:click":t,get children(){return e.idx}})}}),m(W,{get when(){return !e.isOneClickSubmitEnabled},get children(){var r=gA();return ot(r,"click",t),v(r,()=>e.idx),$(n=>{var o=pe(e.rating)&&e.idx<=e.rating,i="py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none agent-selectable"+(pe(e.rating)&&e.idx<=e.rating?" selected":"");return o!==n.e&&G(r,"aria-checked",n.e=o),i!==n.t&&j(r,n.t=i),n},{e:void 0,t:void 0}),r}})]}}),m(J,{get when(){return (e.buttonType??rn.buttonType)!=="Numbers"},get children(){var r=hA();return ot(r,"click",()=>e.onClick(e.idx)),$(n=>{var o="flex justify-center items-center rating-icon-container cursor-pointer "+(pe(e.rating)&&e.idx<=e.rating?"selected":""),i=e.customIcon?.isEnabled&&!tt(e.customIcon.svg)?e.customIcon.svg:yA;return o!==n.e&&j(r,n.e=o),i!==n.t&&(r.innerHTML=n.t=i),n},{e:void 0,t:void 0}),r}})]}})},yA='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>';var vA=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48">'),sd=e=>(()=>{var t=vA();return De(t,e,true,true),t})();var xA=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><circle cx=10 cy=12 r=2></circle><path d="m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22">'),$x=e=>(()=>{var t=xA();return De(t,e,true,true),t})();var wA=w("<input type=file id=document-upload multiple class=hidden>"),TA=w('<input type=file id=photos-upload accept="image/*, video/*"multiple class=hidden>'),_A=w('<label aria-label="Add attachments"for=document-upload>'),CA=w("<label> Document"),SA=w("<label> Photos & videos"),Lx=e=>[(()=>{var t=wA();return t.addEventListener("change",r=>{r.currentTarget.files&&e.onNewFiles(r.currentTarget.files);}),t})(),(()=>{var t=TA();return t.addEventListener("change",r=>{r.currentTarget.files&&e.onNewFiles(r.currentTarget.files);}),t})(),m(He,{get children(){return [m(J,{get when(){return X()},get children(){var t=_A();return v(t,m(sd,{class:"w-5"})),$(()=>j(t,xe("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class))),t}}),m(J,{when:true,get children(){return m(Qr.Root,{get children(){return [m(Qr.Trigger,{get class(){return xe("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class)},"aria-label":"Add attachments",get children(){return m(sd,{class:"w-5"})}}),m(Qr.Positioner,{get children(){return m(Qr.Content,{class:"p-3 gap-2 focus:outline-none",get children(){return [m(Qr.Item,{value:"document",asChild:t=>(()=>{var r=CA(),n=r.firstChild;return De(r,Re(t,{for:"document-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),false,true),v(r,m(Pl,{class:"w-4"}),n),r})()}),m(Qr.Item,{value:"photos",asChild:t=>(()=>{var r=SA(),n=r.firstChild;return De(r,Re(t,{for:"photos-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),false,true),v(r,m($x,{class:"w-4"}),n),r})()})]}})}})]}})}})]}})];var kA=w('<svg viewBox="0 0 384 512"stroke=currentColor fill=currentColor><path d="M192 0C139 0 96 43 96 96l0 160c0 53 43 96 96 96s96-43 96-96l0-160c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c85.8-11.7 152-85.3 152-174.4l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40z">'),Nx=e=>(()=>{var t=kA();return De(t,e,true,true),t})();var PA=w('<textarea class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"rows=6 data-testid=textarea required>'),Bx=e=>{let[t,r]=rt(e,["ref","onInput"]);return (()=>{var n=PA();n.$$input=i=>t.onInput(i.currentTarget.value);var o=t.ref;return typeof o=="function"?be(o,n):t.ref=n,De(n,Re({get autofocus(){return !X()}},r),false,false),n})()};Ge(["input"]);var _w=wo(xw());var fi={isRequired:true,labels:{placeholder:"Type your answer..."},attachments:{isEnabled:false}};var ww=`
52
+ (max 10MB)`,button:"Upload",clear:"Clear",skip:"Skip",success:{single:"File uploaded",multiple:"{total} files uploaded"}}};var Xs=({newFile:e,existingFiles:t,params:r,onError:n})=>{let o=r.sizeLimit??Lr("NEXT_PUBLIC_AGENT_FILE_UPLOAD_MAX_SIZE");if(o&&e.size>o*1024*1024){n({title:"File too large",description:`${e.name} is larger than ${o}MB`});return}if(t.length===0)return e;let i=e.name,a=1;for(;t.some(s=>s.name===i);){let s=e.name.lastIndexOf("."),l=s!==-1?e.name.slice(s):"";i=`${e.name.slice(0,s)}(${a})${l}`,a++;}return new File([e],i,{type:e.type})};var Xo=async({apiHost:e,files:t,onUploadProgress:r})=>{let n=[],o=0;for(let{input:i,file:a}of t){r&&r({progress:o/t.length*100,fileIndex:o}),o+=1;let{data:s}=await yp({method:"POST",url:`${e}/api/v3/generate-upload-url`,body:{fileName:i.fileName,sessionId:i.sessionId,fileType:a.type,blockId:i.blockId}});if(s?.presignedUrl){console.log("iniciando puuuttt",a),console.log(s.presignedUrl);let l=new FormData;if(Object.entries(s.formData).forEach(([c,d])=>{l.append(c,d);}),l.append("file",a),!(await fetch(s.presignedUrl,{method:"PUT",body:a,headers:{"Content-Type":a.type}})).ok)continue;n.push({url:s.fileUrl,type:a.type});}else continue}return n};var n1=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4">'),Zs=e=>(()=>{var t=n1();return Pe(t,e,true,true),t})();var o1=w('<div class="flex items-center gap-4 border bg-white border-gray-200 rounded-md p-2 text-gray-900 min-w-[250px]"><div></div><div class="flex flex-col"><span class="text-md font-semibold text-sm"></span><span class="text-gray-500 text-xs">'),Qs=e=>{let t=a1(e.file);return (()=>{var r=o1(),n=r.firstChild,o=n.nextSibling,i=o.firstChild,a=i.nextSibling;return x(n,m(Zs,{class:"w-6 h-6"})),x(i,()=>e.file.name),x(a,()=>i1(e.file)),M(()=>U(n,ye("rounded-md text-white p-2 flex items-center",t==="pink"&&"bg-pink-400",t==="blue"&&"bg-blue-400",t==="green"&&"bg-green-400",t==="gray"&&"bg-gray-400",t==="orange"&&"bg-orange-400"))),r})()},i1=e=>{switch(e.name.split(".").pop()){case "pdf":return "PDF";case "doc":case "docx":return "Word";case "xls":case "xlsx":case "csv":return "Sheet";case "json":return "JSON";case "md":return "Markdown";default:return "DOCUMENT"}},a1=e=>{let t=e.name.split(".").pop();if(!t)return "gray";switch(t){case "pdf":return "pink";case "doc":case "docx":return "blue";case "xls":case "xlsx":case "csv":return "green";case "json":return "orange";default:return "gray"}};var s1=w('<img class="rounded-md object-cover w-[58px] h-[58px]">'),l1=w('<div class="relative group flex-shrink-0"><button class="absolute -right-2 p-0.5 -top-2 rounded-full bg-gray-200 text-black border border-gray-400 opacity-1 sm:opacity-0 group-hover:opacity-100 transition-opacity"aria-label="Remove attachment">'),c1=w('<div class="absolute w-full h-full inset-0 bg-black/20 rounded-md">'),Js=e=>(()=>{var t=l1(),r=t.firstChild;return x(t,m(Le,{get children(){return [m(X,{get when(){return e.file.type.startsWith("image")},get children(){var n=s1();return M(o=>{var i=URL.createObjectURL(e.file),a=e.file.name;return i!==o.e&&G(n,"src",o.e=i),a!==o.t&&G(n,"alt",o.t=a),o},{e:void 0,t:void 0}),n}}),m(X,{when:true,get children(){return m(Qs,{get file(){return e.file}})}})]}}),r),nt(r,"click",e.onRemoveClick),x(r,m(Dr,{class:"w-4"})),x(t,m(W,{get when(){return ue(e.uploadProgressPercent)&&e.uploadProgressPercent!==100},get children(){return m(u1,{get progressPercent(){return e.uploadProgressPercent}})}}),null),t})(),u1=e=>{let[t,r]=R(e.progressPercent??0),n;return Ce(()=>{e.progressPercent===20&&(n=setInterval(()=>{t()<100&&r(i=>i+(Math.floor(Math.random()*10)+1));},1e3));}),ae(()=>{clearInterval(n);}),(()=>{var o=c1();return x(o,m(Mn.Root,{get value(){return t()},class:"flex items-center justify-center",get children(){return m(Mn.Circle,{get children(){return [m(Mn.CircleTrack,{}),m(Mn.CircleRange,{})]}})}})),o})()};var d1=w('<div class="w-full bg-gray-200 rounded-full h-2.5"><div class="upload-progress-bar h-2.5 rounded-full">'),f1=w('<div class="p-4 flex gap-2 border-gray-200 border overflow-auto bg-white rounded-md w-full">'),p1=w('<div class="flex flex-col justify-center items-center gap-4 max-w-[90%]"><p class="text-sm text-center">'),m1=w("<input id=dropzone-file type=file class=hidden>"),g1=w('<div class="flex justify-end">'),h1=w('<div class="flex justify-end"><div class="flex gap-2">'),b1=w('<form class="flex flex-col relative w-full gap-2 rounded-md agent-host-bubble upload"><span class="flex h-5 w-5 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-5 w-5 brightness-150"></span></span><label for=dropzone-file>'),y1=w('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><polyline points="16 16 12 12 8 16"></polyline><line x1=12 y1=12 x2=12 y2=21></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16">'),Sx=e=>{let[t,r]=R([]),[n,o]=R(false),[i,a]=R(0),[s,l]=R(false),u=E=>{let h=Array.from(E).map(C=>Xs({existingFiles:t(),newFile:C,params:{sizeLimit:e.block.options&&"sizeLimit"in e.block.options?e.block.options.sizeLimit:void 0},onError:({description:$,title:H})=>Rr.create({title:H,description:$})})).filter(ue);if(h.length!==0){if(!e.block.options?.isMultipleAllowed)return d(h[0]);r([...t(),...h]);}},c=async E=>{E.preventDefault(),t().length!==0&&p(t());},d=async E=>{o(true);let h=await Xo({apiHost:e.context.apiHost??dt({ignoreChatApiUrl:true}),files:[{file:E,input:{sessionId:e.context.sessionId,blockId:e.block.id,fileName:E.name}}]});if(o(false),h.length&&h[0])return e.onSubmit({type:"text",label:e.block.options?.labels?.success?.single??mr.labels.success.single,value:h[0]?_x(h[0].url):"",attachments:[{type:E.type,url:h[0].url,blobUrl:URL.createObjectURL(E)}]});Rr.create({description:"An error occured while uploading the file"});},p=async E=>{o(true);let h=await Xo({apiHost:e.context.apiHost??dt({ignoreChatApiUrl:true}),files:E.map(C=>({file:C,input:{sessionId:e.context.sessionId,blockId:e.block.id,fileName:C.name}})),onUploadProgress:a});if(o(false),a(0),h.length!==E.length)return Rr.create({description:"An error occured while uploading the files"});e.onSubmit({type:"text",label:h.length>1?(e.block.options?.labels?.success?.multiple??mr.labels.success.multiple).replaceAll("{total}",h.length.toString()):e.block.options?.labels?.success?.single??mr.labels.success.single,value:h.filter(ue).map(({url:C})=>_x(C)).join(", "),attachments:h.map((C,$)=>C?{...C,blobUrl:URL.createObjectURL(t()[$])}:null).filter(ue)});},f=E=>{E.preventDefault(),l(true);},b=()=>l(false),g=E=>{E.preventDefault(),E.stopPropagation(),E.dataTransfer?.files&&u(E.dataTransfer.files);},y=()=>r([]),T=()=>e.onSkip(e.block.options?.labels?.skip??mr.labels.skip),S=E=>{r(h=>h.filter((C,$)=>$!==E));};return (()=>{var E=b1(),h=E.firstChild,C=h.nextSibling;return E.addEventListener("submit",c),C.addEventListener("drop",g),C.addEventListener("dragleave",b),C.addEventListener("dragover",f),x(C,m(Le,{get children(){return [m(X,{get when(){return n()},get children(){return m(W,{get when(){return t().length>1},get fallback(){return m(jo,{})},get children(){var $=d1(),H=$.firstChild;return H.style.setProperty("transition","width 150ms cubic-bezier(0.4, 0, 0.2, 1)"),M(N=>(N=`${i()>0?i:10}%`)!=null?H.style.setProperty("width",N):H.style.removeProperty("width")),$}})}}),m(X,{get when(){return !n()},get children(){return [(()=>{var $=p1(),H=$.firstChild;return x($,m(W,{get when(){return t().length},get fallback(){return m(x1,{})},get children(){var N=f1();return nt(N,"click",_=>{_.preventDefault(),_.stopPropagation();}),x(N,m(ke,{get each(){return t()},children:(_,A)=>m(Js,{file:_,onRemoveClick:()=>S(A())})})),N}}),H),M(()=>H.innerHTML=e.block.options?.labels?.placeholder??mr.labels.placeholder),$})(),(()=>{var $=m1();return $.addEventListener("change",H=>{H.currentTarget.files&&u(H.currentTarget.files);}),M(()=>$.multiple=e.block.options?.isMultipleAllowed??mr.isMultipleAllowed),$})()]}})]}})),x(E,m(W,{get when(){return t().length===0&&e.block.options?.isRequired===false},get children(){var $=g1();return x($,m(pr,{"on:click":T,get children(){return e.block.options?.labels?.skip??mr.labels.skip}})),$}}),null),x(E,m(W,{get when(){return L(()=>!!(e.block.options?.isMultipleAllowed&&t().length>0))()&&!n()},get children(){var $=h1(),H=$.firstChild;return x(H,m(W,{get when(){return t().length},get children(){return m(pr,{variant:"secondary","on:click":y,get children(){return e.block.options?.labels?.clear??mr.labels.clear}})}}),null),x(H,m(We,{type:"submit",disableIcon:true,get children(){return L(()=>(e.block.options?.labels?.button??mr.labels.button)===mr.labels.button)()?`Upload ${t().length} file${t().length>1?"s":""}`:e.block.options?.labels?.button}}),null),$}}),null),M(()=>U(C,"agent-upload-input py-6 flex flex-col justify-center items-center w-full bubble-typing cursor-pointer px-8 "+(s()?"dragging-over":""))),E})()},x1=()=>y1(),_x=e=>{let t=e.split("/").pop();if(!t)return e;let r=encodeURIComponent(t);return e.replace(t,r)};var el={labels:{placeholder:"Type a number..."},isRequired:true};var kx=e=>{let t=n=>{Ce(()=>{let o=e();if(o==null){n.value=o;return}let i=n.value;(o===0&&i===""||o!==i)&&(n.value=o+"");});},r=n=>{if(n.validity.badInput)return e();if(n.value!=="")return n.valueAsNumber};return [rt(e),t,r]};var v1=w('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex relative agent-input w-full"><input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"type=number>'),w1=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),Px=e=>{let[t,r]=R(e.defaultValue??""),[n,o,i]=kx(()=>t()),a,s=()=>a?.value!==""&&a?.reportValidity(),l=()=>{let p=e.block.options?.isRequired??el.isRequired,f=a?.value??t().toString();!p&&!f&&(f="** omited **"),!p||s()?e.onSubmit({type:"text",isRequired:p,value:f}):a?.focus();},u=p=>{p.key==="Enter"&&l();};ie(()=>{!K()&&a&&a.focus({preventScroll:true}),window.addEventListener("message",c);}),ae(()=>{window.removeEventListener("message",c);});let c=p=>{let{data:f}=p;f.isFromAgent&&f.command==="setInputValue"&&r(f.value);},d=e.block.options?.isRequired??el.isRequired;return (()=>{var p=v1(),f=p.firstChild,b=f.firstChild;p.$$keydown=u,b.$$input=y=>{r(i(y.currentTarget));},me(o,b,()=>true);var g=a;return typeof g=="function"?me(g,b):a=b,b.style.setProperty("font-size","16px"),b.style.setProperty("appearance","auto"),b.value=n,x(f,!d&&w1(),null),x(p,m(We,{type:"button",class:"h-[56px]","on:click":l,get children(){return e.block.options?.labels?.button}}),null),M(y=>{var T=e.block.options?.labels?.placeholder??el.labels.placeholder,S=e.block.options?.min,E=e.block.options?.max,h=e.block.options?.step??"any";return T!==y.e&&G(b,"placeholder",y.e=T),S!==y.t&&G(b,"min",y.t=S),E!==y.a&&G(b,"max",y.a=E),h!==y.o&&G(b,"step",y.o=h),y},{e:void 0,t:void 0,a:void 0,o:void 0}),p})()};Ne(["keydown","input"]);var Lx=Ma(Nx());var il={labels:{button:"Pay",success:"Success"}};var D1=w('<div class="agent-input-error-message mt-4 text-center animate-fade-in">'),M1=w('<form id=payment-form class="flex flex-col p-4 agent-input w-full items-center"><slot name=stripe-payment-form>'),$1="stripe-payment-form",Pu,da=null,al=null,Fx=e=>{let[t,r]=R(),[n,o]=R(false),[i,a]=R(false);ie(async()=>{if(N1(Pu),!e.options?.publicKey)return r("Missing Stripe public key");if(da=await(0, Lx.loadStripe)(e.options?.publicKey),!da)return;al=da.elements({appearance:{theme:"stripe",variables:{colorPrimary:getComputedStyle(Pu).getPropertyValue("--agent-button-bg-color")}},clientSecret:e.options.paymentIntentSecret}),al.create("payment",{layout:"tabs"}).mount("#payment-element"),setTimeout(()=>{o(true),e.onTransitionEnd();},1e3);});let s=async l=>{if(l.preventDefault(),!da||!al)return;a(true),ff({sessionId:e.context.sessionId,resultId:e.context.resultId,agent:e.context.agent});let{postalCode:u,...c}=e.options?.additionalInformation?.address??{},{error:d,paymentIntent:p}=await da.confirmPayment({elements:al,confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:{name:e.options?.additionalInformation?.name,email:e.options?.additionalInformation?.email,phone:e.options?.additionalInformation?.phoneNumber,address:{...c,postal_code:u}}}},redirect:"if_required"});if(za(),a(false),d?.type!=="validation_error"){if(d?.type==="card_error")return r(d.message);if(!d&&p.status==="succeeded")return e.onSuccess()}};return (()=>{var l=M1(),u=l.firstChild;return l.addEventListener("submit",s),me(c=>Pu=c,u),u._$owner=lo(),x(l,m(W,{get when(){return n()},get children(){return m(We,{get isLoading(){return i()},class:"mt-4 w-full max-w-lg animate-fade-in",disableIcon:true,get children(){return [L(()=>e.options?.labels?.button??il.labels.button)," ",L(()=>e.options?.amountLabel)]}})}}),null),x(l,m(W,{get when(){return t()},get children(){var c=D1();return x(c,t),c}}),null),l})()},N1=e=>{let r=e.getRootNode().host,n=document.createElement("div");n.style.width="100%",n.slot=$1,r.appendChild(n);let o=document.createElement("div");o.id="payment-element",n.appendChild(o);};var Bx=e=>m(Fx,{get onSuccess(){return e.onSuccess},get options(){return e.options},get context(){return e.context},get onTransitionEnd(){return e.onTransitionEnd}});var L1=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><polyline points="6 9 12 15 18 9">'),Ux=e=>(()=>{var t=L1();return Pe(t,e,true,true),t})();var F1=w('<input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"type=text>'),$t=e=>{let[t,r]=Je(e,["ref","onInput"]);return (()=>{var n=F1();n.$$input=i=>t.onInput(i.currentTarget.value);var o=e.ref;return typeof o=="function"?me(o,n):e.ref=n,Pe(n,r,false,false),n})()};Ne(["input"]);var sl={labels:{placeholder:"Type your phone number..."},isRequired:true};var jn=[{name:"International",flag:"\u{1F310}",code:"INT",dial_code:""},{name:"Afghanistan",flag:"\u{1F1E6}\u{1F1EB}",code:"AF",dial_code:"+93"},{name:"\xC5land Islands",flag:"\u{1F1E6}\u{1F1FD}",code:"AX",dial_code:"+358"},{name:"Albania",flag:"\u{1F1E6}\u{1F1F1}",code:"AL",dial_code:"+355"},{name:"Algeria",flag:"\u{1F1E9}\u{1F1FF}",code:"DZ",dial_code:"+213"},{name:"American Samoa",flag:"\u{1F1E6}\u{1F1F8}",code:"AS",dial_code:"+1684"},{name:"Andorra",flag:"\u{1F1E6}\u{1F1E9}",code:"AD",dial_code:"+376"},{name:"Angola",flag:"\u{1F1E6}\u{1F1F4}",code:"AO",dial_code:"+244"},{name:"Anguilla",flag:"\u{1F1E6}\u{1F1EE}",code:"AI",dial_code:"+1264"},{name:"Antarctica",flag:"\u{1F1E6}\u{1F1F6}",code:"AQ",dial_code:"+672"},{name:"Antigua and Barbuda",flag:"\u{1F1E6}\u{1F1EC}",code:"AG",dial_code:"+1268"},{name:"Argentina",flag:"\u{1F1E6}\u{1F1F7}",code:"AR",dial_code:"+54"},{name:"Armenia",flag:"\u{1F1E6}\u{1F1F2}",code:"AM",dial_code:"+374"},{name:"Aruba",flag:"\u{1F1E6}\u{1F1FC}",code:"AW",dial_code:"+297"},{name:"Australia",flag:"\u{1F1E6}\u{1F1FA}",code:"AU",dial_code:"+61"},{name:"Austria",flag:"\u{1F1E6}\u{1F1F9}",code:"AT",dial_code:"+43"},{name:"Azerbaijan",flag:"\u{1F1E6}\u{1F1FF}",code:"AZ",dial_code:"+994"},{name:"Bahamas",flag:"\u{1F1E7}\u{1F1F8}",code:"BS",dial_code:"+1242"},{name:"Bahrain",flag:"\u{1F1E7}\u{1F1ED}",code:"BH",dial_code:"+973"},{name:"Bangladesh",flag:"\u{1F1E7}\u{1F1E9}",code:"BD",dial_code:"+880"},{name:"Barbados",flag:"\u{1F1E7}\u{1F1E7}",code:"BB",dial_code:"+1246"},{name:"Belarus",flag:"\u{1F1E7}\u{1F1FE}",code:"BY",dial_code:"+375"},{name:"Belgium",flag:"\u{1F1E7}\u{1F1EA}",code:"BE",dial_code:"+32"},{name:"Belize",flag:"\u{1F1E7}\u{1F1FF}",code:"BZ",dial_code:"+501"},{name:"Benin",flag:"\u{1F1E7}\u{1F1EF}",code:"BJ",dial_code:"+229"},{name:"Bermuda",flag:"\u{1F1E7}\u{1F1F2}",code:"BM",dial_code:"+1441"},{name:"Bhutan",flag:"\u{1F1E7}\u{1F1F9}",code:"BT",dial_code:"+975"},{name:"Bolivia, Plurinational State of bolivia",flag:"\u{1F1E7}\u{1F1F4}",code:"BO",dial_code:"+591"},{name:"Bosnia and Herzegovina",flag:"\u{1F1E7}\u{1F1E6}",code:"BA",dial_code:"+387"},{name:"Botswana",flag:"\u{1F1E7}\u{1F1FC}",code:"BW",dial_code:"+267"},{name:"Bouvet Island",flag:"\u{1F1E7}\u{1F1FB}",code:"BV",dial_code:"+47"},{name:"Brazil",flag:"\u{1F1E7}\u{1F1F7}",code:"BR",dial_code:"+55"},{name:"British Indian Ocean Territory",flag:"\u{1F1EE}\u{1F1F4}",code:"IO",dial_code:"+246"},{name:"Brunei Darussalam",flag:"\u{1F1E7}\u{1F1F3}",code:"BN",dial_code:"+673"},{name:"Bulgaria",flag:"\u{1F1E7}\u{1F1EC}",code:"BG",dial_code:"+359"},{name:"Burkina Faso",flag:"\u{1F1E7}\u{1F1EB}",code:"BF",dial_code:"+226"},{name:"Burundi",flag:"\u{1F1E7}\u{1F1EE}",code:"BI",dial_code:"+257"},{name:"Cambodia",flag:"\u{1F1F0}\u{1F1ED}",code:"KH",dial_code:"+855"},{name:"Cameroon",flag:"\u{1F1E8}\u{1F1F2}",code:"CM",dial_code:"+237"},{name:"Canada",flag:"\u{1F1E8}\u{1F1E6}",code:"CA",dial_code:"+1"},{name:"Cape Verde",flag:"\u{1F1E8}\u{1F1FB}",code:"CV",dial_code:"+238"},{name:"Cayman Islands",flag:"\u{1F1F0}\u{1F1FE}",code:"KY",dial_code:"+345"},{name:"Central African Republic",flag:"\u{1F1E8}\u{1F1EB}",code:"CF",dial_code:"+236"},{name:"Chad",flag:"\u{1F1F9}\u{1F1E9}",code:"TD",dial_code:"+235"},{name:"Chile",flag:"\u{1F1E8}\u{1F1F1}",code:"CL",dial_code:"+56"},{name:"China",flag:"\u{1F1E8}\u{1F1F3}",code:"CN",dial_code:"+86"},{name:"Christmas Island",flag:"\u{1F1E8}\u{1F1FD}",code:"CX",dial_code:"+61"},{name:"Cocos (Keeling) Islands",flag:"\u{1F1E8}\u{1F1E8}",code:"CC",dial_code:"+61"},{name:"Colombia",flag:"\u{1F1E8}\u{1F1F4}",code:"CO",dial_code:"+57"},{name:"Comoros",flag:"\u{1F1F0}\u{1F1F2}",code:"KM",dial_code:"+269"},{name:"Congo",flag:"\u{1F1E8}\u{1F1EC}",code:"CG",dial_code:"+242"},{name:"Congo, The Democratic Republic of the Congo",flag:"\u{1F1E8}\u{1F1E9}",code:"CD",dial_code:"+243"},{name:"Cook Islands",flag:"\u{1F1E8}\u{1F1F0}",code:"CK",dial_code:"+682"},{name:"Costa Rica",flag:"\u{1F1E8}\u{1F1F7}",code:"CR",dial_code:"+506"},{name:"Cote d'Ivoire",flag:"\u{1F1E8}\u{1F1EE}",code:"CI",dial_code:"+225"},{name:"Croatia",flag:"\u{1F1ED}\u{1F1F7}",code:"HR",dial_code:"+385"},{name:"Cuba",flag:"\u{1F1E8}\u{1F1FA}",code:"CU",dial_code:"+53"},{name:"Cyprus",flag:"\u{1F1E8}\u{1F1FE}",code:"CY",dial_code:"+357"},{name:"Czech Republic",flag:"\u{1F1E8}\u{1F1FF}",code:"CZ",dial_code:"+420"},{name:"Denmark",flag:"\u{1F1E9}\u{1F1F0}",code:"DK",dial_code:"+45"},{name:"Djibouti",flag:"\u{1F1E9}\u{1F1EF}",code:"DJ",dial_code:"+253"},{name:"Dominica",flag:"\u{1F1E9}\u{1F1F2}",code:"DM",dial_code:"+1767"},{name:"Dominican Republic",flag:"\u{1F1E9}\u{1F1F4}",code:"DO",dial_code:"+1849"},{name:"Dominican Republic",flag:"\u{1F1E9}\u{1F1F4}",code:"DO",dial_code:"+1829"},{name:"Dominican Republic",flag:"\u{1F1E9}\u{1F1F4}",code:"DO",dial_code:"+1809"},{name:"Ecuador",flag:"\u{1F1EA}\u{1F1E8}",code:"EC",dial_code:"+593"},{name:"Egypt",flag:"\u{1F1EA}\u{1F1EC}",code:"EG",dial_code:"+20"},{name:"El Salvador",flag:"\u{1F1F8}\u{1F1FB}",code:"SV",dial_code:"+503"},{name:"Equatorial Guinea",flag:"\u{1F1EC}\u{1F1F6}",code:"GQ",dial_code:"+240"},{name:"Eritrea",flag:"\u{1F1EA}\u{1F1F7}",code:"ER",dial_code:"+291"},{name:"Estonia",flag:"\u{1F1EA}\u{1F1EA}",code:"EE",dial_code:"+372"},{name:"Ethiopia",flag:"\u{1F1EA}\u{1F1F9}",code:"ET",dial_code:"+251"},{name:"Falkland Islands (Malvinas)",flag:"\u{1F1EB}\u{1F1F0}",code:"FK",dial_code:"+500"},{name:"Faroe Islands",flag:"\u{1F1EB}\u{1F1F4}",code:"FO",dial_code:"+298"},{name:"Fiji",flag:"\u{1F1EB}\u{1F1EF}",code:"FJ",dial_code:"+679"},{name:"Finland",flag:"\u{1F1EB}\u{1F1EE}",code:"FI",dial_code:"+358"},{name:"France",flag:"\u{1F1EB}\u{1F1F7}",code:"FR",dial_code:"+33"},{name:"French Guiana",flag:"\u{1F1EC}\u{1F1EB}",code:"GF",dial_code:"+594"},{name:"French Polynesia",flag:"\u{1F1F5}\u{1F1EB}",code:"PF",dial_code:"+689"},{name:"French Southern Territories",flag:"\u{1F1F9}\u{1F1EB}",code:"TF",dial_code:"+262"},{name:"Gabon",flag:"\u{1F1EC}\u{1F1E6}",code:"GA",dial_code:"+241"},{name:"Gambia",flag:"\u{1F1EC}\u{1F1F2}",code:"GM",dial_code:"+220"},{name:"Georgia",flag:"\u{1F1EC}\u{1F1EA}",code:"GE",dial_code:"+995"},{name:"Germany",flag:"\u{1F1E9}\u{1F1EA}",code:"DE",dial_code:"+49"},{name:"Ghana",flag:"\u{1F1EC}\u{1F1ED}",code:"GH",dial_code:"+233"},{name:"Gibraltar",flag:"\u{1F1EC}\u{1F1EE}",code:"GI",dial_code:"+350"},{name:"Greece",flag:"\u{1F1EC}\u{1F1F7}",code:"GR",dial_code:"+30"},{name:"Greenland",flag:"\u{1F1EC}\u{1F1F1}",code:"GL",dial_code:"+299"},{name:"Grenada",flag:"\u{1F1EC}\u{1F1E9}",code:"GD",dial_code:"+1473"},{name:"Guadeloupe",flag:"\u{1F1EC}\u{1F1F5}",code:"GP",dial_code:"+590"},{name:"Guam",flag:"\u{1F1EC}\u{1F1FA}",code:"GU",dial_code:"+1671"},{name:"Guatemala",flag:"\u{1F1EC}\u{1F1F9}",code:"GT",dial_code:"+502"},{name:"Guernsey",flag:"\u{1F1EC}\u{1F1EC}",code:"GG",dial_code:"+44"},{name:"Guinea",flag:"\u{1F1EC}\u{1F1F3}",code:"GN",dial_code:"+224"},{name:"Guinea-Bissau",flag:"\u{1F1EC}\u{1F1FC}",code:"GW",dial_code:"+245"},{name:"Guyana",flag:"\u{1F1EC}\u{1F1FE}",code:"GY",dial_code:"+592"},{name:"Haiti",flag:"\u{1F1ED}\u{1F1F9}",code:"HT",dial_code:"+509"},{name:"Heard Island and Mcdonald Islands",flag:"\u{1F1ED}\u{1F1F2}",code:"HM",dial_code:"+672"},{name:"Holy See (Vatican City State)",flag:"\u{1F1FB}\u{1F1E6}",code:"VA",dial_code:"+379"},{name:"Honduras",flag:"\u{1F1ED}\u{1F1F3}",code:"HN",dial_code:"+504"},{name:"Hong Kong",flag:"\u{1F1ED}\u{1F1F0}",code:"HK",dial_code:"+852"},{name:"Hungary",flag:"\u{1F1ED}\u{1F1FA}",code:"HU",dial_code:"+36"},{name:"Iceland",flag:"\u{1F1EE}\u{1F1F8}",code:"IS",dial_code:"+354"},{name:"India",flag:"\u{1F1EE}\u{1F1F3}",code:"IN",dial_code:"+91"},{name:"Indonesia",flag:"\u{1F1EE}\u{1F1E9}",code:"ID",dial_code:"+62"},{name:"Iran, Islamic Republic of Persian Gulf",flag:"\u{1F1EE}\u{1F1F7}",code:"IR",dial_code:"+98"},{name:"Iraq",flag:"\u{1F1EE}\u{1F1F6}",code:"IQ",dial_code:"+964"},{name:"Ireland",flag:"\u{1F1EE}\u{1F1EA}",code:"IE",dial_code:"+353"},{name:"Isle of Man",flag:"\u{1F1EE}\u{1F1F2}",code:"IM",dial_code:"+44"},{name:"Israel",flag:"\u{1F1EE}\u{1F1F1}",code:"IL",dial_code:"+972"},{name:"Italy",flag:"\u{1F1EE}\u{1F1F9}",code:"IT",dial_code:"+39"},{name:"Jamaica",flag:"\u{1F1EF}\u{1F1F2}",code:"JM",dial_code:"+1876"},{name:"Japan",flag:"\u{1F1EF}\u{1F1F5}",code:"JP",dial_code:"+81"},{name:"Jersey",flag:"\u{1F1EF}\u{1F1EA}",code:"JE",dial_code:"+44"},{name:"Jordan",flag:"\u{1F1EF}\u{1F1F4}",code:"JO",dial_code:"+962"},{name:"Kazakhstan",flag:"\u{1F1F0}\u{1F1FF}",code:"KZ",dial_code:"+7"},{name:"Kenya",flag:"\u{1F1F0}\u{1F1EA}",code:"KE",dial_code:"+254"},{name:"Kiribati",flag:"\u{1F1F0}\u{1F1EE}",code:"KI",dial_code:"+686"},{name:"Korea, Democratic People's Republic of Korea",flag:"\u{1F1F0}\u{1F1F5}",code:"KP",dial_code:"+850"},{name:"Korea, Republic of South Korea",flag:"\u{1F1F0}\u{1F1F7}",code:"KR",dial_code:"+82"},{name:"Kosovo",flag:"\u{1F1FD}\u{1F1F0}",code:"XK",dial_code:"+383"},{name:"Kuwait",flag:"\u{1F1F0}\u{1F1FC}",code:"KW",dial_code:"+965"},{name:"Kyrgyzstan",flag:"\u{1F1F0}\u{1F1EC}",code:"KG",dial_code:"+996"},{name:"Laos",flag:"\u{1F1F1}\u{1F1E6}",code:"LA",dial_code:"+856"},{name:"Latvia",flag:"\u{1F1F1}\u{1F1FB}",code:"LV",dial_code:"+371"},{name:"Lebanon",flag:"\u{1F1F1}\u{1F1E7}",code:"LB",dial_code:"+961"},{name:"Lesotho",flag:"\u{1F1F1}\u{1F1F8}",code:"LS",dial_code:"+266"},{name:"Liberia",flag:"\u{1F1F1}\u{1F1F7}",code:"LR",dial_code:"+231"},{name:"Libyan Arab Jamahiriya",flag:"\u{1F1F1}\u{1F1FE}",code:"LY",dial_code:"+218"},{name:"Liechtenstein",flag:"\u{1F1F1}\u{1F1EE}",code:"LI",dial_code:"+423"},{name:"Lithuania",flag:"\u{1F1F1}\u{1F1F9}",code:"LT",dial_code:"+370"},{name:"Luxembourg",flag:"\u{1F1F1}\u{1F1FA}",code:"LU",dial_code:"+352"},{name:"Macao",flag:"\u{1F1F2}\u{1F1F4}",code:"MO",dial_code:"+853"},{name:"Macedonia",flag:"\u{1F1F2}\u{1F1F0}",code:"MK",dial_code:"+389"},{name:"Madagascar",flag:"\u{1F1F2}\u{1F1EC}",code:"MG",dial_code:"+261"},{name:"Malawi",flag:"\u{1F1F2}\u{1F1FC}",code:"MW",dial_code:"+265"},{name:"Malaysia",flag:"\u{1F1F2}\u{1F1FE}",code:"MY",dial_code:"+60"},{name:"Maldives",flag:"\u{1F1F2}\u{1F1FB}",code:"MV",dial_code:"+960"},{name:"Mali",flag:"\u{1F1F2}\u{1F1F1}",code:"ML",dial_code:"+223"},{name:"Malta",flag:"\u{1F1F2}\u{1F1F9}",code:"MT",dial_code:"+356"},{name:"Marshall Islands",flag:"\u{1F1F2}\u{1F1ED}",code:"MH",dial_code:"+692"},{name:"Martinique",flag:"\u{1F1F2}\u{1F1F6}",code:"MQ",dial_code:"+596"},{name:"Mauritania",flag:"\u{1F1F2}\u{1F1F7}",code:"MR",dial_code:"+222"},{name:"Mauritius",flag:"\u{1F1F2}\u{1F1FA}",code:"MU",dial_code:"+230"},{name:"Mayotte",flag:"\u{1F1FE}\u{1F1F9}",code:"YT",dial_code:"+262"},{name:"Mexico",flag:"\u{1F1F2}\u{1F1FD}",code:"MX",dial_code:"+52"},{name:"Micronesia, Federated States of Micronesia",flag:"\u{1F1EB}\u{1F1F2}",code:"FM",dial_code:"+691"},{name:"Moldova",flag:"\u{1F1F2}\u{1F1E9}",code:"MD",dial_code:"+373"},{name:"Monaco",flag:"\u{1F1F2}\u{1F1E8}",code:"MC",dial_code:"+377"},{name:"Mongolia",flag:"\u{1F1F2}\u{1F1F3}",code:"MN",dial_code:"+976"},{name:"Montenegro",flag:"\u{1F1F2}\u{1F1EA}",code:"ME",dial_code:"+382"},{name:"Montserrat",flag:"\u{1F1F2}\u{1F1F8}",code:"MS",dial_code:"+1664"},{name:"Morocco",flag:"\u{1F1F2}\u{1F1E6}",code:"MA",dial_code:"+212"},{name:"Mozambique",flag:"\u{1F1F2}\u{1F1FF}",code:"MZ",dial_code:"+258"},{name:"Myanmar",flag:"\u{1F1F2}\u{1F1F2}",code:"MM",dial_code:"+95"},{name:"Namibia",flag:"\u{1F1F3}\u{1F1E6}",code:"NA",dial_code:"+264"},{name:"Nauru",flag:"\u{1F1F3}\u{1F1F7}",code:"NR",dial_code:"+674"},{name:"Nepal",flag:"\u{1F1F3}\u{1F1F5}",code:"NP",dial_code:"+977"},{name:"Netherlands",flag:"\u{1F1F3}\u{1F1F1}",code:"NL",dial_code:"+31"},{name:"Netherlands Antilles",flag:"",code:"AN",dial_code:"+599"},{name:"New Caledonia",flag:"\u{1F1F3}\u{1F1E8}",code:"NC",dial_code:"+687"},{name:"New Zealand",flag:"\u{1F1F3}\u{1F1FF}",code:"NZ",dial_code:"+64"},{name:"Nicaragua",flag:"\u{1F1F3}\u{1F1EE}",code:"NI",dial_code:"+505"},{name:"Niger",flag:"\u{1F1F3}\u{1F1EA}",code:"NE",dial_code:"+227"},{name:"Nigeria",flag:"\u{1F1F3}\u{1F1EC}",code:"NG",dial_code:"+234"},{name:"Niue",flag:"\u{1F1F3}\u{1F1FA}",code:"NU",dial_code:"+683"},{name:"Norfolk Island",flag:"\u{1F1F3}\u{1F1EB}",code:"NF",dial_code:"+672"},{name:"Northern Mariana Islands",flag:"\u{1F1F2}\u{1F1F5}",code:"MP",dial_code:"+1670"},{name:"Norway",flag:"\u{1F1F3}\u{1F1F4}",code:"NO",dial_code:"+47"},{name:"Oman",flag:"\u{1F1F4}\u{1F1F2}",code:"OM",dial_code:"+968"},{name:"Pakistan",flag:"\u{1F1F5}\u{1F1F0}",code:"PK",dial_code:"+92"},{name:"Palau",flag:"\u{1F1F5}\u{1F1FC}",code:"PW",dial_code:"+680"},{name:"Palestinian Territory, Occupied",flag:"\u{1F1F5}\u{1F1F8}",code:"PS",dial_code:"+970"},{name:"Panama",flag:"\u{1F1F5}\u{1F1E6}",code:"PA",dial_code:"+507"},{name:"Papua New Guinea",flag:"\u{1F1F5}\u{1F1EC}",code:"PG",dial_code:"+675"},{name:"Paraguay",flag:"\u{1F1F5}\u{1F1FE}",code:"PY",dial_code:"+595"},{name:"Peru",flag:"\u{1F1F5}\u{1F1EA}",code:"PE",dial_code:"+51"},{name:"Philippines",flag:"\u{1F1F5}\u{1F1ED}",code:"PH",dial_code:"+63"},{name:"Pitcairn",flag:"\u{1F1F5}\u{1F1F3}",code:"PN",dial_code:"+64"},{name:"Poland",flag:"\u{1F1F5}\u{1F1F1}",code:"PL",dial_code:"+48"},{name:"Portugal",flag:"\u{1F1F5}\u{1F1F9}",code:"PT",dial_code:"+351"},{name:"Puerto Rico",flag:"\u{1F1F5}\u{1F1F7}",code:"PR",dial_code:"+1939"},{name:"Qatar",flag:"\u{1F1F6}\u{1F1E6}",code:"QA",dial_code:"+974"},{name:"Romania",flag:"\u{1F1F7}\u{1F1F4}",code:"RO",dial_code:"+40"},{name:"Russia",flag:"\u{1F1F7}\u{1F1FA}",code:"RU",dial_code:"+7"},{name:"Rwanda",flag:"\u{1F1F7}\u{1F1FC}",code:"RW",dial_code:"+250"},{name:"Reunion",flag:"\u{1F1F7}\u{1F1EA}",code:"RE",dial_code:"+262"},{name:"Saint Barthelemy",flag:"\u{1F1E7}\u{1F1F1}",code:"BL",dial_code:"+590"},{name:"Saint Helena, Ascension and Tristan Da Cunha",flag:"\u{1F1F8}\u{1F1ED}",code:"SH",dial_code:"+290"},{name:"Saint Kitts and Nevis",flag:"\u{1F1F0}\u{1F1F3}",code:"KN",dial_code:"+1869"},{name:"Saint Lucia",flag:"\u{1F1F1}\u{1F1E8}",code:"LC",dial_code:"+1758"},{name:"Saint Martin",flag:"\u{1F1F2}\u{1F1EB}",code:"MF",dial_code:"+590"},{name:"Saint Pierre and Miquelon",flag:"\u{1F1F5}\u{1F1F2}",code:"PM",dial_code:"+508"},{name:"Saint Vincent and the Grenadines",flag:"\u{1F1FB}\u{1F1E8}",code:"VC",dial_code:"+1784"},{name:"Samoa",flag:"\u{1F1FC}\u{1F1F8}",code:"WS",dial_code:"+685"},{name:"San Marino",flag:"\u{1F1F8}\u{1F1F2}",code:"SM",dial_code:"+378"},{name:"Sao Tome and Principe",flag:"\u{1F1F8}\u{1F1F9}",code:"ST",dial_code:"+239"},{name:"Saudi Arabia",flag:"\u{1F1F8}\u{1F1E6}",code:"SA",dial_code:"+966"},{name:"Senegal",flag:"\u{1F1F8}\u{1F1F3}",code:"SN",dial_code:"+221"},{name:"Serbia",flag:"\u{1F1F7}\u{1F1F8}",code:"RS",dial_code:"+381"},{name:"Seychelles",flag:"\u{1F1F8}\u{1F1E8}",code:"SC",dial_code:"+248"},{name:"Sierra Leone",flag:"\u{1F1F8}\u{1F1F1}",code:"SL",dial_code:"+232"},{name:"Singapore",flag:"\u{1F1F8}\u{1F1EC}",code:"SG",dial_code:"+65"},{name:"Slovakia",flag:"\u{1F1F8}\u{1F1F0}",code:"SK",dial_code:"+421"},{name:"Slovenia",flag:"\u{1F1F8}\u{1F1EE}",code:"SI",dial_code:"+386"},{name:"Solomon Islands",flag:"\u{1F1F8}\u{1F1E7}",code:"SB",dial_code:"+677"},{name:"Somalia",flag:"\u{1F1F8}\u{1F1F4}",code:"SO",dial_code:"+252"},{name:"South Africa",flag:"\u{1F1FF}\u{1F1E6}",code:"ZA",dial_code:"+27"},{name:"South Sudan",flag:"\u{1F1F8}\u{1F1F8}",code:"SS",dial_code:"+211"},{name:"South Georgia and the South Sandwich Islands",flag:"\u{1F1EC}\u{1F1F8}",code:"GS",dial_code:"+500"},{name:"Spain",flag:"\u{1F1EA}\u{1F1F8}",code:"ES",dial_code:"+34"},{name:"Sri Lanka",flag:"\u{1F1F1}\u{1F1F0}",code:"LK",dial_code:"+94"},{name:"Sudan",flag:"\u{1F1F8}\u{1F1E9}",code:"SD",dial_code:"+249"},{name:"Suriname",flag:"\u{1F1F8}\u{1F1F7}",code:"SR",dial_code:"+597"},{name:"Svalbard and Jan Mayen",flag:"\u{1F1F8}\u{1F1EF}",code:"SJ",dial_code:"+47"},{name:"Swaziland",flag:"\u{1F1F8}\u{1F1FF}",code:"SZ",dial_code:"+268"},{name:"Sweden",flag:"\u{1F1F8}\u{1F1EA}",code:"SE",dial_code:"+46"},{name:"Switzerland",flag:"\u{1F1E8}\u{1F1ED}",code:"CH",dial_code:"+41"},{name:"Syrian Arab Republic",flag:"\u{1F1F8}\u{1F1FE}",code:"SY",dial_code:"+963"},{name:"Taiwan",flag:"\u{1F1F9}\u{1F1FC}",code:"TW",dial_code:"+886"},{name:"Tajikistan",flag:"\u{1F1F9}\u{1F1EF}",code:"TJ",dial_code:"+992"},{name:"Tanzania, United Republic of Tanzania",flag:"\u{1F1F9}\u{1F1FF}",code:"TZ",dial_code:"+255"},{name:"Thailand",flag:"\u{1F1F9}\u{1F1ED}",code:"TH",dial_code:"+66"},{name:"Timor-Leste",flag:"\u{1F1F9}\u{1F1F1}",code:"TL",dial_code:"+670"},{name:"Togo",flag:"\u{1F1F9}\u{1F1EC}",code:"TG",dial_code:"+228"},{name:"Tokelau",flag:"\u{1F1F9}\u{1F1F0}",code:"TK",dial_code:"+690"},{name:"Tonga",flag:"\u{1F1F9}\u{1F1F4}",code:"TO",dial_code:"+676"},{name:"Trinidad and Tobago",flag:"\u{1F1F9}\u{1F1F9}",code:"TT",dial_code:"+1868"},{name:"Tunisia",flag:"\u{1F1F9}\u{1F1F3}",code:"TN",dial_code:"+216"},{name:"Turkey",flag:"\u{1F1F9}\u{1F1F7}",code:"TR",dial_code:"+90"},{name:"Turkmenistan",flag:"\u{1F1F9}\u{1F1F2}",code:"TM",dial_code:"+993"},{name:"Turks and Caicos Islands",flag:"\u{1F1F9}\u{1F1E8}",code:"TC",dial_code:"+1649"},{name:"Tuvalu",flag:"\u{1F1F9}\u{1F1FB}",code:"TV",dial_code:"+688"},{name:"Uganda",flag:"\u{1F1FA}\u{1F1EC}",code:"UG",dial_code:"+256"},{name:"Ukraine",flag:"\u{1F1FA}\u{1F1E6}",code:"UA",dial_code:"+380"},{name:"United Arab Emirates",flag:"\u{1F1E6}\u{1F1EA}",code:"AE",dial_code:"+971"},{name:"United Kingdom",flag:"\u{1F1EC}\u{1F1E7}",code:"GB",dial_code:"+44"},{name:"United States",flag:"\u{1F1FA}\u{1F1F8}",code:"US",dial_code:"+1"},{name:"Uruguay",flag:"\u{1F1FA}\u{1F1FE}",code:"UY",dial_code:"+598"},{name:"Uzbekistan",flag:"\u{1F1FA}\u{1F1FF}",code:"UZ",dial_code:"+998"},{name:"Vanuatu",flag:"\u{1F1FB}\u{1F1FA}",code:"VU",dial_code:"+678"},{name:"Venezuela, Bolivarian Republic of Venezuela",flag:"\u{1F1FB}\u{1F1EA}",code:"VE",dial_code:"+58"},{name:"Vietnam",flag:"\u{1F1FB}\u{1F1F3}",code:"VN",dial_code:"+84"},{name:"Virgin Islands, British",flag:"\u{1F1FB}\u{1F1EC}",code:"VG",dial_code:"+1284"},{name:"Virgin Islands, U.S.",flag:"\u{1F1FB}\u{1F1EE}",code:"VI",dial_code:"+1340"},{name:"Wallis and Futuna",flag:"\u{1F1FC}\u{1F1EB}",code:"WF",dial_code:"+681"},{name:"Yemen",flag:"\u{1F1FE}\u{1F1EA}",code:"YE",dial_code:"+967"},{name:"Zambia",flag:"\u{1F1FF}\u{1F1F2}",code:"ZM",dial_code:"+260"},{name:"Zimbabwe",flag:"\u{1F1FF}\u{1F1FC}",code:"ZW",dial_code:"+263"}];var B1=w('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex relative agent-input w-full"><div class="relative agent-country-select flex justify-center items-center"><div class="pl-2 pr-1 flex items-center gap-2"><span></span></div><select class="absolute top-0 left-0 w-full h-full cursor-pointer opacity-0">'),U1=w("<option> "),V1=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),Vx=e=>{let[t,r]=R(Ze(e.defaultCountryCode)?"INT":e.defaultCountryCode),[n,o]=R(e.defaultValue??""),i,a=f=>{o(f),(f===""||f==="+")&&t()!=="INT"&&r("INT");let b=f?.startsWith("+")&&f.length>2&&jn.reduce((g,y)=>!y?.dial_code||g!==null&&!g.dial_code?g:f?.startsWith(y.dial_code)&&y.dial_code.length>(g?.dial_code.length??0)?y:g,null);b&&r(b.code);},s=()=>i?.value!==""&&i?.reportValidity(),l=()=>{let f=jn.find(y=>y.code===t())?.dial_code,b=e?.isRequired??sl.isRequired,g=i?.value??n();!b&&!g?g="** omited **":!g.startsWith("+")&&f&&(g=`${f??""}${g}`),!b||s()?e.onSubmit({type:"text",value:g,isRequired:b}):i?.focus();},u=f=>{f.key==="Enter"&&l();},c=f=>{let b=jn.find(y=>y.code===f.currentTarget.value);if(!b)return;let g=jn.find(y=>y.code===t());(n()===""||g&&n()===g.dial_code)&&o(b.dial_code),r(b.code),i?.focus();};ie(()=>{!K()&&i&&i.focus({preventScroll:true}),window.addEventListener("message",d);}),ae(()=>{window.removeEventListener("message",d);});let d=f=>{let{data:b}=f;b.isFromAgent&&b.command==="setInputValue"&&o(b.value);},p=e?.isRequired??sl.isRequired;return (()=>{var f=B1(),b=f.firstChild,g=b.firstChild,y=g.firstChild,T=y.firstChild,S=y.nextSibling;return f.$$keydown=u,x(T,()=>jn.find(E=>t()===E.code)?.flag),x(y,m(Ux,{class:"w-3"}),null),S.addEventListener("change",c),x(S,m(ke,{each:jn,children:E=>(()=>{var h=U1(),C=h.firstChild;return x(h,()=>E.name,C),x(h,()=>E.dial_code?`(${E.dial_code})`:"",null),M(()=>h.selected=E.code===t()),M(()=>h.value=E.code),h})()})),x(b,m($t,{type:"tel",ref(E){var h=i;typeof h=="function"?h(E):i=E;},get value(){return n()},onInput:a,get placeholder(){return e.labels?.placeholder??sl.labels.placeholder},get autofocus(){return !K()}}),null),x(b,!p&&V1(),null),x(f,m(We,{type:"button",class:"h-[56px]","on:click":l,get children(){return e.labels?.button}}),null),f})()};Ne(["keydown"]);var fa={buttonLabel:Qe,searchInputPlaceholder:"Filter the options...",showTitle:false};var H1=w('<div class="flex items-end agent-input w-full">'),W1=w('<form class="flex flex-col gap-2 w-full items-end"><div>'),Hx=w("<span class=font-semibold>"),Wx=w('<span class="text-sm whitespace-pre-wrap text-left">'),jx=w('<div class="flex flex-col gap-1 ">'),j1=w("<div role=checkbox><img fetchpriority=high class=m-auto><div>"),z1=w('<div role=checkbox aria-checked class="flex flex-col focus:outline-none cursor-pointer select-none agent-selectable-picture selected"><img fetchpriority=high><div>'),zx=e=>{let t,[r,n]=R(e.defaultItems),[o,i]=R([]),[a,s]=R(0);ie(()=>{!K()&&t&&t.focus({preventScroll:true});});let l=f=>{u(f);},u=f=>{let b=o().indexOf(f);i(b!==-1?g=>g.filter(y=>y!==f):g=>[...g,f]);},c=()=>e.onSubmit({type:"text",value:o().map(f=>{let b=e.defaultItems.find(g=>g.id===f);return Re(b?.title)?b.title:b?.pictureSrc}).join(", "),imgSrc:o().map(f=>e.defaultItems.find(g=>g.id===f)?.pictureSrc).filter(ue).join(",")}),d=f=>{n(e.defaultItems.filter(b=>b.title?.toLowerCase().includes((f??"").toLowerCase())||b.description?.toLowerCase().includes((f??"").toLowerCase())));};Ce(()=>{a()===e.defaultItems.filter(f=>ue(f.pictureSrc)).length&&e.onTransitionEnd();});let p=()=>{s(f=>f+1);};return (()=>{var f=W1(),b=f.firstChild;return f.addEventListener("submit",c),x(f,m(W,{get when(){return e.options?.isSearchable},get children(){var g=H1();return x(g,m(pn,{ref(y){var T=t;typeof T=="function"?T(y):t=y;},onInput:d,get placeholder(){return e.options?.searchInputPlaceholder??fa.searchInputPlaceholder},onClear:()=>n(e.defaultItems)})),g}}),b),x(b,m(ke,{get each(){return r()},children:(g,y)=>(()=>{var T=j1(),S=T.firstChild,E=S.nextSibling;return nt(T,"click",()=>l(g.id)),S.addEventListener("load",p),x(E,m(zo,{get isChecked(){return o().some(h=>h===g.id)},get class(){return "flex-shrink-0"+(g.title||g.description?" mt-1":void 0)}}),null),x(E,m(W,{get when(){return (g.title||g.description)&&e.options?.showTitle},get children(){var h=jx();return x(h,m(W,{get when(){return g.title},get children(){var C=Hx();return x(C,()=>g.title),C}}),null),x(h,m(W,{get when(){return g.description},get children(){var C=Wx();return x(C,()=>g.description),C}}),null),h}}),null),M(h=>{var C=o().some(k=>k===g.id),$="flex flex-col focus:outline-none cursor-pointer select-none agent-selectable-picture"+(o().some(k=>k===g.id)?" selected":"")+(or(g.pictureSrc)?" has-svg":""),H=g.id,N=g.pictureSrc,_=g.title??`Picture ${y()+1}`,A=`Picture choice ${y()+1}`,I="flex gap-3 py-2 flex-shrink-0"+(Ze(g.title)&&Ze(g.description)||!e.options?.showTitle?" justify-center":" px-3");return C!==h.e&&G(T,"aria-checked",h.e=C),$!==h.t&&U(T,h.t=$),H!==h.a&&G(T,"data-itemid",h.a=H),N!==h.o&&G(S,"src",h.o=N),_!==h.i&&G(S,"alt",h.i=_),A!==h.n&&G(S,"elementtiming",h.n=A),I!==h.s&&U(E,h.s=I),h},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),T})()}),null),x(b,m(ke,{get each(){return o().filter(g=>r().every(y=>y.id!==g)).map(g=>e.defaultItems.find(y=>y.id===g)).filter(ue)},children:(g,y)=>(()=>{var T=z1(),S=T.firstChild,E=S.nextSibling;return nt(T,"click",()=>l(g.id)),x(E,m(zo,{get isChecked(){return o().some(h=>h===g.id)},get class(){return "flex-shrink-0"+(g.title||g.description?" mt-1":void 0)}}),null),x(E,m(W,{get when(){return g.title||g.description},get children(){var h=jx();return x(h,m(W,{get when(){return g.title},get children(){var C=Hx();return x(C,()=>g.title),C}}),null),x(h,m(W,{get when(){return g.description},get children(){var C=Wx();return x(C,()=>g.description),C}}),null),h}}),null),M(h=>{var C=g.id,$=e.defaultItems.find(A=>A.id===g.id)?.pictureSrc,H=g.title??`Selected picture ${y()+1}`,N=`Selected picture choice ${y()+1}`,_="flex gap-3 py-2 flex-shrink-0"+(Ze(g.title)&&Ze(g.description)?" justify-center":" pl-4");return C!==h.e&&G(T,"data-itemid",h.e=C),$!==h.t&&G(S,"src",h.t=$),H!==h.a&&G(S,"alt",h.a=H),N!==h.o&&G(S,"elementtiming",h.o=N),_!==h.i&&U(E,h.i=_),h},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),T})()}),null),x(f,(()=>{var g=L(()=>o().length>0);return ()=>g()&&m(We,{disableIcon:true,get children(){return e.options?.buttonLabel??fa.buttonLabel}})})(),null),M(()=>U(b,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-[464px] rounded-md":""))),f})()};var G1=w('<div class="flex items-end agent-input w-full">'),q1=w('<div class="flex flex-col gap-2 w-full"><div>'),Y1=w("<button><img fetchpriority=high class=m-auto>"),K1=w("<div>"),X1=w("<span>"),Z1=w('<span class="text-sm mt-1 whitespace-pre-wrap text-left">'),Gx=e=>{let t,[r,n]=R(e.defaultItems),[o,i]=R(0);ie(()=>{!K()&&t&&t.focus({preventScroll:true});});let a=u=>{let c=r()[u];if(c)return e.onSubmit({type:"text",label:Re(c.title)?c.title:c.pictureSrc??c.id,value:c.id,imgSrc:c.pictureSrc})},s=u=>{n(e.defaultItems.filter(c=>c.title?.toLowerCase().includes((u??"").toLowerCase())||c.description?.toLowerCase().includes((u??"").toLowerCase())));};Ce(()=>{o()===e.defaultItems.filter(u=>ue(u.pictureSrc)).length&&e.onTransitionEnd();});let l=()=>{i(u=>u+1);};return (()=>{var u=q1(),c=u.firstChild;return x(u,m(W,{get when(){return e.options?.isSearchable},get children(){var d=G1();return x(d,m(pn,{ref(p){var f=t;typeof f=="function"?f(p):t=p;},onInput:s,get placeholder(){return e.options?.searchInputPlaceholder??""},onClear:()=>n(e.defaultItems)})),d}}),c),x(c,m(ke,{get each(){return r()},children:(d,p)=>(()=>{var f=Y1(),b=f.firstChild;return nt(f,"click",()=>a(p())),b.addEventListener("load",l),x(f,(()=>{var g=L(()=>!!((e.options?.showTitle??fa.showTitle)&&d.title&&d.title?.length>0||d.description&&d.description?.length>0));return ()=>g()&&(()=>{var y=K1();return x(y,(()=>{var T=L(()=>!!(d.title&&d.title?.length>0));return ()=>T()&&(()=>{var S=X1();return x(S,()=>d.title),S})()})(),null),x(y,(()=>{var T=L(()=>!!(d.description&&d.description?.length>0));return ()=>T()&&(()=>{var S=Z1();return x(S,()=>d.description),S})()})(),null),M(()=>U(y,"flex flex-col gap-1 py-2 flex-shrink-0 px-4 w-full"+(d.description?" items-start":""))),y})()})(),null),M(g=>{var y=d.id,T="flex flex-col agent-picture-button focus:outline-none filter hover:brightness-90 active:brightness-75 justify-between "+(or(d.pictureSrc)?"has-svg":""),S=d.pictureSrc,E=d.title??`Picture ${p()+1}`,h=`Picture choice ${p()+1}`;return y!==g.e&&G(f,"data-itemid",g.e=y),T!==g.t&&U(f,g.t=T),S!==g.a&&G(b,"src",g.a=S),E!==g.o&&G(b,"alt",g.o=E),h!==g.i&&G(b,"elementtiming",g.i=h),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),f})()})),M(()=>U(c,"gap-2 flex flex-wrap justify-end"+(e.options?.isSearchable?" overflow-y-scroll max-h-[464px] rounded-md":""))),u})()};var Kr={buttonType:"Numbers",length:10,labels:{button:Qe},startsAt:0};var Q1=w('<form class="flex flex-col gap-2"><div class="flex flex-wrap justify-center gap-2"></div><div class="flex justify-end">'),J1=w('<span class="text-sm w-full rating-label">'),eA=w('<span class="text-sm w-full text-right pr-2 rating-label">'),tA=w("<div role=checkbox>"),rA=w("<div>"),qx=e=>{let[t,r]=R(e.defaultValue?Number(e.defaultValue):void 0),n=i=>{i.preventDefault();let a=t();at(a)||e.onSubmit({type:"text",value:a.toString()});},o=i=>{e.block.options?.isOneClickSubmitEnabled&&e.onSubmit({type:"text",value:i.toString()}),r(i);};return (()=>{var i=Q1(),a=i.firstChild,s=a.nextSibling;return i.addEventListener("submit",n),x(i,(()=>{var l=L(()=>!!e.block.options?.labels?.left);return ()=>l()&&(()=>{var u=J1();return x(u,()=>e.block.options.labels.left),u})()})(),a),x(a,m(ke,{get each(){return Array.from(Array((e.block.options?.length??Kr.length)+((e.block.options?.buttonType??Kr.buttonType)==="Numbers"?-((e.block.options?.startsAt??Kr.startsAt)-1):0)))},children:(l,u)=>m(nA,be(()=>e.block.options,{get rating(){return t()},get idx(){return u()+((e.block.options?.buttonType??Kr.buttonType)==="Numbers"?e.block.options?.startsAt??Kr.startsAt:1)},onClick:o}))})),x(i,(()=>{var l=L(()=>!!e.block.options?.labels?.right);return ()=>l()&&(()=>{var u=eA();return x(u,()=>e.block.options.labels.right),u})()})(),s),x(s,(()=>{var l=L(()=>!!ue(t()));return ()=>l()&&m(We,{disableIcon:true,get children(){return e.block.options?.labels?.button??Kr.labels.button}})})()),i})()},nA=e=>{let t=r=>{r.preventDefault(),e.onClick(e.idx);};return m(Le,{get children(){return [m(X,{get when(){return (e.buttonType??Kr.buttonType)==="Numbers"},get children(){return [m(W,{get when(){return e.isOneClickSubmitEnabled},get children(){return m(pr,{"on:click":t,get children(){return e.idx}})}}),m(W,{get when(){return !e.isOneClickSubmitEnabled},get children(){var r=tA();return nt(r,"click",t),x(r,()=>e.idx),M(n=>{var o=ue(e.rating)&&e.idx<=e.rating,i="py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none agent-selectable"+(ue(e.rating)&&e.idx<=e.rating?" selected":"");return o!==n.e&&G(r,"aria-checked",n.e=o),i!==n.t&&U(r,n.t=i),n},{e:void 0,t:void 0}),r}})]}}),m(X,{get when(){return (e.buttonType??Kr.buttonType)!=="Numbers"},get children(){var r=rA();return nt(r,"click",()=>e.onClick(e.idx)),M(n=>{var o="flex justify-center items-center rating-icon-container cursor-pointer "+(ue(e.rating)&&e.idx<=e.rating?"selected":""),i=e.customIcon?.isEnabled&&!Ze(e.customIcon.svg)?e.customIcon.svg:oA;return o!==n.e&&U(r,n.e=o),i!==n.t&&(r.innerHTML=n.t=i),n},{e:void 0,t:void 0}),r}})]}})},oA='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>';var iA=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48">'),Eu=e=>(()=>{var t=iA();return Pe(t,e,true,true),t})();var aA=w('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><circle cx=10 cy=12 r=2></circle><path d="m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22">'),Yx=e=>(()=>{var t=aA();return Pe(t,e,true,true),t})();var sA=w("<input type=file id=document-upload multiple class=hidden>"),lA=w('<input type=file id=photos-upload accept="image/*, video/*"multiple class=hidden>'),cA=w('<label aria-label="Add attachments"for=document-upload>'),uA=w("<label> Document"),dA=w("<label> Photos & videos"),Kx=e=>[(()=>{var t=sA();return t.addEventListener("change",r=>{r.currentTarget.files&&e.onNewFiles(r.currentTarget.files);}),t})(),(()=>{var t=lA();return t.addEventListener("change",r=>{r.currentTarget.files&&e.onNewFiles(r.currentTarget.files);}),t})(),m(Le,{get children(){return [m(X,{get when(){return K()},get children(){var t=cA();return x(t,m(Eu,{class:"w-5"})),M(()=>U(t,ye("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class))),t}}),m(X,{when:true,get children(){return m(jr.Root,{get children(){return [m(jr.Trigger,{get class(){return ye("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class)},"aria-label":"Add attachments",get children(){return m(Eu,{class:"w-5"})}}),m(jr.Positioner,{get children(){return m(jr.Content,{class:"p-3 gap-2 focus:outline-none",get children(){return [m(jr.Item,{value:"document",asChild:t=>(()=>{var r=uA(),n=r.firstChild;return Pe(r,be(t,{for:"document-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),false,true),x(r,m(Zs,{class:"w-4"}),n),r})()}),m(jr.Item,{value:"photos",asChild:t=>(()=>{var r=dA(),n=r.firstChild;return Pe(r,be(t,{for:"photos-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),false,true),x(r,m(Yx,{class:"w-4"}),n),r})()})]}})}})]}})}})]}})];var fA=w('<svg viewBox="0 0 384 512"stroke=currentColor fill=currentColor><path d="M192 0C139 0 96 43 96 96l0 160c0 53 43 96 96 96s96-43 96-96l0-160c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c85.8-11.7 152-85.3 152-174.4l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40z">'),Xx=e=>(()=>{var t=fA();return Pe(t,e,true,true),t})();var pA=w('<textarea class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"rows=6 data-testid=textarea required>'),Zx=e=>{let[t,r]=Je(e,["ref","onInput"]);return (()=>{var n=pA();n.$$input=i=>t.onInput(i.currentTarget.value);var o=t.ref;return typeof o=="function"?me(o,n):t.ref=n,Pe(n,be({get autofocus(){return !K()}},r),false,false),n})()};Ne(["input"]);var Nv=Ma(Dv());var Jo={isRequired:true,labels:{placeholder:"Type your answer..."},attachments:{isEnabled:false}};var Mv=`
31
53
  const gainFactor = 3;
32
54
 
33
55
  class VolumeProcessor extends AudioWorkletProcessor {
@@ -52,34 +74,35 @@ class VolumeProcessor extends AudioWorkletProcessor {
52
74
 
53
75
  registerProcessor("volume-processor", VolumeProcessor);
54
76
 
55
- `;var GA=w('<div><button class="p-0.5 rounded-full"aria-label="Stop recording"></button><div class="relative flex w-full"><canvas class="w-full h-[56px]"></canvas><div class="absolute left-gradient w-2 left-0 h-[56px]"></div><div class="absolute right-gradient w-3 right-0 h-[56px]"></div></div><span class="time-container flex-none w-[35px] font-bold text-sm">'),io=3,ao=3,qA=60,YA=10,KA=5,XA=90,Tw=e=>{let[t,r]=M(0),n,o,i,a,s,l,c,u=[],d,f,p=0,g=mt(e.buttonsTheme?.backgroundColor??Fi).join(", "),h=()=>{if(!i||!n||!f)return;let S=performance.now(),C=S-f;f=S,i.clearRect(0,0,n.width,n.height),i.fillStyle=`rgba(${g}, 0.2)`;for(let k=0;k<(n.width+ao)/(io+ao);k++){let D=k*(io+ao)-p,U=n.height*(YA/100),N=(n.height-U)/2;i.beginPath(),i.roundRect(D,N,io,U,5),i.fill();}i.fillStyle=`rgba(${g}, 1)`;for(let k=0;k<u.length;k++){let D=n.width+(k+1)*(io+ao)-p,U=n.height*((u[k]??0)/100),N=(n.height-U)/2;i.beginPath(),i.roundRect(D,N,io,U,5),i.fill();}p+=qA*(C/1e3),o=requestAnimationFrame(h);},b=async()=>{n&&(c=await navigator.mediaDevices.getUserMedia({audio:true}),e.onRecordingConfirmed(c),i||(i=n.getContext("2d")??void 0),d=setInterval(()=>{r(S=>S+=1);},1e3),a=new AudioContext,s=await ZA(a),l=a.createMediaStreamSource(c),l.connect(s),s.connect(a.destination),s.port.onmessage=S=>{((n.width+ao)/(io+ao)+u.length)*(io+ao)<n.width+p&&u.push(Math.min(Math.max(S.data,KA),XA));},f=performance.now(),o=requestAnimationFrame(h));},y=()=>{i&&n&&i.clearRect(0,0,n.width,n.height),p=0,s?.disconnect(),s=void 0,l?.disconnect(),l=void 0,a?.close(),a=void 0,c?.getTracks().forEach(S=>S.stop()),c=void 0,u=[],clearTimeout(d),r(0),cancelAnimationFrame(o),e.onAbortRecording();};return Se(()=>{e.recordingStatus==="asking"?b():e.recordingStatus==="stopped"&&y();}),me(()=>{y();}),(()=>{var S=GA(),C=S.firstChild,k=C.nextSibling,D=k.firstChild,U=k.nextSibling;ot(C,"click",y),v(C,m(Ur,{class:"w-4"}));var N=n;return typeof N=="function"?be(N,D):n=D,v(U,()=>QA(t())),$(()=>j(S,xe("w-full gap-2 items-center transition-opacity px-2 agent-recorder",e.recordingStatus==="started"?"opacity-1 flex":"opacity-0 hidden"))),S})()},ZA=async e=>{let t=new Blob([ww],{type:"application/javascript"}),r=URL.createObjectURL(t);return await e.audioWorklet.addModule(r),new AudioWorkletNode(e,"volume-processor")},QA=e=>{let t=Math.floor(e/60),n=(e%60).toString().padStart(2,"0");return `${t}:${n}`};var JA=w('<div class="p-2 flex gap-2 border-gray-100 overflow-auto">'),eO=w("<div>"),tO=w("<div><div>"),rO=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),Cw=e=>{let[t,r]=M(e.defaultValue??""),[n,o]=M([]),[i,a]=M(void 0),[s,l]=M(false),[c,u]=M("stopped"),d,f,p=[],g=_=>r(_),h=()=>d?.value!==""&&d?.reportValidity(),b=async()=>{if(c()==="started"&&f){f.stop();return}let _=e.block.options?.isRequired??fi.isRequired;if(!_||h()){let T;n().length>0&&(a(void 0),T=(await ci({apiHost:e.context.apiHost??yt({ignoreChatApiUrl:true}),files:n().map(z=>({file:z,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:z.name}})),onUploadProgress:a}))?.map((z,ne)=>z?{...z,blobUrl:URL.createObjectURL(n()[ne])}:null).filter(pe));let O=d?.value??t();!_&&!O&&(O="** omited **"),e.onSubmit({type:"text",value:O,label:e.block.options?.labels?.button,isPassword:e.block.options?.isPassword,isRequired:_,attachments:T});}else d?.focus();},y=_=>{e.block.options?.isLong||_.key==="Enter"&&b();},S=_=>{e.block.options?.isLong&&_.key==="Enter"&&(_.metaKey||_.ctrlKey)&&b();};ce(()=>{!X()&&d&&d.focus({preventScroll:true}),window.addEventListener("message",C);}),me(()=>{window.removeEventListener("message",C);});let C=_=>{let{data:T}=_;T.isFromAgent&&T.command==="setInputValue"&&r(T.value);},k=_=>{_.preventDefault(),l(true);},D=()=>l(false),U=_=>{_.preventDefault(),_.stopPropagation(),_.dataTransfer?.files&&N(_.dataTransfer.files);},N=_=>{let T=Array.from(_).map(O=>kl({existingFiles:n(),newFile:O,params:{sizeLimit:Er("NEXT_PUBLIC_AGENT_FILE_UPLOAD_MAX_SIZE")},onError:({description:L,title:z})=>{Fr.create({description:L,title:z});}})).filter(pe);T.length!==0&&o(O=>[...T,...O]);},ie=_=>{o(T=>T.filter((O,L)=>L!==_));},I=()=>{u("asking");},A=_=>{let T,O=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"video/mp4";f=new MediaRecorder(_,{mimeType:O}),f.ondataavailable=L=>{L.data.size!==0&&p.push(L.data);},f.onstart=()=>{T=Date.now();},f.onstop=async()=>{if(c()!=="started"||p.length===0)return;let L=Date.now()-T,z=await(0, _w.fixWebmDuration)(new Blob(p,{type:O}),L),ne=new File([z],`rec-${e.block.id}-${Date.now()}.${O==="audio/webm"?"webm":"mp4"}`,{type:O});a(void 0);let K=(await ci({apiHost:e.context.apiHost??yt({ignoreChatApiUrl:true}),files:[{file:ne,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:ne.name}}],onUploadProgress:a})).filter(pe).map(Ie=>Ie.url);e.onSubmit({type:"recording",url:K[0],blobUrl:URL.createObjectURL(ne)});},f.start(),u("started");},R=()=>{f?.stop(),u("stopped"),f=void 0,p=[];},E=e.block.options?.isRequired??fi.isRequired;return (()=>{var _=tO(),T=_.firstChild;return _.addEventListener("dragleave",D),_.addEventListener("dragover",k),_.addEventListener("drop",U),_.$$keydown=y,v(T,m(Tw,{get recordingStatus(){return c()},get buttonsTheme(){return e.context.agent.theme.chat?.buttons},onRecordingConfirmed:A,onAbortRecording:R}),null),v(T,m(W,{get when(){return c()!=="started"},get children(){return [m(W,{get when(){return n().length},get children(){var O=JA();return O.style.setProperty("border-bottom-width","1px"),v(O,m(ke,{get each(){return n()},children:(L,z)=>m(Il,{file:L,get uploadProgressPercent(){return B(()=>!!i())()?B(()=>i()?.fileIndex===z())()?20:z()<(i()?.fileIndex??0)?100:0:void 0},onRemoveClick:()=>ie(z())})})),O}}),(()=>{var O=eO();return v(O,(()=>{var L=B(()=>!!e.block.options?.isLong);return ()=>L()?m(Bx,{ref(z){var ne=d;typeof ne=="function"?ne(z):d=z;},onInput:g,onKeyDown:S,get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??fi.labels.placeholder}}):m(dr,{ref(z){var ne=d;typeof ne=="function"?ne(z):d=z;},onInput:g,get value(){return t()},get type(){return e.block.options?.isPassword?"password":"text"},get placeholder(){return e.block.options?.labels?.placeholder??fi.labels.placeholder}})})(),null),v(O,!E&&rO(),null),v(O,m(W,{get when(){return (e.block.options?.attachments?.isEnabled??fi.attachments.isEnabled)&&e.block.options?.attachments?.saveVariableId},get children(){return m(Lx,{onNewFiles:N,get class(){return xe(e.block.options?.isLong?"ml-2":void 0)}})}}),null),$(()=>j(O,xe("flex justify-between px-2",e.block.options?.isLong?"items-end":"items-center"))),O})()]}}),null),v(_,m(He,{get children(){return [m(J,{get when(){return !t()&&c()!=="started"&&e.block.options?.audioClip?.isEnabled},get children(){return m(Tr,{class:"h-[56px] flex items-center","on:click":I,"aria-label":"Record voice",get children(){return m(Nx,{class:"flex w-6 h-6"})}})}}),m(J,{when:true,get children(){return m(Xe,{type:"button","on:click":b,get isDisabled(){return !!i()},class:"h-[56px]",get children(){return e.block.options?.labels?.button}})}})]}}),null),$(O=>{var L=xe("agent-input-form flex w-full gap-2 items-end",e.block.options?.isLong&&c()!=="started"?"max-w-full":"max-w-[350px]"),z=xe("relative agent-input flex-col w-full",s()&&"filter brightness-95");return L!==O.e&&j(_,O.e=L),z!==O.t&&j(T,O.t=z),O},{e:void 0,t:void 0}),_})()};Ge(["keydown"]);var Jl={labels:{placeholder:"Type a URL..."},isRequired:true};var nO=w('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex relative agent-input w-full">'),oO=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),Sw=e=>{let[t,r]=M(e.defaultValue??""),n,o=u=>{r(u);},i=()=>n?.value!==""&&n?.reportValidity(),a=()=>{let u=e.block.options?.isRequired??Jl.isRequired,d=n?.value??t();d.length>0&&n&&d.startsWith("http")&&(n.value=`https://${n.value}`),!u&&!d&&(d="** omited **"),!u||i()?e.onSubmit({type:"text",value:d,isRequired:u}):n?.focus();},s=u=>{u.key==="Enter"&&a();};ce(()=>{!X()&&n&&n.focus({preventScroll:true}),window.addEventListener("message",l);}),me(()=>{window.removeEventListener("message",l);});let l=u=>{let{data:d}=u;d.isFromAgent&&d.command==="setInputValue"&&r(d.value);},c=e?.block.options?.isRequired??Jl.isRequired;return (()=>{var u=nO(),d=u.firstChild;return u.$$keydown=s,v(d,m(dr,{ref(f){var p=n;typeof p=="function"?p(f):n=f;},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??Jl.labels.placeholder},onInput:o,type:"url",autocomplete:"url"}),null),v(d,!c&&oO(),null),v(u,m(Xe,{type:"button",class:"h-[56px]","on:click":a,get children(){return e.block.options?.labels?.button}}),null),u})()};Ge(["keydown"]);var Sn={labels:{placeholder:"Start typing to search..."},isRequired:true,minSearchLength:2,restrictToList:false};var Ha=new Map,kw=2*60*1e3,Cd=class{baseUrl;sessionId;blockId;debounceTimeouts=new Map;constructor(){this.baseUrl="",this.sessionId="",this.blockId="";}setApiData(t,r,n){this.baseUrl=t,this.sessionId=r||"",this.blockId=n||"";}debounce(t,r,n){return (...o)=>new Promise((i,a)=>{this.debounceTimeouts.has(n)&&clearTimeout(this.debounceTimeouts.get(n));let s=window.setTimeout(async()=>{try{let l=await t(...o);i(l);}catch(l){a(l);}this.debounceTimeouts.delete(n);},r);this.debounceTimeouts.set(n,s);})}async getSuggestions(t){if(!this.baseUrl||!this.sessionId||!this.blockId)throw new Error("API client not properly initialized");this.cleanExpiredCache();let r=`${this.blockId}-${t.toLowerCase()}`,n=Ha.get(r);if(n){if(Date.now()-n.timestamp<kw)return n.data;Ha.delete(r);}try{let o=new URL("/api/integrations/autocomplete",this.baseUrl);o.searchParams.set("q",t),o.searchParams.set("sessionId",this.sessionId),o.searchParams.set("blockId",this.blockId);let i=await fetch(o.toString(),{method:"GET",headers:{"Content-Type":"application/json"}});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);let a=await i.json();return Ha.set(r,{data:a,timestamp:Date.now()}),a}catch(o){throw o}}cleanExpiredCache(){let t=Date.now();for(let[r,{timestamp:n}]of Ha.entries())t-n>=kw&&Ha.delete(r);}cleanup(){for(let t of this.debounceTimeouts.values())clearTimeout(t);this.debounceTimeouts.clear();}},Wa=new Cd;var iO=w('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px] relative"><div class="flex agent-input w-full relative">'),aO=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),sO=w('<div class="absolute agent-input top-full left-0 mt-2 right-0 rounded-md shadow-lg z-50 max-h-60 overflow-y-auto scrollable-container">'),lO=w('<div><div class="flex gap-3 items-center"><div class="flex-shrink-0 opacity-50 mt-0.5"><svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=text-gray-400><line x1=8 y1=6 x2=21 y2=6></line><line x1=8 y1=12 x2=21 y2=12></line><line x1=8 y1=18 x2=21 y2=18></line><line x1=3 y1=6 x2=3.01 y2=6></line><line x1=3 y1=12 x2=3.01 y2=12></line><line x1=3 y1=18 x2=3.01 y2=18></line></svg></div><div class="flex-1 min-w-0"><div class="font-medium text-sm">'),cO=w('<div class="absolute right-3 top-1/2 transform -translate-y-1/2"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-current">'),uO=w('<div class="absolute right-3 top-1/2 transform -translate-y-1/2 text-yellow-500">\u26A0\uFE0F'),Pw=e=>{let[t,r]=M(e.defaultValue??""),[n,o]=M(false),[i,a]=M(null),[s,l]=M([]),[c,u]=M(-1),d,f,p=Wa.debounce(async I=>{let A=e.block.options?.minSearchLength??Sn.minSearchLength;if(I.length<A){l([]);return}o(true),a(null);try{let R=await Wa.getSuggestions(I);R.status==="OK"?(l(R.suggestions),setTimeout(()=>{d&&document.activeElement!==d&&d.focus({preventScroll:!0});},0)):R.status==="ZERO_RESULTS"?l([]):(a("Error fetching suggestions"),l([]));}catch(R){let E=R instanceof Error?R.message:"Unknown error";a(E),l([]);}finally{o(false);}},300,"autocomplete-suggestions"),g=I=>{r(I),u(-1),d&&(d.removeAttribute("data-selected-key"),d.removeAttribute("data-selected-value"));let A=e.block.options?.minSearchLength??Sn.minSearchLength;I.trim().length>=A?p(I.trim()):l([]),d&&document.activeElement!==d&&setTimeout(()=>{d?.focus({preventScroll:true});},0);},h=()=>{let I=d?.value||t(),A=e.block.options?.minSearchLength??Sn.minSearchLength;I.trim().length>=A&&p(I.trim());},b=I=>{let A=I.value;r(A),d&&(d.value=A,d.setAttribute("data-selected-key",I.key),d.setAttribute("data-selected-value",I.value)),l([]),u(-1),d&&d.focus();},y=I=>{if(!f)return;let A=f.children[I];A&&A.scrollIntoView({behavior:"smooth",block:"nearest"});},S=I=>{if(s().length===0){I.key==="Enter"&&D();return}switch(I.key){case "ArrowDown":I.preventDefault(),u(R=>{let E=R<s().length-1?R+1:0;return setTimeout(()=>y(E),0),E});break;case "ArrowUp":I.preventDefault(),u(R=>{let E=R>0?R-1:s().length-1;return setTimeout(()=>y(E),0),E});break;case "Enter":I.preventDefault();let A=c();A>=0&&A<s().length?b(s()[A]):D();break;case "Escape":I.preventDefault(),l([]),u(-1);break}},C=I=>{let A=I.target;d&&f&&!d.contains(A)&&!f.contains(A)&&setTimeout(()=>{document.activeElement!==d&&l([]);},100);},k=()=>d?.value!==""&&d?.reportValidity(),D=()=>{let I=e.block.options?.isRequired??Sn.isRequired,A=e.block.options?.restrictToList??Sn.restrictToList,R=d?.value??t();!I&&!R&&(R="** omited **");let E=d?.getAttribute("data-selected-key"),_=d?.getAttribute("data-selected-value");if(A&&R!=="** omited **"&&(!E||!_)){d?.focus();return}E&&_&&(R=JSON.stringify({key:E,value:_})),!I||k()?e.onSubmit({type:"text",value:R,isRequired:I}):d?.focus();};ce(()=>{let I=e.context?.apiHost??yt({ignoreChatApiUrl:true}),A=e.context?.sessionId;Wa.setApiData(I,A,e.block.id),window.addEventListener("message",U),document.addEventListener("click",C),!X()&&d&&setTimeout(()=>{d?.focus({preventScroll:true});},100);}),me(()=>{window.removeEventListener("message",U),document.removeEventListener("click",C),Wa.cleanup();});let U=I=>{let{data:A}=I;A.isFromAgent&&A.command==="setInputValue"&&r(A.value);},N=e.block.options?.isRequired??Sn.isRequired,ie=()=>n()?"Loading suggestions...":i()?"Enter text (suggestions unavailable)":e.block.options?.labels?.placeholder??Sn.labels.placeholder;return (()=>{var I=iO(),A=I.firstChild;return v(A,m(dr,{ref(R){var E=d;typeof E=="function"?E(R):d=R;},get value(){return t()},get placeholder(){return ie()},onInput:g,onFocus:h,onKeyDown:S,type:"text",get autocomplete(){return s().length<1?"off":"list"}}),null),v(A,!N&&aO(),null),v(A,(()=>{var R=B(()=>s().length>0);return ()=>R()&&(()=>{var E=sO();E.$$mousedown=T=>{T.preventDefault();};var _=f;return typeof _=="function"?be(_,E):f=E,v(E,()=>s().map((T,O)=>(()=>{var L=lO(),z=L.firstChild,ne=z.firstChild,K=ne.nextSibling,Ie=K.firstChild;return L.addEventListener("mouseenter",()=>u(O)),L.$$mousedown=Ce=>{Ce.preventDefault();},L.$$click=()=>b(T),v(Ie,()=>T.value),$(()=>j(L,`px-4 py-3 agent-input-suggest cursor-pointer border-b last:border-b-0
56
- ${c()===O,""}`)),L})())),E})()})(),null),v(A,(()=>{var R=B(()=>!!n());return ()=>R()&&cO()})(),null),v(A,(()=>{var R=B(()=>!!(i()&&!n()));return ()=>R()&&(()=>{var E=uO();return $(()=>G(E,"title",`Autocomplete API error: ${i()}`)),E})()})(),null),v(I,m(Xe,{type:"button",class:"h-[56px]","on:click":D,get children(){return e.block.options?.labels?.button}}),null),I})()};Ge(["mousedown","click"]);var Ew=e=>m(_n.Root,{get open(){return e.isOpen},lazyMount:true,unmountOnExit:true,onOpenChange:t=>t.open?void 0:e.onClose?.(),get children(){return [m(_n.Backdrop,{class:"fixed inset-0 bg-[rgba(0,0,0,0.5)] h-screen z-50"}),m(_n.Positioner,{class:"fixed inset-0 z-50 flex items-center justify-center px-2",get children(){return [m(_n.Content,{get children(){return e.children}}),m(_n.CloseTrigger,{class:"fixed top-2 right-2 z-50 rounded-md bg-white p-2 text-black",get children(){return m(Ur,{class:"w-6 h-6"})}})]}})]}});var dO=w('<svg viewBox="0 0 80 80"><g transform=translate(15,15)><g stroke=none stroke-width=1 fill=none fill-rule=evenodd><g transform="translate(1.000000, 1.000000)"stroke=currentColor stroke-width=2><path d="M23,5.0109 L23,2.5 C23,1.1193 24.1193,0 25.5,0 C26.8807,0 28,1.1193 28,2.5 L28,5"stroke-linecap=round stroke-linejoin=round></path><path d="M36.4505,45 L13.5495,45 C8.8473,45 5,41.1527 5,36.4505 L5,13.5495 C5,8.8473 8.8473,5 13.5495,5 L36.4505,5 C41.1527,5 45,8.8473 45,13.5495 L45,36.4505 C45,41.1527 41.1527,45 36.4505,45 Z"stroke-linecap=round stroke-linejoin=round></path><circle stroke-linecap=round stroke-linejoin=round cx=33.8346 cy=18.0022 r=2.8338></circle><circle stroke-linecap=round stroke-linejoin=round cx=16.3342 cy=18.0017 r=2.8338></circle><path d="M33.5,36.5 L16.5,36.5 C14.3,36.5 12.5,34.7 12.5,32.5 C12.5,30.3 14.3,28.5 16.5,28.5 L33.5,28.5 C35.7,28.5 37.5,30.3 37.5,32.5 C37.5,34.7 35.7,36.5 33.5,36.5 Z"></path><g stroke-linecap=round stroke-linejoin=round transform="translate(0.000000, 17.000000)"><path d="M2.5,13 C1.1193,13 0,11.8807 0,10.5 L0,2.5 C0,1.1193 1.1193,0 2.5,0 C3.8807,0 5,1.1193 5,2.5 L5,10.5 C5,11.8807 3.8807,13 2.5,13 Z"></path><path d="M47.5,13 C48.8807,13 50,11.8807 50,10.5 L50,2.5 C50,1.1193 48.8807,0 47.5,0 C46.1193,0 45,1.1193 45,2.5 L45,10.5 C45,11.8807 46.1193,13 47.5,13 Z"></path><line x1=17 y1=12 x2=17 y2=19></line><line x1=22 y1=12 x2=22 y2=19></line><line x1=27 y1=12 x2=27 y2=19></line><line x1=32 y1=12 x2=32 y2=19>'),Iw=({strokeColor:e})=>(()=>{var t=dO();return e!=null?t.style.setProperty("color",e):t.style.removeProperty("color"),$(()=>G(t,"class",X()?"size-6":"size-10")),t})();var fO=w('<svg viewBox="0 0 80 80"><g transform=translate(15,15)><g stroke=none stroke-width=1 fill=none fill-rule=evenodd><g transform="translate(1.000000, 1.000000)"><circle id=Oval stroke=currentColor stroke-width=2 cx=25 cy=25 r=25></circle><path d="M14.9350649,32.4675325 C16.9120779,35.9554545 20.6786364,38.3116883 25,38.3116883 C29.3213636,38.3116883 33.0879221,35.9554545 35.0649351,32.4675325"id=Path stroke=currentColor stroke-width=3 stroke-linecap=round></path><circle fill=currentColor fill-rule=nonzero cx=15.2597403 cy=16.5584416 r=2.92207792></circle><circle fill=currentColor fill-rule=nonzero cx=34.0909091 cy=16.5584416 r=2.92207792>'),Aw=({strokeColor:e})=>(()=>{var t=fO();return e!=null?t.style.setProperty("color",e):t.style.removeProperty("color"),$(()=>G(t,"class",X()?"size-6":"size-10")),t})();var pO=w('<span class="text-4xl text-[40px]">'),mO=w('<img alt="Bot avatar"elementtiming="Bot avatar">'),gO=w('<figure><img alt="Bot avatar"class="rounded-full object-cover w-full h-full"elementtiming="Bot avatar"fetchpriority=high>'),hO=w('<div class="absolute left-[-4px] top-1/2 -translate-y-1/2 w-0 h-0">'),bO=w('<div class="absolute right-[-4px] top-1/2 -translate-y-1/2 w-0 h-0">'),yO=w("<div>"),ec=e=>m(W,{get when(){return Ne(e.src)},keyed:true,get fallback(){return (()=>{var t=yO();return v(t,m(W,{get when(){return e.isGuest},get children(){return [m(Aw,{get strokeColor(){return e.theme.chat?.hostBubbles?.color??Ui}}),(()=>{var r=hO();return r.style.setProperty("border-top","5px solid transparent"),r.style.setProperty("border-bottom","5px solid transparent"),$(n=>(n=`5px solid ${e.theme.chat?.hostBubbles?.backgroundColor??Bo}`)!=null?r.style.setProperty("border-right",n):r.style.removeProperty("border-right")),r})()]}}),null),v(t,m(W,{get when(){return !e.isGuest},get children(){return [m(Iw,{get strokeColor(){return e.theme.chat?.hostBubbles?.color??Ui}}),(()=>{var r=bO();return r.style.setProperty("border-top","5px solid transparent"),r.style.setProperty("border-bottom","5px solid transparent"),$(n=>(n=`5px solid ${e.theme.chat?.hostBubbles?.backgroundColor??Bo}`)!=null?r.style.setProperty("border-left",n):r.style.removeProperty("border-left")),r})()]}}),null),$(r=>{var n=`relative flex justify-center items-center rounded-full ${X()?"w-6 h-6":"w-10 h-10"}
57
- `,o=e.theme.chat?.hostBubbles?.backgroundColor??Bo;return n!==r.e&&j(t,r.e=n),o!==r.t&&((r.t=o)!=null?t.style.setProperty("background",o):t.style.removeProperty("background")),r},{e:void 0,t:void 0}),t})()},get children(){return m(He,{get children(){return [m(J,{get when(){return vO(e.src??"")},get children(){var t=pO();return v(t,()=>e.src),t}}),m(J,{get when(){return pr(e.src)},get children(){var t=mO();return $(r=>{var n=e.src,o="flex justify-center items-center relative animate-fade-in flex-shrink-0 "+(X()?"w-6 h-6 text-sm":"w-10 h-10 text-xl");return n!==r.e&&G(t,"src",r.e=n),o!==r.t&&j(t,r.t=o),r},{e:void 0,t:void 0}),t}}),m(J,{when:true,get children(){var t=gO(),r=t.firstChild;return $(n=>{var o="flex justify-center items-center rounded-full text-white relative animate-fade-in flex-shrink-0 "+(X()?"w-6 h-6 text-sm":"w-10 h-10 text-xl"),i=e.src;return o!==n.e&&j(t,n.e=o),i!==n.t&&G(r,"src",n.t=i),n},{e:void 0,t:void 0}),t}})]}})}}),vO=e=>/^\p{Emoji}$/u.test(e);function Sr(...e){return rp(xe(e))}var wO=w('<div class="flex justify-end items-end animate-fade-in gap-2 guest-container">'),TO=w('<div class="flex flex-row flex-wrap justify-end items-center gap-2">'),Ow=w("<div>"),_O=w("<span>"),CO=w("<img alt=Attachment>"),SO=w('<div class="flex flex-col gap-1 items-end"><div data-testid=guest-bubble>'),kO=w('<img alt=image class="w-[120px] h-[120px] object-cover rounded-lg">'),PO=w("<img>"),EO=w('<div class="flex flex-col gap-1 items-end"><div class="p-2 w-full whitespace-pre-wrap agent-guest-bubble flex flex-col"data-testid=guest-bubble><audio controls>'),Rw=e=>(()=>{var t=wO();return v(t,m(He,{get children(){return [m(J,{get when(){return e.answer?.type==="text"},get children(){return m(IO,{get blockType(){return e.blockType},get answer(){return e.answer}})}}),m(J,{get when(){return e.answer?.type==="recording"},get children(){return m(AO,{get answer(){return e.answer}})}})]}}),null),v(t,m(W,{get when(){return e.showAvatar},get children(){return m(ec,{isGuest:true,get theme(){return e.theme},get src(){return e.avatarSrc}})}}),null),$(r=>(r=e.hasHostAvatar?X()?"28px":"50px":void 0)!=null?t.style.setProperty("margin-left",r):t.style.removeProperty("margin-left")),t})(),IO=e=>{let[t,r]=M();return (()=>{var n=SO(),o=n.firstChild;return v(n,m(W,{get when(){return (e.answer.imgSrc??"").length>0},get children(){var i=TO();return v(i,()=>e.answer.imgSrc?.split(",").map(a=>(()=>{var s=kO();return G(s,"src",a),s})())),i}}),o),v(n,m(W,{get when(){return (e.answer.attachments??[]).length>0},get children(){return [(()=>{var i=Ow();return v(i,m(ke,{get each(){return e.answer.attachments?.filter(a=>a.type.startsWith("image"))},children:(a,s)=>(()=>{var l=PO();return l.$$click=()=>r(a.blobUrl??a.url),$(c=>{var u=a.blobUrl??a.url,d=`Attached image ${s()+1}`,f=xe("agent-guest-bubble-image-attachment cursor-pointer",e.answer.attachments.filter(p=>p.type.startsWith("image")).length>1&&"max-w-[90%]");return u!==c.e&&G(l,"src",c.e=u),d!==c.t&&G(l,"alt",c.t=d),f!==c.a&&j(l,c.a=f),c},{e:void 0,t:void 0,a:void 0}),l})()})),$(()=>j(i,xe("flex gap-1 overflow-auto max-w-[350px]",X()?"flex-wrap justify-end":"items-center"))),i})(),(()=>{var i=Ow();return v(i,m(ke,{get each(){return e.answer.attachments?.filter(a=>!a.type.startsWith("image"))},children:a=>m(El,{get file(){return {name:a.url.split("/").at(-1)}}})})),$(()=>j(i,xe("flex gap-1 overflow-auto max-w-[350px]",X()?"flex-wrap justify-end":"items-center"))),i})()]}}),o),v(o,m(W,{get when(){return Ne(e.answer.label??e.answer.value)&&!e.answer.imgSrc},get children(){var i=_O();return v(i,(()=>{var a=B(()=>!!e.answer.isPassword);return ()=>a()?"*".repeat(e.answer.value.length):(()=>{switch(e.blockType){case "image choice":return;case "file input":return e.answer.label??e.answer.value;case "autocomplete input":let s;try{if(s=JSON.parse(e.answer.value),s&&typeof s=="object"&&s.key&&s.value)return s.value}catch{}return e.answer.label??e.answer.value;case "choice input":return e.answer.label??e.answer.value;default:return !e.answer.isRequired&&e.answer.value==="** omited **"?"* No value provided":e.answer.value??e.answer.label}})()})()),$(()=>j(i,Sr(!e.answer.isRequired&&e.answer.value==="** omited **"?"px-[12px] py-[4px] text-xs":"px-[15px] py-[7px]"))),i}})),v(n,m(Ew,{get isOpen(){return t()!==void 0},onClose:()=>r(void 0),get children(){var i=CO();return i.style.setProperty("border-radius","6px"),$(()=>G(i,"src",t())),i}}),null),$(()=>j(o,Sr("p-[1px] whitespace-pre-wrap max-w-full agent-guest-bubble flex flex-col",!e.answer.isRequired&&e.answer.value==="** omited **"?"opacity-60 italic px-0":""))),n})()},AO=e=>(()=>{var t=EO(),r=t.firstChild,n=r.firstChild;return $(()=>G(n,"src",e.answer.blobUrl??e.answer.url)),t})();Ge(["click"]);var Va={labels:{placeholder:"Type your address..."},isRequired:true,restrictToList:true};var Dw=new Map,OO=5*60*1e3,Sd=class{baseUrl;sessionId;blockId;debounceTimeouts=new Map;constructor(t="/api/integrations",r="",n=""){this.baseUrl=t,this.sessionId=r,this.blockId=n;}setApiData(t,r,n){this.apiHost=t?.replace(/\/$/,""),this.sessionId=r,this.blockId=n;}apiHost="";async getSuggestions(t,r=5){if(!t.trim())return {suggestions:[],status:"ZERO_RESULTS"};let n=`${t}-${r}`,o=Dw.get(n);if(o&&Date.now()-o.timestamp<OO)return o.data;try{let i=this.apiHost||window.location.origin,a=new URL(`${this.baseUrl}/geoloc`,i);a.searchParams.set("q",t),a.searchParams.set("limit",r.toString()),a.searchParams.set("sessionId",this.sessionId),a.searchParams.set("blockId",this.blockId);let s=await fetch(a.toString());if(s.status===403)return {suggestions:[],status:"API_KEY_INVALID"};if(!s.ok)throw new Error(`API error: ${s.status}`);let l=await s.json();return Dw.set(n,{data:l,timestamp:Date.now()}),l}catch{return {suggestions:[],status:"ERROR"}}}async getPlaceDetails(t){try{let r=this.apiHost||window.location.origin,n=new URL(`${this.baseUrl}/place-details`,r);n.searchParams.set("place_id",t);let o=await fetch(n.toString());if(!o.ok)throw new Error(`API error: ${o.status}`);return await o.json()}catch{return {place:null,status:"ERROR"}}}debounce(t,r,n){return (...o)=>{let i=this.debounceTimeouts.get(n);i&&clearTimeout(i);let a=window.setTimeout(()=>{t(...o),this.debounceTimeouts.delete(n);},r);this.debounceTimeouts.set(n,a);}}cleanup(){this.debounceTimeouts.forEach(t=>clearTimeout(t)),this.debounceTimeouts.clear();}},za=new Sd;var RO=w('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px] relative"><div class="flex agent-input w-full relative">'),DO=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),MO=w('<div class="absolute agent-input top-full left-0 mt-2 right-0 border-gray-300 rounded-md shadow-lg z-50 max-h-60 overflow-y-auto scrollable-container">'),$O=w('<div><div class="flex gap-3 items-center"><div class="flex-shrink-0 opacity-50 mt-0.5"><svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=text-gray-400><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx=12 cy=10 r=3></circle></svg></div><div class="flex-1 min-w-0"><div class="font-medium text-sm">'),LO=w('<div class="text-xs opacity-70 mt-1">'),NO=w('<div class="absolute right-3 top-1/2 transform -translate-y-1/2"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-current">'),BO=w('<div class="absolute right-3 top-1/2 transform -translate-y-1/2 text-yellow-500">\u26A0\uFE0F'),Mw=e=>{let[t,r]=M(e.defaultValue??""),[n,o]=M(false),[i,a]=M(null),[s,l]=M([]),[c,u]=M(-1),d,f,p=e.block.options?.restrictToList??Va.restrictToList,g=za.debounce(async I=>{if(I.length<2){l([]);return}o(true),a(null);try{let A=await za.getSuggestions(I);A.status==="OK"?(l(A.suggestions),setTimeout(()=>{d&&document.activeElement!==d&&d.focus({preventScroll:!0});},0)):A.status==="API_KEY_INVALID"?Fr.create({title:"Invalid Google API key",description:"Make sure the API key is valid and properly configured."}):A.status==="ZERO_RESULTS"?l([]):(a("Error fetching suggestions"),l([]));}catch(A){let R=A instanceof Error?A.message:"Unknown error";a(R),l([]);}finally{o(false);}},300,"address-suggestions"),h=I=>{r(I),u(-1),d&&d.removeAttribute("data-selected-description"),I.trim().length>=2?g(I.trim()):l([]),d&&document.activeElement!==d&&setTimeout(()=>{d?.focus({preventScroll:true});},0);},b=()=>{let I=d?.value||t();I.trim().length>=3&&g(I.trim());},y=I=>{let A=I.description;r(A),d&&(d.value=A,d.setAttribute("data-selected-description",I.description)),l([]),u(-1),d&&d.focus();},S=I=>{if(!f)return;let A=f.children[I];A&&A.scrollIntoView({behavior:"smooth",block:"nearest"});},C=I=>{if(s().length===0){I.key==="Enter"&&U();return}switch(I.key){case "ArrowDown":I.preventDefault(),u(R=>{let E=R<s().length-1?R+1:0;return setTimeout(()=>S(E),0),E});break;case "ArrowUp":I.preventDefault(),u(R=>{let E=R>0?R-1:s().length-1;return setTimeout(()=>S(E),0),E});break;case "Enter":I.preventDefault();let A=c();A>=0&&A<s().length?y(s()[A]):U();break;case "Escape":I.preventDefault(),l([]),u(-1);break}},k=I=>{let A=I.target;d&&f&&!d.contains(A)&&!f.contains(A)&&setTimeout(()=>{document.activeElement!==d&&l([]);},100);},D=()=>d?.value!==""&&d?.reportValidity(),U=()=>{let I=e.block.options?.isRequired??Va.isRequired,A=d?.value??t();!I&&!A&&(A="** omited **");let R=d?.getAttribute("data-selected-description");if(p&&A!=="** omited **"&&!R){d?.focus();return}R&&(A=R),!I||D()?e.onSubmit({type:"text",value:A,isRequired:I}):d?.focus();};ce(()=>{let I=e.context?.apiHost??yt({ignoreChatApiUrl:true}),A=e.context?.sessionId;za.setApiData(I,A,e.block.id),window.addEventListener("message",N),document.addEventListener("click",k),!X()&&d&&setTimeout(()=>{d?.focus({preventScroll:true});},100);}),me(()=>{window.removeEventListener("message",N),document.removeEventListener("click",k),za.cleanup();});let N=I=>{let{data:A}=I;A.isFromAgent&&A.command==="setInputValue"&&r(A.value);},ie=e.block.options?.isRequired??Va.isRequired;return (()=>{var I=RO(),A=I.firstChild;return v(A,m(dr,{ref(R){var E=d;typeof E=="function"?E(R):d=R;},get value(){return t()},get placeholder(){return B(()=>!!n())()?"Loading address suggestions...":i()?"Enter address (suggestions unavailable)":e.block.options?.labels?.placeholder??Va.labels.placeholder},onInput:h,onFocus:b,onKeyDown:C,type:"text",get autocomplete(){return s().length<1?"off":"address-line1"}}),null),v(A,!ie&&DO(),null),v(A,(()=>{var R=B(()=>s().length>0);return ()=>R()&&(()=>{var E=MO();E.$$mousedown=T=>{T.preventDefault();};var _=f;return typeof _=="function"?be(_,E):f=E,v(E,()=>s().map((T,O)=>(()=>{var L=$O(),z=L.firstChild,ne=z.firstChild,K=ne.nextSibling,Ie=K.firstChild;return L.addEventListener("mouseenter",()=>u(O)),L.$$mousedown=Ce=>{Ce.preventDefault();},L.$$click=()=>y(T),v(Ie,()=>T.structured_formatting.main_text),v(K,(()=>{var Ce=B(()=>!!T.structured_formatting.secondary_text);return ()=>Ce()&&(()=>{var nt=LO();return v(nt,()=>T.structured_formatting.secondary_text),nt})()})(),null),$(()=>j(L,`px-4 py-3 agent-input-suggest cursor-pointer border-b last:border-b-0 ${c()===O?"bg-blue-50 dark:bg-blue-900/20":"hover:bg-gray-50 dark:hover:bg-gray-800"}`)),L})())),E})()})(),null),v(A,(()=>{var R=B(()=>!!n());return ()=>R()&&NO()})(),null),v(A,(()=>{var R=B(()=>!!(i()&&!n()));return ()=>R()&&(()=>{var E=BO();return $(()=>G(E,"title",`Address API error: ${i()}`)),E})()})(),null),v(I,m(Xe,{type:"button",class:"h-[56px]","on:click":U,get children(){return e.block.options?.labels?.button}}),null),I})()};Ge(["mousedown","click"]);var FO=w("<div>"),UO=w('<div class="flex justify-end animate-fade-in gap-2 agent-input-container">'),$w=e=>{let[t,r]=Ar(M(),{key:`agent-${e.context.agent.id}-input-${e.chunkIndex}`,storage:e.context.storage});ce(()=>{e.isOngoingLastChunk&&pe(t())&&e.onSubmit(t());});let n=async i=>{r(i),e.onSubmit(i);},o=i=>{r({type:"text",value:i}),e.onSkip();};return Se(()=>{let i=ml().findLast(a=>e.chunkIndex===a.inputIndex)?.formattedMessage;i&&e.block.type!=="file input"&&r(a=>a?.type==="text"?{...a,label:i}:a);}),m(He,{get children(){return [m(J,{get when(){return t()&&!e.hasError},get children(){return m(Rw,{get theme(){return e.theme},get answer(){return t()},get blockType(){return e.block.type},get showAvatar(){return e.guestAvatar?.isEnabled??ji},get avatarSrc(){return e.guestAvatar?.url&&e.guestAvatar.url},get hasHostAvatar(){return e.hasHostAvatar}})}}),m(J,{get when(){return ut(t())||e.hasError},get children(){var i=UO(),a=e.ref;return typeof a=="function"?be(a,i):e.ref=i,v(i,m(W,{get when(){return e.hasHostAvatar},get children(){var s=FO();return $(()=>j(s,"flex flex-shrink-0 items-center "+(X()?"w-6 h-6":"w-10 h-10"))),s}}),null),v(i,m(HO,{get context(){return e.context},get block(){return e.block},get chunkIndex(){return e.chunkIndex},get isInputPrefillEnabled(){return e.isInputPrefillEnabled},get existingAnswer(){return B(()=>!!e.hasError)()?jO(t()):void 0},get onTransitionEnd(){return e.onTransitionEnd},onSubmit:n,onSkip:o}),null),$(()=>G(i,"data-blockid",e.block.id)),i}})]}})},jO=e=>{if(e)return e.type==="text"?e.value:e.url},HO=e=>{let t=o=>e.onSubmit(o),r=()=>e.existingAnswer??(e.isInputPrefillEnabled?e.block.prefilledValue:void 0),n=()=>e.onSubmit({type:"text",value:e.block.options?.labels?.success??Ml.labels.success});return m(He,{get children(){return [m(J,{get when(){return e.block.type==="text input"},get children(){return m(Cw,{get block(){return e.block},get defaultValue(){return r()},get context(){return e.context},onSubmit:t})}}),m(J,{get when(){return e.block.type==="number input"},get children(){return m(bx,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(J,{get when(){return e.block.type==="email input"},get children(){return m(px,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(J,{get when(){return e.block.type==="autocomplete input"},get children(){return m(Pw,{get context(){return e.context},get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(J,{get when(){return e.block.type==="address input"},get children(){return m(Mw,{get context(){return e.context},get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(J,{get when(){return e.block.type==="url input"},get children(){return m(Sw,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(J,{get when(){return e.block.type==="phone number input"},get children(){return m(Ex,{get isRequired(){return e.block.options?.isRequired},get labels(){return e.block.options?.labels},get defaultCountryCode(){return e.block.options?.defaultCountryCode},get defaultValue(){return r()},onSubmit:t})}}),m(J,{get when(){return e.block.type==="date input"},get children(){return m(fx,{get options(){return e.block.options},get defaultValue(){return r()},onSubmit:t})}}),m(J,{get when(){return WO(e.block)},keyed:true,children:o=>m(He,{get children(){return [m(J,{get when(){return !o.options?.isMultipleChoice},get children(){return m(sv,{get chunkIndex(){return e.chunkIndex},get defaultItems(){return o.items},get options(){return o.options},onSubmit:t})}}),m(J,{get when(){return o.options?.isMultipleChoice},get children(){return m(uv,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t})}})]}})}),m(J,{get when(){return VO(e.block)},keyed:true,children:o=>m(He,{get children(){return [m(J,{get when(){return !o.options?.isMultipleChoice},get children(){return m(Dx,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t,get onTransitionEnd(){return e.onTransitionEnd}})}}),m(J,{get when(){return o.options?.isMultipleChoice},get children(){return m(Rx,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t,get onTransitionEnd(){return e.onTransitionEnd}})}})]}})}),m(J,{get when(){return e.block.type==="rating input"},get children(){return m(Mx,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(J,{get when(){return e.block.type==="file input"},get children(){return m(gx,{get context(){return e.context},get block(){return e.block},onSubmit:t,get onSkip(){return e.onSkip}})}}),m(J,{get when(){return e.block.type==="payment input"},get children(){return m(kx,{get context(){return e.context},get options(){return {...e.block.options,...e.block.runtimeOptions}},onSuccess:n,get onTransitionEnd(){return e.onTransitionEnd}})}})]}})},WO=e=>e?.type==="choice input"?e:void 0,VO=e=>e?.type==="image choice"?e:void 0;var zO=w('<div class="flex items-center gap-1"><div class="w-2 h-2 rounded-full bubble1"></div><div class="w-2 h-2 rounded-full bubble2"></div><div class="w-2 h-2 rounded-full bubble3">'),Vt=()=>zO();var Lw={isAutoplayEnabled:true};var GO=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><audio controls>'),qO=400,YO=100,kd,Nw=e=>{let t=false,r,n,[o,i]=M(!!e.onTransitionEnd);return ce(()=>{kd=setTimeout(()=>{t||(t=true,i(false),setTimeout(()=>e.onTransitionEnd?.(r),qO));},YO);}),me(()=>{kd&&clearTimeout(kd);}),(()=>{var a=GO(),s=a.firstChild,l=s.firstChild,c=l.firstChild,u=c.nextSibling,d=r;typeof d=="function"?be(d,a):r=a,v(c,(()=>{var p=B(()=>!!o());return ()=>p()&&m(Vt,{})})());var f=n;return typeof f=="function"?be(f,u):n=u,$(p=>{var g=xe("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),h=o()?"64px":"100%",b=o()?"32px":"100%",y=e.content?.url,S=e.onTransitionEnd?e.content?.isAutoplayEnabled??Lw.isAutoplayEnabled:false,C="z-10 text-fade-in "+(o()?"opacity-0":"opacity-100 m-2"),k=o()?X()?"32px":"36px":"revert";return g!==p.e&&j(a,p.e=g),h!==p.t&&((p.t=h)!=null?c.style.setProperty("width",h):c.style.removeProperty("width")),b!==p.a&&((p.a=b)!=null?c.style.setProperty("height",b):c.style.removeProperty("height")),y!==p.o&&G(u,"src",p.o=y),S!==p.i&&(u.autoplay=p.i=S),C!==p.n&&j(u,p.n=C),k!==p.s&&((p.s=k)!=null?u.style.setProperty("height",k):u.style.removeProperty("height")),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),a})()};var KO=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><div class="w-full overflow-y-auto">'),Pd,XO=400,Bw=e=>{let t,[r,n]=M(!!e.onTransitionEnd),o;return ce(()=>{da({args:{...e.content.initFunction.args,agentElement:o},content:e.content.initFunction.content}),e.content.waitForEventFunction&&da({args:{...e.content.waitForEventFunction.args,continueFlow:i=>e.onCompleted(i?{type:"text",value:i}:void 0)},content:e.content.waitForEventFunction.content}),Pd=setTimeout(()=>{n(false),setTimeout(()=>e.onTransitionEnd?.(t),XO);},2e3);}),me(()=>{Pd&&clearTimeout(Pd);}),(()=>{var i=KO(),a=i.firstChild,s=a.firstChild,l=s.firstChild,c=l.nextSibling,u=c.firstChild,d=t;typeof d=="function"?be(d,i):t=i,v(l,(()=>{var p=B(()=>!!r());return ()=>p()&&m(Vt,{})})());var f=o;return typeof f=="function"?be(f,u):o=u,$(p=>{var g=xe("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),h=r()?"64px":"100%",b=r()?"32px":"100%",y=xe("p-2 z-20 text-fade-in w-full",r()?"opacity-0":"opacity-100"),S=r()?X()?"32px":"36px":void 0,C=`calc(${gm()} - 100px)`;return g!==p.e&&j(i,p.e=g),h!==p.t&&((p.t=h)!=null?l.style.setProperty("width",h):l.style.removeProperty("width")),b!==p.a&&((p.a=b)!=null?l.style.setProperty("height",b):l.style.removeProperty("height")),y!==p.o&&j(c,p.o=y),S!==p.i&&((p.i=S)!=null?c.style.setProperty("height",S):c.style.removeProperty("height")),C!==p.n&&((p.n=C)!=null?u.style.setProperty("max-height",C):u.style.removeProperty("max-height")),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()};var Fw={height:400};var ZO=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><iframe id=embed-bubble-content class="w-full h-full ">'),Ed,QO=400,Uw=e=>{let t,[r,n]=M(!!e.onTransitionEnd),o=i=>{e.content?.waitForEvent?.isEnabled&&Ne(i.data.name)&&i.data.name===e.content?.waitForEvent.name&&(e.onCompleted?.(e.content.waitForEvent.saveDataInVariableId&&i.data.data?{type:"text",value:i.data.data}:void 0),window.removeEventListener("message",o));};return ce(()=>{Ed=setTimeout(()=>{n(false),e.content?.waitForEvent?.isEnabled&&window.addEventListener("message",o),setTimeout(()=>{e.onTransitionEnd?.(t);},QO);},2e3);}),me(()=>{Ed&&clearTimeout(Ed),window.removeEventListener("message",o);}),(()=>{var i=ZO(),a=i.firstChild,s=a.firstChild,l=s.firstChild,c=l.nextSibling,u=c.firstChild,d=t;return typeof d=="function"?be(d,i):t=i,v(l,(()=>{var f=B(()=>!!r());return ()=>f()&&m(Vt,{})})()),$(f=>{var p=xe("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),g=r()?"64px":"100%",h=r()?"32px":"100%",b=xe("p-4 z-20 text-fade-in w-full",r()?"opacity-0":"opacity-100 p-4"),y=r()?X()?"32px":"36px":`${e.content?.height??Fw.height}px`,S=e.content?.url;return p!==f.e&&j(i,f.e=p),g!==f.t&&((f.t=g)!=null?l.style.setProperty("width",g):l.style.removeProperty("width")),h!==f.a&&((f.a=h)!=null?l.style.setProperty("height",h):l.style.removeProperty("height")),b!==f.o&&j(c,f.o=b),y!==f.i&&((f.i=y)!=null?c.style.setProperty("height",y):c.style.removeProperty("height")),S!==f.n&&G(u,"src",f.n=S),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()};var jw={clickLink:{alt:"Bubble image"}};var JO=w('<img elementtiming="Bubble image"fetchpriority=high>'),eR=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),tR=w("<a target=_blank rel=noreferrer>"),rR=w("<figure>"),nR=400,oR=5e3,tc,Hw=e=>{let t,r,[n,o]=M(!!e.onTransitionEnd),i=()=>{n()&&(o(false),setTimeout(()=>{e.onTransitionEnd?.(t);},nR));};ce(()=>{r&&(tc=setTimeout(i,oR),r.onload=()=>{clearTimeout(tc),i();});}),me(()=>{tc&&clearTimeout(tc);});let a=(()=>{var s=JO(),l=r;return typeof l=="function"?be(l,s):r=s,s.style.setProperty("max-height","512px"),$(c=>{var u=e.content?.url,d=e.content?.clickLink?.alt??jw.clickLink.alt,f=xe(n()?"opacity-0":"opacity-100",e.onTransitionEnd?"text-fade-in":void 0,e.content?.url?.endsWith(".svg")?"w-full":void 0),p=n()?"32px":"auto";return u!==c.e&&G(s,"src",c.e=u),d!==c.t&&G(s,"alt",c.t=d),f!==c.a&&j(s,c.a=f),p!==c.o&&((c.o=p)!=null?s.style.setProperty("height",p):s.style.removeProperty("height")),c},{e:void 0,t:void 0,a:void 0,o:void 0}),s})();return (()=>{var s=eR(),l=s.firstChild,c=l.firstChild,u=c.firstChild,d=t;return typeof d=="function"?be(d,s):t=s,v(u,(()=>{var f=B(()=>!!n());return ()=>f()?m(Vt,{}):null})()),v(c,(()=>{var f=B(()=>!!e.content?.clickLink);return ()=>f()?(()=>{var p=tR();return v(p,a),$(g=>{var h=e.content.clickLink.url,b=xe("z-10",n()?"h-8":"p-4");return h!==g.e&&G(p,"href",g.e=h),b!==g.t&&j(p,g.t=b),g},{e:void 0,t:void 0}),p})():(()=>{var p=rR();return v(p,a),$(()=>j(p,xe("z-10",!n()&&"p-4",n()?X()?"h-8":"h-9":""))),p})()})(),null),$(f=>{var p=xe("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),g=n()?"64px":"100%",h=n()?"32px":"100%";return p!==f.e&&j(s,f.e=p),g!==f.t&&((f.t=g)!=null?u.style.setProperty("width",g):u.style.removeProperty("width")),h!==f.a&&((f.a=h)!=null?u.style.setProperty("height",h):u.style.removeProperty("height")),f},{e:void 0,t:void 0,a:void 0}),s})()};var Ww=({bubbleContent:e,typingSettings:t})=>{let r=e.match(/(\w+)/g)?.length??0;r===0&&(r=e.length);let{enabled:n,speed:o,maxDelay:i}={enabled:t?.enabled??vt.typingEmulation.enabled,speed:t?.speed??vt.typingEmulation.speed,maxDelay:t?.maxDelay??vt.typingEmulation.maxDelay},s=n?r/o*6e4:0;return s>i*1e3&&(s=i*1e3),s};var Id=e=>e.map(t=>t.text??Id(t.children)).join("");var iR=w("<br>"),aR=w("<span>"),sR=(e,t,r)=>{let n="";return e&&(n+="slate-bold"),t&&(n+=" slate-italic"),r&&(n+=" slate-underline"),n},Vw=e=>(()=>{var t=aR();return v(t,()=>e.text,null),v(t,m(W,{get when(){return B(()=>!!e.isUniqueChild)()&&tt(e.text)},get children(){return iR()}}),null),$(()=>j(t,sR(e.bold,e.italic,e.underline))),t})();var lR=w('<a target=_blank rel="noopener noreferrer">'),cR=w("<ol>"),uR=w("<ul>"),dR=w("<li>"),fR=w("<span>"),pR=w("<div>"),so=e=>m(He,{get children(){return [m(J,{get when(){return pe(e.element.text)},get children(){return m(Vw,Re(()=>e.element,{get isUniqueChild(){return e.isUniqueChild??false}}))}}),m(J,{when:true,get children(){return m(He,{get children(){return [m(J,{get when(){return e.element.type==="a"},get children(){var t=lR();return v(t,m(ke,{get each(){return e.element.children},children:r=>m(so,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),$(()=>G(t,"href",e.element.url)),t}}),m(J,{get when(){return e.element.type==="ol"},get children(){var t=cR();return v(t,m(ke,{get each(){return e.element.children},children:r=>m(so,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(J,{get when(){return e.element.type==="ul"},get children(){var t=uR();return v(t,m(ke,{get each(){return e.element.children},children:r=>m(so,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(J,{get when(){return e.element.type==="li"},get children(){var t=dR();return v(t,m(ke,{get each(){return e.element.children},children:r=>m(so,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(J,{when:true,get children(){return m(mR,{get element(){return e.element},get insideInlineVariable(){return e.insideInlineVariable??false},get children(){return m(ke,{get each(){return e.element.children},children:t=>m(so,{element:t,get isUniqueChild(){return e.element.children?.length===1},get insideInlineVariable(){return e.element.type==="inline-variable"}})})}})}})]}})}})]}}),mR=e=>m(He,{get children(){return [m(J,{get when(){return e.element.type==="inline-variable"||e.insideInlineVariable},get children(){var t=fR();return v(t,()=>e.children),$(()=>G(t,"data-element-type",e.element.type)),t}}),m(J,{when:true,get children(){var t=pR();return v(t,()=>e.children),$(()=>G(t,"data-element-type",e.element.type)),t}})]}});var gR=w('<div><div class="flex w-full items-center"><div class="flex relative items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble></div><div>'),hR=400,Ad,zw=e=>{let t,[r,n]=M(!!e.onTransitionEnd),o=()=>{r()&&(n(false),setTimeout(()=>{e.onTransitionEnd?.(t);},hR));};return ce(()=>{if(!r)return;let i=e.content?.richText?Id(e.content.richText):"",a=e.typingEmulation?.enabled===false||e.isTypingSkipped?0:Ww({bubbleContent:i,typingSettings:e.typingEmulation});Ad=setTimeout(o,a);}),me(()=>{Ad&&clearTimeout(Ad);}),(()=>{var i=gR(),a=i.firstChild,s=a.firstChild,l=s.firstChild,c=l.nextSibling,u=t;return typeof u=="function"?be(u,i):t=i,v(l,(()=>{var d=B(()=>!!r());return ()=>d()&&m(Vt,{})})()),v(c,m(ke,{get each(){return e.content?.richText},children:d=>m(so,{element:d})})),$(d=>{var f=xe("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),p=r()?"64px":"100%",g=r()?"32px":"100%",h=xe("overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative text-ellipsis",r()?"opacity-0":"opacity-100"),b=r()?X()?"16px":"20px":"100%";return f!==d.e&&j(i,d.e=f),p!==d.t&&((d.t=p)!=null?l.style.setProperty("width",p):l.style.removeProperty("width")),g!==d.a&&((d.a=g)!=null?l.style.setProperty("height",g):l.style.removeProperty("height")),h!==d.o&&j(c,d.o=h),b!==d.i&&((d.i=b)!=null?c.style.setProperty("height",b):c.style.removeProperty("height")),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()};var Od=["youtube","vimeo","tiktok","gumlet"],lo={height:400,maxWidth:"100%",areControlsDisplayed:true,isAutoplayEnabled:true};var bR="https://www.youtube.com/embed";var yR="https://player.vimeo.com/video";var vR="https://www.tiktok.com/embed/v2";var xR="https://play.gumlet.io/embed";var Gw={vimeo:yR,youtube:bR,tiktok:vR,gumlet:xR};var wR=w("<video>"),TR=w('<div><iframe class="w-full h-full"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen>'),_R=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble overflow-hidden w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),CR=400,Rd,qw=e=>{let t,[r,n]=M(!!e.onTransitionEnd);return ce(()=>{let o=e.content?.type&&Od.includes(e.content?.type)?2e3:100;Rd=setTimeout(()=>{r()&&(n(false),setTimeout(()=>{e.onTransitionEnd?.(t);},CR));},o);}),me(()=>{Rd&&clearTimeout(Rd);}),(()=>{var o=_R(),i=o.firstChild,a=i.firstChild,s=a.firstChild,l=t;return typeof l=="function"?be(l,o):t=o,v(s,(()=>{var c=B(()=>!!r());return ()=>c()&&m(Vt,{})})()),v(a,m(He,{get children(){return [m(J,{get when(){return e.content?.type&&e.content.type==="url"},get children(){var c=wR();return $(u=>{var d=e.onTransitionEnd?e.content?.isAutoplayEnabled??lo.isAutoplayEnabled:false,f=e.content?.url,p=e.content?.areControlsDisplayed??lo.areControlsDisplayed,g="p-4 focus:outline-none w-full z-10 text-fade-in rounded-md "+(r()?"opacity-0":"opacity-100"),h=r()?X()?"32px":"36px":"auto",b=e.content?.aspectRatio,y=e.content?.maxWidth??lo.maxWidth;return d!==u.e&&(c.autoplay=u.e=d),f!==u.t&&G(c,"src",u.t=f),p!==u.a&&(c.controls=u.a=p),g!==u.o&&j(c,u.o=g),h!==u.i&&((u.i=h)!=null?c.style.setProperty("height",h):c.style.removeProperty("height")),b!==u.n&&((u.n=b)!=null?c.style.setProperty("aspect-ratio",b):c.style.removeProperty("aspect-ratio")),y!==u.s&&((u.s=y)!=null?c.style.setProperty("max-width",y):c.style.removeProperty("max-width")),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),c}}),m(J,{get when(){return B(()=>!!e.content?.type)()&&Od.includes(e.content.type)},get children(){var c=TR(),u=c.firstChild;return $(d=>{var f=Qt("p-4 z-10 text-fade-in w-full",r()?"opacity-0":"opacity-100 p-4"),p=r()?X()?"32px":"36px":e.content?.aspectRatio?void 0:`${e.content?.height??lo.height}px`,g=e.content?.aspectRatio,h=e.content?.maxWidth??lo.maxWidth,b=`${Gw[e.content?.type]}/${e.content?.id??""}${e.content?.queryParamsStr??""}`;return f!==d.e&&j(c,d.e=f),p!==d.t&&((d.t=p)!=null?c.style.setProperty("height",p):c.style.removeProperty("height")),g!==d.a&&((d.a=g)!=null?c.style.setProperty("aspect-ratio",g):c.style.removeProperty("aspect-ratio")),h!==d.o&&((d.o=h)!=null?c.style.setProperty("max-width",h):c.style.removeProperty("max-width")),b!==d.i&&G(u,"src",d.i=b),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),c}})]}}),null),$(c=>{var u=Qt("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),d=r()?"64px":"100%",f=r()?"32px":"100%",p=e.content?.maxWidth??lo.maxWidth;return u!==c.e&&j(o,c.e=u),d!==c.t&&((c.t=d)!=null?s.style.setProperty("width",d):s.style.removeProperty("width")),f!==c.a&&((c.a=f)!=null?s.style.setProperty("height",f):s.style.removeProperty("height")),p!==c.o&&((c.o=p)!=null?s.style.setProperty("max-width",p):s.style.removeProperty("max-width")),c},{e:void 0,t:void 0,a:void 0,o:void 0}),o})()};var Yw=e=>m(He,{get children(){return [m(J,{get when(){return e.message.type==="text"},get children(){return m(zw,{get content(){return e.message.content},get isTypingSkipped(){return e.isTypingSkipped},get typingEmulation(){return e.typingEmulation},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(J,{get when(){return e.message.type==="image"},get children(){return m(Hw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(J,{get when(){return e.message.type==="video"},get children(){return m(qw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(J,{get when(){return e.message.type==="embed"},get children(){return m(Uw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(J,{get when(){return e.message.type==="custom-embed"},get children(){return m(Bw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(J,{get when(){return e.message.type==="audio"},get children(){return m(Nw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}})]}});var Bd=wo(Kw());function Nd(){return {async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}var uo=Nd();function e0(e){uo=e;}var t0=/[&<>"']/,SR=new RegExp(t0.source,"g"),r0=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,kR=new RegExp(r0.source,"g"),PR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Xw=e=>PR[e];function Yt(e,t){if(t){if(t0.test(e))return e.replace(SR,Xw)}else if(r0.test(e))return e.replace(kR,Xw);return e}var ER=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function IR(e){return e.replace(ER,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}var AR=/(^|[^\[])\^/g;function We(e,t){e=typeof e=="string"?e:e.source,t=t||"";let r={replace:(n,o)=>(o=typeof o=="object"&&"source"in o?o.source:o,o=o.replace(AR,"$1"),e=e.replace(n,o),r),getRegex:()=>new RegExp(e,t)};return r}function Zw(e){try{e=encodeURI(e).replace(/%25/g,"%");}catch{return null}return e}var rc={exec:()=>null};function Qw(e,t){let r=e.replace(/\|/g,(i,a,s)=>{let l=false,c=a;for(;--c>=0&&s[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(/ \|/),o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(/\\\|/g,"|");return n}function $d(e,t,r){let n=e.length;if(n===0)return "";let o=0;for(;o<n;){let i=e.charAt(n-o-1);if(i===t&&true)o++;else break}return e.slice(0,n-o)}function OR(e,t){if(e.indexOf(t[1])===-1)return -1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return -1}function Jw(e,t,r,n){let o=t.href,i=t.title?Yt(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){n.state.inLink=true;let s={type:"link",raw:r,href:o,title:i,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=false,s}return {type:"image",raw:r,href:o,title:i,text:Yt(a)}}function RR(e,t){let r=e.match(/^(\s+)(?:```)/);if(r===null)return t;let n=r[1];return t.split(`
77
+ `;var RA=w('<div><button class="p-0.5 rounded-full"aria-label="Stop recording"></button><div class="relative flex w-full"><canvas class="w-full h-[56px]"></canvas><div class="absolute left-gradient w-2 left-0 h-[56px]"></div><div class="absolute right-gradient w-3 right-0 h-[56px]"></div></div><span class="time-container flex-none w-[35px] font-bold text-sm">'),zn=3,Gn=3,DA=60,MA=10,$A=5,NA=90,$v=e=>{let[t,r]=R(0),n,o,i,a,s,l,u,c=[],d,p,f=0,b=ct(e.buttonsTheme?.backgroundColor??Ci).join(", "),g=()=>{if(!i||!n||!p)return;let S=performance.now(),E=S-p;p=S,i.clearRect(0,0,n.width,n.height),i.fillStyle=`rgba(${b}, 0.2)`;for(let h=0;h<(n.width+Gn)/(zn+Gn);h++){let C=h*(zn+Gn)-f,$=n.height*(MA/100),H=(n.height-$)/2;i.beginPath(),i.roundRect(C,H,zn,$,5),i.fill();}i.fillStyle=`rgba(${b}, 1)`;for(let h=0;h<c.length;h++){let C=n.width+(h+1)*(zn+Gn)-f,$=n.height*((c[h]??0)/100),H=(n.height-$)/2;i.beginPath(),i.roundRect(C,H,zn,$,5),i.fill();}f+=DA*(E/1e3),o=requestAnimationFrame(g);},y=async()=>{n&&(u=await navigator.mediaDevices.getUserMedia({audio:true}),e.onRecordingConfirmed(u),i||(i=n.getContext("2d")??void 0),d=setInterval(()=>{r(S=>S+=1);},1e3),a=new AudioContext,s=await LA(a),l=a.createMediaStreamSource(u),l.connect(s),s.connect(a.destination),s.port.onmessage=S=>{((n.width+Gn)/(zn+Gn)+c.length)*(zn+Gn)<n.width+f&&c.push(Math.min(Math.max(S.data,$A),NA));},p=performance.now(),o=requestAnimationFrame(g));},T=()=>{i&&n&&i.clearRect(0,0,n.width,n.height),f=0,s?.disconnect(),s=void 0,l?.disconnect(),l=void 0,a?.close(),a=void 0,u?.getTracks().forEach(S=>S.stop()),u=void 0,c=[],clearTimeout(d),r(0),cancelAnimationFrame(o),e.onAbortRecording();};return Ce(()=>{e.recordingStatus==="asking"?y():e.recordingStatus==="stopped"&&T();}),ae(()=>{T();}),(()=>{var S=RA(),E=S.firstChild,h=E.nextSibling,C=h.firstChild,$=h.nextSibling;nt(E,"click",T),x(E,m(Dr,{class:"w-4"}));var H=n;return typeof H=="function"?me(H,C):n=C,x($,()=>FA(t())),M(()=>U(S,ye("w-full gap-2 items-center transition-opacity px-2 agent-recorder",e.recordingStatus==="started"?"opacity-1 flex":"opacity-0 hidden"))),S})()},LA=async e=>{let t=new Blob([Mv],{type:"application/javascript"}),r=URL.createObjectURL(t);return await e.audioWorklet.addModule(r),new AudioWorkletNode(e,"volume-processor")},FA=e=>{let t=Math.floor(e/60),n=(e%60).toString().padStart(2,"0");return `${t}:${n}`};var BA=w('<div class="p-2 flex gap-2 border-gray-100 overflow-auto">'),UA=w("<div>"),VA=w("<div><div>"),HA=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),Lv=e=>{let[t,r]=R(e.defaultValue??""),[n,o]=R([]),[i,a]=R(void 0),[s,l]=R(false),[u,c]=R("stopped"),d,p,f=[],b=O=>r(O),g=()=>d?.value!==""&&d?.reportValidity(),y=async()=>{if(console.log(1),u()==="started"&&p){p.stop();return}let O=e.block.options?.isRequired??Jo.isRequired;if(!O||g()){let D;n().length>0&&(a(void 0),D=(await Xo({apiHost:e.context.apiHost??dt({ignoreChatApiUrl:true}),files:n().map(ne=>({file:ne,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:ne.name}})),onUploadProgress:a}))?.map((ne,ve)=>ne?{...ne,blobUrl:URL.createObjectURL(n()[ve])}:null).filter(ue));let F=d?.value??t();!O&&!F&&(F="** omited **"),e.onSubmit({type:"text",value:F,label:e.block.options?.labels?.button,isPassword:e.block.options?.isPassword,isRequired:O,attachments:D});}else d?.focus();},T=O=>{e.block.options?.isLong||O.key==="Enter"&&y();},S=O=>{e.block.options?.isLong&&O.key==="Enter"&&(O.metaKey||O.ctrlKey)&&y();};ie(()=>{!K()&&d&&d.focus({preventScroll:true}),window.addEventListener("message",E);}),ae(()=>{window.removeEventListener("message",E);});let E=O=>{let{data:D}=O;D.isFromAgent&&D.command==="setInputValue"&&r(D.value);},h=O=>{O.preventDefault(),l(true);},C=()=>l(false),$=O=>{O.preventDefault(),O.stopPropagation(),O.dataTransfer?.files&&H(O.dataTransfer.files);},H=O=>{let D=Array.from(O).map(F=>Xs({existingFiles:n(),newFile:F,params:{sizeLimit:Lr("NEXT_PUBLIC_AGENT_FILE_UPLOAD_MAX_SIZE")},onError:({description:j,title:ne})=>{Rr.create({description:j,title:ne});}})).filter(ue);D.length!==0&&o(F=>[...D,...F]);},N=O=>{o(D=>D.filter((F,j)=>j!==O));},_=()=>{c("asking");},A=O=>{let D,F=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"video/mp4";p=new MediaRecorder(O,{mimeType:F}),p.ondataavailable=j=>{j.data.size!==0&&f.push(j.data);},p.onstart=()=>{D=Date.now();},p.onstop=async()=>{if(u()!=="started"||f.length===0)return;let j=Date.now()-D,ne=await(0, Nv.fixWebmDuration)(new Blob(f,{type:F}),j),ve=new File([ne],`rec-${e.block.id}-${Date.now()}.${F==="audio/webm"?"webm":"mp4"}`,{type:F});a(void 0);let fe=(await Xo({apiHost:e.context.apiHost??dt({ignoreChatApiUrl:true}),files:[{file:ve,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:ve.name}}],onUploadProgress:a})).filter(ue).map(Be=>Be.url);e.onSubmit({type:"recording",url:fe[0],blobUrl:URL.createObjectURL(ve)});},p.start(),c("started");},I=()=>{p?.stop(),c("stopped"),p=void 0,f=[];},k=e.block.options?.isRequired??Jo.isRequired;return (()=>{var O=VA(),D=O.firstChild;return O.addEventListener("dragleave",C),O.addEventListener("dragover",h),O.addEventListener("drop",$),O.$$keydown=T,x(D,m($v,{get recordingStatus(){return u()},get buttonsTheme(){return e.context.agent.theme.chat?.buttons},onRecordingConfirmed:A,onAbortRecording:I}),null),x(D,m(W,{get when(){return u()!=="started"},get children(){return [m(W,{get when(){return n().length},get children(){var F=BA();return F.style.setProperty("border-bottom-width","1px"),x(F,m(ke,{get each(){return n()},children:(j,ne)=>m(Js,{file:j,get uploadProgressPercent(){return L(()=>!!i())()?L(()=>i()?.fileIndex===ne())()?20:ne()<(i()?.fileIndex??0)?100:0:void 0},onRemoveClick:()=>N(ne())})})),F}}),(()=>{var F=UA();return x(F,(()=>{var j=L(()=>!!e.block.options?.isLong);return ()=>j()?m(Zx,{ref(ne){var ve=d;typeof ve=="function"?ve(ne):d=ne;},onInput:b,onKeyDown:S,get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??Jo.labels.placeholder}}):m($t,{ref(ne){var ve=d;typeof ve=="function"?ve(ne):d=ne;},onInput:b,get value(){return t()},get type(){return e.block.options?.isPassword?"password":"text"},get placeholder(){return e.block.options?.labels?.placeholder??Jo.labels.placeholder}})})(),null),x(F,!k&&HA(),null),x(F,m(W,{get when(){return (e.block.options?.attachments?.isEnabled??Jo.attachments.isEnabled)&&e.block.options?.attachments?.saveVariableId},get children(){return m(Kx,{onNewFiles:H,get class(){return ye(e.block.options?.isLong?"ml-2":void 0)}})}}),null),M(()=>U(F,ye("flex justify-between px-2",e.block.options?.isLong?"items-end":"items-center"))),F})()]}}),null),x(O,m(Le,{get children(){return [m(X,{get when(){return !t()&&u()!=="started"&&e.block.options?.audioClip?.isEnabled},get children(){return m(pr,{class:"h-[56px] flex items-center","on:click":_,"aria-label":"Record voice",get children(){return m(Xx,{class:"flex w-6 h-6"})}})}}),m(X,{when:true,get children(){return m(We,{type:"button","on:click":y,get isDisabled(){return !!i()},class:"h-[56px]",get children(){return e.block.options?.labels?.button}})}})]}}),null),M(F=>{var j=ye("agent-input-form flex w-full gap-2 items-end",e.block.options?.isLong&&u()!=="started"?"max-w-full":"max-w-[350px]"),ne=ye("relative agent-input flex-col w-full",s()&&"filter brightness-95");return j!==F.e&&U(O,F.e=j),ne!==F.t&&U(D,F.t=ne),F},{e:void 0,t:void 0}),O})()};Ne(["keydown"]);var _l={labels:{placeholder:"Type a URL..."},isRequired:true};var WA=w('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex relative agent-input w-full">'),jA=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),Fv=e=>{let[t,r]=R(e.defaultValue??""),n,o=c=>{r(c);},i=()=>n?.value!==""&&n?.reportValidity(),a=()=>{let c=e.block.options?.isRequired??_l.isRequired,d=n?.value??t();d.length>0&&n&&d.startsWith("http")&&(n.value=`https://${n.value}`),!c&&!d&&(d="** omited **"),!c||i()?e.onSubmit({type:"text",value:d,isRequired:c}):n?.focus();},s=c=>{c.key==="Enter"&&a();};ie(()=>{!K()&&n&&n.focus({preventScroll:true}),window.addEventListener("message",l);}),ae(()=>{window.removeEventListener("message",l);});let l=c=>{let{data:d}=c;d.isFromAgent&&d.command==="setInputValue"&&r(d.value);},u=e?.block.options?.isRequired??_l.isRequired;return (()=>{var c=WA(),d=c.firstChild;return c.$$keydown=s,x(d,m($t,{ref(p){var f=n;typeof f=="function"?f(p):n=p;},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??_l.labels.placeholder},onInput:o,type:"url",autocomplete:"url"}),null),x(d,!u&&jA(),null),x(c,m(We,{type:"button",class:"h-[56px]","on:click":a,get children(){return e.block.options?.labels?.button}}),null),c})()};Ne(["keydown"]);var mn={labels:{placeholder:"Start typing to search..."},isRequired:true,minSearchLength:2,restrictToList:false};var ga=new Map,Bv=120*1e3,zu=class{baseUrl;sessionId;blockId;debounceTimeouts=new Map;constructor(){this.baseUrl="",this.sessionId="",this.blockId="";}setApiData(t,r,n){this.baseUrl=t,this.sessionId=r||"",this.blockId=n||"";}debounce(t,r,n){return((...o)=>new Promise((i,a)=>{this.debounceTimeouts.has(n)&&clearTimeout(this.debounceTimeouts.get(n));let s=window.setTimeout(async()=>{try{let l=await t(...o);i(l);}catch(l){a(l);}this.debounceTimeouts.delete(n);},r);this.debounceTimeouts.set(n,s);}))}async getSuggestions(t){if(!this.baseUrl||!this.sessionId||!this.blockId)throw new Error("API client not properly initialized");this.cleanExpiredCache();let r=`${this.blockId}-${t.toLowerCase()}`,n=ga.get(r);if(n){if(Date.now()-n.timestamp<Bv)return n.data;ga.delete(r);}try{let o=new URL("/api/integrations/autocomplete",this.baseUrl);o.searchParams.set("q",t),o.searchParams.set("sessionId",this.sessionId),o.searchParams.set("blockId",this.blockId);let i=await fetch(o.toString(),{method:"GET",headers:{"Content-Type":"application/json"}});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);let a=await i.json();return ga.set(r,{data:a,timestamp:Date.now()}),a}catch(o){throw console.error("Error getting autocomplete suggestions:",o),o}}cleanExpiredCache(){let t=Date.now();for(let[r,{timestamp:n}]of ga.entries())t-n>=Bv&&ga.delete(r);}cleanup(){for(let t of this.debounceTimeouts.values())clearTimeout(t);this.debounceTimeouts.clear();}},ha=new zu;var zA=w('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px] relative"><div class="flex agent-input w-full relative">'),GA=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),qA=w('<div class="absolute agent-input top-full left-0 mt-2 right-0 rounded-md shadow-lg z-50 max-h-60 overflow-y-auto scrollable-container">'),YA=w('<div><div class="flex gap-3 items-center"><div class="flex-shrink-0 opacity-50 mt-0.5"><svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=text-gray-400><line x1=8 y1=6 x2=21 y2=6></line><line x1=8 y1=12 x2=21 y2=12></line><line x1=8 y1=18 x2=21 y2=18></line><line x1=3 y1=6 x2=3.01 y2=6></line><line x1=3 y1=12 x2=3.01 y2=12></line><line x1=3 y1=18 x2=3.01 y2=18></line></svg></div><div class="flex-1 min-w-0"><div class="font-medium text-sm">'),KA=w('<div class="absolute right-3 top-1/2 transform -translate-y-1/2"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-current">'),XA=w('<div class="absolute right-3 top-1/2 transform -translate-y-1/2 text-yellow-500">\u26A0\uFE0F'),Uv=e=>{let[t,r]=R(e.defaultValue??""),[n,o]=R(false),[i,a]=R(null),[s,l]=R([]),[u,c]=R(-1),d,p,f=ha.debounce(async _=>{let A=e.block.options?.minSearchLength??mn.minSearchLength;if(_.length<A){l([]);return}o(true),a(null);try{let I=await ha.getSuggestions(_);I.status==="OK"?(l(I.suggestions),setTimeout(()=>{d&&document.activeElement!==d&&d.focus({preventScroll:!0});},0)):I.status==="ZERO_RESULTS"?l([]):(a("Error fetching suggestions"),l([]));}catch(I){let k=I instanceof Error?I.message:"Unknown error";a(k),l([]);}finally{o(false);}},300,"autocomplete-suggestions"),b=_=>{r(_),c(-1),d&&(d.removeAttribute("data-selected-key"),d.removeAttribute("data-selected-value"));let A=e.block.options?.minSearchLength??mn.minSearchLength;_.trim().length>=A?f(_.trim()):l([]),d&&document.activeElement!==d&&setTimeout(()=>{d?.focus({preventScroll:true});},0);},g=()=>{let _=d?.value||t(),A=e.block.options?.minSearchLength??mn.minSearchLength;_.trim().length>=A&&f(_.trim());},y=_=>{let A=_.value;r(A),d&&(d.value=A,d.setAttribute("data-selected-key",_.key),d.setAttribute("data-selected-value",_.value)),l([]),c(-1),d&&d.focus();},T=_=>{if(!p)return;let A=p.children[_];A&&A.scrollIntoView({behavior:"smooth",block:"nearest"});},S=_=>{if(s().length===0){_.key==="Enter"&&C();return}switch(_.key){case "ArrowDown":_.preventDefault(),c(I=>{let k=I<s().length-1?I+1:0;return setTimeout(()=>T(k),0),k});break;case "ArrowUp":_.preventDefault(),c(I=>{let k=I>0?I-1:s().length-1;return setTimeout(()=>T(k),0),k});break;case "Enter":_.preventDefault();let A=u();A>=0&&A<s().length?y(s()[A]):C();break;case "Escape":_.preventDefault(),l([]),c(-1);break}},E=_=>{let A=_.target;d&&p&&!d.contains(A)&&!p.contains(A)&&setTimeout(()=>{document.activeElement!==d&&l([]);},100);},h=()=>d?.value!==""&&d?.reportValidity(),C=()=>{let _=e.block.options?.isRequired??mn.isRequired,A=e.block.options?.restrictToList??mn.restrictToList,I=d?.value??t();!_&&!I&&(I="** omited **");let k=d?.getAttribute("data-selected-key"),O=d?.getAttribute("data-selected-value");if(A&&I!=="** omited **"&&(!k||!O)){d?.focus();return}k&&O&&(I=JSON.stringify({key:k,value:O})),!_||h()?e.onSubmit({type:"text",value:I,isRequired:_}):d?.focus();};ie(()=>{let _=e.context?.apiHost??dt({ignoreChatApiUrl:true}),A=e.context?.sessionId;ha.setApiData(_,A,e.block.id),window.addEventListener("message",$),document.addEventListener("click",E),!K()&&d&&setTimeout(()=>{d?.focus({preventScroll:true});},100);}),ae(()=>{window.removeEventListener("message",$),document.removeEventListener("click",E),ha.cleanup();});let $=_=>{let{data:A}=_;A.isFromAgent&&A.command==="setInputValue"&&r(A.value);},H=e.block.options?.isRequired??mn.isRequired,N=()=>n()?"Loading suggestions...":i()?"Enter text (suggestions unavailable)":e.block.options?.labels?.placeholder??mn.labels.placeholder;return (()=>{var _=zA(),A=_.firstChild;return x(A,m($t,{ref(I){var k=d;typeof k=="function"?k(I):d=I;},get value(){return t()},get placeholder(){return N()},onInput:b,onFocus:g,onKeyDown:S,type:"text",get autocomplete(){return s().length<1?"off":"list"}}),null),x(A,!H&&GA(),null),x(A,(()=>{var I=L(()=>s().length>0);return ()=>I()&&(()=>{var k=qA();k.$$mousedown=D=>{D.preventDefault();};var O=p;return typeof O=="function"?me(O,k):p=k,x(k,()=>s().map((D,F)=>(()=>{var j=YA(),ne=j.firstChild,ve=ne.firstChild,fe=ve.nextSibling,Be=fe.firstChild;return j.addEventListener("mouseenter",()=>c(F)),j.$$mousedown=pe=>{pe.preventDefault();},j.$$click=()=>y(D),x(Be,()=>D.value),M(()=>U(j,`px-4 py-3 agent-input-suggest cursor-pointer border-b last:border-b-0
78
+ ${u()===F,""}`)),j})())),k})()})(),null),x(A,(()=>{var I=L(()=>!!n());return ()=>I()&&KA()})(),null),x(A,(()=>{var I=L(()=>!!(i()&&!n()));return ()=>I()&&(()=>{var k=XA();return M(()=>G(k,"title",`Autocomplete API error: ${i()}`)),k})()})(),null),x(_,m(We,{type:"button",class:"h-[56px]","on:click":C,get children(){return e.block.options?.labels?.button}}),null),_})()};Ne(["mousedown","click"]);var Vv=e=>m(fn.Root,{get open(){return e.isOpen},lazyMount:true,unmountOnExit:true,onOpenChange:t=>t.open?void 0:e.onClose?.(),get children(){return [m(fn.Backdrop,{class:"fixed inset-0 bg-[rgba(0,0,0,0.5)] h-screen z-50"}),m(fn.Positioner,{class:"fixed inset-0 z-50 flex items-center justify-center px-2",get children(){return [m(fn.Content,{get children(){return e.children}}),m(fn.CloseTrigger,{class:"fixed top-2 right-2 z-50 rounded-md bg-white p-2 text-black",get children(){return m(Dr,{class:"w-6 h-6"})}})]}})]}});var ZA=w('<svg viewBox="0 0 80 80"><g transform=translate(15,15)><g stroke=none stroke-width=1 fill=none fill-rule=evenodd><g transform="translate(1.000000, 1.000000)"stroke=currentColor stroke-width=2><path d="M23,5.0109 L23,2.5 C23,1.1193 24.1193,0 25.5,0 C26.8807,0 28,1.1193 28,2.5 L28,5"stroke-linecap=round stroke-linejoin=round></path><path d="M36.4505,45 L13.5495,45 C8.8473,45 5,41.1527 5,36.4505 L5,13.5495 C5,8.8473 8.8473,5 13.5495,5 L36.4505,5 C41.1527,5 45,8.8473 45,13.5495 L45,36.4505 C45,41.1527 41.1527,45 36.4505,45 Z"stroke-linecap=round stroke-linejoin=round></path><circle stroke-linecap=round stroke-linejoin=round cx=33.8346 cy=18.0022 r=2.8338></circle><circle stroke-linecap=round stroke-linejoin=round cx=16.3342 cy=18.0017 r=2.8338></circle><path d="M33.5,36.5 L16.5,36.5 C14.3,36.5 12.5,34.7 12.5,32.5 C12.5,30.3 14.3,28.5 16.5,28.5 L33.5,28.5 C35.7,28.5 37.5,30.3 37.5,32.5 C37.5,34.7 35.7,36.5 33.5,36.5 Z"></path><g stroke-linecap=round stroke-linejoin=round transform="translate(0.000000, 17.000000)"><path d="M2.5,13 C1.1193,13 0,11.8807 0,10.5 L0,2.5 C0,1.1193 1.1193,0 2.5,0 C3.8807,0 5,1.1193 5,2.5 L5,10.5 C5,11.8807 3.8807,13 2.5,13 Z"></path><path d="M47.5,13 C48.8807,13 50,11.8807 50,10.5 L50,2.5 C50,1.1193 48.8807,0 47.5,0 C46.1193,0 45,1.1193 45,2.5 L45,10.5 C45,11.8807 46.1193,13 47.5,13 Z"></path><line x1=17 y1=12 x2=17 y2=19></line><line x1=22 y1=12 x2=22 y2=19></line><line x1=27 y1=12 x2=27 y2=19></line><line x1=32 y1=12 x2=32 y2=19>'),Hv=({strokeColor:e})=>(()=>{var t=ZA();return e!=null?t.style.setProperty("color",e):t.style.removeProperty("color"),M(()=>G(t,"class",K()?"size-6":"size-10")),t})();var QA=w('<svg viewBox="0 0 80 80"><g transform=translate(15,15)><g stroke=none stroke-width=1 fill=none fill-rule=evenodd><g transform="translate(1.000000, 1.000000)"><circle id=Oval stroke=currentColor stroke-width=2 cx=25 cy=25 r=25></circle><path d="M14.9350649,32.4675325 C16.9120779,35.9554545 20.6786364,38.3116883 25,38.3116883 C29.3213636,38.3116883 33.0879221,35.9554545 35.0649351,32.4675325"id=Path stroke=currentColor stroke-width=3 stroke-linecap=round></path><circle fill=currentColor fill-rule=nonzero cx=15.2597403 cy=16.5584416 r=2.92207792></circle><circle fill=currentColor fill-rule=nonzero cx=34.0909091 cy=16.5584416 r=2.92207792>'),Wv=({strokeColor:e})=>(()=>{var t=QA();return e!=null?t.style.setProperty("color",e):t.style.removeProperty("color"),M(()=>G(t,"class",K()?"size-6":"size-10")),t})();var JA=w('<span class="text-4xl text-[40px]">'),eO=w('<img alt="Bot avatar"elementtiming="Bot avatar">'),tO=w('<figure><img alt="Bot avatar"class="rounded-full object-cover w-full h-full"elementtiming="Bot avatar"fetchpriority=high>'),rO=w('<div class="absolute left-[-4px] top-1/2 -translate-y-1/2 w-0 h-0">'),nO=w('<div class="absolute right-[-4px] top-1/2 -translate-y-1/2 w-0 h-0">'),oO=w("<div>"),Sl=e=>m(W,{get when(){return Re(e.src)},keyed:true,get fallback(){return (()=>{var t=oO();return x(t,m(W,{get when(){return e.isGuest},get children(){return [m(Wv,{get strokeColor(){return e.theme.chat?.hostBubbles?.color??_i}}),(()=>{var r=rO();return r.style.setProperty("border-top","5px solid transparent"),r.style.setProperty("border-bottom","5px solid transparent"),M(n=>(n=`5px solid ${e.theme.chat?.hostBubbles?.backgroundColor??_o}`)!=null?r.style.setProperty("border-right",n):r.style.removeProperty("border-right")),r})()]}}),null),x(t,m(W,{get when(){return !e.isGuest},get children(){return [m(Hv,{get strokeColor(){return e.theme.chat?.hostBubbles?.color??_i}}),(()=>{var r=nO();return r.style.setProperty("border-top","5px solid transparent"),r.style.setProperty("border-bottom","5px solid transparent"),M(n=>(n=`5px solid ${e.theme.chat?.hostBubbles?.backgroundColor??_o}`)!=null?r.style.setProperty("border-left",n):r.style.removeProperty("border-left")),r})()]}}),null),M(r=>{var n=`relative flex justify-center items-center rounded-full ${K()?"w-6 h-6":"w-10 h-10"}
79
+ `,o=e.theme.chat?.hostBubbles?.backgroundColor??_o;return n!==r.e&&U(t,r.e=n),o!==r.t&&((r.t=o)!=null?t.style.setProperty("background",o):t.style.removeProperty("background")),r},{e:void 0,t:void 0}),t})()},get children(){return m(Le,{get children(){return [m(X,{get when(){return iO(e.src??"")},get children(){var t=JA();return x(t,()=>e.src),t}}),m(X,{get when(){return or(e.src)},get children(){var t=eO();return M(r=>{var n=e.src,o="flex justify-center items-center relative animate-fade-in flex-shrink-0 "+(K()?"w-6 h-6 text-sm":"w-10 h-10 text-xl");return n!==r.e&&G(t,"src",r.e=n),o!==r.t&&U(t,r.t=o),r},{e:void 0,t:void 0}),t}}),m(X,{when:true,get children(){var t=tO(),r=t.firstChild;return M(n=>{var o="flex justify-center items-center rounded-full text-white relative animate-fade-in flex-shrink-0 "+(K()?"w-6 h-6 text-sm":"w-10 h-10 text-xl"),i=e.src;return o!==n.e&&U(t,n.e=o),i!==n.t&&G(r,"src",n.t=i),n},{e:void 0,t:void 0}),t}})]}})}}),iO=e=>/^\p{Emoji}$/u.test(e);function hr(...e){return vf(ye(e))}var sO=w('<div class="flex justify-end items-end animate-fade-in gap-2 guest-container">'),lO=w('<div class="flex flex-row flex-wrap justify-end items-center gap-2">'),jv=w("<div>"),cO=w("<span>"),uO=w("<img alt=Attachment>"),dO=w('<div class="flex flex-col gap-1 items-end"><div data-testid=guest-bubble>'),fO=w('<img alt=image class="max-w-[200px] max-h-[60px] .object-scale-down rounded-lg animate-fade-in">'),pO=w("<img>"),mO=w('<div class="flex flex-col gap-1 items-end"><div class="p-2 w-full whitespace-pre-wrap agent-guest-bubble flex flex-col"data-testid=guest-bubble><audio controls>'),zv=e=>(()=>{var t=sO();return x(t,m(Le,{get children(){return [m(X,{get when(){return e.answer?.type==="text"},get children(){return m(gO,{get blockType(){return e.blockType},get answer(){return e.answer}})}}),m(X,{get when(){return e.answer?.type==="recording"},get children(){return m(hO,{get answer(){return e.answer}})}})]}}),null),x(t,m(W,{get when(){return e.showAvatar},get children(){return m(Sl,{isGuest:true,get theme(){return e.theme},get src(){return e.avatarSrc}})}}),null),M(r=>(r=e.hasHostAvatar?K()?"28px":"50px":void 0)!=null?t.style.setProperty("margin-left",r):t.style.removeProperty("margin-left")),t})(),gO=e=>{let[t,r]=R();return (()=>{var n=dO(),o=n.firstChild;return x(n,m(W,{get when(){return (e.answer.imgSrc??"").length>0},get children(){var i=lO();return x(i,()=>e.answer.imgSrc?.split(",").map(a=>(()=>{var s=fO();return G(s,"src",a),s})())),i}}),o),x(n,m(W,{get when(){return (e.answer.attachments??[]).length>0},get children(){return [(()=>{var i=jv();return x(i,m(ke,{get each(){return e.answer.attachments?.filter(a=>a.type.startsWith("image"))},children:(a,s)=>(()=>{var l=pO();return l.$$click=()=>r(a.blobUrl??a.url),M(u=>{var c=a.blobUrl??a.url,d=`Attached image ${s()+1}`,p=ye("agent-guest-bubble-image-attachment cursor-pointer",e.answer.attachments.filter(f=>f.type.startsWith("image")).length>1&&"max-w-[90%]");return c!==u.e&&G(l,"src",u.e=c),d!==u.t&&G(l,"alt",u.t=d),p!==u.a&&U(l,u.a=p),u},{e:void 0,t:void 0,a:void 0}),l})()})),M(()=>U(i,ye("flex gap-1 overflow-auto max-w-[350px]",K()?"flex-wrap justify-end":"items-center"))),i})(),(()=>{var i=jv();return x(i,m(ke,{get each(){return e.answer.attachments?.filter(a=>!a.type.startsWith("image"))},children:a=>m(Qs,{get file(){return {name:a.url.split("/").at(-1)}}})})),M(()=>U(i,ye("flex gap-1 overflow-auto max-w-[350px]",K()?"flex-wrap justify-end":"items-center"))),i})()]}}),o),x(o,m(W,{get when(){return Re(e.answer.label??e.answer.value)&&!e.answer.imgSrc},get children(){var i=cO();return x(i,(()=>{var a=L(()=>!!e.answer.isPassword);return ()=>a()?"*".repeat(e.answer.value.length):(()=>{switch(e.blockType){case "password input":return;case "image choice":return;case "file input":return e.answer.label??e.answer.value;case "autocomplete input":let s;try{if(s=JSON.parse(e.answer.value),s&&typeof s=="object"&&s.key&&s.value)return s.value}catch{}return e.answer.label??e.answer.value;case "choice input":return e.answer.label??e.answer.value;default:return !e.answer.isRequired&&e.answer.value==="** omited **"?"* No value provided":e.answer.value??e.answer.label}})()})()),M(()=>U(i,hr(!e.answer.isRequired&&e.answer.value==="** omited **"?"px-[12px] py-[4px] text-xs":"px-[15px] py-[7px]"))),i}})),x(n,m(Vv,{get isOpen(){return t()!==void 0},onClose:()=>r(void 0),get children(){var i=uO();return i.style.setProperty("border-radius","6px"),M(()=>G(i,"src",t())),i}}),null),M(()=>U(o,hr("p-[1px] whitespace-pre-wrap max-w-full agent-guest-bubble flex flex-col",!e.answer.isRequired&&e.answer.value==="** omited **"?"opacity-60 italic px-0":""))),n})()},hO=e=>(()=>{var t=mO(),r=t.firstChild,n=r.firstChild;return M(()=>G(n,"src",e.answer.blobUrl??e.answer.url)),t})();Ne(["click"]);var ba={labels:{placeholder:"Type your address..."},isRequired:true,restrictToList:true};var Gv=new Map,bO=300*1e3,Gu=class{baseUrl;sessionId;blockId;debounceTimeouts=new Map;constructor(t="/api/integrations",r="",n=""){this.baseUrl=t,this.sessionId=r,this.blockId=n;}setApiData(t,r,n){this.apiHost=t?.replace(/\/$/,""),this.sessionId=r,this.blockId=n;}apiHost="";async getSuggestions(t,r=5){if(!t.trim())return {suggestions:[],status:"ZERO_RESULTS"};let n=`${t}-${r}`,o=Gv.get(n);if(o&&Date.now()-o.timestamp<bO)return o.data;try{let i=navigator.language?.slice(0,2).toLowerCase()||"es",a=this.apiHost||window.location.origin,s=new URL(`${this.baseUrl}/geoloc`,a);s.searchParams.set("q",t),s.searchParams.set("limit",r.toString()),s.searchParams.set("sessionId",this.sessionId),s.searchParams.set("blockId",this.blockId),s.searchParams.set("language",i);let l=await fetch(s.toString());if(l.status===403)return {suggestions:[],status:"API_KEY_INVALID"};if(!l.ok)throw new Error(`API error: ${l.status}`);let u=await l.json();return Gv.set(n,{data:u,timestamp:Date.now()}),u}catch(i){return console.error("Error fetching address suggestions:",i),{suggestions:[],status:"ERROR"}}}async getPlaceDetails(t){try{let r=this.apiHost||window.location.origin,n=new URL(`${this.baseUrl}/place-details`,r);n.searchParams.set("place_id",t);let o=await fetch(n.toString());if(!o.ok)throw new Error(`API error: ${o.status}`);return await o.json()}catch(r){return console.error("Error fetching place details:",r),{place:null,status:"ERROR"}}}debounce(t,r,n){return((...o)=>{let i=this.debounceTimeouts.get(n);i&&clearTimeout(i);let a=window.setTimeout(()=>{t(...o),this.debounceTimeouts.delete(n);},r);this.debounceTimeouts.set(n,a);})}cleanup(){this.debounceTimeouts.forEach(t=>clearTimeout(t)),this.debounceTimeouts.clear();}},ya=new Gu;var yO=w('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px] relative"><div class="flex agent-input w-full relative">'),xO=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),vO=w('<div class="absolute agent-input top-full left-0 mt-2 right-0 border-gray-300 rounded-md shadow-lg z-50 max-h-60 overflow-y-auto scrollable-container">'),wO=w('<div><div class="flex gap-3 items-center"><div class="flex-shrink-0 opacity-50 mt-0.5"><svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=text-gray-400><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx=12 cy=10 r=3></circle></svg></div><div class="flex-1 min-w-0"><div class="font-medium text-sm">'),TO=w('<div class="text-xs opacity-70 mt-1">'),CO=w('<div class="absolute right-3 top-1/2 transform -translate-y-1/2"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-current">'),_O=w('<div class="absolute right-3 top-1/2 transform -translate-y-1/2 text-yellow-500">\u26A0\uFE0F'),qv=e=>{let[t,r]=R(e.defaultValue??""),[n,o]=R(false),[i,a]=R(null),[s,l]=R([]),[u,c]=R(-1),d,p,f=e.block.options?.restrictToList??ba.restrictToList,b=ya.debounce(async _=>{if(_.length<2){l([]);return}o(true),a(null);try{let A=await ya.getSuggestions(_);A.status==="OK"?(l(A.suggestions),setTimeout(()=>{d&&document.activeElement!==d&&d.focus({preventScroll:!0});},0)):A.status==="API_KEY_INVALID"?Rr.create({title:"Invalid Google API key",description:"Make sure the API key is valid and properly configured."}):A.status==="ZERO_RESULTS"?l([]):(a("Error fetching suggestions"),l([]));}catch(A){let I=A instanceof Error?A.message:"Unknown error";a(I),l([]);}finally{o(false);}},300,"address-suggestions"),g=_=>{r(_),c(-1),d&&d.removeAttribute("data-selected-description"),_.trim().length>=2?b(_.trim()):l([]),d&&document.activeElement!==d&&setTimeout(()=>{d?.focus({preventScroll:true});},0);},y=()=>{let _=d?.value||t();_.trim().length>=3&&b(_.trim());},T=_=>{let A=_.description;r(A),d&&(d.value=A,d.setAttribute("data-selected-description",_.description)),l([]),c(-1),d&&d.focus();},S=_=>{if(!p)return;let A=p.children[_];A&&A.scrollIntoView({behavior:"smooth",block:"nearest"});},E=_=>{if(s().length===0){_.key==="Enter"&&$();return}switch(_.key){case "ArrowDown":_.preventDefault(),c(I=>{let k=I<s().length-1?I+1:0;return setTimeout(()=>S(k),0),k});break;case "ArrowUp":_.preventDefault(),c(I=>{let k=I>0?I-1:s().length-1;return setTimeout(()=>S(k),0),k});break;case "Enter":_.preventDefault();let A=u();A>=0&&A<s().length?T(s()[A]):$();break;case "Escape":_.preventDefault(),l([]),c(-1);break}},h=_=>{let A=_.target;d&&p&&!d.contains(A)&&!p.contains(A)&&setTimeout(()=>{document.activeElement!==d&&l([]);},100);},C=()=>d?.value!==""&&d?.reportValidity(),$=()=>{let _=e.block.options?.isRequired??ba.isRequired,A=d?.value??t();!_&&!A&&(A="** omited **");let I=d?.getAttribute("data-selected-description");if(f&&A!=="** omited **"&&!I){d?.focus();return}I&&(A=I),!_||C()?e.onSubmit({type:"text",value:A,isRequired:_}):d?.focus();};ie(()=>{let _=e.context?.apiHost??dt({ignoreChatApiUrl:true}),A=e.context?.sessionId;ya.setApiData(_,A,e.block.id),window.addEventListener("message",H),document.addEventListener("click",h),!K()&&d&&setTimeout(()=>{d?.focus({preventScroll:true});},100);}),ae(()=>{window.removeEventListener("message",H),document.removeEventListener("click",h),ya.cleanup();});let H=_=>{let{data:A}=_;A.isFromAgent&&A.command==="setInputValue"&&r(A.value);},N=e.block.options?.isRequired??ba.isRequired;return (()=>{var _=yO(),A=_.firstChild;return x(A,m($t,{ref(I){var k=d;typeof k=="function"?k(I):d=I;},get value(){return t()},get placeholder(){return L(()=>!!n())()?"Loading address suggestions...":i()?"Enter address (suggestions unavailable)":e.block.options?.labels?.placeholder??ba.labels.placeholder},onInput:g,onFocus:y,onKeyDown:E,type:"text",get autocomplete(){return s().length<1?"off":"address-line1"}}),null),x(A,!N&&xO(),null),x(A,(()=>{var I=L(()=>s().length>0);return ()=>I()&&(()=>{var k=vO();k.$$mousedown=D=>{D.preventDefault();};var O=p;return typeof O=="function"?me(O,k):p=k,x(k,()=>s().map((D,F)=>(()=>{var j=wO(),ne=j.firstChild,ve=ne.firstChild,fe=ve.nextSibling,Be=fe.firstChild;return j.addEventListener("mouseenter",()=>c(F)),j.$$mousedown=pe=>{pe.preventDefault();},j.$$click=()=>T(D),x(Be,()=>D.structured_formatting.main_text),x(fe,(()=>{var pe=L(()=>!!D.structured_formatting.secondary_text);return ()=>pe()&&(()=>{var wt=TO();return x(wt,()=>D.structured_formatting.secondary_text),wt})()})(),null),M(()=>U(j,`px-4 py-3 agent-input-suggest cursor-pointer border-b last:border-b-0 ${u()===F?"bg-blue-50 dark:bg-blue-900/20":"hover:bg-gray-50 dark:hover:bg-gray-800"}`)),j})())),k})()})(),null),x(A,(()=>{var I=L(()=>!!n());return ()=>I()&&CO()})(),null),x(A,(()=>{var I=L(()=>!!(i()&&!n()));return ()=>I()&&(()=>{var k=_O();return M(()=>G(k,"title",`Address API error: ${i()}`)),k})()})(),null),x(_,m(We,{type:"button",class:"h-[56px]","on:click":$,get children(){return e.block.options?.labels?.button}}),null),_})()};Ne(["mousedown","click"]);var kl={labels:{placeholder:"Enter password..."},isRequired:true};var SO=w('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex relative agent-input w-full">'),kO=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),Yv=e=>{let[t,r]=R(e.defaultValue??""),n,o=c=>r(c),i=()=>n?.value!==""&&n?.reportValidity(),a=()=>{let c=e.block.options?.isRequired??kl.isRequired,d=n?.value??t();!c&&!d&&(d="** omited **"),!c||i()?e.onSubmit({type:"text",value:d,isRequired:c,isPassword:true}):n?.focus();},s=c=>{c.key==="Enter"&&a();};ie(()=>{!K()&&n&&n.focus({preventScroll:true}),window.addEventListener("message",l);}),ae(()=>{window.removeEventListener("message",l);});let l=c=>{let{data:d}=c;d.isFromAgent&&d.command==="setInputValue"&&r(d.value);},u=e.block.options?.isRequired??kl.isRequired;return (()=>{var c=SO(),d=c.firstChild;return c.$$keydown=s,x(d,m($t,{ref(p){var f=n;typeof f=="function"?f(p):n=p;},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??kl.labels.placeholder},onInput:o,type:"password"}),null),x(d,!u&&kO(),null),x(c,m(We,{isPassword:true,type:"button",class:"h-[56px]","on:click":a,get children(){return e.block.options?.labels?.button}}),null),c})()};Ne(["keydown"]);var Pl={labels:{placeholder:"Type your email..."},isRequired:true};var PO=w('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex relative agent-input w-full">'),EO=w('<div class="absolute right-2 -bottom-6 opacity-80 italic text-xs">* optional'),Kv=e=>{let[t,r]=R(e.defaultValue??""),n,o=c=>r(c),i=()=>n?.value!==""&&n?.reportValidity(),a=()=>{let c=e.block.options?.isRequired??Pl.isRequired,d=n?.value??t();!c&&!d&&(d="** omited **"),!c||i()?e.onSubmit({type:"text",value:d,isRequired:c}):n?.focus();},s=c=>{c.key==="Enter"&&a();};ie(()=>{!K()&&n&&n.focus({preventScroll:true}),window.addEventListener("message",l);}),ae(()=>{window.removeEventListener("message",l);});let l=c=>{let{data:d}=c;d.isFromAgent&&d.command==="setInputValue"&&r(d.value);},u=e.block.options?.isRequired??Pl.isRequired;return (()=>{var c=PO(),d=c.firstChild;return c.$$keydown=s,x(d,m($t,{ref(p){var f=n;typeof f=="function"?f(p):n=p;},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??Pl.labels.placeholder},onInput:o,type:"email",autocomplete:"email"}),null),x(d,!u&&EO(),null),x(c,m(We,{type:"button",class:"h-[56px]","on:click":a,get children(){return e.block.options?.labels?.button}}),null),c})()};Ne(["keydown"]);var IO=w("<div>"),AO=w('<div class="flex justify-end animate-fade-in gap-2 agent-input-container">'),Xv=e=>{let[t,r]=Cr(R(),{key:`agent-${e.context.agent.id}-input-${e.chunkIndex}`,storage:e.context.storage});ie(()=>{e.isOngoingLastChunk&&ue(t())&&e.onSubmit(t());});let n=async i=>{r(i),e.onSubmit(i);},o=i=>{r({type:"text",value:i}),e.onSkip();};return Ce(()=>{let i=Us().findLast(a=>e.chunkIndex===a.inputIndex)?.formattedMessage;i&&e.block.type!=="file input"&&r(a=>a?.type==="text"?{...a,label:i}:a);}),m(Le,{get children(){return [m(X,{get when(){return t()&&!e.hasError},get children(){return m(zv,{get theme(){return e.theme},get answer(){return t()},get blockType(){return e.block.type},get showAvatar(){return e.guestAvatar?.isEnabled??Si},get avatarSrc(){return e.guestAvatar?.url&&e.guestAvatar.url},get hasHostAvatar(){return e.hasHostAvatar}})}}),m(X,{get when(){return at(t())||e.hasError},get children(){var i=AO(),a=e.ref;return typeof a=="function"?me(a,i):e.ref=i,x(i,m(W,{get when(){return e.hasHostAvatar},get children(){var s=IO();return M(()=>U(s,"flex flex-shrink-0 items-center "+(K()?"w-6 h-6":"w-10 h-10"))),s}}),null),x(i,m(RO,{get context(){return e.context},get block(){return e.block},get chunkIndex(){return e.chunkIndex},get isInputPrefillEnabled(){return e.isInputPrefillEnabled},get existingAnswer(){return L(()=>!!e.hasError)()?OO(t()):void 0},get onTransitionEnd(){return e.onTransitionEnd},onSubmit:n,onSkip:o}),null),M(()=>G(i,"data-blockid",e.block.id)),i}})]}})},OO=e=>{if(e)return e.type==="text"?e.value:e.url},RO=e=>{let t=o=>e.onSubmit(o),r=()=>e.existingAnswer??(e.isInputPrefillEnabled?e.block.prefilledValue:void 0),n=()=>e.onSubmit({type:"text",value:e.block.options?.labels?.success??il.labels.success});return m(Le,{get children(){return [m(X,{get when(){return e.block.type==="text input"},get children(){return m(Lv,{get block(){return e.block},get defaultValue(){return r()},get context(){return e.context},onSubmit:t})}}),m(X,{get when(){return e.block.type==="number input"},get children(){return m(Px,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(X,{get when(){return e.block.type==="email input"},get children(){return m(Kv,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(X,{get when(){return e.block.type==="autocomplete input"},get children(){return m(Uv,{get context(){return e.context},get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(X,{get when(){return e.block.type==="password input"},get children(){return m(Yv,{get context(){return e.context},get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(X,{get when(){return e.block.type==="address input"},get children(){return m(qv,{get context(){return e.context},get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(X,{get when(){return e.block.type==="url input"},get children(){return m(Fv,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(X,{get when(){return e.block.type==="phone number input"},get children(){return m(Vx,{get isRequired(){return e.block.options?.isRequired},get labels(){return e.block.options?.labels},get defaultCountryCode(){return e.block.options?.defaultCountryCode},get defaultValue(){return r()},onSubmit:t})}}),m(X,{get when(){return e.block.type==="date input"},get children(){return m(Cx,{get options(){return e.block.options},get defaultValue(){return r()},onSubmit:t})}}),m(X,{get when(){return DO(e.block)},keyed:true,children:o=>m(Le,{get children(){return [m(X,{get when(){return !o.options?.isMultipleChoice},get children(){return m(by,{get chunkIndex(){return e.chunkIndex},get defaultItems(){return o.items},get options(){return o.options},onSubmit:t})}}),m(X,{get when(){return o.options?.isMultipleChoice},get children(){return m(wy,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t})}})]}})}),m(X,{get when(){return MO(e.block)},keyed:true,children:o=>m(Le,{get children(){return [m(X,{get when(){return !o.options?.isMultipleChoice},get children(){return m(Gx,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t,get onTransitionEnd(){return e.onTransitionEnd}})}}),m(X,{get when(){return o.options?.isMultipleChoice},get children(){return m(zx,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t,get onTransitionEnd(){return e.onTransitionEnd}})}})]}})}),m(X,{get when(){return e.block.type==="rating input"},get children(){return m(qx,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(X,{get when(){return e.block.type==="file input"},get children(){return m(Sx,{get context(){return e.context},get block(){return e.block},onSubmit:t,get onSkip(){return e.onSkip}})}}),m(X,{get when(){return e.block.type==="payment input"},get children(){return m(Bx,{get context(){return e.context},get options(){return {...e.block.options,...e.block.runtimeOptions}},onSuccess:n,get onTransitionEnd(){return e.onTransitionEnd}})}})]}})},DO=e=>e?.type==="choice input"?e:void 0,MO=e=>e?.type==="image choice"?e:void 0;var $O=w('<div class="flex items-center gap-1"><div class="w-2 h-2 rounded-full bubble1"></div><div class="w-2 h-2 rounded-full bubble2"></div><div class="w-2 h-2 rounded-full bubble3">'),Nt=()=>$O();var Zv={isAutoplayEnabled:true};var NO=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><audio controls>'),LO=400,FO=100,qu,Qv=e=>{let t=false,r,n,[o,i]=R(!!e.onTransitionEnd);return ie(()=>{qu=setTimeout(()=>{t||(t=true,i(false),setTimeout(()=>e.onTransitionEnd?.(r),LO));},FO);}),ae(()=>{qu&&clearTimeout(qu);}),(()=>{var a=NO(),s=a.firstChild,l=s.firstChild,u=l.firstChild,c=u.nextSibling,d=r;typeof d=="function"?me(d,a):r=a,x(u,(()=>{var f=L(()=>!!o());return ()=>f()&&m(Nt,{})})());var p=n;return typeof p=="function"?me(p,c):n=c,M(f=>{var b=ye("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),g=o()?"64px":"100%",y=o()?"32px":"100%",T=e.content?.url,S=e.onTransitionEnd?e.content?.isAutoplayEnabled??Zv.isAutoplayEnabled:false,E="z-10 text-fade-in "+(o()?"opacity-0":"opacity-100 m-2"),h=o()?K()?"32px":"36px":"revert";return b!==f.e&&U(a,f.e=b),g!==f.t&&((f.t=g)!=null?u.style.setProperty("width",g):u.style.removeProperty("width")),y!==f.a&&((f.a=y)!=null?u.style.setProperty("height",y):u.style.removeProperty("height")),T!==f.o&&G(c,"src",f.o=T),S!==f.i&&(c.autoplay=f.i=S),E!==f.n&&U(c,f.n=E),h!==f.s&&((f.s=h)!=null?c.style.setProperty("height",h):c.style.removeProperty("height")),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),a})()};var BO=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><div class="w-full overflow-y-auto">'),Yu,UO=400,Jv=e=>{let t,[r,n]=R(!!e.onTransitionEnd),o;return ie(()=>{qi({args:{...e.content.initFunction.args,agentElement:o},content:e.content.initFunction.content}),e.content.waitForEventFunction&&qi({args:{...e.content.waitForEventFunction.args,continueFlow:i=>e.onCompleted(i?{type:"text",value:i}:void 0)},content:e.content.waitForEventFunction.content}),Yu=setTimeout(()=>{n(false),setTimeout(()=>e.onTransitionEnd?.(t),UO);},2e3);}),ae(()=>{Yu&&clearTimeout(Yu);}),(()=>{var i=BO(),a=i.firstChild,s=a.firstChild,l=s.firstChild,u=l.nextSibling,c=u.firstChild,d=t;typeof d=="function"?me(d,i):t=i,x(l,(()=>{var f=L(()=>!!r());return ()=>f()&&m(Nt,{})})());var p=o;return typeof p=="function"?me(p,c):o=c,M(f=>{var b=ye("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),g=`width: ${r()?"64px":"100%"}; height: ${r()?"32px":"100%"};`,y=ye("p-2 z-20 text-fade-in w-full",r()?"opacity-0":"opacity-100"),T=r()?`height: ${K()?"32px":"36px"};`:void 0,S=`max-height: calc(${Dp()} - 100px);`;return b!==f.e&&U(i,f.e=b),f.t=hn(l,g,f.t),y!==f.a&&U(u,f.a=y),f.o=hn(u,T,f.o),f.i=hn(c,S,f.i),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()};var ew={height:400};var VO=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><iframe id=embed-bubble-content class="w-full h-full ">'),Ku,HO=400,tw=e=>{let t,[r,n]=R(!!e.onTransitionEnd),o=i=>{e.content?.waitForEvent?.isEnabled&&Re(i.data.name)&&i.data.name===e.content?.waitForEvent.name&&(e.onCompleted?.(e.content.waitForEvent.saveDataInVariableId&&i.data.data?{type:"text",value:i.data.data}:void 0),window.removeEventListener("message",o));};return ie(()=>{Ku=setTimeout(()=>{n(false),e.content?.waitForEvent?.isEnabled&&window.addEventListener("message",o),setTimeout(()=>{e.onTransitionEnd?.(t);},HO);},2e3);}),ae(()=>{Ku&&clearTimeout(Ku),window.removeEventListener("message",o);}),(()=>{var i=VO(),a=i.firstChild,s=a.firstChild,l=s.firstChild,u=l.nextSibling,c=u.firstChild,d=t;return typeof d=="function"?me(d,i):t=i,x(l,(()=>{var p=L(()=>!!r());return ()=>p()&&m(Nt,{})})()),M(p=>{var f=ye("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),b=r()?"64px":"100%",g=r()?"32px":"100%",y=ye("p-4 z-20 text-fade-in w-full",r()?"opacity-0":"opacity-100 p-4"),T=r()?K()?"32px":"36px":`${e.content?.height??ew.height}px`,S=e.content?.url;return f!==p.e&&U(i,p.e=f),b!==p.t&&((p.t=b)!=null?l.style.setProperty("width",b):l.style.removeProperty("width")),g!==p.a&&((p.a=g)!=null?l.style.setProperty("height",g):l.style.removeProperty("height")),y!==p.o&&U(u,p.o=y),T!==p.i&&((p.i=T)!=null?u.style.setProperty("height",T):u.style.removeProperty("height")),S!==p.n&&G(c,"src",p.n=S),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()};var rw={clickLink:{alt:"Bubble image"}};var WO=w('<img elementtiming="Bubble image"fetchpriority=high>'),jO=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),zO=w("<a target=_blank rel=noreferrer>"),GO=w("<figure>"),qO=400,YO=5e3,El,nw=e=>{let t,r,[n,o]=R(!!e.onTransitionEnd),i=()=>{n()&&(o(false),setTimeout(()=>{e.onTransitionEnd?.(t);},qO));};ie(()=>{r&&(El=setTimeout(i,YO),r.onload=()=>{clearTimeout(El),i();});}),ae(()=>{El&&clearTimeout(El);});let a=(()=>{var s=WO(),l=r;return typeof l=="function"?me(l,s):r=s,s.style.setProperty("max-height","512px"),M(u=>{var c=e.content?.url,d=e.content?.clickLink?.alt??rw.clickLink.alt,p=ye(n()?"opacity-0":"opacity-100",e.onTransitionEnd?"text-fade-in":void 0,e.content?.url?.endsWith(".svg")?"w-full":void 0),f=n()?"32px":"auto";return c!==u.e&&G(s,"src",u.e=c),d!==u.t&&G(s,"alt",u.t=d),p!==u.a&&U(s,u.a=p),f!==u.o&&((u.o=f)!=null?s.style.setProperty("height",f):s.style.removeProperty("height")),u},{e:void 0,t:void 0,a:void 0,o:void 0}),s})();return (()=>{var s=jO(),l=s.firstChild,u=l.firstChild,c=u.firstChild,d=t;return typeof d=="function"?me(d,s):t=s,x(c,(()=>{var p=L(()=>!!n());return ()=>p()?m(Nt,{}):null})()),x(u,(()=>{var p=L(()=>!!e.content?.clickLink);return ()=>p()?(()=>{var f=zO();return x(f,a),M(b=>{var g=e.content.clickLink.url,y=ye("z-10",n()?"h-8":"p-4");return g!==b.e&&G(f,"href",b.e=g),y!==b.t&&U(f,b.t=y),b},{e:void 0,t:void 0}),f})():(()=>{var f=GO();return x(f,a),M(()=>U(f,ye("z-10",!n()&&"p-4",n()?K()?"h-8":"h-9":""))),f})()})(),null),M(p=>{var f=ye("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),b=n()?"64px":"100%",g=n()?"32px":"100%";return f!==p.e&&U(s,p.e=f),b!==p.t&&((p.t=b)!=null?c.style.setProperty("width",b):c.style.removeProperty("width")),g!==p.a&&((p.a=g)!=null?c.style.setProperty("height",g):c.style.removeProperty("height")),p},{e:void 0,t:void 0,a:void 0}),s})()};var ow=({bubbleContent:e,typingSettings:t})=>{let r=e.match(/(\w+)/g)?.length??0;r===0&&(r=e.length);let{enabled:n,speed:o,maxDelay:i}={enabled:t?.enabled??ft.typingEmulation.enabled,speed:t?.speed??ft.typingEmulation.speed,maxDelay:t?.maxDelay??ft.typingEmulation.maxDelay},s=n?r/o*6e4:0;return s>i*1e3&&(s=i*1e3),s};var Xu=e=>e.map(t=>t.text??Xu(t.children)).join("");var KO=w("<br>"),XO=w("<span>"),ZO=(e,t,r)=>{let n="";return e&&(n+="slate-bold"),t&&(n+=" slate-italic"),r&&(n+=" slate-underline"),n},iw=e=>(()=>{var t=XO();return x(t,()=>e.text,null),x(t,m(W,{get when(){return L(()=>!!e.isUniqueChild)()&&Ze(e.text)},get children(){return KO()}}),null),M(()=>U(t,ZO(e.bold,e.italic,e.underline))),t})();var QO=w('<a target=_blank rel="noopener noreferrer">'),JO=w("<ol>"),eR=w("<ul>"),tR=w("<li>"),rR=w("<span>"),nR=w("<div>"),qn=e=>m(Le,{get children(){return [m(X,{get when(){return ue(e.element.text)},get children(){return m(iw,be(()=>e.element,{get isUniqueChild(){return e.isUniqueChild??false}}))}}),m(X,{when:true,get children(){return m(Le,{get children(){return [m(X,{get when(){return e.element.type==="a"},get children(){var t=QO();return x(t,m(ke,{get each(){return e.element.children},children:r=>m(qn,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),M(()=>G(t,"href",e.element.url)),t}}),m(X,{get when(){return e.element.type==="ol"},get children(){var t=JO();return x(t,m(ke,{get each(){return e.element.children},children:r=>m(qn,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(X,{get when(){return e.element.type==="ul"},get children(){var t=eR();return x(t,m(ke,{get each(){return e.element.children},children:r=>m(qn,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(X,{get when(){return e.element.type==="li"},get children(){var t=tR();return x(t,m(ke,{get each(){return e.element.children},children:r=>m(qn,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(X,{when:true,get children(){return m(oR,{get element(){return e.element},get insideInlineVariable(){return e.insideInlineVariable??false},get children(){return m(ke,{get each(){return e.element.children},children:t=>m(qn,{element:t,get isUniqueChild(){return e.element.children?.length===1},get insideInlineVariable(){return e.element.type==="inline-variable"}})})}})}})]}})}})]}}),oR=e=>m(Le,{get children(){return [m(X,{get when(){return e.element.type==="inline-variable"||e.insideInlineVariable},get children(){var t=rR();return x(t,()=>e.children),M(()=>G(t,"data-element-type",e.element.type)),t}}),m(X,{when:true,get children(){var t=nR();return x(t,()=>e.children),M(()=>G(t,"data-element-type",e.element.type)),t}})]}});var iR=w('<div><div class="flex w-full items-center"><div class="flex relative items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble></div><div>'),aR=400,Zu,aw=e=>{let t,[r,n]=R(!!e.onTransitionEnd),o=()=>{r()&&(n(false),setTimeout(()=>{e.onTransitionEnd?.(t);},aR));};return ie(()=>{if(!r)return;let i=e.content?.richText?Xu(e.content.richText):"",a=e.typingEmulation?.enabled===false||e.isTypingSkipped?0:ow({bubbleContent:i,typingSettings:e.typingEmulation});Zu=setTimeout(o,a);}),ae(()=>{Zu&&clearTimeout(Zu);}),(()=>{var i=iR(),a=i.firstChild,s=a.firstChild,l=s.firstChild,u=l.nextSibling,c=t;return typeof c=="function"?me(c,i):t=i,x(l,(()=>{var d=L(()=>!!r());return ()=>d()&&m(Nt,{})})()),x(u,m(ke,{get each(){return e.content?.richText},children:d=>m(qn,{element:d})})),M(d=>{var p=ye("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),f=r()?"64px":"100%",b=r()?"32px":"100%",g=ye("overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative text-ellipsis",r()?"opacity-0":"opacity-100"),y=r()?K()?"16px":"20px":"100%";return p!==d.e&&U(i,d.e=p),f!==d.t&&((d.t=f)!=null?l.style.setProperty("width",f):l.style.removeProperty("width")),b!==d.a&&((d.a=b)!=null?l.style.setProperty("height",b):l.style.removeProperty("height")),g!==d.o&&U(u,d.o=g),y!==d.i&&((d.i=y)!=null?u.style.setProperty("height",y):u.style.removeProperty("height")),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()};var Qu=["youtube","vimeo","tiktok","gumlet"],Yn={height:400,maxWidth:"100%",areControlsDisplayed:true,isAutoplayEnabled:true};var sR="https://www.youtube.com/embed";var lR="https://player.vimeo.com/video";var cR="https://www.tiktok.com/embed/v2";var uR="https://play.gumlet.io/embed";var sw={vimeo:lR,youtube:sR,tiktok:cR,gumlet:uR};var dR=w("<video>"),fR=w('<div><iframe class="w-full h-full"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen>'),pR=w('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start agent-host-bubble overflow-hidden w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),mR=400,Ju,lw=e=>{let t,[r,n]=R(!!e.onTransitionEnd);return ie(()=>{let o=e.content?.type&&Qu.includes(e.content?.type)?2e3:100;Ju=setTimeout(()=>{r()&&(n(false),setTimeout(()=>{e.onTransitionEnd?.(t);},mR));},o);}),ae(()=>{Ju&&clearTimeout(Ju);}),(()=>{var o=pR(),i=o.firstChild,a=i.firstChild,s=a.firstChild,l=t;return typeof l=="function"?me(l,o):t=o,x(s,(()=>{var u=L(()=>!!r());return ()=>u()&&m(Nt,{})})()),x(a,m(Le,{get children(){return [m(X,{get when(){return e.content?.type&&e.content.type==="url"},get children(){var u=dR();return M(c=>{var d=e.onTransitionEnd?e.content?.isAutoplayEnabled??Yn.isAutoplayEnabled:false,p=e.content?.url,f=e.content?.areControlsDisplayed??Yn.areControlsDisplayed,b="p-4 focus:outline-none w-full z-10 text-fade-in rounded-md "+(r()?"opacity-0":"opacity-100"),g=r()?K()?"32px":"36px":"auto",y=e.content?.aspectRatio,T=e.content?.maxWidth??Yn.maxWidth;return d!==c.e&&(u.autoplay=c.e=d),p!==c.t&&G(u,"src",c.t=p),f!==c.a&&(u.controls=c.a=f),b!==c.o&&U(u,c.o=b),g!==c.i&&((c.i=g)!=null?u.style.setProperty("height",g):u.style.removeProperty("height")),y!==c.n&&((c.n=y)!=null?u.style.setProperty("aspect-ratio",y):u.style.removeProperty("aspect-ratio")),T!==c.s&&((c.s=T)!=null?u.style.setProperty("max-width",T):u.style.removeProperty("max-width")),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),u}}),m(X,{get when(){return L(()=>!!e.content?.type)()&&Qu.includes(e.content.type)},get children(){var u=fR(),c=u.firstChild;return M(d=>{var p=jt("p-4 z-10 text-fade-in w-full",r()?"opacity-0":"opacity-100 p-4"),f=r()?K()?"32px":"36px":e.content?.aspectRatio?void 0:`${e.content?.height??Yn.height}px`,b=e.content?.aspectRatio,g=e.content?.maxWidth??Yn.maxWidth,y=`${sw[e.content?.type]}/${e.content?.id??""}${e.content?.queryParamsStr??""}`;return p!==d.e&&U(u,d.e=p),f!==d.t&&((d.t=f)!=null?u.style.setProperty("height",f):u.style.removeProperty("height")),b!==d.a&&((d.a=b)!=null?u.style.setProperty("aspect-ratio",b):u.style.removeProperty("aspect-ratio")),g!==d.o&&((d.o=g)!=null?u.style.setProperty("max-width",g):u.style.removeProperty("max-width")),y!==d.i&&G(c,"src",d.i=y),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),u}})]}}),null),M(u=>{var c=jt("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),d=r()?"64px":"100%",p=r()?"32px":"100%",f=e.content?.maxWidth??Yn.maxWidth;return c!==u.e&&U(o,u.e=c),d!==u.t&&((u.t=d)!=null?s.style.setProperty("width",d):s.style.removeProperty("width")),p!==u.a&&((u.a=p)!=null?s.style.setProperty("height",p):s.style.removeProperty("height")),f!==u.o&&((u.o=f)!=null?s.style.setProperty("max-width",f):s.style.removeProperty("max-width")),u},{e:void 0,t:void 0,a:void 0,o:void 0}),o})()};var cw=e=>m(Le,{get children(){return [m(X,{get when(){return e.message.type==="text"},get children(){return m(aw,{get content(){return e.message.content},get isTypingSkipped(){return e.isTypingSkipped},get typingEmulation(){return e.typingEmulation},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(X,{get when(){return e.message.type==="image"},get children(){return m(nw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(X,{get when(){return e.message.type==="video"},get children(){return m(lw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(X,{get when(){return e.message.type==="embed"},get children(){return m(tw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(X,{get when(){return e.message.type==="custom-embed"},get children(){return m(Jv,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(X,{get when(){return e.message.type==="audio"},get children(){return m(Qv,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}})]}});var{entries:xw,setPrototypeOf:uw,isFrozen:gR,getPrototypeOf:hR,getOwnPropertyDescriptor:bR}=Object,{freeze:It,seal:tr,create:vw}=Object,{apply:id,construct:ad}=typeof Reflect<"u"&&Reflect;It||(It=function(t){return t});tr||(tr=function(t){return t});id||(id=function(t,r,n){return t.apply(r,n)});ad||(ad=function(t,r){return new t(...r)});var Il=At(Array.prototype.forEach),yR=At(Array.prototype.lastIndexOf),dw=At(Array.prototype.pop),xa=At(Array.prototype.push),xR=At(Array.prototype.splice),Ol=At(String.prototype.toLowerCase),ed=At(String.prototype.toString),fw=At(String.prototype.match),va=At(String.prototype.replace),vR=At(String.prototype.indexOf),wR=At(String.prototype.trim),br=At(Object.prototype.hasOwnProperty),Et=At(RegExp.prototype.test),wa=TR(TypeError);function At(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return id(e,t,n)}}function TR(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ad(e,r)}}function Se(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ol;uw&&uw(e,null);let n=t.length;for(;n--;){let o=t[n];if(typeof o=="string"){let i=r(o);i!==o&&(gR(t)||(t[n]=i),o=i);}e[o]=true;}return e}function CR(e){for(let t=0;t<e.length;t++)br(e,t)||(e[t]=null);return e}function Kn(e){let t=vw(null);for(let[r,n]of xw(e))br(e,r)&&(Array.isArray(n)?t[r]=CR(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=Kn(n):t[r]=n);return t}function Ta(e,t){for(;e!==null;){let n=bR(e,t);if(n){if(n.get)return At(n.get);if(typeof n.value=="function")return At(n.value)}e=hR(e);}function r(){return null}return r}var pw=It(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),td=It(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),rd=It(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),_R=It(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),nd=It(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),SR=It(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),mw=It(["#text"]),gw=It(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),od=It(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),hw=It(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Al=It(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),kR=tr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),PR=tr(/<%[\w\W]*|[\w\W]*%>/gm),ER=tr(/\$\{[\w\W]*/gm),IR=tr(/^data-[\-\w.\u00B7-\uFFFF]+$/),AR=tr(/^aria-[\-\w]+$/),ww=tr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),OR=tr(/^(?:\w+script|data):/i),RR=tr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Tw=tr(/^html$/i),DR=tr(/^[a-z][.\w]*(-[.\w]+)+$/i),bw=Object.freeze({__proto__:null,ARIA_ATTR:AR,ATTR_WHITESPACE:RR,CUSTOM_ELEMENT:DR,DATA_ATTR:IR,DOCTYPE_NAME:Tw,ERB_EXPR:PR,IS_ALLOWED_URI:ww,IS_SCRIPT_OR_DATA:OR,MUSTACHE_EXPR:kR,TMPLIT_EXPR:ER}),Ca={element:1,text:3,progressingInstruction:7,comment:8,document:9},MR=function(){return typeof window>"u"?null:window},$R=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null,o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(n=r.getAttribute(o));let i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},yw=function(){return {afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Cw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:MR(),t=le=>Cw(le);if(t.version="3.2.4",t.removed=[],!e||!e.document||e.document.nodeType!==Ca.document||!e.Element)return t.isSupported=false,t;let{document:r}=e,n=r,o=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:s,Element:l,NodeFilter:u,NamedNodeMap:c=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:f}=e,b=l.prototype,g=Ta(b,"cloneNode"),y=Ta(b,"remove"),T=Ta(b,"nextSibling"),S=Ta(b,"childNodes"),E=Ta(b,"parentNode");if(typeof a=="function"){let le=r.createElement("template");le.content&&le.content.ownerDocument&&(r=le.content.ownerDocument);}let h,C="",{implementation:$,createNodeIterator:H,createDocumentFragment:N,getElementsByTagName:_}=r,{importNode:A}=n,I=yw();t.isSupported=typeof xw=="function"&&typeof E=="function"&&$&&$.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:k,ERB_EXPR:O,TMPLIT_EXPR:D,DATA_ATTR:F,ARIA_ATTR:j,IS_SCRIPT_OR_DATA:ne,ATTR_WHITESPACE:ve,CUSTOM_ELEMENT:fe}=bw,{IS_ALLOWED_URI:Be}=bw,pe=null,wt=Se({},[...pw,...td,...rd,...nd,...mw]),Ye=null,rr=Se({},[...gw,...od,...hw,...Al]),Ve=Object.seal(vw(null,{tagNameCheck:{writable:true,configurable:false,enumerable:true,value:null},attributeNameCheck:{writable:true,configurable:false,enumerable:true,value:null},allowCustomizedBuiltInElements:{writable:true,configurable:false,enumerable:true,value:false}})),Ut=null,Vt=null,Ke=true,Oe=true,Tt=false,gn=true,Mr=false,Jn=true,nr=false,eo=false,$l=false,to=false,ka=false,Pa=false,md=true,gd=false,u0="user-content-",Nl=true,oi=false,ro={},no=null,hd=Se({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),bd=null,yd=Se({},["audio","video","img","source","image","track"]),Ll=null,xd=Se({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ea="http://www.w3.org/1998/Math/MathML",Ia="http://www.w3.org/2000/svg",$r="http://www.w3.org/1999/xhtml",oo=$r,Fl=false,Bl=null,d0=Se({},[Ea,Ia,$r],ed),Aa=Se({},["mi","mo","mn","ms","mtext"]),Oa=Se({},["annotation-xml"]),f0=Se({},["title","style","font","a","script"]),ii=null,p0=["application/xhtml+xml","text/html"],m0="text/html",ut=null,io=null,g0=r.createElement("form"),vd=function(P){return P instanceof RegExp||P instanceof Function},Ul=function(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(io&&io===P)){if((!P||typeof P!="object")&&(P={}),P=Kn(P),ii=p0.indexOf(P.PARSER_MEDIA_TYPE)===-1?m0:P.PARSER_MEDIA_TYPE,ut=ii==="application/xhtml+xml"?ed:Ol,pe=br(P,"ALLOWED_TAGS")?Se({},P.ALLOWED_TAGS,ut):wt,Ye=br(P,"ALLOWED_ATTR")?Se({},P.ALLOWED_ATTR,ut):rr,Bl=br(P,"ALLOWED_NAMESPACES")?Se({},P.ALLOWED_NAMESPACES,ed):d0,Ll=br(P,"ADD_URI_SAFE_ATTR")?Se(Kn(xd),P.ADD_URI_SAFE_ATTR,ut):xd,bd=br(P,"ADD_DATA_URI_TAGS")?Se(Kn(yd),P.ADD_DATA_URI_TAGS,ut):yd,no=br(P,"FORBID_CONTENTS")?Se({},P.FORBID_CONTENTS,ut):hd,Ut=br(P,"FORBID_TAGS")?Se({},P.FORBID_TAGS,ut):{},Vt=br(P,"FORBID_ATTR")?Se({},P.FORBID_ATTR,ut):{},ro=br(P,"USE_PROFILES")?P.USE_PROFILES:false,Ke=P.ALLOW_ARIA_ATTR!==false,Oe=P.ALLOW_DATA_ATTR!==false,Tt=P.ALLOW_UNKNOWN_PROTOCOLS||false,gn=P.ALLOW_SELF_CLOSE_IN_ATTR!==false,Mr=P.SAFE_FOR_TEMPLATES||false,Jn=P.SAFE_FOR_XML!==false,nr=P.WHOLE_DOCUMENT||false,to=P.RETURN_DOM||false,ka=P.RETURN_DOM_FRAGMENT||false,Pa=P.RETURN_TRUSTED_TYPE||false,$l=P.FORCE_BODY||false,md=P.SANITIZE_DOM!==false,gd=P.SANITIZE_NAMED_PROPS||false,Nl=P.KEEP_CONTENT!==false,oi=P.IN_PLACE||false,Be=P.ALLOWED_URI_REGEXP||ww,oo=P.NAMESPACE||$r,Aa=P.MATHML_TEXT_INTEGRATION_POINTS||Aa,Oa=P.HTML_INTEGRATION_POINTS||Oa,Ve=P.CUSTOM_ELEMENT_HANDLING||{},P.CUSTOM_ELEMENT_HANDLING&&vd(P.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ve.tagNameCheck=P.CUSTOM_ELEMENT_HANDLING.tagNameCheck),P.CUSTOM_ELEMENT_HANDLING&&vd(P.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ve.attributeNameCheck=P.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),P.CUSTOM_ELEMENT_HANDLING&&typeof P.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ve.allowCustomizedBuiltInElements=P.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Mr&&(Oe=false),ka&&(to=true),ro&&(pe=Se({},mw),Ye=[],ro.html===true&&(Se(pe,pw),Se(Ye,gw)),ro.svg===true&&(Se(pe,td),Se(Ye,od),Se(Ye,Al)),ro.svgFilters===true&&(Se(pe,rd),Se(Ye,od),Se(Ye,Al)),ro.mathMl===true&&(Se(pe,nd),Se(Ye,hw),Se(Ye,Al))),P.ADD_TAGS&&(pe===wt&&(pe=Kn(pe)),Se(pe,P.ADD_TAGS,ut)),P.ADD_ATTR&&(Ye===rr&&(Ye=Kn(Ye)),Se(Ye,P.ADD_ATTR,ut)),P.ADD_URI_SAFE_ATTR&&Se(Ll,P.ADD_URI_SAFE_ATTR,ut),P.FORBID_CONTENTS&&(no===hd&&(no=Kn(no)),Se(no,P.FORBID_CONTENTS,ut)),Nl&&(pe["#text"]=true),nr&&Se(pe,["html","head","body"]),pe.table&&(Se(pe,["tbody"]),delete Ut.tbody),P.TRUSTED_TYPES_POLICY){if(typeof P.TRUSTED_TYPES_POLICY.createHTML!="function")throw wa('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof P.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw wa('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');h=P.TRUSTED_TYPES_POLICY,C=h.createHTML("");}else h===void 0&&(h=$R(f,o)),h!==null&&typeof C=="string"&&(C=h.createHTML(""));It&&It(P),io=P;}},wd=Se({},[...td,...rd,..._R]),Td=Se({},[...nd,...SR]),h0=function(P){let z=E(P);(!z||!z.tagName)&&(z={namespaceURI:oo,tagName:"template"});let oe=Ol(P.tagName),Xe=Ol(z.tagName);return Bl[P.namespaceURI]?P.namespaceURI===Ia?z.namespaceURI===$r?oe==="svg":z.namespaceURI===Ea?oe==="svg"&&(Xe==="annotation-xml"||Aa[Xe]):!!wd[oe]:P.namespaceURI===Ea?z.namespaceURI===$r?oe==="math":z.namespaceURI===Ia?oe==="math"&&Oa[Xe]:!!Td[oe]:P.namespaceURI===$r?z.namespaceURI===Ia&&!Oa[Xe]||z.namespaceURI===Ea&&!Aa[Xe]?false:!Td[oe]&&(f0[oe]||!wd[oe]):!!(ii==="application/xhtml+xml"&&Bl[P.namespaceURI]):false},yr=function(P){xa(t.removed,{element:P});try{E(P).removeChild(P);}catch{y(P);}},Ra=function(P,z){try{xa(t.removed,{attribute:z.getAttributeNode(P),from:z});}catch{xa(t.removed,{attribute:null,from:z});}if(z.removeAttribute(P),P==="is")if(to||ka)try{yr(z);}catch{}else try{z.setAttribute(P,"");}catch{}},Cd=function(P){let z=null,oe=null;if($l)P="<remove></remove>"+P;else {let mt=fw(P,/^[\r\n\t ]+/);oe=mt&&mt[0];}ii==="application/xhtml+xml"&&oo===$r&&(P='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+P+"</body></html>");let Xe=h?h.createHTML(P):P;if(oo===$r)try{z=new p().parseFromString(Xe,ii);}catch{}if(!z||!z.documentElement){z=$.createDocument(oo,"template",null);try{z.documentElement.innerHTML=Fl?C:Xe;}catch{}}let yt=z.body||z.documentElement;return P&&oe&&yt.insertBefore(r.createTextNode(oe),yt.childNodes[0]||null),oo===$r?_.call(z,nr?"html":"body")[0]:nr?z.documentElement:yt},_d=function(P){return H.call(P.ownerDocument||P,P,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Vl=function(P){return P instanceof d&&(typeof P.nodeName!="string"||typeof P.textContent!="string"||typeof P.removeChild!="function"||!(P.attributes instanceof c)||typeof P.removeAttribute!="function"||typeof P.setAttribute!="function"||typeof P.namespaceURI!="string"||typeof P.insertBefore!="function"||typeof P.hasChildNodes!="function")},Sd=function(P){return typeof s=="function"&&P instanceof s};function Nr(le,P,z){Il(le,oe=>{oe.call(t,P,z,io);});}let kd=function(P){let z=null;if(Nr(I.beforeSanitizeElements,P,null),Vl(P))return yr(P),true;let oe=ut(P.nodeName);if(Nr(I.uponSanitizeElement,P,{tagName:oe,allowedTags:pe}),P.hasChildNodes()&&!Sd(P.firstElementChild)&&Et(/<[/\w]/g,P.innerHTML)&&Et(/<[/\w]/g,P.textContent)||P.nodeType===Ca.progressingInstruction||Jn&&P.nodeType===Ca.comment&&Et(/<[/\w]/g,P.data))return yr(P),true;if(!pe[oe]||Ut[oe]){if(!Ut[oe]&&Ed(oe)&&(Ve.tagNameCheck instanceof RegExp&&Et(Ve.tagNameCheck,oe)||Ve.tagNameCheck instanceof Function&&Ve.tagNameCheck(oe)))return false;if(Nl&&!no[oe]){let Xe=E(P)||P.parentNode,yt=S(P)||P.childNodes;if(yt&&Xe){let mt=yt.length;for(let Ot=mt-1;Ot>=0;--Ot){let xr=g(yt[Ot],true);xr.__removalCount=(P.__removalCount||0)+1,Xe.insertBefore(xr,T(P));}}}return yr(P),true}return P instanceof l&&!h0(P)||(oe==="noscript"||oe==="noembed"||oe==="noframes")&&Et(/<\/no(script|embed|frames)/i,P.innerHTML)?(yr(P),true):(Mr&&P.nodeType===Ca.text&&(z=P.textContent,Il([k,O,D],Xe=>{z=va(z,Xe," ");}),P.textContent!==z&&(xa(t.removed,{element:P.cloneNode()}),P.textContent=z)),Nr(I.afterSanitizeElements,P,null),false)},Pd=function(P,z,oe){if(md&&(z==="id"||z==="name")&&(oe in r||oe in g0))return false;if(!(Oe&&!Vt[z]&&Et(F,z))){if(!(Ke&&Et(j,z))){if(!Ye[z]||Vt[z]){if(!(Ed(P)&&(Ve.tagNameCheck instanceof RegExp&&Et(Ve.tagNameCheck,P)||Ve.tagNameCheck instanceof Function&&Ve.tagNameCheck(P))&&(Ve.attributeNameCheck instanceof RegExp&&Et(Ve.attributeNameCheck,z)||Ve.attributeNameCheck instanceof Function&&Ve.attributeNameCheck(z))||z==="is"&&Ve.allowCustomizedBuiltInElements&&(Ve.tagNameCheck instanceof RegExp&&Et(Ve.tagNameCheck,oe)||Ve.tagNameCheck instanceof Function&&Ve.tagNameCheck(oe))))return false}else if(!Ll[z]){if(!Et(Be,va(oe,ve,""))){if(!((z==="src"||z==="xlink:href"||z==="href")&&P!=="script"&&vR(oe,"data:")===0&&bd[P])){if(!(Tt&&!Et(ne,va(oe,ve,"")))){if(oe)return false}}}}}}return true},Ed=function(P){return P!=="annotation-xml"&&fw(P,fe)},Id=function(P){Nr(I.beforeSanitizeAttributes,P,null);let{attributes:z}=P;if(!z||Vl(P))return;let oe={attrName:"",attrValue:"",keepAttr:true,allowedAttributes:Ye,forceKeepAttr:void 0},Xe=z.length;for(;Xe--;){let yt=z[Xe],{name:mt,namespaceURI:Ot,value:xr}=yt,ai=ut(mt),Ct=mt==="value"?xr:wR(xr);if(oe.attrName=ai,oe.attrValue=Ct,oe.keepAttr=true,oe.forceKeepAttr=void 0,Nr(I.uponSanitizeAttribute,P,oe),Ct=oe.attrValue,gd&&(ai==="id"||ai==="name")&&(Ra(mt,P),Ct=u0+Ct),Jn&&Et(/((--!?|])>)|<\/(style|title)/i,Ct)){Ra(mt,P);continue}if(oe.forceKeepAttr||(Ra(mt,P),!oe.keepAttr))continue;if(!gn&&Et(/\/>/i,Ct)){Ra(mt,P);continue}Mr&&Il([k,O,D],Od=>{Ct=va(Ct,Od," ");});let Ad=ut(P.nodeName);if(Pd(Ad,ai,Ct)){if(h&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Ot)switch(f.getAttributeType(Ad,ai)){case "TrustedHTML":{Ct=h.createHTML(Ct);break}case "TrustedScriptURL":{Ct=h.createScriptURL(Ct);break}}try{Ot?P.setAttributeNS(Ot,mt,Ct):P.setAttribute(mt,Ct),Vl(P)?yr(P):dw(t.removed);}catch{}}}Nr(I.afterSanitizeAttributes,P,null);},b0=function le(P){let z=null,oe=_d(P);for(Nr(I.beforeSanitizeShadowDOM,P,null);z=oe.nextNode();)Nr(I.uponSanitizeShadowNode,z,null),kd(z),Id(z),z.content instanceof i&&le(z.content);Nr(I.afterSanitizeShadowDOM,P,null);};return t.sanitize=function(le){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=null,oe=null,Xe=null,yt=null;if(Fl=!le,Fl&&(le="<!-->"),typeof le!="string"&&!Sd(le))if(typeof le.toString=="function"){if(le=le.toString(),typeof le!="string")throw wa("dirty is not a string, aborting")}else throw wa("toString is not a function");if(!t.isSupported)return le;if(eo||Ul(P),t.removed=[],typeof le=="string"&&(oi=false),oi){if(le.nodeName){let xr=ut(le.nodeName);if(!pe[xr]||Ut[xr])throw wa("root node is forbidden and cannot be sanitized in-place")}}else if(le instanceof s)z=Cd("<!---->"),oe=z.ownerDocument.importNode(le,true),oe.nodeType===Ca.element&&oe.nodeName==="BODY"||oe.nodeName==="HTML"?z=oe:z.appendChild(oe);else {if(!to&&!Mr&&!nr&&le.indexOf("<")===-1)return h&&Pa?h.createHTML(le):le;if(z=Cd(le),!z)return to?null:Pa?C:""}z&&$l&&yr(z.firstChild);let mt=_d(oi?le:z);for(;Xe=mt.nextNode();)kd(Xe),Id(Xe),Xe.content instanceof i&&b0(Xe.content);if(oi)return le;if(to){if(ka)for(yt=N.call(z.ownerDocument);z.firstChild;)yt.appendChild(z.firstChild);else yt=z;return (Ye.shadowroot||Ye.shadowrootmode)&&(yt=A.call(n,yt,true)),yt}let Ot=nr?z.outerHTML:z.innerHTML;return nr&&pe["!doctype"]&&z.ownerDocument&&z.ownerDocument.doctype&&z.ownerDocument.doctype.name&&Et(Tw,z.ownerDocument.doctype.name)&&(Ot="<!DOCTYPE "+z.ownerDocument.doctype.name+`>
80
+ `+Ot),Mr&&Il([k,O,D],xr=>{Ot=va(Ot,xr," ");}),h&&Pa?h.createHTML(Ot):Ot},t.setConfig=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ul(le),eo=true;},t.clearConfig=function(){io=null,eo=false;},t.isValidAttribute=function(le,P,z){io||Ul({});let oe=ut(le),Xe=ut(P);return Pd(oe,Xe,z)},t.addHook=function(le,P){typeof P=="function"&&xa(I[le],P);},t.removeHook=function(le,P){if(P!==void 0){let z=yR(I[le],P);return z===-1?void 0:xR(I[le],z,1)[0]}return dw(I[le])},t.removeHooks=function(le){I[le]=[];},t.removeAllHooks=function(){I=yw();},t}var sd=Cw();function ud(){return {async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}var Zn=ud();function Ew(e){Zn=e;}var Iw=/[&<>"']/,NR=new RegExp(Iw.source,"g"),Aw=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,LR=new RegExp(Aw.source,"g"),FR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_w=e=>FR[e];function Bt(e,t){if(t){if(Iw.test(e))return e.replace(NR,_w)}else if(Aw.test(e))return e.replace(LR,_w);return e}var BR=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function UR(e){return e.replace(BR,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}var VR=/(^|[^\[])\^/g;function Fe(e,t){e=typeof e=="string"?e:e.source,t=t||"";let r={replace:(n,o)=>(o=typeof o=="object"&&"source"in o?o.source:o,o=o.replace(VR,"$1"),e=e.replace(n,o),r),getRegex:()=>new RegExp(e,t)};return r}function Sw(e){try{e=encodeURI(e).replace(/%25/g,"%");}catch{return null}return e}var Rl={exec:()=>null};function kw(e,t){let r=e.replace(/\|/g,(i,a,s)=>{let l=false,u=a;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),n=r.split(/ \|/),o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(/\\\|/g,"|");return n}function ld(e,t,r){let n=e.length;if(n===0)return "";let o=0;for(;o<n;){let i=e.charAt(n-o-1);if(i===t&&true)o++;else break}return e.slice(0,n-o)}function HR(e,t){if(e.indexOf(t[1])===-1)return -1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return -1}function Pw(e,t,r,n){let o=t.href,i=t.title?Bt(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){n.state.inLink=true;let s={type:"link",raw:r,href:o,title:i,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=false,s}return {type:"image",raw:r,href:o,title:i,text:Bt(a)}}function WR(e,t){let r=e.match(/^(\s+)(?:```)/);if(r===null)return t;let n=r[1];return t.split(`
58
81
  `).map(o=>{let i=o.match(/^\s+/);if(i===null)return o;let[a]=i;return a.length>=n.length?o.slice(n.length):o}).join(`
59
- `)}var mi=class{options;rules;lexer;constructor(t){this.options=t||uo;}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return {type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let n=r[0].replace(/^ {1,4}/gm,"");return {type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:$d(n,`
60
- `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let n=r[0],o=RR(n,r[3]||"");return {type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline._escapes,"$1"):r[2],text:o}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(/#$/.test(n)){let o=$d(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim());}return {type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return {type:"hr",raw:r[0]}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let n=r[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=true;let i=this.lexer.blockTokens(n);return this.lexer.state.top=o,{type:"blockquote",raw:r[0],tokens:i,text:n}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n=r[1].trim(),o=n.length>1,i={type:"list",raw:"",ordered:o,start:o?+n.slice(0,-1):"",loose:false,items:[]};n=o?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=o?n:"[*+-]");let a=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),s="",l="",c=false;for(;t;){let u=false;if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;s=r[0],t=t.substring(s.length);let d=r[2].split(`
61
- `,1)[0].replace(/^\t+/,y=>" ".repeat(3*y.length)),f=t.split(`
62
- `,1)[0],p=0;this.options.pedantic?(p=2,l=d.trimStart()):(p=r[2].search(/[^ ]/),p=p>4?1:p,l=d.slice(p),p+=r[1].length);let g=false;if(!d&&/^ *$/.test(f)&&(s+=f+`
63
- `,t=t.substring(f.length+1),u=true),!u){let y=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),S=new RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),C=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),k=new RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;t;){let D=t.split(`
64
- `,1)[0];if(f=D,this.options.pedantic&&(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),C.test(f)||k.test(f)||y.test(f)||S.test(t))break;if(f.search(/[^ ]/)>=p||!f.trim())l+=`
65
- `+f.slice(p);else {if(g||d.search(/[^ ]/)>=4||C.test(d)||k.test(d)||S.test(d))break;l+=`
66
- `+f;}!g&&!f.trim()&&(g=true),s+=D+`
67
- `,t=t.substring(D.length+1),d=f.slice(p);}}i.loose||(c?i.loose=true:/\n *\n *$/.test(s)&&(c=true));let h=null,b;this.options.gfm&&(h=/^\[[ xX]\] /.exec(l),h&&(b=h[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:s,task:!!h,checked:b,loose:false,text:l,tokens:[]}),i.raw+=s;}i.items[i.items.length-1].raw=s.trimEnd(),i.items[i.items.length-1].text=l.trimEnd(),i.raw=i.raw.trimEnd();for(let u=0;u<i.items.length;u++)if(this.lexer.state.top=false,i.items[u].tokens=this.lexer.blockTokens(i.items[u].text,[]),!i.loose){let d=i.items[u].tokens.filter(p=>p.type==="space"),f=d.length>0&&d.some(p=>/\n.*\n/.test(p.raw));i.loose=f;}if(i.loose)for(let u=0;u<i.items.length;u++)i.items[u].loose=true;return i}}html(t){let r=this.rules.block.html.exec(t);if(r)return {type:"html",block:true,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let n=r[1].toLowerCase().replace(/\s+/g," "),o=r[2]?r[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline._escapes,"$1"):r[3];return {type:"def",tag:n,raw:r[0],href:o,title:i}}}table(t){let r=this.rules.block.table.exec(t);if(r){if(!/[:|]/.test(r[2]))return;let n={type:"table",raw:r[0],header:Qw(r[1]).map(o=>({text:o,tokens:[]})),align:r[2].replace(/^\||\| *$/g,"").split("|"),rows:r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(`
68
- `):[]};if(n.header.length===n.align.length){let o=n.align.length,i,a,s,l;for(i=0;i<o;i++){let c=n.align[i];c&&(/^ *-+: *$/.test(c)?n.align[i]="right":/^ *:-+: *$/.test(c)?n.align[i]="center":/^ *:-+ *$/.test(c)?n.align[i]="left":n.align[i]=null);}for(o=n.rows.length,i=0;i<o;i++)n.rows[i]=Qw(n.rows[i],n.header.length).map(c=>({text:c,tokens:[]}));for(o=n.header.length,a=0;a<o;a++)n.header[a].tokens=this.lexer.inline(n.header[a].text);for(o=n.rows.length,a=0;a<o;a++)for(l=n.rows[a],s=0;s<l.length;s++)l[s].tokens=this.lexer.inline(l[s].text);return n}}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return {type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let n=r[1].charAt(r[1].length-1)===`
69
- `?r[1].slice(0,-1):r[1];return {type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return {type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return {type:"escape",raw:r[0],text:Yt(r[1])}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return !this.lexer.state.inLink&&/^<a /i.test(r[0])?this.lexer.state.inLink=true:this.lexer.state.inLink&&/^<\/a>/i.test(r[0])&&(this.lexer.state.inLink=false),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=true:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=false),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:false,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let n=r[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;let a=$d(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else {let a=OR(r[2],"()");if(a>-1){let l=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,l).trim(),r[3]="";}}let o=r[2],i="";if(this.options.pedantic){let a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);a&&(o=a[1],i=a[3]);}else i=r[3]?r[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(n)?o=o.slice(1):o=o.slice(1,-1)),Jw(r,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},r[0],this.lexer)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=(n[2]||n[1]).replace(/\s+/g," ");if(o=r[o.toLowerCase()],!o){let i=n[0].charAt(0);return {type:"text",raw:i,text:i}}return Jw(n,o,n[0],this.lexer)}}emStrong(t,r,n=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(o[1]||o[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let a=[...o[0]].length-1,s,l,c=a,u=0,d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,r=r.slice(-1*t.length+o[0].length-1);(o=d.exec(r))!=null;){if(s=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!s)continue;if(l=[...s].length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&a%3&&!((a+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);let f=[...t].slice(0,a+o.index+l+1).join("");if(Math.min(a,l)%2){let g=f.slice(1,-1);return {type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return {type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(/\n/g," "),o=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return o&&i&&(n=n.substring(1,n.length-1)),n=Yt(n,true),{type:"codespan",raw:r[0],text:n}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return {type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return {type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let n,o;return r[2]==="@"?(n=Yt(r[1]),o="mailto:"+n):(n=Yt(r[1]),o=n),{type:"link",raw:r[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let n,o;if(r[2]==="@")n=Yt(r[0]),o="mailto:"+n;else {let i;do i=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(i!==r[0]);n=Yt(r[0]),r[1]==="www."?o="http://"+r[0]:o=r[0];}return {type:"link",raw:r[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let n;return this.lexer.state.inRawBlock?n=r[0]:n=Yt(r[0]),{type:"text",raw:r[0],text:n}}}},fe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:rc,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};fe._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;fe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;fe.def=We(fe.def).replace("label",fe._label).replace("title",fe._title).getRegex();fe.bullet=/(?:[*+-]|\d{1,9}[.)])/;fe.listItemStart=We(/^( *)(bull) */).replace("bull",fe.bullet).getRegex();fe.list=We(fe.list).replace(/bull/g,fe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+fe.def.source+")").getRegex();fe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";fe._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;fe.html=We(fe.html,"i").replace("comment",fe._comment).replace("tag",fe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();fe.lheading=We(fe.lheading).replace(/bull/g,fe.bullet).getRegex();fe.paragraph=We(fe._paragraph).replace("hr",fe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fe._tag).getRegex();fe.blockquote=We(fe.blockquote).replace("paragraph",fe.paragraph).getRegex();fe.normal={...fe};fe.gfm={...fe.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};fe.gfm.table=We(fe.gfm.table).replace("hr",fe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fe._tag).getRegex();fe.gfm.paragraph=We(fe._paragraph).replace("hr",fe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",fe.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fe._tag).getRegex();fe.pedantic={...fe.normal,html:We(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:rc,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:We(fe.normal._paragraph).replace("hr",fe.hr).replace("heading",` *#{1,6} *[^
70
- ]`).replace("lheading",fe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};var Y={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:rc,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:rc,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};Y._punctuation="\\p{P}$+<=>`^|~";Y.punctuation=We(Y.punctuation,"u").replace(/punctuation/g,Y._punctuation).getRegex();Y.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;Y.anyPunctuation=/\\[punct]/g;Y._escapes=/\\([punct])/g;Y._comment=We(fe._comment).replace("(?:-->|$)","-->").getRegex();Y.emStrong.lDelim=We(Y.emStrong.lDelim,"u").replace(/punct/g,Y._punctuation).getRegex();Y.emStrong.rDelimAst=We(Y.emStrong.rDelimAst,"gu").replace(/punct/g,Y._punctuation).getRegex();Y.emStrong.rDelimUnd=We(Y.emStrong.rDelimUnd,"gu").replace(/punct/g,Y._punctuation).getRegex();Y.anyPunctuation=We(Y.anyPunctuation,"gu").replace(/punct/g,Y._punctuation).getRegex();Y._escapes=We(Y._escapes,"gu").replace(/punct/g,Y._punctuation).getRegex();Y._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Y._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Y.autolink=We(Y.autolink).replace("scheme",Y._scheme).replace("email",Y._email).getRegex();Y._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Y.tag=We(Y.tag).replace("comment",Y._comment).replace("attribute",Y._attribute).getRegex();Y._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Y._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Y._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Y.link=We(Y.link).replace("label",Y._label).replace("href",Y._href).replace("title",Y._title).getRegex();Y.reflink=We(Y.reflink).replace("label",Y._label).replace("ref",fe._label).getRegex();Y.nolink=We(Y.nolink).replace("ref",fe._label).getRegex();Y.reflinkSearch=We(Y.reflinkSearch,"g").replace("reflink",Y.reflink).replace("nolink",Y.nolink).getRegex();Y.normal={...Y};Y.pedantic={...Y.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:We(/^!?\[(label)\]\((.*?)\)/).replace("label",Y._label).getRegex(),reflink:We(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Y._label).getRegex()};Y.gfm={...Y.normal,escape:We(Y.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};Y.gfm.url=We(Y.gfm.url,"i").replace("email",Y.gfm._extended_email).getRegex();Y.breaks={...Y.gfm,br:We(Y.br).replace("{2,}","*").getRegex(),text:We(Y.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};var on=class e{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||uo,this.options.tokenizer=this.options.tokenizer||new mi,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:false,inRawBlock:false,top:true};let r={block:fe.normal,inline:Y.normal};this.options.pedantic?(r.block=fe.pedantic,r.inline=Y.pedantic):this.options.gfm&&(r.block=fe.gfm,this.options.breaks?r.inline=Y.breaks:r.inline=Y.gfm),this.tokenizer.rules=r;}static get rules(){return {block:fe,inline:Y}}static lex(t,r){return new e(r).lex(t)}static lexInline(t,r){return new e(r).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
71
- `),this.blockTokens(t,this.tokens);let r;for(;r=this.inlineQueue.shift();)this.inlineTokens(r.src,r.tokens);return this.tokens}blockTokens(t,r=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(s,l,c)=>l+" ".repeat(c.length));let n,o,i,a;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(n=s.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),true):false))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.raw.length===1&&r.length>0?r[r.length-1].raw+=`
82
+ `)}var ti=class{options;rules;lexer;constructor(t){this.options=t||Zn;}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return {type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let n=r[0].replace(/^ {1,4}/gm,"");return {type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ld(n,`
83
+ `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let n=r[0],o=WR(n,r[3]||"");return {type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline._escapes,"$1"):r[2],text:o}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(/#$/.test(n)){let o=ld(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim());}return {type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return {type:"hr",raw:r[0]}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let n=r[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=true;let i=this.lexer.blockTokens(n);return this.lexer.state.top=o,{type:"blockquote",raw:r[0],tokens:i,text:n}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n=r[1].trim(),o=n.length>1,i={type:"list",raw:"",ordered:o,start:o?+n.slice(0,-1):"",loose:false,items:[]};n=o?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=o?n:"[*+-]");let a=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),s="",l="",u=false;for(;t;){let c=false;if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;s=r[0],t=t.substring(s.length);let d=r[2].split(`
84
+ `,1)[0].replace(/^\t+/,T=>" ".repeat(3*T.length)),p=t.split(`
85
+ `,1)[0],f=0;this.options.pedantic?(f=2,l=d.trimStart()):(f=r[2].search(/[^ ]/),f=f>4?1:f,l=d.slice(f),f+=r[1].length);let b=false;if(!d&&/^ *$/.test(p)&&(s+=p+`
86
+ `,t=t.substring(p.length+1),c=true),!c){let T=new RegExp(`^ {0,${Math.min(3,f-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),S=new RegExp(`^ {0,${Math.min(3,f-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),E=new RegExp(`^ {0,${Math.min(3,f-1)}}(?:\`\`\`|~~~)`),h=new RegExp(`^ {0,${Math.min(3,f-1)}}#`);for(;t;){let C=t.split(`
87
+ `,1)[0];if(p=C,this.options.pedantic&&(p=p.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),E.test(p)||h.test(p)||T.test(p)||S.test(t))break;if(p.search(/[^ ]/)>=f||!p.trim())l+=`
88
+ `+p.slice(f);else {if(b||d.search(/[^ ]/)>=4||E.test(d)||h.test(d)||S.test(d))break;l+=`
89
+ `+p;}!b&&!p.trim()&&(b=true),s+=C+`
90
+ `,t=t.substring(C.length+1),d=p.slice(f);}}i.loose||(u?i.loose=true:/\n *\n *$/.test(s)&&(u=true));let g=null,y;this.options.gfm&&(g=/^\[[ xX]\] /.exec(l),g&&(y=g[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:s,task:!!g,checked:y,loose:false,text:l,tokens:[]}),i.raw+=s;}i.items[i.items.length-1].raw=s.trimEnd(),i.items[i.items.length-1].text=l.trimEnd(),i.raw=i.raw.trimEnd();for(let c=0;c<i.items.length;c++)if(this.lexer.state.top=false,i.items[c].tokens=this.lexer.blockTokens(i.items[c].text,[]),!i.loose){let d=i.items[c].tokens.filter(f=>f.type==="space"),p=d.length>0&&d.some(f=>/\n.*\n/.test(f.raw));i.loose=p;}if(i.loose)for(let c=0;c<i.items.length;c++)i.items[c].loose=true;return i}}html(t){let r=this.rules.block.html.exec(t);if(r)return {type:"html",block:true,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let n=r[1].toLowerCase().replace(/\s+/g," "),o=r[2]?r[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline._escapes,"$1"):r[3];return {type:"def",tag:n,raw:r[0],href:o,title:i}}}table(t){let r=this.rules.block.table.exec(t);if(r){if(!/[:|]/.test(r[2]))return;let n={type:"table",raw:r[0],header:kw(r[1]).map(o=>({text:o,tokens:[]})),align:r[2].replace(/^\||\| *$/g,"").split("|"),rows:r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(`
91
+ `):[]};if(n.header.length===n.align.length){let o=n.align.length,i,a,s,l;for(i=0;i<o;i++){let u=n.align[i];u&&(/^ *-+: *$/.test(u)?n.align[i]="right":/^ *:-+: *$/.test(u)?n.align[i]="center":/^ *:-+ *$/.test(u)?n.align[i]="left":n.align[i]=null);}for(o=n.rows.length,i=0;i<o;i++)n.rows[i]=kw(n.rows[i],n.header.length).map(u=>({text:u,tokens:[]}));for(o=n.header.length,a=0;a<o;a++)n.header[a].tokens=this.lexer.inline(n.header[a].text);for(o=n.rows.length,a=0;a<o;a++)for(l=n.rows[a],s=0;s<l.length;s++)l[s].tokens=this.lexer.inline(l[s].text);return n}}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return {type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let n=r[1].charAt(r[1].length-1)===`
92
+ `?r[1].slice(0,-1):r[1];return {type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return {type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return {type:"escape",raw:r[0],text:Bt(r[1])}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return !this.lexer.state.inLink&&/^<a /i.test(r[0])?this.lexer.state.inLink=true:this.lexer.state.inLink&&/^<\/a>/i.test(r[0])&&(this.lexer.state.inLink=false),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=true:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=false),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:false,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let n=r[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;let a=ld(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else {let a=HR(r[2],"()");if(a>-1){let l=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,l).trim(),r[3]="";}}let o=r[2],i="";if(this.options.pedantic){let a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);a&&(o=a[1],i=a[3]);}else i=r[3]?r[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(n)?o=o.slice(1):o=o.slice(1,-1)),Pw(r,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},r[0],this.lexer)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=(n[2]||n[1]).replace(/\s+/g," ");if(o=r[o.toLowerCase()],!o){let i=n[0].charAt(0);return {type:"text",raw:i,text:i}}return Pw(n,o,n[0],this.lexer)}}emStrong(t,r,n=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(o[1]||o[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let a=[...o[0]].length-1,s,l,u=a,c=0,d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,r=r.slice(-1*t.length+o[0].length-1);(o=d.exec(r))!=null;){if(s=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!s)continue;if(l=[...s].length,o[3]||o[4]){u+=l;continue}else if((o[5]||o[6])&&a%3&&!((a+l)%3)){c+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+c);let p=[...t].slice(0,a+o.index+l+1).join("");if(Math.min(a,l)%2){let b=p.slice(1,-1);return {type:"em",raw:p,text:b,tokens:this.lexer.inlineTokens(b)}}let f=p.slice(2,-2);return {type:"strong",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(/\n/g," "),o=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return o&&i&&(n=n.substring(1,n.length-1)),n=Bt(n,true),{type:"codespan",raw:r[0],text:n}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return {type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return {type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let n,o;return r[2]==="@"?(n=Bt(r[1]),o="mailto:"+n):(n=Bt(r[1]),o=n),{type:"link",raw:r[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let n,o;if(r[2]==="@")n=Bt(r[0]),o="mailto:"+n;else {let i;do i=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(i!==r[0]);n=Bt(r[0]),r[1]==="www."?o="http://"+r[0]:o=r[0];}return {type:"link",raw:r[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let n;return this.lexer.state.inRawBlock?n=r[0]:n=Bt(r[0]),{type:"text",raw:r[0],text:n}}}},ce={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Rl,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ce._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;ce.def=Fe(ce.def).replace("label",ce._label).replace("title",ce._title).getRegex();ce.bullet=/(?:[*+-]|\d{1,9}[.)])/;ce.listItemStart=Fe(/^( *)(bull) */).replace("bull",ce.bullet).getRegex();ce.list=Fe(ce.list).replace(/bull/g,ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ce.def.source+")").getRegex();ce._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";ce._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;ce.html=Fe(ce.html,"i").replace("comment",ce._comment).replace("tag",ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();ce.lheading=Fe(ce.lheading).replace(/bull/g,ce.bullet).getRegex();ce.paragraph=Fe(ce._paragraph).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce._tag).getRegex();ce.blockquote=Fe(ce.blockquote).replace("paragraph",ce.paragraph).getRegex();ce.normal={...ce};ce.gfm={...ce.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};ce.gfm.table=Fe(ce.gfm.table).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce._tag).getRegex();ce.gfm.paragraph=Fe(ce._paragraph).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ce.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce._tag).getRegex();ce.pedantic={...ce.normal,html:Fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ce._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Fe(ce.normal._paragraph).replace("hr",ce.hr).replace("heading",` *#{1,6} *[^
93
+ ]`).replace("lheading",ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};var Y={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Rl,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Rl,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};Y._punctuation="\\p{P}$+<=>`^|~";Y.punctuation=Fe(Y.punctuation,"u").replace(/punctuation/g,Y._punctuation).getRegex();Y.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;Y.anyPunctuation=/\\[punct]/g;Y._escapes=/\\([punct])/g;Y._comment=Fe(ce._comment).replace("(?:-->|$)","-->").getRegex();Y.emStrong.lDelim=Fe(Y.emStrong.lDelim,"u").replace(/punct/g,Y._punctuation).getRegex();Y.emStrong.rDelimAst=Fe(Y.emStrong.rDelimAst,"gu").replace(/punct/g,Y._punctuation).getRegex();Y.emStrong.rDelimUnd=Fe(Y.emStrong.rDelimUnd,"gu").replace(/punct/g,Y._punctuation).getRegex();Y.anyPunctuation=Fe(Y.anyPunctuation,"gu").replace(/punct/g,Y._punctuation).getRegex();Y._escapes=Fe(Y._escapes,"gu").replace(/punct/g,Y._punctuation).getRegex();Y._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Y._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Y.autolink=Fe(Y.autolink).replace("scheme",Y._scheme).replace("email",Y._email).getRegex();Y._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Y.tag=Fe(Y.tag).replace("comment",Y._comment).replace("attribute",Y._attribute).getRegex();Y._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Y._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Y._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Y.link=Fe(Y.link).replace("label",Y._label).replace("href",Y._href).replace("title",Y._title).getRegex();Y.reflink=Fe(Y.reflink).replace("label",Y._label).replace("ref",ce._label).getRegex();Y.nolink=Fe(Y.nolink).replace("ref",ce._label).getRegex();Y.reflinkSearch=Fe(Y.reflinkSearch,"g").replace("reflink",Y.reflink).replace("nolink",Y.nolink).getRegex();Y.normal={...Y};Y.pedantic={...Y.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Fe(/^!?\[(label)\]\((.*?)\)/).replace("label",Y._label).getRegex(),reflink:Fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Y._label).getRegex()};Y.gfm={...Y.normal,escape:Fe(Y.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};Y.gfm.url=Fe(Y.gfm.url,"i").replace("email",Y.gfm._extended_email).getRegex();Y.breaks={...Y.gfm,br:Fe(Y.br).replace("{2,}","*").getRegex(),text:Fe(Y.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};var Zr=class e{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Zn,this.options.tokenizer=this.options.tokenizer||new ti,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:false,inRawBlock:false,top:true};let r={block:ce.normal,inline:Y.normal};this.options.pedantic?(r.block=ce.pedantic,r.inline=Y.pedantic):this.options.gfm&&(r.block=ce.gfm,this.options.breaks?r.inline=Y.breaks:r.inline=Y.gfm),this.tokenizer.rules=r;}static get rules(){return {block:ce,inline:Y}}static lex(t,r){return new e(r).lex(t)}static lexInline(t,r){return new e(r).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
94
+ `),this.blockTokens(t,this.tokens);let r;for(;r=this.inlineQueue.shift();)this.inlineTokens(r.src,r.tokens);return this.tokens}blockTokens(t,r=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(s,l,u)=>l+" ".repeat(u.length));let n,o,i,a;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(n=s.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),true):false))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.raw.length===1&&r.length>0?r[r.length-1].raw+=`
72
95
  `:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
73
96
  `+n.raw,o.text+=`
74
97
  `+n.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
75
98
  `+n.raw,o.text+=`
76
- `+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startBlock){let s=1/0,l=t.slice(1),c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(s=Math.min(s,c));}),s<1/0&&s>=0&&(i=t.substring(0,s+1));}if(this.state.top&&(n=this.tokenizer.paragraph(i))){o=r[r.length-1],a&&o.type==="paragraph"?(o.raw+=`
99
+ `+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startBlock){let s=1/0,l=t.slice(1),u;this.options.extensions.startBlock.forEach(c=>{u=c.call({lexer:this},l),typeof u=="number"&&u>=0&&(s=Math.min(s,u));}),s<1/0&&s>=0&&(i=t.substring(0,s+1));}if(this.state.top&&(n=this.tokenizer.paragraph(i))){o=r[r.length-1],a&&o.type==="paragraph"?(o.raw+=`
77
100
  `+n.raw,o.text+=`
78
101
  `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n),a=i.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&o.type==="text"?(o.raw+=`
79
102
  `+n.raw,o.text+=`
80
- `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent)break;throw new Error(s)}}return this.state.top=true,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n,o,i,a=t,s,l,c;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(l||(c=""),l=false,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),true):false))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(t,a,c)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(t)){t=t.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t))){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f));}),u<1/0&&u>=0&&(i=t.substring(0,u+1));}if(n=this.tokenizer.inlineText(i)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),l=true,o=r[r.length-1],o&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent)break;throw new Error(u)}}return r}},gi=class{options;constructor(t){this.options=t||uo;}code(t,r,n){let o=(r||"").match(/^\S*/)?.[0];return t=t.replace(/\n$/,"")+`
81
- `,o?'<pre><code class="language-'+Yt(o)+'">'+(n?t:Yt(t,true))+`</code></pre>
82
- `:"<pre><code>"+(n?t:Yt(t,true))+`</code></pre>
103
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=true,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n,o,i,a=t,s,l,u;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)c.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(l||(u=""),l=false,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(n=c.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),true):false))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(t,a,u)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(t)){t=t.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t))){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0,d=t.slice(1),p;this.options.extensions.startInline.forEach(f=>{p=f.call({lexer:this},d),typeof p=="number"&&p>=0&&(c=Math.min(c,p));}),c<1/0&&c>=0&&(i=t.substring(0,c+1));}if(n=this.tokenizer.inlineText(i)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(u=n.raw.slice(-1)),l=true,o=r[r.length-1],o&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return r}},ri=class{options;constructor(t){this.options=t||Zn;}code(t,r,n){let o=(r||"").match(/^\S*/)?.[0];return t=t.replace(/\n$/,"")+`
104
+ `,o?'<pre><code class="language-'+Bt(o)+'">'+(n?t:Bt(t,true))+`</code></pre>
105
+ `:"<pre><code>"+(n?t:Bt(t,true))+`</code></pre>
83
106
  `}blockquote(t){return `<blockquote>
84
107
  ${t}</blockquote>
85
108
  `}html(t,r){return t}heading(t,r,n){return `<h${r}>${t}</h${r}>
@@ -95,40 +118,25 @@ ${t}</blockquote>
95
118
  `}tablerow(t){return `<tr>
96
119
  ${t}</tr>
97
120
  `}tablecell(t,r){let n=r.header?"th":"td";return (r.align?`<${n} align="${r.align}">`:`<${n}>`)+t+`</${n}>
98
- `}strong(t){return `<strong>${t}</strong>`}em(t){return `<em>${t}</em>`}codespan(t){return `<code>${t}</code>`}br(){return "<br>"}del(t){return `<del>${t}</del>`}link(t,r,n){let o=Zw(t);if(o===null)return n;t=o;let i='<a href="'+t+'"';return r&&(i+=' title="'+r+'"'),i+=">"+n+"</a>",i}image(t,r,n){let o=Zw(t);if(o===null)return n;t=o;let i=`<img src="${t}" alt="${n}"`;return r&&(i+=` title="${r}"`),i+=">",i}text(t){return t}},Ga=class{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,r,n){return ""+n}image(t,r,n){return ""+n}br(){return ""}},an=class e{options;renderer;textRenderer;constructor(t){this.options=t||uo,this.options.renderer=this.options.renderer||new gi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ga;}static parse(t,r){return new e(r).parse(t)}static parseInline(t,r){return new e(r).parseInline(t)}parse(t,r=true){let n="";for(let o=0;o<t.length;o++){let i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=i,s=this.options.extensions.renderers[a.type].call({parser:this},a);if(s!==false||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){n+=s||"";continue}}switch(i.type){case "space":continue;case "hr":{n+=this.renderer.hr();continue}case "heading":{let a=i;n+=this.renderer.heading(this.parseInline(a.tokens),a.depth,IR(this.parseInline(a.tokens,this.textRenderer)));continue}case "code":{let a=i;n+=this.renderer.code(a.text,a.lang,!!a.escaped);continue}case "table":{let a=i,s="",l="";for(let u=0;u<a.header.length;u++)l+=this.renderer.tablecell(this.parseInline(a.header[u].tokens),{header:true,align:a.align[u]});s+=this.renderer.tablerow(l);let c="";for(let u=0;u<a.rows.length;u++){let d=a.rows[u];l="";for(let f=0;f<d.length;f++)l+=this.renderer.tablecell(this.parseInline(d[f].tokens),{header:false,align:a.align[f]});c+=this.renderer.tablerow(l);}n+=this.renderer.table(s,c);continue}case "blockquote":{let a=i,s=this.parse(a.tokens);n+=this.renderer.blockquote(s);continue}case "list":{let a=i,s=a.ordered,l=a.start,c=a.loose,u="";for(let d=0;d<a.items.length;d++){let f=a.items[d],p=f.checked,g=f.task,h="";if(f.task){let b=this.renderer.checkbox(!!p);c?f.tokens.length>0&&f.tokens[0].type==="paragraph"?(f.tokens[0].text=b+" "+f.tokens[0].text,f.tokens[0].tokens&&f.tokens[0].tokens.length>0&&f.tokens[0].tokens[0].type==="text"&&(f.tokens[0].tokens[0].text=b+" "+f.tokens[0].tokens[0].text)):f.tokens.unshift({type:"text",text:b+" "}):h+=b+" ";}h+=this.parse(f.tokens,c),u+=this.renderer.listitem(h,g,!!p);}n+=this.renderer.list(u,s,l);continue}case "html":{let a=i;n+=this.renderer.html(a.text,a.block);continue}case "paragraph":{let a=i;n+=this.renderer.paragraph(this.parseInline(a.tokens));continue}case "text":{let a=i,s=a.tokens?this.parseInline(a.tokens):a.text;for(;o+1<t.length&&t[o+1].type==="text";)a=t[++o],s+=`
99
- `+(a.tokens?this.parseInline(a.tokens):a.text);n+=r?this.renderer.paragraph(s):s;continue}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return "";throw new Error(a)}}}return n}parseInline(t,r){r=r||this.renderer;let n="";for(let o=0;o<t.length;o++){let i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==false||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=a||"";continue}}switch(i.type){case "escape":{let a=i;n+=r.text(a.text);break}case "html":{let a=i;n+=r.html(a.text);break}case "link":{let a=i;n+=r.link(a.href,a.title,this.parseInline(a.tokens,r));break}case "image":{let a=i;n+=r.image(a.href,a.title,a.text);break}case "strong":{let a=i;n+=r.strong(this.parseInline(a.tokens,r));break}case "em":{let a=i;n+=r.em(this.parseInline(a.tokens,r));break}case "codespan":{let a=i;n+=r.codespan(a.text);break}case "br":{n+=r.br();break}case "del":{let a=i;n+=r.del(this.parseInline(a.tokens,r));break}case "text":{let a=i;n+=r.text(a.text);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return "";throw new Error(a)}}}return n}},pi=class{options;constructor(t){this.options=t||uo;}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}},Ld=class{defaults=Nd();options=this.setOptions;parse=this.#e(on.lex,an.parse);parseInline=this.#e(on.lexInline,an.parseInline);Parser=an;parser=an.parse;Renderer=gi;TextRenderer=Ga;Lexer=on;lexer=on.lex;Tokenizer=mi;Hooks=pi;constructor(...t){this.use(...t);}walkTokens(t,r){let n=[];for(let o of t)switch(n=n.concat(r.call(this,o)),o.type){case "table":{let i=o;for(let a of i.header)n=n.concat(this.walkTokens(a.tokens,r));for(let a of i.rows)for(let s of a)n=n.concat(this.walkTokens(s.tokens,r));break}case "list":{let i=o;n=n.concat(this.walkTokens(i.items,r));break}default:{let i=o;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{n=n.concat(this.walkTokens(i[a],r));}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,r)));}}return n}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let o={...n};if(o.async=this.defaults.async||o.async||false,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=r.renderers[i.name];a?r.renderers[i.name]=function(...s){let l=i.renderer.apply(this,s);return l===false&&(l=a.apply(this,s)),l}:r.renderers[i.name]=i.renderer;}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[i.level];a?a.unshift(i.tokenizer):r[i.level]=[i.tokenizer],i.start&&(i.level==="block"?r.startBlock?r.startBlock.push(i.start):r.startBlock=[i.start]:i.level==="inline"&&(r.startInline?r.startInline.push(i.start):r.startInline=[i.start]));}"childTokens"in i&&i.childTokens&&(r.childTokens[i.name]=i.childTokens);}),o.extensions=r),n.renderer){let i=this.defaults.renderer||new gi(this.defaults);for(let a in n.renderer){let s=n.renderer[a],l=a,c=i[l];i[l]=(...u)=>{let d=s.apply(i,u);return d===false&&(d=c.apply(i,u)),d||""};}o.renderer=i;}if(n.tokenizer){let i=this.defaults.tokenizer||new mi(this.defaults);for(let a in n.tokenizer){let s=n.tokenizer[a],l=a,c=i[l];i[l]=(...u)=>{let d=s.apply(i,u);return d===false&&(d=c.apply(i,u)),d};}o.tokenizer=i;}if(n.hooks){let i=this.defaults.hooks||new pi;for(let a in n.hooks){let s=n.hooks[a],l=a,c=i[l];pi.passThroughHooks.has(a)?i[l]=u=>{if(this.defaults.async)return Promise.resolve(s.call(i,u)).then(f=>c.call(i,f));let d=s.call(i,u);return c.call(i,d)}:i[l]=(...u)=>{let d=s.apply(i,u);return d===false&&(d=c.apply(i,u)),d};}o.hooks=i;}if(n.walkTokens){let i=this.defaults.walkTokens,a=n.walkTokens;o.walkTokens=function(s){let l=[];return l.push(a.call(this,s)),i&&(l=l.concat(i.call(this,s))),l};}this.defaults={...this.defaults,...o};}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}#e(t,r){return (n,o)=>{let i={...o},a={...this.defaults,...i};this.defaults.async===true&&i.async===false&&(a.silent,a.async=true);let s=this.#t(!!a.silent,!!a.async);if(typeof n>"u"||n===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(l=>t(l,a)).then(l=>a.walkTokens?Promise.all(this.walkTokens(l,a.walkTokens)).then(()=>l):l).then(l=>r(l,a)).then(l=>a.hooks?a.hooks.postprocess(l):l).catch(s);try{a.hooks&&(n=a.hooks.preprocess(n));let l=t(n,a);a.walkTokens&&this.walkTokens(l,a.walkTokens);let c=r(l,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}catch(l){return s(l)}}}#t(t,r){return n=>{if(n.message+=`
100
- Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+Yt(n.message+"",true)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(n);throw n}}},co=new Ld;function Ue(e,t){return co.parse(e,t)}Ue.options=Ue.setOptions=function(e){return co.setOptions(e),Ue.defaults=co.defaults,e0(Ue.defaults),Ue};Ue.getDefaults=Nd;Ue.defaults=uo;Ue.use=function(...e){return co.use(...e),Ue.defaults=co.defaults,e0(Ue.defaults),Ue};Ue.walkTokens=function(e,t){return co.walkTokens(e,t)};Ue.parseInline=co.parseInline;Ue.Parser=an;Ue.parser=an.parse;Ue.Renderer=gi;Ue.TextRenderer=Ga;Ue.Lexer=on;Ue.lexer=on.lex;Ue.Tokenizer=mi;Ue.Hooks=pi;Ue.parse=Ue;Ue.options;Ue.setOptions;Ue.use;Ue.walkTokens;Ue.parseInline;an.parse;on.lex;var DR=w('<div class="flex flex-col animate-fade-in agent-streaming-container"><div class="flex w-full items-center"><div class="flex relative items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble></div><div class="flex flex-col overflow-hidden text-fade-in mx-4 my-2 relative text-ellipsis h-full gap-6">'),MR=w("<span>"),n0=e=>{let[t,r]=Ar(M([]),{key:`agent-streaming-message-${e.streamingMessageId}`,storage:e.context.storage});return Ue.use({renderer:{link:(n,o,i)=>`<a href="${n}" target="_blank" rel="noopener noreferrer">${i}</a>`}}),Se(()=>{if(Hu()?.id!==e.streamingMessageId)return [];r(Hu()?.content.split("```").flatMap((n,o)=>o%2===0?n.split(`
121
+ `}strong(t){return `<strong>${t}</strong>`}em(t){return `<em>${t}</em>`}codespan(t){return `<code>${t}</code>`}br(){return "<br>"}del(t){return `<del>${t}</del>`}link(t,r,n){let o=Sw(t);if(o===null)return n;t=o;let i='<a href="'+t+'"';return r&&(i+=' title="'+r+'"'),i+=">"+n+"</a>",i}image(t,r,n){let o=Sw(t);if(o===null)return n;t=o;let i=`<img src="${t}" alt="${n}"`;return r&&(i+=` title="${r}"`),i+=">",i}text(t){return t}},_a=class{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,r,n){return ""+n}image(t,r,n){return ""+n}br(){return ""}},Qr=class e{options;renderer;textRenderer;constructor(t){this.options=t||Zn,this.options.renderer=this.options.renderer||new ri,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new _a;}static parse(t,r){return new e(r).parse(t)}static parseInline(t,r){return new e(r).parseInline(t)}parse(t,r=true){let n="";for(let o=0;o<t.length;o++){let i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=i,s=this.options.extensions.renderers[a.type].call({parser:this},a);if(s!==false||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){n+=s||"";continue}}switch(i.type){case "space":continue;case "hr":{n+=this.renderer.hr();continue}case "heading":{let a=i;n+=this.renderer.heading(this.parseInline(a.tokens),a.depth,UR(this.parseInline(a.tokens,this.textRenderer)));continue}case "code":{let a=i;n+=this.renderer.code(a.text,a.lang,!!a.escaped);continue}case "table":{let a=i,s="",l="";for(let c=0;c<a.header.length;c++)l+=this.renderer.tablecell(this.parseInline(a.header[c].tokens),{header:true,align:a.align[c]});s+=this.renderer.tablerow(l);let u="";for(let c=0;c<a.rows.length;c++){let d=a.rows[c];l="";for(let p=0;p<d.length;p++)l+=this.renderer.tablecell(this.parseInline(d[p].tokens),{header:false,align:a.align[p]});u+=this.renderer.tablerow(l);}n+=this.renderer.table(s,u);continue}case "blockquote":{let a=i,s=this.parse(a.tokens);n+=this.renderer.blockquote(s);continue}case "list":{let a=i,s=a.ordered,l=a.start,u=a.loose,c="";for(let d=0;d<a.items.length;d++){let p=a.items[d],f=p.checked,b=p.task,g="";if(p.task){let y=this.renderer.checkbox(!!f);u?p.tokens.length>0&&p.tokens[0].type==="paragraph"?(p.tokens[0].text=y+" "+p.tokens[0].text,p.tokens[0].tokens&&p.tokens[0].tokens.length>0&&p.tokens[0].tokens[0].type==="text"&&(p.tokens[0].tokens[0].text=y+" "+p.tokens[0].tokens[0].text)):p.tokens.unshift({type:"text",text:y+" "}):g+=y+" ";}g+=this.parse(p.tokens,u),c+=this.renderer.listitem(g,b,!!f);}n+=this.renderer.list(c,s,l);continue}case "html":{let a=i;n+=this.renderer.html(a.text,a.block);continue}case "paragraph":{let a=i;n+=this.renderer.paragraph(this.parseInline(a.tokens));continue}case "text":{let a=i,s=a.tokens?this.parseInline(a.tokens):a.text;for(;o+1<t.length&&t[o+1].type==="text";)a=t[++o],s+=`
122
+ `+(a.tokens?this.parseInline(a.tokens):a.text);n+=r?this.renderer.paragraph(s):s;continue}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(t,r){r=r||this.renderer;let n="";for(let o=0;o<t.length;o++){let i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==false||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=a||"";continue}}switch(i.type){case "escape":{let a=i;n+=r.text(a.text);break}case "html":{let a=i;n+=r.html(a.text);break}case "link":{let a=i;n+=r.link(a.href,a.title,this.parseInline(a.tokens,r));break}case "image":{let a=i;n+=r.image(a.href,a.title,a.text);break}case "strong":{let a=i;n+=r.strong(this.parseInline(a.tokens,r));break}case "em":{let a=i;n+=r.em(this.parseInline(a.tokens,r));break}case "codespan":{let a=i;n+=r.codespan(a.text);break}case "br":{n+=r.br();break}case "del":{let a=i;n+=r.del(this.parseInline(a.tokens,r));break}case "text":{let a=i;n+=r.text(a.text);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}},ei=class{options;constructor(t){this.options=t||Zn;}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}},cd=class{defaults=ud();options=this.setOptions;parse=this.#e(Zr.lex,Qr.parse);parseInline=this.#e(Zr.lexInline,Qr.parseInline);Parser=Qr;parser=Qr.parse;Renderer=ri;TextRenderer=_a;Lexer=Zr;lexer=Zr.lex;Tokenizer=ti;Hooks=ei;constructor(...t){this.use(...t);}walkTokens(t,r){let n=[];for(let o of t)switch(n=n.concat(r.call(this,o)),o.type){case "table":{let i=o;for(let a of i.header)n=n.concat(this.walkTokens(a.tokens,r));for(let a of i.rows)for(let s of a)n=n.concat(this.walkTokens(s.tokens,r));break}case "list":{let i=o;n=n.concat(this.walkTokens(i.items,r));break}default:{let i=o;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{n=n.concat(this.walkTokens(i[a],r));}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,r)));}}return n}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let o={...n};if(o.async=this.defaults.async||o.async||false,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=r.renderers[i.name];a?r.renderers[i.name]=function(...s){let l=i.renderer.apply(this,s);return l===false&&(l=a.apply(this,s)),l}:r.renderers[i.name]=i.renderer;}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[i.level];a?a.unshift(i.tokenizer):r[i.level]=[i.tokenizer],i.start&&(i.level==="block"?r.startBlock?r.startBlock.push(i.start):r.startBlock=[i.start]:i.level==="inline"&&(r.startInline?r.startInline.push(i.start):r.startInline=[i.start]));}"childTokens"in i&&i.childTokens&&(r.childTokens[i.name]=i.childTokens);}),o.extensions=r),n.renderer){let i=this.defaults.renderer||new ri(this.defaults);for(let a in n.renderer){let s=n.renderer[a],l=a,u=i[l];i[l]=(...c)=>{let d=s.apply(i,c);return d===false&&(d=u.apply(i,c)),d||""};}o.renderer=i;}if(n.tokenizer){let i=this.defaults.tokenizer||new ti(this.defaults);for(let a in n.tokenizer){let s=n.tokenizer[a],l=a,u=i[l];i[l]=(...c)=>{let d=s.apply(i,c);return d===false&&(d=u.apply(i,c)),d};}o.tokenizer=i;}if(n.hooks){let i=this.defaults.hooks||new ei;for(let a in n.hooks){let s=n.hooks[a],l=a,u=i[l];ei.passThroughHooks.has(a)?i[l]=c=>{if(this.defaults.async)return Promise.resolve(s.call(i,c)).then(p=>u.call(i,p));let d=s.call(i,c);return u.call(i,d)}:i[l]=(...c)=>{let d=s.apply(i,c);return d===false&&(d=u.apply(i,c)),d};}o.hooks=i;}if(n.walkTokens){let i=this.defaults.walkTokens,a=n.walkTokens;o.walkTokens=function(s){let l=[];return l.push(a.call(this,s)),i&&(l=l.concat(i.call(this,s))),l};}this.defaults={...this.defaults,...o};}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}#e(t,r){return (n,o)=>{let i={...o},a={...this.defaults,...i};this.defaults.async===true&&i.async===false&&(a.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),a.async=true);let s=this.#t(!!a.silent,!!a.async);if(typeof n>"u"||n===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(l=>t(l,a)).then(l=>a.walkTokens?Promise.all(this.walkTokens(l,a.walkTokens)).then(()=>l):l).then(l=>r(l,a)).then(l=>a.hooks?a.hooks.postprocess(l):l).catch(s);try{a.hooks&&(n=a.hooks.preprocess(n));let l=t(n,a);a.walkTokens&&this.walkTokens(l,a.walkTokens);let u=r(l,a);return a.hooks&&(u=a.hooks.postprocess(u)),u}catch(l){return s(l)}}}#t(t,r){return n=>{if(n.message+=`
123
+ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+Bt(n.message+"",true)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(n);throw n}}},Xn=new cd;function $e(e,t){return Xn.parse(e,t)}$e.options=$e.setOptions=function(e){return Xn.setOptions(e),$e.defaults=Xn.defaults,Ew($e.defaults),$e};$e.getDefaults=ud;$e.defaults=Zn;$e.use=function(...e){return Xn.use(...e),$e.defaults=Xn.defaults,Ew($e.defaults),$e};$e.walkTokens=function(e,t){return Xn.walkTokens(e,t)};$e.parseInline=Xn.parseInline;$e.Parser=Qr;$e.parser=Qr.parse;$e.Renderer=ri;$e.TextRenderer=_a;$e.Lexer=Zr;$e.lexer=Zr.lex;$e.Tokenizer=ti;$e.Hooks=ei;$e.parse=$e;$e.options;$e.setOptions;$e.use;$e.walkTokens;$e.parseInline;Qr.parse;Zr.lex;var jR=w('<div class="flex flex-col animate-fade-in agent-streaming-container"><div class="flex w-full items-center"><div class="flex relative items-start agent-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble></div><div class="flex flex-col overflow-hidden text-fade-in mx-4 my-2 relative text-ellipsis h-full gap-6">'),zR=w("<span>"),Ow=e=>{let[t,r]=Cr(R([]),{key:`agent-streaming-message-${e.streamingMessageId}`,storage:e.context.storage});return $e.use({renderer:{link:(n,o,i)=>`<a href="${n}" target="_blank" rel="noopener noreferrer">${i}</a>`}}),Ce(()=>{if(cu()?.id!==e.streamingMessageId)return [];r(cu()?.content.split("```").flatMap((n,o)=>o%2===0?n.split(`
101
124
 
102
- `).map(i=>Bd.default.sanitize(Ue.parse(i.replace(/【.+】/g,"").replace(/</g,"&lt;").replace(/>/g,"&gt;"),{breaks:true}),{ADD_ATTR:["target"]})):[Bd.default.sanitize(Ue.parse("```"+n+"```".replace(/</g,"&lt;").replace(/>/g,"&gt;"),{breaks:true}),{ADD_ATTR:["target"]})]).filter(Ne)??[]);}),(()=>{var n=DR(),o=n.firstChild,i=o.firstChild,a=i.firstChild,s=a.nextSibling;return a.style.setProperty("width","100%"),a.style.setProperty("height","100%"),v(s,m(ke,{get each(){return t()},children:l=>(()=>{var c=MR();return c.innerHTML=l,c})()})),n})()};var $R=w("<div><div>"),qa=e=>{let t,[r,n]=M(0),o=new ResizeObserver(i=>n(i[0].target.clientHeight-(X()?24:40)));return ce(()=>{t&&o.observe(t);}),me(()=>{t&&o.unobserve(t);}),(()=>{var i=$R(),a=i.firstChild,s=t;return typeof s=="function"?be(s,i):t=i,v(a,m(ec,{get theme(){return e.theme},get src(){return e.avatarSrc}})),$(l=>{var c="flex flex-shrink-0 items-center relative agent-avatar-container "+(X()?"w-6":"w-10"),u="absolute flex items-center top-0"+(X()?" w-6 h-6":" w-10 h-10")+(e.hideAvatar?" opacity-0":" opacity-100"),d=`${r()}px`,f=e.isTransitionDisabled?void 0:"top 350ms ease-out, opacity 250ms ease-out";return c!==l.e&&j(i,l.e=c),u!==l.t&&j(a,l.t=u),d!==l.a&&((l.a=d)!=null?a.style.setProperty("top",d):a.style.removeProperty("top")),f!==l.o&&((l.o=f)!=null?a.style.setProperty("transition",f):a.style.removeProperty("transition")),l},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()};var o0=w('<div><div class="flex flex-col flex-1 gap-2">'),LR=w('<div class="flex flex-col w-full min-w-0 gap-2 agent-chat-chunk">'),i0=e=>{let t,[r,n]=M(e.isTransitionDisabled?e.messages.length:0),[o,i]=M();ce(()=>{e.streamingMessageId||(e.messages.length===0&&e.onAllBubblesDisplayed(),e.onScrollToBottom(t,50));});let a=async s=>{(e.settings.typingEmulation?.delayBetweenBubbles??vt.typingEmulation.delayBetweenBubbles)>0&&r()<e.messages.length-1&&await new Promise(c=>setTimeout(c,(e.settings.typingEmulation?.delayBetweenBubbles??vt.typingEmulation.delayBetweenBubbles)*1e3));let l=e.messages[r()].id;await e.onNewBubbleDisplayed(l),n(r()===e.messages.length?r():r()+1),e.onScrollToBottom(s),r()===e.messages.length&&(i(s),e.onAllBubblesDisplayed());};return (()=>{var s=LR();return v(s,m(W,{get when(){return e.messages.length>0},get children(){var l=o0(),c=l.firstChild;return v(l,m(W,{get when(){return (e.theme.chat?.hostAvatar?.isEnabled??Fo)&&e.messages.length>0},get children(){return m(qa,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar},get isTransitionDisabled(){return e.isTransitionDisabled}})}}),c),v(c,m(ke,{get each(){return e.messages.slice(0,r()+1)},children:(u,d)=>m(Yw,{message:u,get typingEmulation(){return e.settings.typingEmulation},get isTypingSkipped(){return B(()=>!!((e.settings.typingEmulation?.isDisabledOnFirstMessage??vt.typingEmulation.isDisabledOnFirstMessage)&&e.index===0))()&&d()===0},get onTransitionEnd(){return e.isTransitionDisabled?void 0:a},get onCompleted(){return e.onSubmit}})})),$(u=>{var d="flex"+(X()?" gap-1":" gap-2"),f=e.theme.chat?.guestAvatar?.isEnabled??ji?X()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%";return d!==u.e&&j(l,u.e=d),f!==u.t&&((u.t=f)!=null?c.style.setProperty("max-width",f):c.style.removeProperty("max-width")),u},{e:void 0,t:void 0}),l}}),null),v(s,(()=>{var l=B(()=>!!(e.input&&r()===e.messages.length));return ()=>l()&&m($w,{get theme(){return e.theme},ref(c){var u=t;typeof u=="function"?u(c):t=c;},get block(){return e.input},get chunkIndex(){return e.index},get hasHostAvatar(){return e.theme.chat?.hostAvatar?.isEnabled??Fo},get guestAvatar(){return e.theme.chat?.guestAvatar},get context(){return e.context},get isInputPrefillEnabled(){return e.settings.general?.isInputPrefillEnabled??vt.general.isInputPrefillEnabled},get isOngoingLastChunk(){return e.isOngoingLastChunk},get hasError(){return e.hasError},onTransitionEnd:()=>e.onScrollToBottom(o()),get onSubmit(){return e.onSubmit},get onSkip(){return e.onSkip}})})(),null),v(s,m(W,{get when(){return e.streamingMessageId},keyed:true,children:l=>(()=>{var c=o0(),u=c.firstChild;return v(c,m(W,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??Fo},get children(){return m(qa,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar}})}}),u),v(u,m(n0,{streamingMessageId:l,get context(){return e.context}})),$(d=>{var f="flex"+(X()?" gap-1":" gap-2"),p=e.theme.chat?.guestAvatar?.isEnabled??ji?X()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%";return f!==d.e&&j(c,d.e=f),p!==d.t&&((d.t=p)!=null?u.style.setProperty("max-width",p):u.style.removeProperty("max-width")),d},{e:void 0,t:void 0}),c})()}),null),s})()};var NR=w('<div class="flex flex-col animate-fade-in"><div class="flex w-full items-center"><div class="flex relative items-start agent-host-bubble"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble></div><p class="overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative opacity-0 h-6 text-ellipsis">'),a0=()=>(()=>{var e=NR(),t=e.firstChild,r=t.firstChild,n=r.firstChild;return n.style.setProperty("width","64px"),n.style.setProperty("height","32px"),v(n,m(Vt,{})),e})();var BR=w('<div class="flex w-full agent-loading-chunk"><div class="flex flex-col w-full min-w-0"><div class="flex gap-2">'),s0=e=>(()=>{var t=BR(),r=t.firstChild,n=r.firstChild;return v(n,m(W,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??Fo},get children(){return m(qa,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url}})}}),null),v(n,m(a0,{}),null),t})();var FR=w('<div class="w-full max-w-xs p-4 text-gray-500 bg-white shadow flex flex-col gap-2 agent-popup-blocked-toast"role=alert><div class="flex flex-col gap-1"><span class=" text-sm font-semibold text-gray-900">Popup blocked</span><div class="text-sm font-normal">The agent wants to open a new tab but it was blocked by your browser. It needs a manual approval.</div></div><a target=_blank class="py-1 px-4 justify-center text-sm font-semibold text-white focus:outline-none flex items-center disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 filter hover:brightness-90 active:brightness-75 agent-button"rel=noreferrer>Continue in new tab'),l0=e=>(()=>{var t=FR(),r=t.firstChild,n=r.nextSibling;return n.$$click=()=>e.onLinkClick(),$(()=>G(n,"href",e.url)),t})();Ge(["click"]);var UR=w('<div class="flex flex-col overflow-y-auto w-full relative scrollable-container agent-chat-view scroll-smooth gap-2">'),jR=w('<div class="flex justify-end">'),HR=w('<div class="w-full flex-shrink-0 agent-bottom-spacer h-[20%]">'),WR=.6,VR=50,zR=(e,t)=>({...e,chat:{...e.chat,hostAvatar:e.chat?.hostAvatar&&t?.hostAvatarUrl?{...e.chat.hostAvatar,url:t.hostAvatarUrl}:e.chat?.hostAvatar,guestAvatar:e.chat?.guestAvatar&&t?.guestAvatarUrl?{...e.chat.guestAvatar,url:t?.guestAvatarUrl}:e.chat?.guestAvatar}}),c0=e=>{let t,[r,n]=Ar(M([{input:e.initialChatReply.input,messages:e.initialChatReply.messages}]),{key:`agent-${e.context.agent.id}-chatChunks`,storage:e.context.storage,onRecovered:()=>{setTimeout(()=>{t?.scrollTo(0,t.scrollHeight);},200);}}),[o,i]=Ar(M(e.initialChatReply.clientSideActions??[]),{key:`agent-${e.context.agent.id}-clientSideActions`,storage:e.context.storage}),[a,s]=Ar(M(false),{key:`agent-${e.context.agent.id}-isEnded`,storage:e.context.storage}),[l,c]=M(e.initialChatReply.dynamicTheme),[u,d]=M(e.initialChatReply.agent.theme),[f,p]=M(false),[g,h]=M(),[b,y]=M(false);ce(()=>{(async()=>{if(r().length>1)S();else {let E=o()?.filter(_=>ut(_.lastBubbleBlockId));await I(E);}})();});let S=()=>{[...r()].pop()?.streamingMessageId&&n(E=>E.slice(0,-1));let R=Fd({clientSideActions:o(),lastBubbleBlockId:void 0});i(E=>E.slice(R.length));},C=({id:R,message:E})=>{p(false);let _=[...r()].pop();_&&(_.streamingMessageId!==R&&n(T=>[...T,{messages:[],streamingMessageId:R}]),Wu({id:R,content:E}));};Se(()=>{d(zR(e.initialChatReply.agent.theme,l()));});let k=async R=>{R&&(e.onNewLogs?.(R),!e.context.isPreview&&await Mu({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:R}));},D=async R=>{y(false);let E=[...r()].pop()?.input;E?.id&&e.onAnswer&&R&&e.onAnswer({message:av(R),blockId:E.id});let _=setTimeout(()=>{p(true);},1e3);U();let{data:T,error:O}=await Ry({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,message:qR(R)});if(clearTimeout(_),p(false),O){y(true);let L=[{description:"Failed to send the reply",details:O instanceof Ir?{status:O.response.status,body:await O.response.json()}:O,status:"error"}];await Mu({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:L}),e.onNewLogs?.(L);return}if(T){if(T.progress&&e.onProgressUpdate?.(T.progress),T.lastMessageNewFormat&&ju([...ml(),{inputIndex:[...r()].length-1,formattedMessage:T.lastMessageNewFormat}]),T.logs&&e.onNewLogs?.(T.logs),T.dynamicTheme&&c(T.dynamicTheme),T.input&&e.onNewInputBlock&&e.onNewInputBlock(T.input),T.clientSideActions){i(T.clientSideActions);let L=Fd({clientSideActions:T.clientSideActions,lastBubbleBlockId:void 0});if(await I(L),T.clientSideActions.length===1&&T.clientSideActions[0].type==="stream"&&T.messages.length===0&&T.input===void 0)return}n(L=>[...L,{input:T.input,messages:T.messages}]);}},U=(R,E=0)=>{!t||t.scrollTop+t.clientHeight<t.scrollHeight-t.clientHeight*WR||setTimeout(()=>{t?.scrollTo({top:R?R.offsetTop-E:t.scrollHeight,behavior:"smooth"});},VR);},N=async()=>{let R=[...r()].pop();R&&ut(R.input)&&(s(true),e.onEnd?.());},ie=async R=>{let E=Fd({clientSideActions:o(),lastBubbleBlockId:R});await I(E);},I=async R=>{for(let E of R){("streamOpenAiChatCompletion"in E||"webhookToExecute"in E||"stream"in E)&&p(true);let _=await iv({clientSideAction:E,context:{apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,resultId:e.initialChatReply.resultId},onMessageStream:C});if(i(T=>T.slice(1)),_&&"logs"in _&&k(_.logs),_&&"replyToSend"in _){p(false),D(_.replyToSend?{type:"text",value:_.replyToSend}:void 0);return}_&&"blockedPopupUrl"in _&&h(_.blockedPopupUrl),_&&"scriptCallbackMessage"in _&&e.onScriptExecutionSuccess?.(_.scriptCallbackMessage);}};me(()=>{Wu(void 0),ju([]);});let A=()=>D(void 0);return (()=>{var R=UR(),E=t;return typeof E=="function"?be(E,R):t=R,v(R,m(ke,{get each(){return r()},children:(_,T)=>m(i0,{get index(){return T()},get messages(){return _.messages},get input(){return _.input},get theme(){return u()},get settings(){return e.initialChatReply.agent.settings},get streamingMessageId(){return _.streamingMessageId},get context(){return e.context},get hideAvatar(){return B(()=>!_.input)()&&((r()[T()+1]?.messages??[]).length>0||r()[T()+1]?.streamingMessageId!==void 0||_.messages.length>0&&f())},get hasError(){return B(()=>!!b())()&&T()===r().length-1},get isTransitionDisabled(){return T()!==r().length-1},get isOngoingLastChunk(){return B(()=>!a())()&&T()===r().length-1},onNewBubbleDisplayed:ie,onAllBubblesDisplayed:N,onSubmit:D,onScrollToBottom:U,onSkip:A})}),null),v(R,m(W,{get when(){return f()},get children(){return m(s0,{get theme(){return u()}})}}),null),v(R,m(W,{get when(){return g()},keyed:true,children:_=>(()=>{var T=jR();return v(T,m(l0,{url:_,onLinkClick:()=>h(void 0)})),T})()}),null),v(R,m(GR,{}),null),R})()},GR=()=>HR(),qR=e=>{if(e){if(e.type==="text")return {type:"text",text:e.value,attachedFileUrls:e.attachments?.map(t=>t.url)};if(e.type==="recording")return {type:"audio",url:e.url}}},Fd=({clientSideActions:e,lastBubbleBlockId:t})=>{let r=[],n=t;for(let o of e){if(n!==o.lastBubbleBlockId)break;n=o.lastBubbleBlockId,t===o.lastBubbleBlockId&&r.push(o);}return r};var YR=w('<div class="h-full flex justify-center items-center flex-col"><p class="text-2xl text-center"></p><pre>'),u0=e=>(()=>{var t=YR(),r=t.firstChild,n=r.nextSibling;return v(r,()=>e.error.message),v(n,()=>JSON.stringify(e.error.cause,null,2)),t})();var KR=w('<a target=_blank rel="noopener noreferrer"class=brand-mark id=brand-mark><span>'),d0=e=>{let t,r,n=o=>{o.forEach(i=>{i.removedNodes.forEach(a=>{"id"in a&&t&&a.id==="brand-mark"&&e.agentContainer?.append(t);});});};return ce(()=>{!document||!e.agentContainer||(r=new MutationObserver(n),r.observe(e.agentContainer,{subtree:false,childList:true}));}),me(()=>{r&&r.disconnect();}),(()=>{var o=KR(),i=o.firstChild,a=t;return typeof a=="function"?be(a,o):t=o,v(i,()=>e.text),$(()=>G(o,"href",e.url)),o})()};var XR=w("<div class=agent-progress-bar-container><div class=agent-progress-bar>"),Ud=e=>(()=>{var t=XR(),r=t.firstChild;return $(n=>(n=`${e.value}%`)!=null?r.style.setProperty("width",n):r.style.removeProperty("width")),t})();var f0=w("<style>"),ZR=w("<div>"),hi=e=>{let[t,r]=M(),[n,o]=M(""),[i,a]=M(false),[s,l]=M(),c=async()=>{e.font&&Yc(e.font),a(true);let u=new URLSearchParams(location.search);e.onInit?.();let d={};u.forEach((y,S)=>{d[S]=y;});let f=typeof e.agent=="string"?e.agent:void 0,p=typeof e.agent!="string"||(e.isPreview??false),g=Hm(f),{data:h,error:b}=await mm({stripeRedirectStatus:u.get("redirect_status")??void 0,agent:e.agent,apiHost:e.apiHost,isPreview:p,resultId:Ne(e.resultId)?e.resultId:g,prefilledVariables:{...d,...e.prefilledVariables},startFrom:e.startFrom,sessionId:e.sessionId});if(b instanceof Ir)return p?l(new Error("\u{1F6A8} An error occurred while loading the agent.",{})):b.response.status===400||b.response.status===403?l(new Error("This agent is now closed.")):b.response.status===404?l(new Error("The agent you're looking for doesn't exist.")):l(new Error(`Something went wrong while starting the chat! (${b.response.statusText}) Please try again.`));if(b instanceof Po)return l(new Error(b.message));if(!h)return l(b&&p?new Error("Error! Could not reach server. Check your connection.",{cause:b}):new Error("Error! Could not reach server. Check your connection."));if(h.resultId&&f&&(h.agent.settings.general?.rememberUser?.isEnabled??vt.general.rememberUser.isEnabled)){g&&g!==h.resultId&&Rs(h.agent.id);let y=h.agent.settings.general?.rememberUser?.storage??vt.general.rememberUser.storage;Wm(y)(f,h.resultId);let S=Vm(h.agent.id);S&&S.agent.publishedAt&&h.agent.publishedAt?new Date(S.agent.publishedAt).getTime()===new Date(h.agent.publishedAt).getTime()?r(S):(Rs(h.agent.id),r(h),Qc(h,{agentId:h.agent.id,storage:y})):(r(h),Qc(h,{agentId:h.agent.id,storage:y})),e.onChatStatePersisted?.(true);}else {if(Rs(h.agent.id),r(h),h.input?.id&&e.onNewInputBlock&&e.onNewInputBlock(h.input),h.logs){let y=h.logs.map(S=>({status:S.status??"",description:S.description??"",details:S.details}));e.onNewLogs?.(y);}e.onChatStatePersisted?.(false);}o(h.agent.theme.customCss??"");};return Se(()=>{ut(e.agent)||i()||c().then();}),Se(()=>{ut(e.agent)||typeof e.agent=="string"||(o(e.agent.theme.customCss??""),e.agent.theme.general?.progressBar?.isEnabled&&t()&&!t()?.agent.theme.general?.progressBar?.isEnabled&&(a(false),c().then()));}),me(()=>{a(false);}),[(()=>{var u=f0();return v(u,n),u})(),(()=>{var u=f0();return v(u,Oy),u})(),m(W,{get when(){return s()},keyed:true,children:u=>m(u0,{error:u})}),m(W,{get when(){return t()},keyed:true,children:u=>m(QR,{get class(){return e.class},get initialChatReply(){return {...u,agent:{...u.agent,settings:typeof e.agent=="string"?u.agent?.settings:e.agent?.settings,theme:typeof e.agent=="string"?u.agent?.theme:e.agent?.theme}}},get context(){return {apiHost:e.apiHost,isPreview:typeof e.agent!="string"||(e.isPreview??false),resultId:u.resultId,sessionId:u.sessionId,agent:u.agent,storage:u.agent.settings.general?.rememberUser?.isEnabled&&!(typeof e.agent!="string"||(e.isPreview??false))?u.agent.settings.general?.rememberUser?.storage??vt.general.rememberUser.storage:void 0}},get progressBarRef(){return e.progressBarRef},get onNewInputBlock(){return e.onNewInputBlock},get onNewLogs(){return e.onNewLogs},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onScriptExecutionSuccess(){return e.onScriptExecutionSuccess}})})]},QR=e=>{let[t,r]=Ar(M(e.initialChatReply.progress),{storage:e.context.storage,key:`agent-${e.context.agent.id}-progressValue`}),n,o=new ResizeObserver(i=>Mm((i[0]?.target.clientWidth??0)<432));return ce(()=>{n&&(bm(n),o.observe(n),hm(`${n.clientHeight}px`));}),Se(()=>{Yc(e.initialChatReply.agent.theme.general?.font??{type:ym,family:Lo}),n&&jm(e.initialChatReply.agent.theme,n,e.context.isPreview);}),me(()=>{n&&o.unobserve(n);}),(()=>{var i=ZR(),a=n;return typeof a=="function"?be(a,i):n=i,v(i,m(W,{get when(){return pe(t())&&e.initialChatReply.agent.theme.general?.progressBar?.isEnabled},get children(){return m(W,{get when(){return e.progressBarRef&&(e.initialChatReply.agent.theme.general?.progressBar?.position??Ss)==="fixed"},get fallback(){return m(Ud,{get value(){return t()}})},get children(){return m(Wf,{get mount(){return e.progressBarRef},get children(){return m(Ud,{get value(){return t()}})}})}})}}),null),v(i,m(c0,{get context(){return e.context},get initialChatReply(){return e.initialChatReply},get onNewInputBlock(){return e.onNewInputBlock},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onNewLogs(){return e.onNewLogs},onProgressUpdate:r,get onScriptExecutionSuccess(){return e.onScriptExecutionSuccess}}),null),v(i,m(W,{get when(){return e.initialChatReply.agent.settings.general?.isBrandingEnabled},get children(){return m(d0,{agentContainer:n,get url(){return e.initialChatReply.agent.settings.general?.brandingUrl??"https://release0.com/?utm_source=brand-mark"},get text(){return e.initialChatReply.agent.settings.general?.brandingText??"Powered by Release0"}})}}),null),v(i,m(Eu,{toaster:Fr,children:s=>m(zn.Root,{get children(){return [m(zn.Title,{class:"!font-semibold !text-sm",get children(){return s().title}}),m(zn.Description,{class:"!font-normal",get children(){return s().description}}),m(zn.CloseTrigger,{class:"absolute right-2 top-2",get children(){return m(Ur,{class:"w-4 h-4"})}})]}})}),null),$(()=>j(i,xe("relative flex w-full h-full text-base overflow-hidden flex-col justify-center items-center agent-container",e.class))),i})()};var nc="Zendesk Web Widget Opened";var fo='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--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-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--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-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--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-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--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-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.16 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-bottom-6{bottom:-24px}.-left-5{left:-20px}.-right-2{right:-8px}.-right-5{right:-20px}.-top-2{top:-8px}.bottom-5{bottom:20px}.bottom-\\[calc\\(100\\%\\+12px\\)\\]{bottom:calc(100% + 12px)}.left-0{left:0}.left-1\\/2{left:50%}.left-5{left:20px}.left-\\[-4px\\]{left:-4px}.right-0{right:0}.right-2{right:8px}.right-3{right:12px}.right-5{right:20px}.right-\\[-4px\\]{right:-4px}.top-0{top:0}.top-1\\/2{top:50%}.top-2{top:8px}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[424242\\]{z-index:424242}.m-2{margin:8px}.m-auto{margin:auto}.mx-4{margin-left:16px;margin-right:16px}.my-2{margin-bottom:8px;margin-top:8px}.-mr-1{margin-right:-4px}.-mt-1{margin-top:-4px}.ml-2{margin-left:8px}.mt-0\\.5{margin-top:2px}.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-4{margin-top:16px}.\\!block{display:block!important}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.size-10{height:40px;width:40px}.size-6{height:24px;width:24px}.h-0{height:0}.h-10{height:40px}.h-2{height:8px}.h-2\\.5{height:10px}.h-3{height:12px}.h-4{height:16px}.h-5{height:20px}.h-6{height:24px}.h-8{height:32px}.h-9{height:36px}.h-\\[120px\\]{height:120px}.h-\\[20\\%\\]{height:20%}.h-\\[56px\\]{height:56px}.h-\\[58px\\]{height:58px}.h-\\[80vh\\]{height:80vh}.h-full{height:100%}.h-screen{height:100vh}.max-h-60{max-height:240px}.max-h-80{max-height:320px}.max-h-\\[464px\\]{max-height:464px}.min-h-full{min-height:100%}.w-0{width:0}.w-10{width:40px}.w-2{width:8px}.w-3{width:12px}.w-4{width:16px}.w-5{width:20px}.w-6{width:24px}.w-64{width:256px}.w-8{width:32px}.w-\\[120px\\]{width:120px}.w-\\[35px\\]{width:35px}.w-\\[58px\\]{width:58px}.w-\\[60\\%\\]{width:60%}.w-full{width:100%}.w-screen{width:100vw}.min-w-0{min-width:0}.min-w-\\[250px\\]{min-width:250px}.max-w-\\[256px\\]{max-width:256px}.max-w-\\[350px\\]{max-width:350px}.max-w-\\[90\\%\\]{max-width:90%}.max-w-full{max-width:100%}.max-w-lg{max-width:512px}.max-w-xs{max-width:320px}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.-translate-y-1\\/2{transform:translate(var(--tw-translate-x),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))}.-translate-y-1\\/2{--tw-translate-y:-50%}.-rotate-180{--tw-rotate:-180deg}.-rotate-180,.rotate-0{transform:translate(var(--tw-translate-x),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))}.rotate-0{--tw-rotate:0deg}.scale-0{--tw-scale-x:0;--tw-scale-y:0}.scale-0,.scale-100{transform:translate(var(--tw-translate-x),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))}.scale-100{--tw-scale-x:1;--tw-scale-y:1}.transform{transform:translate(var(--tw-translate-x),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))}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in .3s ease-out}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-6{gap:24px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.scroll-smooth{scroll-behavior:smooth}.text-ellipsis{text-overflow:ellipsis}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-2xl{border-radius:16px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:6px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-current{border-color:currentColor}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity,1))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity,1))}.bg-\\[rgba\\(0\\2c 0\\2c 0\\2c 0\\.5\\)\\]{background-color:rgba(0,0,0,.5)}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.bg-black\\/20{background-color:rgba(0,0,0,.2)}.bg-blue-400{--tw-bg-opacity:1;background-color:rgb(96 165 250/var(--tw-bg-opacity,1))}.bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.bg-green-400{--tw-bg-opacity:1;background-color:rgb(74 222 128/var(--tw-bg-opacity,1))}.bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.bg-pink-400{--tw-bg-opacity:1;background-color:rgb(244 114 182/var(--tw-bg-opacity,1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-opacity-50{--tw-bg-opacity:0.5}.fill-transparent{fill:transparent}.stroke-2{stroke-width:2}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0\\.5{padding:2px}.p-1{padding:4px}.p-2{padding:8px}.p-3{padding:12px}.p-4{padding:16px}.p-\\[1px\\]{padding:1px}.px-0{padding-left:0;padding-right:0}.px-2{padding-left:8px;padding-right:8px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-8{padding-left:32px;padding-right:32px}.px-\\[12px\\]{padding-left:12px;padding-right:12px}.px-\\[15px\\]{padding-left:15px;padding-right:15px}.py-1{padding-bottom:4px;padding-top:4px}.py-2{padding-bottom:8px;padding-top:8px}.py-3{padding-bottom:12px;padding-top:12px}.py-4{padding-bottom:16px;padding-top:16px}.py-6{padding-bottom:24px;padding-top:24px}.py-\\[4px\\]{padding-bottom:4px;padding-top:4px}.py-\\[7px\\]{padding-bottom:7px;padding-top:7px}.pb-0{padding-bottom:0}.pl-2{padding-left:8px}.pl-4{padding-left:16px}.pr-1{padding-right:4px}.pr-2{padding-right:8px}.pr-4{padding-right:16px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.\\!text-sm{font-size:14px!important;line-height:20px!important}.text-2xl{font-size:24px;line-height:32px}.text-4xl{font-size:36px;line-height:40px}.text-\\[40px\\]{font-size:40px}.text-base{font-size:16px;line-height:24px}.text-sm{font-size:14px;line-height:20px}.text-xl{font-size:20px;line-height:28px}.text-xs{font-size:12px;line-height:16px}.\\!font-normal{font-weight:400!important}.\\!font-semibold{font-weight:600!important}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-md,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.blur{--tw-blur:blur(8px)}.blur,.brightness-150{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-150{--tw-brightness:brightness(1.5)}.brightness-200{--tw-brightness:brightness(2)}.brightness-200,.brightness-95{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-95{--tw-brightness:brightness(.95)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.scrollable-container::-webkit-scrollbar{display:none}.scrollable-container{-ms-overflow-style:none;scrollbar-width:none}.text-fade-in{transition:opacity .4s ease-in .2s}.bubble-typing{transition:width .4s ease-out,height .4s ease-out}.bubble1,.bubble2,.bubble3{background-color:var(--agent-host-bubble-color);opacity:.5}.bubble1,.bubble2{animation:chatBubbles 1s ease-in-out infinite}.bubble2{animation-delay:.3s}.bubble3{animation:chatBubbles 1s ease-in-out infinite;animation-delay:.5s}@keyframes chatBubbles{0%{transform:translateY(2.5)}50%{transform:translateY(-2.5px)}to{transform:translateY(0)}}button,input,textarea{font-weight:300}a{text-decoration:underline}ol,ul{margin-inline-end:0;margin-inline-start:0;padding-inline-start:40px}ol{list-style-type:decimal}ul{list-style-type:disc}li:not(:last-child){margin-bottom:8px}pre{white-space:pre-wrap;word-wrap:break-word;max-height:100%;max-width:100%;overflow:auto;overflow-wrap:break-word}.slate-bold{font-weight:700}.slate-italic{font-style:oblique}.slate-underline{text-decoration:underline}.text-input::-moz-placeholder{color:var(--agent-input-placeholder-color)!important;opacity:1!important}.text-input::placeholder{color:var(--agent-input-placeholder-color)!important;opacity:1!important}.agent-container{background-color:var(--agent-container-bg-color);background-image:var(--agent-container-bg-image);background-position:50%;background-size:cover;container-type:inline-size;font-family:var(--agent-container-font-family),-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"}.agent-chat-view{-webkit-backdrop-filter:blur(var(--agent-chat-container-blur));backdrop-filter:blur(var(--agent-chat-container-blur));background-color:rgba(var(--agent-chat-container-bg-rgb),var(--agent-chat-container-opacity));border-color:rgba(var(--agent-chat-container-border-rgb),var(--agent-chat-container-border-opacity));border-width:var(--agent-chat-container-border-width);box-shadow:var(--agent-chat-container-box-shadow);color:rgb(var(--agent-chat-container-color));max-width:var(--agent-chat-container-max-width);min-height:100%;padding-left:12px;padding-right:12px;padding-top:20px}@container (min-width: 432px){.agent-chat-view{border-radius:var(--agent-chat-container-border-radius);max-height:var(--agent-chat-container-max-height);min-height:var(--agent-chat-container-max-height);padding-left:20px;padding-right:20px;padding-top:40px}}.agent-button{-webkit-backdrop-filter:blur(var(--agent-button-blur));backdrop-filter:blur(var(--agent-button-blur));background-color:rgba(var(--agent-button-bg-rgb),var(--agent-button-opacity));border-color:rgba(var(--agent-button-border-rgb),var(--agent-button-border-opacity));border-radius:var(--agent-button-border-radius);border-width:var(--agent-button-border-width);box-shadow:var(--agent-button-box-shadow);color:var(--agent-button-color);transition:all .3s ease}.agent-selectable{background-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.08));border-color:rgba(var(--agent-button-border-rgb),calc(var(--selectable-alpha-ratio)*.25));border-radius:var(--agent-button-border-radius);border-width:var(--agent-button-border-width);color:rgb(var(--agent-chat-container-color));transition:all .3s ease}.agent-selectable:hover{background-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.12));border-color:rgba(var(--agent-button-border-rgb),calc(var(--selectable-alpha-ratio)*.3))}.agent-selectable.selected{background-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.18));border-color:rgba(var(--agent-button-border-rgb),calc(var(--selectable-alpha-ratio)*.35))}.agent-checkbox{background-color:rgba(var(--agent-checkbox-bg-rgb));border:1px solid rgba(var(--agent-button-bg-rgb),var(--agent-button-opacity));border-radius:var(--agent-button-border-radius);border-radius:2px;color:var(--agent-button-color);padding:1px;transition:all .3s ease}.agent-checkbox.checked{background-color:rgb(var(--agent-button-bg-rgb))}.agent-host-bubble{color:var(--agent-host-bubble-color)}form.agent-host-bubble{border-color:rgba(var(--agent-host-bubble-bg-rgb),1);border-radius:var(--agent-host-bubble-border-radius);border-style:dashed;border-width:2px}.agent-host-bubble>.bubble-typing{-webkit-backdrop-filter:blur(var(--agent-host-bubble-blur));backdrop-filter:blur(var(--agent-host-bubble-blur));background-color:rgba(var(--agent-host-bubble-bg-rgb),var(--agent-host-bubble-opacity));border-color:rgba(var(--agent-host-bubble-border-rgb),var(--agent-host-bubble-border-opacity));border-radius:var(--agent-host-bubble-border-radius);border-width:var(--agent-host-bubble-border-width);box-shadow:var(--agent-host-bubble-box-shadow);overflow:hidden}.agent-host-bubble iframe,.agent-host-bubble img,.agent-host-bubble video{border-radius:6px}.agent-guest-bubble{-webkit-backdrop-filter:blur(var(--agent-guest-bubble-blur));backdrop-filter:blur(var(--agent-guest-bubble-blur));background-color:rgba(var(--agent-guest-bubble-bg-rgb),var(--agent-guest-bubble-opacity));border-color:rgba(var(--agent-guest-bubble-border-rgb),var(--agent-guest-bubble-border-opacity));border-width:var(--agent-guest-bubble-border-width);box-shadow:var(--agent-guest-bubble-box-shadow);color:var(--agent-guest-bubble-color)}.agent-guest-bubble,.agent-guest-bubble-image-attachment{border-radius:var(--agent-guest-bubble-border-radius)}.agent-input{-webkit-backdrop-filter:blur(var(--agent-input-blur));backdrop-filter:blur(var(--agent-input-blur));background-color:rgba(var(--agent-input-bg-rgb),var(--agent-input-opacity));border-color:rgba(var(--agent-input-border-rgb),var(--agent-input-border-opacity));border-radius:var(--agent-input-border-radius);border-width:var(--agent-input-border-width);box-shadow:var(--agent-input-box-shadow);transition:filter .1s ease}.agent-input,.agent-input-error-message{color:var(--agent-input-color)}.agent-input-form .agent-button{box-shadow:var(--agent-input-box-shadow)}.agent-button>.send-icon{fill:var(--agent-button-color)}.ping span{background-color:rgb(var(--agent-button-bg-rgb))}.rating-icon-container svg{height:42px;width:42px;stroke:rgb(var(--agent-button-bg-rgb));fill:rgba(var(--agent-host-bubble-bg-rgb),var(--agent-host-bubble-opacity));transition:fill .1s ease-out}.rating-icon-container.selected svg{fill:rgb(var(--agent-button-bg-rgb))}.rating-icon-container:hover svg{filter:brightness(.9)}.rating-icon-container:active svg{filter:brightness(.75)}.upload-progress-bar{border-radius:var(--agent-input-border-radius)}.total-files-indicator,.upload-progress-bar{background-color:rgb(var(--agent-button-bg-rgb))}.total-files-indicator{color:var(--agent-button-color);font-size:10px}.agent-upload-input{border-radius:var(--agent-input-border-radius);transition:border-color .1s ease-out}.agent-upload-input.dragging-over{border-color:rgb(var(--agent-button-bg-rgb))}.secondary-button{background-color:rgba(var(--agent-host-bubble-bg-rgb),var(--agent-host-bubble-opacity));border-radius:var(--agent-button-border-radius);color:var(--agent-host-bubble-color)}.agent-country-select{border-radius:var(--agent-button-border-radius);color:var(--agent-input-color)}.agent-country-select,.agent-date-input{background-color:var(--agent-input-bg-color)}.agent-date-input{color:var(--agent-input-color);color-scheme:light}.agent-date-input,.agent-popup-blocked-toast{border-radius:var(--agent-input-border-radius)}.agent-picture-button{background-color:rgb(var(--agent-button-bg-rgb));border-radius:var(--agent-button-border-radius);color:var(--agent-button-color);overflow:hidden;transition:all .3s ease;width:236px}.agent-picture-button>img,.agent-selectable-picture>img{border-radius:var(--agent-button-border-radius) var(--agent-button-border-radius) 0 0;height:100%;max-height:200px;min-width:200px;-o-object-fit:cover;object-fit:cover;width:100%}.agent-picture-button.has-svg>img,.agent-selectable-picture.has-svg>img{max-height:128px;-o-object-fit:contain;object-fit:contain;padding:1rem}.agent-selectable-picture{background-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.08));border:1px solid rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.25));border-radius:var(--agent-button-border-radius);color:rgb(var(--agent-chat-container-color));transition:all .3s ease;width:236px}.agent-selectable-picture:hover{background-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.12));border-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.3))}.agent-selectable-picture.selected{background-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.18));border-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.35))}select option{background-color:var(--agent-input-bg-color);color:var(--agent-input-color)}.agent-progress-bar-container{background-color:rgba(var(--agent-progress-bar-bg-rgb),calc(var(--selectable-alpha-ratio)*.12));bottom:var(--agent-progress-bar-bottom);height:var(--agent-progress-bar-height);left:0;position:var(--agent-progress-bar-position);top:var(--agent-progress-bar-top);width:100%;z-index:99999999}.agent-progress-bar-container>.agent-progress-bar{background-color:var(--agent-progress-bar-color);height:100%;position:absolute;transition:width .25s ease}.agent-recorder .left-gradient{background-image:linear-gradient(to right,rgba(var(--agent-input-bg-rgb),1),rgba(var(--agent-input-bg-rgb),0))}.agent-recorder .right-gradient{background-image:linear-gradient(to left,rgba(var(--agent-input-bg-rgb),1),rgba(var(--agent-input-bg-rgb),0))}.agent-recorder button{background-color:rgba(var(--agent-button-bg-rgb),.3);color:rgba(var(--agent-button-bg-rgb))}@keyframes fadeInFromTop{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeOutFromTop{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes fadeInFromBottom{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeOutFromBottom{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}[data-scope=menu][data-part=content]{-webkit-backdrop-filter:blur(var(--agent-input-blur));backdrop-filter:blur(var(--agent-input-blur));border-color:rgba(var(--agent-input-border-rgb),var(--agent-input-border-opacity));border-width:var(--agent-input-border-width);box-shadow:var(--agent-input-box-shadow);color:var(--agent-input-color)}[data-scope=menu][data-part=content],[data-scope=menu][data-part=item]{background-color:rgba(var(--agent-input-bg-rgb),var(--agent-input-opacity));border-radius:var(--agent-input-border-radius)}[data-scope=menu][data-part=item]{cursor:pointer}[data-scope=menu][data-part=content][data-state=open]{animation:fadeInFromTop .15s ease-out forwards}[data-scope=menu][data-part=content][data-state=closed]{animation:fadeOutFromTop 50ms ease-out forwards}[data-scope=toast][data-part=group]{width:100%}[data-scope=toast][data-part=root]{background-color:rgba(var(--agent-input-bg-rgb),var(--agent-input-opacity));border-radius:var(--agent-chat-container-border-radius);box-shadow:var(--agent-input-box-shadow);color:var(--agent-input-color);display:flex;flex-direction:column;gap:4px;max-width:60vw;padding:16px 32px 16px 16px}[data-scope=toast][data-part=title]{font-weight:600}[data-scope=toast][data-part=description]{font-size:14px;line-height:20px}[data-scope=toast][data-part=root][data-state=open]{animation:fadeInFromBottom .15s ease-out forwards}[data-scope=toast][data-part=root][data-state=closed]{animation:fadeOutFromBottom 50ms ease-out forwards}[data-scope=progress][data-part=root]{height:100%;width:100%}[data-scope=progress][data-part=circle]{--size:40px;--thickness:4px;--radius:18px;--circomference:113.09724px}[data-scope=progress][data-part=circle-range]{stroke:#fff;--transition-prop:stroke-dasharray,stroke,stroke-dashoffset;transition-property:stroke-dasharray,stroke,stroke-dashoffset;--transition-duration:0.2s;transition-duration:.2s}[data-scope=progress][data-part=circle-track]{stroke:rgba(0,0,0,.5)}.agent-input-suggest{background-color:rgba(var(--agent-input-bg-rgb),var(--agent-input-opacity));border-color:rgba(var(--agent-chat-container-border-rgb),.1);border-width:1;color:var(--agent-input-color)}.agent-input-suggest:hover{filter:brightness(90%)}.last\\:border-b-0:last-child{border-bottom-width:0}.hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),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))}.hover\\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.hover\\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:brightness-90:hover{--tw-brightness:brightness(.9)}.hover\\:brightness-90:hover,.hover\\:brightness-95:hover{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-95:hover{--tw-brightness:brightness(.95)}.hover\\:backdrop-brightness-95:hover{--tw-backdrop-brightness:brightness(.95);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.active\\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),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))}.active\\:brightness-75:active{--tw-brightness:brightness(.75)}.active\\:brightness-75:active,.active\\:brightness-90:active{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.active\\:brightness-90:active{--tw-brightness:brightness(.9)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:brightness-100:disabled{--tw-brightness:brightness(1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[state\\=open\\]\\:backdrop-brightness-90[data-state=open]{--tw-backdrop-brightness:brightness(.9);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}@media (min-width:640px){.sm\\:left-0{left:0}.sm\\:right-0{right:0}.sm\\:my-8{margin-bottom:32px;margin-top:32px}.sm\\:p-0{padding:0}.sm\\:opacity-0{opacity:0}}@media (prefers-color-scheme:dark){.dark\\:bg-blue-900\\/20{background-color:rgba(30,58,138,.2)}.dark\\:hover\\:bg-gray-800:hover{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}}';var eD=w('<svg part=button-icon viewBox="0 0 24 24"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z">'),tD=w('<img part=button-icon alt="Bubble button icon">'),p0=w("<span part=button-icon>"),rD=w('<svg part=button-icon viewBox="0 0 24 24"><path fill-rule=evenodd clip-rule=evenodd d="M18.601 8.39897C18.269 8.06702 17.7309 8.06702 17.3989 8.39897L12 13.7979L6.60099 8.39897C6.26904 8.06702 5.73086 8.06702 5.39891 8.39897C5.06696 8.73091 5.06696 9.2691 5.39891 9.60105L11.3989 15.601C11.7309 15.933 12.269 15.933 12.601 15.601L18.601 9.60105C18.9329 9.2691 18.9329 8.73091 18.601 8.39897Z">'),nD=w('<img part=button-icon alt="Bubble button close icon">'),oD=w('<button part=button aria-label="Open agent">'),jd="#0042DA",m0="#27272A",g0="#fff",oc=e=>e.startsWith("http")||e.startsWith("data:image/svg+xml"),h0=e=>(()=>{var t=oD();return t.$$click=()=>e.toggleAgent(),t.style.setProperty("z-index","99999999"),v(t,m(W,{get when(){return ut(e.customIconSrc)},keyed:true,get children(){var r=eD();return $(n=>{var o=e.iconColor??(Gr(e.backgroundColor??jd)?m0:g0),i=Qt("stroke-2 fill-transparent absolute duration-200 transition w-[60%]",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100");return o!==n.e&&((n.e=o)!=null?r.style.setProperty("stroke",o):r.style.removeProperty("stroke")),i!==n.t&&G(r,"class",n.t=i),n},{e:void 0,t:void 0}),r}}),null),v(t,m(W,{get when(){return B(()=>!!e.customIconSrc)()&&oc(e.customIconSrc)},get children(){var r=tD();return $(n=>{var o=e.customIconSrc,i=Qt("duration-200 transition",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100",pr(e.customIconSrc)?"w-[60%]":"w-full h-full",pr(e.customIconSrc)?"":"object-cover rounded-full");return o!==n.e&&G(r,"src",n.e=o),i!==n.t&&j(r,n.t=i),n},{e:void 0,t:void 0}),r}}),null),v(t,m(W,{get when(){return B(()=>!!e.customIconSrc)()&&!oc(e.customIconSrc)},get children(){var r=p0();return r.style.setProperty("font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"),v(r,()=>e.customIconSrc),$(()=>j(r,Qt("text-4xl duration-200 transition",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100"))),r}}),null),v(t,m(W,{get when(){return ut(e.customCloseIconSrc)},get children(){var r=rD();return $(n=>{var o=e.iconColor??(Gr(e.backgroundColor??jd)?m0:g0),i=Qt("absolute duration-200 transition w-[60%]",e.isAgentOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0");return o!==n.e&&((n.e=o)!=null?r.style.setProperty("fill",o):r.style.removeProperty("fill")),i!==n.t&&G(r,"class",n.t=i),n},{e:void 0,t:void 0}),r}}),null),v(t,m(W,{get when(){return B(()=>!!e.customCloseIconSrc)()&&oc(e.customCloseIconSrc)},get children(){var r=nD();return $(n=>{var o=e.customCloseIconSrc,i=Qt("absolute duration-200 transition",e.isAgentOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0",pr(e.customCloseIconSrc)?"w-[60%]":"w-full h-full",pr(e.customCloseIconSrc)?"":"object-cover rounded-full");return o!==n.e&&G(r,"src",n.e=o),i!==n.t&&j(r,n.t=i),n},{e:void 0,t:void 0}),r}}),null),v(t,m(W,{get when(){return B(()=>!!e.customCloseIconSrc)()&&!oc(e.customCloseIconSrc)},get children(){var r=p0();return r.style.setProperty("font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"),v(r,()=>e.customCloseIconSrc),$(()=>j(r,Qt("absolute text-4xl duration-200 transition",e.isAgentOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0"))),r}}),null),$(r=>{var n=Sr("relative shadow-md rounded-2xl hover:scale-110 active:scale-95 transition-transform duration-200 flex justify-center items-center animate-fade-in"),o=e.backgroundColor??jd,i=e.buttonSize,a=e.buttonSize;return n!==r.e&&j(t,r.e=n),o!==r.t&&((r.t=o)!=null?t.style.setProperty("background-color",o):t.style.removeProperty("background-color")),i!==r.a&&((r.a=i)!=null?t.style.setProperty("width",i):t.style.removeProperty("width")),a!==r.o&&((r.o=a)!=null?t.style.setProperty("height",a):t.style.removeProperty("height")),r},{e:void 0,t:void 0,a:void 0,o:void 0}),t})();Ge(["click"]);var iD=w("<div part=preview-message><p>"),aD=w('<img class="rounded-full w-8 h-8 object-cover"alt="Agent avatar"elementtiming="Agent avatar"fetchpriority=high>'),sD=w('<button part=preview-message-close-button aria-label=Close><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),b0="#F7F8FF",y0="#303235",v0=e=>{let[t,r]=M(false),[n,o]=M({x:0,y:0}),i=s=>{o({x:s.touches[0]?.clientX??0,y:s.touches[0]?.clientY??0});},a=s=>{let l=s.changedTouches[0]?.clientX??0,c=s.changedTouches[0]?.clientY??0;(Math.abs(l-n().x)>10||c-n().y>10)&&e.onCloseClick(),o({x:0,y:0});};return (()=>{var s=iD(),l=s.firstChild;return s.$$touchend=a,s.$$touchstart=i,s.addEventListener("mouseleave",()=>r(false)),s.addEventListener("mouseenter",()=>r(true)),s.$$click=()=>e.onClick(),s.style.setProperty("z-index","99999999"),v(s,m(lD,{get isHovered(){return t()},get previewMessageTheme(){return e.previewMessageTheme},get onClick(){return e.onCloseClick}}),l),v(s,m(W,{get when(){return e.avatarUrl},keyed:true,children:c=>(()=>{var u=aD();return G(u,"src",c),u})()}),l),v(l,()=>e.message),$(c=>{var u=Sr("absolute bottom-[calc(100%+12px)] w-64 rounded-md duration-200 flex items-center gap-4 shadow-md animate-fade-in cursor-pointer hover:shadow-lg p-4",e.placement==="left"?"left-0":"right-0"),d=e.previewMessageTheme?.backgroundColor??b0,f=e.previewMessageTheme?.textColor??y0,p=`calc(${e.buttonSize} + 32px)`;return u!==c.e&&j(s,c.e=u),d!==c.t&&((c.t=d)!=null?s.style.setProperty("background-color",d):s.style.removeProperty("background-color")),f!==c.a&&((c.a=f)!=null?s.style.setProperty("color",f):s.style.removeProperty("color")),p!==c.o&&((c.o=p)!=null?s.style.setProperty("bottom",p):s.style.removeProperty("bottom")),c},{e:void 0,t:void 0,a:void 0,o:void 0}),s})()},lD=e=>(()=>{var t=sD();return t.$$click=r=>(r.stopPropagation(),e.onClick()),$(r=>{var n="absolute -top-2 -right-2 rounded-full w-6 h-6 p-1 hover:brightness-95 active:brightness-90 transition-all border "+(e.isHovered?"opacity-100":"opacity-0"),o=e.previewMessageTheme?.closeButtonBackgroundColor??b0,i=e.previewMessageTheme?.closeButtonIconColor??y0;return n!==r.e&&j(t,r.e=n),o!==r.t&&((r.t=o)!=null?t.style.setProperty("background-color",o):t.style.removeProperty("background-color")),i!==r.a&&((r.a=i)!=null?t.style.setProperty("color",i):t.style.removeProperty("color")),r},{e:void 0,t:void 0,a:void 0}),t})();Ge(["click","touchstart","touchend"]);var cD=w("<style>"),uD=w("<div><div></div><div part=agent><div>"),dD="20px",fD="12px",w0=e=>{let[t,r]=rt(e,["onOpen","onClose","previewMessage","onPreviewMessageClick","onPreviewMessageDismissed","theme","autoShowDelay","inlineStyle"]),[n,o]=M(true),[i,a]=M(r.prefilledVariables),[s,l]=M(false),[c,u]=M({message:t.previewMessage?.message??"",avatarUrl:t.previewMessage?.avatarUrl}),[d,f]=M(false),[p,g]=M(false),[h,b]=M(true),[y,S]=M(x0(t.theme?.button?.size??"medium"));Se(()=>{S(x0(t.theme?.button?.size??"medium"));});let C;ce(()=>{window.addEventListener("message",k);let T=t.autoShowDelay,O=t.previewMessage?.autoShowDelay;(Os()||ko())&&D(),T&&setTimeout(()=>{D();},T),O&&setTimeout(()=>{I();},O);}),me(()=>{window.removeEventListener("message",k);}),Se(()=>{e.prefilledVariables&&a(T=>({...T,...e.prefilledVariables}));});let k=T=>{let{data:O}=T;!O.isFromAgent||O.id&&r.id!==O.id||(O.command==="open"&&D(),O.command==="close"&&U(),O.command==="toggle"&&N(),O.command==="showPreviewMessage"&&I(O.message),O.command==="hidePreviewMessage"&&A(),O.command==="setPrefilledVariables"&&a(L=>({...L,...O.variables})),O.command==="unmount"&&R());},D=()=>{p()||g(true),setTimeout(()=>{b(false);},1200),A(),f(true),d()&&t.onOpen?.();},U=()=>{f(false),As(),d()&&t.onClose?.();},N=()=>{d()?U():D();},ie=()=>{t.onPreviewMessageClick?.(),D();},I=T=>{d()||(T&&u(T),l(true));},A=()=>{t.onPreviewMessageDismissed?.(),l(false);},R=()=>{d()?(U(),setTimeout(()=>{o(false);},200)):o(false);},E=T=>{r.onChatStatePersisted?.(T),T&&Is();},_=T=>{(T===nc||T===ti)&&R(),e.onScriptExecutionSuccess?.(T);};return m(W,{get when(){return n()},get children(){return m(Bn,{get value(){return document.querySelector("agent-bubble")?.shadowRoot},get children(){return [(()=>{var T=cD();return v(T,fo),T})(),(()=>{var T=uD(),O=T.firstChild,L=O.nextSibling,z=L.firstChild;v(T,m(W,{get when(){return s()},get children(){return m(v0,Re(c,{get placement(){return t.theme?.placement},get previewMessageTheme(){return t.theme?.previewMessage},get buttonSize(){return y()},onClick:ie,onCloseClick:A}))}}),O),v(T,m(h0,Re(()=>t.theme?.button,{get placement(){return t.theme?.placement},toggleAgent:N,get isAgentOpened(){return d()},get buttonSize(){return y()}})),O);var ne=C;return typeof ne=="function"?be(ne,O):C=O,L.style.setProperty("transition","transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out"),L.style.setProperty("box-shadow","rgb(0 0 0 / 16%) 0px 5px 40px"),v(L,m(W,{get when(){return p()},get children(){return m(hi,Re(r,{onScriptExecutionSuccess:_,onChatStatePersisted:E,get prefilledVariables(){return i()},class:"rounded-lg",progressBarRef:C}))}}),z),v(z,m(ni,{})),$(K=>{var Ie=Sr(t.theme?.position!=="static"?t.theme?.placement==="left"?"z-[424242] fixed bottom-5 left-5":"z-[424242] fixed bottom-5 right-5":"relative"),Ce=t.inlineStyle,nt=`calc(100vh - ${dD} - ${y()} - ${fD})`,Lt=t.theme?.chatWindow?.maxHeight??"704px",ft=t.theme?.chatWindow?.maxWidth??"400px",Nt=t.theme?.placement==="left"?"bottom left":"bottom right",Kt=d()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",Bt=t.theme?.chatWindow?.backgroundColor,Ye=Sr("absolute rounded-lg w-screen bottom-[calc(100%+12px)]",d()?"opacity-1":"opacity-0 pointer-events-none",t.theme?.placement==="left"?"sm:left-0 -left-5":"sm:right-0 -right-5"),$e=Sr("absolute transition-opacity pointer-events-none top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 opacity-50",h()?"opacity-100":"opacity-0");return Ie!==K.e&&j(T,K.e=Ie),K.t=Rc(T,Ce,K.t),nt!==K.a&&((K.a=nt)!=null?L.style.setProperty("max-height",nt):L.style.removeProperty("max-height")),Lt!==K.o&&((K.o=Lt)!=null?L.style.setProperty("height",Lt):L.style.removeProperty("height")),ft!==K.i&&((K.i=ft)!=null?L.style.setProperty("max-width",ft):L.style.removeProperty("max-width")),Nt!==K.n&&((K.n=Nt)!=null?L.style.setProperty("transform-origin",Nt):L.style.removeProperty("transform-origin")),Kt!==K.s&&((K.s=Kt)!=null?L.style.setProperty("transform",Kt):L.style.removeProperty("transform")),Bt!==K.h&&((K.h=Bt)!=null?L.style.setProperty("background-color",Bt):L.style.removeProperty("background-color")),Ye!==K.r&&j(L,K.r=Ye),$e!==K.d&&j(z,K.d=$e),K},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),T})()]}})}})},x0=e=>e==="medium"?"48px":e==="large"?"64px":e||"48px";var pD=w("<style>"),mD=w('<div class=relative aria-labelledby=modal-title role=dialog aria-modal=true><style></style><div class="fixed inset-0 bg-black bg-opacity-50 transition-opacity animate-fade-in"part=overlay></div><div class="fixed inset-0 z-10 overflow-y-auto"><div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0"><div>'),T0=e=>{let[t,r]=rt(e,["onOpen","onClose","autoShowDelay","theme","isOpen","defaultOpen"]),[n,o]=M(r.prefilledVariables),[i,a]=M(t.isOpen??false);ce(()=>{(t.defaultOpen||ko()||Os())&&c(),window.addEventListener("message",l);let g=t.autoShowDelay;pe(g)&&setTimeout(()=>{c();},g);}),me(()=>{window.removeEventListener("message",l);}),Se(()=>{ut(e.isOpen)||e.isOpen===i()||d();}),Se(()=>{e.prefilledVariables&&o(g=>({...g,...e.prefilledVariables}));});let s=g=>{g.stopPropagation();},l=g=>{let{data:h}=g;!h.isFromAgent||h.id&&r.id!==h.id||(h.command==="open"&&c(),h.command==="close"&&u(),h.command==="toggle"&&d(),h.command==="setPrefilledVariables"&&o(b=>({...b,...h.variables})));},c=()=>{a(true),t.onOpen?.(),document.body.style.setProperty("overflow","hidden","important"),document.addEventListener("pointerdown",u);},u=()=>{a(false),t.onClose?.(),document.body.style.overflow="auto",document.removeEventListener("pointerdown",u),As();},d=()=>{i()?u():c();},f=g=>{r.onChatStatePersisted?.(g),g&&Is();},p=g=>{(g===nc||g===ti)&&u(),e.onScriptExecutionSuccess?.(g);};return m(W,{get when(){return i()},get children(){return m(Bn,{get value(){return document.querySelector("agent-popup")?.shadowRoot},get children(){return [(()=>{var g=pD();return v(g,fo),g})(),(()=>{var g=mD(),h=g.firstChild,b=h.nextSibling,y=b.nextSibling,S=y.firstChild,C=S.firstChild;return v(h,fo),ot(C,"pointerdown",s),v(C,m(hi,Re(r,{onScriptExecutionSuccess:p,get prefilledVariables(){return n()},onChatStatePersisted:f}))),$(k=>{var D=e.theme?.zIndex??99999999,U="relative h-[80vh] transform overflow-hidden rounded-lg text-left transition-all sm:my-8 w-full max-w-lg"+(e.theme?.backgroundColor?" shadow-xl":""),N=e.theme?.backgroundColor??"transparent",ie=e.theme?.width??"512px";return D!==k.e&&((k.e=D)!=null?g.style.setProperty("z-index",D):g.style.removeProperty("z-index")),U!==k.t&&j(C,k.t=U),N!==k.a&&((k.a=N)!=null?C.style.setProperty("background-color",N):C.style.removeProperty("background-color")),ie!==k.o&&((k.o=ie)!=null?C.style.setProperty("max-width",ie):C.style.removeProperty("max-width")),k},{e:void 0,t:void 0,a:void 0,o:void 0}),g})()]}})}})};var gD=w(`<style>
125
+ `).map(i=>sd.sanitize($e.parse(i.replace(/【.+】/g,"").replace(/</g,"&lt;").replace(/>/g,"&gt;"),{breaks:true}),{ADD_ATTR:["target"]})):[sd.sanitize($e.parse("```"+n+"```".replace(/</g,"&lt;").replace(/>/g,"&gt;"),{breaks:true}),{ADD_ATTR:["target"]})]).filter(Re)??[]);}),(()=>{var n=jR(),o=n.firstChild,i=o.firstChild,a=i.firstChild,s=a.nextSibling;return a.style.setProperty("width","100%"),a.style.setProperty("height","100%"),x(s,m(ke,{get each(){return t()},children:l=>(()=>{var u=zR();return u.innerHTML=l,u})()})),n})()};var GR=w("<div><div>"),Sa=e=>{let t,[r,n]=R(0),o=new ResizeObserver(i=>n(i[0].target.clientHeight-(K()?24:40)));return ie(()=>{t&&o.observe(t);}),ae(()=>{t&&o.unobserve(t);}),(()=>{var i=GR(),a=i.firstChild,s=t;return typeof s=="function"?me(s,i):t=i,x(a,m(Sl,{get theme(){return e.theme},get src(){return e.avatarSrc}})),M(l=>{var u="flex flex-shrink-0 items-center relative agent-avatar-container "+(K()?"w-6":"w-10"),c="absolute flex items-center top-0"+(K()?" w-6 h-6":" w-10 h-10")+(e.hideAvatar?" opacity-0":" opacity-100"),d=`${r()}px`,p=e.isTransitionDisabled?void 0:"top 350ms ease-out, opacity 250ms ease-out";return u!==l.e&&U(i,l.e=u),c!==l.t&&U(a,l.t=c),d!==l.a&&((l.a=d)!=null?a.style.setProperty("top",d):a.style.removeProperty("top")),p!==l.o&&((l.o=p)!=null?a.style.setProperty("transition",p):a.style.removeProperty("transition")),l},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()};var Rw=w('<div><div class="flex flex-col flex-1 gap-2">'),qR=w('<div class="flex flex-col w-full min-w-0 gap-2 agent-chat-chunk">'),Dw=e=>{let t,[r,n]=R(e.isTransitionDisabled?e.messages.length:0),[o,i]=R();ie(()=>{e.streamingMessageId||(e.messages.length===0&&e.onAllBubblesDisplayed(),e.onScrollToBottom(t,50));});let a=async s=>{(e.settings.typingEmulation?.delayBetweenBubbles??ft.typingEmulation.delayBetweenBubbles)>0&&r()<e.messages.length-1&&await new Promise(u=>setTimeout(u,(e.settings.typingEmulation?.delayBetweenBubbles??ft.typingEmulation.delayBetweenBubbles)*1e3));let l=e.messages[r()].id;await e.onNewBubbleDisplayed(l),n(r()===e.messages.length?r():r()+1),e.onScrollToBottom(s),r()===e.messages.length&&(i(s),e.onAllBubblesDisplayed());};return (()=>{var s=qR();return x(s,m(W,{get when(){return e.messages.length>0},get children(){var l=Rw(),u=l.firstChild;return x(l,m(W,{get when(){return (e.theme.chat?.hostAvatar?.isEnabled??So)&&e.messages.length>0},get children(){return m(Sa,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar},get isTransitionDisabled(){return e.isTransitionDisabled}})}}),u),x(u,m(ke,{get each(){return e.messages.slice(0,r()+1)},children:(c,d)=>m(cw,{message:c,get typingEmulation(){return e.settings.typingEmulation},get isTypingSkipped(){return L(()=>!!((e.settings.typingEmulation?.isDisabledOnFirstMessage??ft.typingEmulation.isDisabledOnFirstMessage)&&e.index===0))()&&d()===0},get onTransitionEnd(){return e.isTransitionDisabled?void 0:a},get onCompleted(){return e.onSubmit}})})),M(c=>{var d="flex"+(K()?" gap-1":" gap-2"),p=e.theme.chat?.guestAvatar?.isEnabled??Si?K()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%";return d!==c.e&&U(l,c.e=d),p!==c.t&&((c.t=p)!=null?u.style.setProperty("max-width",p):u.style.removeProperty("max-width")),c},{e:void 0,t:void 0}),l}}),null),x(s,(()=>{var l=L(()=>!!(e.input&&r()===e.messages.length));return ()=>l()&&m(Xv,{get theme(){return e.theme},ref(u){var c=t;typeof c=="function"?c(u):t=u;},get block(){return e.input},get chunkIndex(){return e.index},get hasHostAvatar(){return e.theme.chat?.hostAvatar?.isEnabled??So},get guestAvatar(){return e.theme.chat?.guestAvatar},get context(){return e.context},get isInputPrefillEnabled(){return e.settings.general?.isInputPrefillEnabled??ft.general.isInputPrefillEnabled},get isOngoingLastChunk(){return e.isOngoingLastChunk},get hasError(){return e.hasError},onTransitionEnd:()=>e.onScrollToBottom(o()),get onSubmit(){return e.onSubmit},get onSkip(){return e.onSkip}})})(),null),x(s,m(W,{get when(){return e.streamingMessageId},keyed:true,children:l=>(()=>{var u=Rw(),c=u.firstChild;return x(u,m(W,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??So},get children(){return m(Sa,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar}})}}),c),x(c,m(Ow,{streamingMessageId:l,get context(){return e.context}})),M(d=>{var p="flex"+(K()?" gap-1":" gap-2"),f=e.theme.chat?.guestAvatar?.isEnabled??Si?K()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%";return p!==d.e&&U(u,d.e=p),f!==d.t&&((d.t=f)!=null?c.style.setProperty("max-width",f):c.style.removeProperty("max-width")),d},{e:void 0,t:void 0}),u})()}),null),s})()};var YR=w('<div class="flex flex-col animate-fade-in"><div class="flex w-full items-center"><div class="flex relative items-start agent-host-bubble"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble></div><p class="overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative opacity-0 h-6 text-ellipsis">'),Mw=()=>(()=>{var e=YR(),t=e.firstChild,r=t.firstChild,n=r.firstChild;return n.style.setProperty("width","64px"),n.style.setProperty("height","32px"),x(n,m(Nt,{})),e})();var KR=w('<div class="flex w-full agent-loading-chunk"><div class="flex flex-col w-full min-w-0"><div class="flex gap-2">'),$w=e=>(()=>{var t=KR(),r=t.firstChild,n=r.firstChild;return x(n,m(W,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??So},get children(){return m(Sa,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url}})}}),null),x(n,m(Mw,{}),null),t})();var XR=w('<div class="w-full max-w-xs p-4 text-gray-500 bg-white shadow flex flex-col gap-2 agent-popup-blocked-toast"role=alert><div class="flex flex-col gap-1"><span class=" text-sm font-semibold text-gray-900">Popup blocked</span><div class="text-sm font-normal">The agent wants to open a new tab but it was blocked by your browser. It needs a manual approval.</div></div><a target=_blank class="py-1 px-4 justify-center text-sm font-semibold text-white focus:outline-none flex items-center disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 filter hover:brightness-90 active:brightness-75 agent-button"rel=noreferrer>Continue in new tab'),Nw=e=>(()=>{var t=XR(),r=t.firstChild,n=r.nextSibling;return n.$$click=()=>e.onLinkClick(),M(()=>G(n,"href",e.url)),t})();Ne(["click"]);var ZR=w('<div class="flex flex-col overflow-y-auto w-full relative scrollable-container agent-chat-view scroll-smooth gap-2">'),QR=w('<div class="flex justify-end">'),JR=w('<div class="w-full flex-shrink-0 agent-bottom-spacer h-[20%]">'),e2=.6,t2=50,r2=(e,t)=>({...e,chat:{...e.chat,hostAvatar:e.chat?.hostAvatar&&t?.hostAvatarUrl?{...e.chat.hostAvatar,url:t.hostAvatarUrl}:e.chat?.hostAvatar,guestAvatar:e.chat?.guestAvatar&&t?.guestAvatarUrl?{...e.chat.guestAvatar,url:t?.guestAvatarUrl}:e.chat?.guestAvatar}}),Lw=e=>{let t,[r,n]=Cr(R([{input:e.initialChatReply.input,messages:e.initialChatReply.messages}]),{key:`agent-${e.context.agent.id}-chatChunks`,storage:e.context.storage,onRecovered:()=>{setTimeout(()=>{t?.scrollTo(0,t.scrollHeight);},200);}}),[o,i]=Cr(R(e.initialChatReply.clientSideActions??[]),{key:`agent-${e.context.agent.id}-clientSideActions`,storage:e.context.storage}),[a,s]=Cr(R(false),{key:`agent-${e.context.agent.id}-isEnded`,storage:e.context.storage}),[l,u]=R(e.initialChatReply.dynamicTheme),[c,d]=R(e.initialChatReply.agent.theme),[p,f]=R(false),[b,g]=R(),[y,T]=R(false);ie(()=>{(async()=>{if(r().length>1)S();else {let k=o()?.filter(O=>at(O.lastBubbleBlockId));await _(k);}})();});let S=()=>{[...r()].pop()?.streamingMessageId&&n(k=>k.slice(0,-1));let I=dd({clientSideActions:o(),lastBubbleBlockId:void 0});i(k=>k.slice(I.length));},E=({id:I,message:k})=>{f(false);let O=[...r()].pop();O&&(O.streamingMessageId!==I&&n(D=>[...D,{messages:[],streamingMessageId:I}]),uu({id:I,content:k}));};Ce(()=>{d(r2(e.initialChatReply.agent.theme,l()));});let h=async I=>{I&&(e.onNewLogs?.(I),!e.context.isPreview&&await tu({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:I}));},C=async I=>{T(false);let k=[...r()].pop()?.input;k?.id&&e.onAnswer&&I&&e.onAnswer({message:hy(I),blockId:k.id});let O=setTimeout(()=>{f(true);},1e3);$();let{data:D,error:F}=await Gb({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,message:o2(I)});if(clearTimeout(O),f(false),F){T(true);let j=[{description:"Failed to send the reply",details:F instanceof Tr?{status:F.response.status,body:await F.response.json()}:F,status:"error"}];await tu({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:j}),e.onNewLogs?.(j);return}if(D){if(D.progress&&e.onProgressUpdate?.(D.progress),D.lastMessageNewFormat&&lu([...Us(),{inputIndex:[...r()].length-1,formattedMessage:D.lastMessageNewFormat}]),D.logs&&e.onNewLogs?.(D.logs),D.dynamicTheme&&u(D.dynamicTheme),D.input&&e.onNewInputBlock&&e.onNewInputBlock(D.input),D.clientSideActions){i(D.clientSideActions);let j=dd({clientSideActions:D.clientSideActions,lastBubbleBlockId:void 0});if(await _(j),D.clientSideActions.length===1&&D.clientSideActions[0].type==="stream"&&D.messages.length===0&&D.input===void 0)return}n(j=>[...j,{input:D.input,messages:D.messages}]);}},$=(I,k=0)=>{!t||t.scrollTop+t.clientHeight<t.scrollHeight-t.clientHeight*e2||setTimeout(()=>{t?.scrollTo({top:I?I.offsetTop-k:t.scrollHeight,behavior:"smooth"});},t2);},H=async()=>{let I=[...r()].pop();I&&at(I.input)&&(s(true),e.onEnd?.());},N=async I=>{let k=dd({clientSideActions:o(),lastBubbleBlockId:I});await _(k);},_=async I=>{for(let O of I){("streamOpenAiChatCompletion"in O||"webhookToExecute"in O||"stream"in O)&&f(true);let D=await gy({clientSideAction:O,context:{apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,resultId:e.initialChatReply.resultId},onMessageStream:E,onStreamError:async F=>{await h([F]),e.onNewLogs?.([F]);}});if(i(F=>F.slice(1)),D&&"logs"in D&&h(D.logs),D&&"replyToSend"in D){f(false),C(D.replyToSend?{type:"text",value:D.replyToSend}:void 0);return}D&&"blockedPopupUrl"in D&&g(D.blockedPopupUrl),D&&"scriptCallbackMessage"in D&&e.onScriptExecutionSuccess?.(D.scriptCallbackMessage);}};ae(()=>{uu(void 0),lu([]);});let A=()=>C(void 0);return (()=>{var I=ZR(),k=t;return typeof k=="function"?me(k,I):t=I,x(I,m(ke,{get each(){return r()},children:(O,D)=>m(Dw,{get index(){return D()},get messages(){return O.messages},get input(){return O.input},get theme(){return c()},get settings(){return e.initialChatReply.agent.settings},get streamingMessageId(){return O.streamingMessageId},get context(){return e.context},get hideAvatar(){return L(()=>!O.input)()&&((r()[D()+1]?.messages??[]).length>0||r()[D()+1]?.streamingMessageId!==void 0||O.messages.length>0&&p())},get hasError(){return L(()=>!!y())()&&D()===r().length-1},get isTransitionDisabled(){return D()!==r().length-1},get isOngoingLastChunk(){return L(()=>!a())()&&D()===r().length-1},onNewBubbleDisplayed:N,onAllBubblesDisplayed:H,onSubmit:C,onScrollToBottom:$,onSkip:A})}),null),x(I,m(W,{get when(){return p()},get children(){return m($w,{get theme(){return c()}})}}),null),x(I,m(W,{get when(){return b()},keyed:true,children:O=>(()=>{var D=QR();return x(D,m(Nw,{url:O,onLinkClick:()=>g(void 0)})),D})()}),null),x(I,m(n2,{}),null),I})()},n2=()=>JR(),o2=e=>{if(e){if(e.type==="text")return {type:"text",text:e.value,attachedFileUrls:e.attachments?.map(t=>t.url)};if(e.type==="recording")return {type:"audio",url:e.url}}},dd=({clientSideActions:e,lastBubbleBlockId:t})=>{let r=[],n=t;for(let o of e){if(n!==o.lastBubbleBlockId)break;n=o.lastBubbleBlockId,t===o.lastBubbleBlockId&&r.push(o);}return r};var i2=w('<div class="h-full flex justify-center items-center flex-col"><p class="text-2xl text-center"></p><pre>'),Fw=e=>(()=>{var t=i2(),r=t.firstChild,n=r.nextSibling;return x(r,()=>e.error.message),x(n,()=>JSON.stringify(e.error.cause,null,2)),t})();var a2=w('<a target=_blank rel="noopener noreferrer"class=brand-mark id=brand-mark><span>'),Bw=e=>{let t,r,n=o=>{o.forEach(i=>{i.removedNodes.forEach(a=>{"id"in a&&t&&a.id==="brand-mark"&&e.agentContainer?.append(t);});});};return ie(()=>{!document||!e.agentContainer||(r=new MutationObserver(n),r.observe(e.agentContainer,{subtree:false,childList:true}));}),ae(()=>{r&&r.disconnect();}),(()=>{var o=a2(),i=o.firstChild,a=t;return typeof a=="function"?me(a,o):t=o,x(i,()=>e.text),M(()=>G(o,"href",e.url)),o})()};var s2=w("<div class=agent-progress-bar-container><div class=agent-progress-bar>"),fd=e=>(()=>{var t=s2(),r=t.firstChild;return M(n=>(n=`${e.value}%`)!=null?r.style.setProperty("width",n):r.style.removeProperty("width")),t})();var Uw=w("<style>"),l2=w("<div>"),ni=e=>{let[t,r]=R(),[n,o]=R(""),[i,a]=R(false),[s,l]=R(),u=async()=>{e.font&&dc(e.font),a(true);let c=new URLSearchParams(location.search);e.onInit?.();let d={};c.forEach((T,S)=>{d[S]=T;});let p=typeof e.agent=="string"?e.agent:void 0,f=typeof e.agent!="string"||(e.isPreview??false),b=nm(p),{data:g,error:y}=await Rp({stripeRedirectStatus:c.get("redirect_status")??void 0,agent:e.agent,apiHost:e.apiHost,isPreview:f,resultId:Re(e.resultId)?e.resultId:b,prefilledVariables:{...d,...e.prefilledVariables},startFrom:e.startFrom,sessionId:e.sessionId});if(y instanceof Tr)return f?l(new Error("\u{1F6A8} An error occurred while loading the agent.",{})):y.response.status===400||y.response.status===403?l(new Error("This agent is now closed.")):y.response.status===404?l(new Error("The agent you're looking for doesn't exist.")):l(new Error(`Something went wrong while starting the chat! (${y.response.statusText}) Please try again.`));if(y instanceof po)return l(new Error(y.message));if(!g)return y&&(console.error(y),f)?l(new Error("Error! Could not reach server. Check your connection.",{cause:y})):l(new Error("Error! Could not reach server. Check your connection."));if(g.resultId&&p&&(g.agent.settings.general?.rememberUser?.isEnabled??ft.general.rememberUser.isEnabled)){b&&b!==g.resultId&&ss(g.agent.id);let T=g.agent.settings.general?.rememberUser?.storage??ft.general.rememberUser.storage;om(T)(p,g.resultId);let S=im(g.agent.id);S&&S.agent.publishedAt&&g.agent.publishedAt?new Date(S.agent.publishedAt).getTime()===new Date(g.agent.publishedAt).getTime()?r(S):(ss(g.agent.id),r(g),gc(g,{agentId:g.agent.id,storage:T})):(r(g),gc(g,{agentId:g.agent.id,storage:T})),e.onChatStatePersisted?.(true);}else {if(ss(g.agent.id),r(g),g.input?.id&&e.onNewInputBlock&&e.onNewInputBlock(g.input),g.logs){let T=g.logs.map(S=>({status:S.status??"",description:S.description??"",details:S.details}));e.onNewLogs?.(T);}e.onChatStatePersisted?.(false);}o(g.agent.theme.customCss??"");};return Ce(()=>{at(e.agent)||i()||u().then();}),Ce(()=>{at(e.agent)||typeof e.agent=="string"||(o(e.agent.theme.customCss??""),e.agent.theme.general?.progressBar?.isEnabled&&t()&&!t()?.agent.theme.general?.progressBar?.isEnabled&&(a(false),u().then()));}),ae(()=>{a(false);}),[(()=>{var c=Uw();return x(c,n),c})(),(()=>{var c=Uw();return x(c,zb),c})(),m(W,{get when(){return s()},keyed:true,children:c=>m(Fw,{error:c})}),m(W,{get when(){return t()},keyed:true,children:c=>m(c2,{get class(){return e.class},get initialChatReply(){return {...c,agent:{...c.agent,settings:typeof e.agent=="string"?c.agent?.settings:e.agent?.settings,theme:typeof e.agent=="string"?c.agent?.theme:e.agent?.theme}}},get context(){return {apiHost:e.apiHost,isPreview:typeof e.agent!="string"||(e.isPreview??false),resultId:c.resultId,sessionId:c.sessionId,agent:c.agent,storage:c.agent.settings.general?.rememberUser?.isEnabled&&!(typeof e.agent!="string"||(e.isPreview??false))?c.agent.settings.general?.rememberUser?.storage??ft.general.rememberUser.storage:void 0}},get progressBarRef(){return e.progressBarRef},get onNewInputBlock(){return e.onNewInputBlock},get onNewLogs(){return e.onNewLogs},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onScriptExecutionSuccess(){return e.onScriptExecutionSuccess}})})]},c2=e=>{let[t,r]=Cr(R(e.initialChatReply.progress),{storage:e.context.storage,key:`agent-${e.context.agent.id}-progressValue`}),n,o=new ResizeObserver(a=>Qp((a[0]?.target.clientWidth??0)<432));ie(()=>{n&&($p(n),o.observe(n),Mp(`${n.clientHeight}px`));}),Ce(()=>{dc(e.initialChatReply.agent.theme.general?.font??{type:Np,family:To}),n&&rm(e.initialChatReply.agent.theme,n,e.context.isPreview);}),ae(()=>{n&&o.unobserve(n);});let i=e.initialChatReply.agent.settings.general?.isBrandingEnabled===void 0||e.initialChatReply.agent.settings.general?.isBrandingEnabled;return (()=>{var a=l2(),s=n;return typeof s=="function"?me(s,a):n=a,x(a,m(W,{get when(){return ue(t())&&e.initialChatReply.agent.theme.general?.progressBar?.isEnabled},get children(){return m(W,{get when(){return e.progressBarRef&&(e.initialChatReply.agent.theme.general?.progressBar?.position??rs)==="fixed"},get fallback(){return m(fd,{get value(){return t()}})},get children(){return m(lf,{get mount(){return e.progressBarRef},get children(){return m(fd,{get value(){return t()}})}})}})}}),null),x(a,m(Lw,{get context(){return e.context},get initialChatReply(){return e.initialChatReply},get onNewInputBlock(){return e.onNewInputBlock},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onNewLogs(){return e.onNewLogs},onProgressUpdate:r,get onScriptExecutionSuccess(){return e.onScriptExecutionSuccess}}),null),x(a,m(W,{when:i,get children(){return m(Bw,{agentContainer:n,get url(){return e.initialChatReply.agent.settings.general?.brandingUrl??"https://release0.com/?utm_source=brand-mark"},get text(){return e.initialChatReply.agent.settings.general?.brandingText??"Powered by Release0"}})}}),null),x(a,m(zc,{toaster:Rr,children:l=>m(Rn.Root,{get children(){return [m(Rn.Title,{class:"!font-semibold !text-sm",get children(){return l().title}}),m(Rn.Description,{class:"!font-normal",get children(){return l().description}}),m(Rn.CloseTrigger,{class:"absolute right-2 top-2",get children(){return m(Dr,{class:"w-4 h-4"})}})]}})}),null),M(()=>U(a,ye("relative flex w-full h-full text-base overflow-hidden flex-col justify-center items-center agent-container",e.class))),a})()};var Dl="Zendesk Web Widget Opened";var Qn='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--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-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--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-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--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-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--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-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-bottom-6{bottom:-24px}.-left-5{left:-20px}.-right-2{right:-8px}.-right-5{right:-20px}.-top-2{top:-8px}.bottom-5{bottom:20px}.bottom-\\[calc\\(100\\%\\+12px\\)\\]{bottom:calc(100% + 12px)}.left-0{left:0}.left-1\\/2{left:50%}.left-5{left:20px}.left-\\[-4px\\]{left:-4px}.right-0{right:0}.right-2{right:8px}.right-3{right:12px}.right-5{right:20px}.right-\\[-4px\\]{right:-4px}.top-0{top:0}.top-1\\/2{top:50%}.top-2{top:8px}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[424242\\]{z-index:424242}.m-2{margin:8px}.m-auto{margin:auto}.mx-4{margin-left:16px;margin-right:16px}.my-2{margin-bottom:8px;margin-top:8px}.-mr-1{margin-right:-4px}.-mt-1{margin-top:-4px}.ml-2{margin-left:8px}.mt-0\\.5{margin-top:2px}.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-4{margin-top:16px}.\\!block{display:block!important}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.size-10{height:40px;width:40px}.size-6{height:24px;width:24px}.h-0{height:0}.h-10{height:40px}.h-2{height:8px}.h-2\\.5{height:10px}.h-3{height:12px}.h-4{height:16px}.h-5{height:20px}.h-6{height:24px}.h-8{height:32px}.h-9{height:36px}.h-\\[20\\%\\]{height:20%}.h-\\[56px\\]{height:56px}.h-\\[58px\\]{height:58px}.h-\\[80vh\\]{height:80vh}.h-full{height:100%}.h-screen{height:100vh}.max-h-60{max-height:240px}.max-h-80{max-height:320px}.max-h-\\[464px\\]{max-height:464px}.max-h-\\[60px\\]{max-height:60px}.min-h-full{min-height:100%}.w-0{width:0}.w-10{width:40px}.w-2{width:8px}.w-3{width:12px}.w-4{width:16px}.w-5{width:20px}.w-6{width:24px}.w-64{width:256px}.w-8{width:32px}.w-\\[35px\\]{width:35px}.w-\\[58px\\]{width:58px}.w-\\[60\\%\\]{width:60%}.w-full{width:100%}.w-screen{width:100vw}.min-w-0{min-width:0}.min-w-\\[250px\\]{min-width:250px}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[256px\\]{max-width:256px}.max-w-\\[350px\\]{max-width:350px}.max-w-\\[90\\%\\]{max-width:90%}.max-w-full{max-width:100%}.max-w-lg{max-width:512px}.max-w-xs{max-width:320px}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.-translate-y-1\\/2{transform:translate(var(--tw-translate-x),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))}.-translate-y-1\\/2{--tw-translate-y:-50%}.-rotate-180{--tw-rotate:-180deg}.-rotate-180,.rotate-0{transform:translate(var(--tw-translate-x),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))}.rotate-0{--tw-rotate:0deg}.scale-0{--tw-scale-x:0;--tw-scale-y:0}.scale-0,.scale-100{transform:translate(var(--tw-translate-x),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))}.scale-100{--tw-scale-x:1;--tw-scale-y:1}.transform{transform:translate(var(--tw-translate-x),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))}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in .3s ease-out}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-6{gap:24px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.scroll-smooth{scroll-behavior:smooth}.text-ellipsis{text-overflow:ellipsis}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-2xl{border-radius:16px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:6px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-current{border-color:currentColor}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity,1))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity,1))}.bg-\\[rgba\\(0\\2c 0\\2c 0\\2c 0\\.5\\)\\]{background-color:rgba(0,0,0,.5)}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.bg-black\\/20{background-color:rgba(0,0,0,.2)}.bg-blue-400{--tw-bg-opacity:1;background-color:rgb(96 165 250/var(--tw-bg-opacity,1))}.bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.bg-green-400{--tw-bg-opacity:1;background-color:rgb(74 222 128/var(--tw-bg-opacity,1))}.bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.bg-pink-400{--tw-bg-opacity:1;background-color:rgb(244 114 182/var(--tw-bg-opacity,1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-opacity-50{--tw-bg-opacity:0.5}.fill-transparent{fill:transparent}.stroke-2{stroke-width:2}.object-cover{-o-object-fit:cover;object-fit:cover}.object-scale-down{-o-object-fit:scale-down;object-fit:scale-down}.p-0\\.5{padding:2px}.p-1{padding:4px}.p-2{padding:8px}.p-3{padding:12px}.p-4{padding:16px}.p-\\[1px\\]{padding:1px}.px-0{padding-left:0;padding-right:0}.px-2{padding-left:8px;padding-right:8px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-8{padding-left:32px;padding-right:32px}.px-\\[12px\\]{padding-left:12px;padding-right:12px}.px-\\[15px\\]{padding-left:15px;padding-right:15px}.py-1{padding-bottom:4px;padding-top:4px}.py-2{padding-bottom:8px;padding-top:8px}.py-3{padding-bottom:12px;padding-top:12px}.py-4{padding-bottom:16px;padding-top:16px}.py-6{padding-bottom:24px;padding-top:24px}.py-\\[4px\\]{padding-bottom:4px;padding-top:4px}.py-\\[7px\\]{padding-bottom:7px;padding-top:7px}.pb-0{padding-bottom:0}.pl-2{padding-left:8px}.pl-4{padding-left:16px}.pr-1{padding-right:4px}.pr-2{padding-right:8px}.pr-4{padding-right:16px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.\\!text-sm{font-size:14px!important;line-height:20px!important}.text-2xl{font-size:24px;line-height:32px}.text-4xl{font-size:36px;line-height:40px}.text-\\[40px\\]{font-size:40px}.text-base{font-size:16px;line-height:24px}.text-sm{font-size:14px;line-height:20px}.text-xl{font-size:20px;line-height:28px}.text-xs{font-size:12px;line-height:16px}.\\!font-normal{font-weight:400!important}.\\!font-semibold{font-weight:600!important}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-md,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.blur{--tw-blur:blur(8px)}.blur,.brightness-150{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-150{--tw-brightness:brightness(1.5)}.brightness-200{--tw-brightness:brightness(2)}.brightness-200,.brightness-95{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-95{--tw-brightness:brightness(.95)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.scrollable-container::-webkit-scrollbar{display:none}.scrollable-container{-ms-overflow-style:none;scrollbar-width:none}.text-fade-in{transition:opacity .4s ease-in .2s}.bubble-typing{transition:width .4s ease-out,height .4s ease-out}.bubble1,.bubble2,.bubble3{background-color:var(--agent-host-bubble-color);opacity:.5}.bubble1,.bubble2{animation:chatBubbles 1s ease-in-out infinite}.bubble2{animation-delay:.3s}.bubble3{animation:chatBubbles 1s ease-in-out infinite;animation-delay:.5s}@keyframes chatBubbles{0%{transform:translateY(2.5)}50%{transform:translateY(-2.5px)}to{transform:translateY(0)}}button,input,textarea{font-weight:300}a{text-decoration:underline}ol,ul{margin-inline-end:0;margin-inline-start:0;padding-inline-start:40px}ol{list-style-type:decimal}ul{list-style-type:disc}li:not(:last-child){margin-bottom:8px}pre{white-space:pre-wrap;word-wrap:break-word;max-height:100%;max-width:100%;overflow:auto;overflow-wrap:break-word}.slate-bold{font-weight:700}.slate-italic{font-style:oblique}.slate-underline{text-decoration:underline}.text-input::-moz-placeholder{color:var(--agent-input-placeholder-color)!important;opacity:1!important}.text-input::placeholder{color:var(--agent-input-placeholder-color)!important;opacity:1!important}.agent-container{background-color:var(--agent-container-bg-color);background-image:var(--agent-container-bg-image);background-position:50%;background-size:cover;container-type:inline-size;font-family:var(--agent-container-font-family),-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"}.agent-chat-view{backdrop-filter:blur(var(--agent-chat-container-blur));background-color:rgba(var(--agent-chat-container-bg-rgb),var(--agent-chat-container-opacity));border-color:rgba(var(--agent-chat-container-border-rgb),var(--agent-chat-container-border-opacity));border-width:var(--agent-chat-container-border-width);box-shadow:var(--agent-chat-container-box-shadow);color:rgb(var(--agent-chat-container-color));max-width:var(--agent-chat-container-max-width);min-height:100%;padding-left:12px;padding-right:12px;padding-top:20px}@container (min-width: 432px){.agent-chat-view{border-radius:var(--agent-chat-container-border-radius);max-height:var(--agent-chat-container-max-height);min-height:var(--agent-chat-container-max-height);padding-left:20px;padding-right:20px;padding-top:40px}}.agent-button{backdrop-filter:blur(var(--agent-button-blur));background-color:rgba(var(--agent-button-bg-rgb),var(--agent-button-opacity));border-color:rgba(var(--agent-button-border-rgb),var(--agent-button-border-opacity));border-radius:var(--agent-button-border-radius);border-width:var(--agent-button-border-width);box-shadow:var(--agent-button-box-shadow);color:var(--agent-button-color);transition:all .3s ease}.agent-selectable{background-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.08));border-color:rgba(var(--agent-button-border-rgb),calc(var(--selectable-alpha-ratio)*.25));border-radius:var(--agent-button-border-radius);border-width:var(--agent-button-border-width);color:rgb(var(--agent-chat-container-color));transition:all .3s ease}.agent-selectable:hover{background-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.12));border-color:rgba(var(--agent-button-border-rgb),calc(var(--selectable-alpha-ratio)*.3))}.agent-selectable.selected{background-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.18));border-color:rgba(var(--agent-button-border-rgb),calc(var(--selectable-alpha-ratio)*.35))}.agent-checkbox{background-color:rgba(var(--agent-checkbox-bg-rgb));border:1px solid rgba(var(--agent-button-bg-rgb),var(--agent-button-opacity));border-radius:var(--agent-button-border-radius);border-radius:2px;color:var(--agent-button-color);padding:1px;transition:all .3s ease}.agent-checkbox.checked{background-color:rgb(var(--agent-button-bg-rgb))}.agent-host-bubble{color:var(--agent-host-bubble-color)}form.agent-host-bubble{border-color:rgba(var(--agent-host-bubble-bg-rgb),1);border-radius:var(--agent-host-bubble-border-radius);border-style:dashed;border-width:2px}.agent-host-bubble>.bubble-typing{backdrop-filter:blur(var(--agent-host-bubble-blur));background-color:rgba(var(--agent-host-bubble-bg-rgb),var(--agent-host-bubble-opacity));border-color:rgba(var(--agent-host-bubble-border-rgb),var(--agent-host-bubble-border-opacity));border-radius:var(--agent-host-bubble-border-radius);border-width:var(--agent-host-bubble-border-width);box-shadow:var(--agent-host-bubble-box-shadow);overflow:hidden}.agent-host-bubble iframe,.agent-host-bubble img,.agent-host-bubble video{border-radius:6px}.agent-guest-bubble{backdrop-filter:blur(var(--agent-guest-bubble-blur));background-color:rgba(var(--agent-guest-bubble-bg-rgb),var(--agent-guest-bubble-opacity));border-color:rgba(var(--agent-guest-bubble-border-rgb),var(--agent-guest-bubble-border-opacity));border-width:var(--agent-guest-bubble-border-width);box-shadow:var(--agent-guest-bubble-box-shadow);color:var(--agent-guest-bubble-color)}.agent-guest-bubble,.agent-guest-bubble-image-attachment{border-radius:var(--agent-guest-bubble-border-radius)}.agent-input{backdrop-filter:blur(var(--agent-input-blur));background-color:rgba(var(--agent-input-bg-rgb),var(--agent-input-opacity));border-color:rgba(var(--agent-input-border-rgb),var(--agent-input-border-opacity));border-radius:var(--agent-input-border-radius);border-width:var(--agent-input-border-width);box-shadow:var(--agent-input-box-shadow);transition:filter .1s ease}.agent-input,.agent-input-error-message{color:var(--agent-input-color)}.agent-input-form .agent-button{box-shadow:var(--agent-input-box-shadow)}.agent-button>.send-icon{fill:var(--agent-button-color)}.ping span{background-color:rgb(var(--agent-button-bg-rgb))}.rating-icon-container svg{fill:rgba(var(--agent-host-bubble-bg-rgb),var(--agent-host-bubble-opacity));height:42px;stroke:rgb(var(--agent-button-bg-rgb));transition:fill .1s ease-out;width:42px}.rating-icon-container.selected svg{fill:rgb(var(--agent-button-bg-rgb))}.rating-icon-container:hover svg{filter:brightness(.9)}.rating-icon-container:active svg{filter:brightness(.75)}.upload-progress-bar{border-radius:var(--agent-input-border-radius)}.total-files-indicator,.upload-progress-bar{background-color:rgb(var(--agent-button-bg-rgb))}.total-files-indicator{color:var(--agent-button-color);font-size:10px}.agent-upload-input{border-radius:var(--agent-input-border-radius);transition:border-color .1s ease-out}.agent-upload-input.dragging-over{border-color:rgb(var(--agent-button-bg-rgb))}.secondary-button{background-color:rgba(var(--agent-host-bubble-bg-rgb),var(--agent-host-bubble-opacity));border-radius:var(--agent-button-border-radius);color:var(--agent-host-bubble-color)}.agent-country-select{border-radius:var(--agent-button-border-radius);color:var(--agent-input-color)}.agent-country-select,.agent-date-input{background-color:var(--agent-input-bg-color)}.agent-date-input{color:var(--agent-input-color);color-scheme:light}.agent-date-input,.agent-popup-blocked-toast{border-radius:var(--agent-input-border-radius)}.agent-picture-button{background-color:rgb(var(--agent-button-bg-rgb));border-radius:var(--agent-button-border-radius);color:var(--agent-button-color);overflow:hidden;transition:all .3s ease;width:236px}.agent-picture-button>img,.agent-selectable-picture>img{border-radius:var(--agent-button-border-radius) var(--agent-button-border-radius) 0 0;height:100%;max-height:200px;min-width:200px;-o-object-fit:cover;object-fit:cover;width:100%}.agent-picture-button.has-svg>img,.agent-selectable-picture.has-svg>img{max-height:128px;-o-object-fit:contain;object-fit:contain;padding:1rem}.agent-selectable-picture{background-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.08));border:1px solid rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.25));border-radius:var(--agent-button-border-radius);color:rgb(var(--agent-chat-container-color));transition:all .3s ease;width:236px}.agent-selectable-picture:hover{background-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.12));border-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.3))}.agent-selectable-picture.selected{background-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.18));border-color:rgba(var(--agent-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.35))}select option{background-color:var(--agent-input-bg-color);color:var(--agent-input-color)}.agent-progress-bar-container{background-color:rgba(var(--agent-progress-bar-bg-rgb),calc(var(--selectable-alpha-ratio)*.12));bottom:var(--agent-progress-bar-bottom);height:var(--agent-progress-bar-height);left:0;position:var(--agent-progress-bar-position);top:var(--agent-progress-bar-top);width:100%;z-index:99999999}.agent-progress-bar-container>.agent-progress-bar{background-color:var(--agent-progress-bar-color);height:100%;position:absolute;transition:width .25s ease}.agent-recorder .left-gradient{background-image:linear-gradient(to right,rgba(var(--agent-input-bg-rgb),1),rgba(var(--agent-input-bg-rgb),0))}.agent-recorder .right-gradient{background-image:linear-gradient(to left,rgba(var(--agent-input-bg-rgb),1),rgba(var(--agent-input-bg-rgb),0))}.agent-recorder button{background-color:rgba(var(--agent-button-bg-rgb),.3);color:rgba(var(--agent-button-bg-rgb))}@keyframes fadeInFromTop{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeOutFromTop{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes fadeInFromBottom{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeOutFromBottom{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}[data-scope=menu][data-part=content]{backdrop-filter:blur(var(--agent-input-blur));border-color:rgba(var(--agent-input-border-rgb),var(--agent-input-border-opacity));border-width:var(--agent-input-border-width);box-shadow:var(--agent-input-box-shadow);color:var(--agent-input-color)}[data-scope=menu][data-part=content],[data-scope=menu][data-part=item]{background-color:rgba(var(--agent-input-bg-rgb),var(--agent-input-opacity));border-radius:var(--agent-input-border-radius)}[data-scope=menu][data-part=item]{cursor:pointer}[data-scope=menu][data-part=content][data-state=open]{animation:fadeInFromTop .15s ease-out forwards}[data-scope=menu][data-part=content][data-state=closed]{animation:fadeOutFromTop 50ms ease-out forwards}[data-scope=toast][data-part=group]{width:100%}[data-scope=toast][data-part=root]{background-color:rgba(var(--agent-input-bg-rgb),var(--agent-input-opacity));border-radius:var(--agent-chat-container-border-radius);box-shadow:var(--agent-input-box-shadow);color:var(--agent-input-color);display:flex;flex-direction:column;gap:4px;max-width:60vw;padding:16px 32px 16px 16px}[data-scope=toast][data-part=title]{font-weight:600}[data-scope=toast][data-part=description]{font-size:14px;line-height:20px}[data-scope=toast][data-part=root][data-state=open]{animation:fadeInFromBottom .15s ease-out forwards}[data-scope=toast][data-part=root][data-state=closed]{animation:fadeOutFromBottom 50ms ease-out forwards}[data-scope=progress][data-part=root]{height:100%;width:100%}[data-scope=progress][data-part=circle]{--size:40px;--thickness:4px;--radius:18px;--circomference:113.09724px}[data-scope=progress][data-part=circle-range]{stroke:#fff;--transition-prop:stroke-dasharray,stroke,stroke-dashoffset;transition-property:stroke-dasharray,stroke,stroke-dashoffset;--transition-duration:0.2s;transition-duration:.2s}[data-scope=progress][data-part=circle-track]{stroke:rgba(0,0,0,.5)}.agent-input-suggest{background-color:rgba(var(--agent-input-bg-rgb),var(--agent-input-opacity));border-color:rgba(var(--agent-chat-container-border-rgb),.1);border-width:1;color:var(--agent-input-color)}.agent-input-suggest:hover{filter:brightness(90%)}.last\\:border-b-0:last-child{border-bottom-width:0}.hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),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))}.hover\\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.hover\\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:brightness-90:hover{--tw-brightness:brightness(.9)}.hover\\:brightness-90:hover,.hover\\:brightness-95:hover{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-95:hover{--tw-brightness:brightness(.95)}.hover\\:backdrop-brightness-95:hover{--tw-backdrop-brightness:brightness(.95);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.active\\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),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))}.active\\:brightness-75:active{--tw-brightness:brightness(.75)}.active\\:brightness-75:active,.active\\:brightness-90:active{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.active\\:brightness-90:active{--tw-brightness:brightness(.9)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:brightness-100:disabled{--tw-brightness:brightness(1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[state\\=open\\]\\:backdrop-brightness-90[data-state=open]{--tw-backdrop-brightness:brightness(.9);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}@media (min-width:640px){.sm\\:left-0{left:0}.sm\\:right-0{right:0}.sm\\:my-8{margin-bottom:32px;margin-top:32px}.sm\\:p-0{padding:0}.sm\\:opacity-0{opacity:0}}@media (prefers-color-scheme:dark){.dark\\:bg-blue-900\\/20{background-color:rgba(30,58,138,.2)}.dark\\:hover\\:bg-gray-800:hover{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}}';var d2=w('<svg part=button-icon viewBox="0 0 24 24"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z">'),f2=w('<img part=button-icon alt="Bubble button icon">'),Vw=w("<span part=button-icon>"),p2=w('<svg part=button-icon viewBox="0 0 24 24"><path fill-rule=evenodd clip-rule=evenodd d="M18.601 8.39897C18.269 8.06702 17.7309 8.06702 17.3989 8.39897L12 13.7979L6.60099 8.39897C6.26904 8.06702 5.73086 8.06702 5.39891 8.39897C5.06696 8.73091 5.06696 9.2691 5.39891 9.60105L11.3989 15.601C11.7309 15.933 12.269 15.933 12.601 15.601L18.601 9.60105C18.9329 9.2691 18.9329 8.73091 18.601 8.39897Z">'),m2=w('<img part=button-icon alt="Bubble button close icon">'),g2=w('<button part=button aria-label="Open agent">'),pd="#0042DA",Hw="#27272A",Ww="#fff",Ml=e=>e.startsWith("http")||e.startsWith("data:image/svg+xml"),jw=e=>(()=>{var t=g2();return t.$$click=()=>e.toggleAgent(),t.style.setProperty("z-index","99999999"),x(t,m(W,{get when(){return at(e.customIconSrc)},keyed:true,get children(){var r=d2();return M(n=>{var o=e.iconColor??(Ur(e.backgroundColor??pd)?Hw:Ww),i=jt("stroke-2 fill-transparent absolute duration-200 transition w-[60%]",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100");return o!==n.e&&((n.e=o)!=null?r.style.setProperty("stroke",o):r.style.removeProperty("stroke")),i!==n.t&&G(r,"class",n.t=i),n},{e:void 0,t:void 0}),r}}),null),x(t,m(W,{get when(){return L(()=>!!e.customIconSrc)()&&Ml(e.customIconSrc)},get children(){var r=f2();return M(n=>{var o=e.customIconSrc,i=jt("duration-200 transition",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100",or(e.customIconSrc)?"w-[60%]":"w-full h-full",or(e.customIconSrc)?"":"object-cover rounded-full");return o!==n.e&&G(r,"src",n.e=o),i!==n.t&&U(r,n.t=i),n},{e:void 0,t:void 0}),r}}),null),x(t,m(W,{get when(){return L(()=>!!e.customIconSrc)()&&!Ml(e.customIconSrc)},get children(){var r=Vw();return r.style.setProperty("font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"),x(r,()=>e.customIconSrc),M(()=>U(r,jt("text-4xl duration-200 transition",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100"))),r}}),null),x(t,m(W,{get when(){return at(e.customCloseIconSrc)},get children(){var r=p2();return M(n=>{var o=e.iconColor??(Ur(e.backgroundColor??pd)?Hw:Ww),i=jt("absolute duration-200 transition w-[60%]",e.isAgentOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0");return o!==n.e&&((n.e=o)!=null?r.style.setProperty("fill",o):r.style.removeProperty("fill")),i!==n.t&&G(r,"class",n.t=i),n},{e:void 0,t:void 0}),r}}),null),x(t,m(W,{get when(){return L(()=>!!e.customCloseIconSrc)()&&Ml(e.customCloseIconSrc)},get children(){var r=m2();return M(n=>{var o=e.customCloseIconSrc,i=jt("absolute duration-200 transition",e.isAgentOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0",or(e.customCloseIconSrc)?"w-[60%]":"w-full h-full",or(e.customCloseIconSrc)?"":"object-cover rounded-full");return o!==n.e&&G(r,"src",n.e=o),i!==n.t&&U(r,n.t=i),n},{e:void 0,t:void 0}),r}}),null),x(t,m(W,{get when(){return L(()=>!!e.customCloseIconSrc)()&&!Ml(e.customCloseIconSrc)},get children(){var r=Vw();return r.style.setProperty("font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"),x(r,()=>e.customCloseIconSrc),M(()=>U(r,jt("absolute text-4xl duration-200 transition",e.isAgentOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0"))),r}}),null),M(r=>{var n=hr("relative shadow-md rounded-2xl hover:scale-110 active:scale-95 transition-transform duration-200 flex justify-center items-center animate-fade-in"),o=e.backgroundColor??pd,i=e.buttonSize,a=e.buttonSize;return n!==r.e&&U(t,r.e=n),o!==r.t&&((r.t=o)!=null?t.style.setProperty("background-color",o):t.style.removeProperty("background-color")),i!==r.a&&((r.a=i)!=null?t.style.setProperty("width",i):t.style.removeProperty("width")),a!==r.o&&((r.o=a)!=null?t.style.setProperty("height",a):t.style.removeProperty("height")),r},{e:void 0,t:void 0,a:void 0,o:void 0}),t})();Ne(["click"]);var h2=w("<div part=preview-message><p>"),b2=w('<img class="rounded-full w-8 h-8 object-cover"alt="Agent avatar"elementtiming="Agent avatar"fetchpriority=high>'),y2=w('<button part=preview-message-close-button aria-label=Close><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),zw="#F7F8FF",Gw="#303235",qw=e=>{let[t,r]=R(false),[n,o]=R({x:0,y:0}),i=s=>{o({x:s.touches[0]?.clientX??0,y:s.touches[0]?.clientY??0});},a=s=>{let l=s.changedTouches[0]?.clientX??0,u=s.changedTouches[0]?.clientY??0;(Math.abs(l-n().x)>10||u-n().y>10)&&e.onCloseClick(),o({x:0,y:0});};return (()=>{var s=h2(),l=s.firstChild;return s.$$touchend=a,s.$$touchstart=i,s.addEventListener("mouseleave",()=>r(false)),s.addEventListener("mouseenter",()=>r(true)),s.$$click=()=>e.onClick(),s.style.setProperty("z-index","99999999"),x(s,m(x2,{get isHovered(){return t()},get previewMessageTheme(){return e.previewMessageTheme},get onClick(){return e.onCloseClick}}),l),x(s,m(W,{get when(){return e.avatarUrl},keyed:true,children:u=>(()=>{var c=b2();return G(c,"src",u),c})()}),l),x(l,()=>e.message),M(u=>{var c=hr("absolute bottom-[calc(100%+12px)] w-64 rounded-md duration-200 flex items-center gap-4 shadow-md animate-fade-in cursor-pointer hover:shadow-lg p-4",e.placement==="left"?"left-0":"right-0"),d=e.previewMessageTheme?.backgroundColor??zw,p=e.previewMessageTheme?.textColor??Gw,f=`calc(${e.buttonSize} + 32px)`;return c!==u.e&&U(s,u.e=c),d!==u.t&&((u.t=d)!=null?s.style.setProperty("background-color",d):s.style.removeProperty("background-color")),p!==u.a&&((u.a=p)!=null?s.style.setProperty("color",p):s.style.removeProperty("color")),f!==u.o&&((u.o=f)!=null?s.style.setProperty("bottom",f):s.style.removeProperty("bottom")),u},{e:void 0,t:void 0,a:void 0,o:void 0}),s})()},x2=e=>(()=>{var t=y2();return t.$$click=r=>(r.stopPropagation(),e.onClick()),M(r=>{var n="absolute -top-2 -right-2 rounded-full w-6 h-6 p-1 hover:brightness-95 active:brightness-90 transition-all border "+(e.isHovered?"opacity-100":"opacity-0"),o=e.previewMessageTheme?.closeButtonBackgroundColor??zw,i=e.previewMessageTheme?.closeButtonIconColor??Gw;return n!==r.e&&U(t,r.e=n),o!==r.t&&((r.t=o)!=null?t.style.setProperty("background-color",o):t.style.removeProperty("background-color")),i!==r.a&&((r.a=i)!=null?t.style.setProperty("color",i):t.style.removeProperty("color")),r},{e:void 0,t:void 0,a:void 0}),t})();Ne(["click","touchstart","touchend"]);var v2=w("<style>"),w2=w("<div><div></div><div part=agent><div>"),T2="20px",C2="12px",Kw=e=>{let[t,r]=Je(e,["onOpen","onClose","previewMessage","onPreviewMessageClick","onPreviewMessageDismissed","theme","autoShowDelay","inlineStyle"]),[n,o]=R(true),[i,a]=R(r.prefilledVariables),[s,l]=R(false),[u,c]=R({message:t.previewMessage?.message??"",avatarUrl:t.previewMessage?.avatarUrl}),[d,p]=R(false),[f,b]=R(false),[g,y]=R(true),[T,S]=R(Yw(t.theme?.button?.size??"medium"));Ce(()=>{S(Yw(t.theme?.button?.size??"medium"));});let E;ie(()=>{window.addEventListener("message",h);let D=t.autoShowDelay,F=t.previewMessage?.autoShowDelay;(as()||fo())&&C(),D&&setTimeout(()=>{C();},D),F&&setTimeout(()=>{_();},F);}),ae(()=>{window.removeEventListener("message",h);}),Ce(()=>{e.prefilledVariables&&a(D=>({...D,...e.prefilledVariables}));});let h=D=>{let{data:F}=D;!F.isFromAgent||F.id&&r.id!==F.id||(F.command==="open"&&C(),F.command==="close"&&$(),F.command==="toggle"&&H(),F.command==="showPreviewMessage"&&_(F.message),F.command==="hidePreviewMessage"&&A(),F.command==="setPrefilledVariables"&&a(j=>({...j,...F.variables})),F.command==="unmount"&&I());},C=()=>{f()||b(true),setTimeout(()=>{y(false);},1200),A(),p(true),d()&&t.onOpen?.();},$=()=>{p(false),is(),d()&&t.onClose?.();},H=()=>{d()?$():C();},N=()=>{t.onPreviewMessageClick?.(),C();},_=D=>{d()||(D&&c(D),l(true));},A=()=>{t.onPreviewMessageDismissed?.(),l(false);},I=()=>{d()?($(),setTimeout(()=>{o(false);},200)):o(false);},k=D=>{r.onChatStatePersisted?.(D),D&&os();},O=D=>{(D===Dl||D===Wo)&&I(),e.onScriptExecutionSuccess?.(D);};return m(W,{get when(){return n()},get children(){return m(Sn,{get value(){return document.querySelector("agent-bubble")?.shadowRoot},get children(){return [(()=>{var D=v2();return x(D,Qn),D})(),(()=>{var D=w2(),F=D.firstChild,j=F.nextSibling,ne=j.firstChild;x(D,m(W,{get when(){return s()},get children(){return m(qw,be(u,{get placement(){return t.theme?.placement},get previewMessageTheme(){return t.theme?.previewMessage},get buttonSize(){return T()},onClick:N,onCloseClick:A}))}}),F),x(D,m(jw,be(()=>t.theme?.button,{get placement(){return t.theme?.placement},toggleAgent:H,get isAgentOpened(){return d()},get buttonSize(){return T()}})),F);var ve=E;return typeof ve=="function"?me(ve,F):E=F,j.style.setProperty("transition","transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out"),j.style.setProperty("box-shadow","rgb(0 0 0 / 16%) 0px 5px 40px"),x(j,m(W,{get when(){return f()},get children(){return m(ni,be(r,{onScriptExecutionSuccess:O,onChatStatePersisted:k,get prefilledVariables(){return i()},class:"rounded-lg",progressBarRef:E}))}}),ne),x(ne,m(jo,{})),M(fe=>{var Be=hr(t.theme?.position!=="static"?t.theme?.placement==="left"?"z-[424242] fixed bottom-5 left-5":"z-[424242] fixed bottom-5 right-5":"relative"),pe=t.inlineStyle,wt=`calc(100vh - ${T2} - ${T()} - ${C2})`,Ye=t.theme?.chatWindow?.maxHeight??"704px",rr=t.theme?.chatWindow?.maxWidth??"400px",Ve=t.theme?.placement==="left"?"bottom left":"bottom right",Ut=d()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",Vt=t.theme?.chatWindow?.backgroundColor,Ke=hr("absolute rounded-lg w-screen bottom-[calc(100%+12px)]",d()?"opacity-1":"opacity-0 pointer-events-none",t.theme?.placement==="left"?"sm:left-0 -left-5":"sm:right-0 -right-5"),Oe=hr("absolute transition-opacity pointer-events-none top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 opacity-50",g()?"opacity-100":"opacity-0");return Be!==fe.e&&U(D,fe.e=Be),fe.t=hn(D,pe,fe.t),wt!==fe.a&&((fe.a=wt)!=null?j.style.setProperty("max-height",wt):j.style.removeProperty("max-height")),Ye!==fe.o&&((fe.o=Ye)!=null?j.style.setProperty("height",Ye):j.style.removeProperty("height")),rr!==fe.i&&((fe.i=rr)!=null?j.style.setProperty("max-width",rr):j.style.removeProperty("max-width")),Ve!==fe.n&&((fe.n=Ve)!=null?j.style.setProperty("transform-origin",Ve):j.style.removeProperty("transform-origin")),Ut!==fe.s&&((fe.s=Ut)!=null?j.style.setProperty("transform",Ut):j.style.removeProperty("transform")),Vt!==fe.h&&((fe.h=Vt)!=null?j.style.setProperty("background-color",Vt):j.style.removeProperty("background-color")),Ke!==fe.r&&U(j,fe.r=Ke),Oe!==fe.d&&U(ne,fe.d=Oe),fe},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),D})()]}})}})},Yw=e=>e==="medium"?"48px":e==="large"?"64px":e||"48px";var _2=w("<style>"),S2=w('<div class=relative aria-labelledby=modal-title role=dialog aria-modal=true><style></style><div class="fixed inset-0 bg-black bg-opacity-50 transition-opacity animate-fade-in"part=overlay></div><div class="fixed inset-0 z-10 overflow-y-auto"><div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0"><div>'),Xw=e=>{let[t,r]=Je(e,["onOpen","onClose","autoShowDelay","theme","isOpen","defaultOpen"]),[n,o]=R(r.prefilledVariables),[i,a]=R(t.isOpen??false);ie(()=>{(t.defaultOpen||fo()||as())&&c(),window.addEventListener("message",l);let g=t.autoShowDelay;ue(g)&&setTimeout(()=>{c();},g);}),ae(()=>{window.removeEventListener("message",l);}),Ce(()=>{at(e.isOpen)||e.isOpen===i()||p();}),Ce(()=>{e.prefilledVariables&&o(g=>({...g,...e.prefilledVariables}));});let s=g=>{g.stopPropagation();},l=g=>{let{data:y}=g;!y.isFromAgent||y.id&&r.id!==y.id||(y.command==="open"&&c(),y.command==="close"&&d(),y.command==="toggle"&&p(),y.command==="setPrefilledVariables"&&o(T=>({...T,...y.variables})));},u=null,c=()=>{a(true),t.onOpen?.(),u=window.getComputedStyle(document.body).overflow,document.body.style.setProperty("overflow","hidden","important"),document.addEventListener("pointerdown",d);},d=()=>{a(false),t.onClose?.(),document.body.style.setProperty("overflow",u??"auto","important"),document.removeEventListener("pointerdown",d),is();},p=()=>{i()?d():c();},f=g=>{r.onChatStatePersisted?.(g),g&&os();},b=g=>{(g===Dl||g===Wo)&&d(),e.onScriptExecutionSuccess?.(g);};return m(W,{get when(){return i()},get children(){return m(Sn,{get value(){return document.querySelector("agent-popup")?.shadowRoot},get children(){return [(()=>{var g=_2();return x(g,Qn),g})(),(()=>{var g=S2(),y=g.firstChild,T=y.nextSibling,S=T.nextSibling,E=S.firstChild,h=E.firstChild;return x(y,Qn),nt(h,"pointerdown",s),x(h,m(ni,be(r,{onScriptExecutionSuccess:b,get prefilledVariables(){return n()},onChatStatePersisted:f}))),M(C=>{var $=e.theme?.zIndex??99999999,H="relative h-[80vh] transform overflow-hidden rounded-lg text-left transition-all sm:my-8 w-full max-w-lg"+(e.theme?.backgroundColor?" shadow-xl":""),N=e.theme?.backgroundColor??"transparent",_=e.theme?.width??"512px";return $!==C.e&&((C.e=$)!=null?g.style.setProperty("z-index",$):g.style.removeProperty("z-index")),H!==C.t&&U(h,C.t=H),N!==C.a&&((C.a=N)!=null?h.style.setProperty("background-color",N):h.style.removeProperty("background-color")),_!==C.o&&((C.o=_)!=null?h.style.setProperty("max-width",_):h.style.removeProperty("max-width")),C},{e:void 0,t:void 0,a:void 0,o:void 0}),g})()]}})}})};var k2=w(`<style>
103
126
  :host {
104
127
  display: block;
105
128
  width: 100%;
106
129
  height: 100%;
107
130
  overflow-y: hidden;
108
131
  }
109
- `);var _0=(e,{element:t})=>{let[r,n]=M(false),[o,i]=M(e.prefilledVariables),a=()=>{n(true);},s=new IntersectionObserver(c=>{c.some(u=>u.isIntersecting)&&a();});ce(()=>{window.addEventListener("message",l),s.observe(t);}),Se(()=>{e.prefilledVariables&&i(c=>({...c,...e.prefilledVariables}));});let l=c=>{let{data:u}=c;!u.isFromAgent||u.id&&e.id!==u.id||u.command==="setPrefilledVariables"&&i(d=>({...d,...u.variables}));};return me(()=>{s.disconnect();}),m(Bn,{get value(){return document.querySelector("agent-standard")?.shadowRoot},get children(){return [(()=>{var c=gD(),u=c.firstChild;return v(c,fo,u),c})(),m(W,{get when(){return r()},get children(){return m(hi,Re(e,{get prefilledVariables(){return o()}}))}})]}})};var C0=()=>{typeof window>"u"||(fs("agent-standard",ps,_0),fs("agent-bubble",Gf,w0),fs("agent-popup",zf,T0));};var S0=({id:e}={})=>{let t={isFromAgent:true,command:"close",id:e};window.postMessage(t);};var k0=({id:e}={})=>{let t={isFromAgent:true,command:"hidePreviewMessage",id:e};window.postMessage(t);};var P0=({id:e}={})=>{let t={isFromAgent:true,command:"open",id:e};window.postMessage(t);};var E0=(e,{id:t}={})=>{let r={isFromAgent:true,command:"setInputValue",value:e,id:t};window.postMessage(r);};var I0=(e,{id:t}={})=>{let r={isFromAgent:true,command:"setPrefilledVariables",variables:e,id:t};window.postMessage(r);};var A0=(e,{id:t}={})=>{let r={isFromAgent:true,command:"showPreviewMessage",message:e,id:t};window.postMessage(r);};var O0=({id:e}={})=>{let t={isFromAgent:true,command:"toggle",id:e};window.postMessage(t);};var R0=({id:e}={})=>{let t={isFromAgent:true,command:"unmount",id:e};window.postMessage(t);};var hD=e=>{let t=e.id?document.getElementById(e.id):document.querySelector("agent-standard");if(!t)throw new Error("<agent-standard> element not found.");Object.assign(t,e);},bD=e=>{let t=document.createElement("agent-popup");Object.assign(t,e),document.body.prepend(t);},yD=e=>{let t=document.createElement("agent-bubble");Object.assign(t,e),document.body.prepend(t);},D0=()=>({initStandard:hD,initPopup:bD,initBubble:yD,close:S0,hidePreviewMessage:k0,open:P0,setPrefilledVariables:I0,showPreviewMessage:A0,toggle:O0,setInputValue:E0,unmount:R0}),M0=e=>{typeof window>"u"||(window.Agent={...e});};C0();var $0=D0();M0($0);var _ae=$0;/*! Bundled license information:
132
+ `);var Zw=(e,{element:t})=>{let[r,n]=R(false),[o,i]=R(e.prefilledVariables),a=()=>{n(true);},s=()=>{n(false),setTimeout(()=>{n(true);},100);},l=new IntersectionObserver(c=>{c.some(d=>d.isIntersecting)&&a();});ie(()=>{window.addEventListener("message",u),l.observe(t);}),Ce(()=>{e.prefilledVariables&&i(c=>({...c,...e.prefilledVariables}));});let u=c=>{let{data:d}=c;if(!(!d.isFromAgent||d.id&&e.id!==d.id))switch(d.command){case "setPrefilledVariables":i(p=>({...p,...d.variables}));break;case "reload":s();break;}};return ae(()=>{l.disconnect();}),m(Sn,{get value(){return document.querySelector("agent-standard")?.shadowRoot},get children(){return [(()=>{var c=k2(),d=c.firstChild;return x(c,Qn,d),c})(),m(W,{get when(){return r()},get children(){return m(ni,be(e,{get prefilledVariables(){return o()}}))}})]}})};var Qw=()=>{typeof window>"u"||(Wa("agent-standard",ja,Zw),Wa("agent-bubble",df,Kw),Wa("agent-popup",uf,Xw));};var Jw=({id:e}={})=>{let t={isFromAgent:true,command:"close",id:e};window.postMessage(t);};var e0=({id:e}={})=>{let t={isFromAgent:true,command:"hidePreviewMessage",id:e};window.postMessage(t);};var t0=({id:e}={})=>{let t={isFromAgent:true,command:"open",id:e};window.postMessage(t);};var r0=(e,{id:t}={})=>{let r={isFromAgent:true,command:"setInputValue",value:e,id:t};window.postMessage(r);};var n0=(e,{id:t}={})=>{let r={isFromAgent:true,command:"setPrefilledVariables",variables:e,id:t};window.postMessage(r);};var o0=(e,{id:t}={})=>{let r={isFromAgent:true,command:"showPreviewMessage",message:e,id:t};window.postMessage(r);};var i0=({id:e}={})=>{let t={isFromAgent:true,command:"toggle",id:e};window.postMessage(t);};var a0=({id:e}={})=>{let t={isFromAgent:true,command:"unmount",id:e};window.postMessage(t);};var P2=e=>{let t=e.id?document.getElementById(e.id):document.querySelector("agent-standard");if(!t)throw new Error("<agent-standard> element not found.");Object.assign(t,e);},E2=e=>{let t=document.createElement("agent-popup");Object.assign(t,e),document.body.prepend(t);},I2=e=>{let t=document.createElement("agent-bubble");Object.assign(t,e),document.body.prepend(t);},s0=()=>({initStandard:P2,initPopup:E2,initBubble:I2,close:Jw,hidePreviewMessage:e0,open:t0,setPrefilledVariables:n0,showPreviewMessage:o0,toggle:i0,setInputValue:r0,unmount:a0}),l0=e=>{typeof window>"u"||(window.Agent={...e});};Qw();var c0=s0();l0(c0);var Ese=c0;/*! Bundled license information:
110
133
 
111
134
  @noble/hashes/utils.js:
112
135
  (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
113
136
 
114
- dompurify/dist/purify.js:
115
- (*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE *)
116
-
117
137
  ky/distribution/index.js:
118
138
  (*! MIT License © Sindre Sorhus *)
119
139
 
120
- tabbable/dist/index.esm.js:
121
- (*!
122
- * tabbable 6.2.0
123
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
124
- *)
125
-
126
- focus-trap/dist/focus-trap.esm.js:
127
- (*!
128
- * focus-trap 7.6.0
129
- * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
130
- *)
131
-
132
140
  partysocket/dist/chunk-4SNNYC7I.mjs:
133
141
  (*!
134
142
  * Reconnecting WebSocket
@@ -136,6 +144,7 @@ partysocket/dist/chunk-4SNNYC7I.mjs:
136
144
  * https://github.com/pladaria/reconnecting-websocket
137
145
  * License MIT
138
146
  *)
139
- */
140
147
 
141
- export { _ae as default };
148
+ dompurify/dist/purify.es.mjs:
149
+ (*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE *)
150
+ */export{Ese as default};