@release0/js 1.1.5 → 1.1.6
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/README.md +4 -4
- package/dist/web.js +6 -6
- package/package.json +1 -1
package/dist/web.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Release0 v1.1.
|
|
1
|
+
// Release0 v1.1.6
|
|
2
2
|
var Y0=Object.create;var Ka=Object.defineProperty;var q0=Object.getOwnPropertyDescriptor;var K0=Object.getOwnPropertyNames;var X0=Object.getPrototypeOf,Z0=Object.prototype.hasOwnProperty;var Q0=(e,t)=>()=>(e&&(t=e(e=0)),t);var Je=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),J0=(e,t)=>{for(var r in t)Ka(e,r,{get:t[r],enumerable:true});},nf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of K0(t))!Z0.call(e,o)&&o!==r&&Ka(e,o,{get:()=>t[o],enumerable:!(n=q0(t,o))||n.enumerable});return e};var xo=(e,t,r)=>(r=e!=null?Y0(X0(e)):{},nf(Ka(r,"default",{value:e,enumerable:true}),e)),Xa=e=>nf(Ka({},"__esModule",{value:true}),e);var pp=Je(be=>{Object.defineProperty(be,"__esModule",{value:true});be.toBig=be.shrSL=be.shrSH=be.rotrSL=be.rotrSH=be.rotrBL=be.rotrBH=be.rotr32L=be.rotr32H=be.rotlSL=be.rotlSH=be.rotlBL=be.rotlBH=be.add5L=be.add5H=be.add4L=be.add4H=be.add3L=be.add3H=void 0;be.add=ap;be.fromBig=Pc;be.split=Gf;var ls=BigInt(2**32-1),kc=BigInt(32);function Pc(e,t=false){return t?{h:Number(e&ls),l:Number(e>>kc&ls)}:{h:Number(e>>kc&ls)|0,l:Number(e&ls)|0}}function Gf(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}=Pc(e[i],t);[n[i],o[i]]=[a,s];}return [n,o]}var Yf=(e,t)=>BigInt(e>>>0)<<kc|BigInt(t>>>0);be.toBig=Yf;var qf=(e,t,r)=>e>>>r;be.shrSH=qf;var Kf=(e,t,r)=>e<<32-r|t>>>r;be.shrSL=Kf;var Xf=(e,t,r)=>e>>>r|t<<32-r;be.rotrSH=Xf;var Zf=(e,t,r)=>e<<32-r|t>>>r;be.rotrSL=Zf;var Qf=(e,t,r)=>e<<64-r|t>>>r-32;be.rotrBH=Qf;var Jf=(e,t,r)=>e>>>r-32|t<<64-r;be.rotrBL=Jf;var ep=(e,t)=>t;be.rotr32H=ep;var tp=(e,t)=>e;be.rotr32L=tp;var rp=(e,t,r)=>e<<r|t>>>32-r;be.rotlSH=rp;var np=(e,t,r)=>t<<r|e>>>32-r;be.rotlSL=np;var op=(e,t,r)=>t<<r-32|e>>>64-r;be.rotlBH=op;var ip=(e,t,r)=>e<<r-32|t>>>64-r;be.rotlBL=ip;function ap(e,t,r,n){let o=(t>>>0)+(n>>>0);return {h:e+r+(o/2**32|0)|0,l:o|0}}var sp=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);be.add3L=sp;var lp=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;be.add3H=lp;var cp=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);be.add4L=cp;var up=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0;be.add4H=up;var dp=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0);be.add5L=dp;var fp=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0;be.add5H=fp;var wC={fromBig:Pc,split:Gf,toBig:Yf,shrSH:qf,shrSL:Kf,rotrSH:Xf,rotrSL:Zf,rotrBH:Qf,rotrBL:Jf,rotr32H:ep,rotr32L:tp,rotlSH:rp,rotlSL:np,rotlBH:op,rotlBL:ip,add:ap,add3L:sp,add3H:lp,add4L:cp,add4H:up,add5H:fp,add5L:dp};be.default=wC;});var mp=Je(cs=>{Object.defineProperty(cs,"__esModule",{value:true});cs.crypto=void 0;cs.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;});var Tp=Je(pe=>{Object.defineProperty(pe,"__esModule",{value:true});pe.wrapXOFConstructorWithOpts=pe.wrapConstructorWithOpts=pe.wrapConstructor=pe.Hash=pe.nextTick=pe.swap32IfBE=pe.byteSwapIfBE=pe.swap8IfBE=pe.isLE=void 0;pe.isBytes=hp;pe.anumber=Ec;pe.abytes=Ao;pe.ahash=TC;pe.aexists=CC;pe.aoutput=_C;pe.u8=SC;pe.u32=kC;pe.clean=PC;pe.createView=EC;pe.rotr=IC;pe.rotl=AC;pe.byteSwap=Ac;pe.byteSwap32=bp;pe.bytesToHex=RC;pe.hexToBytes=DC;pe.asyncLoop=NC;pe.utf8ToBytes=Oc;pe.bytesToUtf8=LC;pe.toBytes=us;pe.kdfInputToBytes=$C;pe.concatBytes=BC;pe.checkOpts=FC;pe.createHasher=vp;pe.createOptHasher=xp;pe.createXOFer=wp;pe.randomBytes=UC;var Io=mp();function hp(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Ec(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Ao(e,...t){if(!hp(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 TC(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Ec(e.outputLen),Ec(e.blockLen);}function CC(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 _C(e,t){Ao(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function SC(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function kC(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function PC(...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 IC(e,t){return e<<32-t|e>>>t}function AC(e,t){return e<<t|e>>>32-t>>>0}pe.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Ac(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}pe.swap8IfBE=pe.isLE?e=>e:e=>Ac(e);pe.byteSwapIfBE=pe.swap8IfBE;function bp(e){for(let t=0;t<e.length;t++)e[t]=Ac(e[t]);return e}pe.swap32IfBE=pe.isLE?e=>e:bp;var yp=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",OC=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function RC(e){if(Ao(e),yp)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=OC[e[r]];return t}var jr={_0:48,_9:57,A:65,F:70,a:97,f:102};function gp(e){if(e>=jr._0&&e<=jr._9)return e-jr._0;if(e>=jr.A&&e<=jr.F)return e-(jr.A-10);if(e>=jr.a&&e<=jr.f)return e-(jr.a-10)}function DC(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(yp)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=gp(e.charCodeAt(i)),s=gp(e.charCodeAt(i+1));if(a===void 0||s===void 0){let c=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}n[o]=a*16+s;}return n}var MC=async()=>{};pe.nextTick=MC;async function NC(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, pe.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 us(e){return typeof e=="string"&&(e=Oc(e)),Ao(e),e}function $C(e){return typeof e=="string"&&(e=Oc(e)),Ao(e),e}function BC(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];Ao(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 FC(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 Ic=class{};pe.Hash=Ic;function vp(e){let t=n=>e().update(us(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function xp(e){let t=(n,o)=>e(o).update(us(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function wp(e){let t=(n,o)=>e(o).update(us(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}pe.wrapConstructor=vp;pe.wrapConstructorWithOpts=xp;pe.wrapXOFConstructorWithOpts=wp;function UC(e=32){if(Io.crypto&&typeof Io.crypto.getRandomValues=="function")return Io.crypto.getRandomValues(new Uint8Array(e));if(Io.crypto&&typeof Io.crypto.randomBytes=="function")return Uint8Array.from(Io.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}});var Op=Je(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=Ip;var Ei=pp(),St=Tp(),jC=BigInt(0),Pi=BigInt(1),WC=BigInt(2),HC=BigInt(7),VC=BigInt(256),zC=BigInt(113),Sp=[],kp=[],Pp=[];for(let e=0,t=Pi,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Sp.push(2*(5*n+r)),kp.push((e+1)*(e+2)/2%64);let o=jC;for(let i=0;i<7;i++)t=(t<<Pi^(t>>HC)*zC)%VC,t&WC&&(o^=Pi<<(Pi<<BigInt(i))-Pi);Pp.push(o);}var Ep=(0, Ei.split)(Pp,true),GC=Ep[0],YC=Ep[1],Cp=(e,t,r)=>r>32?(0, Ei.rotlBH)(e,t,r):(0, Ei.rotlSH)(e,t,r),_p=(e,t,r)=>r>32?(0, Ei.rotlBL)(e,t,r):(0, Ei.rotlSL)(e,t,r);function Ip(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,c=(a+2)%10,l=r[c],u=r[c+1],f=Cp(l,u,1)^r[s],d=_p(l,u,1)^r[s+1];for(let p=0;p<50;p+=10)e[a+p]^=f,e[a+p+1]^=d;}let o=e[2],i=e[3];for(let a=0;a<24;a++){let s=kp[a],c=Cp(o,i,s),l=_p(o,i,s),u=Sp[a];o=e[u],i=e[u+1],e[u]=c,e[u+1]=l;}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]^=GC[n],e[1]^=YC[n];}(0, St.clean)(r);}var Ii=class e extends St.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, St.anumber)(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0, St.u32)(this.state);}clone(){return this._cloneInto()}keccak(){(0, St.swap32IfBE)(this.state32),Ip(this.state32,this.rounds),(0, St.swap32IfBE)(this.state32),this.posOut=0,this.pos=0;}update(t){(0, St.aexists)(this),t=(0, St.toBytes)(t),(0, St.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, St.aexists)(this,false),(0, St.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, St.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0, St.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, St.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=Ii;var ln=(e,t,r)=>(0, St.createHasher)(()=>new Ii(t,e,r));Qe.sha3_224=ln(6,144,224/8);Qe.sha3_256=ln(6,136,256/8);Qe.sha3_384=ln(6,104,384/8);Qe.sha3_512=ln(6,72,512/8);Qe.keccak_224=ln(1,144,224/8);Qe.keccak_256=ln(1,136,256/8);Qe.keccak_384=ln(1,104,384/8);Qe.keccak_512=ln(1,72,512/8);var Ap=(e,t,r)=>(0, St.createXOFer)((n={})=>new Ii(t,e,n.dkLen===void 0?r:n.dkLen,true));Qe.shake128=Ap(31,168,128/8);Qe.shake256=Ap(31,136,256/8);});var Fp=Je((gD,cn)=>{var{sha3_512:qC}=Op(),Dp=24,Ai=32,Rc=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function Mp(e){let t=8n,r=0n;for(let n of e.values()){let o=BigInt(n);r=(r<<t)+o;}return r}var Np=(e="")=>Mp(qC(e)).toString(36).slice(1),Rp=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),KC=e=>Rp[Math.floor(e()*Rp.length)],Lp=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+Rc(Ai,t):Rc(Ai,t);return Np(n).substring(0,Ai)},$p=e=>()=>e++,XC=476782367,Bp=({random:e=Math.random,counter:t=$p(Math.floor(e()*XC)),length:r=Dp,fingerprint:n=Lp({random:e})}={})=>function(){let i=KC(e),a=Date.now().toString(36),s=t().toString(36),c=Rc(r,e),l=`${a+c+s+n}`;return `${i+Np(l).substring(1,r)}`},ZC=Bp(),QC=(e,{minLength:t=2,maxLength:r=Ai}={})=>{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};cn.exports.getConstants=()=>({defaultLength:Dp,bigLength:Ai});cn.exports.init=Bp;cn.exports.createId=ZC;cn.exports.bufToBigInt=Mp;cn.exports.createCounter=$p;cn.exports.createFingerprint=Lp;cn.exports.isCuid=QC;});var Up=Je((hD,Oi)=>{var{createId:JC,init:e_,getConstants:t_,isCuid:r_}=Fp();Oi.exports.createId=JC;Oi.exports.init=e_;Oi.exports.getConstants=t_;Oi.exports.isCuid=r_;});var Wp=Je((bD,jp)=>{var Oo=1e3,Ro=Oo*60,Do=Ro*60,On=Do*24,n_=On*7,o_=On*365.25;jp.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return i_(e);if(r==="number"&&isFinite(e))return t.long?s_(e):a_(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function i_(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*o_;case "weeks":case "week":case "w":return r*n_;case "days":case "day":case "d":return r*On;case "hours":case "hour":case "hrs":case "hr":case "h":return r*Do;case "minutes":case "minute":case "mins":case "min":case "m":return r*Ro;case "seconds":case "second":case "secs":case "sec":case "s":return r*Oo;case "milliseconds":case "millisecond":case "msecs":case "msec":case "ms":return r;default:return}}}}function a_(e){var t=Math.abs(e);return t>=On?Math.round(e/On)+"d":t>=Do?Math.round(e/Do)+"h":t>=Ro?Math.round(e/Ro)+"m":t>=Oo?Math.round(e/Oo)+"s":e+"ms"}function s_(e){var t=Math.abs(e);return t>=On?ds(e,t,On,"day"):t>=Do?ds(e,t,Do,"hour"):t>=Ro?ds(e,t,Ro,"minute"):t>=Oo?ds(e,t,Oo,"second"):e+" ms"}function ds(e,t,r,n){var o=t>=r*1.5;return Math.round(e/r)+" "+n+(o?"s":"")}});var Ry=Je((x$,ti)=>{var pE=typeof Buffer<"u",Ey=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Iy=/"(?: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 Ay(e,t,r){r==null&&t!==null&&typeof t=="object"&&(r=t,t=void 0),pE&&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(Ey.test(e)===false&&Iy.test(e)===false)return n}else if(o!=="ignore"&&i==="ignore"){if(Ey.test(e)===false)return n}else if(Iy.test(e)===false)return n;return Oy(n,{protoAction:o,constructorAction:i,safe:r&&r.safe})}function Oy(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 c=a[s];c&&typeof c=="object"&&o.push(c);}}}return e}function Su(e,t,r){let n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return Ay(e,t,r)}finally{Error.stackTraceLimit=n;}}function mE(e,t){let r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return Ay(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=r;}}ti.exports=Su;ti.exports.default=Su;ti.exports.parse=Su;ti.exports.safeParse=mE;ti.exports.scan=Oy;});var fx=Je(Ku=>{Object.defineProperty(Ku,"__esModule",{value:true});function Cl(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Cl=function(t){return typeof t}:Cl=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cl(e)}var ux="https://js.stripe.com/v3",I1=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,A1=function(){for(var t=document.querySelectorAll('script[src^="'.concat(ux,'"]')),r=0;r<t.length;r++){var n=t[r];if(I1.test(n.src))return n}return null},O1=function(t){var r=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(ux).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},R1=function(t,r){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"1.54.1",startTime:r});},Tl=null,D1=function(t){return Tl!==null||(Tl=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=A1();o&&t||o||(o=O1(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}})),Tl},M1=function(t,r,n){if(t===null)return null;var o=t.apply(void 0,r);return R1(o,n),o},cx=function(t){var r=`invalid load parameters; expected object of shape
|
|
3
3
|
|
|
4
4
|
{advancedFraudSignals: boolean}
|
|
@@ -7,7 +7,7 @@ but received
|
|
|
7
7
|
|
|
8
8
|
`.concat(JSON.stringify(t),`
|
|
9
9
|
`);if(t===null||Cl(t)!=="object")throw new Error(r);if(Object.keys(t).length===1&&typeof t.advancedFraudSignals=="boolean")return t;throw new Error(r)},_l,qu=false,dx=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];qu=true;var o=Date.now();return D1(_l).then(function(i){return M1(i,r,o)})};dx.setLoadParameters=function(e){if(qu&&_l){var t=cx(e),r=Object.keys(t),n=r.reduce(function(o,i){var a;return o&&e[i]===((a=_l)===null||a===void 0?void 0:a[i])},true);if(n)return}if(qu)throw new Error("You cannot change load parameters after calling loadStripe");_l=cx(e);};Ku.loadStripe=dx;});var mx=Je((Dq,px)=>{px.exports=fx();});var $a={};J0($a,{__addDisposableResource:()=>tw,__assign:()=>Pl,__asyncDelegator:()=>Yx,__asyncGenerator:()=>Gx,__asyncValues:()=>qx,__await:()=>ci,__awaiter:()=>Ux,__classPrivateFieldGet:()=>Qx,__classPrivateFieldIn:()=>ew,__classPrivateFieldSet:()=>Jx,__createBinding:()=>Il,__decorate:()=>Dx,__disposeResources:()=>rw,__esDecorate:()=>Nx,__exportStar:()=>Wx,__extends:()=>Ox,__generator:()=>jx,__importDefault:()=>Zx,__importStar:()=>Xx,__makeTemplateObject:()=>Kx,__metadata:()=>Fx,__param:()=>Mx,__propKey:()=>$x,__read:()=>td,__rest:()=>Rx,__rewriteRelativeImportExtension:()=>nw,__runInitializers:()=>Lx,__setFunctionName:()=>Bx,__spread:()=>Hx,__spreadArray:()=>zx,__spreadArrays:()=>Vx,__values:()=>El,default:()=>pA});function Ox(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ju(e,t);function r(){this.constructor=e;}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r);}function Rx(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 Dx(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 Mx(e,t){return function(r,n){t(r,n,e);}}function Nx(e,t,r,n,o,i){function a(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var s=n.kind,c=s==="getter"?"get":s==="setter"?"set":"value",l=!t&&e?n.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f,d=false,p=r.length-1;p>=0;p--){var h={};for(var g in n)h[g]=g==="access"?{}:n[g];for(var g in n.access)h.access[g]=n.access[g];h.addInitializer=function(b){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(b||null));};var v=(0, r[p])(s==="accessor"?{get:u.get,set:u.set}:u[c],h);if(s==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(f=a(v.get))&&(u.get=f),(f=a(v.set))&&(u.set=f),(f=a(v.init))&&o.unshift(f);}else (f=a(v))&&(s==="field"?o.unshift(f):u[c]=f);}l&&Object.defineProperty(l,n.name,u),d=true;}function Lx(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 $x(e){return typeof e=="symbol"?e:"".concat(e)}function Bx(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 Fx(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Ux(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{l(n.next(u));}catch(f){a(f);}}function c(u){try{l(n.throw(u));}catch(f){a(f);}}function l(u){u.done?i(u.value):o(u.value).then(s,c);}l((n=n.apply(e,t||[])).next());})}function jx(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(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(r=0)),r;)try{if(n=1,o&&(i=l[0]&2?o.return:l[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,l[1])).done)return i;switch(o=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){r.label=l[1];break}if(l[0]===6&&r.label<i[1]){r.label=i[1],i=l;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(l);break}i[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r);}catch(u){l=[6,u],o=0;}finally{n=i=0;}if(l[0]&5)throw l[1];return {value:l[0]?l[1]:void 0,done:true}}}function Wx(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Il(t,e,r);}function El(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 td(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 Hx(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(td(arguments[t]));return e}function Vx(){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 zx(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 ci(e){return this instanceof ci?(this.v=e,this):new ci(e)}function Gx(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(h){return Promise.resolve(h).then(p,f)}}function s(p,h){n[p]&&(o[p]=function(g){return new Promise(function(v,b){i.push([p,g,v,b])>1||c(p,g);})},h&&(o[p]=h(o[p])));}function c(p,h){try{l(n[p](h));}catch(g){d(i[0][3],g);}}function l(p){p.value instanceof ci?Promise.resolve(p.value.v).then(u,f):d(i[0][2],p);}function u(p){c("next",p);}function f(p){c("throw",p);}function d(p,h){p(h),i.shift(),i.length&&c(i[0][0],i[0][1]);}}function Yx(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:ci(e[o](a)),done:false}:i?i(a):a}:i;}}function qx(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 El=="function"?El(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,c){a=e[i](a),o(s,c,a.done,a.value);})};}function o(i,a,s,c){Promise.resolve(c).then(function(l){i({value:l,done:s});},a);}}function Kx(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Xx(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=ed(e),n=0;n<r.length;n++)r[n]!=="default"&&Il(t,e,r[n]);return dA(t,e),t}function Zx(e){return e&&e.__esModule?e:{default:e}}function Qx(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 Jx(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 ew(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 tw(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 rw(e){function t(i){e.error=e.hasError?new fA(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 nw(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 Ju,Pl,Il,dA,ed,fA,pA,Ba=Q0(()=>{Ju=function(e,t){return Ju=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]);},Ju(e,t)};Pl=function(){return Pl=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},Pl.apply(this,arguments)};Il=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];};dA=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t});}:function(e,t){e.default=t;},ed=function(e){return ed=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},ed(e)};fA=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};pA={__extends:Ox,__assign:Pl,__rest:Rx,__decorate:Dx,__param:Mx,__esDecorate:Nx,__runInitializers:Lx,__propKey:$x,__setFunctionName:Bx,__metadata:Fx,__awaiter:Ux,__generator:jx,__createBinding:Il,__exportStar:Wx,__values:El,__read:td,__spread:Hx,__spreadArrays:Vx,__spreadArray:zx,__await:ci,__asyncGenerator:Gx,__asyncDelegator:Yx,__asyncValues:qx,__makeTemplateObject:Kx,__importStar:Xx,__importDefault:Zx,__classPrivateFieldGet:Qx,__classPrivateFieldSet:Jx,__classPrivateFieldIn:ew,__addDisposableResource:tw,__disposeResources:rw,__rewriteRelativeImportExtension:nw};});var ui=Je(Al=>{Object.defineProperty(Al,"__esModule",{value:true});Al.WebmBase=void 0;var rd=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);}};Al.WebmBase=rd;});var Rl=Je(Ol=>{Object.defineProperty(Ol,"__esModule",{value:true});Ol.SectionType=void 0;var ow;(function(e){e.Container="Container",e.Uint="Uint",e.Int="Int",e.Float="Float",e.String="String",e.Date="Date",e.Binary="Binary";})(ow||(Ol.SectionType=ow={}));});var nd=Je(Dl=>{Object.defineProperty(Dl,"__esModule",{value:true});Dl.sections=void 0;var y=Rl();Dl.sections={172351395:{name:"EBML",type:y.SectionType.Container},646:{name:"EBMLVersion",type:y.SectionType.Uint},759:{name:"EBMLReadVersion",type:y.SectionType.Uint},754:{name:"EBMLMaxIDLength",type:y.SectionType.Uint},755:{name:"EBMLMaxSizeLength",type:y.SectionType.Uint},642:{name:"DocType",type:y.SectionType.String},647:{name:"DocTypeVersion",type:y.SectionType.Uint},645:{name:"DocTypeReadVersion",type:y.SectionType.Uint},108:{name:"Void",type:y.SectionType.Binary},63:{name:"CRC-32",type:y.SectionType.Binary},190023271:{name:"SignatureSlot",type:y.SectionType.Container},16010:{name:"SignatureAlgo",type:y.SectionType.Uint},16026:{name:"SignatureHash",type:y.SectionType.Uint},16037:{name:"SignaturePublicKey",type:y.SectionType.Binary},16053:{name:"Signature",type:y.SectionType.Binary},15963:{name:"SignatureElements",type:y.SectionType.Container},15995:{name:"SignatureElementList",type:y.SectionType.Container},9522:{name:"SignedElement",type:y.SectionType.Binary},139690087:{name:"Segment",type:y.SectionType.Container},21863284:{name:"SeekHead",type:y.SectionType.Container},3515:{name:"Seek",type:y.SectionType.Container},5035:{name:"SeekID",type:y.SectionType.Binary},5036:{name:"SeekPosition",type:y.SectionType.Uint},88713574:{name:"Info",type:y.SectionType.Container},13220:{name:"SegmentUID",type:y.SectionType.Binary},13188:{name:"SegmentFilename",type:y.SectionType.String},1882403:{name:"PrevUID",type:y.SectionType.Binary},1868715:{name:"PrevFilename",type:y.SectionType.String},2013475:{name:"NextUID",type:y.SectionType.Binary},1999803:{name:"NextFilename",type:y.SectionType.String},1092:{name:"SegmentFamily",type:y.SectionType.Binary},10532:{name:"ChapterTranslate",type:y.SectionType.Container},10748:{name:"ChapterTranslateEditionUID",type:y.SectionType.Uint},10687:{name:"ChapterTranslateCodec",type:y.SectionType.Uint},10661:{name:"ChapterTranslateID",type:y.SectionType.Binary},710577:{name:"TimecodeScale",type:y.SectionType.Uint},1161:{name:"Duration",type:y.SectionType.Float},1121:{name:"DateUTC",type:y.SectionType.Date},15273:{name:"Title",type:y.SectionType.String},3456:{name:"MuxingApp",type:y.SectionType.String},5953:{name:"WritingApp",type:y.SectionType.String},103:{name:"Timecode",type:y.SectionType.Uint},6228:{name:"SilentTracks",type:y.SectionType.Container},6359:{name:"SilentTrackNumber",type:y.SectionType.Uint},39:{name:"Position",type:y.SectionType.Uint},43:{name:"PrevSize",type:y.SectionType.Uint},35:{name:"SimpleBlock",type:y.SectionType.Binary},32:{name:"BlockGroup",type:y.SectionType.Container},33:{name:"Block",type:y.SectionType.Binary},34:{name:"BlockVirtual",type:y.SectionType.Binary},13729:{name:"BlockAdditions",type:y.SectionType.Container},38:{name:"BlockMore",type:y.SectionType.Container},110:{name:"BlockAddID",type:y.SectionType.Uint},37:{name:"BlockAdditional",type:y.SectionType.Binary},27:{name:"BlockDuration",type:y.SectionType.Uint},122:{name:"ReferencePriority",type:y.SectionType.Uint},123:{name:"ReferenceBlock",type:y.SectionType.Int},125:{name:"ReferenceVirtual",type:y.SectionType.Int},36:{name:"CodecState",type:y.SectionType.Binary},13730:{name:"DiscardPadding",type:y.SectionType.Int},14:{name:"Slices",type:y.SectionType.Container},104:{name:"TimeSlice",type:y.SectionType.Container},76:{name:"LaceNumber",type:y.SectionType.Uint},77:{name:"FrameNumber",type:y.SectionType.Uint},75:{name:"BlockAdditionID",type:y.SectionType.Uint},78:{name:"Delay",type:y.SectionType.Uint},79:{name:"SliceDuration",type:y.SectionType.Uint},72:{name:"ReferenceFrame",type:y.SectionType.Container},73:{name:"ReferenceOffset",type:y.SectionType.Uint},74:{name:"ReferenceTimeCode",type:y.SectionType.Uint},47:{name:"EncryptedBlock",type:y.SectionType.Binary},106212971:{name:"Tracks",type:y.SectionType.Container},46:{name:"TrackEntry",type:y.SectionType.Container},87:{name:"TrackNumber",type:y.SectionType.Uint},13253:{name:"TrackUID",type:y.SectionType.Uint},3:{name:"TrackType",type:y.SectionType.Uint},57:{name:"FlagEnabled",type:y.SectionType.Uint},8:{name:"FlagDefault",type:y.SectionType.Uint},5546:{name:"FlagForced",type:y.SectionType.Uint},28:{name:"FlagLacing",type:y.SectionType.Uint},11751:{name:"MinCache",type:y.SectionType.Uint},11768:{name:"MaxCache",type:y.SectionType.Uint},254851:{name:"DefaultDuration",type:y.SectionType.Uint},216698:{name:"DefaultDecodedFieldDuration",type:y.SectionType.Uint},209231:{name:"TrackTimecodeScale",type:y.SectionType.Float},4991:{name:"TrackOffset",type:y.SectionType.Int},5614:{name:"MaxBlockAdditionID",type:y.SectionType.Uint},4974:{name:"Name",type:y.SectionType.String},177564:{name:"Language",type:y.SectionType.String},6:{name:"CodecID",type:y.SectionType.String},9122:{name:"CodecPrivate",type:y.SectionType.Binary},362120:{name:"CodecName",type:y.SectionType.String},13382:{name:"AttachmentLink",type:y.SectionType.Uint},1742487:{name:"CodecSettings",type:y.SectionType.String},1785920:{name:"CodecInfoURL",type:y.SectionType.String},438848:{name:"CodecDownloadURL",type:y.SectionType.String},42:{name:"CodecDecodeAll",type:y.SectionType.Uint},12203:{name:"TrackOverlay",type:y.SectionType.Uint},5802:{name:"CodecDelay",type:y.SectionType.Uint},5819:{name:"SeekPreRoll",type:y.SectionType.Uint},9764:{name:"TrackTranslate",type:y.SectionType.Container},9980:{name:"TrackTranslateEditionUID",type:y.SectionType.Uint},9919:{name:"TrackTranslateCodec",type:y.SectionType.Uint},9893:{name:"TrackTranslateTrackID",type:y.SectionType.Binary},96:{name:"Video",type:y.SectionType.Container},26:{name:"FlagInterlaced",type:y.SectionType.Uint},5048:{name:"StereoMode",type:y.SectionType.Uint},5056:{name:"AlphaMode",type:y.SectionType.Uint},5049:{name:"OldStereoMode",type:y.SectionType.Uint},48:{name:"PixelWidth",type:y.SectionType.Uint},58:{name:"PixelHeight",type:y.SectionType.Uint},5290:{name:"PixelCropBottom",type:y.SectionType.Uint},5307:{name:"PixelCropTop",type:y.SectionType.Uint},5324:{name:"PixelCropLeft",type:y.SectionType.Uint},5341:{name:"PixelCropRight",type:y.SectionType.Uint},5296:{name:"DisplayWidth",type:y.SectionType.Uint},5306:{name:"DisplayHeight",type:y.SectionType.Uint},5298:{name:"DisplayUnit",type:y.SectionType.Uint},5299:{name:"AspectRatioType",type:y.SectionType.Uint},963876:{name:"ColourSpace",type:y.SectionType.Binary},1029411:{name:"GammaValue",type:y.SectionType.Float},230371:{name:"FrameRate",type:y.SectionType.Float},97:{name:"Audio",type:y.SectionType.Container},53:{name:"SamplingFrequency",type:y.SectionType.Float},14517:{name:"OutputSamplingFrequency",type:y.SectionType.Float},31:{name:"Channels",type:y.SectionType.Uint},15739:{name:"ChannelPositions",type:y.SectionType.Binary},8804:{name:"BitDepth",type:y.SectionType.Uint},98:{name:"TrackOperation",type:y.SectionType.Container},99:{name:"TrackCombinePlanes",type:y.SectionType.Container},100:{name:"TrackPlane",type:y.SectionType.Container},101:{name:"TrackPlaneUID",type:y.SectionType.Uint},102:{name:"TrackPlaneType",type:y.SectionType.Uint},105:{name:"TrackJoinBlocks",type:y.SectionType.Container},109:{name:"TrackJoinUID",type:y.SectionType.Uint},64:{name:"TrickTrackUID",type:y.SectionType.Uint},65:{name:"TrickTrackSegmentUID",type:y.SectionType.Binary},70:{name:"TrickTrackFlag",type:y.SectionType.Uint},71:{name:"TrickMasterTrackUID",type:y.SectionType.Uint},68:{name:"TrickMasterTrackSegmentUID",type:y.SectionType.Binary},11648:{name:"ContentEncodings",type:y.SectionType.Container},8768:{name:"ContentEncoding",type:y.SectionType.Container},4145:{name:"ContentEncodingOrder",type:y.SectionType.Uint},4146:{name:"ContentEncodingScope",type:y.SectionType.Uint},4147:{name:"ContentEncodingType",type:y.SectionType.Uint},4148:{name:"ContentCompression",type:y.SectionType.Container},596:{name:"ContentCompAlgo",type:y.SectionType.Uint},597:{name:"ContentCompSettings",type:y.SectionType.Binary},4149:{name:"ContentEncryption",type:y.SectionType.Container},2017:{name:"ContentEncAlgo",type:y.SectionType.Uint},2018:{name:"ContentEncKeyID",type:y.SectionType.Binary},2019:{name:"ContentSignature",type:y.SectionType.Binary},2020:{name:"ContentSigKeyID",type:y.SectionType.Binary},2021:{name:"ContentSigAlgo",type:y.SectionType.Uint},2022:{name:"ContentSigHashAlgo",type:y.SectionType.Uint},206814059:{name:"Cues",type:y.SectionType.Container},59:{name:"CuePoint",type:y.SectionType.Container},51:{name:"CueTime",type:y.SectionType.Uint},55:{name:"CueTrackPositions",type:y.SectionType.Container},119:{name:"CueTrack",type:y.SectionType.Uint},113:{name:"CueClusterPosition",type:y.SectionType.Uint},112:{name:"CueRelativePosition",type:y.SectionType.Uint},50:{name:"CueDuration",type:y.SectionType.Uint},4984:{name:"CueBlockNumber",type:y.SectionType.Uint},106:{name:"CueCodecState",type:y.SectionType.Uint},91:{name:"CueReference",type:y.SectionType.Container},22:{name:"CueRefTime",type:y.SectionType.Uint},23:{name:"CueRefCluster",type:y.SectionType.Uint},4959:{name:"CueRefNumber",type:y.SectionType.Uint},107:{name:"CueRefCodecState",type:y.SectionType.Uint},155296873:{name:"Attachments",type:y.SectionType.Container},8615:{name:"AttachedFile",type:y.SectionType.Container},1662:{name:"FileDescription",type:y.SectionType.String},1646:{name:"FileName",type:y.SectionType.String},1632:{name:"FileMimeType",type:y.SectionType.String},1628:{name:"FileData",type:y.SectionType.Binary},1710:{name:"FileUID",type:y.SectionType.Uint},1653:{name:"FileReferral",type:y.SectionType.Binary},1633:{name:"FileUsedStartTime",type:y.SectionType.Uint},1634:{name:"FileUsedEndTime",type:y.SectionType.Uint},4433776:{name:"Chapters",type:y.SectionType.Container},1465:{name:"EditionEntry",type:y.SectionType.Container},1468:{name:"EditionUID",type:y.SectionType.Uint},1469:{name:"EditionFlagHidden",type:y.SectionType.Uint},1499:{name:"EditionFlagDefault",type:y.SectionType.Uint},1501:{name:"EditionFlagOrdered",type:y.SectionType.Uint},54:{name:"ChapterAtom",type:y.SectionType.Container},13252:{name:"ChapterUID",type:y.SectionType.Uint},5716:{name:"ChapterStringUID",type:y.SectionType.String},17:{name:"ChapterTimeStart",type:y.SectionType.Uint},18:{name:"ChapterTimeEnd",type:y.SectionType.Uint},24:{name:"ChapterFlagHidden",type:y.SectionType.Uint},1432:{name:"ChapterFlagEnabled",type:y.SectionType.Uint},11879:{name:"ChapterSegmentUID",type:y.SectionType.Binary},11964:{name:"ChapterSegmentEditionUID",type:y.SectionType.Uint},9155:{name:"ChapterPhysicalEquiv",type:y.SectionType.Uint},15:{name:"ChapterTrack",type:y.SectionType.Container},9:{name:"ChapterTrackNumber",type:y.SectionType.Uint},0:{name:"ChapterDisplay",type:y.SectionType.Container},5:{name:"ChapString",type:y.SectionType.String},892:{name:"ChapLanguage",type:y.SectionType.String},894:{name:"ChapCountry",type:y.SectionType.String},10564:{name:"ChapProcess",type:y.SectionType.Container},10581:{name:"ChapProcessCodecID",type:y.SectionType.Uint},1293:{name:"ChapProcessPrivate",type:y.SectionType.Binary},10513:{name:"ChapProcessCommand",type:y.SectionType.Container},10530:{name:"ChapProcessTime",type:y.SectionType.Uint},10547:{name:"ChapProcessData",type:y.SectionType.Binary},39109479:{name:"Tags",type:y.SectionType.Container},13171:{name:"Tag",type:y.SectionType.Container},9152:{name:"Targets",type:y.SectionType.Container},10442:{name:"TargetTypeValue",type:y.SectionType.Uint},9162:{name:"TargetType",type:y.SectionType.String},9157:{name:"TagTrackUID",type:y.SectionType.Uint},9161:{name:"TagEditionUID",type:y.SectionType.Uint},9156:{name:"TagChapterUID",type:y.SectionType.Uint},9158:{name:"TagAttachmentUID",type:y.SectionType.Uint},10184:{name:"SimpleTag",type:y.SectionType.Container},1443:{name:"TagName",type:y.SectionType.String},1146:{name:"TagLanguage",type:y.SectionType.String},1156:{name:"TagDefault",type:y.SectionType.Uint},1159:{name:"TagString",type:y.SectionType.String},1157:{name:"TagBinary",type:y.SectionType.Binary},5552:{name:"Colour",type:y.SectionType.Container},5553:{name:"MatrixCoefficients",type:y.SectionType.Uint},5554:{name:"BitsPerChannel",type:y.SectionType.Uint},5555:{name:"ChromaSubsamplingHorz",type:y.SectionType.Uint},5556:{name:"ChromaSubsamplingVert",type:y.SectionType.Uint},5557:{name:"CbSubsamplingHorz",type:y.SectionType.Uint},5558:{name:"CbSubsamplingVert",type:y.SectionType.Uint},5559:{name:"ChromaSitingHorz",type:y.SectionType.Uint},5560:{name:"ChromaSitingVert",type:y.SectionType.Uint},5561:{name:"Range",type:y.SectionType.Uint},5562:{name:"TransferCharacteristics",type:y.SectionType.Uint},5563:{name:"Primaries",type:y.SectionType.Uint},5564:{name:"MaxCLL",type:y.SectionType.Uint},5565:{name:"MaxFALL",type:y.SectionType.Uint}};});var id=Je(Ml=>{Object.defineProperty(Ml,"__esModule",{value:true});Ml.WebmUint=void 0;var mA=ui();function iw(e){return e.length%2===1?"0"+e:e}var od=class extends mA.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+=iw(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(iw(t.toString(16)));}};Ml.WebmUint=od;});var sd=Je(Nl=>{Object.defineProperty(Nl,"__esModule",{value:true});Nl.WebmFloat=void 0;var gA=ui(),ad=class extends gA.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();}};Nl.WebmFloat=ad;});var cd=Je(Ll=>{Object.defineProperty(Ll,"__esModule",{value:true});Ll.WebmString=void 0;var hA=ui(),ld=class extends hA.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}};Ll.WebmString=ld;});var dd=Je(Bl=>{Object.defineProperty(Bl,"__esModule",{value:true});Bl.WebmContainer=void 0;var aw=ui(),bA=nd(),$l=Rl(),yA=id(),vA=sd(),xA=cd(),ud=class e extends aw.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=bA.sections[o])!==null&&t!==void 0?t:{},s=this.readUint();r=this.source.length,s>=0&&(r=Math.min(this.offset+s,r));let c=this.source.slice(this.offset,r),l;switch(a){case $l.SectionType.Container:l=new e(i,s<0,n);break;case $l.SectionType.Uint:l=new yA.WebmUint(i,n);break;case $l.SectionType.Float:l=new vA.WebmFloat(i,n);break;case $l.SectionType.String:l=new xA.WebmString(i,n);break;default:l=new aw.WebmBase(i,n);break}l.setSource(c),this.data.push({id:o,idHex:o.toString(16),data:l});}}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}};Bl.WebmContainer=ud;});var sw=Je(Fl=>{Object.defineProperty(Fl,"__esModule",{value:true});Fl.WebmFile=void 0;var wA=(Ba(),Xa($a)),TA=dd(),fd=class e extends TA.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 wA.__awaiter(this,void 0,void 0,function*(){let r=yield e.blobToArray(t);return new e(r)})}};Fl.WebmFile=fd;});var cw=Je(lw=>{Object.defineProperty(lw,"__esModule",{value:true});});var pd=Je(Cr=>{Object.defineProperty(Cr,"__esModule",{value:true});var en=(Ba(),Xa($a));en.__exportStar(ui(),Cr);en.__exportStar(dd(),Cr);en.__exportStar(sw(),Cr);en.__exportStar(sd(),Cr);en.__exportStar(cd(),Cr);en.__exportStar(id(),Cr);en.__exportStar(Rl(),Cr);en.__exportStar(cw(),Cr);en.__exportStar(nd(),Cr);});var md=Je(Ul=>{Object.defineProperty(Ul,"__esModule",{value:true});Ul.fixParsedWebmDuration=void 0;var CA=pd(),_A=(e,t,r={})=>{let n=r.logger;n===void 0?n=c=>{}: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 CA.WebmFloat("Duration"),s.setValue(t),i.data.push({id:1161,data:s});return a.setValue(1e6),i.updateByData(),o.updateByData(),e.updateByData(),true};Ul.fixParsedWebmDuration=_A;});var uw=Je(jl=>{Object.defineProperty(jl,"__esModule",{value:true});jl.fixWebmDuration=void 0;var SA=(Ba(),Xa($a)),kA=pd(),PA=md(),EA=(e,t,r)=>SA.__awaiter(void 0,void 0,void 0,function*(){try{let n=yield kA.WebmFile.fromBlob(e);if((0,PA.fixParsedWebmDuration)(n,t,r))return n.toBlob(e.type)}catch{}return e});jl.fixWebmDuration=EA;});var fw=Je(Wl=>{Object.defineProperty(Wl,"__esModule",{value:true});var dw=(Ba(),Xa($a));dw.__exportStar(uw(),Wl);dw.__exportStar(md(),Wl);});var Bw=Je((Td,Cd)=>{(function(e,t){typeof Td=="object"&&typeof Cd<"u"?Cd.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.DOMPurify=t());})(Td,function(){let{entries:e,setPrototypeOf:t,isFrozen:r,getPrototypeOf:n,getOwnPropertyDescriptor:o}=Object,{freeze:i,seal:a,create:s}=Object,{apply:c,construct:l}=typeof Reflect<"u"&&Reflect;i||(i=function(ge){return ge}),a||(a=function(ge){return ge}),c||(c=function(ge,Ve,je){return ge.apply(Ve,je)}),l||(l=function(ge,Ve){return new ge(...Ve)});let u=I(Array.prototype.forEach),f=I(Array.prototype.pop),d=I(Array.prototype.push),p=I(String.prototype.toLowerCase),h=I(String.prototype.toString),g=I(String.prototype.match),v=I(String.prototype.replace),b=I(String.prototype.indexOf),C=I(String.prototype.trim),_=I(RegExp.prototype.test),k=B(TypeError);function I(Ne){return function(ge){for(var Ve=arguments.length,je=new Array(Ve>1?Ve-1:0),It=1;It<Ve;It++)je[It-1]=arguments[It];return c(Ne,ge,je)}}function B(Ne){return function(){for(var ge=arguments.length,Ve=new Array(ge),je=0;je<ge;je++)Ve[je]=arguments[je];return l(Ne,Ve)}}function D(Ne,ge){let Ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p;t&&t(Ne,null);let je=ge.length;for(;je--;){let It=ge[je];if(typeof It=="string"){let nn=Ve(It);nn!==It&&(r(ge)||(ge[je]=nn),It=nn);}Ne[It]=true;}return Ne}function oe(Ne){let ge=s(null);for(let[Ve,je]of e(Ne))o(Ne,Ve)!==void 0&&(ge[Ve]=je);return ge}function H(Ne,ge){for(;Ne!==null;){let je=o(Ne,ge);if(je){if(je.get)return I(je.get);if(typeof je.value=="function")return I(je.value)}Ne=n(Ne);}function Ve(je){return null}return Ve}let V=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"]),L=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"]),P=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"]),w=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"]),A=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),M=i(["#text"]),X=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"]),me=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"]),ee=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"]),Ue=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ae=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ut=a(/<%[\w\W]*|[\w\W]*%>/gm),Nt=a(/\${[\w\W]*}/gm),dt=a(/^data-[\-\w.\u00B7-\uFFFF]/),Lt=a(/^aria-[\-\w]+$/),Kt=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$t=a(/^(?:\w+script|data):/i),Ye=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Me=a(/^html$/i);var Et=Object.freeze({__proto__:null,MUSTACHE_EXPR:Ae,ERB_EXPR:ut,TMPLIT_EXPR:Nt,DATA_ATTR:dt,ARIA_ATTR:Lt,IS_ALLOWED_URI:Kt,IS_SCRIPT_OR_DATA:$t,ATTR_WHITESPACE:Ye,DOCTYPE_NAME:Me});let fo=function(){return typeof window>"u"?null:window},ja=function(ge,Ve){if(typeof ge!="object"||typeof ge.createPolicy!="function")return null;let je=null,It="data-tt-policy-suffix";Ve&&Ve.hasAttribute(It)&&(je=Ve.getAttribute(It));let nn="dompurify"+(je?"#"+je:"");try{return ge.createPolicy(nn,{createHTML(po){return po},createScriptURL(po){return po}})}catch{return null}};function gi(){let Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fo(),ge=le=>gi(le);if(ge.version="3.0.6",ge.removed=[],!Ne||!Ne.document||Ne.document.nodeType!==9)return ge.isSupported=false,ge;let{document:Ve}=Ne,je=Ve,It=je.currentScript,{DocumentFragment:nn,HTMLTemplateElement:po,Node:Kl,Element:Od,NodeFilter:Xl,NamedNodeMap:S0=Ne.NamedNodeMap||Ne.MozNamedAttrMap,HTMLFormElement:k0,DOMParser:P0,trustedTypes:Wa}=Ne,Ha=Od.prototype,E0=H(Ha,"cloneNode"),I0=H(Ha,"nextSibling"),A0=H(Ha,"childNodes"),Zl=H(Ha,"parentNode");if(typeof po=="function"){let le=Ve.createElement("template");le.content&&le.content.ownerDocument&&(Ve=le.content.ownerDocument);}let At,bi="",{implementation:Ql,createNodeIterator:O0,createDocumentFragment:R0,getElementsByTagName:D0}=Ve,{importNode:M0}=je,_r={};ge.isSupported=typeof e=="function"&&typeof Zl=="function"&&Ql&&Ql.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Jl,ERB_EXPR:ec,TMPLIT_EXPR:tc,DATA_ATTR:N0,ARIA_ATTR:L0,IS_SCRIPT_OR_DATA:$0,ATTR_WHITESPACE:Rd}=Et,{IS_ALLOWED_URI:Dd}=Et,mt=null,Md=D({},[...V,...L,...E,...w,...M]),gt=null,Nd=D({},[...X,...me,...ee,...Ue]),ot=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}})),yi=null,rc=null,Ld=true,nc=true,$d=false,Bd=true,mo=false,Sn=false,oc=false,ic=false,go=false,Va=false,za=false,Fd=true,Ud=false,B0="user-content-",ac=true,vi=false,ho={},bo=null,jd=D({},["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"]),Wd=null,Hd=D({},["audio","video","img","source","image","track"]),sc=null,Vd=D({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ga="http://www.w3.org/1998/Math/MathML",Ya="http://www.w3.org/2000/svg",Br="http://www.w3.org/1999/xhtml",yo=Br,lc=false,cc=null,F0=D({},[Ga,Ya,Br],h),kn=null,U0=["application/xhtml+xml","text/html"],j0="text/html",ht=null,vo=null,W0=Ve.createElement("form"),zd=function(S){return S instanceof RegExp||S instanceof Function},uc=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(vo&&vo===S)){if((!S||typeof S!="object")&&(S={}),S=oe(S),kn=U0.indexOf(S.PARSER_MEDIA_TYPE)===-1?kn=j0:kn=S.PARSER_MEDIA_TYPE,ht=kn==="application/xhtml+xml"?h:p,mt="ALLOWED_TAGS"in S?D({},S.ALLOWED_TAGS,ht):Md,gt="ALLOWED_ATTR"in S?D({},S.ALLOWED_ATTR,ht):Nd,cc="ALLOWED_NAMESPACES"in S?D({},S.ALLOWED_NAMESPACES,h):F0,sc="ADD_URI_SAFE_ATTR"in S?D(oe(Vd),S.ADD_URI_SAFE_ATTR,ht):Vd,Wd="ADD_DATA_URI_TAGS"in S?D(oe(Hd),S.ADD_DATA_URI_TAGS,ht):Hd,bo="FORBID_CONTENTS"in S?D({},S.FORBID_CONTENTS,ht):jd,yi="FORBID_TAGS"in S?D({},S.FORBID_TAGS,ht):{},rc="FORBID_ATTR"in S?D({},S.FORBID_ATTR,ht):{},ho="USE_PROFILES"in S?S.USE_PROFILES:false,Ld=S.ALLOW_ARIA_ATTR!==false,nc=S.ALLOW_DATA_ATTR!==false,$d=S.ALLOW_UNKNOWN_PROTOCOLS||false,Bd=S.ALLOW_SELF_CLOSE_IN_ATTR!==false,mo=S.SAFE_FOR_TEMPLATES||false,Sn=S.WHOLE_DOCUMENT||false,go=S.RETURN_DOM||false,Va=S.RETURN_DOM_FRAGMENT||false,za=S.RETURN_TRUSTED_TYPE||false,ic=S.FORCE_BODY||false,Fd=S.SANITIZE_DOM!==false,Ud=S.SANITIZE_NAMED_PROPS||false,ac=S.KEEP_CONTENT!==false,vi=S.IN_PLACE||false,Dd=S.ALLOWED_URI_REGEXP||Kt,yo=S.NAMESPACE||Br,ot=S.CUSTOM_ELEMENT_HANDLING||{},S.CUSTOM_ELEMENT_HANDLING&&zd(S.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ot.tagNameCheck=S.CUSTOM_ELEMENT_HANDLING.tagNameCheck),S.CUSTOM_ELEMENT_HANDLING&&zd(S.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ot.attributeNameCheck=S.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ot.allowCustomizedBuiltInElements=S.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),mo&&(nc=false),Va&&(go=true),ho&&(mt=D({},[...M]),gt=[],ho.html===true&&(D(mt,V),D(gt,X)),ho.svg===true&&(D(mt,L),D(gt,me),D(gt,Ue)),ho.svgFilters===true&&(D(mt,E),D(gt,me),D(gt,Ue)),ho.mathMl===true&&(D(mt,w),D(gt,ee),D(gt,Ue))),S.ADD_TAGS&&(mt===Md&&(mt=oe(mt)),D(mt,S.ADD_TAGS,ht)),S.ADD_ATTR&&(gt===Nd&&(gt=oe(gt)),D(gt,S.ADD_ATTR,ht)),S.ADD_URI_SAFE_ATTR&&D(sc,S.ADD_URI_SAFE_ATTR,ht),S.FORBID_CONTENTS&&(bo===jd&&(bo=oe(bo)),D(bo,S.FORBID_CONTENTS,ht)),ac&&(mt["#text"]=true),Sn&&D(mt,["html","head","body"]),mt.table&&(D(mt,["tbody"]),delete yi.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw k('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw k('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');At=S.TRUSTED_TYPES_POLICY,bi=At.createHTML("");}else At===void 0&&(At=ja(Wa,It)),At!==null&&typeof bi=="string"&&(bi=At.createHTML(""));i&&i(S),vo=S;}},Gd=D({},["mi","mo","mn","ms","mtext"]),Yd=D({},["foreignobject","desc","title","annotation-xml"]),H0=D({},["title","style","font","a","script"]),qa=D({},L);D(qa,E),D(qa,P);let dc=D({},w);D(dc,A);let V0=function(S){let W=Zl(S);(!W||!W.tagName)&&(W={namespaceURI:yo,tagName:"template"});let ie=p(S.tagName),qe=p(W.tagName);return cc[S.namespaceURI]?S.namespaceURI===Ya?W.namespaceURI===Br?ie==="svg":W.namespaceURI===Ga?ie==="svg"&&(qe==="annotation-xml"||Gd[qe]):!!qa[ie]:S.namespaceURI===Ga?W.namespaceURI===Br?ie==="math":W.namespaceURI===Ya?ie==="math"&&Yd[qe]:!!dc[ie]:S.namespaceURI===Br?W.namespaceURI===Ya&&!Yd[qe]||W.namespaceURI===Ga&&!Gd[qe]?false:!dc[ie]&&(H0[ie]||!qa[ie]):!!(kn==="application/xhtml+xml"&&cc[S.namespaceURI]):false},Pn=function(S){d(ge.removed,{element:S});try{S.parentNode.removeChild(S);}catch{S.remove();}},fc=function(S,W){try{d(ge.removed,{attribute:W.getAttributeNode(S),from:W});}catch{d(ge.removed,{attribute:null,from:W});}if(W.removeAttribute(S),S==="is"&&!gt[S])if(go||Va)try{Pn(W);}catch{}else try{W.setAttribute(S,"");}catch{}},qd=function(S){let W=null,ie=null;if(ic)S="<remove></remove>"+S;else {let Ct=g(S,/^[\r\n\t ]+/);ie=Ct&&Ct[0];}kn==="application/xhtml+xml"&&yo===Br&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");let qe=At?At.createHTML(S):S;if(yo===Br)try{W=new P0().parseFromString(qe,kn);}catch{}if(!W||!W.documentElement){W=Ql.createDocument(yo,"template",null);try{W.documentElement.innerHTML=lc?bi:qe;}catch{}}let Tt=W.body||W.documentElement;return S&&ie&&Tt.insertBefore(Ve.createTextNode(ie),Tt.childNodes[0]||null),yo===Br?D0.call(W,Sn?"html":"body")[0]:Sn?W.documentElement:Tt},Kd=function(S){return O0.call(S.ownerDocument||S,S,Xl.SHOW_ELEMENT|Xl.SHOW_COMMENT|Xl.SHOW_TEXT,null)},z0=function(S){return S instanceof k0&&(typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||!(S.attributes instanceof S0)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function")},Xd=function(S){return typeof Kl=="function"&&S instanceof Kl},Fr=function(S,W,ie){_r[S]&&u(_r[S],qe=>{qe.call(ge,W,ie,vo);});},Zd=function(S){let W=null;if(Fr("beforeSanitizeElements",S,null),z0(S))return Pn(S),true;let ie=ht(S.nodeName);if(Fr("uponSanitizeElement",S,{tagName:ie,allowedTags:mt}),S.hasChildNodes()&&!Xd(S.firstElementChild)&&_(/<[/\w]/g,S.innerHTML)&&_(/<[/\w]/g,S.textContent))return Pn(S),true;if(!mt[ie]||yi[ie]){if(!yi[ie]&&Jd(ie)&&(ot.tagNameCheck instanceof RegExp&&_(ot.tagNameCheck,ie)||ot.tagNameCheck instanceof Function&&ot.tagNameCheck(ie)))return false;if(ac&&!bo[ie]){let qe=Zl(S)||S.parentNode,Tt=A0(S)||S.childNodes;if(Tt&&qe){let Ct=Tt.length;for(let Bt=Ct-1;Bt>=0;--Bt)qe.insertBefore(E0(Tt[Bt],true),I0(S));}}return Pn(S),true}return S instanceof Od&&!V0(S)||(ie==="noscript"||ie==="noembed"||ie==="noframes")&&_(/<\/no(script|embed|frames)/i,S.innerHTML)?(Pn(S),true):(mo&&S.nodeType===3&&(W=S.textContent,u([Jl,ec,tc],qe=>{W=v(W,qe," ");}),S.textContent!==W&&(d(ge.removed,{element:S.cloneNode()}),S.textContent=W)),Fr("afterSanitizeElements",S,null),false)},Qd=function(S,W,ie){if(Fd&&(W==="id"||W==="name")&&(ie in Ve||ie in W0))return false;if(!(nc&&!rc[W]&&_(N0,W))){if(!(Ld&&_(L0,W))){if(!gt[W]||rc[W]){if(!(Jd(S)&&(ot.tagNameCheck instanceof RegExp&&_(ot.tagNameCheck,S)||ot.tagNameCheck instanceof Function&&ot.tagNameCheck(S))&&(ot.attributeNameCheck instanceof RegExp&&_(ot.attributeNameCheck,W)||ot.attributeNameCheck instanceof Function&&ot.attributeNameCheck(W))||W==="is"&&ot.allowCustomizedBuiltInElements&&(ot.tagNameCheck instanceof RegExp&&_(ot.tagNameCheck,ie)||ot.tagNameCheck instanceof Function&&ot.tagNameCheck(ie))))return false}else if(!sc[W]){if(!_(Dd,v(ie,Rd,""))){if(!((W==="src"||W==="xlink:href"||W==="href")&&S!=="script"&&b(ie,"data:")===0&&Wd[S])){if(!($d&&!_($0,v(ie,Rd,"")))){if(ie)return false}}}}}}return true},Jd=function(S){return S.indexOf("-")>0},ef=function(S){Fr("beforeSanitizeAttributes",S,null);let{attributes:W}=S;if(!W)return;let ie={attrName:"",attrValue:"",keepAttr:true,allowedAttributes:gt},qe=W.length;for(;qe--;){let Tt=W[qe],{name:Ct,namespaceURI:Bt,value:En}=Tt,xi=ht(Ct),Ft=Ct==="value"?En:C(En);if(ie.attrName=xi,ie.attrValue=Ft,ie.keepAttr=true,ie.forceKeepAttr=void 0,Fr("uponSanitizeAttribute",S,ie),Ft=ie.attrValue,ie.forceKeepAttr||(fc(Ct,S),!ie.keepAttr))continue;if(!Bd&&_(/\/>/i,Ft)){fc(Ct,S);continue}mo&&u([Jl,ec,tc],rf=>{Ft=v(Ft,rf," ");});let tf=ht(S.nodeName);if(Qd(tf,xi,Ft)){if(Ud&&(xi==="id"||xi==="name")&&(fc(Ct,S),Ft=B0+Ft),At&&typeof Wa=="object"&&typeof Wa.getAttributeType=="function"&&!Bt)switch(Wa.getAttributeType(tf,xi)){case "TrustedHTML":{Ft=At.createHTML(Ft);break}case "TrustedScriptURL":{Ft=At.createScriptURL(Ft);break}}try{Bt?S.setAttributeNS(Bt,Ct,Ft):S.setAttribute(Ct,Ft),f(ge.removed);}catch{}}}Fr("afterSanitizeAttributes",S,null);},G0=function le(S){let W=null,ie=Kd(S);for(Fr("beforeSanitizeShadowDOM",S,null);W=ie.nextNode();)Fr("uponSanitizeShadowNode",W,null),!Zd(W)&&(W.content instanceof nn&&le(W.content),ef(W));Fr("afterSanitizeShadowDOM",S,null);};return ge.sanitize=function(le){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=null,ie=null,qe=null,Tt=null;if(lc=!le,lc&&(le="<!-->"),typeof le!="string"&&!Xd(le))if(typeof le.toString=="function"){if(le=le.toString(),typeof le!="string")throw k("dirty is not a string, aborting")}else throw k("toString is not a function");if(!ge.isSupported)return le;if(oc||uc(S),ge.removed=[],typeof le=="string"&&(vi=false),vi){if(le.nodeName){let En=ht(le.nodeName);if(!mt[En]||yi[En])throw k("root node is forbidden and cannot be sanitized in-place")}}else if(le instanceof Kl)W=qd("<!---->"),ie=W.ownerDocument.importNode(le,true),ie.nodeType===1&&ie.nodeName==="BODY"||ie.nodeName==="HTML"?W=ie:W.appendChild(ie);else {if(!go&&!mo&&!Sn&&le.indexOf("<")===-1)return At&&za?At.createHTML(le):le;if(W=qd(le),!W)return go?null:za?bi:""}W&&ic&&Pn(W.firstChild);let Ct=Kd(vi?le:W);for(;qe=Ct.nextNode();)Zd(qe)||(qe.content instanceof nn&&G0(qe.content),ef(qe));if(vi)return le;if(go){if(Va)for(Tt=R0.call(W.ownerDocument);W.firstChild;)Tt.appendChild(W.firstChild);else Tt=W;return (gt.shadowroot||gt.shadowrootmode)&&(Tt=M0.call(je,Tt,true)),Tt}let Bt=Sn?W.outerHTML:W.innerHTML;return Sn&&mt["!doctype"]&&W.ownerDocument&&W.ownerDocument.doctype&&W.ownerDocument.doctype.name&&_(Me,W.ownerDocument.doctype.name)&&(Bt="<!DOCTYPE "+W.ownerDocument.doctype.name+`>
|
|
10
|
-
`+Bt),mo&&u([Jl,ec,tc],En=>{Bt=v(Bt,En," ");}),At&&za?At.createHTML(Bt):Bt},ge.setConfig=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};uc(le),oc=true;},ge.clearConfig=function(){vo=null,oc=false;},ge.isValidAttribute=function(le,S,W){vo||uc({});let ie=ht(le),qe=ht(S);return Qd(ie,qe,W)},ge.addHook=function(le,S){typeof S=="function"&&(_r[le]=_r[le]||[],d(_r[le],S));},ge.removeHook=function(le){if(_r[le])return f(_r[le])},ge.removeHooks=function(le){_r[le]&&(_r[le]=[]);},ge.removeAllHooks=function(){_r={};},ge}var hi=gi();return hi});});function eT(e){return Object.keys(e).reduce((r,n)=>{let o=e[n];return r[n]=Object.assign({},o),sf(o.value)&&!iT(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 tT(e){return e?Object.keys(e).reduce((r,n)=>{let o=e[n];return r[n]=sf(o)&&"value"in o?o:{value:o},r[n].attribute||(r[n].attribute=oT(n)),r[n].parse="parse"in r[n]?r[n].parse:typeof r[n].value!="string",r},{}):{}}function rT(e){return Object.keys(e).reduce((r,n)=>(r[n]=e[n].value,r),{})}function nT(e,t){let r=eT(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?af(a):a),s!=null&&(i.value=Array.isArray(s)?s.slice(0):s),i.reflect&&of(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(c){let l=i.value;i.value=c,i.reflect&&of(this,i.attribute,i.value,!!i.parse);for(let u=0,f=this.__propertyChangedCallbacks.length;u<f;u++)this.__propertyChangedCallbacks[u](o,c,l);},enumerable:true,configurable:true});}),r}function af(e){if(e)try{return JSON.parse(e)}catch{return e}}function of(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 oT(e){return e.replace(/\.?([A-Z]+)/g,(t,r)=>"-"+r.toLowerCase()).replace("_","-").replace(/^-/,"")}function sf(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function iT(e){return Object.prototype.toString.call(e)==="[object Function]"}function aT(e){return typeof e=="function"&&e.toString().indexOf("class")===0}var pc;function sT(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=nT(this,t);let o=rT(this.props),i=this.Component,a=pc;try{pc=this,this.__initialized=!0,aT(i)?new i(o,{element:this}):i(o,{element:this});}finally{pc=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?af(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 lf(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=sT(n,tT(t)),s.prototype.Component=a,s.prototype.registeredTag=e,i.define(e,s,o),s)}}var cT=(e,t)=>e===t,Xt=Symbol("solid-proxy"),gf=typeof Proxy=="function",es=Symbol("solid-track"),Qa={equals:cT},hf=Cf,Zt=1,wi=2,bf={owned:null,cleanups:null,context:null,owner:null};var ke=null,G=null,wo=null,ze=null,ft=null,_t=null,ts=0;function In(e,t){let r=ze,n=ke,o=e.length===0,i=t===void 0?n:t,a=o?bf:{owned:null,cleanups:null,context:i?i.context:null,owner:i},s=o?e:()=>e(()=>st(()=>on(a)));ke=a,ze=null;try{return dr(s,!0)}finally{ze=r,ke=n;}}function O(e,t){t=t?Object.assign({},Qa,t):Qa;let r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=o=>(typeof o=="function"&&(o=o(r.value)),Tf(r,o));return [wf.bind(r),n]}function R(e,t,r){let n=xc(e,t,false,Zt);_i(n);}function _e(e,t,r){hf=pT;let n=xc(e,t,false,Zt);(!r||!r.render)&&(n.user=true),_t?_t.push(n):_i(n);}function j(e,t,r){r=r?Object.assign({},Qa,r):Qa;let n=xc(e,t,true,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,_i(n),wf.bind(n)}function yf(e){return dr(e,false)}function st(e){if(ze===null)return e();let t=ze;ze=null;try{return wo?wo.untrack(e):e()}finally{ze=t;}}function de(e){_e(()=>st(e));}function he(e){return ke===null||(ke.cleanups===null?ke.cleanups=[e]:ke.cleanups.push(e)),e}function rs(){return ze}function To(){return ke}function vf(e,t){let r=ke,n=ze;ke=e,ze=null;try{return dr(t,!0)}catch(o){os(o);}finally{ke=r,ze=n;}}var[WR,df]=O(false);function xf(e,t){let r=Symbol("context");return {id:r,Provider:gT(r),defaultValue:e}}function vc(e){let t;return ke&&ke.context&&(t=ke.context[e.id])!==void 0?t:e.defaultValue}function ns(e){let t=j(e),r=j(()=>bc(t()));return r.toArray=()=>{let n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}function wf(){let e=G;if(this.sources&&(this.state))if((this.state)===Zt)_i(this);else {let t=ft;ft=null,dr(()=>Ja(this),false),ft=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&&G.sources.has(this)?this.tValue:this.value}function Tf(e,t,r){let n=e.value;if(!e.comparator||!e.comparator(n,t)){e.value=t;e.observers&&e.observers.length&&dr(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],a=G&&G.running;a&&G.disposed.has(i)||((a?!i.tState:!i.state)&&(i.pure?ft.push(i):_t.push(i),i.observers&&_f(i)),a?i.tState=Zt:i.state=Zt);}if(ft.length>1e6)throw ft=[],new Error},false);}return t}function _i(e){if(!e.fn)return;on(e);let t=ts;ff(e,e.value,t);}function ff(e,t,r){let n,o=ke,i=ze;ze=ke=e;try{n=e.fn(t);}catch(a){return e.pure&&((e.state=Zt,e.owned&&e.owned.forEach(on),e.owned=null)),e.updatedAt=r+1,os(a)}finally{ze=i,ke=o;}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?Tf(e,n):e.value=n,e.updatedAt=r);}function xc(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:ke,context:ke?ke.context:null,pure:r};if(ke===null||ke!==bf&&(ke.owned?ke.owned.push(i):ke.owned=[i]),wo);return i}function Ti(e){let t=G;if((e.state)===0)return;if((e.state)===wi)return Ja(e);if(e.suspense&&st(e.suspense.inFallback))return e.suspense.effects.push(e);let r=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ts);){(e.state)&&r.push(e);}for(let n=r.length-1;n>=0;n--){if(e=r[n],t);if((e.state)===Zt)_i(e);else if((e.state)===wi){let o=ft;ft=null,dr(()=>Ja(e,r[0]),false),ft=o;}}}function dr(e,t){if(ft)return e();let r=false;t||(ft=[]),_t?r=true:_t=[],ts++;try{let n=e();return dT(r),n}catch(n){r||(_t=null),ft=null,os(n);}}function dT(e){if(ft&&(Cf(ft),ft=null),e)return;let r=_t;_t=null,r.length&&dr(()=>hf(r),false);}function Cf(e){for(let t=0;t<e.length;t++)Ti(e[t]);}function pT(e){let t,r=0;for(t=0;t<e.length;t++){let n=e[t];n.user?e[r++]=n:Ti(n);}for(t=0;t<r;t++)Ti(e[t]);}function Ja(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<ts)&&Ti(o):i===wi&&Ja(o,t);}}}function _f(e){for(let r=0;r<e.observers.length;r+=1){let n=e.observers[r];(!n.state)&&(n.state=wi,n.pure?ft.push(n):_t.push(n),n.observers&&_f(n));}}function on(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--)on(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)on(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 mT(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function os(e,t=ke){let n=mT(e);throw n;}function bc(e){if(typeof e=="function"&&!e.length)return bc(e());if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++){let n=bc(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n);}return t}return e}function gT(e,t){return function(n){let o;return R(()=>o=st(()=>(ke.context={...ke.context,[e]:n.value},ns(()=>n.children))),void 0),o}}var hT=Symbol("fallback");function mf(e){for(let t=0;t<e.length;t++)e[t]();}function bT(e,t,r={}){let n=[],o=[],i=[],a=0,s=t.length>1?[]:null;return he(()=>mf(i)),()=>{let c=e()||[],l=c.length,u,f;return c[es],st(()=>{let p,h,g,v,b,C,_,k,I;if(l===0)a!==0&&(mf(i),i=[],n=[],o=[],a=0,s&&(s=[])),r.fallback&&(n=[hT],o[0]=In(B=>(i[0]=B,r.fallback())),a=1);else if(a===0){for(o=new Array(l),f=0;f<l;f++)n[f]=c[f],o[f]=In(d);a=l;}else {for(g=new Array(l),v=new Array(l),s&&(b=new Array(l)),C=0,_=Math.min(a,l);C<_&&n[C]===c[C];C++);for(_=a-1,k=l-1;_>=C&&k>=C&&n[_]===c[k];_--,k--)g[k]=o[_],v[k]=i[_],s&&(b[k]=s[_]);for(p=new Map,h=new Array(k+1),f=k;f>=C;f--)I=c[f],u=p.get(I),h[f]=u===void 0?-1:u,p.set(I,f);for(u=C;u<=_;u++)I=n[u],f=p.get(I),f!==void 0&&f!==-1?(g[f]=o[u],v[f]=i[u],s&&(b[f]=s[u]),f=h[f],p.set(I,f)):i[u]();for(f=C;f<l;f++)f in g?(o[f]=g[f],i[f]=v[f],s&&(s[f]=b[f],s[f](f))):o[f]=In(d);o=o.slice(0,a=l),n=c.slice(0);}return o});function d(p){if(i[f]=p,s){let[h,g]=O(f);return s[f]=g,t(c[f],h)}return t(c[f])}}}function m(e,t){return st(()=>e(t||{}))}function Za(){return true}var yc={get(e,t,r){return t===Xt?r:e.get(t)},has(e,t){return t===Xt?true:e.has(t)},set:Za,deleteProperty:Za,getOwnPropertyDescriptor(e,t){return {configurable:true,enumerable:true,get(){return e.get(t)},set:Za,deleteProperty:Za}},ownKeys(e){return e.keys()}};function mc(e){return (e=typeof e=="function"?e():e)?e:{}}function vT(){for(let e=0,t=this.length;e<t;++e){let r=this[e]();if(r!==void 0)return r}}function Oe(...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,j(s)):s;}if(gf&&t)return new Proxy({get(a){for(let s=e.length-1;s>=0;s--){let c=mc(e[s])[a];if(c!==void 0)return c}},has(a){for(let s=e.length-1;s>=0;s--)if(a in mc(e[s]))return true;return false},keys(){let a=[];for(let s=0;s<e.length;s++)a.push(...Object.keys(mc(e[s])));return [...new Set(a)]}},yc);let r={},n=Object.create(null);for(let a=e.length-1;a>=0;a--){let s=e[a];if(!s)continue;let c=Object.getOwnPropertyNames(s);for(let l=c.length-1;l>=0;l--){let u=c[l];if(u==="__proto__"||u==="constructor")continue;let f=Object.getOwnPropertyDescriptor(s,u);if(!n[u])n[u]=f.get?{enumerable:true,configurable:true,get:vT.bind(r[u]=[f.get.bind(s)])}:f.value!==void 0?f:void 0;else {let d=r[u];d&&(f.get?d.push(f.get.bind(s)):f.value!==void 0&&d.push(()=>f.value));}}}let o={},i=Object.keys(n);for(let a=i.length-1;a>=0;a--){let s=i[a],c=n[s];c&&c.get?Object.defineProperty(o,s,c):o[s]=c?c.value:void 0;}return o}function tt(e,...t){if(gf&&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)}},yc));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))}},yc)),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,c=0;for(let l of t)l.includes(o)&&(s=true,a?n[c][o]=i.value:Object.defineProperty(n[c],o,i)),++c;s||(a?r[o]=i.value:Object.defineProperty(r,o,i));}return [...n,r]}var xT=0;function Sr(){return `cl-${xT++}`}var kf=e=>`Stale read from <${e}>.`;function Se(e){let t="fallback"in e&&{fallback:()=>e.fallback};return j(bT(()=>e.each,e.children,t||void 0))}function F(e){let t=e.keyed,r=j(()=>e.when,void 0,{equals:(n,o)=>t?n===o:!n==!o});return j(()=>{let n=r();if(n){let o=e.children;return typeof o=="function"&&o.length>0?st(()=>o(t?n:()=>{if(!st(r))throw kf("Show");return e.when})):o}return e.fallback},void 0,void 0)}function We(e){let t=false,r=(i,a)=>(t?i[1]===a[1]:!i[1]==!a[1])&&i[2]===a[2],n=ns(()=>e.children),o=j(()=>{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 j(()=>{let[i,a,s]=o();if(i<0)return e.fallback;let c=s.children;return typeof c=="function"&&c.length>0?st(()=>c(t?a:()=>{if(st(o)[0]!==i)throw kf("Match");return s.when})):c},void 0,void 0)}function te(e){return e}var wT=["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"],TT=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...wT]),CT=new Set(["innerHTML","textContent","innerText","children"]),_T=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),ST=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 kT(e,t){let r=ST[e];return typeof r=="object"?r[t]?r.$:void 0:r}var PT=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ET=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"]),IT={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function AT(e,t,r){let n=r.length,o=t.length,i=n,a=0,s=0,c=t[o-1].nextSibling,l=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]:c;for(;s<i;)e.insertBefore(r[s++],u);}else if(i===s)for(;a<o;)(!l||!l.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(!l){l=new Map;let f=s;for(;f<i;)l.set(r[f],f++);}let u=l.get(t[a]);if(u!=null)if(s<u&&u<i){let f=a,d=1,p;for(;++f<o&&f<i&&!((p=l.get(t[f]))==null||p!==u+d);)d++;if(d>u-s){let h=t[a];for(;s<u;)e.insertBefore(r[s++],h);}else e.replaceChild(r[s++],t[a++]);}else a++;else t[a++].remove();}}}var Pf="_$DX_DELEGATE";function T(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 Xe(e,t=window.document){let r=t[Pf]||(t[Pf]=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,$T));}}function z(e,t,r){(r==null?e.removeAttribute(t):e.setAttribute(t,r));}function OT(e,t,r,n){(n==null?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n));}function RT(e,t,r){(r?e.setAttribute(t,""):e.removeAttribute(t));}function U(e,t){(t==null?e.removeAttribute("class"):e.className=t);}function rt(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 DT(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]||(Ef(e,s,false),delete r[s]);}for(i=0,a=n.length;i<a;i++){let s=n[i],c=!!t[s];!s||s==="undefined"||r[s]===c||!c||(Ef(e,s,true),r[s]=c);}return r}function Tc(e,t,r){if(!t)return r?z(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 Re(e,t={},r,n){let o={};return n||R(()=>o.children=_o(e,t.children,o.children)),R(()=>typeof t.ref=="function"&&ye(t.ref,e)),R(()=>MT(e,t,r,true,o,true)),o}function ye(e,t,r){return st(()=>e(t,r))}function x(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return _o(e,t,n,r);R(o=>_o(e,t(),o,r),n);}function MT(e,t,r,n,o={},i=false){t||(t={});for(let a in o)if(!(a in t)){if(a==="children")continue;o[a]=If(e,a,null,o[a],r,i,t);}for(let a in t){if(a==="children"){continue}let s=t[a];o[a]=If(e,a,s,o[a],r,i,t);}}function LT(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function Ef(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 If(e,t,r,n,o,i,a){let s,c,l,u,f;if(t==="style")return Tc(e,r,n);if(t==="classList")return DT(e,r,n);if(r===n)return n;if(t==="ref")i||r(e);else if(t.slice(0,3)==="on:"){let d=t.slice(3);n&&e.removeEventListener(d,n,typeof n!="function"&&n),r&&e.addEventListener(d,r,typeof r!="function"&&r);}else if(t.slice(0,10)==="oncapture:"){let d=t.slice(10);n&&e.removeEventListener(d,n,true),r&&e.addEventListener(d,r,true);}else if(t.slice(0,2)==="on"){let d=t.slice(2).toLowerCase(),p=PT.has(d);if(!p&&n){let h=Array.isArray(n)?n[0]:n;e.removeEventListener(d,h);}(p||r)&&(rt(e,d,r,p),p&&Xe([d]));}else if(t.slice(0,5)==="attr:")z(e,t.slice(5),r);else if(t.slice(0,5)==="bool:")RT(e,t.slice(5),r);else if((f=t.slice(0,5)==="prop:")||(l=CT.has(t))||!o&&((u=kT(t,e.tagName))||(c=TT.has(t)))||(s=e.nodeName.includes("-")||"is"in a)){if(f)t=t.slice(5),c=true;t==="class"||t==="className"?U(e,r):s&&!c&&!l?e[LT(t)]=r:e[u||t]=r;}else {let d=o&&t.indexOf(":")>-1&&IT[t.split(":")[0]];d?OT(e,d,t,r):z(e,_T[t]||t,r);}return r}function $T(e){let t=e.target,r=`$$${e.type}`,n=e.target,o=e.currentTarget,i=c=>Object.defineProperty(e,"target",{configurable:true,value:c}),a=()=>{let c=t[r];if(c&&!t.disabled){let l=t[`${r}Data`];if(l!==void 0?c.call(t,l,e):c.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 c=e.composedPath();i(c[0]);for(let l=0;l<c.length-2&&(t=c[l],!!a());l++){if(t._$host){t=t._$host,s();break}if(t.parentNode===o)break}}else s();i(n);}function _o(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 c=r[0];c&&c.nodeType===3?c.data!==t&&(c.data=t):c=document.createTextNode(t),r=Co(e,r,n,c);}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 R(()=>{let c=t();for(;typeof c=="function";)c=c();r=_o(e,c,r,n);}),()=>r;if(Array.isArray(t)){let c=[],l=r&&Array.isArray(r);if(wc(c,t,r,o))return R(()=>r=_o(e,c,r,n,true)),()=>r;if(c.length===0){if(r=Co(e,r,n),s)return r}else l?r.length===0?Af(e,c,n):AT(e,r,c):(r&&Co(e),Af(e,c));r=c;}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 wc(e,t,r,n){let o=false;for(let i=0,a=t.length;i<a;i++){let s=t[i],c=r&&r[e.length],l;if(!(s==null||s===true||s===false))if((l=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))o=wc(e,s,c)||o;else if(l==="function")if(n){for(;typeof s=="function";)s=s();o=wc(e,Array.isArray(s)?s:[s],Array.isArray(c)?c:[c])||o;}else e.push(s),o=true;else {let u=String(s);c&&c.nodeType===3&&c.data===u?e.push(c):e.push(document.createTextNode(u));}}return o}function Af(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 c=s.parentNode===e;!i&&!a?c?e.replaceChild(o,s):e.insertBefore(o,r):c&&s.remove();}else i=true;}}else e.insertBefore(o,r);return [o]}var FT="http://www.w3.org/2000/svg";function Of(e,t=false){return t?document.createElementNS(FT,e):document.createElement(e)}function Rf(e){let {useShadow:t}=e,r=document.createTextNode(""),n=()=>e.mount||document.body,o=To(),i;return _e(()=>{i||(i=vf(o,()=>j(()=>e.children)));let s=n();if(s instanceof HTMLHeadElement){let[c,l]=O(false),u=()=>l(true);In(f=>x(s,()=>c()?f():i(),null)),he(u);}else {let c=Of(e.isSVG?"g":"div",e.isSVG),l=t&&c.attachShadow?c.attachShadow({mode:"open"}):c;Object.defineProperty(c,"_$host",{get(){return r.parentNode},configurable:true}),x(l,i),s.appendChild(c),e.ref&&e.ref(c),he(()=>s.removeChild(c));}},void 0,{render:true}),r}function Df(e){let[t,r]=tt(e,["component"]),n=j(()=>t.component);return j(()=>{let o=n();switch(typeof o){case "function":return st(()=>o(r));case "string":let i=ET.has(o),a=Of(o,i);return Re(a,r,i),a}})}function UT(e){let t=Object.keys(e),r={};for(let n=0;n<t.length;n++){let[o,i]=O(e[t[n]]);Object.defineProperty(r,t[n],{get:o,set(a){i(()=>a);}});}return r}function jT(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 WT(e){return (t,r)=>{let{element:n}=r;return In(o=>{let i=UT(t);n.addPropertyChangedCallback((s,c)=>i[s]=c),n.addReleaseCallback(()=>{n.renderRoot.textContent="",o();});let a=e(i,r);return x(n.renderRoot,a)},jT(n))}}function is(e,t,r){return arguments.length===2&&(r=t,t={}),lf(e,t)(WT(r))}var as={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},Mf={...as,onClose:void 0,onOpen:void 0,theme:void 0,autoShowDelay:void 0,isOpen:void 0,defaultOpen:void 0},Nf={...as,onClose:void 0,onOpen:void 0,theme:void 0,previewMessage:void 0,onPreviewMessageClick:void 0,onPreviewMessageDismissed:void 0,autoShowDelay:void 0};var Lf=e=>{sessionStorage.setItem("agentPaymentInProgress",JSON.stringify(e));},So=()=>sessionStorage.getItem("agentPaymentInProgress"),ss=()=>{sessionStorage.removeItem("agentPaymentInProgress");};var ko=class extends Error{constructor(t){super("This agent can only be executed on "+t);}};var kr=(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 HT="https://r0.ar",Ut=({ignoreChatApiUrl:e}={ignoreChatApiUrl:false})=>{let t=kr("NEXT_PUBLIC_CHAT_API_URL"),r=kr("NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON")?.split(",");if(!e&&t&&(!r||r.some(i=>i===window.location.href)))return t;let n=kr("NEXT_PUBLIC_VIEWER_URL")?.split(",");return n?.find(i=>window.location.href.startsWith(i))??n?.[0]??HT};function $f(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=$f(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=$f(e))&&(n&&(n+=" "),n+=t);return n}var xe=Qt;var Sc="-",VT=e=>{let t=GT(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return {getClassGroupId:a=>{let s=a.split(Sc);return s[0]===""&&s.length!==1&&s.shift(),Uf(s,t)||zT(a)},getConflictingClassGroupIds:(a,s)=>{let c=r[a]||[];return s&&n[a]?[...c,...n[a]]:c}}},Uf=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],n=t.nextPart.get(r),o=n?Uf(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;let i=e.join(Sc);return t.validators.find(({validator:a})=>a(i))?.classGroupId},Bf=/^\[(.+)\]$/,zT=e=>{if(Bf.test(e)){let t=Bf.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return "arbitrary.."+r}},GT=e=>{let{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return qT(Object.entries(e.classGroups),r).forEach(([i,a])=>{_c(a,n,i,t);}),n},_c=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){let i=o===""?t:Ff(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(YT(o)){_c(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,a])=>{_c(a,Ff(t,i),r,n);});});},Ff=(e,t)=>{let r=e;return t.split(Sc).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n);}),r},YT=e=>e.isThemeGetter,qT=(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,KT=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);}}},jf="!",XT=e=>{let{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],i=t.length,a=s=>{let c=[],l=0,u=0,f;for(let v=0;v<s.length;v++){let b=s[v];if(l===0){if(b===o&&(n||s.slice(v,v+i)===t)){c.push(s.slice(u,v)),u=v+i;continue}if(b==="/"){f=v;continue}}b==="["?l++:b==="]"&&l--;}let d=c.length===0?s:s.substring(u),p=d.startsWith(jf),h=p?d.substring(1):d,g=f&&f>u?f-u:void 0;return {modifiers:c,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:g}};return r?s=>r({className:s,parseClassName:a}):a},ZT=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},QT=e=>({cache:KT(e.cacheSize),parseClassName:XT(e),...VT(e)}),JT=/\s+/,eC=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(JT),s="";for(let c=a.length-1;c>=0;c-=1){let l=a[c],{modifiers:u,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:p}=r(l),h=!!p,g=n(h?d.substring(0,p):d);if(!g){if(!h){s=l+(s.length>0?" "+s:s);continue}if(g=n(d),!g){s=l+(s.length>0?" "+s:s);continue}h=false;}let v=ZT(u).join(":"),b=f?v+jf:v,C=b+g;if(i.includes(C))continue;i.push(C);let _=o(g,h);for(let k=0;k<_.length;++k){let I=_[k];i.push(b+I);}s=l+(s.length>0?" "+s:s);}return s};function tC(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Wf(t))&&(n&&(n+=" "),n+=r);return n}var Wf=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Wf(e[n]))&&(r&&(r+=" "),r+=t);return r};function rC(e,...t){let r,n,o,i=a;function a(c){let l=t.reduce((u,f)=>f(u),e());return r=QT(l),n=r.cache.get,o=r.cache.set,i=s,s(c)}function s(c){let l=n(c);if(l)return l;let u=eC(c,r);return o(c,u),u}return function(){return i(tC.apply(null,arguments))}}var Ze=e=>{let t=r=>r[e]||[];return t.isThemeGetter=true,t},Hf=/^\[(?:([a-z-]+):)?(.+)\]$/i,nC=/^\d+\/\d+$/,oC=new Set(["px","full","screen"]),iC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aC=/\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$/,sC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,lC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ur=e=>Po(e)||oC.has(e)||nC.test(e),an=e=>Eo(e,"length",bC),Po=e=>!!e&&!Number.isNaN(Number(e)),Cc=e=>Eo(e,"number",Po),Si=e=>!!e&&Number.isInteger(Number(e)),uC=e=>e.endsWith("%")&&Po(e.slice(0,-1)),Te=e=>Hf.test(e),sn=e=>iC.test(e),dC=new Set(["length","size","percentage"]),fC=e=>Eo(e,dC,Vf),pC=e=>Eo(e,"position",Vf),mC=new Set(["image","url"]),gC=e=>Eo(e,mC,vC),hC=e=>Eo(e,"",yC),ki=()=>true,Eo=(e,t,r)=>{let n=Hf.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):false},bC=e=>aC.test(e)&&!sC.test(e),Vf=()=>false,yC=e=>lC.test(e),vC=e=>cC.test(e);var xC=()=>{let e=Ze("colors"),t=Ze("spacing"),r=Ze("blur"),n=Ze("brightness"),o=Ze("borderColor"),i=Ze("borderRadius"),a=Ze("borderSpacing"),s=Ze("borderWidth"),c=Ze("contrast"),l=Ze("grayscale"),u=Ze("hueRotate"),f=Ze("invert"),d=Ze("gap"),p=Ze("gradientColorStops"),h=Ze("gradientColorStopPositions"),g=Ze("inset"),v=Ze("margin"),b=Ze("opacity"),C=Ze("padding"),_=Ze("saturate"),k=Ze("scale"),I=Ze("sepia"),B=Ze("skew"),D=Ze("space"),oe=Ze("translate"),H=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",Te,t],E=()=>[Te,t],P=()=>["",Ur,an],w=()=>["auto",Po,Te],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>["start","end","center","between","around","evenly","stretch"],ee=()=>["","0",Te],Ue=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ae=()=>[Po,Te];return {cacheSize:500,separator:":",theme:{colors:[ki],spacing:[Ur,an],blur:["none","",sn,Te],brightness:Ae(),borderColor:[e],borderRadius:["none","","full",sn,Te],borderSpacing:E(),borderWidth:P(),contrast:Ae(),grayscale:ee(),hueRotate:Ae(),invert:ee(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[uC,an],inset:L(),margin:L(),opacity:Ae(),padding:E(),saturate:Ae(),scale:Ae(),sepia:ee(),skew:Ae(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",Te]}],container:["container"],columns:[{columns:[sn]}],"break-after":[{"break-after":Ue()}],"break-before":[{"break-before":Ue()}],"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:[...A(),Te]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],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",Si,Te]}],basis:[{basis:L()}],"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:ee()}],shrink:[{shrink:ee()}],order:[{order:["first","last","none",Si,Te]}],"grid-cols":[{"grid-cols":[ki]}],"col-start-end":[{col:["auto",{span:["full",Si,Te]},Te]}],"col-start":[{"col-start":w()}],"col-end":[{"col-end":w()}],"grid-rows":[{"grid-rows":[ki]}],"row-start-end":[{row:["auto",{span:[Si,Te]},Te]}],"row-start":[{"row-start":w()}],"row-end":[{"row-end":w()}],"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:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...me()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...me(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...me(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"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:[sn]},sn]}],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",sn,an]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Cc]}],"font-family":[{font:[ki]}],"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",Po,Cc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ur,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":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ur,an]}],"underline-offset":[{"underline-offset":["auto",Ur,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":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),pC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},gC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"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":[b]}],"border-style":[{border:[...M(),"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":[b]}],"divide-style":[{divide:M()}],"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:["",...M()]}],"outline-offset":[{"outline-offset":[Ur,Te]}],"outline-w":[{outline:[Ur,an]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Ur,an]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",sn,hC]}],"shadow-color":[{shadow:[ki]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",sn,Te]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[_]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"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:Ae()}],ease:[{ease:["linear","in","out","in-out",Te]}],delay:[{delay:Ae()}],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:[Si,Te]}],"translate-x":[{"translate-x":[oe]}],"translate-y":[{"translate-y":[oe]}],"skew-x":[{"skew-x":[B]}],"skew-y":[{"skew-y":[B]}],"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:[Ur,an,Cc]}],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 zf=rC(xC);xo(Up());xo(Wp());var Hp=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"&&fe(e.body)?{"Content-Type":"application/json"}:void 0,body:typeof e!="string"&&fe(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}}},fe=e=>e!=null,lt=e=>e==null,et=e=>e==null||e==="",Le=e=>e!=null&&e!=="";var Vp=e=>{e.split("</noscript>").forEach(r=>{let[n,o]=r.split("<noscript>"),i=document.createRange().createContextualFragment(n??"");if(document.head.append(i),lt(o))return;let a=document.createElement("noscript"),s=document.createRange().createContextualFragment(o);a.append(s),document.head.append(a);});};var fr=e=>e?.startsWith("data:image/svg")||e?.endsWith(".svg");var Pr=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 Mo=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 Ri=e=>e!==null&&typeof e=="object";var Di=(...e)=>{for(let t of e)if((!Ri(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return fs({},...e)},Dc=(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},fs=(...e)=>{let t={},r={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(Ri(n)){for(let[o,i]of Object.entries(n))Ri(i)&&o in t&&(i=fs(t[o],i)),t={...t,[o]:i};Ri(n.headers)&&(r=Dc(r,n.headers),t.headers=r);}return t};var zp=(()=>{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})(),Gp=typeof globalThis.AbortController=="function",Yp=typeof globalThis.ReadableStream=="function",qp=typeof globalThis.FormData=="function",ps=["get","post","put","patch","head","delete"];var Kp={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},ms=2147483647,gs=Symbol("stop"),Xp={json:true,parseJson:true,searchParams:true,prefixUrl:true,retry:true,timeout:true,hooks:true,throwHttpErrors:true,onDownloadProgress:true,fetch:true},Zp={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 Jp=e=>ps.includes(e)?e.toUpperCase():e,d_=["get","put","head","delete","options","trace"],f_=[408,413,429,500,502,503,504],em=[413,429,503],Qp={limit:2,methods:d_,statusCodes:f_,afterStatusCodes:em,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},tm=(e={})=>{if(typeof e=="number")return {...Qp,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 {...Qp,...e,afterStatusCodes:em}};async function Mc(e,t,r,n){return new Promise((o,i)=>{let a=setTimeout(()=>{r&&r.abort(),i(new Mo(e));},n.timeout);n.fetch(e,t).then(o).catch(i).then(()=>{clearTimeout(a);});})}async function Nc(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 rm=(e,t)=>{let r={};for(let n in t)!(n in Zp)&&!(n in Xp)&&!(n in e)&&(r[n]=t[n]);return r};var Mi=class e{static create(t,r){let n=new e(t,r),o=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>ms)throw new RangeError(`The \`timeout\` option cannot be greater than ${ms}`);await Promise.resolve();let s=await n._fetch();for(let c of n._options.hooks.afterResponse){let l=await c(n.request,n._options,n._decorateResponse(s.clone()));l instanceof globalThis.Response&&(s=l);}if(n._decorateResponse(s),!s.ok&&n._options.throwHttpErrors){let c=new Pr(s,n.request,n._options);for(let l of n._options.hooks.beforeError)c=await l(c);throw c}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Yp)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,c]of Object.entries(Kp))a[s]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||c);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:Dc(this._input.headers,r.headers),hooks:fs({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Jp(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:tm(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(Gp){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(zp&&(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);(qp&&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 Mo)){if(t instanceof Pr){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),ms);if(n!==0&&this._retryCount>0){await Nc(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})===gs)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=rm(this.request,this._options);return this._options.timeout===false?this._options.fetch(this.request.clone(),t):Mc(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:c,value:l}=await a.read();if(c){i.close();return}if(r){o+=l.byteLength;let u=n===0?0:o/n;r({percent:u,transferredBytes:o,totalBytes:n},l);}i.enqueue(l),await s();}await s();}}),{status:t.status,statusText:t.statusText,headers:t.headers})}};var Lc=e=>{let t=(r,n)=>Mi.create(r,Di(e,n));for(let r of ps)t[r]=(n,o)=>Mi.create(n,Di(e,o,{method:r}));return t.create=r=>Lc(Di(r)),t.extend=r=>Lc(Di(e,r)),t.stop=gs,t},p_=Lc(),un=p_;async function nm({agent:e,isPreview:t,apiHost:r,prefilledVariables:n,resultId:o,stripeRedirectStatus:i,startFrom:a,sessionId:s}){if(lt(e))throw new Error("Agent is required to start the chat");let c=So()??void 0,l=c?JSON.parse(c):void 0;if(l)return m_({apiHost:r,stripeRedirectStatus:i,paymentInProgressState:l});let u=typeof e=="string"?e:e.id;if(t)return g_({apiHost:r,agentId:u,startFrom:a,agent:e,prefilledVariables:n,sessionId:s});try{let f=parent!==window&&Le(document.referrer)?new URL(document.referrer).origin:void 0,d=await un.post(`${$c(r)}/api/v1/agents/${u}/startChat`,{headers:{"x-agent-iframe-referrer-origin":f},json:{isStreamEnabled:!0,prefilledVariables:n,resultId:o,isOnlyRegistering:!1},timeout:!1}),p=d.headers.get("access-control-allow-origin");if(f&&p&&p!=="*"&&!f.includes(p))throw new ko(p);return {data:await d.json()}}catch(f){return {error:f}}}var m_=async({apiHost:e,stripeRedirectStatus:t,paymentInProgressState:r})=>{ss();try{return {data:{...await un.post(`${$c(e)}/api/v1/sessions/${r.sessionId}/continueChat`,{json:{message:t==="failed"?"fail":"Success"},timeout:!1}).json(),...r}}}catch(n){return {error:n}}},g_=async({apiHost:e,agentId:t,startFrom:r,agent:n,prefilledVariables:o,sessionId:i})=>{try{return {data:await un.post(`${$c(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}}},$c=e=>Le(e)?e:Ut();var[om,im]=O("100%");var[fM,am]=O();var hs="#303235",bs="#FFFFFF",sm="Google",No="Open Sans",Lo="Color",Ni="#ffffff";var lm="#000",cm="#000",um=2,ys="absolute",dm="Top",Rn="medium",Ot=1,fm=0,pm="800px",mm="100%",Li="transparent";var $o="#F7F8FF",gm=hs,hm="#CCC",bm=bs,$i="#0042DA",ym=bs,vm=1;var xm="#FFFFFF",Bi=hs,wm="#9095A0",Tm="md";var Bo=true,Fi=false;var h_="https://fonts.bunny.net/css2",vs="agent-font",Bc=e=>{let t=document.getElementById(vs);if(typeof e=="string"||e.type==="Google"){let r=(typeof e=="string"?e:e.family)??No;if(t?.getAttribute("href")?.includes(r))return;t?.remove();let n=document.createElement("link");n.href=`${h_}?family=${r}:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap`,n.rel="stylesheet",n.id=vs,document.head.appendChild(n);return}if(e.type==="Custom"){if(Le(e.css)){if(t?.innerHTML===e.css)return;t?.remove();let r=document.createElement("style");r.innerHTML=e.css,r.id=vs,document.head.appendChild(r);}if(Le(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=vs,document.head.appendChild(r);}}};var[re,Cm]=O();var bt={general:{isInputPrefillEnabled:false,rememberUser:{isEnabled:false,storage:"session"}},typingEmulation:{enabled:true,speed:900,maxDelay:2,delayBetweenBubbles:0,isDisabledOnFirstMessage:true}};var Fc=Symbol("store-raw"),Uo=Symbol("store-node"),Wr=Symbol("store-has"),_m=Symbol("store-self");function Sm(e){let t=e[Xt];if(!t&&(Object.defineProperty(e,Xt,{value:t=new Proxy(e,v_)}),!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 dn(e){let t;return e!=null&&typeof e=="object"&&(e[Xt]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function jo(e,t=new Set){let r,n,o,i;if(r=e!=null&&e[Fc])return r;if(!dn(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=jo(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 c=0,l=a.length;c<l;c++)i=a[c],!s[i].get&&(o=e[i],(n=jo(o,t))!==o&&(e[i]=n));}return e}function xs(e,t){let r=e[t];return r||Object.defineProperty(e,t,{value:r=Object.create(null)}),r}function ji(e,t,r){if(e[t])return e[t];let[n,o]=O(r,{equals:false,internal:true});return n.$=o,e[t]=n}function b_(e,t){let r=Reflect.getOwnPropertyDescriptor(e,t);return !r||r.get||!r.configurable||t===Xt||t===Uo||(delete r.value,delete r.writable,r.get=()=>e[Xt][t]),r}function km(e){rs()&&ji(xs(e,Uo),_m)();}function y_(e){return km(e),Reflect.ownKeys(e)}var v_={get(e,t,r){if(t===Fc)return e;if(t===Xt)return r;if(t===es)return km(e),r;let n=xs(e,Uo),o=n[t],i=o?o():e[t];if(t===Uo||t===Wr||t==="__proto__")return i;if(!o){let a=Object.getOwnPropertyDescriptor(e,t);rs()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(a&&a.get)&&(i=ji(n,t,i)());}return dn(i)?Sm(i):i},has(e,t){return t===Fc||t===Xt||t===es||t===Uo||t===Wr||t==="__proto__"?true:(rs()&&ji(xs(e,Wr),t)(),t in e)},set(){return true},deleteProperty(){return true},ownKeys:y_,getOwnPropertyDescriptor:b_};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[Wr]&&e[Wr][t]&&o!==void 0&&e[Wr][t].$()):(e[t]=r,e[Wr]&&e[Wr][t]&&o===void 0&&e[Wr][t].$());let a=xs(e,Uo),s;if((s=ji(a,t,o))&&s.$(()=>r),Array.isArray(e)&&e.length!==i){for(let c=e.length;c<i;c++)(s=a[c])&&s.$();(s=ji(a,"length",i))&&s.$(e.length);}(s=a[_m])&&s.$();}function Pm(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 x_(e,t){if(typeof t=="function"&&(t=t(e)),t=jo(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 Pm(e,t);}function Ui(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 c=0;c<n.length;c++)Ui(e,[n[c]].concat(t),r);return}else if(s&&a==="function"){for(let c=0;c<e.length;c++)n(e[c],c)&&Ui(e,[c].concat(t),r);return}else if(s&&a==="object"){let{from:c=0,to:l=e.length-1,by:u=1}=n;for(let f=c;f<=l;f+=u)Ui(e,[f].concat(t),r);return}else if(t.length>1){Ui(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=jo(i),n===void 0||dn(o)&&dn(i)&&!Array.isArray(i)?Pm(o,i):Jt(e,n,i));}function Em(...[e,t]){let r=jo(e||{}),n=Array.isArray(r),o=Sm(r);function i(...a){yf(()=>{n&&a.length===1?x_(r,a[0]):Ui(r,a);});}return [o,i]}var Uc=Symbol("store-root");function Fo(e,t,r,n,o){let i=t[r];if(e===i)return;let a=Array.isArray(e);if(r!==Uc&&(!dn(e)||!dn(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 l,u,f,d,p,h,g,v;for(f=0,d=Math.min(i.length,e.length);f<d&&(i[f]===e[f]||o&&i[f]&&e[f]&&i[f][o]===e[f][o]);f++)Fo(e[f],i,f,n,o);let b=new Array(e.length),C=new Map;for(d=i.length-1,p=e.length-1;d>=f&&p>=f&&(i[d]===e[p]||o&&i[f]&&e[f]&&i[d][o]===e[p][o]);d--,p--)b[p]=i[d];if(f>p||f>d){for(u=f;u<=p;u++)Jt(i,u,e[u]);for(;u<e.length;u++)Jt(i,u,b[u]),Fo(e[u],i,u,n,o);i.length>e.length&&Jt(i,"length",e.length);return}for(g=new Array(p+1),u=p;u>=f;u--)h=e[u],v=o&&h?h[o]:h,l=C.get(v),g[u]=l===void 0?-1:l,C.set(v,u);for(l=f;l<=d;l++)h=i[l],v=o&&h?h[o]:h,u=C.get(v),u!==void 0&&u!==-1&&(b[u]=i[l],u=g[u],C.set(v,u));for(u=f;u<e.length;u++)u in b?(Jt(i,u,b[u]),Fo(e[u],i,u,n,o)):Jt(i,u,e[u]);}else for(let l=0,u=e.length;l<u;l++)Fo(e[l],i,l,n,o);i.length>e.length&&Jt(i,"length",e.length);return}let s=Object.keys(e);for(let l=0,u=s.length;l<u;l++)Fo(e[s[l]],i,s[l],n,o);let c=Object.keys(i);for(let l=0,u=c.length;l<u;l++)e[c[l]]===void 0&&Jt(i,c[l],void 0);}function ws(e,t={}){let{merge:r,key:n="id"}=t,o=jo(e);return i=>{if(!dn(i)||!dn(o))return o;let a=Fo(o,{[Uc]:i},Uc,r,n);return a===void 0?i:a}}function Er(e,t){if(!t.storage)return [...e];let r=w_(t.storage||bt.general.rememberUser.storage),n=s=>{let c=JSON.parse(JSON.stringify(s));return typeof c!="object"||("blobUrl"in c&&(c.blobUrl=void 0),"attachments"in c&&Array.isArray(c.attachments)&&c.attachments.forEach(l=>{l&&"blobUrl"in l&&(l.blobUrl=void 0);})),JSON.stringify(c)},o=JSON.parse.bind(JSON),i=r.getItem(t.key),a=typeof e[0]=="function"?s=>e[1](()=>o(s)):s=>e[1](ws(o(s)));return i&&(a(i),t.onRecovered?.()),[e[0],typeof e[0]=="function"?s=>{let c=e[1](s);return s?r.setItem(t.key,n(c)):r.removeItem(t.key),c}:(...s)=>{e[1](...s);let c=n(st(()=>e[0]));r.setItem(t.key,c);}]}var w_=e=>(e??bt.general.rememberUser.storage)==="session"?sessionStorage:localStorage;var pt=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]},Hr=e=>(([t,r,n])=>(t*299+r*587+n*114)/1e3>155)(pt(e));var Im=({chatContainer:e,generalBackground:t})=>{let r=e?.backgroundColor??Li;if((e?.opacity??Ot)<=.3||r==="transparent"||et(r)){let o=t?.type??Lo,i=o==="Image"?"#000000":o==="Color"&&Le(t?.content)?t.content:"#ffffff";return Hr(i)}return Hr(e?.backgroundColor??Ni)};var Z={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"}}},Am=(e,t,r)=>{if(!e)return;let n=t?.style;n&&(C_(e.general,n,r),S_(e.chat,e.general?.background,n));},C_=(e,t,r)=>{R_(e?.background,t),t.setProperty(Z.general.fontFamily,(typeof e?.font=="string"?e.font:e?.font?.family)??No),__(e?.progressBar,t,r);},__=(e,t,r)=>{let n=e?.position??ys;t.setProperty(Z.general.progressBar.position,n==="fixed"?r?"absolute":"fixed":n),t.setProperty(Z.general.progressBar.color,e?.color??lm),t.setProperty(Z.general.progressBar.colorRgb,pt(e?.backgroundColor??cm).join(", ")),t.setProperty(Z.general.progressBar.height,`${e?.thickness??um}px`);let o=e?.placement??dm;t.setProperty(Z.general.progressBar.top,o==="Top"?"0":"auto"),t.setProperty(Z.general.progressBar.bottom,o==="Bottom"?"0":"auto");},S_=(e,t,r)=>{k_(e?.container,t,r,e?.roundness),P_(e?.hostBubbles,r,e?.roundness),E_(e?.guestBubbles,r,e?.roundness),I_(e?.buttons,r,e?.roundness),A_(e?.inputs,r,e?.roundness),O_(e?.container,t,r);},k_=(e,t,r,n)=>{let o=e?.backgroundColor??Li,i=o==="transparent"||et(o);r.setProperty(Z.chat.container.bgColor,i?"0, 0, 0":pt(o).join(", ")),r.setProperty(Z.chat.container.color,pt(e?.color??(Im({chatContainer:e,generalBackground:t})?hs:bs)).join(", ")),r.setProperty(Z.chat.container.maxWidth,e?.maxWidth??pm),r.setProperty(Z.chat.container.maxHeight,e?.maxHeight??mm);let a=i?"1":(e?.opacity??Ot).toString();r.setProperty(Z.chat.container.opacity,i?"0":(e?.opacity??Ot).toString()),r.setProperty(Z.chat.container.blur,a==="1"||i?"0xp":`${e?.blur??fm}px`),Hi(e?.shadow,r,Z.chat.container.boxShadow),Wi(e?.border??{roundeness:n??Rn},r,Z.chat.container.borderRadius),r.setProperty(Z.chat.container.borderWidth,fe(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),r.setProperty(Z.chat.container.borderOpacity,fe(e?.border?.opacity)?e.border.opacity.toString():Ot.toString()),r.setProperty(Z.chat.container.borderColor,pt(e?.border?.color??"").join(", "));},P_=(e,t,r)=>{t.setProperty(Z.chat.hostBubbles.bgColor,pt(e?.backgroundColor??$o).join(", ")),t.setProperty(Z.chat.hostBubbles.color,e?.color??gm),Wi(e?.border??{roundeness:r??Rn},t,Z.chat.hostBubbles.borderRadius),t.setProperty(Z.chat.hostBubbles.borderWidth,fe(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(Z.chat.hostBubbles.borderColor,pt(e?.border?.color??"").join(", ")),t.setProperty(Z.chat.hostBubbles.opacity,e?.backgroundColor==="transparent"?"0":fe(e?.opacity)?e.opacity.toString():Ot.toString()),t.setProperty(Z.chat.hostBubbles.borderOpacity,fe(e?.border?.opacity)?e.border.opacity.toString():Ot.toString()),t.setProperty(Z.chat.hostBubbles.blur,fe(e?.blur)?`${e.blur??0}px`:"none"),Hi(e?.shadow,t,Z.chat.hostBubbles.boxShadow);},E_=(e,t,r)=>{t.setProperty(Z.chat.guestBubbles.bgColor,pt(e?.backgroundColor??hm).join(", ")),t.setProperty(Z.chat.guestBubbles.color,e?.color??bm),Wi(e?.border??{roundeness:r??Rn},t,Z.chat.guestBubbles.borderRadius),t.setProperty(Z.chat.guestBubbles.borderWidth,fe(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(Z.chat.guestBubbles.borderColor,pt(e?.border?.color??"").join(", ")),t.setProperty(Z.chat.guestBubbles.borderOpacity,fe(e?.border?.opacity)?e.border.opacity.toString():Ot.toString()),t.setProperty(Z.chat.guestBubbles.opacity,e?.backgroundColor==="transparent"?"0":fe(e?.opacity)?e.opacity.toString():Ot.toString()),t.setProperty(Z.chat.guestBubbles.blur,fe(e?.blur)?`${e.blur??0}px`:"none"),Hi(e?.shadow,t,Z.chat.guestBubbles.boxShadow);},I_=(e,t,r)=>{let n=e?.backgroundColor??$i;t.setProperty(Z.chat.buttons.bgRgb,pt(n).join(", ")),t.setProperty(Z.chat.buttons.bgRgb,pt(n).join(", ")),t.setProperty(Z.chat.buttons.color,e?.color??ym),Wi(e?.border??{roundeness:r??Rn},t,Z.chat.buttons.borderRadius),t.setProperty(Z.chat.buttons.borderWidth,fe(e?.border?.thickness)?`${e?.border?.thickness}px`:`${vm}px`),t.setProperty(Z.chat.buttons.borderColor,pt(e?.border?.color??e?.backgroundColor??$i).join(", ")),t.setProperty(Z.chat.buttons.borderOpacity,fe(e?.border?.opacity)?e.border.opacity.toString():Ot.toString()),t.setProperty(Z.chat.buttons.opacity,e?.backgroundColor==="transparent"?"0":fe(e?.opacity)?e.opacity.toString():Ot.toString()),t.setProperty(Z.chat.buttons.blur,fe(e?.blur)?`${e.blur??0}px`:"none"),Hi(e?.shadow,t,Z.chat.buttons.boxShadow);},A_=(e,t,r)=>{t.setProperty(Z.chat.inputs.bgColor,pt(e?.backgroundColor??xm).join(", ")),t.setProperty(Z.chat.inputs.color,e?.color??Bi),t.setProperty(Z.chat.inputs.placeholderColor,e?.placeholderColor??wm),Wi(e?.border??{roundeness:r??Rn},t,Z.chat.inputs.borderRadius),t.setProperty(Z.chat.inputs.borderWidth,fe(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(Z.chat.inputs.borderColor,pt(e?.border?.color??"").join(", ")),t.setProperty(Z.chat.inputs.borderOpacity,fe(e?.border?.opacity)?e.border.opacity.toString():Ot.toString()),t.setProperty(Z.chat.inputs.opacity,e?.backgroundColor==="transparent"?"0":fe(e?.opacity)?e.opacity.toString():Ot.toString()),t.setProperty(Z.chat.inputs.blur,fe(e?.blur)?`${e.blur??0}px`:"none"),Hi(e?.shadow??Tm,t,Z.chat.inputs.boxShadow);},O_=(e,t,r)=>{let n=e?.backgroundColor??Li;if(n==="transparent"||et(n)||(e?.opacity??Ot)<=.2){let i=t?.type??Lo;r.setProperty(Z.chat.checkbox.bgRgb,i==="Image"?"rgba(255, 255, 255, 0.75)":pt((i==="Color"?t?.content:"#ffffff")??"#ffffff").join(", ")),i==="Image"?r.setProperty(Z.chat.checkbox.alphaRatio,"3"):r.setProperty(Z.chat.checkbox.alphaRatio,t?.content&&Hr(t?.content)?"1":"2");}else r.setProperty(Z.chat.checkbox.bgRgb,pt(n).concat(e?.opacity??1).join(", ")),r.setProperty(Z.chat.checkbox.alphaRatio,Hr(n)?"1":"2");},R_=(e,t)=>{t.setProperty(Z.general.bgImage,null),t.setProperty(Z.general.bgColor,null),t.setProperty((e?.type??Lo)==="Image"?Z.general.bgImage:Z.general.bgColor,D_({type:e?.type??Lo,content:e?.content??Ni}));},D_=({type:e,content:t}={})=>{switch(e){case "None":return "transparent";case void 0:case "Color":return t??Ni;case "Image":return `url(${t})`}},Wi=(e,t,r)=>{switch(e?.roundeness??Rn){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}}},Hi=(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 jc="resultId",Om=e=>{if(e)try{return sessionStorage.getItem(`${jc}-${e}`)??localStorage.getItem(`${jc}-${e}`)??void 0}catch{}},Rm=(e="session")=>(t,r)=>{try{Mm(e).setItem(`${jc}-${t}`,r);}catch{}},Dm=e=>{if(e)try{let t=sessionStorage.getItem(`agent-${e}-initialChatReply`)??localStorage.getItem(`agent-${e}-initialChatReply`);return t?JSON.parse(t):void 0}catch{}},Wc=(e,{agentId:t,storage:r})=>{try{let n=JSON.stringify(e);Mm(r).setItem(`agent-${t}-initialChatReply`,n);}catch{}},Ts=()=>{try{sessionStorage.setItem("agent-typeOpened","true");}catch{}},Cs=()=>{try{sessionStorage.removeItem("agent-typeOpened");}catch{}},_s=()=>{try{return sessionStorage.getItem("agent-typeOpened")==="true"}catch{return false}},Mm=e=>(e??bt.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 vt=()=>(e,t)=>tt(e,t);function M_(e,t){return `${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function it(e={}){let{strict:t=true,hookName:r="useContext",providerName:n="Provider",errorMessage:o,defaultValue:i}=e,a=xf(i);function s(){let c=vc(a);if(!c&&t){let l=new Error(o??M_(r,n));throw l.name="ContextError",Error.captureStackTrace?.(l,s),l}return c}return [a.Provider,s,a]}var[Hc,Nm]=it({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"}),Vi=e=>vt()(e,["lazyMount","unmountOnExit"]);var N_=Symbol();var Lm=Object.getPrototypeOf,Vc=new WeakMap,L_=e=>e&&(Vc.has(e)?Vc.get(e):Lm(e)===Object.prototype||Lm(e)===Array.prototype);var $m=e=>L_(e)&&e[N_]||null,zc=(e,t=true)=>{Vc.set(e,t);};function $_(){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 Bm(e,t){let r=$_();return r?(r[e]||(r[e]=t()),r[e]):t()}var Gc=e=>typeof e=="object"&&e!==null,Dn=Bm("__zag__proxyStateMap",()=>new WeakMap),zi=Bm("__zag__refSet",()=>new WeakSet),B_=e=>typeof e=="object"&&e!==null&&"$$typeof"in e,F_=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,U_=e=>typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeName=="string",j_=e=>B_(e)||F_(e)||U_(e),W_=(e=Object.is,t=(l,u)=>new Proxy(l,u),r=l=>Gc(l)&&!zi.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!j_(l)&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),n=l=>{switch(l.status){case "fulfilled":return l.value;case "rejected":throw l.reason;default:throw l}},o=new WeakMap,i=(l,u,f=n)=>{let d=o.get(l);if(d?.[0]===u)return d[1];let p=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return zc(p,true),o.set(l,[u,p]),Reflect.ownKeys(l).forEach(h=>{let g=Reflect.get(l,h);zi.has(g)?(zc(g,false),p[h]=g):g instanceof Promise?Object.defineProperty(p,h,{get(){return f(g)}}):Dn.has(g)?p[h]=fn(g,f):p[h]=g;}),Object.freeze(p)},a=new WeakMap,s=[1,1],c=l=>{if(!Gc(l))throw new Error("object required");let u=a.get(l);if(u)return u;let f=s[0],d=new Set,p=(H,V=++s[0])=>{f!==V&&(f=V,d.forEach(L=>L(H,V)));},h=s[1],g=(H=++s[1])=>(h!==H&&!d.size&&(h=H,b.forEach(([V])=>{let L=V[1](H);L>f&&(f=L);})),f),v=H=>(V,L)=>{let E=[...V];E[1]=[H,...E[1]],p(E,L);},b=new Map,C=(H,V)=>{if(d.size){let L=V[3](v(H));b.set(H,[V,L]);}else b.set(H,[V]);},_=H=>{let V=b.get(H);V&&(b.delete(H),V[1]?.());},k=H=>(d.add(H),d.size===1&&b.forEach(([L,E],P)=>{let w=L[3](v(P));b.set(P,[L,w]);}),()=>{d.delete(H),d.size===0&&b.forEach(([L,E],P)=>{E&&(E(),b.set(P,[L]));});}),I=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),D=t(I,{deleteProperty(H,V){let L=Reflect.get(H,V);_(V);let E=Reflect.deleteProperty(H,V);return E&&p(["delete",[V],L]),E},set(H,V,L,E){let P=Reflect.has(H,V),w=Reflect.get(H,V,E);if(P&&(e(w,L)||a.has(L)&&e(w,a.get(L))))return true;_(V),Gc(L)&&(L=$m(L)||L);let A=L;if(!Object.getOwnPropertyDescriptor(H,V)?.set)if(L instanceof Promise)L.then(M=>{Object.assign(L,{status:"fulfilled",value:M}),p(["resolve",[V],M]);}).catch(M=>{Object.assign(L,{status:"rejected",reason:M}),p(["reject",[V],M]);});else {!Dn.has(L)&&r(L)&&(A=Gi(L));let M=!zi.has(A)&&Dn.get(A);M&&C(V,M);}return Reflect.set(H,V,A,E),p(["set",[V],L,w]),true}});a.set(l,D);let oe=[I,g,i,k];return Dn.set(D,oe),Reflect.ownKeys(l).forEach(H=>{let V=Object.getOwnPropertyDescriptor(l,H);V.get||V.set?Object.defineProperty(I,H,V):D[H]=l[H];}),D})=>[c,Dn,zi,e,t,r,n,o,i,a,s],[H_]=W_();function Gi(e={}){return H_(e)}function Wo(e,t,r){let n=Dn.get(e);let o,i=[],a=n[3],s=false,l=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,l();}}function fn(e,t){let r=Dn.get(e);let[n,o,i]=r;return i(n,o(),t)}function zt(e){return zi.add(e),e}function Fm(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,c={};c.get=()=>a(fn(n)),s&&(c.set=l=>s(n,l)),Object.defineProperty(e,o,c);});let n=Gi(e);return n}var jm=e=>e[0],Wm=e=>e[e.length-1];function Hm(e){for(;e.length>0;)e.pop();return e}var Um=e=>e?.constructor.name==="Array",V_=(e,t)=>{if(e.length!==t.length)return false;for(let r=0;r<e.length;r++)if(!Ps(e[r],t[r]))return false;return true},Ps=(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(Um(e)&&Um(t))return V_(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(!Ps(e[i],t[i]))return false}return true},Vr=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,er=e=>e,Es=()=>{},Yi=(...e)=>(...t)=>{e.forEach(function(r){r?.(...t);});},qi=(()=>{let e=0;return ()=>(e++,e.toString(36))})();var Ki=e=>Array.isArray(e);var zm=e=>e!=null&&typeof e=="object",Xi=e=>zm(e)&&!Ki(e),Zi=e=>typeof e=="number"&&!Number.isNaN(e),jt=e=>typeof e=="string",pn=e=>typeof e=="function",Gm=e=>e==null,Yc=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),z_=e=>Object.prototype.toString.call(e),Ym=Function.prototype.toString,G_=Ym.call(Object),qm=e=>{if(!zm(e)||z_(e)!="[object Object]")return false;let t=Object.getPrototypeOf(e);if(t===null)return true;let r=Yc(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Ym.call(r)==G_};function kt(e){if(!q_(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]=kt(o));}return r}var q_=e=>e&&typeof e=="object"&&e.constructor===Object;function zr(...e){e.length===1?e[0]:e[1];e.length===2?e[0]:true;}function Qi(...e){e.length===1?e[0]:e[1];e.length===2?e[0]:true;}function Km(e,t,r){typeof r.value=="object"&&(r.value=Mn(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value;}function Mn(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(Mn(a));})):i==="[object Map]"?(o=new Map,e.forEach(function(a,s){o.set(Mn(s),Mn(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(Mn(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++)Km(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]||Km(o,r,Object.getOwnPropertyDescriptor(e,r));}return o||e}var K_=Object.defineProperty,X_=(e,t,r)=>t in e?K_(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,ae=(e,t,r)=>X_(e,typeof t!="symbol"?t+"":t,r);function Qm(e,...t){for(let r of t){let n=kt(r);for(let o in n)qm(r[o])?(e[o]||(e[o]={}),Qm(e[o],r[o])):e[o]=r[o];}return e}function Xm(e){return Mn(e)}function pr(e){return jt(e)?{type:e}:e}function mn(e){return e?Ki(e)?e.slice():[e]:[]}function Jm(e){return Xi(e)&&e.predicate!=null}var Z_=()=>true;function Kc(e,t,r,n){return o=>jt(o)?!!e[o]?.(t,r,n):pn(o)?o(t,r,n):o.predicate(e)(t,r,n)}function Q_(...e){return {predicate:t=>(r,n,o)=>e.map(Kc(t,r,n,o)).some(Boolean)}}function J_(...e){return {predicate:t=>(r,n,o)=>e.map(Kc(t,r,n,o)).every(Boolean)}}function eS(e){return {predicate:t=>(r,n,o)=>!Kc(t,r,n,o)(e)}}var Is={or:Q_,and:J_,not:eS};function eg(e,t){return e=e??Z_,(r,n,o)=>{if(jt(e)){let i=t[e];return pn(i)?i(r,n,o):i}return Jm(e)?e.predicate(t)(r,n,o):e?.(r,n,o)}}function qc(e,t){return (r,n,o)=>Jm(e)?e.predicate(t)(r,n,o):e}function rS(e){let t=e.computed??er({}),r=e.context??er({}),n=e.initial?e.states?.[e.initial]?.tags:[],o=Gi({value:e.initial??"",previousValue:"",event:er({}),previousEvent:er({}),context:Fm(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 Ji(e,t){return (r,n)=>{if(Zi(e))return e;if(pn(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 Qi(i==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${e}\`. It doesn't exist in \`options.delays\``),pn(i)?i(r,n):i}}}}function nS(e){return jt(e)?{target:e}:e}function oS(e,t){return (r,n,o)=>mn(e).map(nS).find(i=>eg(i.guard,t)(r,n,o)??i.target??i.actions)}var tg=class{constructor(e,t){ae(this,"status","Not Started"),ae(this,"state"),ae(this,"initialState"),ae(this,"initialContext"),ae(this,"id"),ae(this,"type","machine"),ae(this,"activityEvents",new Map),ae(this,"delayedEvents",new Map),ae(this,"stateListeners",new Set),ae(this,"doneListeners",new Set),ae(this,"contextWatchers",new Set),ae(this,"removeStateListener",Es),ae(this,"parent"),ae(this,"children",new Map),ae(this,"guardMap"),ae(this,"actionMap"),ae(this,"delayMap"),ae(this,"activityMap"),ae(this,"sync"),ae(this,"options"),ae(this,"config"),ae(this,"_created",()=>{let r=pr("machine.created");this.executeActions(this.config?.created,r);}),ae(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(c=>{c(this.stateSnapshot);});},this.sync),this.setupContextWatchers(),this.executeActivities(pr("machine.start"),mn(this.config.activities),"machine.start"),this.executeActions(this.config.entry,pr("machine.start"));let n=pr("machine.init"),o=Xi(r)?r.value:r,i=Xi(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}),ae(this,"setupContextWatchers",()=>{let{watch:r}=this.config;if(!r)return;let n=fn(this.state.context),o=Wo(this.state.context,()=>{let i=fn(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);}),ae(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,pr("machine.stop")),this.executeActions(this.config.exit,pr("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this}),ae(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear();}),ae(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(r=>r()),this.contextWatchers.clear();}),ae(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(r=>{r.forEach(n=>n());}),this.delayedEvents.clear();}),ae(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());}),ae(this,"sendChild",(r,n)=>{let o=pr(r),i=Vr(n,this.contextSnapshot),a=this.children.get(i);a||Qi(`[@zag-js/core] Cannot send '${o.type}' event to unknown child`),a.send(o);}),ae(this,"stopChild",r=>{this.children.has(r)||Qi(`[@zag-js/core > stop-child] Cannot stop unknown child ${r}`),this.children.get(r).stop(),this.children.delete(r);}),ae(this,"removeChild",r=>{this.children.delete(r);}),ae(this,"stopChildren",()=>{this.children.forEach(r=>r.stop()),this.children.clear();}),ae(this,"setParent",r=>{this.parent=r;}),ae(this,"spawn",(r,n)=>{let o=Vr(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))}),ae(this,"stopActivity",r=>{if(!this.state.value)return;let n=this.activityEvents.get(this.state.value);n?.get(r)?.(),n?.delete(r);}),ae(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]])));}),ae(this,"setState",r=>{this.state.previousValue=this.state.value,this.state.value=r;let n=this.getStateNode(r);r==null?Hm(this.state.tags):this.state.tags=mn(n?.tags);}),ae(this,"setContext",r=>{r&&Qm(this.state.context,kt(r));}),ae(this,"setOptions",r=>{let n=kt(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};}),ae(this,"getStateNode",r=>{if(r)return this.config.states?.[r]}),ae(this,"getNextStateInfo",(r,n)=>{let o=this.determineTransition(r,n),i=!o?.target,a=o?.target??this.state.value,s=this.state.value!==a,c=this.getStateNode(a),u={reenter:!i&&!s&&!o?.internal,transition:o,stateNode:c,target:a,changed:s};return this.log("NextState:",`[${n.type}]`,this.state.value,"---->",u.target),u}),ae(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);}}}),ae(this,"getDelayedEventActions",r=>{let n=this.getStateNode(r),o=this.state.event;if(!n||!n.after)return;let i=[],a=[];if(Ki(n.after)){let s=this.determineTransition(n.after,o);if(!s)return;if(!Yc(s,"delay"))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(s)}`);let l=Ji(s.delay,this.delayMap)(this.contextSnapshot,o),u=this.getAfterActions(s,l);return i.push(u.entry),a.push(u.exit),{entries:i,exits:a}}if(Xi(n.after))for(let s in n.after){let c=n.after[s],u=Ji(s,this.delayMap)(this.contextSnapshot,o),f=this.getAfterActions(c,u);i.push(f.entry),a.push(f.exit);}return {entries:i,exits:a}}),ae(this,"executeActions",(r,n)=>{let o=qc(r,this.guardMap)(this.contextSnapshot,n,this.guardMeta);for(let i of mn(o)){let a=jt(i)?this.actionMap?.[i]:i;zr(jt(i)&&!a,`[@zag-js/core > execute-actions] No implementation found for action: \`${i}\``),a?.(this.state.context,n,this.meta);}}),ae(this,"executeActivities",(r,n,o)=>{for(let i of n){let a=jt(i)?this.activityMap?.[i]:i;if(!a){zr(`[@zag-js/core > execute-activity] No implementation found for activity: \`${i}\``);continue}let s=a(this.state.context,r,this.meta);if(s){let c=jt(i)?i:i.name||qi();this.addActivityCleanup(o??this.state.value,c,s);}}}),ae(this,"createEveryActivities",(r,n)=>{if(r)if(Ki(r)){let o=mn(r).find(c=>{let l=c.delay,f=Ji(l,this.delayMap)(this.contextSnapshot,this.state.event);return eg(c.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??f!=null});if(!o)return;let a=Ji(o.delay,this.delayMap)(this.contextSnapshot,this.state.event);n(()=>{let c=globalThis.setInterval(()=>{this.executeActions(o.actions,this.state.event);},a);return ()=>{globalThis.clearInterval(c);}});}else for(let o in r){let i=r?.[o],s=Ji(o,this.delayMap)(this.contextSnapshot,this.state.event);n(()=>{let l=globalThis.setInterval(()=>{this.executeActions(i,this.state.event);},s);return ()=>{globalThis.clearInterval(l);}});}}),ae(this,"setEvent",r=>{this.state.previousEvent=this.state.event,this.state.event=zt(pr(r));}),ae(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=qc(i?.exit,this.guardMap)(this.contextSnapshot,n,this.guardMeta),s=mn(a),c=this.delayedEvents.get(o);c&&s.push(...c),this.executeActions(s,n),this.delayedEvents.delete(o);}),ae(this,"performEntryEffects",(r,n)=>{let o=this.getStateNode(r),i=mn(o?.activities);this.createEveryActivities(o?.every,l=>{i.unshift(l);}),i.length>0&&this.executeActivities(n,i);let a=qc(o?.entry,this.guardMap)(this.contextSnapshot,n,this.guardMeta),s=mn(a),c=this.getDelayedEventActions(r);o?.after&&c&&(this.delayedEvents.set(r,c?.exits),s.push(...c.entries)),this.executeActions(s,n),o?.type==="final"&&(this.state.done=true,this.doneListeners.forEach(l=>{l(this.stateSnapshot);}),this.stop());}),ae(this,"performTransitionEffects",(r,n)=>{let o=this.determineTransition(r,n);this.executeActions(o?.actions,n);}),ae(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);}),ae(this,"determineTransition",(r,n)=>oS(r,this.guardMap)?.(this.contextSnapshot,n,this.guardMeta)),ae(this,"sendParent",r=>{this.parent||Qi("[@zag-js/core > send-parent] Cannot send event to an unknown parent");let n=pr(r);this.parent?.send(n);}),ae(this,"log",(...r)=>{}),ae(this,"send",r=>{let n=pr(r);this.transition(this.state.value,n);}),ae(this,"transition",(r,n)=>{let o=jt(r)?this.getStateNode(r):r?.stateNode,i=pr(n);if(!o&&!this.config.on){let c=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}`;zr(c);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}),ae(this,"subscribe",r=>(this.stateListeners.add(r),this.status==="Running"&&r(this.stateSnapshot),()=>{this.stateListeners.delete(r);})),ae(this,"onDone",r=>(this.doneListeners.add(r),this)),ae(this,"onTransition",r=>(this.stateListeners.add(r),this.status==="Running"&&r(this.stateSnapshot),this)),this.config=Xm(e),this.options=Xm(t??{}),this.id=this.config.id??`machine-${qi()}`,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=rS(this.config),this.initialContext=fn(this.state.context);}get stateSnapshot(){return er(fn(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}}},mr=(e,t)=>new tg(e,t),rg=e=>e instanceof tg||e?.type==="machine",iS=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),aS=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Zm=e=>{let t={},r;for(;r=aS.exec(e);)t[r[1]]=r[2];return t},sS=(e,t)=>{if(jt(e)){if(jt(t))return `${e};${t}`;e=Zm(e);}else jt(t)&&(t=Zm(t));return Object.assign({},e??{},t??{})};function As(...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]=Yi(r[n],t[n]);continue}if(n==="className"||n==="class"){t[n]=iS(t[n],r[n]);continue}if(n==="style"){t[n]=sS(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 ng(e){return new Proxy({},{get(){return e}})}var tr=()=>e=>Array.from(new Set(e));function ce(...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 c=e[s];typeof c=="function"&&(c=c()),a=As(a,{[i]:(c||{})[i]});}return a[i]}for(let s=e.length-1;s>=0;s--){let c,l=e[s];if(typeof l=="function"&&(l=l()),c=(l||{})[i],c!==void 0)return c}}});}}return t}var lS=e=>Array.isArray(e),cS=e=>e!=null&&typeof e=="object",uS=e=>cS(e)&&!lS(e),dS=e=>typeof e=="number"&&!Number.isNaN(e),ig=e=>typeof e=="string",fS=Function.prototype.toString;fS.call(Object);var og={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},pS=e=>e.startsWith("--")?e:vS(e);function mS(e){return e in og?og[e]:e}var rr=ng(e=>{let t={};for(let r in e){let n=e[r];if(!(r==="readOnly"&&n===false)){if(r==="style"&&uS(n)){t.style=gS(n);continue}if(r==="children"){ig(n)&&(t.textContent=n);continue}t[mS(r)]=n;}}return t});function gS(e){let t={};for(let r in e){let n=e[r];!ig(n)&&!dS(n)||(t[pS(r)]=n);}return t}var hS=/[A-Z]/g,bS=/^ms-/;function yS(e){return "-"+e.toLowerCase()}var Xc={};function vS(e){if(Xc.hasOwnProperty(e))return Xc[e];var t=e.replace(hS,yS);return Xc[e]=bS.test(t)?"-"+t:t}function ag(e,t){let{actions:r,context:n}=t??{},[o,i]=Em(e.getState());return de(()=>{let a=e.subscribe(s=>{i(ws(s));});he(()=>{a();});}),_e(()=>{let a=typeof n=="function"?n():n;e.setContext(a);}),_e(()=>{e.setOptions({actions:r});}),o}function sg(e){return [ag(e),e.send]}function xS(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 de(()=>{o.start(r),he(()=>{o.stop();});}),o}function Ar(e,t){let r=xS(e,t);return [ag(r,t),r.send,r]}var Zc=e=>r=>{let[n,o]=tt(r,["asChild"]);if(n.asChild){let i=a=>{let[,s]=tt(o,["ref"]);return ce(s,a)};return n.asChild(i)}return m(Df,Oe({component:e},o))};function wS(){let e=new Map;return new Proxy(Zc,{apply(t,r,n){return Zc(n[0])},get(t,r){let n=r;return e.has(n)||e.set(n,Zc(n)),e.get(n)}})}var ve=wS();function lg(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 Os(e){return e?.animationName||"none"}function cg(e){return mr({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=Os(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=Os(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=Os(t.styles));},a=s=>{let c=Os(t.styles);(s.composedPath?.()?.[0]??s.target)===o&&c===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 Ho=e=>vt()(e,["immediate","lazyMount","onExitComplete","present","unmountOnExit"]),Nn=e=>{let[t,r]=Vi(e),[n,o]=O(false),[i,a]=Ar(cg(r),{context:r}),s=j(()=>lg(i,a));return _e(()=>{s().present&&o(true);}),j(()=>({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[Vo,gn]=it({hookName:"usePresenceContext",providerName:"<PresenceProvider />"});var Wt=e=>e?"":void 0;var dg=2147483647,CS=1,_S=9,SS=11,Rs=e=>typeof e=="object"&&e!==null,xt=e=>Rs(e)&&e.nodeType===CS&&typeof e.nodeName=="string",fg=e=>Rs(e)&&e.nodeType===_S,kS=e=>Rs(e)&&e===e.window;var pg=e=>xt(e)?e.localName||"":"#document";function PS(e){return ["html","body","#document"].includes(pg(e))}var ES=e=>Rs(e)&&e.nodeType!==void 0,Jc=e=>ES(e)&&e.nodeType===SS&&"host"in e;function nr(e,t){return !e||!t||!xt(e)||!xt(t)?false:e===t||e.contains(t)}function gr(e){return fg(e)?e:kS(e)?e.document:e?.ownerDocument??document}function IS(e){return gr(e).documentElement}function Or(e){return Jc(e)?Or(e.host):fg(e)?e.defaultView??window:xt(e)?e.ownerDocument?.defaultView??window:window}function AS(e){let t=e.activeElement;for(;t?.shadowRoot;){let r=t.shadowRoot.activeElement;if(r===t)break;t=r;}return t}var mg=()=>typeof document<"u";function OS(){return navigator.userAgentData?.platform??navigator.platform}var eu=e=>mg()&&e.test(OS()),RS=e=>mg()&&e.test(navigator.userAgent);var gg=()=>eu(/^Mac/);var hg=()=>RS(/firefox\//i),DS=()=>eu(/mac|iphone|ipad|ipod/i),bg=()=>eu(/iP(hone|ad|od)|iOS/);function MS(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function Rr(e){return MS(e)?.[0]??e.target}var yg=e=>nr(e.currentTarget,Rr(e));function tu(e){let t=e.currentTarget;if(!t)return false;let r=DS();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 ru(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 nu=e=>e.id;function NS(e,t,r=nu){return e.find(n=>r(n)===t)}function ou(e,t,r=nu){let n=NS(e,t,r);return n?e.indexOf(n):-1}function vg(e,t,r=true){let n=ou(e,t);return n=r?(n+1)%e.length:Math.min(n+1,e.length-1),e[n]}function xg(e,t,r=true){let n=ou(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 LS=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(),$S=e=>LS(e.dataset.valuetext??e.textContent??""),BS=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase()),FS=(e,t)=>e.map((r,n)=>e[(Math.max(t,0)+n)%e.length]);function US(e,t,r,n=nu){let o=r?ou(e,r,n):-1,i=r?FS(e,o):e;return t.length===1&&(i=i.filter(s=>n(s)!==r)),i.find(s=>BS($S(s),t))}function jS(e,t){let{state:r,activeId:n,key:o,timeout:i=350,itemToId:a}=t,s=r.keysSoFar+o,l=s.length>1&&Array.from(s).every(h=>h===s[0])?s[0]:s,u=e.slice(),f=US(u,l,n,a);function d(){clearTimeout(r.timer),r.timer=-1;}function p(h){r.keysSoFar=h,d(),h!==""&&(r.timer=+setTimeout(()=>{p(""),d();},i));}return p(s),f}var iu=Object.assign(jS,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:WS});function WS(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}function HS(e){if(pg(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Jc(e)&&e.host||IS(e);return Jc(t)?t.host:t}var wg=e=>typeof e=="object"&&e!==null&&e.nodeType===1,VS=e=>wg(e)&&e.tagName==="IFRAME";function zS(e){return wg(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:false}function GS(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}var Tg="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 Ds(e){return !e||e.closest("[inert]")?false:e.matches(Tg)&&zS(e)}function au(e,t){if(!e)return [];let r=Array.from(e.querySelectorAll(Tg)),n=r.filter(ug);return n.forEach((o,i)=>{if(VS(o)&&o.contentDocument){let a=o.contentDocument.body,s=au(a);n.splice(i,1,...s);}}),!n.length&&t?r:n}function ug(e){return e!=null&&e.tabIndex>0?true:Ds(e)&&!GS(e)}function YS(e,t){let r=au(e,t),n=r[0]||null,o=r[r.length-1]||null;return [n,o]}function Cg(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=au(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]=YS(t),o=t.ownerDocument||document;return !(o.activeElement===r&&e.shiftKey||o.activeElement===n&&!e.shiftKey||!r&&!n)}function su(e){if(e==null||!xt(e))return false;try{let t=Or(e);return e instanceof t.HTMLInputElement&&e.selectionStart!=null||/(textarea|select)/.test(e.localName)||e.isContentEditable}catch{return false}}var qS=/auto|scroll|overlay|hidden|clip/;function Sg(e){let t=Or(e),{overflow:r,overflowX:n,overflowY:o,display:i}=t.getComputedStyle(e);return qS.test(r+o+n)&&!["inline","contents"].includes(i)}function kg(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 at(e){let t=globalThis.requestAnimationFrame(e);return ()=>{globalThis.cancelAnimationFrame(t);}}function KS(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 Pg(e,t){let n=at,o=[];return o.push(n(()=>{let i=typeof e=="function"?e():e;o.push(KS(i,t));})),()=>{o.forEach(i=>i?.());}}function lu(e){let t=HS(e);return PS(t)?gr(t).body:xt(t)&&Sg(t)?t:lu(t)}function Ms(e,t){return Array.from(e?.querySelectorAll(t)??[])}function hn(e){let t={getRootNode:r=>r.getRootNode?.()??document,getDoc:r=>gr(t.getRootNode(r)),getWin:r=>t.getDoc(r).defaultView??window,getActiveElement:r=>AS(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 XS(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function Eg(e,t){let{rootEl:r,...n}=t||{};!e||!r||!Sg(r)||!XS(r)||e.scrollIntoView(n);}var Qc=new WeakMap;function ZS(e,t,r){Qc.has(e)||Qc.set(e,new Map);let n=Qc.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 Ig(e,t){return e?ZS(e,"style",()=>{let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n;}}):()=>{}}var QS=1e3/60;function JS(e,t){let r=e();if(xt(r)&&r.isConnected)return t(r),()=>{};{let n=setInterval(()=>{let o=e();xt(o)&&o.isConnected&&(t(o),clearInterval(n));},QS);return ()=>clearInterval(n)}}function Ag(e,t){let r=[];return e?.forEach(n=>{let o=JS(n,t);r.push(o);}),()=>{r.forEach(n=>n());}}var[S2,zo]=it({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:false,defaultValue:()=>({dir:"ltr",locale:"en-US"})});var ek=e=>typeof e=="function",Og=(e,...t)=>ek(e)?e(...t):e;var[tk,Ln]=it({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:false,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})}),rk=T("<span hidden>"),$n=e=>{let[t,r]=O(),n=()=>Og(e.value)??t()?.ownerDocument??document,o=j(()=>({getRootNode:n,getDocument:()=>gr(n()),getWindow:()=>Or(n())}));return m(tk,{value:o,get children(){return [j(()=>e.children),m(F,{get when(){return !e.value},get children(){var i=rk();return ye(r,i),i}})]}})};var nk=Object.defineProperty,bn=(e,t)=>{for(var r in t)nk(e,r,{get:t[r],enumerable:true});};var hr=(e,t=[])=>({parts:(...r)=>{if(ok(t))return hr(e,r);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...r)=>hr(e,[...t,...r]),rename:r=>hr(r,t),keys:()=>t,build:()=>[...new Set(t)].reduce((r,n)=>Object.assign(r,{[n]:{selector:[`&[data-scope="${Go(e)}"][data-part="${Go(n)}"]`,`& [data-scope="${Go(e)}"][data-part="${Go(n)}"]`].join(", "),attrs:{"data-scope":Go(e),"data-part":Go(n)}}}),{})}),Go=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),ok=e=>e.length===0;var Rg=["top","right","bottom","left"];var Dr=Math.min,Rt=Math.max,ta=Math.round,ra=Math.floor,Gr=e=>({x:e,y:e}),ik={left:"right",right:"left",bottom:"top",top:"bottom"},ak={start:"end",end:"start"};function Ls(e,t,r){return Rt(e,Dr(t,r))}function Mr(e,t){return typeof e=="function"?e(t):e}function Nr(e){return e.split("-")[0]}function Bn(e){return e.split("-")[1]}function $s(e){return e==="x"?"y":"x"}function Bs(e){return e==="y"?"height":"width"}function br(e){return ["top","bottom"].includes(Nr(e))?"y":"x"}function Fs(e){return $s(br(e))}function Dg(e,t,r){r===void 0&&(r=false);let n=Bn(e),o=Fs(e),i=Bs(o),a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=ea(a)),[a,ea(a)]}function Mg(e){let t=ea(e);return [Ns(e),t,Ns(t)]}function Ns(e){return e.replace(/start|end/g,t=>ak[t])}function sk(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 Ng(e,t,r,n){let o=Bn(e),i=sk(Nr(e),r==="start",n);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Ns)))),i}function ea(e){return e.replace(/left|right|bottom|top/g,t=>ik[t])}function lk(e){return {top:0,right:0,bottom:0,left:0,...e}}function cu(e){return typeof e!="number"?lk(e):{top:e,right:e,bottom:e,left:e}}function Fn(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 Lg(e,t,r){let{reference:n,floating:o}=e,i=br(t),a=Fs(t),s=Bs(a),c=Nr(t),l=i==="y",u=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,d=n[s]/2-o[s]/2,p;switch(c){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:f};break;case "left":p={x:n.x-o.width,y:f};break;default:p={x:n.x,y:n.y};}switch(Bn(t)){case "start":p[a]-=d*(r&&l?-1:1);break;case "end":p[a]+=d*(r&&l?-1:1);break}return p}var Fg=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t)),l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Lg(l,n,c),d=n,p={},h=0;for(let g=0;g<s.length;g++){let{name:v,fn:b}=s[g],{x:C,y:_,data:k,reset:I}=await b({x:u,y:f,initialPlacement:n,placement:d,strategy:o,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});u=C??u,f=_??f,p={...p,[v]:{...p[v],...k}},I&&h<=50&&(h++,typeof I=="object"&&(I.placement&&(d=I.placement),I.rects&&(l=I.rects===true?await a.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:u,y:f}=Lg(l,d,c)),g=-1);}return {x:u,y:f,placement:d,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:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=false,padding:p=0}=Mr(t,e),h=cu(p),v=s[d?f==="floating"?"reference":"floating":f],b=Fn(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(v)))==null||r?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),C=f==="floating"?{x:n,y:o,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),k=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},I=Fn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:C,offsetParent:_,strategy:c}):C);return {top:(b.top-I.top+h.top)/k.y,bottom:(I.bottom-b.bottom+h.bottom)/k.y,left:(b.left-I.left+h.left)/k.x,right:(I.right-b.right+h.right)/k.x}}var Ug=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:o,rects:i,platform:a,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Mr(e,t)||{};if(l==null)return {};let f=cu(u),d={x:r,y:n},p=Fs(o),h=Bs(p),g=await a.getDimensions(l),v=p==="y",b=v?"top":"left",C=v?"bottom":"right",_=v?"clientHeight":"clientWidth",k=i.reference[h]+i.reference[p]-d[p]-i.floating[h],I=d[p]-i.reference[p],B=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l)),D=B?B[_]:0;(!D||!await(a.isElement==null?void 0:a.isElement(B)))&&(D=s.floating[_]||i.floating[h]);let oe=k/2-I/2,H=D/2-g[h]/2-1,V=Dr(f[b],H),L=Dr(f[C],H),E=V,P=D-g[h]-L,w=D/2-g[h]/2+oe,A=Ls(E,w,P),M=!c.arrow&&Bn(o)!=null&&w!==A&&i.reference[h]/2-(w<E?V:L)-g[h]/2<0,X=M?w<E?w-E:w-P:0;return {[p]:d[p]+X,data:{[p]:A,centerOffset:w-A-X,...M&&{alignmentOffset:X}},reset:M}}});var jg=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:c,elements:l}=t,{mainAxis:u=true,crossAxis:f=true,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=true,...v}=Mr(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return {};let b=Nr(o),C=br(s),_=Nr(s)===s,k=await(c.isRTL==null?void 0:c.isRTL(l.floating)),I=d||(_||!g?[ea(s)]:Mg(s)),B=h!=="none";!d&&B&&I.push(...Ng(s,g,h,k));let D=[s,...I],oe=await Yo(t,v),H=[],V=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&H.push(oe[b]),f){let w=Dg(o,a,k);H.push(oe[w[0]],oe[w[1]]);}if(V=[...V,{placement:o,overflows:H}],!H.every(w=>w<=0)){var L,E;let w=(((L=i.flip)==null?void 0:L.index)||0)+1,A=D[w];if(A&&(!(f==="alignment"?C!==br(A):false)||V.every(me=>me.overflows[0]>0&&br(me.placement)===C)))return {data:{index:w,overflows:V},reset:{placement:A}};let M=(E=V.filter(X=>X.overflows[0]<=0).sort((X,me)=>X.overflows[1]-me.overflows[1])[0])==null?void 0:E.placement;if(!M)switch(p){case "bestFit":{var P;let X=(P=V.filter(me=>{if(B){let ee=br(me.placement);return ee===C||ee==="y"}return true}).map(me=>[me.placement,me.overflows.filter(ee=>ee>0).reduce((ee,Ue)=>ee+Ue,0)]).sort((me,ee)=>me[1]-ee[1])[0])==null?void 0:P[0];X&&(M=X);break}case "initialPlacement":M=s;break}if(o!==M)return {reset:{placement:M}}}return {}}}};function $g(e,t){return {top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bg(e){return Rg.some(t=>e[t]>=0)}var Wg=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:n="referenceHidden",...o}=Mr(e,t);switch(n){case "referenceHidden":{let i=await Yo(t,{...o,elementContext:"reference"}),a=$g(i,r.reference);return {data:{referenceHiddenOffsets:a,referenceHidden:Bg(a)}}}case "escaped":{let i=await Yo(t,{...o,altBoundary:true}),a=$g(i,r.floating);return {data:{escapedOffsets:a,escaped:Bg(a)}}}default:return {}}}}};async function ck(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=Bn(r),c=br(r)==="y",l=["left","top"].includes(a)?-1:1,u=i&&c?-1:1,f=Mr(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),c?{x:p*u,y:d*l}:{x:d*l,y:p*u}}var Hg=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,c=await ck(t,e);return a===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},Vg=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:v=>{let{x:b,y:C}=v;return {x:b,y:C}}},...c}=Mr(e,t),l={x:r,y:n},u=await Yo(t,c),f=br(Nr(o)),d=$s(f),p=l[d],h=l[f];if(i){let v=d==="y"?"top":"left",b=d==="y"?"bottom":"right",C=p+u[v],_=p-u[b];p=Ls(C,p,_);}if(a){let v=f==="y"?"top":"left",b=f==="y"?"bottom":"right",C=h+u[v],_=h-u[b];h=Ls(C,h,_);}let g=s.fn({...t,[d]:p,[f]:h});return {...g,data:{x:g.x-r,y:g.y-n,enabled:{[d]:i,[f]:a}}}}}},zg=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:c=true,crossAxis:l=true}=Mr(e,t),u={x:r,y:n},f=br(o),d=$s(f),p=u[d],h=u[f],g=Mr(s,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){let _=d==="y"?"height":"width",k=i.reference[d]-i.floating[_]+v.mainAxis,I=i.reference[d]+i.reference[_]-v.mainAxis;p<k?p=k:p>I&&(p=I);}if(l){var b,C;let _=d==="y"?"width":"height",k=["top","left"].includes(Nr(o)),I=i.reference[f]-i.floating[_]+(k&&((b=a.offset)==null?void 0:b[f])||0)+(k?0:v.crossAxis),B=i.reference[f]+i.reference[_]+(k?0:((C=a.offset)==null?void 0:C[f])||0)-(k?v.crossAxis:0);h<I?h=I:h>B&&(h=B);}return {[d]:p,[f]:h}}}},Gg=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:c=()=>{},...l}=Mr(e,t),u=await Yo(t,l),f=Nr(o),d=Bn(o),p=br(o)==="y",{width:h,height:g}=i.floating,v,b;f==="top"||f==="bottom"?(v=f,b=d===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(b=f,v=d==="end"?"top":"bottom");let C=g-u.top-u.bottom,_=h-u.left-u.right,k=Dr(g-u[v],C),I=Dr(h-u[b],_),B=!t.middlewareData.shift,D=k,oe=I;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(oe=_),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(D=C),B&&!d){let V=Rt(u.left,0),L=Rt(u.right,0),E=Rt(u.top,0),P=Rt(u.bottom,0);p?oe=h-2*(V!==0||L!==0?V+L:Rt(u.left,u.right)):D=g-2*(E!==0||P!==0?E+P:Rt(u.top,u.bottom));}await c({...t,availableWidth:oe,availableHeight:D});let H=await a.getDimensions(s.floating);return h!==H.width||g!==H.height?{reset:{rects:true}}:{}}}};function Us(){return typeof window<"u"}function Un(e){return qg(e)?(e.nodeName||"").toLowerCase():"#document"}function Ht(e){var t;return (e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yr(e){var t;return (t=(qg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qg(e){return Us()?e instanceof Node||e instanceof Ht(e).Node:false}function or(e){return Us()?e instanceof Element||e instanceof Ht(e).Element:false}function vr(e){return Us()?e instanceof HTMLElement||e instanceof Ht(e).HTMLElement:false}function Yg(e){return !Us()||typeof ShadowRoot>"u"?false:e instanceof ShadowRoot||e instanceof Ht(e).ShadowRoot}function Ko(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 Kg(e){return ["table","td","th"].includes(Un(e))}function na(e){return [":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return false}})}function js(e){let t=Ws(),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 Xg(e){let t=Yr(e);for(;vr(t)&&!jn(t);){if(js(t))return t;if(na(t))return null;t=Yr(t);}return null}function Ws(){return typeof CSS>"u"||!CSS.supports?false:CSS.supports("-webkit-backdrop-filter","none")}function jn(e){return ["html","body","#document"].includes(Un(e))}function ir(e){return Ht(e).getComputedStyle(e)}function oa(e){return or(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yr(e){if(Un(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Yg(e)&&e.host||yr(e);return Yg(t)?t.host:t}function Zg(e){let t=Yr(e);return jn(t)?e.ownerDocument?e.ownerDocument.body:e.body:vr(t)&&Ko(t)?t:Zg(t)}function qo(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=true);let o=Zg(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),a=Ht(o);if(i){let s=Hs(a);return t.concat(a,a.visualViewport||[],Ko(o)?o:[],s&&r?qo(s):[])}return t.concat(o,qo(o,[],r))}function Hs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eh(e){let t=ir(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=vr(e),i=o?e.offsetWidth:r,a=o?e.offsetHeight:n,s=ta(r)!==i||ta(n)!==a;return s&&(r=i,n=a),{width:r,height:n,$:s}}function fu(e){return or(e)?e:e.contextElement}function Xo(e){let t=fu(e);if(!vr(t))return Gr(1);let r=t.getBoundingClientRect(),{width:n,height:o,$:i}=eh(t),a=(i?ta(r.width):r.width)/n,s=(i?ta(r.height):r.height)/o;return (!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var uk=Gr(0);function th(e){let t=Ht(e);return !Ws()||!t.visualViewport?uk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dk(e,t,r){return t===void 0&&(t=false),!r||t&&r!==Ht(e)?false:t}function Wn(e,t,r,n){t===void 0&&(t=false),r===void 0&&(r=false);let o=e.getBoundingClientRect(),i=fu(e),a=Gr(1);t&&(n?or(n)&&(a=Xo(n)):a=Xo(e));let s=dk(i,r,n)?th(i):Gr(0),c=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,u=o.width/a.x,f=o.height/a.y;if(i){let d=Ht(i),p=n&&or(n)?Ht(n):n,h=d,g=Hs(h);for(;g&&n&&p!==h;){let v=Xo(g),b=g.getBoundingClientRect(),C=ir(g),_=b.left+(g.clientLeft+parseFloat(C.paddingLeft))*v.x,k=b.top+(g.clientTop+parseFloat(C.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=_,l+=k,h=Ht(g),g=Hs(h);}}return Fn({width:u,height:f,x:c,y:l})}function fk(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,i=o==="fixed",a=yr(n),s=t?na(t.floating):false;if(n===a||s&&i)return r;let c={scrollLeft:0,scrollTop:0},l=Gr(1),u=Gr(0),f=vr(n);if((f||!f&&!i)&&((Un(n)!=="body"||Ko(a))&&(c=oa(n)),vr(n))){let d=Wn(n);l=Xo(n),u.x=d.x+n.clientLeft,u.y=d.y+n.clientTop;}return {width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+u.x,y:r.y*l.y-c.scrollTop*l.y+u.y}}function pk(e){return Array.from(e.getClientRects())}function du(e,t){let r=oa(e).scrollLeft;return t?t.left+r:Wn(yr(e)).left+r}function mk(e){let t=yr(e),r=oa(e),n=e.ownerDocument.body,o=Rt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Rt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),a=-r.scrollLeft+du(e),s=-r.scrollTop;return ir(n).direction==="rtl"&&(a+=Rt(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:s}}function gk(e,t){let r=Ht(e),n=yr(e),o=r.visualViewport,i=n.clientWidth,a=n.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;let l=Ws();(!l||l&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop);}return {width:i,height:a,x:s,y:c}}function hk(e,t){let r=Wn(e,true,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=vr(e)?Xo(e):Gr(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,c=o*i.x,l=n*i.y;return {width:a,height:s,x:c,y:l}}function Qg(e,t,r){let n;if(t==="viewport")n=gk(e,r);else if(t==="document")n=mk(yr(e));else if(or(t))n=hk(t,r);else {let o=th(e);n={...t,x:t.x-o.x,y:t.y-o.y};}return Fn(n)}function rh(e,t){let r=Yr(e);return r===t||!or(r)||jn(r)?false:ir(r).position==="fixed"||rh(r,t)}function bk(e,t){let r=t.get(e);if(r)return r;let n=qo(e,[],false).filter(s=>or(s)&&Un(s)!=="body"),o=null,i=ir(e).position==="fixed",a=i?Yr(e):e;for(;or(a)&&!jn(a);){let s=ir(a),c=js(a);!c&&s.position==="fixed"&&(o=null),(i?!c&&!o:!c&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ko(a)&&!c&&rh(e,a))?n=n.filter(u=>u!==a):o=s,a=Yr(a);}return t.set(e,n),n}function yk(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,a=[...r==="clippingAncestors"?na(t)?[]:bk(t,this._c):[].concat(r),n],s=a[0],c=a.reduce((l,u)=>{let f=Qg(t,u,o);return l.top=Rt(f.top,l.top),l.right=Dr(f.right,l.right),l.bottom=Dr(f.bottom,l.bottom),l.left=Rt(f.left,l.left),l},Qg(t,s,o));return {width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function vk(e){let{width:t,height:r}=eh(e);return {width:t,height:r}}function xk(e,t,r){let n=vr(t),o=yr(t),i=r==="fixed",a=Wn(e,true,i,t),s={scrollLeft:0,scrollTop:0},c=Gr(0);if(n||!n&&!i)if((Un(t)!=="body"||Ko(o))&&(s=oa(t)),n){let p=Wn(t,true,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop;}else o&&(c.x=du(o));let l=0,u=0;if(o&&!n&&!i){let p=o.getBoundingClientRect();u=p.top+s.scrollTop,l=p.left+s.scrollLeft-du(o,p);}let f=a.left+s.scrollLeft-c.x-l,d=a.top+s.scrollTop-c.y-u;return {x:f,y:d,width:a.width,height:a.height}}function uu(e){return ir(e).position==="static"}function Jg(e,t){if(!vr(e)||ir(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return yr(e)===r&&(r=r.ownerDocument.body),r}function nh(e,t){let r=Ht(e);if(na(e))return r;if(!vr(e)){let o=Yr(e);for(;o&&!jn(o);){if(or(o)&&!uu(o))return o;o=Yr(o);}return r}let n=Jg(e,t);for(;n&&Kg(n)&&uu(n);)n=Jg(n,t);return n&&jn(n)&&uu(n)&&!js(n)?r:n||Xg(e)||r}var wk=async function(e){let t=this.getOffsetParent||nh,r=this.getDimensions,n=await r(e.floating);return {reference:xk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Tk(e){return ir(e).direction==="rtl"}var Ck={convertOffsetParentRelativeRectToViewportRelativeRect:fk,getDocumentElement:yr,getClippingRect:yk,getOffsetParent:nh,getElementRects:wk,getClientRects:pk,getDimensions:vk,getScale:Xo,isElement:or,isRTL:Tk};function _k(e,t){let r=null,n,o=yr(e);function i(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null;}function a(s,c){s===void 0&&(s=false),c===void 0&&(c=1),i();let{left:l,top:u,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;let p=ra(u),h=ra(o.clientWidth-(l+f)),g=ra(o.clientHeight-(u+d)),v=ra(l),C={rootMargin:-p+"px "+-h+"px "+-g+"px "+-v+"px",threshold:Rt(0,Dr(1,c))||1},_=true;function k(I){let B=I[0].intersectionRatio;if(B!==c){if(!_)return a();B?a(false,B):n=setTimeout(()=>{a(false,1e-7);},1e3);}_=false;}try{r=new IntersectionObserver(k,{...C,root:o.ownerDocument});}catch{r=new IntersectionObserver(k,C);}r.observe(e);}return a(true),i}function oh(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:c=false}=n,l=fu(e),u=o||i?[...l?qo(l):[],...qo(t)]:[];u.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:true}),i&&b.addEventListener("resize",r);});let f=l&&s?_k(l,r):null,d=-1,p=null;a&&(p=new ResizeObserver(b=>{let[C]=b;C&&C.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var _;(_=p)==null||_.observe(t);})),r();}),l&&!c&&p.observe(l),p.observe(t));let h,g=c?Wn(e):null;c&&v();function v(){let b=Wn(e);g&&(b.x!==g.x||b.y!==g.y||b.width!==g.width||b.height!==g.height)&&r(),g=b,h=requestAnimationFrame(v);}return r(),()=>{var b;u.forEach(C=>{o&&C.removeEventListener("scroll",r),i&&C.removeEventListener("resize",r);}),f?.(),(b=p)==null||b.disconnect(),p=null,c&&cancelAnimationFrame(h);}}var ih=Hg;var ah=Vg,sh=jg,lh=Gg,ch=Wg,uh=Ug;var dh=zg,fh=(e,t,r)=>{let n=new Map,o={platform:Ck,...r},i={...o.platform,_c:n};return Fg(e,t,{...o,platform:i})};function ph(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 Sk(e){if(!e)return ph();let{x:t,y:r,width:n,height:o}=e;return ph(t,r,n,o)}function kk(e,t){return {contextElement:xt(e)?e:void 0,getBoundingClientRect:()=>{let r=e,n=t?.(r);return n||!r?Sk(n):r.getBoundingClientRect()}}}var ia=e=>({variable:e,reference:`var(${e})`}),qr={arrowSize:ia("--arrow-size"),arrowSizeHalf:ia("--arrow-size-half"),arrowBg:ia("--arrow-background"),transformOrigin:ia("--transform-origin"),arrowOffset:ia("--arrow-offset")},Pk=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"}),Ek={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:r}){let{arrow:n}=r,o=Pk(n)[e],{floating:i}=t;return i.style.setProperty(qr.transformOrigin.variable,o),{data:{transformOrigin:o}}}},Ik={name:"rects",fn({rects:e}){return {data:e}}},Ak=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% + ${qr.arrowOffset.reference})`}),{}}}};function Ok(e){let[t,r]=e.split("-");return {side:t,align:r,hasAlign:r!=null}}function gh(e){return e.split("-")[0]}var Rk={strategy:"absolute",placement:"bottom",listeners:true,gutter:8,flip:true,slide:true,overlap:false,sameWidth:false,fitViewport:false,overflowPadding:8,arrowPadding:4};function mh(e,t){let r=e.devicePixelRatio||1;return Math.round(t*r)/r}function hh(e){return Vr(e.boundary)}function Dk(e,t){if(e)return uh({element:e,padding:t.arrowPadding})}function Mk(e,t){if(!Gm(t.offset??t.gutter))return ih(({placement:r})=>{let n=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+n:o??n,{hasAlign:a}=Ok(r),s=a?void 0:t.shift,c=t.offset?.crossAxis??s;return kt({crossAxis:c,mainAxis:i,alignmentAxis:t.shift})})}function Nk(e){if(e.flip)return sh({boundary:hh(e),padding:e.overflowPadding,fallbackPlacements:e.flip===true?void 0:e.flip})}function Lk(e){if(!(!e.slide&&!e.overlap))return ah({boundary:hh(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:dh()})}function $k(e){return lh({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 Bk(e){if(e.hideWhenDetached)return ch({strategy:"referenceHidden",boundary:e.boundary?.()??"clippingAncestors"})}function Fk(e){return e?e===true?{ancestorResize:true,ancestorScroll:true,elementResize:true,layoutShift:true}:e:{}}function Uk(e,t,r={}){let n=kk(e,r.getAnchorRect);if(!t||!n)return;let o=Object.assign({},Rk,r),i=t.querySelector("[data-part=arrow]"),a=[Mk(i,o),Nk(o),Lk(o),Dk(i,o),Ak(i),Ek,$k(o),Bk(o),Ik],{placement:s,strategy:c,onComplete:l,onPositioned:u}=o,f=async()=>{if(!n||!t)return;let g=await fh(n,t,{placement:s,middleware:a,strategy:c});l?.(g),u?.({placed:true});let v=Or(t),b=mh(v,g.x),C=mh(v,g.y);t.style.setProperty("--x",`${b}px`),t.style.setProperty("--y",`${C}px`),o.hideWhenDetached&&g.middlewareData.hide?.referenceHidden&&t.style.setProperty("visibility","hidden");let _=t.firstElementChild;if(_){let k=v.getComputedStyle(_).zIndex;t.style.setProperty("--z-index",k);}},d=async()=>{r.updatePosition?(await r.updatePosition({updatePosition:f}),u?.({placed:true})):await f();},p=Fk(o.listeners),h=o.listeners?oh(n,t,d,p):Es;return d(),()=>{h?.(),u?.({placed:false});}}function pu(e,t,r={}){let{defer:n,...o}=r,i=n?at:s=>s(),a=[];return a.push(i(()=>{let s=typeof e=="function"?e():e,c=typeof t=="function"?t():t;a.push(Uk(s,c,o));})),()=>{a.forEach(s=>s?.());}}var jk={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function bh(e={}){let{placement:t,sameWidth:r,fitViewport:n,strategy:o="absolute"}=e;return {arrow:{position:"absolute",width:qr.arrowSize.reference,height:qr.arrowSize.reference,[qr.arrowSizeHalf.variable]:`calc(${qr.arrowSize.reference} / 2)`,[qr.arrowOffset.variable]:`calc(${qr.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?jk[t.split("-")[0]]:void 0,background:qr.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 xr=(e,t,r,n)=>{let o=typeof e=="function"?e():e;return o?.addEventListener(t,r,n),()=>{o?.removeEventListener(t,r,n);}};function vh(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var Vs=e=>e.button===2||gg()&&e.ctrlKey&&e.button===0,xh=e=>e.ctrlKey||e.altKey||e.metaKey;function Wk(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 Hk(e){return e?.matches("a[href]")??false}function wh(e){if(!Hk(e))return;let t=()=>e.click();hg()?Wk(e,"keyup",t):queueMicrotask(t);}function mu(e,t,r){if(!e)return;let n=e.ownerDocument.defaultView||window,o=new n.CustomEvent(t,r);return e.dispatchEvent(o)}var Vk={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},yh={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function gu(e,t={}){let{dir:r="ltr",orientation:n="horizontal"}=t,{key:o}=e;return o=Vk[o]??o,r==="rtl"&&n==="horizontal"&&o in yh&&(o=yh[o]),o}function zk(e,t="client"){let r=e.touches[0]||e.changedTouches[0];return {x:r[`${t}X`],y:r[`${t}Y`]}}function Gk(e,t="client"){return {x:e[`${t}X`],y:e[`${t}Y`]}}var Yk=e=>"touches"in e&&e.touches.length>0;function zs(e,t="client"){return Yk(e)?zk(e,t):Gk(e,t)}function qk(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 Kk(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 Th="pointerdown.outside",Ch="focus.outside";function Xk(e){for(let t of e)if(xt(t)&&Ds(t))return true;return false}var Sh=e=>"clientY"in e;function Zk(e,t){if(!Sh(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||!Sh(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 Qk(e,t){let{exclude:r,onFocusOutside:n,onPointerDownOutside:o,onInteractOutside:i,defer:a}=t;if(!e)return;let s=gr(e),c=Or(e),l=qk(c),u=Kk(c);function f(b){let C=Rr(b);if(!xt(C)||nr(e,C)||Zk(e,b)||_h(b,C))return false;let _=lu(e);return _h(b,_)?false:!r?.(C)}let d=new Set;function p(b){function C(){let _=a?at:I=>I(),k=b.composedPath?.()??[b.target];_(()=>{if(!(!e||!f(b))){if(o||i){let I=Yi(o,i);e.addEventListener(Th,I,{once:true});}mu(e,Th,{bubbles:false,cancelable:true,detail:{originalEvent:b,contextmenu:Vs(b),focusable:Xk(k)}});}});}b.pointerType==="touch"?(d.forEach(_=>_()),d.add(xr(s,"click",C,{once:true})),d.add(u.addEventListener("click",C,{once:true})),d.add(l.addEventListener("click",C,{once:true}))):C();}let h=new Set,g=setTimeout(()=>{h.add(xr(s,"pointerdown",p,true)),h.add(u.addEventListener("pointerdown",p,true)),h.add(l.addEventListener("pointerdown",p,true));},0);function v(b){(a?at:_=>_())(()=>{if(!(!e||!f(b))){if(n||i){let _=Yi(n,i);e.addEventListener(Ch,_,{once:true});}mu(e,Ch,{bubbles:false,cancelable:true,detail:{originalEvent:b,contextmenu:false,focusable:Ds(Rr(b))}});}});}return h.add(xr(s,"focusin",v,true)),h.add(u.addEventListener("focusin",v,true)),h.add(l.addEventListener("focusin",v,true)),()=>{clearTimeout(g),d.forEach(b=>b()),h.forEach(b=>b());}}function kh(e,t){let{defer:r}=t,n=r?at:i=>i(),o=[];return o.push(n(()=>{let i=typeof e=="function"?e():e;o.push(Qk(i,t));})),()=>{o.forEach(i=>i?.());}}function Jk(e,t){let r=n=>{n.key==="Escape"&&(n.isComposing||t?.(n));};return xr(gr(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);}},Ph;function Eh(){Gt.layers.forEach(({node:e})=>{e.style.pointerEvents=Gt.isBelowPointerBlockingLayer(e)?"none":"auto";});}function eP(e){e.style.pointerEvents="";}function tP(e,t){let r=gr(e),n=[];if(Gt.hasPointerBlockingLayer()&&!r.body.hasAttribute("data-inert")&&(Ph=document.body.style.pointerEvents,queueMicrotask(()=>{r.body.style.pointerEvents="none",r.body.setAttribute("data-inert","");})),t){let o=Ag(t,i=>{n.push(Ig(i,{pointerEvents:"auto"}));});n.push(o);}return ()=>{Gt.hasPointerBlockingLayer()||(queueMicrotask(()=>{r.body.style.pointerEvents=Ph,r.body.removeAttribute("data-inert"),r.body.style.length===0&&r.body.removeAttribute("style");}),n.forEach(o=>o()));}}function rP(e,t){if(!e){zr("[@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),Eh();function s(d){let p=Rr(d.detail.originalEvent);Gt.isBelowPointerBlockingLayer(e)||Gt.isInBranch(p)||(t.onPointerDownOutside?.(d),t.onInteractOutside?.(d),!d.defaultPrevented&&r?.());}function c(d){let p=Rr(d.detail.originalEvent);Gt.isInBranch(p)||(t.onFocusOutside?.(d),t.onInteractOutside?.(d),!d.defaultPrevented&&r?.());}function l(d){Gt.isTopMost(e)&&(t.onEscapeKeyDown?.(d),!d.defaultPrevented&&r&&(d.preventDefault(),r()));}function u(d){if(!e)return false;let p=typeof o=="function"?o():o,h=Array.isArray(p)?p:[p],g=t.persistentElements?.map(v=>v()).filter(xt);return g&&h.push(...g),h.some(v=>nr(v,d))||Gt.isInNestedLayer(e,d)}let f=[n?tP(e,t.persistentElements):void 0,Jk(e,l),kh(e,{exclude:u,onFocusOutside:c,onPointerDownOutside:s,defer:t.defer})];return ()=>{Gt.remove(e),Eh(),eP(e),f.forEach(d=>d?.());}}function Gs(e,t){let{defer:r}=t,n=r?at:i=>i(),o=[];return o.push(n(()=>{let i=pn(e)?e():e;o.push(rP(i,t));})),()=>{o.forEach(i=>i?.());}}function Ih(e,t={}){let{defer:r}=t,n=r?at:i=>i(),o=[];return o.push(n(()=>{let i=pn(e)?e():e;if(!i){zr("[@zag-js/dismissable] branch node is `null` or `undefined`");return}Gt.addBranch(i),o.push(()=>{Gt.removeBranch(i);});})),()=>{o.forEach(i=>i?.());}}var Rh=hr("toast").parts("group","root","title","description","actionTrigger","closeTrigger"),Zo=Rh.build(),Pt=hn({getRegionId:e=>`toast-group:${e}`,getRegionEl:(e,t)=>Pt.getById(e,`toast-group:${t}`),getRootId:e=>`toast:${e.id}`,getRootEl:e=>Pt.getById(e,Pt.getRootId(e)),getTitleId:e=>`toast:${e.id}:title`,getDescriptionId:e=>`toast:${e.id}:description`,getCloseTriggerId:e=>`toast${e.id}:close`});function hu(e,t){return e.filter(r=>r.state.context.placement===t)}var Ah={info:5e3,error:5e3,success:2e3,loading:1/0,DEFAULT:5e3};function Oh(e,t){return e??Ah[t]??Ah.DEFAULT}function nP(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"),c={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:dg},l="center";if(a&&(l="flex-end"),s&&(l="flex-start"),c.alignItems=l,i.includes("top")){let u=n.top;c.top=`max(env(safe-area-inset-top, 0px), ${u})`;}if(i.includes("bottom")){let u=n.bottom;c.bottom=`max(env(safe-area-inset-bottom, 0px), ${u})`;}if(!i.includes("left")){let u=n.right;c.insetInlineEnd=`calc(env(safe-area-inset-right, 0px) + ${u})`;}if(!i.includes("right")){let u=n.left;c.insetInlineStart=`calc(env(safe-area-inset-left, 0px) + ${u})`;}return c}function oP(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 iP(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 aP(e,t){return {position:"absolute",left:"0",height:"calc(var(--gap) + 2px)",bottom:"100%",width:"100%"}}function sP(e,t,r){function n(){return rg(e)?e.getState():e}function o(u){return hu(n().context.toasts,u)}function i(u){let f=n().context.toasts;return f.length?!!f.find(d=>d.id==u):false}function a(u){let f=`toast:${qi()}`,d=u.id?u.id:f;return i(d)||t({type:"ADD_TOAST",toast:{...u,id:d}}),d}function s(u,f){return i(u)&&t({type:"UPDATE_TOAST",id:u,toast:f}),u}function c(u){let{id:f}=u;return (f?i(f):false)&&f!=null?s(f,u):a(u)}function l(u){u==null?t("DISMISS_ALL"):i(u)&&t({type:"DISMISS_TOAST",id:u});}return {getCount(){return n().context.count},getPlacements(){let f=n().context.toasts.map(d=>d.state.context.placement);return Array.from(new Set(f))},getToastsByPlacement:o,isVisible:i,create:a,update:s,upsert:c,dismiss:l,remove(u){u==null?t("REMOVE_ALL"):i(u)&&t({type:"REMOVE_TOAST",id:u});},dismissByPlacement(u){o(u).forEach(d=>l(d.id));},loading(u){return c({...u,type:"loading"})},success(u){return c({...u,type:"success"})},error(u){return c({...u,type:"error"})},promise(u,f,d={}){let p=c({...d,...f.loading,type:"loading"});return Vr(u).then(h=>{let g=Vr(f.success,h);c({...d,...g,id:p,type:"success"});}).catch(h=>{let g=Vr(f.error,h);c({...d,...g,id:p,type:"error"});}).finally(()=>{f.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:f,label:d="Notifications"}=u,p=n(),h=p.context.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),[g,v="center"]=f.split("-");return r.element({...Zo.group.attrs,dir:p.context.dir,tabIndex:-1,"aria-label":`${f} ${d} ${h}`,id:Pt.getRegionId(f),"data-placement":f,"data-side":g,"data-align":v,"aria-live":"polite",role:"region",style:nP(p.context,f),onMouseMove(){t({type:"REGION.POINTER_ENTER",placement:f});},onMouseLeave(){t({type:"REGION.POINTER_LEAVE",placement:f});},onFocus(b){t({type:"REGION.FOCUS",target:b.relatedTarget});},onBlur(b){p.context.isFocusWithin&&!nr(b.currentTarget,b.relatedTarget)&&t({type:"REGION.BLUR"});}})},subscribe(u){let f=n();return Wo(f.context.toasts,()=>{let p=o(f.context.placement).map(h=>h.getState().context);u(p);})}}}var{not:lP,and:cP,or:uP}=Is;function dP(e){let{type:t="info",duration:r,id:n="1",placement:o="bottom",removeDelay:i=200,...a}=e,s=kt(a),c=Oh(r,t);return mr({id:n,context:{id:n,type:t,remaining:c,duration:c,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:cP("hasTypeChanged","isChangingToLoading"),target:"visible:persist",actions:["setContext"]},{guard:uP("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:lP("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(l,u,{self:f}){let d;return at(()=>{let p=Pt.getRootEl(l);if(!p)return;l.mounted=true;let h=Ms(p,"[data-ghost]");zr(h.length!==2,"[toast] No ghost element found in toast. Render the `ghostBefore` and `ghostAfter` elements");let g=()=>{let C=p.style.height;p.style.height="auto";let _=p.getBoundingClientRect().height;p.style.height=C,l.height=_,f.sendParent({type:"UPDATE_HEIGHT",id:f.id,height:_,placement:l.placement});};g();let v=Pt.getWin(l),b=new v.MutationObserver(g);b.observe(p,{childList:true,subtree:true,characterData:true}),d=()=>b.disconnect();}),()=>d?.()}},guards:{isChangingToLoading:(l,u)=>u.toast?.type==="loading",isLoadingType:l=>l.type==="loading",hasTypeChanged:(l,u)=>u.toast?.type!=null&&u.toast.type!==l.type,hasDurationChanged:(l,u)=>u.toast?.duration!=null&&u.toast.duration!==l.duration},delays:{VISIBLE_DURATION:l=>l.remaining,REMOVE_DELAY:l=>l.removeDelay},actions:{measureHeight(l,u,{self:f}){at(()=>{let d=Pt.getRootEl(l);if(!d)return;l.mounted=true;let p=d.style.height;d.style.height="auto";let h=d.getBoundingClientRect().height;d.style.height=p,l.height=h,f.sendParent({type:"UPDATE_HEIGHT",id:f.id,height:h,placement:l.placement});});},setRemainingDuration(l){l.remaining-=Date.now()-l.createdAt;},setCreatedAt(l){l.createdAt=Date.now();},notifyParentToRemove(l,u,{self:f}){f.sendParent({type:"REMOVE_TOAST",id:f.id});},invokeOnDismiss(l){l.onStatusChange?.({status:"dismissing"});},invokeOnUnmount(l){l.onStatusChange?.({status:"unmounted"});},invokeOnVisible(l){l.onStatusChange?.({status:"visible"});},setContext(l,u){let f=u.toast?.duration,d=u.toast?.type??l.type,p=Oh(f,d);Object.assign(l,{...u.toast,duration:p,remaining:p});}}})}function fP(e){let t=kt(e);return mr({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 xr(document,"keydown",a=>{r.hotkey.every(c=>a[c]||a.code===c)&&o({type:"DOC.HOTKEY"});},{capture:true})},trackDocumentVisibility(r,n,{send:o}){if(!r.pauseOnPageIdle)return;let i=Pt.getDoc(r);return xr(i,"visibilitychange",()=>{o(i.visibilityState==="hidden"?"PAUSE_ALL":"RESUME_ALL");})}},actions:{setDismissableBranch(r){let o=hu(r.toasts,r.placement).length>0;if(!o){r._cleanup?.();return}if(o&&r._cleanup)return;let i=()=>Pt.getRegionEl(r,r.placement);r._cleanup=Ih(i,{defer:true});},clearDismissableBranch(r){r._cleanup?.();},focusRegionEl(r){queueMicrotask(()=>{Pt.getRegionEl(r,r.placement)?.focus();});},expandToasts(r){Ys(r,n=>{n.state.context.stacked=true;});},collapseToasts(r){Ys(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=dP(a),c=o.spawn(s);r.toasts=[c,...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){Ys(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;Ys({...r,placement:o},i=>{let a=Math.max(r.heights.findIndex(c=>c.id===i.id),0),s=r.heights.reduce((c,l,u)=>u>=a?c:c+l.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 Ys(e,t){hu(e.toasts,e.placement).forEach(t);}function Dh(e,t,r){let n=e.hasTag("visible"),o=e.hasTag("paused"),i=e.context.placement,a=e.context.type,[s,c="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({...Zo.root.attrs,dir:e.context.dir,id:Pt.getRootId(e.context),"data-state":n?"open":"closed","data-type":a,"data-placement":i,"data-align":c,"data-side":s,"data-mounted":Wt(e.context.mounted),"data-paused":Wt(o),"data-first":Wt(e.context.frontmost),"data-sibling":Wt(!e.context.frontmost),"data-stack":Wt(e.context.stacked),"data-overlap":Wt(!e.context.stacked),role:"status","aria-atomic":"true","aria-describedby":e.context.description?Pt.getDescriptionId(e.context):void 0,"aria-labelledby":e.context.title?Pt.getTitleId(e.context):void 0,tabIndex:0,style:oP(e.context,n),onKeyDown(l){l.defaultPrevented||l.key=="Escape"&&(t("DISMISS"),l.preventDefault());}})},getGhostBeforeProps(){return r.element({"data-ghost":"before",style:iP(e.context,n)})},getGhostAfterProps(){return r.element({"data-ghost":"after",style:aP()})},getTitleProps(){return r.element({...Zo.title.attrs,id:Pt.getTitleId(e.context)})},getDescriptionProps(){return r.element({...Zo.description.attrs,id:Pt.getDescriptionId(e.context)})},getActionTriggerProps(){return r.button({...Zo.actionTrigger.attrs,type:"button",onClick(l){l.defaultPrevented||(e.context.action?.onClick?.(),t("DISMISS"));}})},getCloseTriggerProps(){return r.button({id:Pt.getCloseTriggerId(e.context),...Zo.closeTrigger.attrs,type:"button","aria-label":"Dismiss notification",onClick(l){l.defaultPrevented||t("DISMISS");}})}}}var qs={connect:sP,machine:fP};var bu=e=>{let t=qs.machine({id:"1",...e});return {...qs.connect(t,t.send,rr),machine:t}},[mP,Hn]=it({hookName:"useToastContext",providerName:"<ToastProvider />"}),Mh=e=>{let t=Hn(),r=ce(()=>t().getActionTriggerProps(),e);return m(ve.button,r)},Nh=e=>{let t=Hn(),r=ce(()=>t().getCloseTriggerProps(),e);return m(ve.button,r)},Lh=e=>e.children(Hn()),$h=e=>{let t=Hn(),r=ce(()=>t().getDescriptionProps(),e);return m(ve.div,r)},gP=T("<div><div></div><div>"),Bh=e=>{let t=Hn(),r=ce(()=>t().getRootProps(),e);return (()=>{var n=gP(),o=n.firstChild,i=o.nextSibling;return Re(n,r,false,true),Re(o,Oe(()=>t().getGhostBeforeProps()),false,false),x(n,()=>e.children,i),Re(i,Oe(()=>t().getGhostAfterProps()),false,false),n})()},Fh=e=>{let t=Hn(),r=ce(()=>t().getTitleProps(),e);return m(ve.div,r)},yu=e=>{let[t,r]=tt(e,["toaster","children"]),[n,o]=Ar(t.toaster.machine),i=n.context.placement,a=j(()=>qs.connect(n,o,rr)),s=j(()=>a().getToastsByPlacement(i)),c=ce(a().getGroupProps({placement:i}),r);return m(ve.div,Oe(c,{get children(){return m(Se,{get each(){return s()},children:l=>m(hP,{value:l,children:u=>t.children(u)})})}}))},hP=e=>{let[t,r]=sg(e.value),n=j(()=>Dh(t,r,rr)),o=j(()=>t.context);return m(mP,{value:n,get children(){return e.children(o)}})},Vn={};bn(Vn,{ActionTrigger:()=>Mh,CloseTrigger:()=>Nh,Context:()=>Lh,Description:()=>$h,Root:()=>Bh,Title:()=>Fh});var aa=(e,t)=>({x:e,y:t});function bP(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:aa(i,a)}}function yP(e){let t=aa(e.minX,e.minY),r=aa(e.maxX,e.minY),n=aa(e.maxX,e.maxY),o=aa(e.minX,e.maxY);return {top:t,right:r,bottom:n,left:o}}function Uh(e,t){let r=bP(e),{top:n,right:o,left:i,bottom:a}=yP(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 jh(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,c=e[i].y,l=e[a].x,u=e[a].y;c>n!=u>n&&r<(l-s)*(n-c)/(u-c)+s&&(o=!o);}return o}var Hh=hr("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem"),Dt=Hh.build(),se=hn({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=>se.getById(e,se.getContentId(e)),getPositionerEl:e=>se.getById(e,se.getPositionerId(e)),getTriggerEl:e=>se.getById(e,se.getTriggerId(e)),getHighlightedItemEl:e=>e.highlightedValue?se.getById(e,e.highlightedValue):null,getArrowEl:e=>se.getById(e,se.getArrowId(e)),getElements:e=>{let r=`[role^="menuitem"][data-ownedby=${CSS.escape(se.getContentId(e))}]:not([data-disabled])`;return Ms(se.getContentEl(e),r)},getFirstEl:e=>jm(se.getElements(e)),getLastEl:e=>Wm(se.getElements(e)),getNextEl:(e,t)=>vg(se.getElements(e),e.highlightedValue,t??e.loopFocus),getPrevEl:(e,t)=>xg(se.getElements(e),e.highlightedValue,t??e.loopFocus),getElemByKey:(e,t)=>iu(se.getElements(e),{state:e.typeaheadState,key:t,activeId:e.highlightedValue}),isTargetDisabled:e=>xt(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 Vh(e,t,r){let n=e.context.isSubmenu,o=e.context.isTypingAhead,i=e.context.composite,a=e.hasTag("open"),s=bh({...e.context.positioning,placement:e.context.anchorPoint?"bottom":e.context.currentPlacement});function c(d){return {disabled:!!d.disabled,highlighted:e.context.highlightedValue===d.value}}function l(d){let p=d.valueText??d.value;return {...d,id:d.value,valueText:p}}function u(d){return {...c(l(d)),checked:!!d.checked}}function f(d){let{value:p,closeOnSelect:h,valueText:g}=d,v=c(d);return r.element({...Dt.item.attrs,id:p,role:"menuitem","aria-disabled":v.disabled,"data-disabled":Wt(v.disabled),"data-ownedby":se.getContentId(e.context),"data-highlighted":Wt(v.highlighted),"data-valuetext":g,onDragStart(b){b.currentTarget.matches("a[href]")&&b.preventDefault();},onPointerMove(b){if(v.disabled||b.pointerType!=="mouse")return;let C=b.currentTarget;v.highlighted||t({type:"ITEM_POINTERMOVE",id:p,target:C,closeOnSelect:h});},onPointerLeave(b){if(v.disabled||b.pointerType!=="mouse"||!e.previousEvent.type.includes("POINTER"))return;let _=b.currentTarget;t({type:"ITEM_POINTERLEAVE",id:p,target:_,closeOnSelect:h});},onPointerDown(b){if(v.disabled)return;let C=b.currentTarget;t({type:"ITEM_POINTERDOWN",target:C,id:p,closeOnSelect:h});},onClick(b){if(ru(b)||tu(b)||v.disabled)return;let C=b.currentTarget;t({type:"ITEM_CLICK",target:C,id:p,closeOnSelect:h});}})}return {highlightedValue:e.context.highlightedValue,open:a,setOpen(d){d!==a&&t(d?"OPEN":"CLOSE");},setHighlightedValue(d){t({type:"HIGHLIGHTED.SET",id:d});},setParent(d){t({type:"PARENT.SET",value:d,id:d.state.context.id});},setChild(d){t({type:"CHILD.SET",value:d,id:d.state.context.id});},reposition(d={}){t({type:"POSITIONING.SET",options:d});},getContextTriggerProps(){return r.element({...Dt.contextTrigger.attrs,dir:e.context.dir,id:se.getContextTriggerId(e.context),onPointerDown(d){if(d.pointerType==="mouse")return;let p=zs(d);t({type:"CONTEXT_MENU_START",point:p});},onPointerCancel(d){d.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL");},onPointerMove(d){d.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL");},onPointerUp(d){d.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL");},onContextMenu(d){let p=zs(d);t({type:"CONTEXT_MENU",point:p}),d.preventDefault();},style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"}})},getTriggerItemProps(d){return As(f({value:d.getTriggerProps().id}),d.getTriggerProps())},getTriggerProps(){return r.button({...n?Dt.triggerItem.attrs:Dt.trigger.attrs,"data-placement":e.context.currentPlacement,type:"button",dir:e.context.dir,id:se.getTriggerId(e.context),"data-uid":e.context.id,"aria-haspopup":i?"menu":"dialog","aria-controls":se.getContentId(e.context),"aria-expanded":a||void 0,"data-state":a?"open":"closed",onPointerMove(d){d.pointerType!=="mouse"||se.isTargetDisabled(d.currentTarget)||!n||t({type:"TRIGGER_POINTERMOVE",target:d.currentTarget});},onPointerLeave(d){if(se.isTargetDisabled(d.currentTarget)||d.pointerType!=="mouse"||!n)return;let p=zs(d);t({type:"TRIGGER_POINTERLEAVE",target:d.currentTarget,point:p});},onPointerDown(d){se.isTargetDisabled(d.currentTarget)||Vs(d)||d.preventDefault();},onClick(d){d.defaultPrevented||se.isTargetDisabled(d.currentTarget)||t({type:"TRIGGER_CLICK",target:d.currentTarget});},onBlur(){t("TRIGGER_BLUR");},onFocus(){t("TRIGGER_FOCUS");},onKeyDown(d){if(d.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"});}},h=gu(d,e.context),g=p[h];g&&(d.preventDefault(),g(d));}})},getIndicatorProps(){return r.element({...Dt.indicator.attrs,dir:e.context.dir,"data-state":a?"open":"closed"})},getPositionerProps(){return r.element({...Dt.positioner.attrs,dir:e.context.dir,id:se.getPositionerId(e.context),style:s.floating})},getArrowProps(){return r.element({id:se.getArrowId(e.context),...Dt.arrow.attrs,dir:e.context.dir,style:s.arrow})},getArrowTipProps(){return r.element({...Dt.arrowTip.attrs,dir:e.context.dir,style:s.arrowTip})},getContentProps(){return r.element({...Dt.content.attrs,id:se.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":se.getTriggerId(e.context),"data-placement":e.context.currentPlacement,onPointerEnter(d){d.pointerType==="mouse"&&t("MENU_POINTERENTER");},onKeyDown(d){if(d.defaultPrevented||!yg(d))return;let p=Rr(d);if(!(p?.closest("[role=menu]")===d.currentTarget||p===d.currentTarget))return;if(d.key==="Tab"&&!_g(d)){d.preventDefault();return}let g=se.getHighlightedItemEl(e.context),v={ArrowDown(){t("ARROW_DOWN");},ArrowUp(){t("ARROW_UP");},ArrowLeft(){t("ARROW_LEFT");},ArrowRight(){t("ARROW_RIGHT");},Enter(){t("ENTER"),wh(g);},Space(_){o?t({type:"TYPEAHEAD",key:_.key}):v.Enter?.(_);},Home(){t("HOME");},End(){t("END");}},b=gu(d,{dir:e.context.dir}),C=v[b];if(C){C(d),d.stopPropagation(),d.preventDefault();return}e.context.typeahead&&vh(d)&&(xh(d)||su(p)||(t({type:"TYPEAHEAD",key:d.key}),d.preventDefault()));}})},getSeparatorProps(){return r.element({...Dt.separator.attrs,role:"separator",dir:e.context.dir,"aria-orientation":"horizontal"})},getItemState:c,getItemProps:f,getOptionItemState:u,getOptionItemProps(d){let{type:p,disabled:h,onCheckedChange:g,closeOnSelect:v}=d,b=l(d),C=u(d);return {...f(b),...r.element({"data-type":p,...Dt.item.attrs,dir:e.context.dir,"data-value":b.value,role:`menuitem${p}`,"aria-checked":!!C.checked,"data-state":C.checked?"checked":"unchecked",onClick(_){if(h||ru(_)||tu(_))return;let k=_.currentTarget;t({type:"ITEM_CLICK",target:k,option:b,closeOnSelect:v}),g?.(!C.checked);}})}},getItemIndicatorProps(d){let p=u(d);return r.element({...Dt.itemIndicator.attrs,dir:e.context.dir,"data-disabled":Wt(p.disabled),"data-highlighted":Wt(p.highlighted),"data-state":p.checked?"checked":"unchecked",hidden:!p.checked})},getItemTextProps(d){let p=u(d);return r.element({...Dt.itemText.attrs,dir:e.context.dir,"data-disabled":Wt(p.disabled),"data-highlighted":Wt(p.highlighted),"data-state":p.checked?"checked":"unchecked"})},getItemGroupLabelProps(d){return r.element({id:se.getGroupLabelId(e.context,d.htmlFor),dir:e.context.dir,...Dt.itemGroupLabel.attrs})},getItemGroupProps(d){return r.element({id:se.getGroupId(e.context,d.id),...Dt.itemGroup.attrs,dir:e.context.dir,"aria-labelledby":se.getGroupLabelId(e.context,d.id),role:"group"})}}}var{not:ar,and:Qo,or:vP}=Is;function zh(e){let t=kt(e);return mr({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:iu.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:vP("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:Qo(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:Qo("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:Qo(ar("suspendPointer"),ar("isTriggerItem")),actions:"clearHighlightedItem"},ITEM_CLICK:[{guard:Qo(ar("isTriggerItemHighlighted"),ar("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Qo(ar("isTriggerItemHighlighted"),ar("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Qo(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)=>se.isTriggerItem(n.target),isTriggerItemHighlighted:(r,n)=>!!(n.target??se.getHighlightedItemEl(r))?.hasAttribute("aria-controls"),isSubmenu:r=>r.isSubmenu,suspendPointer:r=>r.suspendPointer,isHighlightedItemEditable:r=>su(se.getHighlightedItemEl(r)),isWithinPolygon:(r,n)=>r.intentPolygon?jh(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=()=>se.getPositionerEl(r);return pu(se.getTriggerEl(r),n,{...r.positioning,defer:true,onComplete(o){r.currentPlacement=o.placement;}})},trackInteractOutside(r,n,{send:o}){return Gs(()=>se.getContentEl(r),{defer:true,exclude:[se.getTriggerEl(r)],onInteractOutside:r.onInteractOutside,onFocusOutside:r.onFocusOutside,onEscapeKeyDown(a){r.onEscapeKeyDown?.(a),r.isSubmenu&&a.preventDefault(),Wh(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=se.getDoc(r);return xr(s,"pointermove",c=>{let l={x:c.clientX,y:c.clientY};a(r,{point:l})||(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 c=se.getHighlightedItemEl(r),l=se.getContentEl(r);Eg(c,{rootEl:l,block:"nearest"});};return at(()=>i()),Pg(()=>se.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=()=>se.getPositionerEl(r),i=r.anchorPoint?()=>({width:0,height:0,...r.anchorPoint}):void 0;pu(se.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=se.getHighlightedItemEl(r);!o||o.dataset.disabled||queueMicrotask(()=>o.click());},setIntentPolygon(r,n){let o=se.getContentEl(r),i=r.currentPlacement;if(!o||!i)return;let a=o.getBoundingClientRect(),s=Uh(a,i);if(!s)return;let l=gh(i)==="right"?-5:5;r.intentPolygon=[{...n.point,x:n.point.x+l},...s];},clearIntentPolygon(r){r.intentPolygon=null;},resumePointer(r){r.parent&&(r.parent.state.context.suspendPointer=false);},setHighlightedItem(r,n){yn.highlighted(r,n.id);},clearHighlightedItem(r){yn.highlighted(r,null);},focusMenu(r){at(()=>{let n=se.getContentEl(r);Cg({root:n,enabled:!nr(n,se.getActiveElement(r)),filter(i){return !i.role?.startsWith("menuitem")}})?.focus({preventScroll:true});});},highlightFirstItem(r){(se.getContentEl(r)?queueMicrotask:at)(()=>{let o=se.getFirstEl(r);o&&yn.highlighted(r,o.id);});},highlightLastItem(r){(se.getContentEl(r)?queueMicrotask:at)(()=>{let o=se.getLastEl(r);o&&yn.highlighted(r,o.id);});},highlightNextItem(r,n){let o=se.getNextEl(r,n.loop);yn.highlighted(r,o?.id??null);},highlightPrevItem(r,n){let o=se.getPrevEl(r,n.loop);yn.highlighted(r,o?.id??null);},invokeOnSelect(r){r.highlightedValue&&r.onSelect?.({value:r.highlightedValue});},focusTrigger(r){r.isSubmenu||r.anchorPoint||!r.restoreFocus||queueMicrotask(()=>se.getTriggerEl(r)?.focus({preventScroll:true}));},highlightMatchedItem(r,n){let o=se.getElemByKey(r,n.key);o&&yn.highlighted(r,o.id);},setParentMenu(r,n){r.parent=zt(n.value);},setChildMenu(r,n){r.children[n.id]=zt(n.value);},closeRootMenu(r){Wh(r);},openSubmenu(r){let o=se.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&&(yn.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 Wh(e){let t=e.parent;for(;t&&t.state.context.isSubmenu;)t=t.state.context.parent;t?.send("CLOSE");}var yn={highlighted(e,t){Ps(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[Gh,ct]=it({hookName:"useMenuContext",providerName:"<MenuProvider />",strict:false}),Yh=e=>{let t=ct(),r=ce(()=>t().getArrowProps(),e);return m(ve.div,r)},qh=e=>{let t=ct(),r=ce(()=>t().getArrowTipProps(),e);return m(ve.div,r)},[vu,Kh]=it({hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[Xh,Zh]=it({hookName:"useMenuOptionItemPropsContext",providerName:"<MenuOptionItemPropsProvider />"}),Qh=e=>{let[t,r]=vt()(e,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),n=ce(t,{type:"checkbox"}),o=ct(),i=ce(()=>o().getOptionItemProps(n),r),a=j(()=>o().getItemState(n));return m(Xh,{value:n,get children(){return m(vu,{value:a,get children(){return m(ve.div,i)}})}})},Jh=e=>{let t=ct(),r=gn(),n=ce(()=>t().getContentProps(),()=>r().presenceProps,e);return m(F,{get when(){return !r().unmounted},get children(){return m(ve.div,n)}})},eb=e=>e.children(ct()),tb=e=>{let t=ct(),r=ce(()=>t().getContextTriggerProps(),e);return m(ve.button,r)},rb=e=>{let t=ct(),r=ce(()=>t().getIndicatorProps(),e);return m(ve.div,r)},nb=e=>{let[t,r]=vt()(e,["closeOnSelect","disabled","value","valueText"]),n=ct(),o=ce(()=>n().getItemProps(t),r),i=j(()=>n().getItemState(t));return m(vu,{value:i,get children(){return m(ve.div,o)}})},ob=e=>e.children(Kh()),[ib,ab]=it({hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),sb=e=>{let[t,r]=vt()(e,["id"]),n=ce({id:Sr()},t),o=ct(),i=ce(()=>o().getItemGroupProps(n),r);return m(ib,{value:n,get children(){return m(ve.div,i)}})},lb=e=>{let t=ct(),r=ab(),n=ce(t().getItemGroupLabelProps({htmlFor:r.id}),e);return m(ve.div,n)},cb=e=>{let t=ct(),r=Zh(),n=ce(()=>t().getItemIndicatorProps(r),e);return m(ve.div,n)},ub=e=>{let t=ct(),r=Zh(),n=ce(()=>t().getItemTextProps(r),e);return m(ve.div,n)},db=e=>{let t=ct(),r=gn(),n=ce(()=>t().getPositionerProps(),e);return m(F,{get when(){return !r().unmounted},get children(){return m(ve.div,n)}})},fb=e=>{let[t,r]=vt()(e,["closeOnSelect","disabled","value","valueText"]),n=ct(),o=ab(),i=ce(t,()=>({type:"radio",checked:o.value===t.value,onCheckedChange:()=>o.onValueChange?.({value:t.value})})),a=ce(()=>n().getOptionItemProps(i),r),s=j(()=>n().getOptionItemState(i));return m(Xh,{value:i,get children(){return m(vu,{value:s,get children(){return m(ve.div,a)}})}})},pb=e=>{let[t,r]=vt()(e,["id","onValueChange","value"]),n=ct(),o=ce({id:Sr()},t),i=ce(()=>n().getItemGroupProps(o),r);return m(ib,{value:o,get children(){return m(ve.div,i)}})},mb=e=>{let t=zo(),r=Ln(),n=Sr(),o=j(()=>({id:n,dir:t().dir,getRootNode:r().getRootNode,open:e.defaultOpen,"open.controlled":e.open!==void 0,...e})),[i,a,s]=Ar(zh(o()),{context:o});return {api:j(()=>Vh(i,a,rr)),machine:s}},[gb,hb]=it({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:false}),[bb,kP]=it({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:false}),yb=e=>{let[t,r]=Ho(e),[n,o]=vt()(r,["anchorPoint","aria-label","closeOnSelect","composite","defaultOpen","highlightedValue","id","ids","loopFocus","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),i=ct(),a=hb(),s=mb(n),c=Nn(ce(t,()=>({present:s.api().open})));return _e(()=>{a&&(i?.().setChild(s.machine),s.api().setParent(a));}),m(bb,{value:()=>i?.().getTriggerItemProps(s.api()),get children(){return m(gb,{get value(){return s.machine},get children(){return m(Gh,{get value(){return s.api},get children(){return m(Vo,{value:c,get children(){return o.children}})}})}})}})},vb=e=>{let t=ct(),r=hb(),[n,o]=Ho(e),i=Nn(ce(n,()=>({present:o.value.api().open})));return _e(()=>{r&&(t?.().setChild(o.value.machine),o.value.api().setParent(r));}),m(bb,{value:()=>t?.().getTriggerItemProps(o.value.api()),get children(){return m(gb,{get value(){return o.value.machine},get children(){return m(Gh,{get value(){return o.value.api},get children(){return m(Vo,{value:i,get children(){return o.children}})}})}})}})},xb=e=>{let t=ct(),r=ce(()=>t().getSeparatorProps(),e);return m(ve.hr,r)},wb=e=>{let t=ct(),r=gn(),n=ce(()=>t().getTriggerProps(),()=>({"aria-controls":r().unmounted&&null}),e);return m(ve.button,n)},Tb=e=>{let t=kP(),r=ce(()=>t?.(),e);return m(ve.div,r)},Kr={};bn(Kr,{Arrow:()=>Yh,ArrowTip:()=>qh,CheckboxItem:()=>Qh,Content:()=>Jh,Context:()=>eb,ContextTrigger:()=>tb,Indicator:()=>rb,Item:()=>nb,ItemContext:()=>ob,ItemGroup:()=>sb,ItemGroupLabel:()=>lb,ItemIndicator:()=>cb,ItemText:()=>ub,Positioner:()=>db,RadioItem:()=>fb,RadioItemGroup:()=>pb,Root:()=>yb,RootProvider:()=>vb,Separator:()=>xb,Trigger:()=>wb,TriggerItem:()=>Tb});var Cb=hr("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange"),Xr=Cb.build(),Ks=hn({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,c=e.context.translations,l=e.context.isIndeterminate,u=e.context.value,f=c.value({value:u,max:i,percent:n,min:a}),d=PP(u,i),p={role:"progressbar","aria-label":f,"data-max":i,"aria-valuemin":a,"aria-valuemax":i,"aria-valuenow":u??void 0,"data-orientation":s,"data-state":d},h=EP(e.context);return {value:u,valueAsString:f,min:a,max:i,percent:n,percentAsString:o,indeterminate:l,setValue(g){t({type:"VALUE.SET",value:g});},setToMax(){t({type:"VALUE.SET",value:i});},setToMin(){t({type:"VALUE.SET",value:a});},getRootProps(){return r.element({dir:e.context.dir,...Xr.root.attrs,id:Ks.getRootId(e.context),"data-max":i,"data-value":u??void 0,"data-state":d,"data-orientation":s,style:{"--percent":l?void 0:n}})},getLabelProps(){return r.element({dir:e.context.dir,id:Ks.getLabelId(e.context),...Xr.label.attrs,"data-orientation":s})},getValueTextProps(){return r.element({dir:e.context.dir,"aria-live":"polite",...Xr.valueText.attrs})},getTrackProps(){return r.element({dir:e.context.dir,id:Ks.getTrackId(e.context),...Xr.track.attrs,...p})},getRangeProps(){return r.element({dir:e.context.dir,...Xr.range.attrs,"data-orientation":s,"data-state":d,style:{[e.context.isHorizontal?"width":"height"]:l?void 0:`${n}%`}})},getCircleProps(){return r.element({dir:e.context.dir,id:Ks.getCircleId(e.context),...Xr.circle.attrs,...p,...h.root})},getCircleTrackProps(){return r.element({dir:e.context.dir,"data-orientation":s,...Xr.circleTrack.attrs,...h.track})},getCircleRangeProps(){return r.element({dir:e.context.dir,...Xr.circleRange.attrs,...h.range,"data-state":d})},getViewProps(g){return r.element({dir:e.context.dir,...Xr.view.attrs,"data-state":g.state,hidden:g.state!==d})}}}function PP(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function EP(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 IP(e,t){return e+(t-e)/2}function Sb(e){let t=kt(e);return mr({id:"progress",initial:"idle",context:{max:t.max??100,min:t.min??0,value:IP(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 Zi(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(!xu(r.max))throw new Error(`[progress] The max value passed \`${r.max}\` is not a valid number`);if(!AP(r.value,r.max))throw new Error(`[progress] The value passed \`${r.value}\` exceeds the max value \`${r.max}\``);if(!OP(r.value,r.min))throw new Error(`[progress] The value passed \`${r.value}\` exceeds the min value \`${r.min}\``)}}}})}function xu(e){return Zi(e)&&!isNaN(e)}function AP(e,t){return xu(e)&&e<=t}function OP(e,t){return xu(e)&&e>=t}tr()(["dir","getRootNode","id","ids","max","min","orientation","translations","value"]);var[kb,Lr]=it({hookName:"useProgressContext",providerName:"<ProgressProvider />"}),Pb=e=>{let t=Lr(),r=ce(()=>t().getCircleProps(),e);return m(ve.svg,r)},Eb=e=>{let t=Lr(),r=ce(()=>t().getCircleRangeProps(),e);return m(ve.circle,r)},Ib=e=>{let t=Lr(),r=ce(()=>t().getCircleTrackProps(),e);return m(ve.circle,r)},Ab=e=>e.children(Lr()),Ob=e=>{let t=Lr(),r=ce(()=>t().getLabelProps(),e);return m(ve.label,r)},Rb=e=>{let t=Lr(),r=ce(()=>t().getRangeProps(),e);return m(ve.div,r)},Db=e=>{let t=zo(),r=Ln(),n=Sr(),o=j(()=>({id:n,dir:t().dir,getRootNode:r().getRootNode,...e})),[i,a]=Ar(Sb(o()),{context:o});return j(()=>_b(i,a,rr))},Mb=e=>{let[t,r]=vt()(e,["id","ids","max","min","orientation","translations","value"]),n=Db(t),o=ce(()=>n().getRootProps(),r);return m(kb,{value:n,get children(){return m(ve.div,o)}})},Nb=e=>{let[{value:t},r]=vt()(e,["value"]),n=ce(()=>t().getRootProps(),r);return m(kb,{value:t,get children(){return m(ve.div,n)}})},Lb=e=>{let t=Lr(),r=ce(()=>t().getTrackProps(),e);return m(ve.div,r)},$b=e=>{let t=Lr(),r=ce(()=>t().getValueTextProps(),e);return m(ve.span,Oe(r,{get children(){return e.children||t().percentAsString}}))},Bb=e=>{let[t,r]=vt()(e,["state"]),n=Lr(),o=ce(()=>n().getViewProps(t),r);return m(ve.span,o)},zn={};bn(zn,{Circle:()=>Pb,CircleRange:()=>Eb,CircleTrack:()=>Ib,Context:()=>Ab,Label:()=>Ob,Range:()=>Rb,Root:()=>Mb,RootProvider:()=>Nb,Track:()=>Lb,ValueText:()=>$b,View:()=>Bb});var MP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Jo=new WeakMap,Xs=new WeakMap,Zs={},wu=0,Fb=function(e){return e&&(e.host||Fb(e.parentNode))},NP=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Fb(r);return n&&e.contains(n)?n:null}).filter(function(r){return !!r})},LP=function(e,t,r,n){var o=NP(t,Array.isArray(e)?e:[e]);Zs[r]||(Zs[r]=new WeakMap);var i=Zs[r],a=[],s=new Set,c=new Set(o),l=function(f){!f||s.has(f)||(s.add(f),l(f.parentNode));};o.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(s.has(d))u(d);else try{var p=d.getAttribute(n),h=p!==null&&p!=="false",g=(Jo.get(d)||0)+1,v=(i.get(d)||0)+1;Jo.set(d,g),i.set(d,v),a.push(d),g===1&&h&&Xs.set(d,!0),v===1&&d.setAttribute(r,"true"),h||d.setAttribute(n,"true");}catch{}});};return u(t),s.clear(),wu++,function(){a.forEach(function(f){var d=Jo.get(f)-1,p=i.get(f)-1;Jo.set(f,d),i.set(f,p),d||(Xs.has(f)||f.removeAttribute(n),Xs.delete(f)),p||f.removeAttribute(r);}),wu--,wu||(Jo=new WeakMap,Jo=new WeakMap,Xs=new WeakMap,Zs={});}},Ub=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=MP(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live]"))),LP(n,o,r,"aria-hidden")):function(){return null}};var $P=e=>{let t=requestAnimationFrame(()=>e());return ()=>cancelAnimationFrame(t)};function jb(e,t={}){let{defer:r=true}=t,n=r?$P:i=>i(),o=[];return o.push(n(()=>{let a=(typeof e=="function"?e():e).filter(Boolean);o.push(Ub(a));})),()=>{o.forEach(i=>i?.());}}var Tu="data-scroll-lock";function Wb(e,t){if(!e)return;let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r;}}function BP(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 FP(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function Hb(e){let t=e??document,r=t.defaultView??window,{documentElement:n,body:o}=t;if(o.hasAttribute(Tu))return;o.setAttribute(Tu,"");let a=r.innerWidth-n.clientWidth,s=()=>BP(n,"--scrollbar-width",`${a}px`),c=FP(n),l=()=>Wb(o,{overflow:"hidden",[c]:`${a}px`}),u=()=>{let{scrollX:d,scrollY:p,visualViewport:h}=r,g=h?.offsetLeft??0,v=h?.offsetTop??0,b=Wb(o,{position:"fixed",overflow:"hidden",top:`${-(p-Math.floor(v))}px`,left:`${-(d-Math.floor(g))}px`,right:"0",[c]:`${a}px`});return ()=>{b?.(),r.scrollTo({left:d,top:p,behavior:"instant"});}},f=[s(),bg()?u():l()];return ()=>{f.forEach(d=>d?.()),o.removeAttribute(Tu);}}var zb=["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])"],Qs=zb.join(","),Gb=typeof Element>"u",Gn=Gb?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Js=!Gb&&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},el=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},UP=function(t){var r,n=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return n===""||n==="true"},Yb=function(t,r,n){if(el(t))return [];var o=Array.prototype.slice.apply(t.querySelectorAll(Qs));return r&&Gn.call(t,Qs)&&o.unshift(t),o=o.filter(n),o},qb=function e(t,r,n){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!el(a,false))if(a.tagName==="SLOT"){var s=a.assignedElements(),c=s.length?s:a.children,l=e(c,true,n);n.flatten?o.push.apply(o,l):o.push({scopeParent:a,candidates:l});}else {var u=Gn.call(a,Qs);u&&n.filter(a)&&(r||!t.includes(a))&&o.push(a);var f=a.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(a),d=!el(f,false)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(f&&d){var p=e(f===true?a.children:f.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},Kb=function(t){return !isNaN(parseInt(t.getAttribute("tabindex"),10))},vn=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||UP(t))&&!Kb(t)?0:t.tabIndex},jP=function(t,r){var n=vn(t);return n<0&&r&&!Kb(t)?0:n},WP=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},Xb=function(t){return t.tagName==="INPUT"},HP=function(t){return Xb(t)&&t.type==="hidden"},VP=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return r},zP=function(t,r){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===r)return t[n]},GP=function(t){if(!t.name)return true;var r=t.form||Js(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=zP(o,t.form);return !i||i===t},YP=function(t){return Xb(t)&&t.type==="radio"},qP=function(t){return YP(t)&&!GP(t)},KP=function(t){var r,n=t&&Js(t),o=(r=n)===null||r===void 0?void 0:r.host,i=false;if(n&&n!==t){var a,s,c;for(i=!!((a=o)!==null&&a!==void 0&&(s=a.ownerDocument)!==null&&s!==void 0&&s.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!i&&o;){var l,u,f;n=Js(o),o=(l=n)===null||l===void 0?void 0:l.host,i=!!((u=o)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(o));}}return i},Vb=function(t){var r=t.getBoundingClientRect(),n=r.width,o=r.height;return n===0&&o===0},XP=function(t,r){var n=r.displayCheck,o=r.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return true;var i=Gn.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(Gn.call(a,"details:not([open]) *"))return true;if(!n||n==="full"||n==="legacy-full"){if(typeof o=="function"){for(var s=t;t;){var c=t.parentElement,l=Js(t);if(c&&!c.shadowRoot&&o(c)===true)return Vb(t);t.assignedSlot?t=t.assignedSlot:!c&&l!==t.ownerDocument?t=l.host:t=c;}t=s;}if(KP(t))return !t.getClientRects().length;if(n!=="legacy-full")return true}else if(n==="non-zero-area")return Vb(t);return false},ZP=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 Gn.call(r,"fieldset[disabled] *")?true:!o.contains(t)}return true}r=r.parentElement;}return false},tl=function(t,r){return !(r.disabled||el(r)||HP(r)||XP(r,t)||VP(r)||ZP(r))},Cu=function(t,r){return !(qP(r)||vn(r)<0||!tl(t,r))},QP=function(t){var r=parseInt(t.getAttribute("tabindex"),10);return !!(isNaN(r)||r>=0)},JP=function e(t){var r=[],n=[];return t.forEach(function(o,i){var a=!!o.scopeParent,s=a?o.scopeParent:o,c=jP(s,a),l=a?e(o.candidates):s;c===0?a?r.push.apply(r,l):r.push(s):n.push({documentOrder:i,tabIndex:c,item:o,isScope:a,content:l});}),n.sort(WP).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(r)},Zb=function(t,r){r=r||{};var n;return r.getShadowRoot?n=qb([t],r.includeContainer,{filter:Cu.bind(null,r),flatten:false,getShadowRoot:r.getShadowRoot,shadowRootFilter:QP}):n=Yb(t,r.includeContainer,Cu.bind(null,r)),JP(n)},Qb=function(t,r){r=r||{};var n;return r.getShadowRoot?n=qb([t],r.includeContainer,{filter:tl.bind(null,r),flatten:true,getShadowRoot:r.getShadowRoot}):n=Yb(t,r.includeContainer,tl.bind(null,r)),n},Yn=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return Gn.call(t,Qs)===false?false:Cu(r,t)},eE=zb.concat("iframe").join(","),rl=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return Gn.call(t,eE)===false?false:tl(r,t)};function tE(e,t,r){return (t=nE(t))in e?Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true}):e[t]=r,e}function Jb(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 ey(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jb(Object(r),true).forEach(function(n){tE(e,n,r[n]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));});}return e}function rE(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 nE(e){var t=rE(e,"string");return typeof t=="symbol"?t:t+""}var ty={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();}},oE=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},iE=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},la=function(t){return t?.key==="Tab"||t?.keyCode===9},aE=function(t){return la(t)&&!t.shiftKey},sE=function(t){return la(t)&&t.shiftKey},ry=function(t){return setTimeout(t,0)},ny=function(t,r){var n=-1;return t.every(function(o,i){return r(o)?(n=i,false):true}),n},sa=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},nl=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},lE=[],oy=function(t,r){var n=r?.document||document,o=r?.trapStack||lE,i=ey({returnFocusOnDeactivate:true,escapeDeactivates:true,delayInitialFocus:true,isKeyForward:aE,isKeyBackward:sE},r),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:false,paused:false,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s,c=function(P,w,A){return P&&P[w]!==void 0?P[w]:i[A||w]},l=function(P,w){var A=typeof w?.composedPath=="function"?w.composedPath():void 0;return a.containerGroups.findIndex(function(M){var X=M.container,me=M.tabbableNodes;return X.contains(P)||A?.includes(X)||me.find(function(ee){return ee===P})})},u=function(P){var w=i[P];if(typeof w=="function"){for(var A=arguments.length,M=new Array(A>1?A-1:0),X=1;X<A;X++)M[X-1]=arguments[X];w=w.apply(void 0,M);}if(w===true&&(w=void 0),!w){if(w===void 0||w===false)return w;throw new Error("`".concat(P,"` was specified but was not a node, or did not return a node"))}var me=w;if(typeof w=="string"&&(me=n.querySelector(w),!me))throw new Error("`".concat(P,"` as selector refers to no known node"));return me},f=function(){var P=u("initialFocus");if(P===false)return false;if(P===void 0||!rl(P,i.tabbableOptions))if(l(n.activeElement)>=0)P=n.activeElement;else {var w=a.tabbableGroups[0],A=w&&w.firstTabbableNode;P=A||u("fallbackFocus");}if(!P)throw new Error("Your focus-trap needs to have at least one focusable element");return P},d=function(){if(a.containerGroups=a.containers.map(function(P){var w=Zb(P,i.tabbableOptions),A=Qb(P,i.tabbableOptions),M=w.length>0?w[0]:void 0,X=w.length>0?w[w.length-1]:void 0,me=A.find(function(Ae){return Yn(Ae)}),ee=A.slice().reverse().find(function(Ae){return Yn(Ae)}),Ue=!!w.find(function(Ae){return vn(Ae)>0});return {container:P,tabbableNodes:w,focusableNodes:A,posTabIndexesFound:Ue,firstTabbableNode:M,lastTabbableNode:X,firstDomTabbableNode:me,lastDomTabbableNode:ee,nextTabbableNode:function(ut){var Nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:true,dt=w.indexOf(ut);return dt<0?Nt?A.slice(A.indexOf(ut)+1).find(function(Lt){return Yn(Lt)}):A.slice(0,A.indexOf(ut)).reverse().find(function(Lt){return Yn(Lt)}):w[dt+(Nt?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(P){return P.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(P){return P.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(P){var w=P.activeElement;if(w)return w.shadowRoot&&w.shadowRoot.activeElement!==null?p(w.shadowRoot):w},h=function(P){if(P!==false&&P!==p(document)){if(!P||!P.focus){h(f());return}P.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=P,oE(P)&&P.select();}},g=function(P){var w=u("setReturnFocus",P);return w||(w===false?false:P)},v=function(P){var w=P.target,A=P.event,M=P.isBackward,X=M===void 0?false:M;w=w||nl(A),d();var me=null;if(a.tabbableGroups.length>0){var ee=l(w,A),Ue=ee>=0?a.containerGroups[ee]:void 0;if(ee<0)X?me=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:me=a.tabbableGroups[0].firstTabbableNode;else if(X){var Ae=ny(a.tabbableGroups,function($t){var Ye=$t.firstTabbableNode;return w===Ye});if(Ae<0&&(Ue.container===w||rl(w,i.tabbableOptions)&&!Yn(w,i.tabbableOptions)&&!Ue.nextTabbableNode(w,false))&&(Ae=ee),Ae>=0){var ut=Ae===0?a.tabbableGroups.length-1:Ae-1,Nt=a.tabbableGroups[ut];me=vn(w)>=0?Nt.lastTabbableNode:Nt.lastDomTabbableNode;}else la(A)||(me=Ue.nextTabbableNode(w,false));}else {var dt=ny(a.tabbableGroups,function($t){var Ye=$t.lastTabbableNode;return w===Ye});if(dt<0&&(Ue.container===w||rl(w,i.tabbableOptions)&&!Yn(w,i.tabbableOptions)&&!Ue.nextTabbableNode(w))&&(dt=ee),dt>=0){var Lt=dt===a.tabbableGroups.length-1?0:dt+1,Kt=a.tabbableGroups[Lt];me=vn(w)>=0?Kt.firstTabbableNode:Kt.firstDomTabbableNode;}else la(A)||(me=Ue.nextTabbableNode(w));}}else me=u("fallbackFocus");return me},b=function(P){var w=nl(P);if(!(l(w,P)>=0)){if(sa(i.clickOutsideDeactivates,P)){s.deactivate({returnFocus:i.returnFocusOnDeactivate});return}sa(i.allowOutsideClick,P)||P.preventDefault();}},C=function(P){var w=nl(P),A=l(w,P)>=0;if(A||w instanceof Document)A&&(a.mostRecentlyFocusedNode=w);else {P.stopImmediatePropagation();var M,X=true;if(a.mostRecentlyFocusedNode)if(vn(a.mostRecentlyFocusedNode)>0){var me=l(a.mostRecentlyFocusedNode),ee=a.containerGroups[me].tabbableNodes;if(ee.length>0){var Ue=ee.findIndex(function(Ae){return Ae===a.mostRecentlyFocusedNode});Ue>=0&&(i.isKeyForward(a.recentNavEvent)?Ue+1<ee.length&&(M=ee[Ue+1],X=false):Ue-1>=0&&(M=ee[Ue-1],X=false));}}else a.containerGroups.some(function(Ae){return Ae.tabbableNodes.some(function(ut){return vn(ut)>0})})||(X=false);else X=false;X&&(M=v({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),h(M||a.mostRecentlyFocusedNode||f());}a.recentNavEvent=void 0;},_=function(P){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:false;a.recentNavEvent=P;var A=v({event:P,isBackward:w});A&&(la(P)&&P.preventDefault(),h(A));},k=function(P){(i.isKeyForward(P)||i.isKeyBackward(P))&&_(P,i.isKeyBackward(P));},I=function(P){iE(P)&&sa(i.escapeDeactivates,P)!==false&&(P.preventDefault(),s.deactivate());},B=function(P){var w=nl(P);l(w,P)>=0||sa(i.clickOutsideDeactivates,P)||sa(i.allowOutsideClick,P)||(P.preventDefault(),P.stopImmediatePropagation());},D=function(){if(a.active)return ty.activateTrap(o,s),a.delayInitialFocusTimer=i.delayInitialFocus?ry(function(){h(f());}):h(f()),n.addEventListener("focusin",C,true),n.addEventListener("mousedown",b,{capture:true,passive:false}),n.addEventListener("touchstart",b,{capture:true,passive:false}),n.addEventListener("click",B,{capture:true,passive:false}),n.addEventListener("keydown",k,{capture:true,passive:false}),n.addEventListener("keydown",I),s},oe=function(){if(a.active)return n.removeEventListener("focusin",C,true),n.removeEventListener("mousedown",b,true),n.removeEventListener("touchstart",b,true),n.removeEventListener("click",B,true),n.removeEventListener("keydown",k,true),n.removeEventListener("keydown",I),s},H=function(P){var w=P.some(function(A){var M=Array.from(A.removedNodes);return M.some(function(X){return X===a.mostRecentlyFocusedNode})});w&&h(f());},V=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(H):void 0,L=function(){V&&(V.disconnect(),a.active&&!a.paused&&a.containers.map(function(P){V.observe(P,{subtree:true,childList:true});}));};return s={get active(){return a.active},get paused(){return a.paused},activate:function(P){if(a.active)return this;var w=c(P,"onActivate"),A=c(P,"onPostActivate"),M=c(P,"checkCanFocusTrap");M||d(),a.active=true,a.paused=false,a.nodeFocusedBeforeActivation=n.activeElement,w?.();var X=function(){M&&d(),D(),L(),A?.();};return M?(M(a.containers.concat()).then(X,X),this):(X(),this)},deactivate:function(P){if(!a.active)return this;var w=ey({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},P);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,oe(),a.active=false,a.paused=false,L(),ty.deactivateTrap(o,s);var A=c(w,"onDeactivate"),M=c(w,"onPostDeactivate"),X=c(w,"checkCanReturnFocus"),me=c(w,"returnFocus","returnFocusOnDeactivate");A?.();var ee=function(){ry(function(){me&&h(g(a.nodeFocusedBeforeActivation)),M?.();});};return me&&X?(X(g(a.nodeFocusedBeforeActivation)).then(ee,ee),this):(ee(),this)},pause:function(P){if(a.paused||!a.active)return this;var w=c(P,"onPause"),A=c(P,"onPostPause");return a.paused=true,w?.(),oe(),L(),A?.(),this},unpause:function(P){if(!a.paused||!a.active)return this;var w=c(P,"onUnpause"),A=c(P,"onPostUnpause");return a.paused=false,w?.(),d(),D(),L(),A?.(),this},updateContainerElements:function(P){var w=[].concat(P).filter(Boolean);return a.containers=w.map(function(A){return typeof A=="string"?n.querySelector(A):A}),a.active&&d(),L(),this}},s.updateContainerElements(t),s};var iy=hr("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),qn=iy.build(),Pe=hn({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=>Pe.getById(e,Pe.getContentId(e)),getPositionerEl:e=>Pe.getById(e,Pe.getPositionerId(e)),getBackdropEl:e=>Pe.getById(e,Pe.getBackdropId(e)),getTriggerEl:e=>Pe.getById(e,Pe.getTriggerId(e)),getTitleEl:e=>Pe.getById(e,Pe.getTitleId(e)),getDescriptionEl:e=>Pe.getById(e,Pe.getDescriptionId(e)),getCloseTriggerEl:e=>Pe.getById(e,Pe.getCloseTriggerId(e))});function ay(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({...qn.trigger.attrs,dir:e.context.dir,id:Pe.getTriggerId(e.context),"aria-haspopup":"dialog",type:"button","aria-expanded":o,"data-state":o?"open":"closed","aria-controls":Pe.getContentId(e.context),onClick(a){a.defaultPrevented||t("TOGGLE");}})},getBackdropProps(){return r.element({...qn.backdrop.attrs,dir:e.context.dir,hidden:!o,id:Pe.getBackdropId(e.context),"data-state":o?"open":"closed"})},getPositionerProps(){return r.element({...qn.positioner.attrs,dir:e.context.dir,id:Pe.getPositionerId(e.context),style:{pointerEvents:o?void 0:"none"}})},getContentProps(){return r.element({...qn.content.attrs,dir:e.context.dir,role:e.context.role,hidden:!o,id:Pe.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:Pe.getTitleId(e.context),"aria-describedby":i.description?Pe.getDescriptionId(e.context):void 0})},getTitleProps(){return r.element({...qn.title.attrs,dir:e.context.dir,id:Pe.getTitleId(e.context)})},getDescriptionProps(){return r.element({...qn.description.attrs,dir:e.context.dir,id:Pe.getDescriptionId(e.context)})},getCloseTriggerProps(){return r.button({...qn.closeTrigger.attrs,dir:e.context.dir,id:Pe.getCloseTriggerId(e.context),type:"button",onClick(a){a.defaultPrevented||(a.stopPropagation(),t("CLOSE"));}})}}}function sy(e){let t=kt(e);return mr({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 Gs(()=>Pe.getContentEl(r),{defer:true,pointerBlocking:r.modal,exclude:[Pe.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 Hb(Pe.getDoc(r))},trapFocus(r){if(!r.trapFocus||!r.modal)return;let n,o=kg(()=>{let i=Pe.getContentEl(r);if(i){n=oy(i,{document:Pe.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?jb(()=>[Pe.getContentEl(r)],{defer:true}):void 0}},actions:{setAlertDialogProps(r){r.role==="alertdialog"&&(r.initialFocusEl||(r.initialFocusEl=()=>Pe.getCloseTriggerEl(r)),r.closeOnInteractOutside=false);},checkRenderedElements(r){at(()=>{r.renderedElements.title=!!Pe.getTitleEl(r),r.renderedElements.description=!!Pe.getDescriptionEl(r);});},syncZIndex(r){at(()=>{let n=Pe.getContentEl(r);if(!n)return;let i=Pe.getWin(r).getComputedStyle(n);[Pe.getPositionerEl(r),Pe.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[ly,Zr]=it({hookName:"useDialogContext",providerName:"<DialogProvider />"}),cy=e=>{let t=Zr(),r=Nm(),n=Nn(ce(r,()=>({present:t().open}))),o=ce(()=>t().getBackdropProps(),()=>n().presenceProps,e);return m(F,{get when(){return !n().unmounted},get children(){return m(ve.div,o)}})},uy=e=>{let t=Zr(),r=ce(()=>t().getCloseTriggerProps(),e);return m(ve.button,r)},dy=e=>{let t=Zr(),r=gn(),n=ce(()=>t().getContentProps(),()=>r().presenceProps,e);return m(F,{get when(){return !r().unmounted},get children(){return m(ve.div,n)}})},fy=e=>e.children(Zr()),py=e=>{let t=Zr(),r=ce(()=>t().getDescriptionProps(),e);return m(ve.div,r)},my=e=>{let t=Zr(),r=gn(),n=ce(()=>t().getPositionerProps(),e);return m(F,{get when(){return !r().unmounted},get children(){return m(ve.div,n)}})},gy=e=>{let t=zo(),r=Ln(),n=Sr(),o=j(()=>({id:n,dir:t().dir,getRootNode:r().getRootNode,open:e.defaultOpen,"open.controlled":e.open!==void 0,...e})),[i,a]=Ar(sy(o()),{context:o});return j(()=>ay(i,a,rr))},hy=e=>{let[t,r]=Ho(e),[n]=Vi(t),[o,i]=vt()(r,["aria-label","closeOnEscape","closeOnInteractOutside","defaultOpen","finalFocusEl","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),a=gy(o),s=Nn(ce(t,()=>({present:a().open})));return m(ly,{value:a,get children(){return m(Hc,{value:n,get children(){return m(Vo,{value:s,get children(){return i.children}})}})}})},by=e=>{let[t,r]=Ho(e),[n]=Vi(t),o=Nn(ce(t,()=>({present:r.value().open})));return m(ly,{get value(){return r.value},get children(){return m(Hc,{value:n,get children(){return m(Vo,{value:o,get children(){return r.children}})}})}})},yy=e=>{let t=Zr(),r=ce(()=>t().getTitleProps(),e);return m(ve.h2,r)},vy=e=>{let t=Zr(),r=gn(),n=ce(()=>t().getTriggerProps(),()=>({"aria-controls":r().unmounted&&null}),e);return m(ve.button,n)},xn={};bn(xn,{Backdrop:()=>cy,CloseTrigger:()=>uy,Content:()=>dy,Context:()=>fy,Description:()=>py,Positioner:()=>my,Root:()=>hy,RootProvider:()=>by,Title:()=>yy,Trigger:()=>vy});var wn=bu({placement:"bottom-end",gap:24});var xy="#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 wy=async({apiHost:e,message:t,sessionId:r})=>{try{return {data:await un.post(`${Le(e)?e:Ut()}/api/v1/sessions/${r}/continueChat`,{json:{message:t},timeout:!1}).json()}}catch(n){return {error:n}}};var _u=async({apiHost:e,sessionId:t,clientLogs:r})=>{try{await un.post(`${Le(e)?e:Ut()}/api/v1/sessions/${t}/clientLogs`,{json:{clientLogs:r}});}catch{}};var ol=e=>typeof e=="string"?e:e instanceof Error?e.name+": "+e.message:JSON.stringify(e);var Ty=Object.getPrototypeOf(async()=>{}).constructor,il=async({content:e,args:t})=>{try{let n=await Ty(...t.map(o=>o.id),fE(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:ol(r)}]}}},fE=e=>e.replace(/<script>/g,"").replace(/<\/script>/g,""),ca=async({args:e,content:t})=>{try{let n=await Ty(...Object.keys(e),t)(...Object.keys(e).map(o=>e[o]));if(n&&typeof n=="string")return {scriptCallbackMessage:n}}catch{}};var ei="Chatwoot Web Widget Opened";var Cy=e=>(il(e.scriptToExecute),{scriptCallbackMessage:ei});var _y=e=>fe(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 || [];
|
|
10
|
+
`+Bt),mo&&u([Jl,ec,tc],En=>{Bt=v(Bt,En," ");}),At&&za?At.createHTML(Bt):Bt},ge.setConfig=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};uc(le),oc=true;},ge.clearConfig=function(){vo=null,oc=false;},ge.isValidAttribute=function(le,S,W){vo||uc({});let ie=ht(le),qe=ht(S);return Qd(ie,qe,W)},ge.addHook=function(le,S){typeof S=="function"&&(_r[le]=_r[le]||[],d(_r[le],S));},ge.removeHook=function(le){if(_r[le])return f(_r[le])},ge.removeHooks=function(le){_r[le]&&(_r[le]=[]);},ge.removeAllHooks=function(){_r={};},ge}var hi=gi();return hi});});function eT(e){return Object.keys(e).reduce((r,n)=>{let o=e[n];return r[n]=Object.assign({},o),sf(o.value)&&!iT(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 tT(e){return e?Object.keys(e).reduce((r,n)=>{let o=e[n];return r[n]=sf(o)&&"value"in o?o:{value:o},r[n].attribute||(r[n].attribute=oT(n)),r[n].parse="parse"in r[n]?r[n].parse:typeof r[n].value!="string",r},{}):{}}function rT(e){return Object.keys(e).reduce((r,n)=>(r[n]=e[n].value,r),{})}function nT(e,t){let r=eT(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?af(a):a),s!=null&&(i.value=Array.isArray(s)?s.slice(0):s),i.reflect&&of(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(c){let l=i.value;i.value=c,i.reflect&&of(this,i.attribute,i.value,!!i.parse);for(let u=0,f=this.__propertyChangedCallbacks.length;u<f;u++)this.__propertyChangedCallbacks[u](o,c,l);},enumerable:true,configurable:true});}),r}function af(e){if(e)try{return JSON.parse(e)}catch{return e}}function of(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 oT(e){return e.replace(/\.?([A-Z]+)/g,(t,r)=>"-"+r.toLowerCase()).replace("_","-").replace(/^-/,"")}function sf(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function iT(e){return Object.prototype.toString.call(e)==="[object Function]"}function aT(e){return typeof e=="function"&&e.toString().indexOf("class")===0}var pc;function sT(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=nT(this,t);let o=rT(this.props),i=this.Component,a=pc;try{pc=this,this.__initialized=!0,aT(i)?new i(o,{element:this}):i(o,{element:this});}finally{pc=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?af(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 lf(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=sT(n,tT(t)),s.prototype.Component=a,s.prototype.registeredTag=e,i.define(e,s,o),s)}}var cT=(e,t)=>e===t,Xt=Symbol("solid-proxy"),gf=typeof Proxy=="function",es=Symbol("solid-track"),Qa={equals:cT},hf=Cf,Zt=1,wi=2,bf={owned:null,cleanups:null,context:null,owner:null};var ke=null,G=null,wo=null,ze=null,ft=null,_t=null,ts=0;function In(e,t){let r=ze,n=ke,o=e.length===0,i=t===void 0?n:t,a=o?bf:{owned:null,cleanups:null,context:i?i.context:null,owner:i},s=o?e:()=>e(()=>st(()=>on(a)));ke=a,ze=null;try{return dr(s,!0)}finally{ze=r,ke=n;}}function O(e,t){t=t?Object.assign({},Qa,t):Qa;let r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=o=>(typeof o=="function"&&(o=o(r.value)),Tf(r,o));return [wf.bind(r),n]}function R(e,t,r){let n=xc(e,t,false,Zt);_i(n);}function _e(e,t,r){hf=pT;let n=xc(e,t,false,Zt);(!r||!r.render)&&(n.user=true),_t?_t.push(n):_i(n);}function j(e,t,r){r=r?Object.assign({},Qa,r):Qa;let n=xc(e,t,true,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,_i(n),wf.bind(n)}function yf(e){return dr(e,false)}function st(e){if(ze===null)return e();let t=ze;ze=null;try{return wo?wo.untrack(e):e()}finally{ze=t;}}function de(e){_e(()=>st(e));}function he(e){return ke===null||(ke.cleanups===null?ke.cleanups=[e]:ke.cleanups.push(e)),e}function rs(){return ze}function To(){return ke}function vf(e,t){let r=ke,n=ze;ke=e,ze=null;try{return dr(t,!0)}catch(o){os(o);}finally{ke=r,ze=n;}}var[WR,df]=O(false);function xf(e,t){let r=Symbol("context");return {id:r,Provider:gT(r),defaultValue:e}}function vc(e){let t;return ke&&ke.context&&(t=ke.context[e.id])!==void 0?t:e.defaultValue}function ns(e){let t=j(e),r=j(()=>bc(t()));return r.toArray=()=>{let n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}function wf(){let e=G;if(this.sources&&(this.state))if((this.state)===Zt)_i(this);else {let t=ft;ft=null,dr(()=>Ja(this),false),ft=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&&G.sources.has(this)?this.tValue:this.value}function Tf(e,t,r){let n=e.value;if(!e.comparator||!e.comparator(n,t)){e.value=t;e.observers&&e.observers.length&&dr(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],a=G&&G.running;a&&G.disposed.has(i)||((a?!i.tState:!i.state)&&(i.pure?ft.push(i):_t.push(i),i.observers&&_f(i)),a?i.tState=Zt:i.state=Zt);}if(ft.length>1e6)throw ft=[],new Error},false);}return t}function _i(e){if(!e.fn)return;on(e);let t=ts;ff(e,e.value,t);}function ff(e,t,r){let n,o=ke,i=ze;ze=ke=e;try{n=e.fn(t);}catch(a){return e.pure&&((e.state=Zt,e.owned&&e.owned.forEach(on),e.owned=null)),e.updatedAt=r+1,os(a)}finally{ze=i,ke=o;}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?Tf(e,n):e.value=n,e.updatedAt=r);}function xc(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:ke,context:ke?ke.context:null,pure:r};if(ke===null||ke!==bf&&(ke.owned?ke.owned.push(i):ke.owned=[i]),wo);return i}function Ti(e){let t=G;if((e.state)===0)return;if((e.state)===wi)return Ja(e);if(e.suspense&&st(e.suspense.inFallback))return e.suspense.effects.push(e);let r=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ts);){(e.state)&&r.push(e);}for(let n=r.length-1;n>=0;n--){if(e=r[n],t);if((e.state)===Zt)_i(e);else if((e.state)===wi){let o=ft;ft=null,dr(()=>Ja(e,r[0]),false),ft=o;}}}function dr(e,t){if(ft)return e();let r=false;t||(ft=[]),_t?r=true:_t=[],ts++;try{let n=e();return dT(r),n}catch(n){r||(_t=null),ft=null,os(n);}}function dT(e){if(ft&&(Cf(ft),ft=null),e)return;let r=_t;_t=null,r.length&&dr(()=>hf(r),false);}function Cf(e){for(let t=0;t<e.length;t++)Ti(e[t]);}function pT(e){let t,r=0;for(t=0;t<e.length;t++){let n=e[t];n.user?e[r++]=n:Ti(n);}for(t=0;t<r;t++)Ti(e[t]);}function Ja(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<ts)&&Ti(o):i===wi&&Ja(o,t);}}}function _f(e){for(let r=0;r<e.observers.length;r+=1){let n=e.observers[r];(!n.state)&&(n.state=wi,n.pure?ft.push(n):_t.push(n),n.observers&&_f(n));}}function on(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--)on(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)on(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 mT(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function os(e,t=ke){let n=mT(e);throw n;}function bc(e){if(typeof e=="function"&&!e.length)return bc(e());if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++){let n=bc(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n);}return t}return e}function gT(e,t){return function(n){let o;return R(()=>o=st(()=>(ke.context={...ke.context,[e]:n.value},ns(()=>n.children))),void 0),o}}var hT=Symbol("fallback");function mf(e){for(let t=0;t<e.length;t++)e[t]();}function bT(e,t,r={}){let n=[],o=[],i=[],a=0,s=t.length>1?[]:null;return he(()=>mf(i)),()=>{let c=e()||[],l=c.length,u,f;return c[es],st(()=>{let p,h,g,v,b,C,_,k,I;if(l===0)a!==0&&(mf(i),i=[],n=[],o=[],a=0,s&&(s=[])),r.fallback&&(n=[hT],o[0]=In(B=>(i[0]=B,r.fallback())),a=1);else if(a===0){for(o=new Array(l),f=0;f<l;f++)n[f]=c[f],o[f]=In(d);a=l;}else {for(g=new Array(l),v=new Array(l),s&&(b=new Array(l)),C=0,_=Math.min(a,l);C<_&&n[C]===c[C];C++);for(_=a-1,k=l-1;_>=C&&k>=C&&n[_]===c[k];_--,k--)g[k]=o[_],v[k]=i[_],s&&(b[k]=s[_]);for(p=new Map,h=new Array(k+1),f=k;f>=C;f--)I=c[f],u=p.get(I),h[f]=u===void 0?-1:u,p.set(I,f);for(u=C;u<=_;u++)I=n[u],f=p.get(I),f!==void 0&&f!==-1?(g[f]=o[u],v[f]=i[u],s&&(b[f]=s[u]),f=h[f],p.set(I,f)):i[u]();for(f=C;f<l;f++)f in g?(o[f]=g[f],i[f]=v[f],s&&(s[f]=b[f],s[f](f))):o[f]=In(d);o=o.slice(0,a=l),n=c.slice(0);}return o});function d(p){if(i[f]=p,s){let[h,g]=O(f);return s[f]=g,t(c[f],h)}return t(c[f])}}}function m(e,t){return st(()=>e(t||{}))}function Za(){return true}var yc={get(e,t,r){return t===Xt?r:e.get(t)},has(e,t){return t===Xt?true:e.has(t)},set:Za,deleteProperty:Za,getOwnPropertyDescriptor(e,t){return {configurable:true,enumerable:true,get(){return e.get(t)},set:Za,deleteProperty:Za}},ownKeys(e){return e.keys()}};function mc(e){return (e=typeof e=="function"?e():e)?e:{}}function vT(){for(let e=0,t=this.length;e<t;++e){let r=this[e]();if(r!==void 0)return r}}function Oe(...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,j(s)):s;}if(gf&&t)return new Proxy({get(a){for(let s=e.length-1;s>=0;s--){let c=mc(e[s])[a];if(c!==void 0)return c}},has(a){for(let s=e.length-1;s>=0;s--)if(a in mc(e[s]))return true;return false},keys(){let a=[];for(let s=0;s<e.length;s++)a.push(...Object.keys(mc(e[s])));return [...new Set(a)]}},yc);let r={},n=Object.create(null);for(let a=e.length-1;a>=0;a--){let s=e[a];if(!s)continue;let c=Object.getOwnPropertyNames(s);for(let l=c.length-1;l>=0;l--){let u=c[l];if(u==="__proto__"||u==="constructor")continue;let f=Object.getOwnPropertyDescriptor(s,u);if(!n[u])n[u]=f.get?{enumerable:true,configurable:true,get:vT.bind(r[u]=[f.get.bind(s)])}:f.value!==void 0?f:void 0;else {let d=r[u];d&&(f.get?d.push(f.get.bind(s)):f.value!==void 0&&d.push(()=>f.value));}}}let o={},i=Object.keys(n);for(let a=i.length-1;a>=0;a--){let s=i[a],c=n[s];c&&c.get?Object.defineProperty(o,s,c):o[s]=c?c.value:void 0;}return o}function tt(e,...t){if(gf&&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)}},yc));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))}},yc)),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,c=0;for(let l of t)l.includes(o)&&(s=true,a?n[c][o]=i.value:Object.defineProperty(n[c],o,i)),++c;s||(a?r[o]=i.value:Object.defineProperty(r,o,i));}return [...n,r]}var xT=0;function Sr(){return `cl-${xT++}`}var kf=e=>`Stale read from <${e}>.`;function Se(e){let t="fallback"in e&&{fallback:()=>e.fallback};return j(bT(()=>e.each,e.children,t||void 0))}function F(e){let t=e.keyed,r=j(()=>e.when,void 0,{equals:(n,o)=>t?n===o:!n==!o});return j(()=>{let n=r();if(n){let o=e.children;return typeof o=="function"&&o.length>0?st(()=>o(t?n:()=>{if(!st(r))throw kf("Show");return e.when})):o}return e.fallback},void 0,void 0)}function We(e){let t=false,r=(i,a)=>(t?i[1]===a[1]:!i[1]==!a[1])&&i[2]===a[2],n=ns(()=>e.children),o=j(()=>{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 j(()=>{let[i,a,s]=o();if(i<0)return e.fallback;let c=s.children;return typeof c=="function"&&c.length>0?st(()=>c(t?a:()=>{if(st(o)[0]!==i)throw kf("Match");return s.when})):c},void 0,void 0)}function te(e){return e}var wT=["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"],TT=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...wT]),CT=new Set(["innerHTML","textContent","innerText","children"]),_T=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),ST=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 kT(e,t){let r=ST[e];return typeof r=="object"?r[t]?r.$:void 0:r}var PT=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ET=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"]),IT={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function AT(e,t,r){let n=r.length,o=t.length,i=n,a=0,s=0,c=t[o-1].nextSibling,l=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]:c;for(;s<i;)e.insertBefore(r[s++],u);}else if(i===s)for(;a<o;)(!l||!l.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(!l){l=new Map;let f=s;for(;f<i;)l.set(r[f],f++);}let u=l.get(t[a]);if(u!=null)if(s<u&&u<i){let f=a,d=1,p;for(;++f<o&&f<i&&!((p=l.get(t[f]))==null||p!==u+d);)d++;if(d>u-s){let h=t[a];for(;s<u;)e.insertBefore(r[s++],h);}else e.replaceChild(r[s++],t[a++]);}else a++;else t[a++].remove();}}}var Pf="_$DX_DELEGATE";function T(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 Xe(e,t=window.document){let r=t[Pf]||(t[Pf]=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,$T));}}function z(e,t,r){(r==null?e.removeAttribute(t):e.setAttribute(t,r));}function OT(e,t,r,n){(n==null?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n));}function RT(e,t,r){(r?e.setAttribute(t,""):e.removeAttribute(t));}function U(e,t){(t==null?e.removeAttribute("class"):e.className=t);}function rt(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 DT(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]||(Ef(e,s,false),delete r[s]);}for(i=0,a=n.length;i<a;i++){let s=n[i],c=!!t[s];!s||s==="undefined"||r[s]===c||!c||(Ef(e,s,true),r[s]=c);}return r}function Tc(e,t,r){if(!t)return r?z(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 Re(e,t={},r,n){let o={};return n||R(()=>o.children=_o(e,t.children,o.children)),R(()=>typeof t.ref=="function"&&ye(t.ref,e)),R(()=>MT(e,t,r,true,o,true)),o}function ye(e,t,r){return st(()=>e(t,r))}function x(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return _o(e,t,n,r);R(o=>_o(e,t(),o,r),n);}function MT(e,t,r,n,o={},i=false){t||(t={});for(let a in o)if(!(a in t)){if(a==="children")continue;o[a]=If(e,a,null,o[a],r,i,t);}for(let a in t){if(a==="children"){continue}let s=t[a];o[a]=If(e,a,s,o[a],r,i,t);}}function LT(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function Ef(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 If(e,t,r,n,o,i,a){let s,c,l,u,f;if(t==="style")return Tc(e,r,n);if(t==="classList")return DT(e,r,n);if(r===n)return n;if(t==="ref")i||r(e);else if(t.slice(0,3)==="on:"){let d=t.slice(3);n&&e.removeEventListener(d,n,typeof n!="function"&&n),r&&e.addEventListener(d,r,typeof r!="function"&&r);}else if(t.slice(0,10)==="oncapture:"){let d=t.slice(10);n&&e.removeEventListener(d,n,true),r&&e.addEventListener(d,r,true);}else if(t.slice(0,2)==="on"){let d=t.slice(2).toLowerCase(),p=PT.has(d);if(!p&&n){let h=Array.isArray(n)?n[0]:n;e.removeEventListener(d,h);}(p||r)&&(rt(e,d,r,p),p&&Xe([d]));}else if(t.slice(0,5)==="attr:")z(e,t.slice(5),r);else if(t.slice(0,5)==="bool:")RT(e,t.slice(5),r);else if((f=t.slice(0,5)==="prop:")||(l=CT.has(t))||!o&&((u=kT(t,e.tagName))||(c=TT.has(t)))||(s=e.nodeName.includes("-")||"is"in a)){if(f)t=t.slice(5),c=true;t==="class"||t==="className"?U(e,r):s&&!c&&!l?e[LT(t)]=r:e[u||t]=r;}else {let d=o&&t.indexOf(":")>-1&&IT[t.split(":")[0]];d?OT(e,d,t,r):z(e,_T[t]||t,r);}return r}function $T(e){let t=e.target,r=`$$${e.type}`,n=e.target,o=e.currentTarget,i=c=>Object.defineProperty(e,"target",{configurable:true,value:c}),a=()=>{let c=t[r];if(c&&!t.disabled){let l=t[`${r}Data`];if(l!==void 0?c.call(t,l,e):c.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 c=e.composedPath();i(c[0]);for(let l=0;l<c.length-2&&(t=c[l],!!a());l++){if(t._$host){t=t._$host,s();break}if(t.parentNode===o)break}}else s();i(n);}function _o(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 c=r[0];c&&c.nodeType===3?c.data!==t&&(c.data=t):c=document.createTextNode(t),r=Co(e,r,n,c);}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 R(()=>{let c=t();for(;typeof c=="function";)c=c();r=_o(e,c,r,n);}),()=>r;if(Array.isArray(t)){let c=[],l=r&&Array.isArray(r);if(wc(c,t,r,o))return R(()=>r=_o(e,c,r,n,true)),()=>r;if(c.length===0){if(r=Co(e,r,n),s)return r}else l?r.length===0?Af(e,c,n):AT(e,r,c):(r&&Co(e),Af(e,c));r=c;}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 wc(e,t,r,n){let o=false;for(let i=0,a=t.length;i<a;i++){let s=t[i],c=r&&r[e.length],l;if(!(s==null||s===true||s===false))if((l=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))o=wc(e,s,c)||o;else if(l==="function")if(n){for(;typeof s=="function";)s=s();o=wc(e,Array.isArray(s)?s:[s],Array.isArray(c)?c:[c])||o;}else e.push(s),o=true;else {let u=String(s);c&&c.nodeType===3&&c.data===u?e.push(c):e.push(document.createTextNode(u));}}return o}function Af(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 c=s.parentNode===e;!i&&!a?c?e.replaceChild(o,s):e.insertBefore(o,r):c&&s.remove();}else i=true;}}else e.insertBefore(o,r);return [o]}var FT="http://www.w3.org/2000/svg";function Of(e,t=false){return t?document.createElementNS(FT,e):document.createElement(e)}function Rf(e){let {useShadow:t}=e,r=document.createTextNode(""),n=()=>e.mount||document.body,o=To(),i;return _e(()=>{i||(i=vf(o,()=>j(()=>e.children)));let s=n();if(s instanceof HTMLHeadElement){let[c,l]=O(false),u=()=>l(true);In(f=>x(s,()=>c()?f():i(),null)),he(u);}else {let c=Of(e.isSVG?"g":"div",e.isSVG),l=t&&c.attachShadow?c.attachShadow({mode:"open"}):c;Object.defineProperty(c,"_$host",{get(){return r.parentNode},configurable:true}),x(l,i),s.appendChild(c),e.ref&&e.ref(c),he(()=>s.removeChild(c));}},void 0,{render:true}),r}function Df(e){let[t,r]=tt(e,["component"]),n=j(()=>t.component);return j(()=>{let o=n();switch(typeof o){case "function":return st(()=>o(r));case "string":let i=ET.has(o),a=Of(o,i);return Re(a,r,i),a}})}function UT(e){let t=Object.keys(e),r={};for(let n=0;n<t.length;n++){let[o,i]=O(e[t[n]]);Object.defineProperty(r,t[n],{get:o,set(a){i(()=>a);}});}return r}function jT(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 WT(e){return (t,r)=>{let{element:n}=r;return In(o=>{let i=UT(t);n.addPropertyChangedCallback((s,c)=>i[s]=c),n.addReleaseCallback(()=>{n.renderRoot.textContent="",o();});let a=e(i,r);return x(n.renderRoot,a)},jT(n))}}function is(e,t,r){return arguments.length===2&&(r=t,t={}),lf(e,t)(WT(r))}var as={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},Mf={...as,onClose:void 0,onOpen:void 0,theme:void 0,autoShowDelay:void 0,isOpen:void 0,defaultOpen:void 0},Nf={...as,onClose:void 0,onOpen:void 0,theme:void 0,previewMessage:void 0,onPreviewMessageClick:void 0,onPreviewMessageDismissed:void 0,autoShowDelay:void 0};var Lf=e=>{sessionStorage.setItem("agentPaymentInProgress",JSON.stringify(e));},So=()=>sessionStorage.getItem("agentPaymentInProgress"),ss=()=>{sessionStorage.removeItem("agentPaymentInProgress");};var ko=class extends Error{constructor(t){super("This agent can only be executed on "+t);}};var kr=(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 HT="https://r0.ar",Ut=({ignoreChatApiUrl:e}={ignoreChatApiUrl:false})=>{let t=kr("NEXT_PUBLIC_CHAT_API_URL"),r=kr("NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON")?.split(",");if(!e&&t&&(!r||r.some(i=>i===window.location.href)))return t;let n=kr("NEXT_PUBLIC_VIEWER_URL")?.split(",");return n?.find(i=>window.location.href.startsWith(i))??n?.[0]??HT};function $f(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=$f(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=$f(e))&&(n&&(n+=" "),n+=t);return n}var xe=Qt;var Sc="-",VT=e=>{let t=GT(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return {getClassGroupId:a=>{let s=a.split(Sc);return s[0]===""&&s.length!==1&&s.shift(),Uf(s,t)||zT(a)},getConflictingClassGroupIds:(a,s)=>{let c=r[a]||[];return s&&n[a]?[...c,...n[a]]:c}}},Uf=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],n=t.nextPart.get(r),o=n?Uf(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;let i=e.join(Sc);return t.validators.find(({validator:a})=>a(i))?.classGroupId},Bf=/^\[(.+)\]$/,zT=e=>{if(Bf.test(e)){let t=Bf.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return "arbitrary.."+r}},GT=e=>{let{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return qT(Object.entries(e.classGroups),r).forEach(([i,a])=>{_c(a,n,i,t);}),n},_c=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){let i=o===""?t:Ff(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(YT(o)){_c(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,a])=>{_c(a,Ff(t,i),r,n);});});},Ff=(e,t)=>{let r=e;return t.split(Sc).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n);}),r},YT=e=>e.isThemeGetter,qT=(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,KT=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);}}},jf="!",XT=e=>{let{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],i=t.length,a=s=>{let c=[],l=0,u=0,f;for(let v=0;v<s.length;v++){let b=s[v];if(l===0){if(b===o&&(n||s.slice(v,v+i)===t)){c.push(s.slice(u,v)),u=v+i;continue}if(b==="/"){f=v;continue}}b==="["?l++:b==="]"&&l--;}let d=c.length===0?s:s.substring(u),p=d.startsWith(jf),h=p?d.substring(1):d,g=f&&f>u?f-u:void 0;return {modifiers:c,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:g}};return r?s=>r({className:s,parseClassName:a}):a},ZT=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},QT=e=>({cache:KT(e.cacheSize),parseClassName:XT(e),...VT(e)}),JT=/\s+/,eC=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(JT),s="";for(let c=a.length-1;c>=0;c-=1){let l=a[c],{modifiers:u,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:p}=r(l),h=!!p,g=n(h?d.substring(0,p):d);if(!g){if(!h){s=l+(s.length>0?" "+s:s);continue}if(g=n(d),!g){s=l+(s.length>0?" "+s:s);continue}h=false;}let v=ZT(u).join(":"),b=f?v+jf:v,C=b+g;if(i.includes(C))continue;i.push(C);let _=o(g,h);for(let k=0;k<_.length;++k){let I=_[k];i.push(b+I);}s=l+(s.length>0?" "+s:s);}return s};function tC(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Wf(t))&&(n&&(n+=" "),n+=r);return n}var Wf=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Wf(e[n]))&&(r&&(r+=" "),r+=t);return r};function rC(e,...t){let r,n,o,i=a;function a(c){let l=t.reduce((u,f)=>f(u),e());return r=QT(l),n=r.cache.get,o=r.cache.set,i=s,s(c)}function s(c){let l=n(c);if(l)return l;let u=eC(c,r);return o(c,u),u}return function(){return i(tC.apply(null,arguments))}}var Ze=e=>{let t=r=>r[e]||[];return t.isThemeGetter=true,t},Hf=/^\[(?:([a-z-]+):)?(.+)\]$/i,nC=/^\d+\/\d+$/,oC=new Set(["px","full","screen"]),iC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aC=/\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$/,sC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,lC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ur=e=>Po(e)||oC.has(e)||nC.test(e),an=e=>Eo(e,"length",bC),Po=e=>!!e&&!Number.isNaN(Number(e)),Cc=e=>Eo(e,"number",Po),Si=e=>!!e&&Number.isInteger(Number(e)),uC=e=>e.endsWith("%")&&Po(e.slice(0,-1)),Te=e=>Hf.test(e),sn=e=>iC.test(e),dC=new Set(["length","size","percentage"]),fC=e=>Eo(e,dC,Vf),pC=e=>Eo(e,"position",Vf),mC=new Set(["image","url"]),gC=e=>Eo(e,mC,vC),hC=e=>Eo(e,"",yC),ki=()=>true,Eo=(e,t,r)=>{let n=Hf.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):false},bC=e=>aC.test(e)&&!sC.test(e),Vf=()=>false,yC=e=>lC.test(e),vC=e=>cC.test(e);var xC=()=>{let e=Ze("colors"),t=Ze("spacing"),r=Ze("blur"),n=Ze("brightness"),o=Ze("borderColor"),i=Ze("borderRadius"),a=Ze("borderSpacing"),s=Ze("borderWidth"),c=Ze("contrast"),l=Ze("grayscale"),u=Ze("hueRotate"),f=Ze("invert"),d=Ze("gap"),p=Ze("gradientColorStops"),h=Ze("gradientColorStopPositions"),g=Ze("inset"),v=Ze("margin"),b=Ze("opacity"),C=Ze("padding"),_=Ze("saturate"),k=Ze("scale"),I=Ze("sepia"),B=Ze("skew"),D=Ze("space"),oe=Ze("translate"),H=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",Te,t],E=()=>[Te,t],P=()=>["",Ur,an],w=()=>["auto",Po,Te],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>["start","end","center","between","around","evenly","stretch"],ee=()=>["","0",Te],Ue=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ae=()=>[Po,Te];return {cacheSize:500,separator:":",theme:{colors:[ki],spacing:[Ur,an],blur:["none","",sn,Te],brightness:Ae(),borderColor:[e],borderRadius:["none","","full",sn,Te],borderSpacing:E(),borderWidth:P(),contrast:Ae(),grayscale:ee(),hueRotate:Ae(),invert:ee(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[uC,an],inset:L(),margin:L(),opacity:Ae(),padding:E(),saturate:Ae(),scale:Ae(),sepia:ee(),skew:Ae(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",Te]}],container:["container"],columns:[{columns:[sn]}],"break-after":[{"break-after":Ue()}],"break-before":[{"break-before":Ue()}],"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:[...A(),Te]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],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",Si,Te]}],basis:[{basis:L()}],"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:ee()}],shrink:[{shrink:ee()}],order:[{order:["first","last","none",Si,Te]}],"grid-cols":[{"grid-cols":[ki]}],"col-start-end":[{col:["auto",{span:["full",Si,Te]},Te]}],"col-start":[{"col-start":w()}],"col-end":[{"col-end":w()}],"grid-rows":[{"grid-rows":[ki]}],"row-start-end":[{row:["auto",{span:[Si,Te]},Te]}],"row-start":[{"row-start":w()}],"row-end":[{"row-end":w()}],"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:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...me()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...me(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...me(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"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:[sn]},sn]}],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",sn,an]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Cc]}],"font-family":[{font:[ki]}],"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",Po,Cc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ur,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":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ur,an]}],"underline-offset":[{"underline-offset":["auto",Ur,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":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),pC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},gC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"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":[b]}],"border-style":[{border:[...M(),"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":[b]}],"divide-style":[{divide:M()}],"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:["",...M()]}],"outline-offset":[{"outline-offset":[Ur,Te]}],"outline-w":[{outline:[Ur,an]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Ur,an]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",sn,hC]}],"shadow-color":[{shadow:[ki]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",sn,Te]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[_]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"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:Ae()}],ease:[{ease:["linear","in","out","in-out",Te]}],delay:[{delay:Ae()}],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:[Si,Te]}],"translate-x":[{"translate-x":[oe]}],"translate-y":[{"translate-y":[oe]}],"skew-x":[{"skew-x":[B]}],"skew-y":[{"skew-y":[B]}],"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:[Ur,an,Cc]}],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 zf=rC(xC);xo(Up());xo(Wp());var Hp=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"&&fe(e.body)?{"Content-Type":"application/json"}:void 0,body:typeof e!="string"&&fe(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}}},fe=e=>e!=null,lt=e=>e==null,et=e=>e==null||e==="",Le=e=>e!=null&&e!=="";var Vp=e=>{e.split("</noscript>").forEach(r=>{let[n,o]=r.split("<noscript>"),i=document.createRange().createContextualFragment(n??"");if(document.head.append(i),lt(o))return;let a=document.createElement("noscript"),s=document.createRange().createContextualFragment(o);a.append(s),document.head.append(a);});};var fr=e=>e?.startsWith("data:image/svg")||e?.endsWith(".svg");var Pr=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 Mo=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 Ri=e=>e!==null&&typeof e=="object";var Di=(...e)=>{for(let t of e)if((!Ri(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return fs({},...e)},Dc=(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},fs=(...e)=>{let t={},r={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(Ri(n)){for(let[o,i]of Object.entries(n))Ri(i)&&o in t&&(i=fs(t[o],i)),t={...t,[o]:i};Ri(n.headers)&&(r=Dc(r,n.headers),t.headers=r);}return t};var zp=(()=>{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})(),Gp=typeof globalThis.AbortController=="function",Yp=typeof globalThis.ReadableStream=="function",qp=typeof globalThis.FormData=="function",ps=["get","post","put","patch","head","delete"];var Kp={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},ms=2147483647,gs=Symbol("stop"),Xp={json:true,parseJson:true,searchParams:true,prefixUrl:true,retry:true,timeout:true,hooks:true,throwHttpErrors:true,onDownloadProgress:true,fetch:true},Zp={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 Jp=e=>ps.includes(e)?e.toUpperCase():e,d_=["get","put","head","delete","options","trace"],f_=[408,413,429,500,502,503,504],em=[413,429,503],Qp={limit:2,methods:d_,statusCodes:f_,afterStatusCodes:em,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},tm=(e={})=>{if(typeof e=="number")return {...Qp,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 {...Qp,...e,afterStatusCodes:em}};async function Mc(e,t,r,n){return new Promise((o,i)=>{let a=setTimeout(()=>{r&&r.abort(),i(new Mo(e));},n.timeout);n.fetch(e,t).then(o).catch(i).then(()=>{clearTimeout(a);});})}async function Nc(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 rm=(e,t)=>{let r={};for(let n in t)!(n in Zp)&&!(n in Xp)&&!(n in e)&&(r[n]=t[n]);return r};var Mi=class e{static create(t,r){let n=new e(t,r),o=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>ms)throw new RangeError(`The \`timeout\` option cannot be greater than ${ms}`);await Promise.resolve();let s=await n._fetch();for(let c of n._options.hooks.afterResponse){let l=await c(n.request,n._options,n._decorateResponse(s.clone()));l instanceof globalThis.Response&&(s=l);}if(n._decorateResponse(s),!s.ok&&n._options.throwHttpErrors){let c=new Pr(s,n.request,n._options);for(let l of n._options.hooks.beforeError)c=await l(c);throw c}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Yp)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,c]of Object.entries(Kp))a[s]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||c);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:Dc(this._input.headers,r.headers),hooks:fs({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Jp(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:tm(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(Gp){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(zp&&(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);(qp&&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 Mo)){if(t instanceof Pr){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),ms);if(n!==0&&this._retryCount>0){await Nc(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})===gs)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=rm(this.request,this._options);return this._options.timeout===false?this._options.fetch(this.request.clone(),t):Mc(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:c,value:l}=await a.read();if(c){i.close();return}if(r){o+=l.byteLength;let u=n===0?0:o/n;r({percent:u,transferredBytes:o,totalBytes:n},l);}i.enqueue(l),await s();}await s();}}),{status:t.status,statusText:t.statusText,headers:t.headers})}};var Lc=e=>{let t=(r,n)=>Mi.create(r,Di(e,n));for(let r of ps)t[r]=(n,o)=>Mi.create(n,Di(e,o,{method:r}));return t.create=r=>Lc(Di(r)),t.extend=r=>Lc(Di(e,r)),t.stop=gs,t},p_=Lc(),un=p_;async function nm({agent:e,isPreview:t,apiHost:r,prefilledVariables:n,resultId:o,stripeRedirectStatus:i,startFrom:a,sessionId:s}){if(lt(e))throw new Error("Agent is required to start the chat");let c=So()??void 0,l=c?JSON.parse(c):void 0;if(l)return m_({apiHost:r,stripeRedirectStatus:i,paymentInProgressState:l});let u=typeof e=="string"?e:e.id;if(t)return g_({apiHost:r,agentId:u,startFrom:a,agent:e,prefilledVariables:n,sessionId:s});try{let f=parent!==window&&Le(document.referrer)?new URL(document.referrer).origin:void 0,d=await un.post(`${$c(r)}/api/v1/agents/${u}/startChat`,{headers:{"x-agent-iframe-referrer-origin":f,"x-original-referrer":document.referrer},json:{isStreamEnabled:!0,prefilledVariables:n,resultId:o,isOnlyRegistering:!1},timeout:!1}),p=d.headers.get("access-control-allow-origin");if(f&&p&&p!=="*"&&!f.includes(p))throw new ko(p);return {data:await d.json()}}catch(f){return {error:f}}}var m_=async({apiHost:e,stripeRedirectStatus:t,paymentInProgressState:r})=>{ss();try{return {data:{...await un.post(`${$c(e)}/api/v1/sessions/${r.sessionId}/continueChat`,{json:{message:t==="failed"?"fail":"Success"},timeout:!1}).json(),...r}}}catch(n){return {error:n}}},g_=async({apiHost:e,agentId:t,startFrom:r,agent:n,prefilledVariables:o,sessionId:i})=>{try{return {data:await un.post(`${$c(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}}},$c=e=>Le(e)?e:Ut();var[om,im]=O("100%");var[fM,am]=O();var hs="#303235",bs="#FFFFFF",sm="Google",No="Open Sans",Lo="Color",Ni="#ffffff";var lm="#000",cm="#000",um=2,ys="absolute",dm="Top",Rn="medium",Ot=1,fm=0,pm="800px",mm="100%",Li="transparent";var $o="#F7F8FF",gm=hs,hm="#000",bm=bs,$i="#0042DA",ym=bs,vm=1;var xm="#FFFFFF",Bi=hs,wm="#9095A0",Tm="md";var Bo=true,Fi=false;var h_="https://fonts.bunny.net/css2",vs="agent-font",Bc=e=>{let t=document.getElementById(vs);if(typeof e=="string"||e.type==="Google"){let r=(typeof e=="string"?e:e.family)??No;if(t?.getAttribute("href")?.includes(r))return;t?.remove();let n=document.createElement("link");n.href=`${h_}?family=${r}:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap`,n.rel="stylesheet",n.id=vs,document.head.appendChild(n);return}if(e.type==="Custom"){if(Le(e.css)){if(t?.innerHTML===e.css)return;t?.remove();let r=document.createElement("style");r.innerHTML=e.css,r.id=vs,document.head.appendChild(r);}if(Le(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=vs,document.head.appendChild(r);}}};var[re,Cm]=O();var bt={general:{isInputPrefillEnabled:false,rememberUser:{isEnabled:false,storage:"session"}},typingEmulation:{enabled:true,speed:900,maxDelay:2,delayBetweenBubbles:0,isDisabledOnFirstMessage:true}};var Fc=Symbol("store-raw"),Uo=Symbol("store-node"),Wr=Symbol("store-has"),_m=Symbol("store-self");function Sm(e){let t=e[Xt];if(!t&&(Object.defineProperty(e,Xt,{value:t=new Proxy(e,v_)}),!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 dn(e){let t;return e!=null&&typeof e=="object"&&(e[Xt]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function jo(e,t=new Set){let r,n,o,i;if(r=e!=null&&e[Fc])return r;if(!dn(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=jo(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 c=0,l=a.length;c<l;c++)i=a[c],!s[i].get&&(o=e[i],(n=jo(o,t))!==o&&(e[i]=n));}return e}function xs(e,t){let r=e[t];return r||Object.defineProperty(e,t,{value:r=Object.create(null)}),r}function ji(e,t,r){if(e[t])return e[t];let[n,o]=O(r,{equals:false,internal:true});return n.$=o,e[t]=n}function b_(e,t){let r=Reflect.getOwnPropertyDescriptor(e,t);return !r||r.get||!r.configurable||t===Xt||t===Uo||(delete r.value,delete r.writable,r.get=()=>e[Xt][t]),r}function km(e){rs()&&ji(xs(e,Uo),_m)();}function y_(e){return km(e),Reflect.ownKeys(e)}var v_={get(e,t,r){if(t===Fc)return e;if(t===Xt)return r;if(t===es)return km(e),r;let n=xs(e,Uo),o=n[t],i=o?o():e[t];if(t===Uo||t===Wr||t==="__proto__")return i;if(!o){let a=Object.getOwnPropertyDescriptor(e,t);rs()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(a&&a.get)&&(i=ji(n,t,i)());}return dn(i)?Sm(i):i},has(e,t){return t===Fc||t===Xt||t===es||t===Uo||t===Wr||t==="__proto__"?true:(rs()&&ji(xs(e,Wr),t)(),t in e)},set(){return true},deleteProperty(){return true},ownKeys:y_,getOwnPropertyDescriptor:b_};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[Wr]&&e[Wr][t]&&o!==void 0&&e[Wr][t].$()):(e[t]=r,e[Wr]&&e[Wr][t]&&o===void 0&&e[Wr][t].$());let a=xs(e,Uo),s;if((s=ji(a,t,o))&&s.$(()=>r),Array.isArray(e)&&e.length!==i){for(let c=e.length;c<i;c++)(s=a[c])&&s.$();(s=ji(a,"length",i))&&s.$(e.length);}(s=a[_m])&&s.$();}function Pm(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 x_(e,t){if(typeof t=="function"&&(t=t(e)),t=jo(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 Pm(e,t);}function Ui(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 c=0;c<n.length;c++)Ui(e,[n[c]].concat(t),r);return}else if(s&&a==="function"){for(let c=0;c<e.length;c++)n(e[c],c)&&Ui(e,[c].concat(t),r);return}else if(s&&a==="object"){let{from:c=0,to:l=e.length-1,by:u=1}=n;for(let f=c;f<=l;f+=u)Ui(e,[f].concat(t),r);return}else if(t.length>1){Ui(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=jo(i),n===void 0||dn(o)&&dn(i)&&!Array.isArray(i)?Pm(o,i):Jt(e,n,i));}function Em(...[e,t]){let r=jo(e||{}),n=Array.isArray(r),o=Sm(r);function i(...a){yf(()=>{n&&a.length===1?x_(r,a[0]):Ui(r,a);});}return [o,i]}var Uc=Symbol("store-root");function Fo(e,t,r,n,o){let i=t[r];if(e===i)return;let a=Array.isArray(e);if(r!==Uc&&(!dn(e)||!dn(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 l,u,f,d,p,h,g,v;for(f=0,d=Math.min(i.length,e.length);f<d&&(i[f]===e[f]||o&&i[f]&&e[f]&&i[f][o]===e[f][o]);f++)Fo(e[f],i,f,n,o);let b=new Array(e.length),C=new Map;for(d=i.length-1,p=e.length-1;d>=f&&p>=f&&(i[d]===e[p]||o&&i[f]&&e[f]&&i[d][o]===e[p][o]);d--,p--)b[p]=i[d];if(f>p||f>d){for(u=f;u<=p;u++)Jt(i,u,e[u]);for(;u<e.length;u++)Jt(i,u,b[u]),Fo(e[u],i,u,n,o);i.length>e.length&&Jt(i,"length",e.length);return}for(g=new Array(p+1),u=p;u>=f;u--)h=e[u],v=o&&h?h[o]:h,l=C.get(v),g[u]=l===void 0?-1:l,C.set(v,u);for(l=f;l<=d;l++)h=i[l],v=o&&h?h[o]:h,u=C.get(v),u!==void 0&&u!==-1&&(b[u]=i[l],u=g[u],C.set(v,u));for(u=f;u<e.length;u++)u in b?(Jt(i,u,b[u]),Fo(e[u],i,u,n,o)):Jt(i,u,e[u]);}else for(let l=0,u=e.length;l<u;l++)Fo(e[l],i,l,n,o);i.length>e.length&&Jt(i,"length",e.length);return}let s=Object.keys(e);for(let l=0,u=s.length;l<u;l++)Fo(e[s[l]],i,s[l],n,o);let c=Object.keys(i);for(let l=0,u=c.length;l<u;l++)e[c[l]]===void 0&&Jt(i,c[l],void 0);}function ws(e,t={}){let{merge:r,key:n="id"}=t,o=jo(e);return i=>{if(!dn(i)||!dn(o))return o;let a=Fo(o,{[Uc]:i},Uc,r,n);return a===void 0?i:a}}function Er(e,t){if(!t.storage)return [...e];let r=w_(t.storage||bt.general.rememberUser.storage),n=s=>{let c=JSON.parse(JSON.stringify(s));return typeof c!="object"||("blobUrl"in c&&(c.blobUrl=void 0),"attachments"in c&&Array.isArray(c.attachments)&&c.attachments.forEach(l=>{l&&"blobUrl"in l&&(l.blobUrl=void 0);})),JSON.stringify(c)},o=JSON.parse.bind(JSON),i=r.getItem(t.key),a=typeof e[0]=="function"?s=>e[1](()=>o(s)):s=>e[1](ws(o(s)));return i&&(a(i),t.onRecovered?.()),[e[0],typeof e[0]=="function"?s=>{let c=e[1](s);return s?r.setItem(t.key,n(c)):r.removeItem(t.key),c}:(...s)=>{e[1](...s);let c=n(st(()=>e[0]));r.setItem(t.key,c);}]}var w_=e=>(e??bt.general.rememberUser.storage)==="session"?sessionStorage:localStorage;var pt=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]},Hr=e=>(([t,r,n])=>(t*299+r*587+n*114)/1e3>155)(pt(e));var Im=({chatContainer:e,generalBackground:t})=>{let r=e?.backgroundColor??Li;if((e?.opacity??Ot)<=.3||r==="transparent"||et(r)){let o=t?.type??Lo,i=o==="Image"?"#000000":o==="Color"&&Le(t?.content)?t.content:"#ffffff";return Hr(i)}return Hr(e?.backgroundColor??Ni)};var Z={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"}}},Am=(e,t,r)=>{if(!e)return;let n=t?.style;n&&(C_(e.general,n,r),S_(e.chat,e.general?.background,n));},C_=(e,t,r)=>{R_(e?.background,t),t.setProperty(Z.general.fontFamily,(typeof e?.font=="string"?e.font:e?.font?.family)??No),__(e?.progressBar,t,r);},__=(e,t,r)=>{let n=e?.position??ys;t.setProperty(Z.general.progressBar.position,n==="fixed"?r?"absolute":"fixed":n),t.setProperty(Z.general.progressBar.color,e?.color??lm),t.setProperty(Z.general.progressBar.colorRgb,pt(e?.backgroundColor??cm).join(", ")),t.setProperty(Z.general.progressBar.height,`${e?.thickness??um}px`);let o=e?.placement??dm;t.setProperty(Z.general.progressBar.top,o==="Top"?"0":"auto"),t.setProperty(Z.general.progressBar.bottom,o==="Bottom"?"0":"auto");},S_=(e,t,r)=>{k_(e?.container,t,r,e?.roundness),P_(e?.hostBubbles,r,e?.roundness),E_(e?.guestBubbles,r,e?.roundness),I_(e?.buttons,r,e?.roundness),A_(e?.inputs,r,e?.roundness),O_(e?.container,t,r);},k_=(e,t,r,n)=>{let o=e?.backgroundColor??Li,i=o==="transparent"||et(o);r.setProperty(Z.chat.container.bgColor,i?"0, 0, 0":pt(o).join(", ")),r.setProperty(Z.chat.container.color,pt(e?.color??(Im({chatContainer:e,generalBackground:t})?hs:bs)).join(", ")),r.setProperty(Z.chat.container.maxWidth,e?.maxWidth??pm),r.setProperty(Z.chat.container.maxHeight,e?.maxHeight??mm);let a=i?"1":(e?.opacity??Ot).toString();r.setProperty(Z.chat.container.opacity,i?"0":(e?.opacity??Ot).toString()),r.setProperty(Z.chat.container.blur,a==="1"||i?"0xp":`${e?.blur??fm}px`),Hi(e?.shadow,r,Z.chat.container.boxShadow),Wi(e?.border??{roundeness:n??Rn},r,Z.chat.container.borderRadius),r.setProperty(Z.chat.container.borderWidth,fe(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),r.setProperty(Z.chat.container.borderOpacity,fe(e?.border?.opacity)?e.border.opacity.toString():Ot.toString()),r.setProperty(Z.chat.container.borderColor,pt(e?.border?.color??"").join(", "));},P_=(e,t,r)=>{t.setProperty(Z.chat.hostBubbles.bgColor,pt(e?.backgroundColor??$o).join(", ")),t.setProperty(Z.chat.hostBubbles.color,e?.color??gm),Wi(e?.border??{roundeness:r??Rn},t,Z.chat.hostBubbles.borderRadius),t.setProperty(Z.chat.hostBubbles.borderWidth,fe(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(Z.chat.hostBubbles.borderColor,pt(e?.border?.color??"").join(", ")),t.setProperty(Z.chat.hostBubbles.opacity,e?.backgroundColor==="transparent"?"0":fe(e?.opacity)?e.opacity.toString():Ot.toString()),t.setProperty(Z.chat.hostBubbles.borderOpacity,fe(e?.border?.opacity)?e.border.opacity.toString():Ot.toString()),t.setProperty(Z.chat.hostBubbles.blur,fe(e?.blur)?`${e.blur??0}px`:"none"),Hi(e?.shadow,t,Z.chat.hostBubbles.boxShadow);},E_=(e,t,r)=>{t.setProperty(Z.chat.guestBubbles.bgColor,pt(e?.backgroundColor??hm).join(", ")),t.setProperty(Z.chat.guestBubbles.color,e?.color??bm),Wi(e?.border??{roundeness:r??Rn},t,Z.chat.guestBubbles.borderRadius),t.setProperty(Z.chat.guestBubbles.borderWidth,fe(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(Z.chat.guestBubbles.borderColor,pt(e?.border?.color??"").join(", ")),t.setProperty(Z.chat.guestBubbles.borderOpacity,fe(e?.border?.opacity)?e.border.opacity.toString():Ot.toString()),t.setProperty(Z.chat.guestBubbles.opacity,e?.backgroundColor==="transparent"?"0":fe(e?.opacity)?e.opacity.toString():Ot.toString()),t.setProperty(Z.chat.guestBubbles.blur,fe(e?.blur)?`${e.blur??0}px`:"none"),Hi(e?.shadow,t,Z.chat.guestBubbles.boxShadow);},I_=(e,t,r)=>{let n=e?.backgroundColor??$i;t.setProperty(Z.chat.buttons.bgRgb,pt(n).join(", ")),t.setProperty(Z.chat.buttons.bgRgb,pt(n).join(", ")),t.setProperty(Z.chat.buttons.color,e?.color??ym),Wi(e?.border??{roundeness:r??Rn},t,Z.chat.buttons.borderRadius),t.setProperty(Z.chat.buttons.borderWidth,fe(e?.border?.thickness)?`${e?.border?.thickness}px`:`${vm}px`),t.setProperty(Z.chat.buttons.borderColor,pt(e?.border?.color??e?.backgroundColor??$i).join(", ")),t.setProperty(Z.chat.buttons.borderOpacity,fe(e?.border?.opacity)?e.border.opacity.toString():Ot.toString()),t.setProperty(Z.chat.buttons.opacity,e?.backgroundColor==="transparent"?"0":fe(e?.opacity)?e.opacity.toString():Ot.toString()),t.setProperty(Z.chat.buttons.blur,fe(e?.blur)?`${e.blur??0}px`:"none"),Hi(e?.shadow,t,Z.chat.buttons.boxShadow);},A_=(e,t,r)=>{t.setProperty(Z.chat.inputs.bgColor,pt(e?.backgroundColor??xm).join(", ")),t.setProperty(Z.chat.inputs.color,e?.color??Bi),t.setProperty(Z.chat.inputs.placeholderColor,e?.placeholderColor??wm),Wi(e?.border??{roundeness:r??Rn},t,Z.chat.inputs.borderRadius),t.setProperty(Z.chat.inputs.borderWidth,fe(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(Z.chat.inputs.borderColor,pt(e?.border?.color??"").join(", ")),t.setProperty(Z.chat.inputs.borderOpacity,fe(e?.border?.opacity)?e.border.opacity.toString():Ot.toString()),t.setProperty(Z.chat.inputs.opacity,e?.backgroundColor==="transparent"?"0":fe(e?.opacity)?e.opacity.toString():Ot.toString()),t.setProperty(Z.chat.inputs.blur,fe(e?.blur)?`${e.blur??0}px`:"none"),Hi(e?.shadow??Tm,t,Z.chat.inputs.boxShadow);},O_=(e,t,r)=>{let n=e?.backgroundColor??Li;if(n==="transparent"||et(n)||(e?.opacity??Ot)<=.2){let i=t?.type??Lo;r.setProperty(Z.chat.checkbox.bgRgb,i==="Image"?"rgba(255, 255, 255, 0.75)":pt((i==="Color"?t?.content:"#ffffff")??"#ffffff").join(", ")),i==="Image"?r.setProperty(Z.chat.checkbox.alphaRatio,"3"):r.setProperty(Z.chat.checkbox.alphaRatio,t?.content&&Hr(t?.content)?"1":"2");}else r.setProperty(Z.chat.checkbox.bgRgb,pt(n).concat(e?.opacity??1).join(", ")),r.setProperty(Z.chat.checkbox.alphaRatio,Hr(n)?"1":"2");},R_=(e,t)=>{t.setProperty(Z.general.bgImage,null),t.setProperty(Z.general.bgColor,null),t.setProperty((e?.type??Lo)==="Image"?Z.general.bgImage:Z.general.bgColor,D_({type:e?.type??Lo,content:e?.content??Ni}));},D_=({type:e,content:t}={})=>{switch(e){case "None":return "transparent";case void 0:case "Color":return t??Ni;case "Image":return `url(${t})`}},Wi=(e,t,r)=>{switch(e?.roundeness??Rn){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}}},Hi=(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 jc="resultId",Om=e=>{if(e)try{return sessionStorage.getItem(`${jc}-${e}`)??localStorage.getItem(`${jc}-${e}`)??void 0}catch{}},Rm=(e="session")=>(t,r)=>{try{Mm(e).setItem(`${jc}-${t}`,r);}catch{}},Dm=e=>{if(e)try{let t=sessionStorage.getItem(`agent-${e}-initialChatReply`)??localStorage.getItem(`agent-${e}-initialChatReply`);return t?JSON.parse(t):void 0}catch{}},Wc=(e,{agentId:t,storage:r})=>{try{let n=JSON.stringify(e);Mm(r).setItem(`agent-${t}-initialChatReply`,n);}catch{}},Ts=()=>{try{sessionStorage.setItem("agent-typeOpened","true");}catch{}},Cs=()=>{try{sessionStorage.removeItem("agent-typeOpened");}catch{}},_s=()=>{try{return sessionStorage.getItem("agent-typeOpened")==="true"}catch{return false}},Mm=e=>(e??bt.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 vt=()=>(e,t)=>tt(e,t);function M_(e,t){return `${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function it(e={}){let{strict:t=true,hookName:r="useContext",providerName:n="Provider",errorMessage:o,defaultValue:i}=e,a=xf(i);function s(){let c=vc(a);if(!c&&t){let l=new Error(o??M_(r,n));throw l.name="ContextError",Error.captureStackTrace?.(l,s),l}return c}return [a.Provider,s,a]}var[Hc,Nm]=it({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"}),Vi=e=>vt()(e,["lazyMount","unmountOnExit"]);var N_=Symbol();var Lm=Object.getPrototypeOf,Vc=new WeakMap,L_=e=>e&&(Vc.has(e)?Vc.get(e):Lm(e)===Object.prototype||Lm(e)===Array.prototype);var $m=e=>L_(e)&&e[N_]||null,zc=(e,t=true)=>{Vc.set(e,t);};function $_(){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 Bm(e,t){let r=$_();return r?(r[e]||(r[e]=t()),r[e]):t()}var Gc=e=>typeof e=="object"&&e!==null,Dn=Bm("__zag__proxyStateMap",()=>new WeakMap),zi=Bm("__zag__refSet",()=>new WeakSet),B_=e=>typeof e=="object"&&e!==null&&"$$typeof"in e,F_=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,U_=e=>typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeName=="string",j_=e=>B_(e)||F_(e)||U_(e),W_=(e=Object.is,t=(l,u)=>new Proxy(l,u),r=l=>Gc(l)&&!zi.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!j_(l)&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),n=l=>{switch(l.status){case "fulfilled":return l.value;case "rejected":throw l.reason;default:throw l}},o=new WeakMap,i=(l,u,f=n)=>{let d=o.get(l);if(d?.[0]===u)return d[1];let p=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return zc(p,true),o.set(l,[u,p]),Reflect.ownKeys(l).forEach(h=>{let g=Reflect.get(l,h);zi.has(g)?(zc(g,false),p[h]=g):g instanceof Promise?Object.defineProperty(p,h,{get(){return f(g)}}):Dn.has(g)?p[h]=fn(g,f):p[h]=g;}),Object.freeze(p)},a=new WeakMap,s=[1,1],c=l=>{if(!Gc(l))throw new Error("object required");let u=a.get(l);if(u)return u;let f=s[0],d=new Set,p=(H,V=++s[0])=>{f!==V&&(f=V,d.forEach(L=>L(H,V)));},h=s[1],g=(H=++s[1])=>(h!==H&&!d.size&&(h=H,b.forEach(([V])=>{let L=V[1](H);L>f&&(f=L);})),f),v=H=>(V,L)=>{let E=[...V];E[1]=[H,...E[1]],p(E,L);},b=new Map,C=(H,V)=>{if(d.size){let L=V[3](v(H));b.set(H,[V,L]);}else b.set(H,[V]);},_=H=>{let V=b.get(H);V&&(b.delete(H),V[1]?.());},k=H=>(d.add(H),d.size===1&&b.forEach(([L,E],P)=>{let w=L[3](v(P));b.set(P,[L,w]);}),()=>{d.delete(H),d.size===0&&b.forEach(([L,E],P)=>{E&&(E(),b.set(P,[L]));});}),I=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),D=t(I,{deleteProperty(H,V){let L=Reflect.get(H,V);_(V);let E=Reflect.deleteProperty(H,V);return E&&p(["delete",[V],L]),E},set(H,V,L,E){let P=Reflect.has(H,V),w=Reflect.get(H,V,E);if(P&&(e(w,L)||a.has(L)&&e(w,a.get(L))))return true;_(V),Gc(L)&&(L=$m(L)||L);let A=L;if(!Object.getOwnPropertyDescriptor(H,V)?.set)if(L instanceof Promise)L.then(M=>{Object.assign(L,{status:"fulfilled",value:M}),p(["resolve",[V],M]);}).catch(M=>{Object.assign(L,{status:"rejected",reason:M}),p(["reject",[V],M]);});else {!Dn.has(L)&&r(L)&&(A=Gi(L));let M=!zi.has(A)&&Dn.get(A);M&&C(V,M);}return Reflect.set(H,V,A,E),p(["set",[V],L,w]),true}});a.set(l,D);let oe=[I,g,i,k];return Dn.set(D,oe),Reflect.ownKeys(l).forEach(H=>{let V=Object.getOwnPropertyDescriptor(l,H);V.get||V.set?Object.defineProperty(I,H,V):D[H]=l[H];}),D})=>[c,Dn,zi,e,t,r,n,o,i,a,s],[H_]=W_();function Gi(e={}){return H_(e)}function Wo(e,t,r){let n=Dn.get(e);let o,i=[],a=n[3],s=false,l=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,l();}}function fn(e,t){let r=Dn.get(e);let[n,o,i]=r;return i(n,o(),t)}function zt(e){return zi.add(e),e}function Fm(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,c={};c.get=()=>a(fn(n)),s&&(c.set=l=>s(n,l)),Object.defineProperty(e,o,c);});let n=Gi(e);return n}var jm=e=>e[0],Wm=e=>e[e.length-1];function Hm(e){for(;e.length>0;)e.pop();return e}var Um=e=>e?.constructor.name==="Array",V_=(e,t)=>{if(e.length!==t.length)return false;for(let r=0;r<e.length;r++)if(!Ps(e[r],t[r]))return false;return true},Ps=(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(Um(e)&&Um(t))return V_(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(!Ps(e[i],t[i]))return false}return true},Vr=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,er=e=>e,Es=()=>{},Yi=(...e)=>(...t)=>{e.forEach(function(r){r?.(...t);});},qi=(()=>{let e=0;return ()=>(e++,e.toString(36))})();var Ki=e=>Array.isArray(e);var zm=e=>e!=null&&typeof e=="object",Xi=e=>zm(e)&&!Ki(e),Zi=e=>typeof e=="number"&&!Number.isNaN(e),jt=e=>typeof e=="string",pn=e=>typeof e=="function",Gm=e=>e==null,Yc=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),z_=e=>Object.prototype.toString.call(e),Ym=Function.prototype.toString,G_=Ym.call(Object),qm=e=>{if(!zm(e)||z_(e)!="[object Object]")return false;let t=Object.getPrototypeOf(e);if(t===null)return true;let r=Yc(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Ym.call(r)==G_};function kt(e){if(!q_(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]=kt(o));}return r}var q_=e=>e&&typeof e=="object"&&e.constructor===Object;function zr(...e){e.length===1?e[0]:e[1];e.length===2?e[0]:true;}function Qi(...e){e.length===1?e[0]:e[1];e.length===2?e[0]:true;}function Km(e,t,r){typeof r.value=="object"&&(r.value=Mn(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value;}function Mn(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(Mn(a));})):i==="[object Map]"?(o=new Map,e.forEach(function(a,s){o.set(Mn(s),Mn(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(Mn(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++)Km(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]||Km(o,r,Object.getOwnPropertyDescriptor(e,r));}return o||e}var K_=Object.defineProperty,X_=(e,t,r)=>t in e?K_(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,ae=(e,t,r)=>X_(e,typeof t!="symbol"?t+"":t,r);function Qm(e,...t){for(let r of t){let n=kt(r);for(let o in n)qm(r[o])?(e[o]||(e[o]={}),Qm(e[o],r[o])):e[o]=r[o];}return e}function Xm(e){return Mn(e)}function pr(e){return jt(e)?{type:e}:e}function mn(e){return e?Ki(e)?e.slice():[e]:[]}function Jm(e){return Xi(e)&&e.predicate!=null}var Z_=()=>true;function Kc(e,t,r,n){return o=>jt(o)?!!e[o]?.(t,r,n):pn(o)?o(t,r,n):o.predicate(e)(t,r,n)}function Q_(...e){return {predicate:t=>(r,n,o)=>e.map(Kc(t,r,n,o)).some(Boolean)}}function J_(...e){return {predicate:t=>(r,n,o)=>e.map(Kc(t,r,n,o)).every(Boolean)}}function eS(e){return {predicate:t=>(r,n,o)=>!Kc(t,r,n,o)(e)}}var Is={or:Q_,and:J_,not:eS};function eg(e,t){return e=e??Z_,(r,n,o)=>{if(jt(e)){let i=t[e];return pn(i)?i(r,n,o):i}return Jm(e)?e.predicate(t)(r,n,o):e?.(r,n,o)}}function qc(e,t){return (r,n,o)=>Jm(e)?e.predicate(t)(r,n,o):e}function rS(e){let t=e.computed??er({}),r=e.context??er({}),n=e.initial?e.states?.[e.initial]?.tags:[],o=Gi({value:e.initial??"",previousValue:"",event:er({}),previousEvent:er({}),context:Fm(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 Ji(e,t){return (r,n)=>{if(Zi(e))return e;if(pn(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 Qi(i==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${e}\`. It doesn't exist in \`options.delays\``),pn(i)?i(r,n):i}}}}function nS(e){return jt(e)?{target:e}:e}function oS(e,t){return (r,n,o)=>mn(e).map(nS).find(i=>eg(i.guard,t)(r,n,o)??i.target??i.actions)}var tg=class{constructor(e,t){ae(this,"status","Not Started"),ae(this,"state"),ae(this,"initialState"),ae(this,"initialContext"),ae(this,"id"),ae(this,"type","machine"),ae(this,"activityEvents",new Map),ae(this,"delayedEvents",new Map),ae(this,"stateListeners",new Set),ae(this,"doneListeners",new Set),ae(this,"contextWatchers",new Set),ae(this,"removeStateListener",Es),ae(this,"parent"),ae(this,"children",new Map),ae(this,"guardMap"),ae(this,"actionMap"),ae(this,"delayMap"),ae(this,"activityMap"),ae(this,"sync"),ae(this,"options"),ae(this,"config"),ae(this,"_created",()=>{let r=pr("machine.created");this.executeActions(this.config?.created,r);}),ae(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(c=>{c(this.stateSnapshot);});},this.sync),this.setupContextWatchers(),this.executeActivities(pr("machine.start"),mn(this.config.activities),"machine.start"),this.executeActions(this.config.entry,pr("machine.start"));let n=pr("machine.init"),o=Xi(r)?r.value:r,i=Xi(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}),ae(this,"setupContextWatchers",()=>{let{watch:r}=this.config;if(!r)return;let n=fn(this.state.context),o=Wo(this.state.context,()=>{let i=fn(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);}),ae(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,pr("machine.stop")),this.executeActions(this.config.exit,pr("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this}),ae(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear();}),ae(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(r=>r()),this.contextWatchers.clear();}),ae(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(r=>{r.forEach(n=>n());}),this.delayedEvents.clear();}),ae(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());}),ae(this,"sendChild",(r,n)=>{let o=pr(r),i=Vr(n,this.contextSnapshot),a=this.children.get(i);a||Qi(`[@zag-js/core] Cannot send '${o.type}' event to unknown child`),a.send(o);}),ae(this,"stopChild",r=>{this.children.has(r)||Qi(`[@zag-js/core > stop-child] Cannot stop unknown child ${r}`),this.children.get(r).stop(),this.children.delete(r);}),ae(this,"removeChild",r=>{this.children.delete(r);}),ae(this,"stopChildren",()=>{this.children.forEach(r=>r.stop()),this.children.clear();}),ae(this,"setParent",r=>{this.parent=r;}),ae(this,"spawn",(r,n)=>{let o=Vr(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))}),ae(this,"stopActivity",r=>{if(!this.state.value)return;let n=this.activityEvents.get(this.state.value);n?.get(r)?.(),n?.delete(r);}),ae(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]])));}),ae(this,"setState",r=>{this.state.previousValue=this.state.value,this.state.value=r;let n=this.getStateNode(r);r==null?Hm(this.state.tags):this.state.tags=mn(n?.tags);}),ae(this,"setContext",r=>{r&&Qm(this.state.context,kt(r));}),ae(this,"setOptions",r=>{let n=kt(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};}),ae(this,"getStateNode",r=>{if(r)return this.config.states?.[r]}),ae(this,"getNextStateInfo",(r,n)=>{let o=this.determineTransition(r,n),i=!o?.target,a=o?.target??this.state.value,s=this.state.value!==a,c=this.getStateNode(a),u={reenter:!i&&!s&&!o?.internal,transition:o,stateNode:c,target:a,changed:s};return this.log("NextState:",`[${n.type}]`,this.state.value,"---->",u.target),u}),ae(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);}}}),ae(this,"getDelayedEventActions",r=>{let n=this.getStateNode(r),o=this.state.event;if(!n||!n.after)return;let i=[],a=[];if(Ki(n.after)){let s=this.determineTransition(n.after,o);if(!s)return;if(!Yc(s,"delay"))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(s)}`);let l=Ji(s.delay,this.delayMap)(this.contextSnapshot,o),u=this.getAfterActions(s,l);return i.push(u.entry),a.push(u.exit),{entries:i,exits:a}}if(Xi(n.after))for(let s in n.after){let c=n.after[s],u=Ji(s,this.delayMap)(this.contextSnapshot,o),f=this.getAfterActions(c,u);i.push(f.entry),a.push(f.exit);}return {entries:i,exits:a}}),ae(this,"executeActions",(r,n)=>{let o=qc(r,this.guardMap)(this.contextSnapshot,n,this.guardMeta);for(let i of mn(o)){let a=jt(i)?this.actionMap?.[i]:i;zr(jt(i)&&!a,`[@zag-js/core > execute-actions] No implementation found for action: \`${i}\``),a?.(this.state.context,n,this.meta);}}),ae(this,"executeActivities",(r,n,o)=>{for(let i of n){let a=jt(i)?this.activityMap?.[i]:i;if(!a){zr(`[@zag-js/core > execute-activity] No implementation found for activity: \`${i}\``);continue}let s=a(this.state.context,r,this.meta);if(s){let c=jt(i)?i:i.name||qi();this.addActivityCleanup(o??this.state.value,c,s);}}}),ae(this,"createEveryActivities",(r,n)=>{if(r)if(Ki(r)){let o=mn(r).find(c=>{let l=c.delay,f=Ji(l,this.delayMap)(this.contextSnapshot,this.state.event);return eg(c.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??f!=null});if(!o)return;let a=Ji(o.delay,this.delayMap)(this.contextSnapshot,this.state.event);n(()=>{let c=globalThis.setInterval(()=>{this.executeActions(o.actions,this.state.event);},a);return ()=>{globalThis.clearInterval(c);}});}else for(let o in r){let i=r?.[o],s=Ji(o,this.delayMap)(this.contextSnapshot,this.state.event);n(()=>{let l=globalThis.setInterval(()=>{this.executeActions(i,this.state.event);},s);return ()=>{globalThis.clearInterval(l);}});}}),ae(this,"setEvent",r=>{this.state.previousEvent=this.state.event,this.state.event=zt(pr(r));}),ae(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=qc(i?.exit,this.guardMap)(this.contextSnapshot,n,this.guardMeta),s=mn(a),c=this.delayedEvents.get(o);c&&s.push(...c),this.executeActions(s,n),this.delayedEvents.delete(o);}),ae(this,"performEntryEffects",(r,n)=>{let o=this.getStateNode(r),i=mn(o?.activities);this.createEveryActivities(o?.every,l=>{i.unshift(l);}),i.length>0&&this.executeActivities(n,i);let a=qc(o?.entry,this.guardMap)(this.contextSnapshot,n,this.guardMeta),s=mn(a),c=this.getDelayedEventActions(r);o?.after&&c&&(this.delayedEvents.set(r,c?.exits),s.push(...c.entries)),this.executeActions(s,n),o?.type==="final"&&(this.state.done=true,this.doneListeners.forEach(l=>{l(this.stateSnapshot);}),this.stop());}),ae(this,"performTransitionEffects",(r,n)=>{let o=this.determineTransition(r,n);this.executeActions(o?.actions,n);}),ae(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);}),ae(this,"determineTransition",(r,n)=>oS(r,this.guardMap)?.(this.contextSnapshot,n,this.guardMeta)),ae(this,"sendParent",r=>{this.parent||Qi("[@zag-js/core > send-parent] Cannot send event to an unknown parent");let n=pr(r);this.parent?.send(n);}),ae(this,"log",(...r)=>{}),ae(this,"send",r=>{let n=pr(r);this.transition(this.state.value,n);}),ae(this,"transition",(r,n)=>{let o=jt(r)?this.getStateNode(r):r?.stateNode,i=pr(n);if(!o&&!this.config.on){let c=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}`;zr(c);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}),ae(this,"subscribe",r=>(this.stateListeners.add(r),this.status==="Running"&&r(this.stateSnapshot),()=>{this.stateListeners.delete(r);})),ae(this,"onDone",r=>(this.doneListeners.add(r),this)),ae(this,"onTransition",r=>(this.stateListeners.add(r),this.status==="Running"&&r(this.stateSnapshot),this)),this.config=Xm(e),this.options=Xm(t??{}),this.id=this.config.id??`machine-${qi()}`,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=rS(this.config),this.initialContext=fn(this.state.context);}get stateSnapshot(){return er(fn(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}}},mr=(e,t)=>new tg(e,t),rg=e=>e instanceof tg||e?.type==="machine",iS=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),aS=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Zm=e=>{let t={},r;for(;r=aS.exec(e);)t[r[1]]=r[2];return t},sS=(e,t)=>{if(jt(e)){if(jt(t))return `${e};${t}`;e=Zm(e);}else jt(t)&&(t=Zm(t));return Object.assign({},e??{},t??{})};function As(...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]=Yi(r[n],t[n]);continue}if(n==="className"||n==="class"){t[n]=iS(t[n],r[n]);continue}if(n==="style"){t[n]=sS(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 ng(e){return new Proxy({},{get(){return e}})}var tr=()=>e=>Array.from(new Set(e));function ce(...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 c=e[s];typeof c=="function"&&(c=c()),a=As(a,{[i]:(c||{})[i]});}return a[i]}for(let s=e.length-1;s>=0;s--){let c,l=e[s];if(typeof l=="function"&&(l=l()),c=(l||{})[i],c!==void 0)return c}}});}}return t}var lS=e=>Array.isArray(e),cS=e=>e!=null&&typeof e=="object",uS=e=>cS(e)&&!lS(e),dS=e=>typeof e=="number"&&!Number.isNaN(e),ig=e=>typeof e=="string",fS=Function.prototype.toString;fS.call(Object);var og={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},pS=e=>e.startsWith("--")?e:vS(e);function mS(e){return e in og?og[e]:e}var rr=ng(e=>{let t={};for(let r in e){let n=e[r];if(!(r==="readOnly"&&n===false)){if(r==="style"&&uS(n)){t.style=gS(n);continue}if(r==="children"){ig(n)&&(t.textContent=n);continue}t[mS(r)]=n;}}return t});function gS(e){let t={};for(let r in e){let n=e[r];!ig(n)&&!dS(n)||(t[pS(r)]=n);}return t}var hS=/[A-Z]/g,bS=/^ms-/;function yS(e){return "-"+e.toLowerCase()}var Xc={};function vS(e){if(Xc.hasOwnProperty(e))return Xc[e];var t=e.replace(hS,yS);return Xc[e]=bS.test(t)?"-"+t:t}function ag(e,t){let{actions:r,context:n}=t??{},[o,i]=Em(e.getState());return de(()=>{let a=e.subscribe(s=>{i(ws(s));});he(()=>{a();});}),_e(()=>{let a=typeof n=="function"?n():n;e.setContext(a);}),_e(()=>{e.setOptions({actions:r});}),o}function sg(e){return [ag(e),e.send]}function xS(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 de(()=>{o.start(r),he(()=>{o.stop();});}),o}function Ar(e,t){let r=xS(e,t);return [ag(r,t),r.send,r]}var Zc=e=>r=>{let[n,o]=tt(r,["asChild"]);if(n.asChild){let i=a=>{let[,s]=tt(o,["ref"]);return ce(s,a)};return n.asChild(i)}return m(Df,Oe({component:e},o))};function wS(){let e=new Map;return new Proxy(Zc,{apply(t,r,n){return Zc(n[0])},get(t,r){let n=r;return e.has(n)||e.set(n,Zc(n)),e.get(n)}})}var ve=wS();function lg(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 Os(e){return e?.animationName||"none"}function cg(e){return mr({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=Os(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=Os(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=Os(t.styles));},a=s=>{let c=Os(t.styles);(s.composedPath?.()?.[0]??s.target)===o&&c===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 Ho=e=>vt()(e,["immediate","lazyMount","onExitComplete","present","unmountOnExit"]),Nn=e=>{let[t,r]=Vi(e),[n,o]=O(false),[i,a]=Ar(cg(r),{context:r}),s=j(()=>lg(i,a));return _e(()=>{s().present&&o(true);}),j(()=>({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[Vo,gn]=it({hookName:"usePresenceContext",providerName:"<PresenceProvider />"});var Wt=e=>e?"":void 0;var dg=2147483647,CS=1,_S=9,SS=11,Rs=e=>typeof e=="object"&&e!==null,xt=e=>Rs(e)&&e.nodeType===CS&&typeof e.nodeName=="string",fg=e=>Rs(e)&&e.nodeType===_S,kS=e=>Rs(e)&&e===e.window;var pg=e=>xt(e)?e.localName||"":"#document";function PS(e){return ["html","body","#document"].includes(pg(e))}var ES=e=>Rs(e)&&e.nodeType!==void 0,Jc=e=>ES(e)&&e.nodeType===SS&&"host"in e;function nr(e,t){return !e||!t||!xt(e)||!xt(t)?false:e===t||e.contains(t)}function gr(e){return fg(e)?e:kS(e)?e.document:e?.ownerDocument??document}function IS(e){return gr(e).documentElement}function Or(e){return Jc(e)?Or(e.host):fg(e)?e.defaultView??window:xt(e)?e.ownerDocument?.defaultView??window:window}function AS(e){let t=e.activeElement;for(;t?.shadowRoot;){let r=t.shadowRoot.activeElement;if(r===t)break;t=r;}return t}var mg=()=>typeof document<"u";function OS(){return navigator.userAgentData?.platform??navigator.platform}var eu=e=>mg()&&e.test(OS()),RS=e=>mg()&&e.test(navigator.userAgent);var gg=()=>eu(/^Mac/);var hg=()=>RS(/firefox\//i),DS=()=>eu(/mac|iphone|ipad|ipod/i),bg=()=>eu(/iP(hone|ad|od)|iOS/);function MS(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function Rr(e){return MS(e)?.[0]??e.target}var yg=e=>nr(e.currentTarget,Rr(e));function tu(e){let t=e.currentTarget;if(!t)return false;let r=DS();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 ru(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 nu=e=>e.id;function NS(e,t,r=nu){return e.find(n=>r(n)===t)}function ou(e,t,r=nu){let n=NS(e,t,r);return n?e.indexOf(n):-1}function vg(e,t,r=true){let n=ou(e,t);return n=r?(n+1)%e.length:Math.min(n+1,e.length-1),e[n]}function xg(e,t,r=true){let n=ou(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 LS=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(),$S=e=>LS(e.dataset.valuetext??e.textContent??""),BS=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase()),FS=(e,t)=>e.map((r,n)=>e[(Math.max(t,0)+n)%e.length]);function US(e,t,r,n=nu){let o=r?ou(e,r,n):-1,i=r?FS(e,o):e;return t.length===1&&(i=i.filter(s=>n(s)!==r)),i.find(s=>BS($S(s),t))}function jS(e,t){let{state:r,activeId:n,key:o,timeout:i=350,itemToId:a}=t,s=r.keysSoFar+o,l=s.length>1&&Array.from(s).every(h=>h===s[0])?s[0]:s,u=e.slice(),f=US(u,l,n,a);function d(){clearTimeout(r.timer),r.timer=-1;}function p(h){r.keysSoFar=h,d(),h!==""&&(r.timer=+setTimeout(()=>{p(""),d();},i));}return p(s),f}var iu=Object.assign(jS,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:WS});function WS(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}function HS(e){if(pg(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Jc(e)&&e.host||IS(e);return Jc(t)?t.host:t}var wg=e=>typeof e=="object"&&e!==null&&e.nodeType===1,VS=e=>wg(e)&&e.tagName==="IFRAME";function zS(e){return wg(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:false}function GS(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}var Tg="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 Ds(e){return !e||e.closest("[inert]")?false:e.matches(Tg)&&zS(e)}function au(e,t){if(!e)return [];let r=Array.from(e.querySelectorAll(Tg)),n=r.filter(ug);return n.forEach((o,i)=>{if(VS(o)&&o.contentDocument){let a=o.contentDocument.body,s=au(a);n.splice(i,1,...s);}}),!n.length&&t?r:n}function ug(e){return e!=null&&e.tabIndex>0?true:Ds(e)&&!GS(e)}function YS(e,t){let r=au(e,t),n=r[0]||null,o=r[r.length-1]||null;return [n,o]}function Cg(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=au(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]=YS(t),o=t.ownerDocument||document;return !(o.activeElement===r&&e.shiftKey||o.activeElement===n&&!e.shiftKey||!r&&!n)}function su(e){if(e==null||!xt(e))return false;try{let t=Or(e);return e instanceof t.HTMLInputElement&&e.selectionStart!=null||/(textarea|select)/.test(e.localName)||e.isContentEditable}catch{return false}}var qS=/auto|scroll|overlay|hidden|clip/;function Sg(e){let t=Or(e),{overflow:r,overflowX:n,overflowY:o,display:i}=t.getComputedStyle(e);return qS.test(r+o+n)&&!["inline","contents"].includes(i)}function kg(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 at(e){let t=globalThis.requestAnimationFrame(e);return ()=>{globalThis.cancelAnimationFrame(t);}}function KS(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 Pg(e,t){let n=at,o=[];return o.push(n(()=>{let i=typeof e=="function"?e():e;o.push(KS(i,t));})),()=>{o.forEach(i=>i?.());}}function lu(e){let t=HS(e);return PS(t)?gr(t).body:xt(t)&&Sg(t)?t:lu(t)}function Ms(e,t){return Array.from(e?.querySelectorAll(t)??[])}function hn(e){let t={getRootNode:r=>r.getRootNode?.()??document,getDoc:r=>gr(t.getRootNode(r)),getWin:r=>t.getDoc(r).defaultView??window,getActiveElement:r=>AS(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 XS(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function Eg(e,t){let{rootEl:r,...n}=t||{};!e||!r||!Sg(r)||!XS(r)||e.scrollIntoView(n);}var Qc=new WeakMap;function ZS(e,t,r){Qc.has(e)||Qc.set(e,new Map);let n=Qc.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 Ig(e,t){return e?ZS(e,"style",()=>{let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n;}}):()=>{}}var QS=1e3/60;function JS(e,t){let r=e();if(xt(r)&&r.isConnected)return t(r),()=>{};{let n=setInterval(()=>{let o=e();xt(o)&&o.isConnected&&(t(o),clearInterval(n));},QS);return ()=>clearInterval(n)}}function Ag(e,t){let r=[];return e?.forEach(n=>{let o=JS(n,t);r.push(o);}),()=>{r.forEach(n=>n());}}var[S2,zo]=it({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:false,defaultValue:()=>({dir:"ltr",locale:"en-US"})});var ek=e=>typeof e=="function",Og=(e,...t)=>ek(e)?e(...t):e;var[tk,Ln]=it({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:false,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})}),rk=T("<span hidden>"),$n=e=>{let[t,r]=O(),n=()=>Og(e.value)??t()?.ownerDocument??document,o=j(()=>({getRootNode:n,getDocument:()=>gr(n()),getWindow:()=>Or(n())}));return m(tk,{value:o,get children(){return [j(()=>e.children),m(F,{get when(){return !e.value},get children(){var i=rk();return ye(r,i),i}})]}})};var nk=Object.defineProperty,bn=(e,t)=>{for(var r in t)nk(e,r,{get:t[r],enumerable:true});};var hr=(e,t=[])=>({parts:(...r)=>{if(ok(t))return hr(e,r);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...r)=>hr(e,[...t,...r]),rename:r=>hr(r,t),keys:()=>t,build:()=>[...new Set(t)].reduce((r,n)=>Object.assign(r,{[n]:{selector:[`&[data-scope="${Go(e)}"][data-part="${Go(n)}"]`,`& [data-scope="${Go(e)}"][data-part="${Go(n)}"]`].join(", "),attrs:{"data-scope":Go(e),"data-part":Go(n)}}}),{})}),Go=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),ok=e=>e.length===0;var Rg=["top","right","bottom","left"];var Dr=Math.min,Rt=Math.max,ta=Math.round,ra=Math.floor,Gr=e=>({x:e,y:e}),ik={left:"right",right:"left",bottom:"top",top:"bottom"},ak={start:"end",end:"start"};function Ls(e,t,r){return Rt(e,Dr(t,r))}function Mr(e,t){return typeof e=="function"?e(t):e}function Nr(e){return e.split("-")[0]}function Bn(e){return e.split("-")[1]}function $s(e){return e==="x"?"y":"x"}function Bs(e){return e==="y"?"height":"width"}function br(e){return ["top","bottom"].includes(Nr(e))?"y":"x"}function Fs(e){return $s(br(e))}function Dg(e,t,r){r===void 0&&(r=false);let n=Bn(e),o=Fs(e),i=Bs(o),a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=ea(a)),[a,ea(a)]}function Mg(e){let t=ea(e);return [Ns(e),t,Ns(t)]}function Ns(e){return e.replace(/start|end/g,t=>ak[t])}function sk(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 Ng(e,t,r,n){let o=Bn(e),i=sk(Nr(e),r==="start",n);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Ns)))),i}function ea(e){return e.replace(/left|right|bottom|top/g,t=>ik[t])}function lk(e){return {top:0,right:0,bottom:0,left:0,...e}}function cu(e){return typeof e!="number"?lk(e):{top:e,right:e,bottom:e,left:e}}function Fn(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 Lg(e,t,r){let{reference:n,floating:o}=e,i=br(t),a=Fs(t),s=Bs(a),c=Nr(t),l=i==="y",u=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,d=n[s]/2-o[s]/2,p;switch(c){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:f};break;case "left":p={x:n.x-o.width,y:f};break;default:p={x:n.x,y:n.y};}switch(Bn(t)){case "start":p[a]-=d*(r&&l?-1:1);break;case "end":p[a]+=d*(r&&l?-1:1);break}return p}var Fg=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t)),l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Lg(l,n,c),d=n,p={},h=0;for(let g=0;g<s.length;g++){let{name:v,fn:b}=s[g],{x:C,y:_,data:k,reset:I}=await b({x:u,y:f,initialPlacement:n,placement:d,strategy:o,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});u=C??u,f=_??f,p={...p,[v]:{...p[v],...k}},I&&h<=50&&(h++,typeof I=="object"&&(I.placement&&(d=I.placement),I.rects&&(l=I.rects===true?await a.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:u,y:f}=Lg(l,d,c)),g=-1);}return {x:u,y:f,placement:d,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:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=false,padding:p=0}=Mr(t,e),h=cu(p),v=s[d?f==="floating"?"reference":"floating":f],b=Fn(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(v)))==null||r?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),C=f==="floating"?{x:n,y:o,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),k=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},I=Fn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:C,offsetParent:_,strategy:c}):C);return {top:(b.top-I.top+h.top)/k.y,bottom:(I.bottom-b.bottom+h.bottom)/k.y,left:(b.left-I.left+h.left)/k.x,right:(I.right-b.right+h.right)/k.x}}var Ug=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:o,rects:i,platform:a,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Mr(e,t)||{};if(l==null)return {};let f=cu(u),d={x:r,y:n},p=Fs(o),h=Bs(p),g=await a.getDimensions(l),v=p==="y",b=v?"top":"left",C=v?"bottom":"right",_=v?"clientHeight":"clientWidth",k=i.reference[h]+i.reference[p]-d[p]-i.floating[h],I=d[p]-i.reference[p],B=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l)),D=B?B[_]:0;(!D||!await(a.isElement==null?void 0:a.isElement(B)))&&(D=s.floating[_]||i.floating[h]);let oe=k/2-I/2,H=D/2-g[h]/2-1,V=Dr(f[b],H),L=Dr(f[C],H),E=V,P=D-g[h]-L,w=D/2-g[h]/2+oe,A=Ls(E,w,P),M=!c.arrow&&Bn(o)!=null&&w!==A&&i.reference[h]/2-(w<E?V:L)-g[h]/2<0,X=M?w<E?w-E:w-P:0;return {[p]:d[p]+X,data:{[p]:A,centerOffset:w-A-X,...M&&{alignmentOffset:X}},reset:M}}});var jg=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:c,elements:l}=t,{mainAxis:u=true,crossAxis:f=true,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=true,...v}=Mr(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return {};let b=Nr(o),C=br(s),_=Nr(s)===s,k=await(c.isRTL==null?void 0:c.isRTL(l.floating)),I=d||(_||!g?[ea(s)]:Mg(s)),B=h!=="none";!d&&B&&I.push(...Ng(s,g,h,k));let D=[s,...I],oe=await Yo(t,v),H=[],V=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&H.push(oe[b]),f){let w=Dg(o,a,k);H.push(oe[w[0]],oe[w[1]]);}if(V=[...V,{placement:o,overflows:H}],!H.every(w=>w<=0)){var L,E;let w=(((L=i.flip)==null?void 0:L.index)||0)+1,A=D[w];if(A&&(!(f==="alignment"?C!==br(A):false)||V.every(me=>me.overflows[0]>0&&br(me.placement)===C)))return {data:{index:w,overflows:V},reset:{placement:A}};let M=(E=V.filter(X=>X.overflows[0]<=0).sort((X,me)=>X.overflows[1]-me.overflows[1])[0])==null?void 0:E.placement;if(!M)switch(p){case "bestFit":{var P;let X=(P=V.filter(me=>{if(B){let ee=br(me.placement);return ee===C||ee==="y"}return true}).map(me=>[me.placement,me.overflows.filter(ee=>ee>0).reduce((ee,Ue)=>ee+Ue,0)]).sort((me,ee)=>me[1]-ee[1])[0])==null?void 0:P[0];X&&(M=X);break}case "initialPlacement":M=s;break}if(o!==M)return {reset:{placement:M}}}return {}}}};function $g(e,t){return {top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bg(e){return Rg.some(t=>e[t]>=0)}var Wg=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:n="referenceHidden",...o}=Mr(e,t);switch(n){case "referenceHidden":{let i=await Yo(t,{...o,elementContext:"reference"}),a=$g(i,r.reference);return {data:{referenceHiddenOffsets:a,referenceHidden:Bg(a)}}}case "escaped":{let i=await Yo(t,{...o,altBoundary:true}),a=$g(i,r.floating);return {data:{escapedOffsets:a,escaped:Bg(a)}}}default:return {}}}}};async function ck(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=Bn(r),c=br(r)==="y",l=["left","top"].includes(a)?-1:1,u=i&&c?-1:1,f=Mr(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),c?{x:p*u,y:d*l}:{x:d*l,y:p*u}}var Hg=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,c=await ck(t,e);return a===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},Vg=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:v=>{let{x:b,y:C}=v;return {x:b,y:C}}},...c}=Mr(e,t),l={x:r,y:n},u=await Yo(t,c),f=br(Nr(o)),d=$s(f),p=l[d],h=l[f];if(i){let v=d==="y"?"top":"left",b=d==="y"?"bottom":"right",C=p+u[v],_=p-u[b];p=Ls(C,p,_);}if(a){let v=f==="y"?"top":"left",b=f==="y"?"bottom":"right",C=h+u[v],_=h-u[b];h=Ls(C,h,_);}let g=s.fn({...t,[d]:p,[f]:h});return {...g,data:{x:g.x-r,y:g.y-n,enabled:{[d]:i,[f]:a}}}}}},zg=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:c=true,crossAxis:l=true}=Mr(e,t),u={x:r,y:n},f=br(o),d=$s(f),p=u[d],h=u[f],g=Mr(s,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){let _=d==="y"?"height":"width",k=i.reference[d]-i.floating[_]+v.mainAxis,I=i.reference[d]+i.reference[_]-v.mainAxis;p<k?p=k:p>I&&(p=I);}if(l){var b,C;let _=d==="y"?"width":"height",k=["top","left"].includes(Nr(o)),I=i.reference[f]-i.floating[_]+(k&&((b=a.offset)==null?void 0:b[f])||0)+(k?0:v.crossAxis),B=i.reference[f]+i.reference[_]+(k?0:((C=a.offset)==null?void 0:C[f])||0)-(k?v.crossAxis:0);h<I?h=I:h>B&&(h=B);}return {[d]:p,[f]:h}}}},Gg=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:c=()=>{},...l}=Mr(e,t),u=await Yo(t,l),f=Nr(o),d=Bn(o),p=br(o)==="y",{width:h,height:g}=i.floating,v,b;f==="top"||f==="bottom"?(v=f,b=d===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(b=f,v=d==="end"?"top":"bottom");let C=g-u.top-u.bottom,_=h-u.left-u.right,k=Dr(g-u[v],C),I=Dr(h-u[b],_),B=!t.middlewareData.shift,D=k,oe=I;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(oe=_),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(D=C),B&&!d){let V=Rt(u.left,0),L=Rt(u.right,0),E=Rt(u.top,0),P=Rt(u.bottom,0);p?oe=h-2*(V!==0||L!==0?V+L:Rt(u.left,u.right)):D=g-2*(E!==0||P!==0?E+P:Rt(u.top,u.bottom));}await c({...t,availableWidth:oe,availableHeight:D});let H=await a.getDimensions(s.floating);return h!==H.width||g!==H.height?{reset:{rects:true}}:{}}}};function Us(){return typeof window<"u"}function Un(e){return qg(e)?(e.nodeName||"").toLowerCase():"#document"}function Ht(e){var t;return (e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yr(e){var t;return (t=(qg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qg(e){return Us()?e instanceof Node||e instanceof Ht(e).Node:false}function or(e){return Us()?e instanceof Element||e instanceof Ht(e).Element:false}function vr(e){return Us()?e instanceof HTMLElement||e instanceof Ht(e).HTMLElement:false}function Yg(e){return !Us()||typeof ShadowRoot>"u"?false:e instanceof ShadowRoot||e instanceof Ht(e).ShadowRoot}function Ko(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 Kg(e){return ["table","td","th"].includes(Un(e))}function na(e){return [":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return false}})}function js(e){let t=Ws(),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 Xg(e){let t=Yr(e);for(;vr(t)&&!jn(t);){if(js(t))return t;if(na(t))return null;t=Yr(t);}return null}function Ws(){return typeof CSS>"u"||!CSS.supports?false:CSS.supports("-webkit-backdrop-filter","none")}function jn(e){return ["html","body","#document"].includes(Un(e))}function ir(e){return Ht(e).getComputedStyle(e)}function oa(e){return or(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yr(e){if(Un(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Yg(e)&&e.host||yr(e);return Yg(t)?t.host:t}function Zg(e){let t=Yr(e);return jn(t)?e.ownerDocument?e.ownerDocument.body:e.body:vr(t)&&Ko(t)?t:Zg(t)}function qo(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=true);let o=Zg(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),a=Ht(o);if(i){let s=Hs(a);return t.concat(a,a.visualViewport||[],Ko(o)?o:[],s&&r?qo(s):[])}return t.concat(o,qo(o,[],r))}function Hs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eh(e){let t=ir(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=vr(e),i=o?e.offsetWidth:r,a=o?e.offsetHeight:n,s=ta(r)!==i||ta(n)!==a;return s&&(r=i,n=a),{width:r,height:n,$:s}}function fu(e){return or(e)?e:e.contextElement}function Xo(e){let t=fu(e);if(!vr(t))return Gr(1);let r=t.getBoundingClientRect(),{width:n,height:o,$:i}=eh(t),a=(i?ta(r.width):r.width)/n,s=(i?ta(r.height):r.height)/o;return (!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var uk=Gr(0);function th(e){let t=Ht(e);return !Ws()||!t.visualViewport?uk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dk(e,t,r){return t===void 0&&(t=false),!r||t&&r!==Ht(e)?false:t}function Wn(e,t,r,n){t===void 0&&(t=false),r===void 0&&(r=false);let o=e.getBoundingClientRect(),i=fu(e),a=Gr(1);t&&(n?or(n)&&(a=Xo(n)):a=Xo(e));let s=dk(i,r,n)?th(i):Gr(0),c=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,u=o.width/a.x,f=o.height/a.y;if(i){let d=Ht(i),p=n&&or(n)?Ht(n):n,h=d,g=Hs(h);for(;g&&n&&p!==h;){let v=Xo(g),b=g.getBoundingClientRect(),C=ir(g),_=b.left+(g.clientLeft+parseFloat(C.paddingLeft))*v.x,k=b.top+(g.clientTop+parseFloat(C.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=_,l+=k,h=Ht(g),g=Hs(h);}}return Fn({width:u,height:f,x:c,y:l})}function fk(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,i=o==="fixed",a=yr(n),s=t?na(t.floating):false;if(n===a||s&&i)return r;let c={scrollLeft:0,scrollTop:0},l=Gr(1),u=Gr(0),f=vr(n);if((f||!f&&!i)&&((Un(n)!=="body"||Ko(a))&&(c=oa(n)),vr(n))){let d=Wn(n);l=Xo(n),u.x=d.x+n.clientLeft,u.y=d.y+n.clientTop;}return {width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+u.x,y:r.y*l.y-c.scrollTop*l.y+u.y}}function pk(e){return Array.from(e.getClientRects())}function du(e,t){let r=oa(e).scrollLeft;return t?t.left+r:Wn(yr(e)).left+r}function mk(e){let t=yr(e),r=oa(e),n=e.ownerDocument.body,o=Rt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Rt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),a=-r.scrollLeft+du(e),s=-r.scrollTop;return ir(n).direction==="rtl"&&(a+=Rt(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:s}}function gk(e,t){let r=Ht(e),n=yr(e),o=r.visualViewport,i=n.clientWidth,a=n.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;let l=Ws();(!l||l&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop);}return {width:i,height:a,x:s,y:c}}function hk(e,t){let r=Wn(e,true,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=vr(e)?Xo(e):Gr(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,c=o*i.x,l=n*i.y;return {width:a,height:s,x:c,y:l}}function Qg(e,t,r){let n;if(t==="viewport")n=gk(e,r);else if(t==="document")n=mk(yr(e));else if(or(t))n=hk(t,r);else {let o=th(e);n={...t,x:t.x-o.x,y:t.y-o.y};}return Fn(n)}function rh(e,t){let r=Yr(e);return r===t||!or(r)||jn(r)?false:ir(r).position==="fixed"||rh(r,t)}function bk(e,t){let r=t.get(e);if(r)return r;let n=qo(e,[],false).filter(s=>or(s)&&Un(s)!=="body"),o=null,i=ir(e).position==="fixed",a=i?Yr(e):e;for(;or(a)&&!jn(a);){let s=ir(a),c=js(a);!c&&s.position==="fixed"&&(o=null),(i?!c&&!o:!c&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ko(a)&&!c&&rh(e,a))?n=n.filter(u=>u!==a):o=s,a=Yr(a);}return t.set(e,n),n}function yk(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,a=[...r==="clippingAncestors"?na(t)?[]:bk(t,this._c):[].concat(r),n],s=a[0],c=a.reduce((l,u)=>{let f=Qg(t,u,o);return l.top=Rt(f.top,l.top),l.right=Dr(f.right,l.right),l.bottom=Dr(f.bottom,l.bottom),l.left=Rt(f.left,l.left),l},Qg(t,s,o));return {width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function vk(e){let{width:t,height:r}=eh(e);return {width:t,height:r}}function xk(e,t,r){let n=vr(t),o=yr(t),i=r==="fixed",a=Wn(e,true,i,t),s={scrollLeft:0,scrollTop:0},c=Gr(0);if(n||!n&&!i)if((Un(t)!=="body"||Ko(o))&&(s=oa(t)),n){let p=Wn(t,true,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop;}else o&&(c.x=du(o));let l=0,u=0;if(o&&!n&&!i){let p=o.getBoundingClientRect();u=p.top+s.scrollTop,l=p.left+s.scrollLeft-du(o,p);}let f=a.left+s.scrollLeft-c.x-l,d=a.top+s.scrollTop-c.y-u;return {x:f,y:d,width:a.width,height:a.height}}function uu(e){return ir(e).position==="static"}function Jg(e,t){if(!vr(e)||ir(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return yr(e)===r&&(r=r.ownerDocument.body),r}function nh(e,t){let r=Ht(e);if(na(e))return r;if(!vr(e)){let o=Yr(e);for(;o&&!jn(o);){if(or(o)&&!uu(o))return o;o=Yr(o);}return r}let n=Jg(e,t);for(;n&&Kg(n)&&uu(n);)n=Jg(n,t);return n&&jn(n)&&uu(n)&&!js(n)?r:n||Xg(e)||r}var wk=async function(e){let t=this.getOffsetParent||nh,r=this.getDimensions,n=await r(e.floating);return {reference:xk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Tk(e){return ir(e).direction==="rtl"}var Ck={convertOffsetParentRelativeRectToViewportRelativeRect:fk,getDocumentElement:yr,getClippingRect:yk,getOffsetParent:nh,getElementRects:wk,getClientRects:pk,getDimensions:vk,getScale:Xo,isElement:or,isRTL:Tk};function _k(e,t){let r=null,n,o=yr(e);function i(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null;}function a(s,c){s===void 0&&(s=false),c===void 0&&(c=1),i();let{left:l,top:u,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;let p=ra(u),h=ra(o.clientWidth-(l+f)),g=ra(o.clientHeight-(u+d)),v=ra(l),C={rootMargin:-p+"px "+-h+"px "+-g+"px "+-v+"px",threshold:Rt(0,Dr(1,c))||1},_=true;function k(I){let B=I[0].intersectionRatio;if(B!==c){if(!_)return a();B?a(false,B):n=setTimeout(()=>{a(false,1e-7);},1e3);}_=false;}try{r=new IntersectionObserver(k,{...C,root:o.ownerDocument});}catch{r=new IntersectionObserver(k,C);}r.observe(e);}return a(true),i}function oh(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:c=false}=n,l=fu(e),u=o||i?[...l?qo(l):[],...qo(t)]:[];u.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:true}),i&&b.addEventListener("resize",r);});let f=l&&s?_k(l,r):null,d=-1,p=null;a&&(p=new ResizeObserver(b=>{let[C]=b;C&&C.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var _;(_=p)==null||_.observe(t);})),r();}),l&&!c&&p.observe(l),p.observe(t));let h,g=c?Wn(e):null;c&&v();function v(){let b=Wn(e);g&&(b.x!==g.x||b.y!==g.y||b.width!==g.width||b.height!==g.height)&&r(),g=b,h=requestAnimationFrame(v);}return r(),()=>{var b;u.forEach(C=>{o&&C.removeEventListener("scroll",r),i&&C.removeEventListener("resize",r);}),f?.(),(b=p)==null||b.disconnect(),p=null,c&&cancelAnimationFrame(h);}}var ih=Hg;var ah=Vg,sh=jg,lh=Gg,ch=Wg,uh=Ug;var dh=zg,fh=(e,t,r)=>{let n=new Map,o={platform:Ck,...r},i={...o.platform,_c:n};return Fg(e,t,{...o,platform:i})};function ph(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 Sk(e){if(!e)return ph();let{x:t,y:r,width:n,height:o}=e;return ph(t,r,n,o)}function kk(e,t){return {contextElement:xt(e)?e:void 0,getBoundingClientRect:()=>{let r=e,n=t?.(r);return n||!r?Sk(n):r.getBoundingClientRect()}}}var ia=e=>({variable:e,reference:`var(${e})`}),qr={arrowSize:ia("--arrow-size"),arrowSizeHalf:ia("--arrow-size-half"),arrowBg:ia("--arrow-background"),transformOrigin:ia("--transform-origin"),arrowOffset:ia("--arrow-offset")},Pk=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"}),Ek={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:r}){let{arrow:n}=r,o=Pk(n)[e],{floating:i}=t;return i.style.setProperty(qr.transformOrigin.variable,o),{data:{transformOrigin:o}}}},Ik={name:"rects",fn({rects:e}){return {data:e}}},Ak=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% + ${qr.arrowOffset.reference})`}),{}}}};function Ok(e){let[t,r]=e.split("-");return {side:t,align:r,hasAlign:r!=null}}function gh(e){return e.split("-")[0]}var Rk={strategy:"absolute",placement:"bottom",listeners:true,gutter:8,flip:true,slide:true,overlap:false,sameWidth:false,fitViewport:false,overflowPadding:8,arrowPadding:4};function mh(e,t){let r=e.devicePixelRatio||1;return Math.round(t*r)/r}function hh(e){return Vr(e.boundary)}function Dk(e,t){if(e)return uh({element:e,padding:t.arrowPadding})}function Mk(e,t){if(!Gm(t.offset??t.gutter))return ih(({placement:r})=>{let n=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+n:o??n,{hasAlign:a}=Ok(r),s=a?void 0:t.shift,c=t.offset?.crossAxis??s;return kt({crossAxis:c,mainAxis:i,alignmentAxis:t.shift})})}function Nk(e){if(e.flip)return sh({boundary:hh(e),padding:e.overflowPadding,fallbackPlacements:e.flip===true?void 0:e.flip})}function Lk(e){if(!(!e.slide&&!e.overlap))return ah({boundary:hh(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:dh()})}function $k(e){return lh({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 Bk(e){if(e.hideWhenDetached)return ch({strategy:"referenceHidden",boundary:e.boundary?.()??"clippingAncestors"})}function Fk(e){return e?e===true?{ancestorResize:true,ancestorScroll:true,elementResize:true,layoutShift:true}:e:{}}function Uk(e,t,r={}){let n=kk(e,r.getAnchorRect);if(!t||!n)return;let o=Object.assign({},Rk,r),i=t.querySelector("[data-part=arrow]"),a=[Mk(i,o),Nk(o),Lk(o),Dk(i,o),Ak(i),Ek,$k(o),Bk(o),Ik],{placement:s,strategy:c,onComplete:l,onPositioned:u}=o,f=async()=>{if(!n||!t)return;let g=await fh(n,t,{placement:s,middleware:a,strategy:c});l?.(g),u?.({placed:true});let v=Or(t),b=mh(v,g.x),C=mh(v,g.y);t.style.setProperty("--x",`${b}px`),t.style.setProperty("--y",`${C}px`),o.hideWhenDetached&&g.middlewareData.hide?.referenceHidden&&t.style.setProperty("visibility","hidden");let _=t.firstElementChild;if(_){let k=v.getComputedStyle(_).zIndex;t.style.setProperty("--z-index",k);}},d=async()=>{r.updatePosition?(await r.updatePosition({updatePosition:f}),u?.({placed:true})):await f();},p=Fk(o.listeners),h=o.listeners?oh(n,t,d,p):Es;return d(),()=>{h?.(),u?.({placed:false});}}function pu(e,t,r={}){let{defer:n,...o}=r,i=n?at:s=>s(),a=[];return a.push(i(()=>{let s=typeof e=="function"?e():e,c=typeof t=="function"?t():t;a.push(Uk(s,c,o));})),()=>{a.forEach(s=>s?.());}}var jk={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function bh(e={}){let{placement:t,sameWidth:r,fitViewport:n,strategy:o="absolute"}=e;return {arrow:{position:"absolute",width:qr.arrowSize.reference,height:qr.arrowSize.reference,[qr.arrowSizeHalf.variable]:`calc(${qr.arrowSize.reference} / 2)`,[qr.arrowOffset.variable]:`calc(${qr.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?jk[t.split("-")[0]]:void 0,background:qr.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 xr=(e,t,r,n)=>{let o=typeof e=="function"?e():e;return o?.addEventListener(t,r,n),()=>{o?.removeEventListener(t,r,n);}};function vh(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var Vs=e=>e.button===2||gg()&&e.ctrlKey&&e.button===0,xh=e=>e.ctrlKey||e.altKey||e.metaKey;function Wk(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 Hk(e){return e?.matches("a[href]")??false}function wh(e){if(!Hk(e))return;let t=()=>e.click();hg()?Wk(e,"keyup",t):queueMicrotask(t);}function mu(e,t,r){if(!e)return;let n=e.ownerDocument.defaultView||window,o=new n.CustomEvent(t,r);return e.dispatchEvent(o)}var Vk={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},yh={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function gu(e,t={}){let{dir:r="ltr",orientation:n="horizontal"}=t,{key:o}=e;return o=Vk[o]??o,r==="rtl"&&n==="horizontal"&&o in yh&&(o=yh[o]),o}function zk(e,t="client"){let r=e.touches[0]||e.changedTouches[0];return {x:r[`${t}X`],y:r[`${t}Y`]}}function Gk(e,t="client"){return {x:e[`${t}X`],y:e[`${t}Y`]}}var Yk=e=>"touches"in e&&e.touches.length>0;function zs(e,t="client"){return Yk(e)?zk(e,t):Gk(e,t)}function qk(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 Kk(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 Th="pointerdown.outside",Ch="focus.outside";function Xk(e){for(let t of e)if(xt(t)&&Ds(t))return true;return false}var Sh=e=>"clientY"in e;function Zk(e,t){if(!Sh(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||!Sh(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 Qk(e,t){let{exclude:r,onFocusOutside:n,onPointerDownOutside:o,onInteractOutside:i,defer:a}=t;if(!e)return;let s=gr(e),c=Or(e),l=qk(c),u=Kk(c);function f(b){let C=Rr(b);if(!xt(C)||nr(e,C)||Zk(e,b)||_h(b,C))return false;let _=lu(e);return _h(b,_)?false:!r?.(C)}let d=new Set;function p(b){function C(){let _=a?at:I=>I(),k=b.composedPath?.()??[b.target];_(()=>{if(!(!e||!f(b))){if(o||i){let I=Yi(o,i);e.addEventListener(Th,I,{once:true});}mu(e,Th,{bubbles:false,cancelable:true,detail:{originalEvent:b,contextmenu:Vs(b),focusable:Xk(k)}});}});}b.pointerType==="touch"?(d.forEach(_=>_()),d.add(xr(s,"click",C,{once:true})),d.add(u.addEventListener("click",C,{once:true})),d.add(l.addEventListener("click",C,{once:true}))):C();}let h=new Set,g=setTimeout(()=>{h.add(xr(s,"pointerdown",p,true)),h.add(u.addEventListener("pointerdown",p,true)),h.add(l.addEventListener("pointerdown",p,true));},0);function v(b){(a?at:_=>_())(()=>{if(!(!e||!f(b))){if(n||i){let _=Yi(n,i);e.addEventListener(Ch,_,{once:true});}mu(e,Ch,{bubbles:false,cancelable:true,detail:{originalEvent:b,contextmenu:false,focusable:Ds(Rr(b))}});}});}return h.add(xr(s,"focusin",v,true)),h.add(u.addEventListener("focusin",v,true)),h.add(l.addEventListener("focusin",v,true)),()=>{clearTimeout(g),d.forEach(b=>b()),h.forEach(b=>b());}}function kh(e,t){let{defer:r}=t,n=r?at:i=>i(),o=[];return o.push(n(()=>{let i=typeof e=="function"?e():e;o.push(Qk(i,t));})),()=>{o.forEach(i=>i?.());}}function Jk(e,t){let r=n=>{n.key==="Escape"&&(n.isComposing||t?.(n));};return xr(gr(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);}},Ph;function Eh(){Gt.layers.forEach(({node:e})=>{e.style.pointerEvents=Gt.isBelowPointerBlockingLayer(e)?"none":"auto";});}function eP(e){e.style.pointerEvents="";}function tP(e,t){let r=gr(e),n=[];if(Gt.hasPointerBlockingLayer()&&!r.body.hasAttribute("data-inert")&&(Ph=document.body.style.pointerEvents,queueMicrotask(()=>{r.body.style.pointerEvents="none",r.body.setAttribute("data-inert","");})),t){let o=Ag(t,i=>{n.push(Ig(i,{pointerEvents:"auto"}));});n.push(o);}return ()=>{Gt.hasPointerBlockingLayer()||(queueMicrotask(()=>{r.body.style.pointerEvents=Ph,r.body.removeAttribute("data-inert"),r.body.style.length===0&&r.body.removeAttribute("style");}),n.forEach(o=>o()));}}function rP(e,t){if(!e){zr("[@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),Eh();function s(d){let p=Rr(d.detail.originalEvent);Gt.isBelowPointerBlockingLayer(e)||Gt.isInBranch(p)||(t.onPointerDownOutside?.(d),t.onInteractOutside?.(d),!d.defaultPrevented&&r?.());}function c(d){let p=Rr(d.detail.originalEvent);Gt.isInBranch(p)||(t.onFocusOutside?.(d),t.onInteractOutside?.(d),!d.defaultPrevented&&r?.());}function l(d){Gt.isTopMost(e)&&(t.onEscapeKeyDown?.(d),!d.defaultPrevented&&r&&(d.preventDefault(),r()));}function u(d){if(!e)return false;let p=typeof o=="function"?o():o,h=Array.isArray(p)?p:[p],g=t.persistentElements?.map(v=>v()).filter(xt);return g&&h.push(...g),h.some(v=>nr(v,d))||Gt.isInNestedLayer(e,d)}let f=[n?tP(e,t.persistentElements):void 0,Jk(e,l),kh(e,{exclude:u,onFocusOutside:c,onPointerDownOutside:s,defer:t.defer})];return ()=>{Gt.remove(e),Eh(),eP(e),f.forEach(d=>d?.());}}function Gs(e,t){let{defer:r}=t,n=r?at:i=>i(),o=[];return o.push(n(()=>{let i=pn(e)?e():e;o.push(rP(i,t));})),()=>{o.forEach(i=>i?.());}}function Ih(e,t={}){let{defer:r}=t,n=r?at:i=>i(),o=[];return o.push(n(()=>{let i=pn(e)?e():e;if(!i){zr("[@zag-js/dismissable] branch node is `null` or `undefined`");return}Gt.addBranch(i),o.push(()=>{Gt.removeBranch(i);});})),()=>{o.forEach(i=>i?.());}}var Rh=hr("toast").parts("group","root","title","description","actionTrigger","closeTrigger"),Zo=Rh.build(),Pt=hn({getRegionId:e=>`toast-group:${e}`,getRegionEl:(e,t)=>Pt.getById(e,`toast-group:${t}`),getRootId:e=>`toast:${e.id}`,getRootEl:e=>Pt.getById(e,Pt.getRootId(e)),getTitleId:e=>`toast:${e.id}:title`,getDescriptionId:e=>`toast:${e.id}:description`,getCloseTriggerId:e=>`toast${e.id}:close`});function hu(e,t){return e.filter(r=>r.state.context.placement===t)}var Ah={info:5e3,error:5e3,success:2e3,loading:1/0,DEFAULT:5e3};function Oh(e,t){return e??Ah[t]??Ah.DEFAULT}function nP(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"),c={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:dg},l="center";if(a&&(l="flex-end"),s&&(l="flex-start"),c.alignItems=l,i.includes("top")){let u=n.top;c.top=`max(env(safe-area-inset-top, 0px), ${u})`;}if(i.includes("bottom")){let u=n.bottom;c.bottom=`max(env(safe-area-inset-bottom, 0px), ${u})`;}if(!i.includes("left")){let u=n.right;c.insetInlineEnd=`calc(env(safe-area-inset-right, 0px) + ${u})`;}if(!i.includes("right")){let u=n.left;c.insetInlineStart=`calc(env(safe-area-inset-left, 0px) + ${u})`;}return c}function oP(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 iP(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 aP(e,t){return {position:"absolute",left:"0",height:"calc(var(--gap) + 2px)",bottom:"100%",width:"100%"}}function sP(e,t,r){function n(){return rg(e)?e.getState():e}function o(u){return hu(n().context.toasts,u)}function i(u){let f=n().context.toasts;return f.length?!!f.find(d=>d.id==u):false}function a(u){let f=`toast:${qi()}`,d=u.id?u.id:f;return i(d)||t({type:"ADD_TOAST",toast:{...u,id:d}}),d}function s(u,f){return i(u)&&t({type:"UPDATE_TOAST",id:u,toast:f}),u}function c(u){let{id:f}=u;return (f?i(f):false)&&f!=null?s(f,u):a(u)}function l(u){u==null?t("DISMISS_ALL"):i(u)&&t({type:"DISMISS_TOAST",id:u});}return {getCount(){return n().context.count},getPlacements(){let f=n().context.toasts.map(d=>d.state.context.placement);return Array.from(new Set(f))},getToastsByPlacement:o,isVisible:i,create:a,update:s,upsert:c,dismiss:l,remove(u){u==null?t("REMOVE_ALL"):i(u)&&t({type:"REMOVE_TOAST",id:u});},dismissByPlacement(u){o(u).forEach(d=>l(d.id));},loading(u){return c({...u,type:"loading"})},success(u){return c({...u,type:"success"})},error(u){return c({...u,type:"error"})},promise(u,f,d={}){let p=c({...d,...f.loading,type:"loading"});return Vr(u).then(h=>{let g=Vr(f.success,h);c({...d,...g,id:p,type:"success"});}).catch(h=>{let g=Vr(f.error,h);c({...d,...g,id:p,type:"error"});}).finally(()=>{f.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:f,label:d="Notifications"}=u,p=n(),h=p.context.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),[g,v="center"]=f.split("-");return r.element({...Zo.group.attrs,dir:p.context.dir,tabIndex:-1,"aria-label":`${f} ${d} ${h}`,id:Pt.getRegionId(f),"data-placement":f,"data-side":g,"data-align":v,"aria-live":"polite",role:"region",style:nP(p.context,f),onMouseMove(){t({type:"REGION.POINTER_ENTER",placement:f});},onMouseLeave(){t({type:"REGION.POINTER_LEAVE",placement:f});},onFocus(b){t({type:"REGION.FOCUS",target:b.relatedTarget});},onBlur(b){p.context.isFocusWithin&&!nr(b.currentTarget,b.relatedTarget)&&t({type:"REGION.BLUR"});}})},subscribe(u){let f=n();return Wo(f.context.toasts,()=>{let p=o(f.context.placement).map(h=>h.getState().context);u(p);})}}}var{not:lP,and:cP,or:uP}=Is;function dP(e){let{type:t="info",duration:r,id:n="1",placement:o="bottom",removeDelay:i=200,...a}=e,s=kt(a),c=Oh(r,t);return mr({id:n,context:{id:n,type:t,remaining:c,duration:c,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:cP("hasTypeChanged","isChangingToLoading"),target:"visible:persist",actions:["setContext"]},{guard:uP("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:lP("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(l,u,{self:f}){let d;return at(()=>{let p=Pt.getRootEl(l);if(!p)return;l.mounted=true;let h=Ms(p,"[data-ghost]");zr(h.length!==2,"[toast] No ghost element found in toast. Render the `ghostBefore` and `ghostAfter` elements");let g=()=>{let C=p.style.height;p.style.height="auto";let _=p.getBoundingClientRect().height;p.style.height=C,l.height=_,f.sendParent({type:"UPDATE_HEIGHT",id:f.id,height:_,placement:l.placement});};g();let v=Pt.getWin(l),b=new v.MutationObserver(g);b.observe(p,{childList:true,subtree:true,characterData:true}),d=()=>b.disconnect();}),()=>d?.()}},guards:{isChangingToLoading:(l,u)=>u.toast?.type==="loading",isLoadingType:l=>l.type==="loading",hasTypeChanged:(l,u)=>u.toast?.type!=null&&u.toast.type!==l.type,hasDurationChanged:(l,u)=>u.toast?.duration!=null&&u.toast.duration!==l.duration},delays:{VISIBLE_DURATION:l=>l.remaining,REMOVE_DELAY:l=>l.removeDelay},actions:{measureHeight(l,u,{self:f}){at(()=>{let d=Pt.getRootEl(l);if(!d)return;l.mounted=true;let p=d.style.height;d.style.height="auto";let h=d.getBoundingClientRect().height;d.style.height=p,l.height=h,f.sendParent({type:"UPDATE_HEIGHT",id:f.id,height:h,placement:l.placement});});},setRemainingDuration(l){l.remaining-=Date.now()-l.createdAt;},setCreatedAt(l){l.createdAt=Date.now();},notifyParentToRemove(l,u,{self:f}){f.sendParent({type:"REMOVE_TOAST",id:f.id});},invokeOnDismiss(l){l.onStatusChange?.({status:"dismissing"});},invokeOnUnmount(l){l.onStatusChange?.({status:"unmounted"});},invokeOnVisible(l){l.onStatusChange?.({status:"visible"});},setContext(l,u){let f=u.toast?.duration,d=u.toast?.type??l.type,p=Oh(f,d);Object.assign(l,{...u.toast,duration:p,remaining:p});}}})}function fP(e){let t=kt(e);return mr({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 xr(document,"keydown",a=>{r.hotkey.every(c=>a[c]||a.code===c)&&o({type:"DOC.HOTKEY"});},{capture:true})},trackDocumentVisibility(r,n,{send:o}){if(!r.pauseOnPageIdle)return;let i=Pt.getDoc(r);return xr(i,"visibilitychange",()=>{o(i.visibilityState==="hidden"?"PAUSE_ALL":"RESUME_ALL");})}},actions:{setDismissableBranch(r){let o=hu(r.toasts,r.placement).length>0;if(!o){r._cleanup?.();return}if(o&&r._cleanup)return;let i=()=>Pt.getRegionEl(r,r.placement);r._cleanup=Ih(i,{defer:true});},clearDismissableBranch(r){r._cleanup?.();},focusRegionEl(r){queueMicrotask(()=>{Pt.getRegionEl(r,r.placement)?.focus();});},expandToasts(r){Ys(r,n=>{n.state.context.stacked=true;});},collapseToasts(r){Ys(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=dP(a),c=o.spawn(s);r.toasts=[c,...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){Ys(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;Ys({...r,placement:o},i=>{let a=Math.max(r.heights.findIndex(c=>c.id===i.id),0),s=r.heights.reduce((c,l,u)=>u>=a?c:c+l.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 Ys(e,t){hu(e.toasts,e.placement).forEach(t);}function Dh(e,t,r){let n=e.hasTag("visible"),o=e.hasTag("paused"),i=e.context.placement,a=e.context.type,[s,c="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({...Zo.root.attrs,dir:e.context.dir,id:Pt.getRootId(e.context),"data-state":n?"open":"closed","data-type":a,"data-placement":i,"data-align":c,"data-side":s,"data-mounted":Wt(e.context.mounted),"data-paused":Wt(o),"data-first":Wt(e.context.frontmost),"data-sibling":Wt(!e.context.frontmost),"data-stack":Wt(e.context.stacked),"data-overlap":Wt(!e.context.stacked),role:"status","aria-atomic":"true","aria-describedby":e.context.description?Pt.getDescriptionId(e.context):void 0,"aria-labelledby":e.context.title?Pt.getTitleId(e.context):void 0,tabIndex:0,style:oP(e.context,n),onKeyDown(l){l.defaultPrevented||l.key=="Escape"&&(t("DISMISS"),l.preventDefault());}})},getGhostBeforeProps(){return r.element({"data-ghost":"before",style:iP(e.context,n)})},getGhostAfterProps(){return r.element({"data-ghost":"after",style:aP()})},getTitleProps(){return r.element({...Zo.title.attrs,id:Pt.getTitleId(e.context)})},getDescriptionProps(){return r.element({...Zo.description.attrs,id:Pt.getDescriptionId(e.context)})},getActionTriggerProps(){return r.button({...Zo.actionTrigger.attrs,type:"button",onClick(l){l.defaultPrevented||(e.context.action?.onClick?.(),t("DISMISS"));}})},getCloseTriggerProps(){return r.button({id:Pt.getCloseTriggerId(e.context),...Zo.closeTrigger.attrs,type:"button","aria-label":"Dismiss notification",onClick(l){l.defaultPrevented||t("DISMISS");}})}}}var qs={connect:sP,machine:fP};var bu=e=>{let t=qs.machine({id:"1",...e});return {...qs.connect(t,t.send,rr),machine:t}},[mP,Hn]=it({hookName:"useToastContext",providerName:"<ToastProvider />"}),Mh=e=>{let t=Hn(),r=ce(()=>t().getActionTriggerProps(),e);return m(ve.button,r)},Nh=e=>{let t=Hn(),r=ce(()=>t().getCloseTriggerProps(),e);return m(ve.button,r)},Lh=e=>e.children(Hn()),$h=e=>{let t=Hn(),r=ce(()=>t().getDescriptionProps(),e);return m(ve.div,r)},gP=T("<div><div></div><div>"),Bh=e=>{let t=Hn(),r=ce(()=>t().getRootProps(),e);return (()=>{var n=gP(),o=n.firstChild,i=o.nextSibling;return Re(n,r,false,true),Re(o,Oe(()=>t().getGhostBeforeProps()),false,false),x(n,()=>e.children,i),Re(i,Oe(()=>t().getGhostAfterProps()),false,false),n})()},Fh=e=>{let t=Hn(),r=ce(()=>t().getTitleProps(),e);return m(ve.div,r)},yu=e=>{let[t,r]=tt(e,["toaster","children"]),[n,o]=Ar(t.toaster.machine),i=n.context.placement,a=j(()=>qs.connect(n,o,rr)),s=j(()=>a().getToastsByPlacement(i)),c=ce(a().getGroupProps({placement:i}),r);return m(ve.div,Oe(c,{get children(){return m(Se,{get each(){return s()},children:l=>m(hP,{value:l,children:u=>t.children(u)})})}}))},hP=e=>{let[t,r]=sg(e.value),n=j(()=>Dh(t,r,rr)),o=j(()=>t.context);return m(mP,{value:n,get children(){return e.children(o)}})},Vn={};bn(Vn,{ActionTrigger:()=>Mh,CloseTrigger:()=>Nh,Context:()=>Lh,Description:()=>$h,Root:()=>Bh,Title:()=>Fh});var aa=(e,t)=>({x:e,y:t});function bP(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:aa(i,a)}}function yP(e){let t=aa(e.minX,e.minY),r=aa(e.maxX,e.minY),n=aa(e.maxX,e.maxY),o=aa(e.minX,e.maxY);return {top:t,right:r,bottom:n,left:o}}function Uh(e,t){let r=bP(e),{top:n,right:o,left:i,bottom:a}=yP(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 jh(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,c=e[i].y,l=e[a].x,u=e[a].y;c>n!=u>n&&r<(l-s)*(n-c)/(u-c)+s&&(o=!o);}return o}var Hh=hr("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem"),Dt=Hh.build(),se=hn({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=>se.getById(e,se.getContentId(e)),getPositionerEl:e=>se.getById(e,se.getPositionerId(e)),getTriggerEl:e=>se.getById(e,se.getTriggerId(e)),getHighlightedItemEl:e=>e.highlightedValue?se.getById(e,e.highlightedValue):null,getArrowEl:e=>se.getById(e,se.getArrowId(e)),getElements:e=>{let r=`[role^="menuitem"][data-ownedby=${CSS.escape(se.getContentId(e))}]:not([data-disabled])`;return Ms(se.getContentEl(e),r)},getFirstEl:e=>jm(se.getElements(e)),getLastEl:e=>Wm(se.getElements(e)),getNextEl:(e,t)=>vg(se.getElements(e),e.highlightedValue,t??e.loopFocus),getPrevEl:(e,t)=>xg(se.getElements(e),e.highlightedValue,t??e.loopFocus),getElemByKey:(e,t)=>iu(se.getElements(e),{state:e.typeaheadState,key:t,activeId:e.highlightedValue}),isTargetDisabled:e=>xt(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 Vh(e,t,r){let n=e.context.isSubmenu,o=e.context.isTypingAhead,i=e.context.composite,a=e.hasTag("open"),s=bh({...e.context.positioning,placement:e.context.anchorPoint?"bottom":e.context.currentPlacement});function c(d){return {disabled:!!d.disabled,highlighted:e.context.highlightedValue===d.value}}function l(d){let p=d.valueText??d.value;return {...d,id:d.value,valueText:p}}function u(d){return {...c(l(d)),checked:!!d.checked}}function f(d){let{value:p,closeOnSelect:h,valueText:g}=d,v=c(d);return r.element({...Dt.item.attrs,id:p,role:"menuitem","aria-disabled":v.disabled,"data-disabled":Wt(v.disabled),"data-ownedby":se.getContentId(e.context),"data-highlighted":Wt(v.highlighted),"data-valuetext":g,onDragStart(b){b.currentTarget.matches("a[href]")&&b.preventDefault();},onPointerMove(b){if(v.disabled||b.pointerType!=="mouse")return;let C=b.currentTarget;v.highlighted||t({type:"ITEM_POINTERMOVE",id:p,target:C,closeOnSelect:h});},onPointerLeave(b){if(v.disabled||b.pointerType!=="mouse"||!e.previousEvent.type.includes("POINTER"))return;let _=b.currentTarget;t({type:"ITEM_POINTERLEAVE",id:p,target:_,closeOnSelect:h});},onPointerDown(b){if(v.disabled)return;let C=b.currentTarget;t({type:"ITEM_POINTERDOWN",target:C,id:p,closeOnSelect:h});},onClick(b){if(ru(b)||tu(b)||v.disabled)return;let C=b.currentTarget;t({type:"ITEM_CLICK",target:C,id:p,closeOnSelect:h});}})}return {highlightedValue:e.context.highlightedValue,open:a,setOpen(d){d!==a&&t(d?"OPEN":"CLOSE");},setHighlightedValue(d){t({type:"HIGHLIGHTED.SET",id:d});},setParent(d){t({type:"PARENT.SET",value:d,id:d.state.context.id});},setChild(d){t({type:"CHILD.SET",value:d,id:d.state.context.id});},reposition(d={}){t({type:"POSITIONING.SET",options:d});},getContextTriggerProps(){return r.element({...Dt.contextTrigger.attrs,dir:e.context.dir,id:se.getContextTriggerId(e.context),onPointerDown(d){if(d.pointerType==="mouse")return;let p=zs(d);t({type:"CONTEXT_MENU_START",point:p});},onPointerCancel(d){d.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL");},onPointerMove(d){d.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL");},onPointerUp(d){d.pointerType!=="mouse"&&t("CONTEXT_MENU_CANCEL");},onContextMenu(d){let p=zs(d);t({type:"CONTEXT_MENU",point:p}),d.preventDefault();},style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"}})},getTriggerItemProps(d){return As(f({value:d.getTriggerProps().id}),d.getTriggerProps())},getTriggerProps(){return r.button({...n?Dt.triggerItem.attrs:Dt.trigger.attrs,"data-placement":e.context.currentPlacement,type:"button",dir:e.context.dir,id:se.getTriggerId(e.context),"data-uid":e.context.id,"aria-haspopup":i?"menu":"dialog","aria-controls":se.getContentId(e.context),"aria-expanded":a||void 0,"data-state":a?"open":"closed",onPointerMove(d){d.pointerType!=="mouse"||se.isTargetDisabled(d.currentTarget)||!n||t({type:"TRIGGER_POINTERMOVE",target:d.currentTarget});},onPointerLeave(d){if(se.isTargetDisabled(d.currentTarget)||d.pointerType!=="mouse"||!n)return;let p=zs(d);t({type:"TRIGGER_POINTERLEAVE",target:d.currentTarget,point:p});},onPointerDown(d){se.isTargetDisabled(d.currentTarget)||Vs(d)||d.preventDefault();},onClick(d){d.defaultPrevented||se.isTargetDisabled(d.currentTarget)||t({type:"TRIGGER_CLICK",target:d.currentTarget});},onBlur(){t("TRIGGER_BLUR");},onFocus(){t("TRIGGER_FOCUS");},onKeyDown(d){if(d.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"});}},h=gu(d,e.context),g=p[h];g&&(d.preventDefault(),g(d));}})},getIndicatorProps(){return r.element({...Dt.indicator.attrs,dir:e.context.dir,"data-state":a?"open":"closed"})},getPositionerProps(){return r.element({...Dt.positioner.attrs,dir:e.context.dir,id:se.getPositionerId(e.context),style:s.floating})},getArrowProps(){return r.element({id:se.getArrowId(e.context),...Dt.arrow.attrs,dir:e.context.dir,style:s.arrow})},getArrowTipProps(){return r.element({...Dt.arrowTip.attrs,dir:e.context.dir,style:s.arrowTip})},getContentProps(){return r.element({...Dt.content.attrs,id:se.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":se.getTriggerId(e.context),"data-placement":e.context.currentPlacement,onPointerEnter(d){d.pointerType==="mouse"&&t("MENU_POINTERENTER");},onKeyDown(d){if(d.defaultPrevented||!yg(d))return;let p=Rr(d);if(!(p?.closest("[role=menu]")===d.currentTarget||p===d.currentTarget))return;if(d.key==="Tab"&&!_g(d)){d.preventDefault();return}let g=se.getHighlightedItemEl(e.context),v={ArrowDown(){t("ARROW_DOWN");},ArrowUp(){t("ARROW_UP");},ArrowLeft(){t("ARROW_LEFT");},ArrowRight(){t("ARROW_RIGHT");},Enter(){t("ENTER"),wh(g);},Space(_){o?t({type:"TYPEAHEAD",key:_.key}):v.Enter?.(_);},Home(){t("HOME");},End(){t("END");}},b=gu(d,{dir:e.context.dir}),C=v[b];if(C){C(d),d.stopPropagation(),d.preventDefault();return}e.context.typeahead&&vh(d)&&(xh(d)||su(p)||(t({type:"TYPEAHEAD",key:d.key}),d.preventDefault()));}})},getSeparatorProps(){return r.element({...Dt.separator.attrs,role:"separator",dir:e.context.dir,"aria-orientation":"horizontal"})},getItemState:c,getItemProps:f,getOptionItemState:u,getOptionItemProps(d){let{type:p,disabled:h,onCheckedChange:g,closeOnSelect:v}=d,b=l(d),C=u(d);return {...f(b),...r.element({"data-type":p,...Dt.item.attrs,dir:e.context.dir,"data-value":b.value,role:`menuitem${p}`,"aria-checked":!!C.checked,"data-state":C.checked?"checked":"unchecked",onClick(_){if(h||ru(_)||tu(_))return;let k=_.currentTarget;t({type:"ITEM_CLICK",target:k,option:b,closeOnSelect:v}),g?.(!C.checked);}})}},getItemIndicatorProps(d){let p=u(d);return r.element({...Dt.itemIndicator.attrs,dir:e.context.dir,"data-disabled":Wt(p.disabled),"data-highlighted":Wt(p.highlighted),"data-state":p.checked?"checked":"unchecked",hidden:!p.checked})},getItemTextProps(d){let p=u(d);return r.element({...Dt.itemText.attrs,dir:e.context.dir,"data-disabled":Wt(p.disabled),"data-highlighted":Wt(p.highlighted),"data-state":p.checked?"checked":"unchecked"})},getItemGroupLabelProps(d){return r.element({id:se.getGroupLabelId(e.context,d.htmlFor),dir:e.context.dir,...Dt.itemGroupLabel.attrs})},getItemGroupProps(d){return r.element({id:se.getGroupId(e.context,d.id),...Dt.itemGroup.attrs,dir:e.context.dir,"aria-labelledby":se.getGroupLabelId(e.context,d.id),role:"group"})}}}var{not:ar,and:Qo,or:vP}=Is;function zh(e){let t=kt(e);return mr({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:iu.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:vP("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:Qo(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:Qo("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:Qo(ar("suspendPointer"),ar("isTriggerItem")),actions:"clearHighlightedItem"},ITEM_CLICK:[{guard:Qo(ar("isTriggerItemHighlighted"),ar("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Qo(ar("isTriggerItemHighlighted"),ar("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Qo(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)=>se.isTriggerItem(n.target),isTriggerItemHighlighted:(r,n)=>!!(n.target??se.getHighlightedItemEl(r))?.hasAttribute("aria-controls"),isSubmenu:r=>r.isSubmenu,suspendPointer:r=>r.suspendPointer,isHighlightedItemEditable:r=>su(se.getHighlightedItemEl(r)),isWithinPolygon:(r,n)=>r.intentPolygon?jh(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=()=>se.getPositionerEl(r);return pu(se.getTriggerEl(r),n,{...r.positioning,defer:true,onComplete(o){r.currentPlacement=o.placement;}})},trackInteractOutside(r,n,{send:o}){return Gs(()=>se.getContentEl(r),{defer:true,exclude:[se.getTriggerEl(r)],onInteractOutside:r.onInteractOutside,onFocusOutside:r.onFocusOutside,onEscapeKeyDown(a){r.onEscapeKeyDown?.(a),r.isSubmenu&&a.preventDefault(),Wh(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=se.getDoc(r);return xr(s,"pointermove",c=>{let l={x:c.clientX,y:c.clientY};a(r,{point:l})||(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 c=se.getHighlightedItemEl(r),l=se.getContentEl(r);Eg(c,{rootEl:l,block:"nearest"});};return at(()=>i()),Pg(()=>se.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=()=>se.getPositionerEl(r),i=r.anchorPoint?()=>({width:0,height:0,...r.anchorPoint}):void 0;pu(se.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=se.getHighlightedItemEl(r);!o||o.dataset.disabled||queueMicrotask(()=>o.click());},setIntentPolygon(r,n){let o=se.getContentEl(r),i=r.currentPlacement;if(!o||!i)return;let a=o.getBoundingClientRect(),s=Uh(a,i);if(!s)return;let l=gh(i)==="right"?-5:5;r.intentPolygon=[{...n.point,x:n.point.x+l},...s];},clearIntentPolygon(r){r.intentPolygon=null;},resumePointer(r){r.parent&&(r.parent.state.context.suspendPointer=false);},setHighlightedItem(r,n){yn.highlighted(r,n.id);},clearHighlightedItem(r){yn.highlighted(r,null);},focusMenu(r){at(()=>{let n=se.getContentEl(r);Cg({root:n,enabled:!nr(n,se.getActiveElement(r)),filter(i){return !i.role?.startsWith("menuitem")}})?.focus({preventScroll:true});});},highlightFirstItem(r){(se.getContentEl(r)?queueMicrotask:at)(()=>{let o=se.getFirstEl(r);o&&yn.highlighted(r,o.id);});},highlightLastItem(r){(se.getContentEl(r)?queueMicrotask:at)(()=>{let o=se.getLastEl(r);o&&yn.highlighted(r,o.id);});},highlightNextItem(r,n){let o=se.getNextEl(r,n.loop);yn.highlighted(r,o?.id??null);},highlightPrevItem(r,n){let o=se.getPrevEl(r,n.loop);yn.highlighted(r,o?.id??null);},invokeOnSelect(r){r.highlightedValue&&r.onSelect?.({value:r.highlightedValue});},focusTrigger(r){r.isSubmenu||r.anchorPoint||!r.restoreFocus||queueMicrotask(()=>se.getTriggerEl(r)?.focus({preventScroll:true}));},highlightMatchedItem(r,n){let o=se.getElemByKey(r,n.key);o&&yn.highlighted(r,o.id);},setParentMenu(r,n){r.parent=zt(n.value);},setChildMenu(r,n){r.children[n.id]=zt(n.value);},closeRootMenu(r){Wh(r);},openSubmenu(r){let o=se.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&&(yn.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 Wh(e){let t=e.parent;for(;t&&t.state.context.isSubmenu;)t=t.state.context.parent;t?.send("CLOSE");}var yn={highlighted(e,t){Ps(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[Gh,ct]=it({hookName:"useMenuContext",providerName:"<MenuProvider />",strict:false}),Yh=e=>{let t=ct(),r=ce(()=>t().getArrowProps(),e);return m(ve.div,r)},qh=e=>{let t=ct(),r=ce(()=>t().getArrowTipProps(),e);return m(ve.div,r)},[vu,Kh]=it({hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[Xh,Zh]=it({hookName:"useMenuOptionItemPropsContext",providerName:"<MenuOptionItemPropsProvider />"}),Qh=e=>{let[t,r]=vt()(e,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),n=ce(t,{type:"checkbox"}),o=ct(),i=ce(()=>o().getOptionItemProps(n),r),a=j(()=>o().getItemState(n));return m(Xh,{value:n,get children(){return m(vu,{value:a,get children(){return m(ve.div,i)}})}})},Jh=e=>{let t=ct(),r=gn(),n=ce(()=>t().getContentProps(),()=>r().presenceProps,e);return m(F,{get when(){return !r().unmounted},get children(){return m(ve.div,n)}})},eb=e=>e.children(ct()),tb=e=>{let t=ct(),r=ce(()=>t().getContextTriggerProps(),e);return m(ve.button,r)},rb=e=>{let t=ct(),r=ce(()=>t().getIndicatorProps(),e);return m(ve.div,r)},nb=e=>{let[t,r]=vt()(e,["closeOnSelect","disabled","value","valueText"]),n=ct(),o=ce(()=>n().getItemProps(t),r),i=j(()=>n().getItemState(t));return m(vu,{value:i,get children(){return m(ve.div,o)}})},ob=e=>e.children(Kh()),[ib,ab]=it({hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),sb=e=>{let[t,r]=vt()(e,["id"]),n=ce({id:Sr()},t),o=ct(),i=ce(()=>o().getItemGroupProps(n),r);return m(ib,{value:n,get children(){return m(ve.div,i)}})},lb=e=>{let t=ct(),r=ab(),n=ce(t().getItemGroupLabelProps({htmlFor:r.id}),e);return m(ve.div,n)},cb=e=>{let t=ct(),r=Zh(),n=ce(()=>t().getItemIndicatorProps(r),e);return m(ve.div,n)},ub=e=>{let t=ct(),r=Zh(),n=ce(()=>t().getItemTextProps(r),e);return m(ve.div,n)},db=e=>{let t=ct(),r=gn(),n=ce(()=>t().getPositionerProps(),e);return m(F,{get when(){return !r().unmounted},get children(){return m(ve.div,n)}})},fb=e=>{let[t,r]=vt()(e,["closeOnSelect","disabled","value","valueText"]),n=ct(),o=ab(),i=ce(t,()=>({type:"radio",checked:o.value===t.value,onCheckedChange:()=>o.onValueChange?.({value:t.value})})),a=ce(()=>n().getOptionItemProps(i),r),s=j(()=>n().getOptionItemState(i));return m(Xh,{value:i,get children(){return m(vu,{value:s,get children(){return m(ve.div,a)}})}})},pb=e=>{let[t,r]=vt()(e,["id","onValueChange","value"]),n=ct(),o=ce({id:Sr()},t),i=ce(()=>n().getItemGroupProps(o),r);return m(ib,{value:o,get children(){return m(ve.div,i)}})},mb=e=>{let t=zo(),r=Ln(),n=Sr(),o=j(()=>({id:n,dir:t().dir,getRootNode:r().getRootNode,open:e.defaultOpen,"open.controlled":e.open!==void 0,...e})),[i,a,s]=Ar(zh(o()),{context:o});return {api:j(()=>Vh(i,a,rr)),machine:s}},[gb,hb]=it({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:false}),[bb,kP]=it({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:false}),yb=e=>{let[t,r]=Ho(e),[n,o]=vt()(r,["anchorPoint","aria-label","closeOnSelect","composite","defaultOpen","highlightedValue","id","ids","loopFocus","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),i=ct(),a=hb(),s=mb(n),c=Nn(ce(t,()=>({present:s.api().open})));return _e(()=>{a&&(i?.().setChild(s.machine),s.api().setParent(a));}),m(bb,{value:()=>i?.().getTriggerItemProps(s.api()),get children(){return m(gb,{get value(){return s.machine},get children(){return m(Gh,{get value(){return s.api},get children(){return m(Vo,{value:c,get children(){return o.children}})}})}})}})},vb=e=>{let t=ct(),r=hb(),[n,o]=Ho(e),i=Nn(ce(n,()=>({present:o.value.api().open})));return _e(()=>{r&&(t?.().setChild(o.value.machine),o.value.api().setParent(r));}),m(bb,{value:()=>t?.().getTriggerItemProps(o.value.api()),get children(){return m(gb,{get value(){return o.value.machine},get children(){return m(Gh,{get value(){return o.value.api},get children(){return m(Vo,{value:i,get children(){return o.children}})}})}})}})},xb=e=>{let t=ct(),r=ce(()=>t().getSeparatorProps(),e);return m(ve.hr,r)},wb=e=>{let t=ct(),r=gn(),n=ce(()=>t().getTriggerProps(),()=>({"aria-controls":r().unmounted&&null}),e);return m(ve.button,n)},Tb=e=>{let t=kP(),r=ce(()=>t?.(),e);return m(ve.div,r)},Kr={};bn(Kr,{Arrow:()=>Yh,ArrowTip:()=>qh,CheckboxItem:()=>Qh,Content:()=>Jh,Context:()=>eb,ContextTrigger:()=>tb,Indicator:()=>rb,Item:()=>nb,ItemContext:()=>ob,ItemGroup:()=>sb,ItemGroupLabel:()=>lb,ItemIndicator:()=>cb,ItemText:()=>ub,Positioner:()=>db,RadioItem:()=>fb,RadioItemGroup:()=>pb,Root:()=>yb,RootProvider:()=>vb,Separator:()=>xb,Trigger:()=>wb,TriggerItem:()=>Tb});var Cb=hr("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange"),Xr=Cb.build(),Ks=hn({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,c=e.context.translations,l=e.context.isIndeterminate,u=e.context.value,f=c.value({value:u,max:i,percent:n,min:a}),d=PP(u,i),p={role:"progressbar","aria-label":f,"data-max":i,"aria-valuemin":a,"aria-valuemax":i,"aria-valuenow":u??void 0,"data-orientation":s,"data-state":d},h=EP(e.context);return {value:u,valueAsString:f,min:a,max:i,percent:n,percentAsString:o,indeterminate:l,setValue(g){t({type:"VALUE.SET",value:g});},setToMax(){t({type:"VALUE.SET",value:i});},setToMin(){t({type:"VALUE.SET",value:a});},getRootProps(){return r.element({dir:e.context.dir,...Xr.root.attrs,id:Ks.getRootId(e.context),"data-max":i,"data-value":u??void 0,"data-state":d,"data-orientation":s,style:{"--percent":l?void 0:n}})},getLabelProps(){return r.element({dir:e.context.dir,id:Ks.getLabelId(e.context),...Xr.label.attrs,"data-orientation":s})},getValueTextProps(){return r.element({dir:e.context.dir,"aria-live":"polite",...Xr.valueText.attrs})},getTrackProps(){return r.element({dir:e.context.dir,id:Ks.getTrackId(e.context),...Xr.track.attrs,...p})},getRangeProps(){return r.element({dir:e.context.dir,...Xr.range.attrs,"data-orientation":s,"data-state":d,style:{[e.context.isHorizontal?"width":"height"]:l?void 0:`${n}%`}})},getCircleProps(){return r.element({dir:e.context.dir,id:Ks.getCircleId(e.context),...Xr.circle.attrs,...p,...h.root})},getCircleTrackProps(){return r.element({dir:e.context.dir,"data-orientation":s,...Xr.circleTrack.attrs,...h.track})},getCircleRangeProps(){return r.element({dir:e.context.dir,...Xr.circleRange.attrs,...h.range,"data-state":d})},getViewProps(g){return r.element({dir:e.context.dir,...Xr.view.attrs,"data-state":g.state,hidden:g.state!==d})}}}function PP(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function EP(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 IP(e,t){return e+(t-e)/2}function Sb(e){let t=kt(e);return mr({id:"progress",initial:"idle",context:{max:t.max??100,min:t.min??0,value:IP(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 Zi(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(!xu(r.max))throw new Error(`[progress] The max value passed \`${r.max}\` is not a valid number`);if(!AP(r.value,r.max))throw new Error(`[progress] The value passed \`${r.value}\` exceeds the max value \`${r.max}\``);if(!OP(r.value,r.min))throw new Error(`[progress] The value passed \`${r.value}\` exceeds the min value \`${r.min}\``)}}}})}function xu(e){return Zi(e)&&!isNaN(e)}function AP(e,t){return xu(e)&&e<=t}function OP(e,t){return xu(e)&&e>=t}tr()(["dir","getRootNode","id","ids","max","min","orientation","translations","value"]);var[kb,Lr]=it({hookName:"useProgressContext",providerName:"<ProgressProvider />"}),Pb=e=>{let t=Lr(),r=ce(()=>t().getCircleProps(),e);return m(ve.svg,r)},Eb=e=>{let t=Lr(),r=ce(()=>t().getCircleRangeProps(),e);return m(ve.circle,r)},Ib=e=>{let t=Lr(),r=ce(()=>t().getCircleTrackProps(),e);return m(ve.circle,r)},Ab=e=>e.children(Lr()),Ob=e=>{let t=Lr(),r=ce(()=>t().getLabelProps(),e);return m(ve.label,r)},Rb=e=>{let t=Lr(),r=ce(()=>t().getRangeProps(),e);return m(ve.div,r)},Db=e=>{let t=zo(),r=Ln(),n=Sr(),o=j(()=>({id:n,dir:t().dir,getRootNode:r().getRootNode,...e})),[i,a]=Ar(Sb(o()),{context:o});return j(()=>_b(i,a,rr))},Mb=e=>{let[t,r]=vt()(e,["id","ids","max","min","orientation","translations","value"]),n=Db(t),o=ce(()=>n().getRootProps(),r);return m(kb,{value:n,get children(){return m(ve.div,o)}})},Nb=e=>{let[{value:t},r]=vt()(e,["value"]),n=ce(()=>t().getRootProps(),r);return m(kb,{value:t,get children(){return m(ve.div,n)}})},Lb=e=>{let t=Lr(),r=ce(()=>t().getTrackProps(),e);return m(ve.div,r)},$b=e=>{let t=Lr(),r=ce(()=>t().getValueTextProps(),e);return m(ve.span,Oe(r,{get children(){return e.children||t().percentAsString}}))},Bb=e=>{let[t,r]=vt()(e,["state"]),n=Lr(),o=ce(()=>n().getViewProps(t),r);return m(ve.span,o)},zn={};bn(zn,{Circle:()=>Pb,CircleRange:()=>Eb,CircleTrack:()=>Ib,Context:()=>Ab,Label:()=>Ob,Range:()=>Rb,Root:()=>Mb,RootProvider:()=>Nb,Track:()=>Lb,ValueText:()=>$b,View:()=>Bb});var MP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Jo=new WeakMap,Xs=new WeakMap,Zs={},wu=0,Fb=function(e){return e&&(e.host||Fb(e.parentNode))},NP=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Fb(r);return n&&e.contains(n)?n:null}).filter(function(r){return !!r})},LP=function(e,t,r,n){var o=NP(t,Array.isArray(e)?e:[e]);Zs[r]||(Zs[r]=new WeakMap);var i=Zs[r],a=[],s=new Set,c=new Set(o),l=function(f){!f||s.has(f)||(s.add(f),l(f.parentNode));};o.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(s.has(d))u(d);else try{var p=d.getAttribute(n),h=p!==null&&p!=="false",g=(Jo.get(d)||0)+1,v=(i.get(d)||0)+1;Jo.set(d,g),i.set(d,v),a.push(d),g===1&&h&&Xs.set(d,!0),v===1&&d.setAttribute(r,"true"),h||d.setAttribute(n,"true");}catch{}});};return u(t),s.clear(),wu++,function(){a.forEach(function(f){var d=Jo.get(f)-1,p=i.get(f)-1;Jo.set(f,d),i.set(f,p),d||(Xs.has(f)||f.removeAttribute(n),Xs.delete(f)),p||f.removeAttribute(r);}),wu--,wu||(Jo=new WeakMap,Jo=new WeakMap,Xs=new WeakMap,Zs={});}},Ub=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=MP(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live]"))),LP(n,o,r,"aria-hidden")):function(){return null}};var $P=e=>{let t=requestAnimationFrame(()=>e());return ()=>cancelAnimationFrame(t)};function jb(e,t={}){let{defer:r=true}=t,n=r?$P:i=>i(),o=[];return o.push(n(()=>{let a=(typeof e=="function"?e():e).filter(Boolean);o.push(Ub(a));})),()=>{o.forEach(i=>i?.());}}var Tu="data-scroll-lock";function Wb(e,t){if(!e)return;let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r;}}function BP(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 FP(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function Hb(e){let t=e??document,r=t.defaultView??window,{documentElement:n,body:o}=t;if(o.hasAttribute(Tu))return;o.setAttribute(Tu,"");let a=r.innerWidth-n.clientWidth,s=()=>BP(n,"--scrollbar-width",`${a}px`),c=FP(n),l=()=>Wb(o,{overflow:"hidden",[c]:`${a}px`}),u=()=>{let{scrollX:d,scrollY:p,visualViewport:h}=r,g=h?.offsetLeft??0,v=h?.offsetTop??0,b=Wb(o,{position:"fixed",overflow:"hidden",top:`${-(p-Math.floor(v))}px`,left:`${-(d-Math.floor(g))}px`,right:"0",[c]:`${a}px`});return ()=>{b?.(),r.scrollTo({left:d,top:p,behavior:"instant"});}},f=[s(),bg()?u():l()];return ()=>{f.forEach(d=>d?.()),o.removeAttribute(Tu);}}var zb=["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])"],Qs=zb.join(","),Gb=typeof Element>"u",Gn=Gb?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Js=!Gb&&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},el=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},UP=function(t){var r,n=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return n===""||n==="true"},Yb=function(t,r,n){if(el(t))return [];var o=Array.prototype.slice.apply(t.querySelectorAll(Qs));return r&&Gn.call(t,Qs)&&o.unshift(t),o=o.filter(n),o},qb=function e(t,r,n){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!el(a,false))if(a.tagName==="SLOT"){var s=a.assignedElements(),c=s.length?s:a.children,l=e(c,true,n);n.flatten?o.push.apply(o,l):o.push({scopeParent:a,candidates:l});}else {var u=Gn.call(a,Qs);u&&n.filter(a)&&(r||!t.includes(a))&&o.push(a);var f=a.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(a),d=!el(f,false)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(f&&d){var p=e(f===true?a.children:f.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},Kb=function(t){return !isNaN(parseInt(t.getAttribute("tabindex"),10))},vn=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||UP(t))&&!Kb(t)?0:t.tabIndex},jP=function(t,r){var n=vn(t);return n<0&&r&&!Kb(t)?0:n},WP=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},Xb=function(t){return t.tagName==="INPUT"},HP=function(t){return Xb(t)&&t.type==="hidden"},VP=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return r},zP=function(t,r){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===r)return t[n]},GP=function(t){if(!t.name)return true;var r=t.form||Js(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=zP(o,t.form);return !i||i===t},YP=function(t){return Xb(t)&&t.type==="radio"},qP=function(t){return YP(t)&&!GP(t)},KP=function(t){var r,n=t&&Js(t),o=(r=n)===null||r===void 0?void 0:r.host,i=false;if(n&&n!==t){var a,s,c;for(i=!!((a=o)!==null&&a!==void 0&&(s=a.ownerDocument)!==null&&s!==void 0&&s.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!i&&o;){var l,u,f;n=Js(o),o=(l=n)===null||l===void 0?void 0:l.host,i=!!((u=o)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(o));}}return i},Vb=function(t){var r=t.getBoundingClientRect(),n=r.width,o=r.height;return n===0&&o===0},XP=function(t,r){var n=r.displayCheck,o=r.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return true;var i=Gn.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(Gn.call(a,"details:not([open]) *"))return true;if(!n||n==="full"||n==="legacy-full"){if(typeof o=="function"){for(var s=t;t;){var c=t.parentElement,l=Js(t);if(c&&!c.shadowRoot&&o(c)===true)return Vb(t);t.assignedSlot?t=t.assignedSlot:!c&&l!==t.ownerDocument?t=l.host:t=c;}t=s;}if(KP(t))return !t.getClientRects().length;if(n!=="legacy-full")return true}else if(n==="non-zero-area")return Vb(t);return false},ZP=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 Gn.call(r,"fieldset[disabled] *")?true:!o.contains(t)}return true}r=r.parentElement;}return false},tl=function(t,r){return !(r.disabled||el(r)||HP(r)||XP(r,t)||VP(r)||ZP(r))},Cu=function(t,r){return !(qP(r)||vn(r)<0||!tl(t,r))},QP=function(t){var r=parseInt(t.getAttribute("tabindex"),10);return !!(isNaN(r)||r>=0)},JP=function e(t){var r=[],n=[];return t.forEach(function(o,i){var a=!!o.scopeParent,s=a?o.scopeParent:o,c=jP(s,a),l=a?e(o.candidates):s;c===0?a?r.push.apply(r,l):r.push(s):n.push({documentOrder:i,tabIndex:c,item:o,isScope:a,content:l});}),n.sort(WP).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(r)},Zb=function(t,r){r=r||{};var n;return r.getShadowRoot?n=qb([t],r.includeContainer,{filter:Cu.bind(null,r),flatten:false,getShadowRoot:r.getShadowRoot,shadowRootFilter:QP}):n=Yb(t,r.includeContainer,Cu.bind(null,r)),JP(n)},Qb=function(t,r){r=r||{};var n;return r.getShadowRoot?n=qb([t],r.includeContainer,{filter:tl.bind(null,r),flatten:true,getShadowRoot:r.getShadowRoot}):n=Yb(t,r.includeContainer,tl.bind(null,r)),n},Yn=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return Gn.call(t,Qs)===false?false:Cu(r,t)},eE=zb.concat("iframe").join(","),rl=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return Gn.call(t,eE)===false?false:tl(r,t)};function tE(e,t,r){return (t=nE(t))in e?Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true}):e[t]=r,e}function Jb(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 ey(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jb(Object(r),true).forEach(function(n){tE(e,n,r[n]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));});}return e}function rE(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 nE(e){var t=rE(e,"string");return typeof t=="symbol"?t:t+""}var ty={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();}},oE=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},iE=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},la=function(t){return t?.key==="Tab"||t?.keyCode===9},aE=function(t){return la(t)&&!t.shiftKey},sE=function(t){return la(t)&&t.shiftKey},ry=function(t){return setTimeout(t,0)},ny=function(t,r){var n=-1;return t.every(function(o,i){return r(o)?(n=i,false):true}),n},sa=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},nl=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},lE=[],oy=function(t,r){var n=r?.document||document,o=r?.trapStack||lE,i=ey({returnFocusOnDeactivate:true,escapeDeactivates:true,delayInitialFocus:true,isKeyForward:aE,isKeyBackward:sE},r),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:false,paused:false,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s,c=function(P,w,A){return P&&P[w]!==void 0?P[w]:i[A||w]},l=function(P,w){var A=typeof w?.composedPath=="function"?w.composedPath():void 0;return a.containerGroups.findIndex(function(M){var X=M.container,me=M.tabbableNodes;return X.contains(P)||A?.includes(X)||me.find(function(ee){return ee===P})})},u=function(P){var w=i[P];if(typeof w=="function"){for(var A=arguments.length,M=new Array(A>1?A-1:0),X=1;X<A;X++)M[X-1]=arguments[X];w=w.apply(void 0,M);}if(w===true&&(w=void 0),!w){if(w===void 0||w===false)return w;throw new Error("`".concat(P,"` was specified but was not a node, or did not return a node"))}var me=w;if(typeof w=="string"&&(me=n.querySelector(w),!me))throw new Error("`".concat(P,"` as selector refers to no known node"));return me},f=function(){var P=u("initialFocus");if(P===false)return false;if(P===void 0||!rl(P,i.tabbableOptions))if(l(n.activeElement)>=0)P=n.activeElement;else {var w=a.tabbableGroups[0],A=w&&w.firstTabbableNode;P=A||u("fallbackFocus");}if(!P)throw new Error("Your focus-trap needs to have at least one focusable element");return P},d=function(){if(a.containerGroups=a.containers.map(function(P){var w=Zb(P,i.tabbableOptions),A=Qb(P,i.tabbableOptions),M=w.length>0?w[0]:void 0,X=w.length>0?w[w.length-1]:void 0,me=A.find(function(Ae){return Yn(Ae)}),ee=A.slice().reverse().find(function(Ae){return Yn(Ae)}),Ue=!!w.find(function(Ae){return vn(Ae)>0});return {container:P,tabbableNodes:w,focusableNodes:A,posTabIndexesFound:Ue,firstTabbableNode:M,lastTabbableNode:X,firstDomTabbableNode:me,lastDomTabbableNode:ee,nextTabbableNode:function(ut){var Nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:true,dt=w.indexOf(ut);return dt<0?Nt?A.slice(A.indexOf(ut)+1).find(function(Lt){return Yn(Lt)}):A.slice(0,A.indexOf(ut)).reverse().find(function(Lt){return Yn(Lt)}):w[dt+(Nt?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(P){return P.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(P){return P.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(P){var w=P.activeElement;if(w)return w.shadowRoot&&w.shadowRoot.activeElement!==null?p(w.shadowRoot):w},h=function(P){if(P!==false&&P!==p(document)){if(!P||!P.focus){h(f());return}P.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=P,oE(P)&&P.select();}},g=function(P){var w=u("setReturnFocus",P);return w||(w===false?false:P)},v=function(P){var w=P.target,A=P.event,M=P.isBackward,X=M===void 0?false:M;w=w||nl(A),d();var me=null;if(a.tabbableGroups.length>0){var ee=l(w,A),Ue=ee>=0?a.containerGroups[ee]:void 0;if(ee<0)X?me=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:me=a.tabbableGroups[0].firstTabbableNode;else if(X){var Ae=ny(a.tabbableGroups,function($t){var Ye=$t.firstTabbableNode;return w===Ye});if(Ae<0&&(Ue.container===w||rl(w,i.tabbableOptions)&&!Yn(w,i.tabbableOptions)&&!Ue.nextTabbableNode(w,false))&&(Ae=ee),Ae>=0){var ut=Ae===0?a.tabbableGroups.length-1:Ae-1,Nt=a.tabbableGroups[ut];me=vn(w)>=0?Nt.lastTabbableNode:Nt.lastDomTabbableNode;}else la(A)||(me=Ue.nextTabbableNode(w,false));}else {var dt=ny(a.tabbableGroups,function($t){var Ye=$t.lastTabbableNode;return w===Ye});if(dt<0&&(Ue.container===w||rl(w,i.tabbableOptions)&&!Yn(w,i.tabbableOptions)&&!Ue.nextTabbableNode(w))&&(dt=ee),dt>=0){var Lt=dt===a.tabbableGroups.length-1?0:dt+1,Kt=a.tabbableGroups[Lt];me=vn(w)>=0?Kt.firstTabbableNode:Kt.firstDomTabbableNode;}else la(A)||(me=Ue.nextTabbableNode(w));}}else me=u("fallbackFocus");return me},b=function(P){var w=nl(P);if(!(l(w,P)>=0)){if(sa(i.clickOutsideDeactivates,P)){s.deactivate({returnFocus:i.returnFocusOnDeactivate});return}sa(i.allowOutsideClick,P)||P.preventDefault();}},C=function(P){var w=nl(P),A=l(w,P)>=0;if(A||w instanceof Document)A&&(a.mostRecentlyFocusedNode=w);else {P.stopImmediatePropagation();var M,X=true;if(a.mostRecentlyFocusedNode)if(vn(a.mostRecentlyFocusedNode)>0){var me=l(a.mostRecentlyFocusedNode),ee=a.containerGroups[me].tabbableNodes;if(ee.length>0){var Ue=ee.findIndex(function(Ae){return Ae===a.mostRecentlyFocusedNode});Ue>=0&&(i.isKeyForward(a.recentNavEvent)?Ue+1<ee.length&&(M=ee[Ue+1],X=false):Ue-1>=0&&(M=ee[Ue-1],X=false));}}else a.containerGroups.some(function(Ae){return Ae.tabbableNodes.some(function(ut){return vn(ut)>0})})||(X=false);else X=false;X&&(M=v({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),h(M||a.mostRecentlyFocusedNode||f());}a.recentNavEvent=void 0;},_=function(P){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:false;a.recentNavEvent=P;var A=v({event:P,isBackward:w});A&&(la(P)&&P.preventDefault(),h(A));},k=function(P){(i.isKeyForward(P)||i.isKeyBackward(P))&&_(P,i.isKeyBackward(P));},I=function(P){iE(P)&&sa(i.escapeDeactivates,P)!==false&&(P.preventDefault(),s.deactivate());},B=function(P){var w=nl(P);l(w,P)>=0||sa(i.clickOutsideDeactivates,P)||sa(i.allowOutsideClick,P)||(P.preventDefault(),P.stopImmediatePropagation());},D=function(){if(a.active)return ty.activateTrap(o,s),a.delayInitialFocusTimer=i.delayInitialFocus?ry(function(){h(f());}):h(f()),n.addEventListener("focusin",C,true),n.addEventListener("mousedown",b,{capture:true,passive:false}),n.addEventListener("touchstart",b,{capture:true,passive:false}),n.addEventListener("click",B,{capture:true,passive:false}),n.addEventListener("keydown",k,{capture:true,passive:false}),n.addEventListener("keydown",I),s},oe=function(){if(a.active)return n.removeEventListener("focusin",C,true),n.removeEventListener("mousedown",b,true),n.removeEventListener("touchstart",b,true),n.removeEventListener("click",B,true),n.removeEventListener("keydown",k,true),n.removeEventListener("keydown",I),s},H=function(P){var w=P.some(function(A){var M=Array.from(A.removedNodes);return M.some(function(X){return X===a.mostRecentlyFocusedNode})});w&&h(f());},V=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(H):void 0,L=function(){V&&(V.disconnect(),a.active&&!a.paused&&a.containers.map(function(P){V.observe(P,{subtree:true,childList:true});}));};return s={get active(){return a.active},get paused(){return a.paused},activate:function(P){if(a.active)return this;var w=c(P,"onActivate"),A=c(P,"onPostActivate"),M=c(P,"checkCanFocusTrap");M||d(),a.active=true,a.paused=false,a.nodeFocusedBeforeActivation=n.activeElement,w?.();var X=function(){M&&d(),D(),L(),A?.();};return M?(M(a.containers.concat()).then(X,X),this):(X(),this)},deactivate:function(P){if(!a.active)return this;var w=ey({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},P);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,oe(),a.active=false,a.paused=false,L(),ty.deactivateTrap(o,s);var A=c(w,"onDeactivate"),M=c(w,"onPostDeactivate"),X=c(w,"checkCanReturnFocus"),me=c(w,"returnFocus","returnFocusOnDeactivate");A?.();var ee=function(){ry(function(){me&&h(g(a.nodeFocusedBeforeActivation)),M?.();});};return me&&X?(X(g(a.nodeFocusedBeforeActivation)).then(ee,ee),this):(ee(),this)},pause:function(P){if(a.paused||!a.active)return this;var w=c(P,"onPause"),A=c(P,"onPostPause");return a.paused=true,w?.(),oe(),L(),A?.(),this},unpause:function(P){if(!a.paused||!a.active)return this;var w=c(P,"onUnpause"),A=c(P,"onPostUnpause");return a.paused=false,w?.(),d(),D(),L(),A?.(),this},updateContainerElements:function(P){var w=[].concat(P).filter(Boolean);return a.containers=w.map(function(A){return typeof A=="string"?n.querySelector(A):A}),a.active&&d(),L(),this}},s.updateContainerElements(t),s};var iy=hr("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),qn=iy.build(),Pe=hn({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=>Pe.getById(e,Pe.getContentId(e)),getPositionerEl:e=>Pe.getById(e,Pe.getPositionerId(e)),getBackdropEl:e=>Pe.getById(e,Pe.getBackdropId(e)),getTriggerEl:e=>Pe.getById(e,Pe.getTriggerId(e)),getTitleEl:e=>Pe.getById(e,Pe.getTitleId(e)),getDescriptionEl:e=>Pe.getById(e,Pe.getDescriptionId(e)),getCloseTriggerEl:e=>Pe.getById(e,Pe.getCloseTriggerId(e))});function ay(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({...qn.trigger.attrs,dir:e.context.dir,id:Pe.getTriggerId(e.context),"aria-haspopup":"dialog",type:"button","aria-expanded":o,"data-state":o?"open":"closed","aria-controls":Pe.getContentId(e.context),onClick(a){a.defaultPrevented||t("TOGGLE");}})},getBackdropProps(){return r.element({...qn.backdrop.attrs,dir:e.context.dir,hidden:!o,id:Pe.getBackdropId(e.context),"data-state":o?"open":"closed"})},getPositionerProps(){return r.element({...qn.positioner.attrs,dir:e.context.dir,id:Pe.getPositionerId(e.context),style:{pointerEvents:o?void 0:"none"}})},getContentProps(){return r.element({...qn.content.attrs,dir:e.context.dir,role:e.context.role,hidden:!o,id:Pe.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:Pe.getTitleId(e.context),"aria-describedby":i.description?Pe.getDescriptionId(e.context):void 0})},getTitleProps(){return r.element({...qn.title.attrs,dir:e.context.dir,id:Pe.getTitleId(e.context)})},getDescriptionProps(){return r.element({...qn.description.attrs,dir:e.context.dir,id:Pe.getDescriptionId(e.context)})},getCloseTriggerProps(){return r.button({...qn.closeTrigger.attrs,dir:e.context.dir,id:Pe.getCloseTriggerId(e.context),type:"button",onClick(a){a.defaultPrevented||(a.stopPropagation(),t("CLOSE"));}})}}}function sy(e){let t=kt(e);return mr({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 Gs(()=>Pe.getContentEl(r),{defer:true,pointerBlocking:r.modal,exclude:[Pe.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 Hb(Pe.getDoc(r))},trapFocus(r){if(!r.trapFocus||!r.modal)return;let n,o=kg(()=>{let i=Pe.getContentEl(r);if(i){n=oy(i,{document:Pe.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?jb(()=>[Pe.getContentEl(r)],{defer:true}):void 0}},actions:{setAlertDialogProps(r){r.role==="alertdialog"&&(r.initialFocusEl||(r.initialFocusEl=()=>Pe.getCloseTriggerEl(r)),r.closeOnInteractOutside=false);},checkRenderedElements(r){at(()=>{r.renderedElements.title=!!Pe.getTitleEl(r),r.renderedElements.description=!!Pe.getDescriptionEl(r);});},syncZIndex(r){at(()=>{let n=Pe.getContentEl(r);if(!n)return;let i=Pe.getWin(r).getComputedStyle(n);[Pe.getPositionerEl(r),Pe.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[ly,Zr]=it({hookName:"useDialogContext",providerName:"<DialogProvider />"}),cy=e=>{let t=Zr(),r=Nm(),n=Nn(ce(r,()=>({present:t().open}))),o=ce(()=>t().getBackdropProps(),()=>n().presenceProps,e);return m(F,{get when(){return !n().unmounted},get children(){return m(ve.div,o)}})},uy=e=>{let t=Zr(),r=ce(()=>t().getCloseTriggerProps(),e);return m(ve.button,r)},dy=e=>{let t=Zr(),r=gn(),n=ce(()=>t().getContentProps(),()=>r().presenceProps,e);return m(F,{get when(){return !r().unmounted},get children(){return m(ve.div,n)}})},fy=e=>e.children(Zr()),py=e=>{let t=Zr(),r=ce(()=>t().getDescriptionProps(),e);return m(ve.div,r)},my=e=>{let t=Zr(),r=gn(),n=ce(()=>t().getPositionerProps(),e);return m(F,{get when(){return !r().unmounted},get children(){return m(ve.div,n)}})},gy=e=>{let t=zo(),r=Ln(),n=Sr(),o=j(()=>({id:n,dir:t().dir,getRootNode:r().getRootNode,open:e.defaultOpen,"open.controlled":e.open!==void 0,...e})),[i,a]=Ar(sy(o()),{context:o});return j(()=>ay(i,a,rr))},hy=e=>{let[t,r]=Ho(e),[n]=Vi(t),[o,i]=vt()(r,["aria-label","closeOnEscape","closeOnInteractOutside","defaultOpen","finalFocusEl","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),a=gy(o),s=Nn(ce(t,()=>({present:a().open})));return m(ly,{value:a,get children(){return m(Hc,{value:n,get children(){return m(Vo,{value:s,get children(){return i.children}})}})}})},by=e=>{let[t,r]=Ho(e),[n]=Vi(t),o=Nn(ce(t,()=>({present:r.value().open})));return m(ly,{get value(){return r.value},get children(){return m(Hc,{value:n,get children(){return m(Vo,{value:o,get children(){return r.children}})}})}})},yy=e=>{let t=Zr(),r=ce(()=>t().getTitleProps(),e);return m(ve.h2,r)},vy=e=>{let t=Zr(),r=gn(),n=ce(()=>t().getTriggerProps(),()=>({"aria-controls":r().unmounted&&null}),e);return m(ve.button,n)},xn={};bn(xn,{Backdrop:()=>cy,CloseTrigger:()=>uy,Content:()=>dy,Context:()=>fy,Description:()=>py,Positioner:()=>my,Root:()=>hy,RootProvider:()=>by,Title:()=>yy,Trigger:()=>vy});var wn=bu({placement:"bottom-end",gap:24});var xy="#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 wy=async({apiHost:e,message:t,sessionId:r})=>{try{return {data:await un.post(`${Le(e)?e:Ut()}/api/v1/sessions/${r}/continueChat`,{headers:{"x-original-referrer":document.referrer},json:{message:t},timeout:!1}).json()}}catch(n){return {error:n}}};var _u=async({apiHost:e,sessionId:t,clientLogs:r})=>{try{await un.post(`${Le(e)?e:Ut()}/api/v1/sessions/${t}/clientLogs`,{json:{clientLogs:r}});}catch{}};var ol=e=>typeof e=="string"?e:e instanceof Error?e.name+": "+e.message:JSON.stringify(e);var Ty=Object.getPrototypeOf(async()=>{}).constructor,il=async({content:e,args:t})=>{try{let n=await Ty(...t.map(o=>o.id),fE(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:ol(r)}]}}},fE=e=>e.replace(/<script>/g,"").replace(/<\/script>/g,""),ca=async({args:e,content:t})=>{try{let n=await Ty(...Object.keys(e),t)(...Object.keys(e).map(o=>e[o]));if(n&&typeof n=="string")return {scriptCallbackMessage:n}}catch{}};var ei="Chatwoot Web Widget Opened";var Cy=e=>(il(e.scriptToExecute),{scriptCallbackMessage:ei});var _y=e=>fe(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
11
|
function gtag(){dataLayer.push(arguments);}
|
|
12
12
|
gtag('js', new Date());
|
|
13
13
|
|
|
@@ -53,7 +53,7 @@ class VolumeProcessor extends AudioWorkletProcessor {
|
|
|
53
53
|
registerProcessor("volume-processor", VolumeProcessor);
|
|
54
54
|
|
|
55
55
|
`;var IA=T('<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">'),oo=3,io=3,AA=60,OA=10,RA=5,DA=90,mw=e=>{let[t,r]=O(0),n,o,i,a,s,c,l,u=[],f,d,p=0,h=pt(e.buttonsTheme?.backgroundColor??$i).join(", "),g=()=>{if(!i||!n||!d)return;let C=performance.now(),_=C-d;d=C,i.clearRect(0,0,n.width,n.height),i.fillStyle=`rgba(${h}, 0.2)`;for(let k=0;k<(n.width+io)/(oo+io);k++){let I=k*(oo+io)-p,B=n.height*(OA/100),D=(n.height-B)/2;i.beginPath(),i.roundRect(I,D,oo,B,5),i.fill();}i.fillStyle=`rgba(${h}, 1)`;for(let k=0;k<u.length;k++){let I=n.width+(k+1)*(oo+io)-p,B=n.height*((u[k]??0)/100),D=(n.height-B)/2;i.beginPath(),i.roundRect(I,D,oo,B,5),i.fill();}p+=AA*(_/1e3),o=requestAnimationFrame(g);},v=async()=>{n&&(l=await navigator.mediaDevices.getUserMedia({audio:true}),e.onRecordingConfirmed(l),i||(i=n.getContext("2d")??void 0),f=setInterval(()=>{r(C=>C+=1);},1e3),a=new AudioContext,s=await MA(a),c=a.createMediaStreamSource(l),c.connect(s),s.connect(a.destination),s.port.onmessage=C=>{((n.width+io)/(oo+io)+u.length)*(oo+io)<n.width+p&&u.push(Math.min(Math.max(C.data,RA),DA));},d=performance.now(),o=requestAnimationFrame(g));},b=()=>{i&&n&&i.clearRect(0,0,n.width,n.height),p=0,s?.disconnect(),s=void 0,c?.disconnect(),c=void 0,a?.close(),a=void 0,l?.getTracks().forEach(C=>C.stop()),l=void 0,u=[],clearTimeout(f),r(0),cancelAnimationFrame(o),e.onAbortRecording();};return _e(()=>{e.recordingStatus==="asking"?v():e.recordingStatus==="stopped"&&b();}),he(()=>{b();}),(()=>{var C=IA(),_=C.firstChild,k=_.nextSibling,I=k.firstChild,B=k.nextSibling;rt(_,"click",b),x(_,m($r,{class:"w-4"}));var D=n;return typeof D=="function"?ye(D,I):n=I,x(B,()=>NA(t())),R(()=>U(C,xe("w-full gap-2 items-center transition-opacity px-2 agent-recorder",e.recordingStatus==="started"?"opacity-1 flex":"opacity-0 hidden"))),C})()},MA=async e=>{let t=new Blob([pw],{type:"application/javascript"}),r=URL.createObjectURL(t);return await e.audioWorklet.addModule(r),new AudioWorkletNode(e,"volume-processor")},NA=e=>{let t=Math.floor(e/60),n=(e%60).toString().padStart(2,"0");return `${t}:${n}`};var LA=T('<div class="p-2 flex gap-2 border-gray-100 overflow-auto">'),$A=T("<div>"),BA=T("<div><div>"),hw=e=>{let[t,r]=O(e.defaultValue??""),[n,o]=O([]),[i,a]=O(void 0),[s,c]=O(false),[l,u]=O("stopped"),f,d,p=[],h=E=>r(E),g=()=>f?.value!==""&&f?.reportValidity(),v=async()=>{if(l()==="started"&&d){d.stop();return}if(g()){let E;n().length>0&&(a(void 0),E=(await li({apiHost:e.context.apiHost??Ut({ignoreChatApiUrl:true}),files:n().map(w=>({file:w,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:w.name}})),onUploadProgress:a}))?.map((w,A)=>w?{...w,blobUrl:URL.createObjectURL(n()[A])}:null).filter(fe)),e.onSubmit({type:"text",value:f?.value??t(),label:e.block.options?.labels?.button,isPassword:e.block.options?.isPassword,attachments:E});}else f?.focus();},b=E=>{e.block.options?.isLong||E.key==="Enter"&&v();},C=E=>{e.block.options?.isLong&&E.key==="Enter"&&(E.metaKey||E.ctrlKey)&&v();};de(()=>{!re()&&f&&f.focus({preventScroll:true}),window.addEventListener("message",_);}),he(()=>{window.removeEventListener("message",_);});let _=E=>{let{data:P}=E;P.isFromAgent&&P.command==="setInputValue"&&r(P.value);},k=E=>{E.preventDefault(),c(true);},I=()=>c(false),B=E=>{E.preventDefault(),E.stopPropagation(),E.dataTransfer?.files&&D(E.dataTransfer.files);},D=E=>{let P=Array.from(E).map(w=>yl({existingFiles:n(),newFile:w,params:{sizeLimit:kr("NEXT_PUBLIC_AGENT_FILE_UPLOAD_MAX_SIZE")},onError:({description:A,title:M})=>{wn.create({description:A,title:M});}})).filter(fe);P.length!==0&&o(w=>[...P,...w]);},oe=E=>{o(P=>P.filter((w,A)=>A!==E));},H=()=>{u("asking");},V=E=>{let P,w=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"video/mp4";d=new MediaRecorder(E,{mimeType:w}),d.ondataavailable=A=>{A.data.size!==0&&p.push(A.data);},d.onstart=()=>{P=Date.now();},d.onstop=async()=>{if(l()!=="started"||p.length===0)return;let A=Date.now()-P,M=await(0, gw.fixWebmDuration)(new Blob(p,{type:w}),A),X=new File([M],`rec-${e.block.id}-${Date.now()}.${w==="audio/webm"?"webm":"mp4"}`,{type:w});a(void 0);let me=(await li({apiHost:e.context.apiHost??Ut({ignoreChatApiUrl:true}),files:[{file:X,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:X.name}}],onUploadProgress:a})).filter(fe).map(ee=>ee.url);e.onSubmit({type:"recording",url:me[0],blobUrl:URL.createObjectURL(X)});},d.start(),u("started");},L=()=>{d?.stop(),u("stopped"),d=void 0,p=[];};return (()=>{var E=BA(),P=E.firstChild;return E.addEventListener("dragleave",I),E.addEventListener("dragover",k),E.addEventListener("drop",B),E.$$keydown=b,x(P,m(mw,{get recordingStatus(){return l()},get buttonsTheme(){return e.context.agent.theme.chat?.buttons},onRecordingConfirmed:V,onAbortRecording:L}),null),x(P,m(F,{get when(){return l()!=="started"},get children(){return [m(F,{get when(){return n().length},get children(){var w=LA();return w.style.setProperty("border-bottom-width","1px"),x(w,m(Se,{get each(){return n()},children:(A,M)=>m(wl,{file:A,get uploadProgressPercent(){return j(()=>!!i())()?j(()=>i()?.fileIndex===M())()?20:M()<(i()?.fileIndex??0)?100:0:void 0},onRemoveClick:()=>oe(M())})})),w}}),(()=>{var w=$A();return x(w,(()=>{var A=j(()=>!!e.block.options?.isLong);return ()=>A()?m(Ax,{ref(M){var X=f;typeof X=="function"?X(M):f=M;},onInput:h,onKeyDown:C,get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??Hl.labels.placeholder}}):m(Cn,{ref(M){var X=f;typeof X=="function"?X(M):f=M;},onInput:h,get value(){return t()},get type(){return e.block.options?.isPassword?"password":"text"},get placeholder(){return e.block.options?.labels?.placeholder??Hl.labels.placeholder}})})(),null),x(w,m(F,{get when(){return (e.block.options?.attachments?.isEnabled??Hl.attachments.isEnabled)&&e.block.options?.attachments?.saveVariableId},get children(){return m(Ex,{onNewFiles:D,get class(){return xe(e.block.options?.isLong?"ml-2":void 0)}})}}),null),R(()=>U(w,xe("flex justify-between px-2",e.block.options?.isLong?"items-end":"items-center"))),w})()]}}),null),x(E,m(We,{get children(){return [m(te,{get when(){return !t()&&l()!=="started"&&e.block.options?.audioClip?.isEnabled},get children(){return m(wr,{class:"h-[56px] flex items-center","on:click":H,"aria-label":"Record voice",get children(){return m(Ix,{class:"flex w-6 h-6"})}})}}),m(te,{when:true,get children(){return m(nt,{type:"button","on:click":v,get isDisabled(){return !!i()},class:"h-[56px]",get children(){return e.block.options?.labels?.button}})}})]}}),null),R(w=>{var A=xe("agent-input-form flex w-full gap-2 items-end",e.block.options?.isLong&&l()!=="started"?"max-w-full":"max-w-[350px]"),M=xe("relative agent-input flex-col w-full",s()&&"filter brightness-95");return A!==w.e&&U(E,w.e=A),M!==w.t&&U(P,w.t=M),w},{e:void 0,t:void 0}),E})()};Xe(["keydown"]);var bw={labels:{placeholder:"Type a URL..."}};var FA=T('<div class="agent-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex agent-input w-full">'),yw=e=>{let[t,r]=O(e.defaultValue??""),n,o=l=>{r(l);},i=()=>n?.value!==""&&n?.reportValidity(),a=()=>{n&&!n?.value.startsWith("http")&&(n.value=`https://${n.value}`),i()?e.onSubmit({type:"text",value:n?.value??t()}):n?.focus();},s=l=>{l.key==="Enter"&&a();};de(()=>{!re()&&n&&n.focus({preventScroll:true}),window.addEventListener("message",c);}),he(()=>{window.removeEventListener("message",c);});let c=l=>{let{data:u}=l;u.isFromAgent&&u.command==="setInputValue"&&r(u.value);};return (()=>{var l=FA(),u=l.firstChild;return l.$$keydown=s,x(u,m(Cn,{ref(f){var d=n;typeof d=="function"?d(f):n=f;},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??bw.labels.placeholder},onInput:o,type:"url",autocomplete:"url"})),x(l,m(nt,{type:"button",class:"h-[56px]","on:click":a,get children(){return e.block.options?.labels?.button}}),null),l})()};Xe(["keydown"]);var vw=e=>m(xn.Root,{get open(){return e.isOpen},lazyMount:true,unmountOnExit:true,onOpenChange:t=>t.open?void 0:e.onClose?.(),get children(){return [m(xn.Backdrop,{class:"fixed inset-0 bg-[rgba(0,0,0,0.5)] h-screen z-50"}),m(xn.Positioner,{class:"fixed inset-0 z-50 flex items-center justify-center px-2",get children(){return [m(xn.Content,{get children(){return e.children}}),m(xn.CloseTrigger,{class:"fixed top-2 right-2 z-50 rounded-md bg-white p-2 text-black",get children(){return m($r,{class:"w-6 h-6"})}})]}})]}});var UA=T('<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>'),xw=({strokeColor:e})=>(()=>{var t=UA();return e!=null?t.style.setProperty("color",e):t.style.removeProperty("color"),R(()=>z(t,"class",re()?"size-6":"size-10")),t})();var jA=T('<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>'),ww=({strokeColor:e})=>(()=>{var t=jA();return e!=null?t.style.setProperty("color",e):t.style.removeProperty("color"),R(()=>z(t,"class",re()?"size-6":"size-10")),t})();var WA=T('<span class="text-4xl text-[40px]">'),HA=T('<img alt="Bot avatar"elementtiming="Bot avatar">'),VA=T('<figure><img alt="Bot avatar"class="rounded-full object-cover w-full h-full"elementtiming="Bot avatar"fetchpriority=high>'),zA=T('<div class="absolute left-[-4px] top-1/2 -translate-y-1/2 w-0 h-0">'),GA=T('<div class="absolute right-[-4px] top-1/2 -translate-y-1/2 w-0 h-0">'),YA=T("<div>"),Vl=e=>m(F,{get when(){return Le(e.src)},keyed:true,get fallback(){return (()=>{var t=YA();return x(t,m(F,{get when(){return e.isGuest},get children(){return [m(ww,{get strokeColor(){return e.theme.chat?.hostBubbles?.color??Bi}}),(()=>{var r=zA();return r.style.setProperty("border-top","5px solid transparent"),r.style.setProperty("border-bottom","5px solid transparent"),R(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(F,{get when(){return !e.isGuest},get children(){return [m(xw,{get strokeColor(){return e.theme.chat?.hostBubbles?.color??Bi}}),(()=>{var r=GA();return r.style.setProperty("border-top","5px solid transparent"),r.style.setProperty("border-bottom","5px solid transparent"),R(n=>(n=`5px solid ${e.theme.chat?.hostBubbles?.backgroundColor??$o}`)!=null?r.style.setProperty("border-left",n):r.style.removeProperty("border-left")),r})()]}}),null),R(r=>{var n=`relative flex justify-center items-center rounded-full ${re()?"w-6 h-6":"w-10 h-10"}
|
|
56
|
-
`,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(We,{get children(){return [m(te,{get when(){return qA(e.src??"")},get children(){var t=WA();return x(t,()=>e.src),t}}),m(te,{get when(){return fr(e.src)},get children(){var t=HA();return R(r=>{var n=e.src,o="flex justify-center items-center relative animate-fade-in flex-shrink-0 "+(re()?"w-6 h-6 text-sm":"w-10 h-10 text-xl");return n!==r.e&&z(t,"src",r.e=n),o!==r.t&&U(t,r.t=o),r},{e:void 0,t:void 0}),t}}),m(te,{when:true,get children(){var t=VA(),r=t.firstChild;return R(n=>{var o="flex justify-center items-center rounded-full text-white relative animate-fade-in flex-shrink-0 "+(re()?"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&&z(r,"src",n.t=i),n},{e:void 0,t:void 0}),t}})]}})}}),qA=e=>/^\p{Emoji}$/u.test(e);var KA=T('<div class="flex justify-end items-end animate-fade-in gap-2 guest-container">'),Tw=T("<div>"),XA=T('<span class="px-[15px] py-[7px]">'),ZA=T("<img alt=Attachment>"),QA=T('<div class="flex flex-col gap-1 items-end"><div class="p-[1px] whitespace-pre-wrap max-w-full agent-guest-bubble flex flex-col"data-testid=guest-bubble>'),JA=T("<img>"),eO=T('<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>'),Cw=e=>(()=>{var t=KA();return x(t,m(We,{get children(){return [m(te,{get when(){return e.answer?.type==="text"},get children(){return m(tO,{get answer(){return e.answer}})}}),m(te,{get when(){return e.answer?.type==="recording"},get children(){return m(rO,{get answer(){return e.answer}})}})]}}),null),x(t,m(F,{get when(){return e.showAvatar},get children(){return m(Vl,{isGuest:true,get theme(){return e.theme},get src(){return e.avatarSrc}})}}),null),R(r=>(r=e.hasHostAvatar?re()?"28px":"50px":void 0)!=null?t.style.setProperty("margin-left",r):t.style.removeProperty("margin-left")),t})(),tO=e=>{let[t,r]=O();return (()=>{var n=QA(),o=n.firstChild;return x(n,m(F,{get when(){return (e.answer.attachments??[]).length>0},get children(){return [(()=>{var i=Tw();return x(i,m(Se,{get each(){return e.answer.attachments?.filter(a=>a.type.startsWith("image"))},children:(a,s)=>(()=>{var c=JA();return c.$$click=()=>r(a.blobUrl??a.url),R(l=>{var u=a.blobUrl??a.url,f=`Attached image ${s()+1}`,d=xe("agent-guest-bubble-image-attachment cursor-pointer",e.answer.attachments.filter(p=>p.type.startsWith("image")).length>1&&"max-w-[90%]");return u!==l.e&&z(c,"src",l.e=u),f!==l.t&&z(c,"alt",l.t=f),d!==l.a&&U(c,l.a=d),l},{e:void 0,t:void 0,a:void 0}),c})()})),R(()=>U(i,xe("flex gap-1 overflow-auto max-w-[350px]",re()?"flex-wrap justify-end":"items-center"))),i})(),(()=>{var i=Tw();return x(i,m(Se,{get each(){return e.answer.attachments?.filter(a=>!a.type.startsWith("image"))},children:a=>m(xl,{get file(){return {name:a.url.split("/").at(-1)}}})})),R(()=>U(i,xe("flex gap-1 overflow-auto max-w-[350px]",re()?"flex-wrap justify-end":"items-center"))),i})()]}}),o),x(o,m(F,{get when(){return Le(e.answer.label??e.answer.value)},get children(){var i=XA();return x(i,()=>(e.answer.isPassword?"*".repeat(e.answer.value.length):e.answer.value)??e.answer.label),i}})),x(n,m(vw,{get isOpen(){return t()!==void 0},onClose:()=>r(void 0),get children(){var i=ZA();return i.style.setProperty("border-radius","6px"),R(()=>z(i,"src",t())),i}}),null),n})()},rO=e=>(()=>{var t=eO(),r=t.firstChild,n=r.firstChild;return R(()=>z(n,"src",e.answer.blobUrl??e.answer.url)),t})();Xe(["click"]);var nO=T("<div>"),oO=T('<div class="flex justify-end animate-fade-in gap-2 agent-input-container">'),_w=e=>{let[t,r]=Er(O(),{key:`agent-${e.context.agent.id}-input-${e.chunkIndex}`,storage:e.context.storage});de(()=>{e.isOngoingLastChunk&&fe(t())&&e.onSubmit(t());});let n=async i=>{r(i),e.onSubmit(i);},o=i=>{r({type:"text",value:i}),e.onSkip();};return _e(()=>{let i=sl().findLast(a=>e.chunkIndex===a.inputIndex)?.formattedMessage;i&&e.block.type!=="file input"&&r(a=>a?.type==="text"?{...a,label:i}:a);}),m(We,{get children(){return [m(te,{get when(){return t()&&!e.hasError},get children(){return m(Cw,{get theme(){return e.theme},get answer(){return t()},get showAvatar(){return e.guestAvatar?.isEnabled??Fi},get avatarSrc(){return e.guestAvatar?.url&&e.guestAvatar.url},get hasHostAvatar(){return e.hasHostAvatar}})}}),m(te,{get when(){return lt(t())||e.hasError},get children(){var i=oO(),a=e.ref;return typeof a=="function"?ye(a,i):e.ref=i,x(i,m(F,{get when(){return e.hasHostAvatar},get children(){var s=nO();return R(()=>U(s,"flex flex-shrink-0 items-center "+(re()?"w-6 h-6":"w-10 h-10"))),s}}),null),x(i,m(aO,{get context(){return e.context},get block(){return e.block},get chunkIndex(){return e.chunkIndex},get isInputPrefillEnabled(){return e.isInputPrefillEnabled},get existingAnswer(){return j(()=>!!e.hasError)()?iO(t()):void 0},get onTransitionEnd(){return e.onTransitionEnd},onSubmit:n,onSkip:o}),null),R(()=>z(i,"data-blockid",e.block.id)),i}})]}})},iO=e=>{if(e)return e.type==="text"?e.value:e.url},aO=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??Sl.labels.success});return m(We,{get children(){return [m(te,{get when(){return e.block.type==="text input"},get children(){return m(hw,{get block(){return e.block},get defaultValue(){return r()},get context(){return e.context},onSubmit:t})}}),m(te,{get when(){return e.block.type==="number input"},get children(){return m(lx,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(te,{get when(){return e.block.type==="email input"},get children(){return m(nx,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(te,{get when(){return e.block.type==="url input"},get children(){return m(yw,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(te,{get when(){return e.block.type==="phone number input"},get children(){return m(xx,{get labels(){return e.block.options?.labels},get defaultCountryCode(){return e.block.options?.defaultCountryCode},get defaultValue(){return r()},onSubmit:t})}}),m(te,{get when(){return e.block.type==="date input"},get children(){return m(tx,{get options(){return e.block.options},get defaultValue(){return r()},onSubmit:t})}}),m(te,{get when(){return sO(e.block)},keyed:true,children:o=>m(We,{get children(){return [m(te,{get when(){return !o.options?.isMultipleChoice},get children(){return m(Xy,{get chunkIndex(){return e.chunkIndex},get defaultItems(){return o.items},get options(){return o.options},onSubmit:t})}}),m(te,{get when(){return o.options?.isMultipleChoice},get children(){return m(Jy,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t})}})]}})}),m(te,{get when(){return lO(e.block)},keyed:true,children:o=>m(We,{get children(){return [m(te,{get when(){return !o.options?.isMultipleChoice},get children(){return m(Sx,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t,get onTransitionEnd(){return e.onTransitionEnd}})}}),m(te,{get when(){return o.options?.isMultipleChoice},get children(){return m(_x,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t,get onTransitionEnd(){return e.onTransitionEnd}})}})]}})}),m(te,{get when(){return e.block.type==="rating input"},get children(){return m(kx,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(te,{get when(){return e.block.type==="file input"},get children(){return m(ix,{get context(){return e.context},get block(){return e.block},onSubmit:t,get onSkip(){return e.onSkip}})}}),m(te,{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}})}})]}})},sO=e=>e?.type==="choice input"?e:void 0,lO=e=>e?.type==="image choice"?e:void 0;var cO=T('<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=()=>cO();var Sw={isAutoplayEnabled:true};var uO=T('<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>'),dO=400,fO=100,gd,kw=e=>{let t=false,r,n,[o,i]=O(!!e.onTransitionEnd);return de(()=>{gd=setTimeout(()=>{t||(t=true,i(false),setTimeout(()=>e.onTransitionEnd?.(r),dO));},fO);}),he(()=>{gd&&clearTimeout(gd);}),(()=>{var a=uO(),s=a.firstChild,c=s.firstChild,l=c.firstChild,u=l.nextSibling,f=r;typeof f=="function"?ye(f,a):r=a,x(l,(()=>{var p=j(()=>!!o());return ()=>p()&&m(Vt,{})})());var d=n;return typeof d=="function"?ye(d,u):n=u,R(p=>{var h=xe("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),g=o()?"64px":"100%",v=o()?"32px":"100%",b=e.content?.url,C=e.onTransitionEnd?e.content?.isAutoplayEnabled??Sw.isAutoplayEnabled:false,_="z-10 text-fade-in "+(o()?"opacity-0":"opacity-100 m-2"),k=o()?re()?"32px":"36px":"revert";return h!==p.e&&U(a,p.e=h),g!==p.t&&((p.t=g)!=null?l.style.setProperty("width",g):l.style.removeProperty("width")),v!==p.a&&((p.a=v)!=null?l.style.setProperty("height",v):l.style.removeProperty("height")),b!==p.o&&z(u,"src",p.o=b),C!==p.i&&(u.autoplay=p.i=C),_!==p.n&&U(u,p.n=_),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 pO=T('<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">'),hd,mO=400,Pw=e=>{let t,[r,n]=O(!!e.onTransitionEnd),o;return de(()=>{ca({args:{...e.content.initFunction.args,agentElement:o},content:e.content.initFunction.content}),e.content.waitForEventFunction&&ca({args:{...e.content.waitForEventFunction.args,continueFlow:i=>e.onCompleted(i?{type:"text",value:i}:void 0)},content:e.content.waitForEventFunction.content}),hd=setTimeout(()=>{n(false),setTimeout(()=>e.onTransitionEnd?.(t),mO);},2e3);}),he(()=>{hd&&clearTimeout(hd);}),(()=>{var i=pO(),a=i.firstChild,s=a.firstChild,c=s.firstChild,l=c.nextSibling,u=l.firstChild,f=t;typeof f=="function"?ye(f,i):t=i,x(c,(()=>{var p=j(()=>!!r());return ()=>p()&&m(Vt,{})})());var d=o;return typeof d=="function"?ye(d,u):o=u,R(p=>{var h=xe("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),g=r()?"64px":"100%",v=r()?"32px":"100%",b=xe("p-2 z-20 text-fade-in w-full",r()?"opacity-0":"opacity-100"),C=r()?re()?"32px":"36px":void 0,_=`calc(${om()} - 100px)`;return h!==p.e&&U(i,p.e=h),g!==p.t&&((p.t=g)!=null?c.style.setProperty("width",g):c.style.removeProperty("width")),v!==p.a&&((p.a=v)!=null?c.style.setProperty("height",v):c.style.removeProperty("height")),b!==p.o&&U(l,p.o=b),C!==p.i&&((p.i=C)!=null?l.style.setProperty("height",C):l.style.removeProperty("height")),_!==p.n&&((p.n=_)!=null?u.style.setProperty("max-height",_):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 Ew={height:400};var gO=T('<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 ">'),bd,hO=400,Iw=e=>{let t,[r,n]=O(!!e.onTransitionEnd),o=i=>{e.content?.waitForEvent?.isEnabled&&Le(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 de(()=>{bd=setTimeout(()=>{n(false),e.content?.waitForEvent?.isEnabled&&window.addEventListener("message",o),setTimeout(()=>{e.onTransitionEnd?.(t);},hO);},2e3);}),he(()=>{bd&&clearTimeout(bd),window.removeEventListener("message",o);}),(()=>{var i=gO(),a=i.firstChild,s=a.firstChild,c=s.firstChild,l=c.nextSibling,u=l.firstChild,f=t;return typeof f=="function"?ye(f,i):t=i,x(c,(()=>{var d=j(()=>!!r());return ()=>d()&&m(Vt,{})})()),R(d=>{var p=xe("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),h=r()?"64px":"100%",g=r()?"32px":"100%",v=xe("p-4 z-20 text-fade-in w-full",r()?"opacity-0":"opacity-100 p-4"),b=r()?re()?"32px":"36px":`${e.content?.height??Ew.height}px`,C=e.content?.url;return p!==d.e&&U(i,d.e=p),h!==d.t&&((d.t=h)!=null?c.style.setProperty("width",h):c.style.removeProperty("width")),g!==d.a&&((d.a=g)!=null?c.style.setProperty("height",g):c.style.removeProperty("height")),v!==d.o&&U(l,d.o=v),b!==d.i&&((d.i=b)!=null?l.style.setProperty("height",b):l.style.removeProperty("height")),C!==d.n&&z(u,"src",d.n=C),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()};var Aw={clickLink:{alt:"Bubble image"}};var bO=T('<img elementtiming="Bubble image"fetchpriority=high>'),yO=T('<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 ">'),vO=T("<a target=_blank rel=noreferrer>"),xO=T("<figure>"),wO=400,TO=5e3,zl,Ow=e=>{let t,r,[n,o]=O(!!e.onTransitionEnd),i=()=>{n()&&(o(false),setTimeout(()=>{e.onTransitionEnd?.(t);},wO));};de(()=>{r&&(zl=setTimeout(i,TO),r.onload=()=>{clearTimeout(zl),i();});}),he(()=>{zl&&clearTimeout(zl);});let a=(()=>{var s=bO(),c=r;return typeof c=="function"?ye(c,s):r=s,s.style.setProperty("max-height","512px"),R(l=>{var u=e.content?.url,f=e.content?.clickLink?.alt??Aw.clickLink.alt,d=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!==l.e&&z(s,"src",l.e=u),f!==l.t&&z(s,"alt",l.t=f),d!==l.a&&U(s,l.a=d),p!==l.o&&((l.o=p)!=null?s.style.setProperty("height",p):s.style.removeProperty("height")),l},{e:void 0,t:void 0,a:void 0,o:void 0}),s})();return (()=>{var s=yO(),c=s.firstChild,l=c.firstChild,u=l.firstChild,f=t;return typeof f=="function"?ye(f,s):t=s,x(u,(()=>{var d=j(()=>!!n());return ()=>d()?m(Vt,{}):null})()),x(l,(()=>{var d=j(()=>!!e.content?.clickLink);return ()=>d()?(()=>{var p=vO();return x(p,a),R(h=>{var g=e.content.clickLink.url,v=xe("z-10",n()?"h-8":"p-4");return g!==h.e&&z(p,"href",h.e=g),v!==h.t&&U(p,h.t=v),h},{e:void 0,t:void 0}),p})():(()=>{var p=xO();return x(p,a),R(()=>U(p,xe("z-10",!n()&&"p-4",n()?re()?"h-8":"h-9":""))),p})()})(),null),R(d=>{var p=xe("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),h=n()?"64px":"100%",g=n()?"32px":"100%";return p!==d.e&&U(s,d.e=p),h!==d.t&&((d.t=h)!=null?u.style.setProperty("width",h):u.style.removeProperty("width")),g!==d.a&&((d.a=g)!=null?u.style.setProperty("height",g):u.style.removeProperty("height")),d},{e:void 0,t:void 0,a:void 0}),s})()};var Rw=({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??bt.typingEmulation.enabled,speed:t?.speed??bt.typingEmulation.speed,maxDelay:t?.maxDelay??bt.typingEmulation.maxDelay},s=n?r/o*6e4:0;return s>i*1e3&&(s=i*1e3),s};var yd=e=>e.map(t=>t.text??yd(t.children)).join("");var CO=T("<br>"),_O=T("<span>"),SO=(e,t,r)=>{let n="";return e&&(n+="slate-bold"),t&&(n+=" slate-italic"),r&&(n+=" slate-underline"),n},Dw=e=>(()=>{var t=_O();return x(t,()=>e.text,null),x(t,m(F,{get when(){return j(()=>!!e.isUniqueChild)()&&et(e.text)},get children(){return CO()}}),null),R(()=>U(t,SO(e.bold,e.italic,e.underline))),t})();var kO=T('<a target=_blank rel="noopener noreferrer">'),PO=T("<ol>"),EO=T("<ul>"),IO=T("<li>"),AO=T("<span>"),OO=T("<div>"),ao=e=>m(We,{get children(){return [m(te,{get when(){return fe(e.element.text)},get children(){return m(Dw,Oe(()=>e.element,{get isUniqueChild(){return e.isUniqueChild??false}}))}}),m(te,{when:true,get children(){return m(We,{get children(){return [m(te,{get when(){return e.element.type==="a"},get children(){var t=kO();return x(t,m(Se,{get each(){return e.element.children},children:r=>m(ao,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),R(()=>z(t,"href",e.element.url)),t}}),m(te,{get when(){return e.element.type==="ol"},get children(){var t=PO();return x(t,m(Se,{get each(){return e.element.children},children:r=>m(ao,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(te,{get when(){return e.element.type==="ul"},get children(){var t=EO();return x(t,m(Se,{get each(){return e.element.children},children:r=>m(ao,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(te,{get when(){return e.element.type==="li"},get children(){var t=IO();return x(t,m(Se,{get each(){return e.element.children},children:r=>m(ao,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(te,{when:true,get children(){return m(RO,{get element(){return e.element},get insideInlineVariable(){return e.insideInlineVariable??false},get children(){return m(Se,{get each(){return e.element.children},children:t=>m(ao,{element:t,get isUniqueChild(){return e.element.children?.length===1},get insideInlineVariable(){return e.element.type==="inline-variable"}})})}})}})]}})}})]}}),RO=e=>m(We,{get children(){return [m(te,{get when(){return e.element.type==="inline-variable"||e.insideInlineVariable},get children(){var t=AO();return x(t,()=>e.children),R(()=>z(t,"data-element-type",e.element.type)),t}}),m(te,{when:true,get children(){var t=OO();return x(t,()=>e.children),R(()=>z(t,"data-element-type",e.element.type)),t}})]}});var DO=T('<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>'),MO=400,vd,Mw=e=>{let t,[r,n]=O(!!e.onTransitionEnd),o=()=>{r()&&(n(false),setTimeout(()=>{e.onTransitionEnd?.(t);},MO));};return de(()=>{if(!r)return;let i=e.content?.richText?yd(e.content.richText):"",a=e.typingEmulation?.enabled===false||e.isTypingSkipped?0:Rw({bubbleContent:i,typingSettings:e.typingEmulation});vd=setTimeout(o,a);}),he(()=>{vd&&clearTimeout(vd);}),(()=>{var i=DO(),a=i.firstChild,s=a.firstChild,c=s.firstChild,l=c.nextSibling,u=t;return typeof u=="function"?ye(u,i):t=i,x(c,(()=>{var f=j(()=>!!r());return ()=>f()&&m(Vt,{})})()),x(l,m(Se,{get each(){return e.content?.richText},children:f=>m(ao,{element:f})})),R(f=>{var d=xe("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),p=r()?"64px":"100%",h=r()?"32px":"100%",g=xe("overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative text-ellipsis",r()?"opacity-0":"opacity-100"),v=r()?re()?"16px":"20px":"100%";return d!==f.e&&U(i,f.e=d),p!==f.t&&((f.t=p)!=null?c.style.setProperty("width",p):c.style.removeProperty("width")),h!==f.a&&((f.a=h)!=null?c.style.setProperty("height",h):c.style.removeProperty("height")),g!==f.o&&U(l,f.o=g),v!==f.i&&((f.i=v)!=null?l.style.setProperty("height",v):l.style.removeProperty("height")),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()};var xd=["youtube","vimeo","tiktok","gumlet"],so={height:400,maxWidth:"100%",areControlsDisplayed:true,isAutoplayEnabled:true};var NO="https://www.youtube.com/embed";var LO="https://player.vimeo.com/video";var $O="https://www.tiktok.com/embed/v2";var BO="https://play.gumlet.io/embed";var Nw={vimeo:LO,youtube:NO,tiktok:$O,gumlet:BO};var FO=T("<video>"),UO=T('<div><iframe class="w-full h-full"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen>'),jO=T('<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 ">'),WO=400,wd,Lw=e=>{let t,[r,n]=O(!!e.onTransitionEnd);return de(()=>{let o=e.content?.type&&xd.includes(e.content?.type)?2e3:100;wd=setTimeout(()=>{r()&&(n(false),setTimeout(()=>{e.onTransitionEnd?.(t);},WO));},o);}),he(()=>{wd&&clearTimeout(wd);}),(()=>{var o=jO(),i=o.firstChild,a=i.firstChild,s=a.firstChild,c=t;return typeof c=="function"?ye(c,o):t=o,x(s,(()=>{var l=j(()=>!!r());return ()=>l()&&m(Vt,{})})()),x(a,m(We,{get children(){return [m(te,{get when(){return e.content?.type&&e.content.type==="url"},get children(){var l=FO();return R(u=>{var f=e.onTransitionEnd?e.content?.isAutoplayEnabled??so.isAutoplayEnabled:false,d=e.content?.url,p=e.content?.areControlsDisplayed??so.areControlsDisplayed,h="p-4 focus:outline-none w-full z-10 text-fade-in rounded-md "+(r()?"opacity-0":"opacity-100"),g=r()?re()?"32px":"36px":"auto",v=e.content?.aspectRatio,b=e.content?.maxWidth??so.maxWidth;return f!==u.e&&(l.autoplay=u.e=f),d!==u.t&&z(l,"src",u.t=d),p!==u.a&&(l.controls=u.a=p),h!==u.o&&U(l,u.o=h),g!==u.i&&((u.i=g)!=null?l.style.setProperty("height",g):l.style.removeProperty("height")),v!==u.n&&((u.n=v)!=null?l.style.setProperty("aspect-ratio",v):l.style.removeProperty("aspect-ratio")),b!==u.s&&((u.s=b)!=null?l.style.setProperty("max-width",b):l.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}),l}}),m(te,{get when(){return j(()=>!!e.content?.type)()&&xd.includes(e.content.type)},get children(){var l=UO(),u=l.firstChild;return R(f=>{var d=Qt("p-4 z-10 text-fade-in w-full",r()?"opacity-0":"opacity-100 p-4"),p=r()?re()?"32px":"36px":e.content?.aspectRatio?void 0:`${e.content?.height??so.height}px`,h=e.content?.aspectRatio,g=e.content?.maxWidth??so.maxWidth,v=`${Nw[e.content?.type]}/${e.content?.id??""}${e.content?.queryParamsStr??""}`;return d!==f.e&&U(l,f.e=d),p!==f.t&&((f.t=p)!=null?l.style.setProperty("height",p):l.style.removeProperty("height")),h!==f.a&&((f.a=h)!=null?l.style.setProperty("aspect-ratio",h):l.style.removeProperty("aspect-ratio")),g!==f.o&&((f.o=g)!=null?l.style.setProperty("max-width",g):l.style.removeProperty("max-width")),v!==f.i&&z(u,"src",f.i=v),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),l}})]}}),null),R(l=>{var u=Qt("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),f=r()?"64px":"100%",d=r()?"32px":"100%",p=e.content?.maxWidth??so.maxWidth;return u!==l.e&&U(o,l.e=u),f!==l.t&&((l.t=f)!=null?s.style.setProperty("width",f):s.style.removeProperty("width")),d!==l.a&&((l.a=d)!=null?s.style.setProperty("height",d):s.style.removeProperty("height")),p!==l.o&&((l.o=p)!=null?s.style.setProperty("max-width",p):s.style.removeProperty("max-width")),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o})()};var $w=e=>m(We,{get children(){return [m(te,{get when(){return e.message.type==="text"},get children(){return m(Mw,{get content(){return e.message.content},get isTypingSkipped(){return e.isTypingSkipped},get typingEmulation(){return e.typingEmulation},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(te,{get when(){return e.message.type==="image"},get children(){return m(Ow,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(te,{get when(){return e.message.type==="video"},get children(){return m(Lw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(te,{get when(){return e.message.type==="embed"},get children(){return m(Iw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(te,{get when(){return e.message.type==="custom-embed"},get children(){return m(Pw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(te,{get when(){return e.message.type==="audio"},get children(){return m(kw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}})]}});var Pd=xo(Bw());function kd(){return {async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}var co=kd();function Hw(e){co=e;}var Vw=/[&<>"']/,HO=new RegExp(Vw.source,"g"),zw=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,VO=new RegExp(zw.source,"g"),zO={"&":"&","<":"<",">":">",'"':""","'":"'"},Fw=e=>zO[e];function qt(e,t){if(t){if(Vw.test(e))return e.replace(HO,Fw)}else if(zw.test(e))return e.replace(VO,Fw);return e}var GO=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function YO(e){return e.replace(GO,(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 qO=/(^|[^\[])\^/g;function He(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(qO,"$1"),e=e.replace(n,o),r),getRegex:()=>new RegExp(e,t)};return r}function Uw(e){try{e=encodeURI(e).replace(/%25/g,"%");}catch{return null}return e}var Gl={exec:()=>null};function jw(e,t){let r=e.replace(/\|/g,(i,a,s)=>{let c=false,l=a;for(;--l>=0&&s[l]==="\\";)c=!c;return c?"|":" |"}),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 KO(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 Ww(e,t,r,n){let o=t.href,i=t.title?qt(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:qt(a)}}function XO(e,t){let r=e.match(/^(\s+)(?:```)/);if(r===null)return t;let n=r[1];return t.split(`
|
|
56
|
+
`,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(We,{get children(){return [m(te,{get when(){return qA(e.src??"")},get children(){var t=WA();return x(t,()=>e.src),t}}),m(te,{get when(){return fr(e.src)},get children(){var t=HA();return R(r=>{var n=e.src,o="flex justify-center items-center relative animate-fade-in flex-shrink-0 "+(re()?"w-6 h-6 text-sm":"w-10 h-10 text-xl");return n!==r.e&&z(t,"src",r.e=n),o!==r.t&&U(t,r.t=o),r},{e:void 0,t:void 0}),t}}),m(te,{when:true,get children(){var t=VA(),r=t.firstChild;return R(n=>{var o="flex justify-center items-center rounded-full text-white relative animate-fade-in flex-shrink-0 "+(re()?"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&&z(r,"src",n.t=i),n},{e:void 0,t:void 0}),t}})]}})}}),qA=e=>/^\p{Emoji}$/u.test(e);var KA=T('<div class="flex justify-end items-end animate-fade-in gap-2 guest-container">'),Tw=T("<div>"),XA=T('<span class="px-[15px] py-[7px]">'),ZA=T("<img alt=Attachment>"),QA=T('<div class="flex flex-col gap-1 items-end"><div class="p-[1px] whitespace-pre-wrap max-w-full agent-guest-bubble flex flex-col"data-testid=guest-bubble>'),JA=T("<img>"),eO=T('<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>'),Cw=e=>(()=>{var t=KA();return x(t,m(We,{get children(){return [m(te,{get when(){return e.answer?.type==="text"},get children(){return m(tO,{get answer(){return e.answer}})}}),m(te,{get when(){return e.answer?.type==="recording"},get children(){return m(rO,{get answer(){return e.answer}})}})]}}),null),x(t,m(F,{get when(){return e.showAvatar},get children(){return m(Vl,{isGuest:true,get theme(){return e.theme},get src(){return e.avatarSrc}})}}),null),R(r=>(r=e.hasHostAvatar?re()?"28px":"50px":void 0)!=null?t.style.setProperty("margin-left",r):t.style.removeProperty("margin-left")),t})(),tO=e=>{let[t,r]=O();return (()=>{var n=QA(),o=n.firstChild;return x(n,m(F,{get when(){return (e.answer.attachments??[]).length>0},get children(){return [(()=>{var i=Tw();return x(i,m(Se,{get each(){return e.answer.attachments?.filter(a=>a.type.startsWith("image"))},children:(a,s)=>(()=>{var c=JA();return c.$$click=()=>r(a.blobUrl??a.url),R(l=>{var u=a.blobUrl??a.url,f=`Attached image ${s()+1}`,d=xe("agent-guest-bubble-image-attachment cursor-pointer",e.answer.attachments.filter(p=>p.type.startsWith("image")).length>1&&"max-w-[90%]");return u!==l.e&&z(c,"src",l.e=u),f!==l.t&&z(c,"alt",l.t=f),d!==l.a&&U(c,l.a=d),l},{e:void 0,t:void 0,a:void 0}),c})()})),R(()=>U(i,xe("flex gap-1 overflow-auto max-w-[350px]",re()?"flex-wrap justify-end":"items-center"))),i})(),(()=>{var i=Tw();return x(i,m(Se,{get each(){return e.answer.attachments?.filter(a=>!a.type.startsWith("image"))},children:a=>m(xl,{get file(){return {name:a.url.split("/").at(-1)}}})})),R(()=>U(i,xe("flex gap-1 overflow-auto max-w-[350px]",re()?"flex-wrap justify-end":"items-center"))),i})()]}}),o),x(o,m(F,{get when(){return Le(e.answer.label??e.answer.value)},get children(){var i=XA();return x(i,(()=>{var a=j(()=>!!e.answer.isPassword);return ()=>a()?"*".repeat(e.answer.value.length):e.answer.label??e.answer.value})()),i}})),x(n,m(vw,{get isOpen(){return t()!==void 0},onClose:()=>r(void 0),get children(){var i=ZA();return i.style.setProperty("border-radius","6px"),R(()=>z(i,"src",t())),i}}),null),n})()},rO=e=>(()=>{var t=eO(),r=t.firstChild,n=r.firstChild;return R(()=>z(n,"src",e.answer.blobUrl??e.answer.url)),t})();Xe(["click"]);var nO=T("<div>"),oO=T('<div class="flex justify-end animate-fade-in gap-2 agent-input-container">'),_w=e=>{let[t,r]=Er(O(),{key:`agent-${e.context.agent.id}-input-${e.chunkIndex}`,storage:e.context.storage});de(()=>{e.isOngoingLastChunk&&fe(t())&&e.onSubmit(t());});let n=async i=>{r(i),e.onSubmit(i);},o=i=>{r({type:"text",value:i}),e.onSkip();};return _e(()=>{let i=sl().findLast(a=>e.chunkIndex===a.inputIndex)?.formattedMessage;i&&e.block.type!=="file input"&&r(a=>a?.type==="text"?{...a,label:i}:a);}),m(We,{get children(){return [m(te,{get when(){return t()&&!e.hasError},get children(){return m(Cw,{get theme(){return e.theme},get answer(){return t()},get showAvatar(){return e.guestAvatar?.isEnabled??Fi},get avatarSrc(){return e.guestAvatar?.url&&e.guestAvatar.url},get hasHostAvatar(){return e.hasHostAvatar}})}}),m(te,{get when(){return lt(t())||e.hasError},get children(){var i=oO(),a=e.ref;return typeof a=="function"?ye(a,i):e.ref=i,x(i,m(F,{get when(){return e.hasHostAvatar},get children(){var s=nO();return R(()=>U(s,"flex flex-shrink-0 items-center "+(re()?"w-6 h-6":"w-10 h-10"))),s}}),null),x(i,m(aO,{get context(){return e.context},get block(){return e.block},get chunkIndex(){return e.chunkIndex},get isInputPrefillEnabled(){return e.isInputPrefillEnabled},get existingAnswer(){return j(()=>!!e.hasError)()?iO(t()):void 0},get onTransitionEnd(){return e.onTransitionEnd},onSubmit:n,onSkip:o}),null),R(()=>z(i,"data-blockid",e.block.id)),i}})]}})},iO=e=>{if(e)return e.type==="text"?e.value:e.url},aO=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??Sl.labels.success});return m(We,{get children(){return [m(te,{get when(){return e.block.type==="text input"},get children(){return m(hw,{get block(){return e.block},get defaultValue(){return r()},get context(){return e.context},onSubmit:t})}}),m(te,{get when(){return e.block.type==="number input"},get children(){return m(lx,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(te,{get when(){return e.block.type==="email input"},get children(){return m(nx,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(te,{get when(){return e.block.type==="url input"},get children(){return m(yw,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(te,{get when(){return e.block.type==="phone number input"},get children(){return m(xx,{get labels(){return e.block.options?.labels},get defaultCountryCode(){return e.block.options?.defaultCountryCode},get defaultValue(){return r()},onSubmit:t})}}),m(te,{get when(){return e.block.type==="date input"},get children(){return m(tx,{get options(){return e.block.options},get defaultValue(){return r()},onSubmit:t})}}),m(te,{get when(){return sO(e.block)},keyed:true,children:o=>m(We,{get children(){return [m(te,{get when(){return !o.options?.isMultipleChoice},get children(){return m(Xy,{get chunkIndex(){return e.chunkIndex},get defaultItems(){return o.items},get options(){return o.options},onSubmit:t})}}),m(te,{get when(){return o.options?.isMultipleChoice},get children(){return m(Jy,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t})}})]}})}),m(te,{get when(){return lO(e.block)},keyed:true,children:o=>m(We,{get children(){return [m(te,{get when(){return !o.options?.isMultipleChoice},get children(){return m(Sx,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t,get onTransitionEnd(){return e.onTransitionEnd}})}}),m(te,{get when(){return o.options?.isMultipleChoice},get children(){return m(_x,{get defaultItems(){return o.items},get options(){return o.options},onSubmit:t,get onTransitionEnd(){return e.onTransitionEnd}})}})]}})}),m(te,{get when(){return e.block.type==="rating input"},get children(){return m(kx,{get block(){return e.block},get defaultValue(){return r()},onSubmit:t})}}),m(te,{get when(){return e.block.type==="file input"},get children(){return m(ix,{get context(){return e.context},get block(){return e.block},onSubmit:t,get onSkip(){return e.onSkip}})}}),m(te,{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}})}})]}})},sO=e=>e?.type==="choice input"?e:void 0,lO=e=>e?.type==="image choice"?e:void 0;var cO=T('<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=()=>cO();var Sw={isAutoplayEnabled:true};var uO=T('<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>'),dO=400,fO=100,gd,kw=e=>{let t=false,r,n,[o,i]=O(!!e.onTransitionEnd);return de(()=>{gd=setTimeout(()=>{t||(t=true,i(false),setTimeout(()=>e.onTransitionEnd?.(r),dO));},fO);}),he(()=>{gd&&clearTimeout(gd);}),(()=>{var a=uO(),s=a.firstChild,c=s.firstChild,l=c.firstChild,u=l.nextSibling,f=r;typeof f=="function"?ye(f,a):r=a,x(l,(()=>{var p=j(()=>!!o());return ()=>p()&&m(Vt,{})})());var d=n;return typeof d=="function"?ye(d,u):n=u,R(p=>{var h=xe("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),g=o()?"64px":"100%",v=o()?"32px":"100%",b=e.content?.url,C=e.onTransitionEnd?e.content?.isAutoplayEnabled??Sw.isAutoplayEnabled:false,_="z-10 text-fade-in "+(o()?"opacity-0":"opacity-100 m-2"),k=o()?re()?"32px":"36px":"revert";return h!==p.e&&U(a,p.e=h),g!==p.t&&((p.t=g)!=null?l.style.setProperty("width",g):l.style.removeProperty("width")),v!==p.a&&((p.a=v)!=null?l.style.setProperty("height",v):l.style.removeProperty("height")),b!==p.o&&z(u,"src",p.o=b),C!==p.i&&(u.autoplay=p.i=C),_!==p.n&&U(u,p.n=_),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 pO=T('<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">'),hd,mO=400,Pw=e=>{let t,[r,n]=O(!!e.onTransitionEnd),o;return de(()=>{ca({args:{...e.content.initFunction.args,agentElement:o},content:e.content.initFunction.content}),e.content.waitForEventFunction&&ca({args:{...e.content.waitForEventFunction.args,continueFlow:i=>e.onCompleted(i?{type:"text",value:i}:void 0)},content:e.content.waitForEventFunction.content}),hd=setTimeout(()=>{n(false),setTimeout(()=>e.onTransitionEnd?.(t),mO);},2e3);}),he(()=>{hd&&clearTimeout(hd);}),(()=>{var i=pO(),a=i.firstChild,s=a.firstChild,c=s.firstChild,l=c.nextSibling,u=l.firstChild,f=t;typeof f=="function"?ye(f,i):t=i,x(c,(()=>{var p=j(()=>!!r());return ()=>p()&&m(Vt,{})})());var d=o;return typeof d=="function"?ye(d,u):o=u,R(p=>{var h=xe("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),g=r()?"64px":"100%",v=r()?"32px":"100%",b=xe("p-2 z-20 text-fade-in w-full",r()?"opacity-0":"opacity-100"),C=r()?re()?"32px":"36px":void 0,_=`calc(${om()} - 100px)`;return h!==p.e&&U(i,p.e=h),g!==p.t&&((p.t=g)!=null?c.style.setProperty("width",g):c.style.removeProperty("width")),v!==p.a&&((p.a=v)!=null?c.style.setProperty("height",v):c.style.removeProperty("height")),b!==p.o&&U(l,p.o=b),C!==p.i&&((p.i=C)!=null?l.style.setProperty("height",C):l.style.removeProperty("height")),_!==p.n&&((p.n=_)!=null?u.style.setProperty("max-height",_):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 Ew={height:400};var gO=T('<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 ">'),bd,hO=400,Iw=e=>{let t,[r,n]=O(!!e.onTransitionEnd),o=i=>{e.content?.waitForEvent?.isEnabled&&Le(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 de(()=>{bd=setTimeout(()=>{n(false),e.content?.waitForEvent?.isEnabled&&window.addEventListener("message",o),setTimeout(()=>{e.onTransitionEnd?.(t);},hO);},2e3);}),he(()=>{bd&&clearTimeout(bd),window.removeEventListener("message",o);}),(()=>{var i=gO(),a=i.firstChild,s=a.firstChild,c=s.firstChild,l=c.nextSibling,u=l.firstChild,f=t;return typeof f=="function"?ye(f,i):t=i,x(c,(()=>{var d=j(()=>!!r());return ()=>d()&&m(Vt,{})})()),R(d=>{var p=xe("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),h=r()?"64px":"100%",g=r()?"32px":"100%",v=xe("p-4 z-20 text-fade-in w-full",r()?"opacity-0":"opacity-100 p-4"),b=r()?re()?"32px":"36px":`${e.content?.height??Ew.height}px`,C=e.content?.url;return p!==d.e&&U(i,d.e=p),h!==d.t&&((d.t=h)!=null?c.style.setProperty("width",h):c.style.removeProperty("width")),g!==d.a&&((d.a=g)!=null?c.style.setProperty("height",g):c.style.removeProperty("height")),v!==d.o&&U(l,d.o=v),b!==d.i&&((d.i=b)!=null?l.style.setProperty("height",b):l.style.removeProperty("height")),C!==d.n&&z(u,"src",d.n=C),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()};var Aw={clickLink:{alt:"Bubble image"}};var bO=T('<img elementtiming="Bubble image"fetchpriority=high>'),yO=T('<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 ">'),vO=T("<a target=_blank rel=noreferrer>"),xO=T("<figure>"),wO=400,TO=5e3,zl,Ow=e=>{let t,r,[n,o]=O(!!e.onTransitionEnd),i=()=>{n()&&(o(false),setTimeout(()=>{e.onTransitionEnd?.(t);},wO));};de(()=>{r&&(zl=setTimeout(i,TO),r.onload=()=>{clearTimeout(zl),i();});}),he(()=>{zl&&clearTimeout(zl);});let a=(()=>{var s=bO(),c=r;return typeof c=="function"?ye(c,s):r=s,s.style.setProperty("max-height","512px"),R(l=>{var u=e.content?.url,f=e.content?.clickLink?.alt??Aw.clickLink.alt,d=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!==l.e&&z(s,"src",l.e=u),f!==l.t&&z(s,"alt",l.t=f),d!==l.a&&U(s,l.a=d),p!==l.o&&((l.o=p)!=null?s.style.setProperty("height",p):s.style.removeProperty("height")),l},{e:void 0,t:void 0,a:void 0,o:void 0}),s})();return (()=>{var s=yO(),c=s.firstChild,l=c.firstChild,u=l.firstChild,f=t;return typeof f=="function"?ye(f,s):t=s,x(u,(()=>{var d=j(()=>!!n());return ()=>d()?m(Vt,{}):null})()),x(l,(()=>{var d=j(()=>!!e.content?.clickLink);return ()=>d()?(()=>{var p=vO();return x(p,a),R(h=>{var g=e.content.clickLink.url,v=xe("z-10",n()?"h-8":"p-4");return g!==h.e&&z(p,"href",h.e=g),v!==h.t&&U(p,h.t=v),h},{e:void 0,t:void 0}),p})():(()=>{var p=xO();return x(p,a),R(()=>U(p,xe("z-10",!n()&&"p-4",n()?re()?"h-8":"h-9":""))),p})()})(),null),R(d=>{var p=xe("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),h=n()?"64px":"100%",g=n()?"32px":"100%";return p!==d.e&&U(s,d.e=p),h!==d.t&&((d.t=h)!=null?u.style.setProperty("width",h):u.style.removeProperty("width")),g!==d.a&&((d.a=g)!=null?u.style.setProperty("height",g):u.style.removeProperty("height")),d},{e:void 0,t:void 0,a:void 0}),s})()};var Rw=({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??bt.typingEmulation.enabled,speed:t?.speed??bt.typingEmulation.speed,maxDelay:t?.maxDelay??bt.typingEmulation.maxDelay},s=n?r/o*6e4:0;return s>i*1e3&&(s=i*1e3),s};var yd=e=>e.map(t=>t.text??yd(t.children)).join("");var CO=T("<br>"),_O=T("<span>"),SO=(e,t,r)=>{let n="";return e&&(n+="slate-bold"),t&&(n+=" slate-italic"),r&&(n+=" slate-underline"),n},Dw=e=>(()=>{var t=_O();return x(t,()=>e.text,null),x(t,m(F,{get when(){return j(()=>!!e.isUniqueChild)()&&et(e.text)},get children(){return CO()}}),null),R(()=>U(t,SO(e.bold,e.italic,e.underline))),t})();var kO=T('<a target=_blank rel="noopener noreferrer">'),PO=T("<ol>"),EO=T("<ul>"),IO=T("<li>"),AO=T("<span>"),OO=T("<div>"),ao=e=>m(We,{get children(){return [m(te,{get when(){return fe(e.element.text)},get children(){return m(Dw,Oe(()=>e.element,{get isUniqueChild(){return e.isUniqueChild??false}}))}}),m(te,{when:true,get children(){return m(We,{get children(){return [m(te,{get when(){return e.element.type==="a"},get children(){var t=kO();return x(t,m(Se,{get each(){return e.element.children},children:r=>m(ao,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),R(()=>z(t,"href",e.element.url)),t}}),m(te,{get when(){return e.element.type==="ol"},get children(){var t=PO();return x(t,m(Se,{get each(){return e.element.children},children:r=>m(ao,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(te,{get when(){return e.element.type==="ul"},get children(){var t=EO();return x(t,m(Se,{get each(){return e.element.children},children:r=>m(ao,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(te,{get when(){return e.element.type==="li"},get children(){var t=IO();return x(t,m(Se,{get each(){return e.element.children},children:r=>m(ao,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),m(te,{when:true,get children(){return m(RO,{get element(){return e.element},get insideInlineVariable(){return e.insideInlineVariable??false},get children(){return m(Se,{get each(){return e.element.children},children:t=>m(ao,{element:t,get isUniqueChild(){return e.element.children?.length===1},get insideInlineVariable(){return e.element.type==="inline-variable"}})})}})}})]}})}})]}}),RO=e=>m(We,{get children(){return [m(te,{get when(){return e.element.type==="inline-variable"||e.insideInlineVariable},get children(){var t=AO();return x(t,()=>e.children),R(()=>z(t,"data-element-type",e.element.type)),t}}),m(te,{when:true,get children(){var t=OO();return x(t,()=>e.children),R(()=>z(t,"data-element-type",e.element.type)),t}})]}});var DO=T('<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>'),MO=400,vd,Mw=e=>{let t,[r,n]=O(!!e.onTransitionEnd),o=()=>{r()&&(n(false),setTimeout(()=>{e.onTransitionEnd?.(t);},MO));};return de(()=>{if(!r)return;let i=e.content?.richText?yd(e.content.richText):"",a=e.typingEmulation?.enabled===false||e.isTypingSkipped?0:Rw({bubbleContent:i,typingSettings:e.typingEmulation});vd=setTimeout(o,a);}),he(()=>{vd&&clearTimeout(vd);}),(()=>{var i=DO(),a=i.firstChild,s=a.firstChild,c=s.firstChild,l=c.nextSibling,u=t;return typeof u=="function"?ye(u,i):t=i,x(c,(()=>{var f=j(()=>!!r());return ()=>f()&&m(Vt,{})})()),x(l,m(Se,{get each(){return e.content?.richText},children:f=>m(ao,{element:f})})),R(f=>{var d=xe("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),p=r()?"64px":"100%",h=r()?"32px":"100%",g=xe("overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative text-ellipsis",r()?"opacity-0":"opacity-100"),v=r()?re()?"16px":"20px":"100%";return d!==f.e&&U(i,f.e=d),p!==f.t&&((f.t=p)!=null?c.style.setProperty("width",p):c.style.removeProperty("width")),h!==f.a&&((f.a=h)!=null?c.style.setProperty("height",h):c.style.removeProperty("height")),g!==f.o&&U(l,f.o=g),v!==f.i&&((f.i=v)!=null?l.style.setProperty("height",v):l.style.removeProperty("height")),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()};var xd=["youtube","vimeo","tiktok","gumlet"],so={height:400,maxWidth:"100%",areControlsDisplayed:true,isAutoplayEnabled:true};var NO="https://www.youtube.com/embed";var LO="https://player.vimeo.com/video";var $O="https://www.tiktok.com/embed/v2";var BO="https://play.gumlet.io/embed";var Nw={vimeo:LO,youtube:NO,tiktok:$O,gumlet:BO};var FO=T("<video>"),UO=T('<div><iframe class="w-full h-full"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen>'),jO=T('<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 ">'),WO=400,wd,Lw=e=>{let t,[r,n]=O(!!e.onTransitionEnd);return de(()=>{let o=e.content?.type&&xd.includes(e.content?.type)?2e3:100;wd=setTimeout(()=>{r()&&(n(false),setTimeout(()=>{e.onTransitionEnd?.(t);},WO));},o);}),he(()=>{wd&&clearTimeout(wd);}),(()=>{var o=jO(),i=o.firstChild,a=i.firstChild,s=a.firstChild,c=t;return typeof c=="function"?ye(c,o):t=o,x(s,(()=>{var l=j(()=>!!r());return ()=>l()&&m(Vt,{})})()),x(a,m(We,{get children(){return [m(te,{get when(){return e.content?.type&&e.content.type==="url"},get children(){var l=FO();return R(u=>{var f=e.onTransitionEnd?e.content?.isAutoplayEnabled??so.isAutoplayEnabled:false,d=e.content?.url,p=e.content?.areControlsDisplayed??so.areControlsDisplayed,h="p-4 focus:outline-none w-full z-10 text-fade-in rounded-md "+(r()?"opacity-0":"opacity-100"),g=r()?re()?"32px":"36px":"auto",v=e.content?.aspectRatio,b=e.content?.maxWidth??so.maxWidth;return f!==u.e&&(l.autoplay=u.e=f),d!==u.t&&z(l,"src",u.t=d),p!==u.a&&(l.controls=u.a=p),h!==u.o&&U(l,u.o=h),g!==u.i&&((u.i=g)!=null?l.style.setProperty("height",g):l.style.removeProperty("height")),v!==u.n&&((u.n=v)!=null?l.style.setProperty("aspect-ratio",v):l.style.removeProperty("aspect-ratio")),b!==u.s&&((u.s=b)!=null?l.style.setProperty("max-width",b):l.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}),l}}),m(te,{get when(){return j(()=>!!e.content?.type)()&&xd.includes(e.content.type)},get children(){var l=UO(),u=l.firstChild;return R(f=>{var d=Qt("p-4 z-10 text-fade-in w-full",r()?"opacity-0":"opacity-100 p-4"),p=r()?re()?"32px":"36px":e.content?.aspectRatio?void 0:`${e.content?.height??so.height}px`,h=e.content?.aspectRatio,g=e.content?.maxWidth??so.maxWidth,v=`${Nw[e.content?.type]}/${e.content?.id??""}${e.content?.queryParamsStr??""}`;return d!==f.e&&U(l,f.e=d),p!==f.t&&((f.t=p)!=null?l.style.setProperty("height",p):l.style.removeProperty("height")),h!==f.a&&((f.a=h)!=null?l.style.setProperty("aspect-ratio",h):l.style.removeProperty("aspect-ratio")),g!==f.o&&((f.o=g)!=null?l.style.setProperty("max-width",g):l.style.removeProperty("max-width")),v!==f.i&&z(u,"src",f.i=v),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),l}})]}}),null),R(l=>{var u=Qt("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),f=r()?"64px":"100%",d=r()?"32px":"100%",p=e.content?.maxWidth??so.maxWidth;return u!==l.e&&U(o,l.e=u),f!==l.t&&((l.t=f)!=null?s.style.setProperty("width",f):s.style.removeProperty("width")),d!==l.a&&((l.a=d)!=null?s.style.setProperty("height",d):s.style.removeProperty("height")),p!==l.o&&((l.o=p)!=null?s.style.setProperty("max-width",p):s.style.removeProperty("max-width")),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o})()};var $w=e=>m(We,{get children(){return [m(te,{get when(){return e.message.type==="text"},get children(){return m(Mw,{get content(){return e.message.content},get isTypingSkipped(){return e.isTypingSkipped},get typingEmulation(){return e.typingEmulation},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(te,{get when(){return e.message.type==="image"},get children(){return m(Ow,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(te,{get when(){return e.message.type==="video"},get children(){return m(Lw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),m(te,{get when(){return e.message.type==="embed"},get children(){return m(Iw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(te,{get when(){return e.message.type==="custom-embed"},get children(){return m(Pw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),m(te,{get when(){return e.message.type==="audio"},get children(){return m(kw,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}})]}});var Pd=xo(Bw());function kd(){return {async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}var co=kd();function Hw(e){co=e;}var Vw=/[&<>"']/,HO=new RegExp(Vw.source,"g"),zw=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,VO=new RegExp(zw.source,"g"),zO={"&":"&","<":"<",">":">",'"':""","'":"'"},Fw=e=>zO[e];function qt(e,t){if(t){if(Vw.test(e))return e.replace(HO,Fw)}else if(zw.test(e))return e.replace(VO,Fw);return e}var GO=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function YO(e){return e.replace(GO,(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 qO=/(^|[^\[])\^/g;function He(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(qO,"$1"),e=e.replace(n,o),r),getRegex:()=>new RegExp(e,t)};return r}function Uw(e){try{e=encodeURI(e).replace(/%25/g,"%");}catch{return null}return e}var Gl={exec:()=>null};function jw(e,t){let r=e.replace(/\|/g,(i,a,s)=>{let c=false,l=a;for(;--l>=0&&s[l]==="\\";)c=!c;return c?"|":" |"}),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 KO(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 Ww(e,t,r,n){let o=t.href,i=t.title?qt(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:qt(a)}}function XO(e,t){let r=e.match(/^(\s+)(?:```)/);if(r===null)return t;let n=r[1];return t.split(`
|
|
57
57
|
`).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(`
|
|
58
58
|
`)}var fi=class{options;rules;lexer;constructor(t){this.options=t||co;}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,`
|
|
59
59
|
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let n=r[0],o=XO(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="",c="",l=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 f=r[2].split(`
|
|
@@ -98,14 +98,14 @@ ${t}</tr>
|
|
|
98
98
|
`+(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}},di=class{options;constructor(t){this.options=t||co;}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}},Sd=class{defaults=kd();options=this.setOptions;parse=this.#e(tn.lex,rn.parse);parseInline=this.#e(tn.lexInline,rn.parseInline);Parser=rn;parser=rn.parse;Renderer=pi;TextRenderer=Fa;Lexer=tn;lexer=tn.lex;Tokenizer=fi;Hooks=di;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 c=i.renderer.apply(this,s);return c===false&&(c=a.apply(this,s)),c}: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 pi(this.defaults);for(let a in n.renderer){let s=n.renderer[a],c=a,l=i[c];i[c]=(...u)=>{let f=s.apply(i,u);return f===false&&(f=l.apply(i,u)),f||""};}o.renderer=i;}if(n.tokenizer){let i=this.defaults.tokenizer||new fi(this.defaults);for(let a in n.tokenizer){let s=n.tokenizer[a],c=a,l=i[c];i[c]=(...u)=>{let f=s.apply(i,u);return f===false&&(f=l.apply(i,u)),f};}o.tokenizer=i;}if(n.hooks){let i=this.defaults.hooks||new di;for(let a in n.hooks){let s=n.hooks[a],c=a,l=i[c];di.passThroughHooks.has(a)?i[c]=u=>{if(this.defaults.async)return Promise.resolve(s.call(i,u)).then(d=>l.call(i,d));let f=s.call(i,u);return l.call(i,f)}:i[c]=(...u)=>{let f=s.apply(i,u);return f===false&&(f=l.apply(i,u)),f};}o.hooks=i;}if(n.walkTokens){let i=this.defaults.walkTokens,a=n.walkTokens;o.walkTokens=function(s){let c=[];return c.push(a.call(this,s)),i&&(c=c.concat(i.call(this,s))),c};}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(c=>t(c,a)).then(c=>a.walkTokens?Promise.all(this.walkTokens(c,a.walkTokens)).then(()=>c):c).then(c=>r(c,a)).then(c=>a.hooks?a.hooks.postprocess(c):c).catch(s);try{a.hooks&&(n=a.hooks.preprocess(n));let c=t(n,a);a.walkTokens&&this.walkTokens(c,a.walkTokens);let l=r(c,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(c){return s(c)}}}#t(t,r){return n=>{if(n.message+=`
|
|
99
99
|
Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+qt(n.message+"",true)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(n);throw n}}},lo=new Sd;function Fe(e,t){return lo.parse(e,t)}Fe.options=Fe.setOptions=function(e){return lo.setOptions(e),Fe.defaults=lo.defaults,Hw(Fe.defaults),Fe};Fe.getDefaults=kd;Fe.defaults=co;Fe.use=function(...e){return lo.use(...e),Fe.defaults=lo.defaults,Hw(Fe.defaults),Fe};Fe.walkTokens=function(e,t){return lo.walkTokens(e,t)};Fe.parseInline=lo.parseInline;Fe.Parser=rn;Fe.parser=rn.parse;Fe.Renderer=pi;Fe.TextRenderer=Fa;Fe.Lexer=tn;Fe.lexer=tn.lex;Fe.Tokenizer=fi;Fe.Hooks=di;Fe.parse=Fe;Fe.options;Fe.setOptions;Fe.use;Fe.walkTokens;Fe.parseInline;rn.parse;tn.lex;var ZO=T('<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">'),QO=T("<span>"),Gw=e=>{let[t,r]=Er(O([]),{key:`agent-streaming-message-${e.streamingMessageId}`,storage:e.context.storage});return Fe.use({renderer:{link:(n,o,i)=>`<a href="${n}" target="_blank" rel="noopener noreferrer">${i}</a>`}}),_e(()=>{if(Ru()?.id!==e.streamingMessageId)return [];r(Ru()?.content.split("```").flatMap((n,o)=>o%2===0?n.split(`
|
|
100
100
|
|
|
101
|
-
`).map(i=>Pd.default.sanitize(Fe.parse(i.replace(/【.+】/g,"").replace(/</g,"<").replace(/>/g,">"),{breaks:true}),{ADD_ATTR:["target"]})):[Pd.default.sanitize(Fe.parse("```"+n+"```".replace(/</g,"<").replace(/>/g,">"),{breaks:true}),{ADD_ATTR:["target"]})]).filter(Le)??[]);}),(()=>{var n=ZO(),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(Se,{get each(){return t()},children:c=>(()=>{var l=QO();return l.innerHTML=c,l})()})),n})()};var JO=T("<div><div>"),Ua=e=>{let t,[r,n]=O(0),o=new ResizeObserver(i=>n(i[0].target.clientHeight-(re()?24:40)));return de(()=>{t&&o.observe(t);}),he(()=>{t&&o.unobserve(t);}),(()=>{var i=JO(),a=i.firstChild,s=t;return typeof s=="function"?ye(s,i):t=i,x(a,m(Vl,{get theme(){return e.theme},get src(){return e.avatarSrc}})),R(c=>{var l="flex flex-shrink-0 items-center relative agent-avatar-container "+(re()?"w-6":"w-10"),u="absolute flex items-center top-0"+(re()?" w-6 h-6":" w-10 h-10")+(e.hideAvatar?" opacity-0":" opacity-100"),f=`${r()}px`,d=e.isTransitionDisabled?void 0:"top 350ms ease-out, opacity 250ms ease-out";return l!==c.e&&U(i,c.e=l),u!==c.t&&U(a,c.t=u),f!==c.a&&((c.a=f)!=null?a.style.setProperty("top",f):a.style.removeProperty("top")),d!==c.o&&((c.o=d)!=null?a.style.setProperty("transition",d):a.style.removeProperty("transition")),c},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()};var Yw=T('<div><div class="flex flex-col flex-1 gap-2">'),eR=T('<div class="flex flex-col w-full min-w-0 gap-2 agent-chat-chunk">'),qw=e=>{let t,[r,n]=O(e.isTransitionDisabled?e.messages.length:0),[o,i]=O();de(()=>{e.streamingMessageId||(e.messages.length===0&&e.onAllBubblesDisplayed(),e.onScrollToBottom(t,50));});let a=async s=>{(e.settings.typingEmulation?.delayBetweenBubbles??bt.typingEmulation.delayBetweenBubbles)>0&&r()<e.messages.length-1&&await new Promise(l=>setTimeout(l,(e.settings.typingEmulation?.delayBetweenBubbles??bt.typingEmulation.delayBetweenBubbles)*1e3));let c=e.messages[r()].id;await e.onNewBubbleDisplayed(c),n(r()===e.messages.length?r():r()+1),e.onScrollToBottom(s),r()===e.messages.length&&(i(s),e.onAllBubblesDisplayed());};return (()=>{var s=eR();return x(s,m(F,{get when(){return e.messages.length>0},get children(){var c=Yw(),l=c.firstChild;return x(c,m(F,{get when(){return (e.theme.chat?.hostAvatar?.isEnabled??Bo)&&e.messages.length>0},get children(){return m(Ua,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar},get isTransitionDisabled(){return e.isTransitionDisabled}})}}),l),x(l,m(Se,{get each(){return e.messages.slice(0,r()+1)},children:(u,f)=>m($w,{message:u,get typingEmulation(){return e.settings.typingEmulation},get isTypingSkipped(){return j(()=>!!((e.settings.typingEmulation?.isDisabledOnFirstMessage??bt.typingEmulation.isDisabledOnFirstMessage)&&e.index===0))()&&f()===0},get onTransitionEnd(){return e.isTransitionDisabled?void 0:a},get onCompleted(){return e.onSubmit}})})),R(u=>{var f="flex"+(re()?" gap-1":" gap-2"),d=e.theme.chat?.guestAvatar?.isEnabled??Fi?re()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%";return f!==u.e&&U(c,u.e=f),d!==u.t&&((u.t=d)!=null?l.style.setProperty("max-width",d):l.style.removeProperty("max-width")),u},{e:void 0,t:void 0}),c}}),null),x(s,(()=>{var c=j(()=>!!(e.input&&r()===e.messages.length));return ()=>c()&&m(_w,{get theme(){return e.theme},ref(l){var u=t;typeof u=="function"?u(l):t=l;},get block(){return e.input},get chunkIndex(){return e.index},get hasHostAvatar(){return e.theme.chat?.hostAvatar?.isEnabled??Bo},get guestAvatar(){return e.theme.chat?.guestAvatar},get context(){return e.context},get isInputPrefillEnabled(){return e.settings.general?.isInputPrefillEnabled??bt.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(F,{get when(){return e.streamingMessageId},keyed:true,children:c=>(()=>{var l=Yw(),u=l.firstChild;return x(l,m(F,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??Bo},get children(){return m(Ua,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar}})}}),u),x(u,m(Gw,{streamingMessageId:c,get context(){return e.context}})),R(f=>{var d="flex"+(re()?" gap-1":" gap-2"),p=e.theme.chat?.guestAvatar?.isEnabled??Fi?re()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%";return d!==f.e&&U(l,f.e=d),p!==f.t&&((f.t=p)!=null?u.style.setProperty("max-width",p):u.style.removeProperty("max-width")),f},{e:void 0,t:void 0}),l})()}),null),s})()};var tR=T('<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">'),Kw=()=>(()=>{var e=tR(),t=e.firstChild,r=t.firstChild,n=r.firstChild;return n.style.setProperty("width","64px"),n.style.setProperty("height","32px"),x(n,m(Vt,{})),e})();var rR=T('<div class="flex w-full agent-loading-chunk"><div class="flex flex-col w-full min-w-0"><div class="flex gap-2">'),Xw=e=>(()=>{var t=rR(),r=t.firstChild,n=r.firstChild;return x(n,m(F,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??Bo},get children(){return m(Ua,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url}})}}),null),x(n,m(Kw,{}),null),t})();var nR=T('<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'),Zw=e=>(()=>{var t=nR(),r=t.firstChild,n=r.nextSibling;return n.$$click=()=>e.onLinkClick(),R(()=>z(n,"href",e.url)),t})();Xe(["click"]);var oR=T('<div class="flex flex-col overflow-y-auto w-full relative scrollable-container agent-chat-view scroll-smooth gap-2">'),iR=T('<div class="flex justify-end">'),aR=T('<div class="w-full flex-shrink-0 agent-bottom-spacer h-[20%]">'),sR=.6,lR=50,cR=(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}}),Qw=e=>{let t,[r,n]=Er(O([{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]=Er(O(e.initialChatReply.clientSideActions??[]),{key:`agent-${e.context.agent.id}-clientSideActions`,storage:e.context.storage}),[a,s]=Er(O(false),{key:`agent-${e.context.agent.id}-isEnded`,storage:e.context.storage}),[c,l]=O(e.initialChatReply.dynamicTheme),[u,f]=O(e.initialChatReply.agent.theme),[d,p]=O(false),[h,g]=O(),[v,b]=O(false);de(()=>{(async()=>{if(r().length>1)C();else {let E=o()?.filter(P=>lt(P.lastBubbleBlockId));await H(E);}})();});let C=()=>{[...r()].pop()?.streamingMessageId&&n(E=>E.slice(0,-1));let L=Ed({clientSideActions:o(),lastBubbleBlockId:void 0});i(E=>E.slice(L.length));},_=({id:L,message:E})=>{p(false);let P=[...r()].pop();P&&(P.streamingMessageId!==L&&n(w=>[...w,{messages:[],streamingMessageId:L}]),Du({id:L,content:E}));};_e(()=>{f(cR(e.initialChatReply.agent.theme,c()));});let k=async L=>{L&&(e.onNewLogs?.(L),!e.context.isPreview&&await _u({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:L}));},I=async L=>{b(false);let E=[...r()].pop()?.input;E?.id&&e.onAnswer&&L&&e.onAnswer({message:Ky(L),blockId:E.id});let P=setTimeout(()=>{p(true);},1e3);B();let{data:w,error:A}=await wy({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,message:dR(L)});if(clearTimeout(P),p(false),A){b(true);let M=[{description:"Failed to send the reply",details:A instanceof Pr?{status:A.response.status,body:await A.response.json()}:A,status:"error"}];await _u({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:M}),e.onNewLogs?.(M);return}if(w){if(w.progress&&e.onProgressUpdate?.(w.progress),w.lastMessageNewFormat&&Ou([...sl(),{inputIndex:[...r()].length-1,formattedMessage:w.lastMessageNewFormat}]),w.logs&&e.onNewLogs?.(w.logs),w.dynamicTheme&&l(w.dynamicTheme),w.input&&e.onNewInputBlock&&e.onNewInputBlock(w.input),w.clientSideActions){i(w.clientSideActions);let M=Ed({clientSideActions:w.clientSideActions,lastBubbleBlockId:void 0});if(await H(M),w.clientSideActions.length===1&&w.clientSideActions[0].type==="stream"&&w.messages.length===0&&w.input===void 0)return}n(M=>[...M,{input:w.input,messages:w.messages}]);}},B=(L,E=0)=>{!t||t.scrollTop+t.clientHeight<t.scrollHeight-t.clientHeight*sR||setTimeout(()=>{t?.scrollTo({top:L?L.offsetTop-E:t.scrollHeight,behavior:"smooth"});},lR);},D=async()=>{let L=[...r()].pop();L&<(L.input)&&(s(true),e.onEnd?.());},oe=async L=>{let E=Ed({clientSideActions:o(),lastBubbleBlockId:L});await H(E);},H=async L=>{for(let E of L){("streamOpenAiChatCompletion"in E||"webhookToExecute"in E||"stream"in E)&&p(true);let P=await qy({clientSideAction:E,context:{apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,resultId:e.initialChatReply.resultId},onMessageStream:_});if(i(w=>w.slice(1)),P&&"logs"in P&&k(P.logs),P&&"replyToSend"in P){p(false),I(P.replyToSend?{type:"text",value:P.replyToSend}:void 0);return}P&&"blockedPopupUrl"in P&&g(P.blockedPopupUrl),P&&"scriptCallbackMessage"in P&&e.onScriptExecutionSuccess?.(P.scriptCallbackMessage);}};he(()=>{Du(void 0),Ou([]);});let V=()=>I(void 0);return (()=>{var L=oR(),E=t;return typeof E=="function"?ye(E,L):t=L,x(L,m(Se,{get each(){return r()},children:(P,w)=>m(qw,{get index(){return w()},get messages(){return P.messages},get input(){return P.input},get theme(){return u()},get settings(){return e.initialChatReply.agent.settings},get streamingMessageId(){return P.streamingMessageId},get context(){return e.context},get hideAvatar(){return j(()=>!P.input)()&&((r()[w()+1]?.messages??[]).length>0||r()[w()+1]?.streamingMessageId!==void 0||P.messages.length>0&&d())},get hasError(){return j(()=>!!v())()&&w()===r().length-1},get isTransitionDisabled(){return w()!==r().length-1},get isOngoingLastChunk(){return j(()=>!a())()&&w()===r().length-1},onNewBubbleDisplayed:oe,onAllBubblesDisplayed:D,onSubmit:I,onScrollToBottom:B,onSkip:V})}),null),x(L,m(F,{get when(){return d()},get children(){return m(Xw,{get theme(){return u()}})}}),null),x(L,m(F,{get when(){return h()},keyed:true,children:P=>(()=>{var w=iR();return x(w,m(Zw,{url:P,onLinkClick:()=>g(void 0)})),w})()}),null),x(L,m(uR,{}),null),L})()},uR=()=>aR(),dR=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}}},Ed=({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 fR=T('<div class="h-full flex justify-center items-center flex-col"><p class="text-2xl text-center"></p><pre>'),Jw=e=>(()=>{var t=fR(),r=t.firstChild,n=r.nextSibling;return x(r,()=>e.error.message),x(n,()=>JSON.stringify(e.error.cause,null,2)),t})();var pR=T('<a target=_blank rel="noopener noreferrer"class=brand-mark id=brand-mark><span>'),e0=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 de(()=>{!document||!e.agentContainer||(r=new MutationObserver(n),r.observe(e.agentContainer,{subtree:false,childList:true}));}),he(()=>{r&&r.disconnect();}),(()=>{var o=pR(),i=o.firstChild,a=t;return typeof a=="function"?ye(a,o):t=o,x(i,()=>e.text),R(()=>z(o,"href",e.url)),o})()};var mR=T("<div class=agent-progress-bar-container><div class=agent-progress-bar>"),Id=e=>(()=>{var t=mR(),r=t.firstChild;return R(n=>(n=`${e.value}%`)!=null?r.style.setProperty("width",n):r.style.removeProperty("width")),t})();var t0=T("<style>"),gR=T("<div>"),mi=e=>{let[t,r]=O(),[n,o]=O(""),[i,a]=O(false),[s,c]=O(),l=async()=>{e.font&&Bc(e.font),a(true);let u=new URLSearchParams(location.search);e.onInit?.();let f={};u.forEach((b,C)=>{f[C]=b;});let d=typeof e.agent=="string"?e.agent:void 0,p=typeof e.agent!="string"||(e.isPreview??false),h=Om(d),{data:g,error:v}=await nm({stripeRedirectStatus:u.get("redirect_status")??void 0,agent:e.agent,apiHost:e.apiHost,isPreview:p,resultId:Le(e.resultId)?e.resultId:h,prefilledVariables:{...f,...e.prefilledVariables},startFrom:e.startFrom,sessionId:e.sessionId});if(v instanceof Pr)return p?c(new Error("\u{1F6A8} An error occurred while loading the agent.",{})):v.response.status===400||v.response.status===403?c(new Error("This agent is now closed.")):v.response.status===404?c(new Error("The agent you're looking for doesn't exist.")):c(new Error(`Something went wrong while starting the chat! (${v.response.statusText}) Please try again.`));if(v instanceof ko)return c(new Error(v.message));if(!g)return c(v&&p?new Error("Error! Could not reach server. Check your connection.",{cause:v}):new Error("Error! Could not reach server. Check your connection."));if(g.resultId&&d&&(g.agent.settings.general?.rememberUser?.isEnabled??bt.general.rememberUser.isEnabled)){h&&h!==g.resultId&&Ss(g.agent.id);let b=g.agent.settings.general?.rememberUser?.storage??bt.general.rememberUser.storage;Rm(b)(d,g.resultId);let C=Dm(g.agent.id);C&&C.agent.publishedAt&&g.agent.publishedAt?new Date(C.agent.publishedAt).getTime()===new Date(g.agent.publishedAt).getTime()?r(C):(Ss(g.agent.id),r(g),Wc(g,{agentId:g.agent.id,storage:b})):(r(g),Wc(g,{agentId:g.agent.id,storage:b})),e.onChatStatePersisted?.(true);}else {if(Ss(g.agent.id),r(g),g.input?.id&&e.onNewInputBlock&&e.onNewInputBlock(g.input),g.logs){let b=g.logs.map(C=>({status:C.status??"",description:C.description??"",details:C.details}));e.onNewLogs?.(b);}e.onChatStatePersisted?.(false);}o(g.agent.theme.customCss??"");};return _e(()=>{lt(e.agent)||i()||l().then();}),_e(()=>{lt(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),l().then()));}),he(()=>{a(false);}),[(()=>{var u=t0();return x(u,n),u})(),(()=>{var u=t0();return x(u,xy),u})(),m(F,{get when(){return s()},keyed:true,children:u=>m(Jw,{error:u})}),m(F,{get when(){return t()},keyed:true,children:u=>m(hR,{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??bt.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}})})]},hR=e=>{let[t,r]=Er(O(e.initialChatReply.progress),{storage:e.context.storage,key:`agent-${e.context.agent.id}-progressValue`}),n,o=new ResizeObserver(i=>Cm((i[0]?.target.clientWidth??0)<432));return de(()=>{n&&(am(n),o.observe(n),im(`${n.clientHeight}px`));}),_e(()=>{Bc(e.initialChatReply.agent.theme.general?.font??{type:sm,family:No}),n&&Am(e.initialChatReply.agent.theme,n,e.context.isPreview);}),he(()=>{n&&o.unobserve(n);}),(()=>{var i=gR(),a=n;return typeof a=="function"?ye(a,i):n=i,x(i,m(F,{get when(){return fe(t())&&e.initialChatReply.agent.theme.general?.progressBar?.isEnabled},get children(){return m(F,{get when(){return e.progressBarRef&&(e.initialChatReply.agent.theme.general?.progressBar?.position??ys)==="fixed"},get fallback(){return m(Id,{get value(){return t()}})},get children(){return m(Rf,{get mount(){return e.progressBarRef},get children(){return m(Id,{get value(){return t()}})}})}})}}),null),x(i,m(Qw,{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(i,m(F,{get when(){return e.initialChatReply.agent.settings.general?.isBrandingEnabled},get children(){return m(e0,{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(i,m(yu,{toaster:wn,children:s=>m(Vn.Root,{get children(){return [m(Vn.Title,{get children(){return s().title}}),m(Vn.Description,{get children(){return s().description}}),m(Vn.CloseTrigger,{class:"absolute right-2 top-2",get children(){return m($r,{class:"w-4 h-4"})}})]}})}),null),R(()=>U(i,xe("relative flex w-full h-full text-base overflow-hidden flex-col justify-center items-center agent-container",e.class))),i})()};var Yl="Zendesk Web Widget Opened";var uo='*,: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}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-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-5{right:20px}.right-\\[-4px\\]{right:-4px}.top-0{top:0}.top-1\\/2{top:50%}.top-2{top:8px}.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-1{margin-top:4px}.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-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-\\[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-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-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-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-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-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-\\[15px\\]{padding-left:15px;padding-right:15px}.py-1{padding-bottom:4px;padding-top:4px}.py-2{padding-bottom:8px;padding-top:8px}.py-4{padding-bottom:16px;padding-top:16px}.py-6{padding-bottom:24px;padding-top:24px}.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-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-bold{font-weight:700}.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-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))}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.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-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.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-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);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.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);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)}.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\\: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}}';function _n(...e){return zf(xe(e))}var yR=T('<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">'),vR=T('<img part=button-icon alt="Bubble button icon">'),r0=T("<span part=button-icon>"),xR=T('<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">'),wR=T('<img part=button-icon alt="Bubble button close icon">'),TR=T('<button part=button aria-label="Open agent">'),Ad="#0042DA",n0="#27272A",o0="#fff",ql=e=>e.startsWith("http")||e.startsWith("data:image/svg+xml"),i0=e=>(()=>{var t=TR();return t.$$click=()=>e.toggleAgent(),t.style.setProperty("z-index","99999999"),x(t,m(F,{get when(){return lt(e.customIconSrc)},keyed:true,get children(){var r=yR();return R(n=>{var o=e.iconColor??(Hr(e.backgroundColor??Ad)?n0:o0),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&&z(r,"class",n.t=i),n},{e:void 0,t:void 0}),r}}),null),x(t,m(F,{get when(){return j(()=>!!e.customIconSrc)()&&ql(e.customIconSrc)},get children(){var r=vR();return R(n=>{var o=e.customIconSrc,i=Qt("duration-200 transition",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100",fr(e.customIconSrc)?"w-[60%]":"w-full h-full",fr(e.customIconSrc)?"":"object-cover rounded-full");return o!==n.e&&z(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(F,{get when(){return j(()=>!!e.customIconSrc)()&&!ql(e.customIconSrc)},get children(){var r=r0();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),R(()=>U(r,Qt("text-4xl duration-200 transition",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100"))),r}}),null),x(t,m(F,{get when(){return lt(e.customCloseIconSrc)},get children(){var r=xR();return R(n=>{var o=e.iconColor??(Hr(e.backgroundColor??Ad)?n0:o0),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&&z(r,"class",n.t=i),n},{e:void 0,t:void 0}),r}}),null),x(t,m(F,{get when(){return j(()=>!!e.customCloseIconSrc)()&&ql(e.customCloseIconSrc)},get children(){var r=wR();return R(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",fr(e.customCloseIconSrc)?"w-[60%]":"w-full h-full",fr(e.customCloseIconSrc)?"":"object-cover rounded-full");return o!==n.e&&z(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(F,{get when(){return j(()=>!!e.customCloseIconSrc)()&&!ql(e.customCloseIconSrc)},get children(){var r=r0();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),R(()=>U(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(r=>{var n=_n("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??Ad,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})();Xe(["click"]);var CR=T("<div part=preview-message><p>"),_R=T('<img class="rounded-full w-8 h-8 object-cover"alt="Agent avatar"elementtiming="Agent avatar"fetchpriority=high>'),SR=T('<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>'),a0="#F7F8FF",s0="#303235",l0=e=>{let[t,r]=O(false),[n,o]=O({x:0,y:0}),i=s=>{o({x:s.touches[0]?.clientX??0,y:s.touches[0]?.clientY??0});},a=s=>{let c=s.changedTouches[0]?.clientX??0,l=s.changedTouches[0]?.clientY??0;(Math.abs(c-n().x)>10||l-n().y>10)&&e.onCloseClick(),o({x:0,y:0});};return (()=>{var s=CR(),c=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(kR,{get isHovered(){return t()},get previewMessageTheme(){return e.previewMessageTheme},get onClick(){return e.onCloseClick}}),c),x(s,m(F,{get when(){return e.avatarUrl},keyed:true,children:l=>(()=>{var u=_R();return z(u,"src",l),u})()}),c),x(c,()=>e.message),R(l=>{var u=_n("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"),f=e.previewMessageTheme?.backgroundColor??a0,d=e.previewMessageTheme?.textColor??s0,p=`calc(${e.buttonSize} + 32px)`;return u!==l.e&&U(s,l.e=u),f!==l.t&&((l.t=f)!=null?s.style.setProperty("background-color",f):s.style.removeProperty("background-color")),d!==l.a&&((l.a=d)!=null?s.style.setProperty("color",d):s.style.removeProperty("color")),p!==l.o&&((l.o=p)!=null?s.style.setProperty("bottom",p):s.style.removeProperty("bottom")),l},{e:void 0,t:void 0,a:void 0,o:void 0}),s})()},kR=e=>(()=>{var t=SR();return t.$$click=r=>(r.stopPropagation(),e.onClick()),R(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??a0,i=e.previewMessageTheme?.closeButtonIconColor??s0;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})();Xe(["click","touchstart","touchend"]);var PR=T("<style>"),ER=T("<div><div></div><div part=agent><div>"),IR="20px",AR="12px",u0=e=>{let[t,r]=tt(e,["onOpen","onClose","previewMessage","onPreviewMessageClick","onPreviewMessageDismissed","theme","autoShowDelay","inlineStyle"]),[n,o]=O(true),[i,a]=O(r.prefilledVariables),[s,c]=O(false),[l,u]=O({message:t.previewMessage?.message??"",avatarUrl:t.previewMessage?.avatarUrl}),[f,d]=O(false),[p,h]=O(false),[g,v]=O(true),[b,C]=O(c0(t.theme?.button?.size??"medium"));_e(()=>{C(c0(t.theme?.button?.size??"medium"));});let _;de(()=>{window.addEventListener("message",k);let w=t.autoShowDelay,A=t.previewMessage?.autoShowDelay;(_s()||So())&&I(),w&&setTimeout(()=>{I();},w),A&&setTimeout(()=>{H();},A);}),he(()=>{window.removeEventListener("message",k);}),_e(()=>{e.prefilledVariables&&a(w=>({...w,...e.prefilledVariables}));});let k=w=>{let{data:A}=w;!A.isFromAgent||A.id&&r.id!==A.id||(A.command==="open"&&I(),A.command==="close"&&B(),A.command==="toggle"&&D(),A.command==="showPreviewMessage"&&H(A.message),A.command==="hidePreviewMessage"&&V(),A.command==="setPrefilledVariables"&&a(M=>({...M,...A.variables})),A.command==="unmount"&&L());},I=()=>{p()||h(true),setTimeout(()=>{v(false);},1200),V(),d(true),f()&&t.onOpen?.();},B=()=>{d(false),Cs(),f()&&t.onClose?.();},D=()=>{f()?B():I();},oe=()=>{t.onPreviewMessageClick?.(),I();},H=w=>{w&&u(w),!f()&&c(true);},V=()=>{t.onPreviewMessageDismissed?.(),c(false);},L=()=>{f()?(B(),setTimeout(()=>{o(false);},200)):o(false);},E=w=>{r.onChatStatePersisted?.(w),w&&Ts();},P=w=>{(w===Yl||w===ei)&&L(),e.onScriptExecutionSuccess?.(w);};return m(F,{get when(){return n()},get children(){return m($n,{get value(){return document.querySelector("agent-bubble")?.shadowRoot},get children(){return [(()=>{var w=PR();return x(w,uo),w})(),(()=>{var w=ER(),A=w.firstChild,M=A.nextSibling,X=M.firstChild;x(w,m(F,{get when(){return s()},get children(){return m(l0,Oe(l,{get placement(){return t.theme?.placement},get previewMessageTheme(){return t.theme?.previewMessage},get buttonSize(){return b()},onClick:oe,onCloseClick:V}))}}),A),x(w,m(i0,Oe(()=>t.theme?.button,{get placement(){return t.theme?.placement},toggleAgent:D,get isAgentOpened(){return f()},get buttonSize(){return b()}})),A);var me=_;return typeof me=="function"?ye(me,A):_=A,M.style.setProperty("transition","transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out"),M.style.setProperty("box-shadow","rgb(0 0 0 / 16%) 0px 5px 40px"),x(M,m(F,{get when(){return p()},get children(){return m(mi,Oe(r,{onScriptExecutionSuccess:P,onChatStatePersisted:E,get prefilledVariables(){return i()},class:"rounded-lg",progressBarRef:_}))}}),X),x(X,m(ri,{})),R(ee=>{var Ue=_n(t.theme?.position!=="static"?t.theme?.placement==="left"?"z-[424242] fixed bottom-5 left-5":"z-[424242] fixed bottom-5 right-5":"relative"),Ae=t.inlineStyle,ut=`calc(100vh - ${IR} - ${b()} - ${AR})`,Nt=t.theme?.chatWindow?.maxHeight??"704px",dt=t.theme?.chatWindow?.maxWidth??"400px",Lt=t.theme?.placement==="left"?"bottom left":"bottom right",Kt=f()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",$t=t.theme?.chatWindow?.backgroundColor,Ye=_n("absolute rounded-lg w-screen bottom-[calc(100%+12px)]",f()?"opacity-1":"opacity-0 pointer-events-none",t.theme?.placement==="left"?"sm:left-0 -left-5":"sm:right-0 -right-5"),Me=_n("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 Ue!==ee.e&&U(w,ee.e=Ue),ee.t=Tc(w,Ae,ee.t),ut!==ee.a&&((ee.a=ut)!=null?M.style.setProperty("max-height",ut):M.style.removeProperty("max-height")),Nt!==ee.o&&((ee.o=Nt)!=null?M.style.setProperty("height",Nt):M.style.removeProperty("height")),dt!==ee.i&&((ee.i=dt)!=null?M.style.setProperty("max-width",dt):M.style.removeProperty("max-width")),Lt!==ee.n&&((ee.n=Lt)!=null?M.style.setProperty("transform-origin",Lt):M.style.removeProperty("transform-origin")),Kt!==ee.s&&((ee.s=Kt)!=null?M.style.setProperty("transform",Kt):M.style.removeProperty("transform")),$t!==ee.h&&((ee.h=$t)!=null?M.style.setProperty("background-color",$t):M.style.removeProperty("background-color")),Ye!==ee.r&&U(M,ee.r=Ye),Me!==ee.d&&U(X,ee.d=Me),ee},{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}),w})()]}})}})},c0=e=>e==="medium"?"48px":e==="large"?"64px":e||"48px";var OR=T("<style>"),RR=T('<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>'),d0=e=>{let[t,r]=tt(e,["onOpen","onClose","autoShowDelay","theme","isOpen","defaultOpen"]),[n,o]=O(r.prefilledVariables),[i,a]=O(t.isOpen??false);de(()=>{(t.defaultOpen||So()||_s())&&l(),window.addEventListener("message",c);let h=t.autoShowDelay;fe(h)&&setTimeout(()=>{l();},h);}),he(()=>{window.removeEventListener("message",c);}),_e(()=>{lt(e.isOpen)||e.isOpen===i()||f();}),_e(()=>{e.prefilledVariables&&o(h=>({...h,...e.prefilledVariables}));});let s=h=>{h.stopPropagation();},c=h=>{let{data:g}=h;!g.isFromAgent||g.id&&r.id!==g.id||(g.command==="open"&&l(),g.command==="close"&&u(),g.command==="toggle"&&f(),g.command==="setPrefilledVariables"&&o(v=>({...v,...g.variables})));},l=()=>{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),Cs();},f=()=>{i()?u():l();},d=h=>{r.onChatStatePersisted?.(h),h&&Ts();},p=h=>{(h===Yl||h===ei)&&u(),e.onScriptExecutionSuccess?.(h);};return m(F,{get when(){return i()},get children(){return m($n,{get value(){return document.querySelector("agent-popup")?.shadowRoot},get children(){return [(()=>{var h=OR();return x(h,uo),h})(),(()=>{var h=RR(),g=h.firstChild,v=g.nextSibling,b=v.nextSibling,C=b.firstChild,_=C.firstChild;return x(g,uo),rt(_,"pointerdown",s),x(_,m(mi,Oe(r,{onScriptExecutionSuccess:p,get prefilledVariables(){return n()},onChatStatePersisted:d}))),R(k=>{var I=e.theme?.zIndex??99999999,B="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":""),D=e.theme?.backgroundColor??"transparent",oe=e.theme?.width??"512px";return I!==k.e&&((k.e=I)!=null?h.style.setProperty("z-index",I):h.style.removeProperty("z-index")),B!==k.t&&U(_,k.t=B),D!==k.a&&((k.a=D)!=null?_.style.setProperty("background-color",D):_.style.removeProperty("background-color")),oe!==k.o&&((k.o=oe)!=null?_.style.setProperty("max-width",oe):_.style.removeProperty("max-width")),k},{e:void 0,t:void 0,a:void 0,o:void 0}),h})()]}})}})};var DR=T(`<style>
|
|
101
|
+
`).map(i=>Pd.default.sanitize(Fe.parse(i.replace(/【.+】/g,"").replace(/</g,"<").replace(/>/g,">"),{breaks:true}),{ADD_ATTR:["target"]})):[Pd.default.sanitize(Fe.parse("```"+n+"```".replace(/</g,"<").replace(/>/g,">"),{breaks:true}),{ADD_ATTR:["target"]})]).filter(Le)??[]);}),(()=>{var n=ZO(),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(Se,{get each(){return t()},children:c=>(()=>{var l=QO();return l.innerHTML=c,l})()})),n})()};var JO=T("<div><div>"),Ua=e=>{let t,[r,n]=O(0),o=new ResizeObserver(i=>n(i[0].target.clientHeight-(re()?24:40)));return de(()=>{t&&o.observe(t);}),he(()=>{t&&o.unobserve(t);}),(()=>{var i=JO(),a=i.firstChild,s=t;return typeof s=="function"?ye(s,i):t=i,x(a,m(Vl,{get theme(){return e.theme},get src(){return e.avatarSrc}})),R(c=>{var l="flex flex-shrink-0 items-center relative agent-avatar-container "+(re()?"w-6":"w-10"),u="absolute flex items-center top-0"+(re()?" w-6 h-6":" w-10 h-10")+(e.hideAvatar?" opacity-0":" opacity-100"),f=`${r()}px`,d=e.isTransitionDisabled?void 0:"top 350ms ease-out, opacity 250ms ease-out";return l!==c.e&&U(i,c.e=l),u!==c.t&&U(a,c.t=u),f!==c.a&&((c.a=f)!=null?a.style.setProperty("top",f):a.style.removeProperty("top")),d!==c.o&&((c.o=d)!=null?a.style.setProperty("transition",d):a.style.removeProperty("transition")),c},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()};var Yw=T('<div><div class="flex flex-col flex-1 gap-2">'),eR=T('<div class="flex flex-col w-full min-w-0 gap-2 agent-chat-chunk">'),qw=e=>{let t,[r,n]=O(e.isTransitionDisabled?e.messages.length:0),[o,i]=O();de(()=>{e.streamingMessageId||(e.messages.length===0&&e.onAllBubblesDisplayed(),e.onScrollToBottom(t,50));});let a=async s=>{(e.settings.typingEmulation?.delayBetweenBubbles??bt.typingEmulation.delayBetweenBubbles)>0&&r()<e.messages.length-1&&await new Promise(l=>setTimeout(l,(e.settings.typingEmulation?.delayBetweenBubbles??bt.typingEmulation.delayBetweenBubbles)*1e3));let c=e.messages[r()].id;await e.onNewBubbleDisplayed(c),n(r()===e.messages.length?r():r()+1),e.onScrollToBottom(s),r()===e.messages.length&&(i(s),e.onAllBubblesDisplayed());};return (()=>{var s=eR();return x(s,m(F,{get when(){return e.messages.length>0},get children(){var c=Yw(),l=c.firstChild;return x(c,m(F,{get when(){return (e.theme.chat?.hostAvatar?.isEnabled??Bo)&&e.messages.length>0},get children(){return m(Ua,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar},get isTransitionDisabled(){return e.isTransitionDisabled}})}}),l),x(l,m(Se,{get each(){return e.messages.slice(0,r()+1)},children:(u,f)=>m($w,{message:u,get typingEmulation(){return e.settings.typingEmulation},get isTypingSkipped(){return j(()=>!!((e.settings.typingEmulation?.isDisabledOnFirstMessage??bt.typingEmulation.isDisabledOnFirstMessage)&&e.index===0))()&&f()===0},get onTransitionEnd(){return e.isTransitionDisabled?void 0:a},get onCompleted(){return e.onSubmit}})})),R(u=>{var f="flex"+(re()?" gap-1":" gap-2"),d=e.theme.chat?.guestAvatar?.isEnabled??Fi?re()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%";return f!==u.e&&U(c,u.e=f),d!==u.t&&((u.t=d)!=null?l.style.setProperty("max-width",d):l.style.removeProperty("max-width")),u},{e:void 0,t:void 0}),c}}),null),x(s,(()=>{var c=j(()=>!!(e.input&&r()===e.messages.length));return ()=>c()&&m(_w,{get theme(){return e.theme},ref(l){var u=t;typeof u=="function"?u(l):t=l;},get block(){return e.input},get chunkIndex(){return e.index},get hasHostAvatar(){return e.theme.chat?.hostAvatar?.isEnabled??Bo},get guestAvatar(){return e.theme.chat?.guestAvatar},get context(){return e.context},get isInputPrefillEnabled(){return e.settings.general?.isInputPrefillEnabled??bt.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(F,{get when(){return e.streamingMessageId},keyed:true,children:c=>(()=>{var l=Yw(),u=l.firstChild;return x(l,m(F,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??Bo},get children(){return m(Ua,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar}})}}),u),x(u,m(Gw,{streamingMessageId:c,get context(){return e.context}})),R(f=>{var d="flex"+(re()?" gap-1":" gap-2"),p=e.theme.chat?.guestAvatar?.isEnabled??Fi?re()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%";return d!==f.e&&U(l,f.e=d),p!==f.t&&((f.t=p)!=null?u.style.setProperty("max-width",p):u.style.removeProperty("max-width")),f},{e:void 0,t:void 0}),l})()}),null),s})()};var tR=T('<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">'),Kw=()=>(()=>{var e=tR(),t=e.firstChild,r=t.firstChild,n=r.firstChild;return n.style.setProperty("width","64px"),n.style.setProperty("height","32px"),x(n,m(Vt,{})),e})();var rR=T('<div class="flex w-full agent-loading-chunk"><div class="flex flex-col w-full min-w-0"><div class="flex gap-2">'),Xw=e=>(()=>{var t=rR(),r=t.firstChild,n=r.firstChild;return x(n,m(F,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??Bo},get children(){return m(Ua,{get theme(){return e.theme},get avatarSrc(){return e.theme.chat?.hostAvatar?.url}})}}),null),x(n,m(Kw,{}),null),t})();var nR=T('<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'),Zw=e=>(()=>{var t=nR(),r=t.firstChild,n=r.nextSibling;return n.$$click=()=>e.onLinkClick(),R(()=>z(n,"href",e.url)),t})();Xe(["click"]);var oR=T('<div class="flex flex-col overflow-y-auto w-full relative scrollable-container agent-chat-view scroll-smooth gap-2">'),iR=T('<div class="flex justify-end">'),aR=T('<div class="w-full flex-shrink-0 agent-bottom-spacer h-[20%]">'),sR=.6,lR=50,cR=(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}}),Qw=e=>{let t,[r,n]=Er(O([{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]=Er(O(e.initialChatReply.clientSideActions??[]),{key:`agent-${e.context.agent.id}-clientSideActions`,storage:e.context.storage}),[a,s]=Er(O(false),{key:`agent-${e.context.agent.id}-isEnded`,storage:e.context.storage}),[c,l]=O(e.initialChatReply.dynamicTheme),[u,f]=O(e.initialChatReply.agent.theme),[d,p]=O(false),[h,g]=O(),[v,b]=O(false);de(()=>{(async()=>{if(r().length>1)C();else {let E=o()?.filter(P=>lt(P.lastBubbleBlockId));await H(E);}})();});let C=()=>{[...r()].pop()?.streamingMessageId&&n(E=>E.slice(0,-1));let L=Ed({clientSideActions:o(),lastBubbleBlockId:void 0});i(E=>E.slice(L.length));},_=({id:L,message:E})=>{p(false);let P=[...r()].pop();P&&(P.streamingMessageId!==L&&n(w=>[...w,{messages:[],streamingMessageId:L}]),Du({id:L,content:E}));};_e(()=>{f(cR(e.initialChatReply.agent.theme,c()));});let k=async L=>{L&&(e.onNewLogs?.(L),!e.context.isPreview&&await _u({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:L}));},I=async L=>{b(false);let E=[...r()].pop()?.input;E?.id&&e.onAnswer&&L&&e.onAnswer({message:Ky(L),blockId:E.id});let P=setTimeout(()=>{p(true);},1e3);B();let{data:w,error:A}=await wy({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,message:dR(L)});if(clearTimeout(P),p(false),A){b(true);let M=[{description:"Failed to send the reply",details:A instanceof Pr?{status:A.response.status,body:await A.response.json()}:A,status:"error"}];await _u({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:M}),e.onNewLogs?.(M);return}if(w){if(w.progress&&e.onProgressUpdate?.(w.progress),w.lastMessageNewFormat&&Ou([...sl(),{inputIndex:[...r()].length-1,formattedMessage:w.lastMessageNewFormat}]),w.logs&&e.onNewLogs?.(w.logs),w.dynamicTheme&&l(w.dynamicTheme),w.input&&e.onNewInputBlock&&e.onNewInputBlock(w.input),w.clientSideActions){i(w.clientSideActions);let M=Ed({clientSideActions:w.clientSideActions,lastBubbleBlockId:void 0});if(await H(M),w.clientSideActions.length===1&&w.clientSideActions[0].type==="stream"&&w.messages.length===0&&w.input===void 0)return}n(M=>[...M,{input:w.input,messages:w.messages}]);}},B=(L,E=0)=>{!t||t.scrollTop+t.clientHeight<t.scrollHeight-t.clientHeight*sR||setTimeout(()=>{t?.scrollTo({top:L?L.offsetTop-E:t.scrollHeight,behavior:"smooth"});},lR);},D=async()=>{let L=[...r()].pop();L&<(L.input)&&(s(true),e.onEnd?.());},oe=async L=>{let E=Ed({clientSideActions:o(),lastBubbleBlockId:L});await H(E);},H=async L=>{for(let E of L){("streamOpenAiChatCompletion"in E||"webhookToExecute"in E||"stream"in E)&&p(true);let P=await qy({clientSideAction:E,context:{apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,resultId:e.initialChatReply.resultId},onMessageStream:_});if(i(w=>w.slice(1)),P&&"logs"in P&&k(P.logs),P&&"replyToSend"in P){p(false),I(P.replyToSend?{type:"text",value:P.replyToSend}:void 0);return}P&&"blockedPopupUrl"in P&&g(P.blockedPopupUrl),P&&"scriptCallbackMessage"in P&&e.onScriptExecutionSuccess?.(P.scriptCallbackMessage);}};he(()=>{Du(void 0),Ou([]);});let V=()=>I(void 0);return (()=>{var L=oR(),E=t;return typeof E=="function"?ye(E,L):t=L,x(L,m(Se,{get each(){return r()},children:(P,w)=>m(qw,{get index(){return w()},get messages(){return P.messages},get input(){return P.input},get theme(){return u()},get settings(){return e.initialChatReply.agent.settings},get streamingMessageId(){return P.streamingMessageId},get context(){return e.context},get hideAvatar(){return j(()=>!P.input)()&&((r()[w()+1]?.messages??[]).length>0||r()[w()+1]?.streamingMessageId!==void 0||P.messages.length>0&&d())},get hasError(){return j(()=>!!v())()&&w()===r().length-1},get isTransitionDisabled(){return w()!==r().length-1},get isOngoingLastChunk(){return j(()=>!a())()&&w()===r().length-1},onNewBubbleDisplayed:oe,onAllBubblesDisplayed:D,onSubmit:I,onScrollToBottom:B,onSkip:V})}),null),x(L,m(F,{get when(){return d()},get children(){return m(Xw,{get theme(){return u()}})}}),null),x(L,m(F,{get when(){return h()},keyed:true,children:P=>(()=>{var w=iR();return x(w,m(Zw,{url:P,onLinkClick:()=>g(void 0)})),w})()}),null),x(L,m(uR,{}),null),L})()},uR=()=>aR(),dR=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}}},Ed=({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 fR=T('<div class="h-full flex justify-center items-center flex-col"><p class="text-2xl text-center"></p><pre>'),Jw=e=>(()=>{var t=fR(),r=t.firstChild,n=r.nextSibling;return x(r,()=>e.error.message),x(n,()=>JSON.stringify(e.error.cause,null,2)),t})();var pR=T('<a target=_blank rel="noopener noreferrer"class=brand-mark id=brand-mark><span>'),e0=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 de(()=>{!document||!e.agentContainer||(r=new MutationObserver(n),r.observe(e.agentContainer,{subtree:false,childList:true}));}),he(()=>{r&&r.disconnect();}),(()=>{var o=pR(),i=o.firstChild,a=t;return typeof a=="function"?ye(a,o):t=o,x(i,()=>e.text),R(()=>z(o,"href",e.url)),o})()};var mR=T("<div class=agent-progress-bar-container><div class=agent-progress-bar>"),Id=e=>(()=>{var t=mR(),r=t.firstChild;return R(n=>(n=`${e.value}%`)!=null?r.style.setProperty("width",n):r.style.removeProperty("width")),t})();var t0=T("<style>"),gR=T("<div>"),mi=e=>{let[t,r]=O(),[n,o]=O(""),[i,a]=O(false),[s,c]=O(),l=async()=>{e.font&&Bc(e.font),a(true);let u=new URLSearchParams(location.search);e.onInit?.();let f={};u.forEach((b,C)=>{f[C]=b;});let d=typeof e.agent=="string"?e.agent:void 0,p=typeof e.agent!="string"||(e.isPreview??false),h=Om(d),{data:g,error:v}=await nm({stripeRedirectStatus:u.get("redirect_status")??void 0,agent:e.agent,apiHost:e.apiHost,isPreview:p,resultId:Le(e.resultId)?e.resultId:h,prefilledVariables:{...f,...e.prefilledVariables},startFrom:e.startFrom,sessionId:e.sessionId});if(v instanceof Pr)return p?c(new Error("\u{1F6A8} An error occurred while loading the agent.",{})):v.response.status===400||v.response.status===403?c(new Error("This agent is now closed.")):v.response.status===404?c(new Error("The agent you're looking for doesn't exist.")):c(new Error(`Something went wrong while starting the chat! (${v.response.statusText}) Please try again.`));if(v instanceof ko)return c(new Error(v.message));if(!g)return c(v&&p?new Error("Error! Could not reach server. Check your connection.",{cause:v}):new Error("Error! Could not reach server. Check your connection."));if(g.resultId&&d&&(g.agent.settings.general?.rememberUser?.isEnabled??bt.general.rememberUser.isEnabled)){h&&h!==g.resultId&&Ss(g.agent.id);let b=g.agent.settings.general?.rememberUser?.storage??bt.general.rememberUser.storage;Rm(b)(d,g.resultId);let C=Dm(g.agent.id);C&&C.agent.publishedAt&&g.agent.publishedAt?new Date(C.agent.publishedAt).getTime()===new Date(g.agent.publishedAt).getTime()?r(C):(Ss(g.agent.id),r(g),Wc(g,{agentId:g.agent.id,storage:b})):(r(g),Wc(g,{agentId:g.agent.id,storage:b})),e.onChatStatePersisted?.(true);}else {if(Ss(g.agent.id),r(g),g.input?.id&&e.onNewInputBlock&&e.onNewInputBlock(g.input),g.logs){let b=g.logs.map(C=>({status:C.status??"",description:C.description??"",details:C.details}));e.onNewLogs?.(b);}e.onChatStatePersisted?.(false);}o(g.agent.theme.customCss??"");};return _e(()=>{lt(e.agent)||i()||l().then();}),_e(()=>{lt(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),l().then()));}),he(()=>{a(false);}),[(()=>{var u=t0();return x(u,n),u})(),(()=>{var u=t0();return x(u,xy),u})(),m(F,{get when(){return s()},keyed:true,children:u=>m(Jw,{error:u})}),m(F,{get when(){return t()},keyed:true,children:u=>m(hR,{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??bt.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}})})]},hR=e=>{let[t,r]=Er(O(e.initialChatReply.progress),{storage:e.context.storage,key:`agent-${e.context.agent.id}-progressValue`}),n,o=new ResizeObserver(i=>Cm((i[0]?.target.clientWidth??0)<432));return de(()=>{n&&(am(n),o.observe(n),im(`${n.clientHeight}px`));}),_e(()=>{Bc(e.initialChatReply.agent.theme.general?.font??{type:sm,family:No}),n&&Am(e.initialChatReply.agent.theme,n,e.context.isPreview);}),he(()=>{n&&o.unobserve(n);}),(()=>{var i=gR(),a=n;return typeof a=="function"?ye(a,i):n=i,x(i,m(F,{get when(){return fe(t())&&e.initialChatReply.agent.theme.general?.progressBar?.isEnabled},get children(){return m(F,{get when(){return e.progressBarRef&&(e.initialChatReply.agent.theme.general?.progressBar?.position??ys)==="fixed"},get fallback(){return m(Id,{get value(){return t()}})},get children(){return m(Rf,{get mount(){return e.progressBarRef},get children(){return m(Id,{get value(){return t()}})}})}})}}),null),x(i,m(Qw,{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(i,m(F,{get when(){return e.initialChatReply.agent.settings.general?.isBrandingEnabled},get children(){return m(e0,{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(i,m(yu,{toaster:wn,children:s=>m(Vn.Root,{get children(){return [m(Vn.Title,{get children(){return s().title}}),m(Vn.Description,{get children(){return s().description}}),m(Vn.CloseTrigger,{class:"absolute right-2 top-2",get children(){return m($r,{class:"w-4 h-4"})}})]}})}),null),R(()=>U(i,xe("relative flex w-full h-full text-base overflow-hidden flex-col justify-center items-center agent-container",e.class))),i})()};var Yl="Zendesk Web Widget Opened";var uo='*,: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}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-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-5{right:20px}.right-\\[-4px\\]{right:-4px}.top-0{top:0}.top-1\\/2{top:50%}.top-2{top:8px}.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-1{margin-top:4px}.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-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-\\[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-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-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-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-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-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-\\[15px\\]{padding-left:15px;padding-right:15px}.py-1{padding-bottom:4px;padding-top:4px}.py-2{padding-bottom:8px;padding-top:8px}.py-4{padding-bottom:16px;padding-top:16px}.py-6{padding-bottom:24px;padding-top:24px}.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-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-bold{font-weight:700}.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-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))}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.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-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.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-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);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.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);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)}.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\\: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}}';function _n(...e){return zf(xe(e))}var yR=T('<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">'),vR=T('<img part=button-icon alt="Bubble button icon">'),r0=T("<span part=button-icon>"),xR=T('<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">'),wR=T('<img part=button-icon alt="Bubble button close icon">'),TR=T('<button part=button aria-label="Open agent">'),Ad="#0042DA",n0="#27272A",o0="#fff",ql=e=>e.startsWith("http")||e.startsWith("data:image/svg+xml"),i0=e=>(()=>{var t=TR();return t.$$click=()=>e.toggleAgent(),t.style.setProperty("z-index","99999999"),x(t,m(F,{get when(){return lt(e.customIconSrc)},keyed:true,get children(){var r=yR();return R(n=>{var o=e.iconColor??(Hr(e.backgroundColor??Ad)?n0:o0),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&&z(r,"class",n.t=i),n},{e:void 0,t:void 0}),r}}),null),x(t,m(F,{get when(){return j(()=>!!e.customIconSrc)()&&ql(e.customIconSrc)},get children(){var r=vR();return R(n=>{var o=e.customIconSrc,i=Qt("duration-200 transition",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100",fr(e.customIconSrc)?"w-[60%]":"w-full h-full",fr(e.customIconSrc)?"":"object-cover rounded-full");return o!==n.e&&z(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(F,{get when(){return j(()=>!!e.customIconSrc)()&&!ql(e.customIconSrc)},get children(){var r=r0();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),R(()=>U(r,Qt("text-4xl duration-200 transition",e.isAgentOpened?"scale-0 opacity-0":"scale-100 opacity-100"))),r}}),null),x(t,m(F,{get when(){return lt(e.customCloseIconSrc)},get children(){var r=xR();return R(n=>{var o=e.iconColor??(Hr(e.backgroundColor??Ad)?n0:o0),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&&z(r,"class",n.t=i),n},{e:void 0,t:void 0}),r}}),null),x(t,m(F,{get when(){return j(()=>!!e.customCloseIconSrc)()&&ql(e.customCloseIconSrc)},get children(){var r=wR();return R(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",fr(e.customCloseIconSrc)?"w-[60%]":"w-full h-full",fr(e.customCloseIconSrc)?"":"object-cover rounded-full");return o!==n.e&&z(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(F,{get when(){return j(()=>!!e.customCloseIconSrc)()&&!ql(e.customCloseIconSrc)},get children(){var r=r0();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),R(()=>U(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(r=>{var n=_n("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??Ad,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})();Xe(["click"]);var CR=T("<div part=preview-message><p>"),_R=T('<img class="rounded-full w-8 h-8 object-cover"alt="Agent avatar"elementtiming="Agent avatar"fetchpriority=high>'),SR=T('<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>'),a0="#F7F8FF",s0="#303235",l0=e=>{let[t,r]=O(false),[n,o]=O({x:0,y:0}),i=s=>{o({x:s.touches[0]?.clientX??0,y:s.touches[0]?.clientY??0});},a=s=>{let c=s.changedTouches[0]?.clientX??0,l=s.changedTouches[0]?.clientY??0;(Math.abs(c-n().x)>10||l-n().y>10)&&e.onCloseClick(),o({x:0,y:0});};return (()=>{var s=CR(),c=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(kR,{get isHovered(){return t()},get previewMessageTheme(){return e.previewMessageTheme},get onClick(){return e.onCloseClick}}),c),x(s,m(F,{get when(){return e.avatarUrl},keyed:true,children:l=>(()=>{var u=_R();return z(u,"src",l),u})()}),c),x(c,()=>e.message),R(l=>{var u=_n("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"),f=e.previewMessageTheme?.backgroundColor??a0,d=e.previewMessageTheme?.textColor??s0,p=`calc(${e.buttonSize} + 32px)`;return u!==l.e&&U(s,l.e=u),f!==l.t&&((l.t=f)!=null?s.style.setProperty("background-color",f):s.style.removeProperty("background-color")),d!==l.a&&((l.a=d)!=null?s.style.setProperty("color",d):s.style.removeProperty("color")),p!==l.o&&((l.o=p)!=null?s.style.setProperty("bottom",p):s.style.removeProperty("bottom")),l},{e:void 0,t:void 0,a:void 0,o:void 0}),s})()},kR=e=>(()=>{var t=SR();return t.$$click=r=>(r.stopPropagation(),e.onClick()),R(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??a0,i=e.previewMessageTheme?.closeButtonIconColor??s0;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})();Xe(["click","touchstart","touchend"]);var PR=T("<style>"),ER=T("<div><div></div><div part=agent><div>"),IR="20px",AR="12px",u0=e=>{let[t,r]=tt(e,["onOpen","onClose","previewMessage","onPreviewMessageClick","onPreviewMessageDismissed","theme","autoShowDelay","inlineStyle"]),[n,o]=O(true),[i,a]=O(r.prefilledVariables),[s,c]=O(false),[l,u]=O({message:t.previewMessage?.message??"",avatarUrl:t.previewMessage?.avatarUrl}),[f,d]=O(false),[p,h]=O(false),[g,v]=O(true),[b,C]=O(c0(t.theme?.button?.size??"medium"));_e(()=>{C(c0(t.theme?.button?.size??"medium"));});let _;de(()=>{window.addEventListener("message",k);let w=t.autoShowDelay,A=t.previewMessage?.autoShowDelay;(_s()||So())&&I(),w&&setTimeout(()=>{I();},w),A&&setTimeout(()=>{H();},A);}),he(()=>{window.removeEventListener("message",k);}),_e(()=>{e.prefilledVariables&&a(w=>({...w,...e.prefilledVariables}));});let k=w=>{let{data:A}=w;!A.isFromAgent||A.id&&r.id!==A.id||(A.command==="open"&&I(),A.command==="close"&&B(),A.command==="toggle"&&D(),A.command==="showPreviewMessage"&&H(A.message),A.command==="hidePreviewMessage"&&V(),A.command==="setPrefilledVariables"&&a(M=>({...M,...A.variables})),A.command==="unmount"&&L());},I=()=>{p()||h(true),setTimeout(()=>{v(false);},1200),V(),d(true),f()&&t.onOpen?.();},B=()=>{d(false),Cs(),f()&&t.onClose?.();},D=()=>{f()?B():I();},oe=()=>{t.onPreviewMessageClick?.(),I();},H=w=>{f()||(w&&u(w),c(true));},V=()=>{t.onPreviewMessageDismissed?.(),c(false);},L=()=>{f()?(B(),setTimeout(()=>{o(false);},200)):o(false);},E=w=>{r.onChatStatePersisted?.(w),w&&Ts();},P=w=>{(w===Yl||w===ei)&&L(),e.onScriptExecutionSuccess?.(w);};return m(F,{get when(){return n()},get children(){return m($n,{get value(){return document.querySelector("agent-bubble")?.shadowRoot},get children(){return [(()=>{var w=PR();return x(w,uo),w})(),(()=>{var w=ER(),A=w.firstChild,M=A.nextSibling,X=M.firstChild;x(w,m(F,{get when(){return s()},get children(){return m(l0,Oe(l,{get placement(){return t.theme?.placement},get previewMessageTheme(){return t.theme?.previewMessage},get buttonSize(){return b()},onClick:oe,onCloseClick:V}))}}),A),x(w,m(i0,Oe(()=>t.theme?.button,{get placement(){return t.theme?.placement},toggleAgent:D,get isAgentOpened(){return f()},get buttonSize(){return b()}})),A);var me=_;return typeof me=="function"?ye(me,A):_=A,M.style.setProperty("transition","transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out"),M.style.setProperty("box-shadow","rgb(0 0 0 / 16%) 0px 5px 40px"),x(M,m(F,{get when(){return p()},get children(){return m(mi,Oe(r,{onScriptExecutionSuccess:P,onChatStatePersisted:E,get prefilledVariables(){return i()},class:"rounded-lg",progressBarRef:_}))}}),X),x(X,m(ri,{})),R(ee=>{var Ue=_n(t.theme?.position!=="static"?t.theme?.placement==="left"?"z-[424242] fixed bottom-5 left-5":"z-[424242] fixed bottom-5 right-5":"relative"),Ae=t.inlineStyle,ut=`calc(100vh - ${IR} - ${b()} - ${AR})`,Nt=t.theme?.chatWindow?.maxHeight??"704px",dt=t.theme?.chatWindow?.maxWidth??"400px",Lt=t.theme?.placement==="left"?"bottom left":"bottom right",Kt=f()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",$t=t.theme?.chatWindow?.backgroundColor,Ye=_n("absolute rounded-lg w-screen bottom-[calc(100%+12px)]",f()?"opacity-1":"opacity-0 pointer-events-none",t.theme?.placement==="left"?"sm:left-0 -left-5":"sm:right-0 -right-5"),Me=_n("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 Ue!==ee.e&&U(w,ee.e=Ue),ee.t=Tc(w,Ae,ee.t),ut!==ee.a&&((ee.a=ut)!=null?M.style.setProperty("max-height",ut):M.style.removeProperty("max-height")),Nt!==ee.o&&((ee.o=Nt)!=null?M.style.setProperty("height",Nt):M.style.removeProperty("height")),dt!==ee.i&&((ee.i=dt)!=null?M.style.setProperty("max-width",dt):M.style.removeProperty("max-width")),Lt!==ee.n&&((ee.n=Lt)!=null?M.style.setProperty("transform-origin",Lt):M.style.removeProperty("transform-origin")),Kt!==ee.s&&((ee.s=Kt)!=null?M.style.setProperty("transform",Kt):M.style.removeProperty("transform")),$t!==ee.h&&((ee.h=$t)!=null?M.style.setProperty("background-color",$t):M.style.removeProperty("background-color")),Ye!==ee.r&&U(M,ee.r=Ye),Me!==ee.d&&U(X,ee.d=Me),ee},{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}),w})()]}})}})},c0=e=>e==="medium"?"48px":e==="large"?"64px":e||"48px";var OR=T("<style>"),RR=T('<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>'),d0=e=>{let[t,r]=tt(e,["onOpen","onClose","autoShowDelay","theme","isOpen","defaultOpen"]),[n,o]=O(r.prefilledVariables),[i,a]=O(t.isOpen??false);de(()=>{(t.defaultOpen||So()||_s())&&l(),window.addEventListener("message",c);let h=t.autoShowDelay;fe(h)&&setTimeout(()=>{l();},h);}),he(()=>{window.removeEventListener("message",c);}),_e(()=>{lt(e.isOpen)||e.isOpen===i()||f();}),_e(()=>{e.prefilledVariables&&o(h=>({...h,...e.prefilledVariables}));});let s=h=>{h.stopPropagation();},c=h=>{let{data:g}=h;!g.isFromAgent||g.id&&r.id!==g.id||(g.command==="open"&&l(),g.command==="close"&&u(),g.command==="toggle"&&f(),g.command==="setPrefilledVariables"&&o(v=>({...v,...g.variables})));},l=()=>{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),Cs();},f=()=>{i()?u():l();},d=h=>{r.onChatStatePersisted?.(h),h&&Ts();},p=h=>{(h===Yl||h===ei)&&u(),e.onScriptExecutionSuccess?.(h);};return m(F,{get when(){return i()},get children(){return m($n,{get value(){return document.querySelector("agent-popup")?.shadowRoot},get children(){return [(()=>{var h=OR();return x(h,uo),h})(),(()=>{var h=RR(),g=h.firstChild,v=g.nextSibling,b=v.nextSibling,C=b.firstChild,_=C.firstChild;return x(g,uo),rt(_,"pointerdown",s),x(_,m(mi,Oe(r,{onScriptExecutionSuccess:p,get prefilledVariables(){return n()},onChatStatePersisted:d}))),R(k=>{var I=e.theme?.zIndex??99999999,B="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":""),D=e.theme?.backgroundColor??"transparent",oe=e.theme?.width??"512px";return I!==k.e&&((k.e=I)!=null?h.style.setProperty("z-index",I):h.style.removeProperty("z-index")),B!==k.t&&U(_,k.t=B),D!==k.a&&((k.a=D)!=null?_.style.setProperty("background-color",D):_.style.removeProperty("background-color")),oe!==k.o&&((k.o=oe)!=null?_.style.setProperty("max-width",oe):_.style.removeProperty("max-width")),k},{e:void 0,t:void 0,a:void 0,o:void 0}),h})()]}})}})};var DR=T(`<style>
|
|
102
102
|
:host {
|
|
103
103
|
display: block;
|
|
104
104
|
width: 100%;
|
|
105
105
|
height: 100%;
|
|
106
106
|
overflow-y: hidden;
|
|
107
107
|
}
|
|
108
|
-
`);var f0=(e,{element:t})=>{let[r,n]=O(false),[o,i]=O(e.prefilledVariables),a=()=>{n(true);},s=new IntersectionObserver(l=>{l.some(u=>u.isIntersecting)&&a();});de(()=>{window.addEventListener("message",c),s.observe(t);}),_e(()=>{e.prefilledVariables&&i(l=>({...l,...e.prefilledVariables}));});let c=l=>{let{data:u}=l;!u.isFromAgent||u.id&&e.id!==u.id||u.command==="setPrefilledVariables"&&i(f=>({...f,...u.variables}));};return he(()=>{s.disconnect();}),m($n,{get value(){return document.querySelector("agent-standard")?.shadowRoot},get children(){return [(()=>{var l=DR(),u=l.firstChild;return x(l,uo,u),l})(),m(F,{get when(){return r()},get children(){return m(mi,Oe(e,{get prefilledVariables(){return o()}}))}})]}})};var p0=()=>{typeof window>"u"||(is("agent-standard",as,f0),is("agent-bubble",Nf,u0),is("agent-popup",Mf,d0));};var m0=({id:e}={})=>{let t={isFromAgent:true,command:"close",id:e};window.postMessage(t);};var g0=({id:e}={})=>{let t={isFromAgent:true,command:"hidePreviewMessage",id:e};window.postMessage(t);};var h0=({id:e}={})=>{let t={isFromAgent:true,command:"open",id:e};window.postMessage(t);};var b0=(e,{id:t}={})=>{let r={isFromAgent:true,command:"setInputValue",value:e,id:t};window.postMessage(r);};var y0=(e,{id:t}={})=>{let r={isFromAgent:true,command:"setPrefilledVariables",variables:e,id:t};window.postMessage(r);};var v0=(e,{id:t}={})=>{let r={isFromAgent:true,command:"showPreviewMessage",message:e,id:t};window.postMessage(r);};var x0=({id:e}={})=>{let t={isFromAgent:true,command:"toggle",id:e};window.postMessage(t);};var w0=({id:e}={})=>{let t={isFromAgent:true,command:"unmount",id:e};window.postMessage(t);};var MR=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);},NR=e=>{let t=document.createElement("agent-popup");Object.assign(t,e),document.body.prepend(t);},LR=e=>{let t=document.createElement("agent-bubble");Object.assign(t,e),document.body.prepend(t);},T0=()=>({initStandard:MR,initPopup:NR,initBubble:LR,close:m0,hidePreviewMessage:g0,open:h0,setPrefilledVariables:y0,showPreviewMessage:v0,toggle:x0,setInputValue:b0,unmount:w0}),C0=e=>{typeof window>"u"||(window.Agent={...e});};p0();var _0=T0();C0(_0);var
|
|
108
|
+
`);var f0=(e,{element:t})=>{let[r,n]=O(false),[o,i]=O(e.prefilledVariables),a=()=>{n(true);},s=new IntersectionObserver(l=>{l.some(u=>u.isIntersecting)&&a();});de(()=>{window.addEventListener("message",c),s.observe(t);}),_e(()=>{e.prefilledVariables&&i(l=>({...l,...e.prefilledVariables}));});let c=l=>{let{data:u}=l;!u.isFromAgent||u.id&&e.id!==u.id||u.command==="setPrefilledVariables"&&i(f=>({...f,...u.variables}));};return he(()=>{s.disconnect();}),m($n,{get value(){return document.querySelector("agent-standard")?.shadowRoot},get children(){return [(()=>{var l=DR(),u=l.firstChild;return x(l,uo,u),l})(),m(F,{get when(){return r()},get children(){return m(mi,Oe(e,{get prefilledVariables(){return o()}}))}})]}})};var p0=()=>{typeof window>"u"||(is("agent-standard",as,f0),is("agent-bubble",Nf,u0),is("agent-popup",Mf,d0));};var m0=({id:e}={})=>{let t={isFromAgent:true,command:"close",id:e};window.postMessage(t);};var g0=({id:e}={})=>{let t={isFromAgent:true,command:"hidePreviewMessage",id:e};window.postMessage(t);};var h0=({id:e}={})=>{let t={isFromAgent:true,command:"open",id:e};window.postMessage(t);};var b0=(e,{id:t}={})=>{let r={isFromAgent:true,command:"setInputValue",value:e,id:t};window.postMessage(r);};var y0=(e,{id:t}={})=>{let r={isFromAgent:true,command:"setPrefilledVariables",variables:e,id:t};window.postMessage(r);};var v0=(e,{id:t}={})=>{let r={isFromAgent:true,command:"showPreviewMessage",message:e,id:t};window.postMessage(r);};var x0=({id:e}={})=>{let t={isFromAgent:true,command:"toggle",id:e};window.postMessage(t);};var w0=({id:e}={})=>{let t={isFromAgent:true,command:"unmount",id:e};window.postMessage(t);};var MR=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);},NR=e=>{let t=document.createElement("agent-popup");Object.assign(t,e),document.body.prepend(t);},LR=e=>{let t=document.createElement("agent-bubble");Object.assign(t,e),document.body.prepend(t);},T0=()=>({initStandard:MR,initPopup:NR,initBubble:LR,close:m0,hidePreviewMessage:g0,open:h0,setPrefilledVariables:y0,showPreviewMessage:v0,toggle:x0,setInputValue:b0,unmount:w0}),C0=e=>{typeof window>"u"||(window.Agent={...e});};p0();var _0=T0();C0(_0);var Koe=_0;/*! Bundled license information:
|
|
109
109
|
|
|
110
110
|
@noble/hashes/utils.js:
|
|
111
111
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
@@ -137,4 +137,4 @@ partysocket/dist/chunk-4SNNYC7I.mjs:
|
|
|
137
137
|
*)
|
|
138
138
|
*/
|
|
139
139
|
|
|
140
|
-
export {
|
|
140
|
+
export { Koe as default };
|