@voxket-ai/voxket-live 1.0.98 → 1.0.100

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.
Files changed (3) hide show
  1. package/dist/index.cjs +462 -33
  2. package/dist/index.js +2074 -1645
  3. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -1,31 +1,31 @@
1
- "use strict";var Od=Object.defineProperty;var Ld=(e,t,n)=>t in e?Od(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Se=(e,t,n)=>Ld(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=require("react"),l=require("react/jsx-runtime"),Z=require("livekit-client"),Ne=require("@livekit/components-react"),Dr=require("class-variance-authority"),$r=require("clsx"),_d=require("@radix-ui/react-toggle"),Bd=require("@radix-ui/react-select"),je=require("lucide-react"),zd=require("@emotion/styled");require("@emotion/react");const Hd=require("react-dom/client");function Fr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const p=Fr(C),Ud=Fr(_d),ze=Fr(Bd),Or=C.createContext({});function Lr(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const _r=typeof window<"u",Ga=_r?C.useLayoutEffect:C.useEffect,ls=C.createContext(null);function Br(e,t){e.indexOf(t)===-1&&e.push(t)}function zr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const rt=(e,t,n)=>n>t?t:n<e?e:n;function or(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let qt=()=>{},ot=()=>{};process.env.NODE_ENV!=="production"&&(qt=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(or(t,n))},ot=(e,t,n)=>{if(!e)throw new Error(or(t,n))});const it={},Ka=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Ya(e){return typeof e=="object"&&e!==null}const qa=e=>/^0[^.\s]+$/u.test(e);function Hr(e){let t;return()=>(t===void 0&&(t=e()),t)}const He=e=>e,Zd=(e,t)=>n=>t(e(n)),Tn=(...e)=>e.reduce(Zd),xn=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class Ur{constructor(){this.subscriptions=[]}add(t){return Br(this.subscriptions,t),()=>zr(this.subscriptions,t)}notify(t,n,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,s);else for(let o=0;o<r;o++){const i=this.subscriptions[o];i&&i(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ge=e=>e*1e3,Xe=e=>e/1e3;function Xa(e,t){return t?e*(1e3/t):0}const Fo=new Set;function Zr(e,t,n){e||Fo.has(t)||(console.warn(or(t,n)),Fo.add(t))}const Ja=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Wd=1e-7,Gd=12;function Kd(e,t,n,s,r){let o,i,a=0;do i=t+(n-t)/2,o=Ja(i,s,r)-e,o>0?n=i:t=i;while(Math.abs(o)>Wd&&++a<Gd);return i}function En(e,t,n,s){if(e===t&&n===s)return He;const r=o=>Kd(o,0,1,e,n);return o=>o===0||o===1?o:Ja(r(o),t,s)}const Qa=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ec=e=>t=>1-e(1-t),tc=En(.33,1.53,.69,.99),Wr=ec(tc),nc=Qa(Wr),sc=e=>(e*=2)<1?.5*Wr(e):.5*(2-Math.pow(2,-10*(e-1))),Gr=e=>1-Math.sin(Math.acos(e)),rc=ec(Gr),oc=Qa(Gr),Yd=En(.42,0,1,1),qd=En(0,0,.58,1),ic=En(.42,0,.58,1),Xd=e=>Array.isArray(e)&&typeof e[0]!="number",ac=e=>Array.isArray(e)&&typeof e[0]=="number",Oo={linear:He,easeIn:Yd,easeInOut:ic,easeOut:qd,circIn:Gr,circInOut:oc,circOut:rc,backIn:Wr,backInOut:nc,backOut:tc,anticipate:sc},Jd=e=>typeof e=="string",Lo=e=>{if(ac(e)){ot(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,s,r]=e;return En(t,n,s,r)}else if(Jd(e))return ot(Oo[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Oo[e];return e},Dn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Qd(e,t){let n=new Set,s=new Set,r=!1,o=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){i.has(u)&&(d.schedule(u),e()),u(a)}const d={schedule:(u,f=!1,h=!1)=>{const x=h&&r?n:s;return f&&i.add(u),x.has(u)||x.add(u),u},cancel:u=>{s.delete(u),i.delete(u)},process:u=>{if(a=u,r){o=!0;return}r=!0,[n,s]=[s,n],n.forEach(c),n.clear(),r=!1,o&&(o=!1,d.process(u))}};return d}const eu=40;function cc(e,t){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Dn.reduce((T,w)=>(T[w]=Qd(o),T),{}),{setup:a,read:c,resolveKeyframes:d,preUpdate:u,update:f,preRender:h,render:g,postRender:x}=i,m=()=>{const T=it.useManualTiming?r.timestamp:performance.now();n=!1,it.useManualTiming||(r.delta=s?1e3/60:Math.max(Math.min(T-r.timestamp,eu),1)),r.timestamp=T,r.isProcessing=!0,a.process(r),c.process(r),d.process(r),u.process(r),f.process(r),h.process(r),g.process(r),x.process(r),r.isProcessing=!1,n&&t&&(s=!1,e(m))},b=()=>{n=!0,s=!0,r.isProcessing||e(m)};return{schedule:Dn.reduce((T,w)=>{const S=i[w];return T[w]=(A,M=!1,j=!1)=>(n||b(),S.schedule(A,M,j)),T},{}),cancel:T=>{for(let w=0;w<Dn.length;w++)i[Dn[w]].cancel(T)},state:r,steps:i}}const{schedule:ye,cancel:ut,state:Pe,steps:Ms}=cc(typeof requestAnimationFrame<"u"?requestAnimationFrame:He,!0);let Gn;function tu(){Gn=void 0}const $e={now:()=>(Gn===void 0&&$e.set(Pe.isProcessing||it.useManualTiming?Pe.timestamp:performance.now()),Gn),set:e=>{Gn=e,queueMicrotask(tu)}},lc=e=>t=>typeof t=="string"&&t.startsWith(e),Kr=lc("--"),nu=lc("var(--"),Yr=e=>nu(e)?su.test(e.split("/*")[0].trim()):!1,su=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Xt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},bn={...Xt,transform:e=>rt(0,1,e)},$n={...Xt,default:1},fn=e=>Math.round(e*1e5)/1e5,qr=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ru(e){return e==null}const ou=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Xr=(e,t)=>n=>!!(typeof n=="string"&&ou.test(n)&&n.startsWith(e)||t&&!ru(n)&&Object.prototype.hasOwnProperty.call(n,t)),dc=(e,t,n)=>s=>{if(typeof s!="string")return s;const[r,o,i,a]=s.match(qr);return{[e]:parseFloat(r),[t]:parseFloat(o),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},iu=e=>rt(0,255,e),Ps={...Xt,transform:e=>Math.round(iu(e))},vt={test:Xr("rgb","red"),parse:dc("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Ps.transform(e)+", "+Ps.transform(t)+", "+Ps.transform(n)+", "+fn(bn.transform(s))+")"};function au(e){let t="",n="",s="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,s+=s,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const ir={test:Xr("#"),parse:au,transform:vt.transform},An=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),lt=An("deg"),Je=An("%"),Q=An("px"),cu=An("vh"),lu=An("vw"),_o={...Je,parse:e=>Je.parse(e)/100,transform:e=>Je.transform(e*100)},Ft={test:Xr("hsl","hue"),parse:dc("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+Je.transform(fn(t))+", "+Je.transform(fn(n))+", "+fn(bn.transform(s))+")"},Ae={test:e=>vt.test(e)||ir.test(e)||Ft.test(e),parse:e=>vt.test(e)?vt.parse(e):Ft.test(e)?Ft.parse(e):ir.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?vt.transform(e):Ft.transform(e),getAnimatableNone:e=>{const t=Ae.parse(e);return t.alpha=0,Ae.transform(t)}},du=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function uu(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(qr))==null?void 0:t.length)||0)+(((n=e.match(du))==null?void 0:n.length)||0)>0}const uc="number",fc="color",fu="var",hu="var(",Bo="${}",mu=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function vn(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},r=[];let o=0;const a=t.replace(mu,c=>(Ae.test(c)?(s.color.push(o),r.push(fc),n.push(Ae.parse(c))):c.startsWith(hu)?(s.var.push(o),r.push(fu),n.push(c)):(s.number.push(o),r.push(uc),n.push(parseFloat(c))),++o,Bo)).split(Bo);return{values:n,split:a,indexes:s,types:r}}function hc(e){return vn(e).values}function mc(e){const{split:t,types:n}=vn(e),s=t.length;return r=>{let o="";for(let i=0;i<s;i++)if(o+=t[i],r[i]!==void 0){const a=n[i];a===uc?o+=fn(r[i]):a===fc?o+=Ae.transform(r[i]):o+=r[i]}return o}}const pu=e=>typeof e=="number"?0:Ae.test(e)?Ae.getAnimatableNone(e):e;function gu(e){const t=hc(e);return mc(e)(t.map(pu))}const ft={test:uu,parse:hc,createTransformer:mc,getAnimatableNone:gu};function Vs(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function yu({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let r=0,o=0,i=0;if(!t)r=o=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;r=Vs(c,a,e+1/3),o=Vs(c,a,e),i=Vs(c,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:s}}function es(e,t){return n=>n>0?t:e}const ve=(e,t,n)=>e+(t-e)*n,Ns=(e,t,n)=>{const s=e*e,r=n*(t*t-s)+s;return r<0?0:Math.sqrt(r)},xu=[ir,vt,Ft],bu=e=>xu.find(t=>t.test(e));function zo(e){const t=bu(e);if(qt(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===Ft&&(n=yu(n)),n}const Ho=(e,t)=>{const n=zo(e),s=zo(t);if(!n||!s)return es(e,t);const r={...n};return o=>(r.red=Ns(n.red,s.red,o),r.green=Ns(n.green,s.green,o),r.blue=Ns(n.blue,s.blue,o),r.alpha=ve(n.alpha,s.alpha,o),vt.transform(r))},ar=new Set(["none","hidden"]);function vu(e,t){return ar.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function wu(e,t){return n=>ve(e,t,n)}function Jr(e){return typeof e=="number"?wu:typeof e=="string"?Yr(e)?es:Ae.test(e)?Ho:ku:Array.isArray(e)?pc:typeof e=="object"?Ae.test(e)?Ho:Su:es}function pc(e,t){const n=[...e],s=n.length,r=e.map((o,i)=>Jr(o)(o,t[i]));return o=>{for(let i=0;i<s;i++)n[i]=r[i](o);return n}}function Su(e,t){const n={...e,...t},s={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(s[r]=Jr(e[r])(e[r],t[r]));return r=>{for(const o in s)n[o]=s[o](r);return n}}function Cu(e,t){const n=[],s={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const o=t.types[r],i=e.indexes[o][s[o]],a=e.values[i]??0;n[r]=a,s[o]++}return n}const ku=(e,t)=>{const n=ft.createTransformer(t),s=vn(e),r=vn(t);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?ar.has(e)&&!r.values.length||ar.has(t)&&!s.values.length?vu(e,t):Tn(pc(Cu(s,r),r.values),n):(qt(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),es(e,t))};function gc(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ve(e,t,n):Jr(e)(e,t)}const Tu=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ye.update(t,n),stop:()=>ut(t),now:()=>Pe.isProcessing?Pe.timestamp:$e.now()}},yc=(e,t,n=10)=>{let s="";const r=Math.max(Math.round(t/n),2);for(let o=0;o<r;o++)s+=Math.round(e(o/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},ts=2e4;function Qr(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<ts;)t+=n,s=e.next(t);return t>=ts?1/0:t}function Eu(e,t=100,n){const s=n({...e,keyframes:[0,t]}),r=Math.min(Qr(s),ts);return{type:"keyframes",ease:o=>s.next(r*o).value/t,duration:Xe(r)}}const Au=5;function xc(e,t,n){const s=Math.max(t-Au,0);return Xa(n-e(s),t-s)}const be={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Rs=.001;function ju({duration:e=be.duration,bounce:t=be.bounce,velocity:n=be.velocity,mass:s=be.mass}){let r,o;qt(e<=Ge(be.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=rt(be.minDamping,be.maxDamping,i),e=rt(be.minDuration,be.maxDuration,Xe(e)),i<1?(r=d=>{const u=d*i,f=u*e,h=u-n,g=cr(d,i),x=Math.exp(-f);return Rs-h/g*x},o=d=>{const f=d*i*e,h=f*n+n,g=Math.pow(i,2)*Math.pow(d,2)*e,x=Math.exp(-f),m=cr(Math.pow(d,2),i);return(-r(d)+Rs>0?-1:1)*((h-g)*x)/m}):(r=d=>{const u=Math.exp(-d*e),f=(d-n)*e+1;return-Rs+u*f},o=d=>{const u=Math.exp(-d*e),f=(n-d)*(e*e);return u*f});const a=5/e,c=Pu(r,o,a);if(e=Ge(e),isNaN(c))return{stiffness:be.stiffness,damping:be.damping,duration:e};{const d=Math.pow(c,2)*s;return{stiffness:d,damping:i*2*Math.sqrt(s*d),duration:e}}}const Mu=12;function Pu(e,t,n){let s=n;for(let r=1;r<Mu;r++)s=s-e(s)/t(s);return s}function cr(e,t){return e*Math.sqrt(1-t*t)}const Vu=["duration","bounce"],Nu=["stiffness","damping","mass"];function Uo(e,t){return t.some(n=>e[n]!==void 0)}function Ru(e){let t={velocity:be.velocity,stiffness:be.stiffness,damping:be.damping,mass:be.mass,isResolvedFromDuration:!1,...e};if(!Uo(e,Nu)&&Uo(e,Vu))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),r=s*s,o=2*rt(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:be.mass,stiffness:r,damping:o}}else{const n=ju(e);t={...t,...n,mass:be.mass},t.isResolvedFromDuration=!0}return t}function ns(e=be.visualDuration,t=be.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:r}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:c,damping:d,mass:u,duration:f,velocity:h,isResolvedFromDuration:g}=Ru({...n,velocity:-Xe(n.velocity||0)}),x=h||0,m=d/(2*Math.sqrt(c*u)),b=i-o,k=Xe(Math.sqrt(c/u)),v=Math.abs(b)<5;s||(s=v?be.restSpeed.granular:be.restSpeed.default),r||(r=v?be.restDelta.granular:be.restDelta.default);let T;if(m<1){const S=cr(k,m);T=A=>{const M=Math.exp(-m*k*A);return i-M*((x+m*k*b)/S*Math.sin(S*A)+b*Math.cos(S*A))}}else if(m===1)T=S=>i-Math.exp(-k*S)*(b+(x+k*b)*S);else{const S=k*Math.sqrt(m*m-1);T=A=>{const M=Math.exp(-m*k*A),j=Math.min(S*A,300);return i-M*((x+m*k*b)*Math.sinh(j)+S*b*Math.cosh(j))/S}}const w={calculatedDuration:g&&f||null,next:S=>{const A=T(S);if(g)a.done=S>=f;else{let M=S===0?x:0;m<1&&(M=S===0?Ge(x):xc(T,S,A));const j=Math.abs(M)<=s,z=Math.abs(i-A)<=r;a.done=j&&z}return a.value=a.done?i:A,a},toString:()=>{const S=Math.min(Qr(w),ts),A=yc(M=>w.next(S*M).value,S,30);return S+"ms "+A},toTransition:()=>{}};return w}ns.applyToOptions=e=>{const t=Eu(e,100,ns);return e.ease=t.ease,e.duration=Ge(t.duration),e.type="keyframes",e};function lr({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:i,min:a,max:c,restDelta:d=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},g=j=>a!==void 0&&j<a||c!==void 0&&j>c,x=j=>a===void 0?c:c===void 0||Math.abs(a-j)<Math.abs(c-j)?a:c;let m=n*t;const b=f+m,k=i===void 0?b:i(b);k!==b&&(m=k-f);const v=j=>-m*Math.exp(-j/s),T=j=>k+v(j),w=j=>{const z=v(j),y=T(j);h.done=Math.abs(z)<=d,h.value=h.done?k:y};let S,A;const M=j=>{g(h.value)&&(S=j,A=ns({keyframes:[h.value,x(h.value)],velocity:xc(T,j,h.value),damping:r,stiffness:o,restDelta:d,restSpeed:u}))};return M(0),{calculatedDuration:null,next:j=>{let z=!1;return!A&&S===void 0&&(z=!0,w(j),M(j)),S!==void 0&&j>=S?A.next(j-S):(!z&&w(j),h)}}}function Iu(e,t,n){const s=[],r=n||it.mix||gc,o=e.length-1;for(let i=0;i<o;i++){let a=r(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||He:t;a=Tn(c,a)}s.push(a)}return s}function Du(e,t,{clamp:n=!0,ease:s,mixer:r}={}){const o=e.length;if(ot(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Iu(t,s,r),c=a.length,d=u=>{if(i&&u<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=xn(e[f],e[f+1],u);return a[f](h)};return n?u=>d(rt(e[0],e[o-1],u)):d}function $u(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const r=xn(0,t,s);e.push(ve(n,1,r))}}function Fu(e){const t=[0];return $u(t,e.length-1),t}function Ou(e,t){return e.map(n=>n*t)}function Lu(e,t){return e.map(()=>t||ic).splice(0,e.length-1)}function Ot({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const r=Xd(s)?s.map(Lo):Lo(s),o={done:!1,value:t[0]},i=Ou(n&&n.length===t.length?n:Fu(t),e),a=Du(i,t,{ease:Array.isArray(r)?r:Lu(t,r)});return{calculatedDuration:e,next:c=>(o.value=a(c),o.done=c>=e,o)}}const _u=e=>e!==null;function eo(e,{repeat:t,repeatType:n="loop"},s,r=1){const o=e.filter(_u),a=r<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const Bu={decay:lr,inertia:lr,tween:Ot,keyframes:Ot,spring:ns};function bc(e){typeof e.type=="string"&&(e.type=Bu[e.type])}class to{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const zu=e=>e/100;class no extends to{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,r;const{motionValue:n}=this.options;n&&n.updatedAt!==$e.now()&&this.tick($e.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(s=this.options).onStop)==null||r.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;bc(t);const{type:n=Ot,repeat:s=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=t;let{keyframes:a}=t;const c=n||Ot;process.env.NODE_ENV!=="production"&&c!==Ot&&ot(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==Ot&&typeof a[0]!="number"&&(this.mixKeyframes=Tn(zu,gc(a[0],a[1])),a=[0,100]);const d=c({...t,keyframes:a});o==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),d.calculatedDuration===null&&(d.calculatedDuration=Qr(d));const{calculatedDuration:u}=d;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=d}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:r,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:d=0,keyframes:u,repeat:f,repeatType:h,repeatDelay:g,type:x,onUpdate:m,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const k=this.currentTime-d*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?k<0:k>r;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let T=this.currentTime,w=s;if(f){const j=Math.min(this.currentTime,r)/a;let z=Math.floor(j),y=j%1;!y&&j>=1&&(y=1),y===1&&z--,z=Math.min(z,f+1),!!(z%2)&&(h==="reverse"?(y=1-y,g&&(y-=g/a)):h==="mirror"&&(w=i)),T=rt(0,1,y)*a}const S=v?{done:!1,value:u[0]}:w.next(T);o&&(S.value=o(S.value));let{done:A}=S;!v&&c!==null&&(A=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return M&&x!==lr&&(S.value=eo(u,this.options,b,this.speed)),m&&m(S.value),M&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return Xe(this.calculatedDuration)}get time(){return Xe(this.currentTime)}set time(t){var n;t=Ge(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime($e.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Xe(this.currentTime))}play(){var r,o;if(this.isStopped)return;const{driver:t=Tu,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(r=this.options).onPlay)==null||o.call(r);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime($e.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function Hu(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const wt=e=>e*180/Math.PI,dr=e=>{const t=wt(Math.atan2(e[1],e[0]));return ur(t)},Uu={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:dr,rotateZ:dr,skewX:e=>wt(Math.atan(e[1])),skewY:e=>wt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ur=e=>(e=e%360,e<0&&(e+=360),e),Zo=dr,Wo=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Go=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Zu={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Wo,scaleY:Go,scale:e=>(Wo(e)+Go(e))/2,rotateX:e=>ur(wt(Math.atan2(e[6],e[5]))),rotateY:e=>ur(wt(Math.atan2(-e[2],e[0]))),rotateZ:Zo,rotate:Zo,skewX:e=>wt(Math.atan(e[4])),skewY:e=>wt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function fr(e){return e.includes("scale")?1:0}function hr(e,t){if(!e||e==="none")return fr(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=Zu,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Uu,r=a}if(!r)return fr(t);const o=s[t],i=r[1].split(",").map(Gu);return typeof o=="function"?o(i):i[o]}const Wu=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return hr(n,t)};function Gu(e){return parseFloat(e.trim())}const Jt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Qt=new Set(Jt),Ko=e=>e===Xt||e===Q,Ku=new Set(["x","y","z"]),Yu=Jt.filter(e=>!Ku.has(e));function qu(e){const t=[];return Yu.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const Ct={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>hr(t,"x"),y:(e,{transform:t})=>hr(t,"y")};Ct.translateX=Ct.x;Ct.translateY=Ct.y;const kt=new Set;let mr=!1,pr=!1,gr=!1;function vc(){if(pr){const e=Array.from(kt).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const r=qu(s);r.length&&(n.set(s,r),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const r=n.get(s);r&&r.forEach(([o,i])=>{var a;(a=s.getValue(o))==null||a.set(i)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}pr=!1,mr=!1,kt.forEach(e=>e.complete(gr)),kt.clear()}function wc(){kt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(pr=!0)})}function Xu(){gr=!0,wc(),vc(),gr=!1}class so{constructor(t,n,s,r,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(kt.add(this),mr||(mr=!0,ye.read(wc),ye.resolveKeyframes(vc))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:r}=this;if(t[0]===null){const o=r==null?void 0:r.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&n){const a=s.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),r&&o===void 0&&r.set(t[0])}Hu(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),kt.delete(this)}cancel(){this.state==="scheduled"&&(kt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Ju=e=>e.startsWith("--");function Qu(e,t,n){Ju(t)?e.style.setProperty(t,n):e.style[t]=n}const ef=Hr(()=>window.ScrollTimeline!==void 0),tf={};function nf(e,t){const n=Hr(e);return()=>tf[t]??n()}const Sc=nf(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ln=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,Yo={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ln([0,.65,.55,1]),circOut:ln([.55,0,1,.45]),backIn:ln([.31,.01,.66,-.59]),backOut:ln([.33,1.53,.69,.99])};function Cc(e,t){if(e)return typeof e=="function"?Sc()?yc(e,t):"ease-out":ac(e)?ln(e):Array.isArray(e)?e.map(n=>Cc(n,t)||Yo.easeOut):Yo[e]}function sf(e,t,n,{delay:s=0,duration:r=300,repeat:o=0,repeatType:i="loop",ease:a="easeOut",times:c}={},d=void 0){const u={[t]:n};c&&(u.offset=c);const f=Cc(a,r);Array.isArray(f)&&(u.easing=f);const h={delay:s,duration:r,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return d&&(h.pseudoElement=d),e.animate(u,h)}function kc(e){return typeof e=="function"&&"applyToOptions"in e}function rf({type:e,...t}){return kc(e)&&Sc()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class of extends to{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:s,keyframes:r,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,ot(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const d=rf(t);this.animation=sf(n,s,r,d,o),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=eo(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Qu(n,s,u),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return Xe(Number(t))}get time(){return Xe(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Ge(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&ef()?(this.animation.timeline=t,He):n(this)}}const Tc={anticipate:sc,backInOut:nc,circInOut:oc};function af(e){return e in Tc}function cf(e){typeof e.ease=="string"&&af(e.ease)&&(e.ease=Tc[e.ease])}const qo=10;class lf extends of{constructor(t){cf(t),bc(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:r,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new no({...i,autoplay:!1}),c=Ge(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-qo).value,a.sample(c).value,qo),a.stop()}}const Xo=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ft.test(e)||e==="0")&&!e.startsWith("url("));function df(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function uf(e,t,n,s){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=Xo(r,t),a=Xo(o,t);return qt(i===a,`You are trying to animate ${t} from "${r}" to "${o}". "${i?o:r}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:df(e)||(n==="spring"||kc(n))&&s}function yr(e){e.duration=0,e.type}const ff=new Set(["opacity","clipPath","filter","transform"]),hf=Hr(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function mf(e){var u;const{motionValue:t,name:n,repeatDelay:s,repeatType:r,damping:o,type:i}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=t.owner.getProps();return hf()&&n&&ff.has(n)&&(n!=="transform"||!d)&&!c&&!s&&r!=="mirror"&&o!==0&&i!=="inertia"}const pf=40;class gf extends to{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",keyframes:a,name:c,motionValue:d,element:u,...f}){var x;super(),this.stop=()=>{var m,b;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=$e.now();const h={autoplay:t,delay:n,type:s,repeat:r,repeatDelay:o,repeatType:i,name:c,motionValue:d,element:u,...f},g=(u==null?void 0:u.KeyframeResolver)||so;this.keyframeResolver=new g(a,(m,b,k)=>this.onKeyframesResolved(m,b,h,!k),c,d,u),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(t,n,s,r){this.keyframeResolver=void 0;const{name:o,type:i,velocity:a,delay:c,isHandoff:d,onUpdate:u}=s;this.resolvedAt=$e.now(),uf(t,o,i,a)||((it.instantAnimations||!c)&&(u==null||u(eo(t,s,n))),t[0]=t[t.length-1],yr(s),s.repeat=0);const h={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>pf?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},g=!d&&mf(h)?new lf({...h,element:h.motionValue.owner.current}):new no(h);g.finished.then(()=>this.notifyFinished()).catch(He),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Xu()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const yf=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xf(e){const t=yf.exec(e);if(!t)return[,];const[,n,s,r]=t;return[`--${n??s}`,r]}const bf=4;function Ec(e,t,n=1){ot(n<=bf,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=xf(e);if(!s)return;const o=window.getComputedStyle(t).getPropertyValue(s);if(o){const i=o.trim();return Ka(i)?parseFloat(i):i}return Yr(r)?Ec(r,t,n+1):r}function ro(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Ac=new Set(["width","height","top","left","right","bottom",...Jt]),vf={test:e=>e==="auto",parse:e=>e},jc=e=>t=>t.test(e),Mc=[Xt,Q,Je,lt,lu,cu,vf],Jo=e=>Mc.find(jc(e));function wf(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||qa(e):!0}const Sf=new Set(["brightness","contrast","saturate","opacity"]);function Cf(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(qr)||[];if(!s)return e;const r=n.replace(s,"");let o=Sf.has(t)?1:0;return s!==n&&(o*=100),t+"("+o+r+")"}const kf=/\b([a-z-]*)\(.*?\)/gu,xr={...ft,getAnimatableNone:e=>{const t=e.match(kf);return t?t.map(Cf).join(" "):e}},Qo={...Xt,transform:Math.round},Tf={rotate:lt,rotateX:lt,rotateY:lt,rotateZ:lt,scale:$n,scaleX:$n,scaleY:$n,scaleZ:$n,skew:lt,skewX:lt,skewY:lt,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:bn,originX:_o,originY:_o,originZ:Q},oo={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,radius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,top:Q,right:Q,bottom:Q,left:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,backgroundPositionX:Q,backgroundPositionY:Q,...Tf,zIndex:Qo,fillOpacity:bn,strokeOpacity:bn,numOctaves:Qo},Ef={...oo,color:Ae,backgroundColor:Ae,outlineColor:Ae,fill:Ae,stroke:Ae,borderColor:Ae,borderTopColor:Ae,borderRightColor:Ae,borderBottomColor:Ae,borderLeftColor:Ae,filter:xr,WebkitFilter:xr},Pc=e=>Ef[e];function Vc(e,t){let n=Pc(e);return n!==xr&&(n=ft),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Af=new Set(["auto","none","0"]);function jf(e,t,n){let s=0,r;for(;s<e.length&&!r;){const o=e[s];typeof o=="string"&&!Af.has(o)&&vn(o).values.length&&(r=e[s]),s++}if(r&&n)for(const o of t)e[o]=Vc(n,r)}class Mf extends so{constructor(t,n,s,r,o){super(t,n,s,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let d=t[c];if(typeof d=="string"&&(d=d.trim(),Yr(d))){const u=Ec(d,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Ac.has(s)||t.length!==2)return;const[r,o]=t,i=Jo(r),a=Jo(o);if(i!==a)if(Ko(i)&&Ko(a))for(let c=0;c<t.length;c++){const d=t[c];typeof d=="string"&&(t[c]=parseFloat(d))}else Ct[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let r=0;r<t.length;r++)(t[r]===null||wf(t[r]))&&s.push(r);s.length&&jf(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ct[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(s,r).jump(r,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=s.length-1,i=s[o];s[o]=Ct[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,d])=>{t.getValue(c).set(d)}),this.resolveNoneKeyframes()}}function Pf(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const r=(n==null?void 0:n[e])??s.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}const Nc=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Rc(e){return Ya(e)&&"offsetHeight"in e}const ei=30,Vf=e=>!isNaN(parseFloat(e));class Nf{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var o;const r=$e.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=$e.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Vf(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Zr(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ur);const s=this.events[t].add(n);return t==="change"?()=>{s(),ye.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=$e.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ei)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ei);return Xa(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Wt(e,t){return new Nf(e,t)}const{schedule:io}=cc(queueMicrotask,!1),We={x:!1,y:!1};function Ic(){return We.x||We.y}function Rf(e){return e==="x"||e==="y"?We[e]?null:(We[e]=!0,()=>{We[e]=!1}):We.x||We.y?null:(We.x=We.y=!0,()=>{We.x=We.y=!1})}function Dc(e,t){const n=Pf(e),s=new AbortController,r={passive:!0,...t,signal:s.signal};return[n,r,()=>s.abort()]}function ti(e){return!(e.pointerType==="touch"||Ic())}function If(e,t,n={}){const[s,r,o]=Dc(e,n),i=a=>{if(!ti(a))return;const{target:c}=a,d=t(c,a);if(typeof d!="function"||!c)return;const u=f=>{ti(f)&&(d(f),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,r)};return s.forEach(a=>{a.addEventListener("pointerenter",i,r)}),o}const $c=(e,t)=>t?e===t?!0:$c(e,t.parentElement):!1,ao=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Df=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function $f(e){return Df.has(e.tagName)||e.tabIndex!==-1}const Kn=new WeakSet;function ni(e){return t=>{t.key==="Enter"&&e(t)}}function Is(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Ff=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=ni(()=>{if(Kn.has(n))return;Is(n,"down");const r=ni(()=>{Is(n,"up")}),o=()=>Is(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function si(e){return ao(e)&&!Ic()}function Of(e,t,n={}){const[s,r,o]=Dc(e,n),i=a=>{const c=a.currentTarget;if(!si(a))return;Kn.add(c);const d=t(c,a),u=(g,x)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Kn.has(c)&&Kn.delete(c),si(g)&&typeof d=="function"&&d(g,{success:x})},f=g=>{u(g,c===window||c===document||n.useGlobalTarget||$c(c,g.target))},h=g=>{u(g,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,r),Rc(a)&&(a.addEventListener("focus",d=>Ff(d,r)),!$f(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function Fc(e){return Ya(e)&&"ownerSVGElement"in e}function Lf(e){return Fc(e)&&e.tagName==="svg"}const Re=e=>!!(e&&e.getVelocity),_f=[...Mc,Ae,ft],Bf=e=>_f.find(jc(e)),co=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class zf extends p.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const s=n.offsetParent,r=Rc(s)&&s.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=r-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Hf({children:e,isPresent:t,anchorX:n,root:s}){const r=C.useId(),o=C.useRef(null),i=C.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=C.useContext(co);return C.useInsertionEffect(()=>{const{width:c,height:d,top:u,left:f,right:h}=i.current;if(t||!o.current||!c||!d)return;const g=n==="left"?`left: ${f}`:`right: ${h}`;o.current.dataset.motionPopId=r;const x=document.createElement("style");a&&(x.nonce=a);const m=s??document.head;return m.appendChild(x),x.sheet&&x.sheet.insertRule(`
2
- [data-motion-pop-id="${r}"] {
1
+ "use strict";var Od=Object.defineProperty;var Ld=(e,t,n)=>t in e?Od(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Se=(e,t,n)=>Ld(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=require("react"),l=require("react/jsx-runtime"),Z=require("livekit-client"),Ne=require("@livekit/components-react"),Ds=require("class-variance-authority"),$s=require("clsx"),_d=require("@radix-ui/react-toggle"),Bd=require("@radix-ui/react-select"),je=require("lucide-react"),zd=require("@emotion/styled");require("@emotion/react");const Ud=require("react-dom/client");function Fs(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const g=Fs(C),Hd=Fs(_d),ze=Fs(Bd),Os=C.createContext({});function Ls(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const _s=typeof window<"u",Ga=_s?C.useLayoutEffect:C.useEffect,lr=C.createContext(null);function Bs(e,t){e.indexOf(t)===-1&&e.push(t)}function zs(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const st=(e,t,n)=>n>t?t:n<e?e:n;function os(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let qt=()=>{},ot=()=>{};process.env.NODE_ENV!=="production"&&(qt=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(os(t,n))},ot=(e,t,n)=>{if(!e)throw new Error(os(t,n))});const it={},Ka=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Ya(e){return typeof e=="object"&&e!==null}const qa=e=>/^0[^.\s]+$/u.test(e);function Us(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ue=e=>e,Zd=(e,t)=>n=>t(e(n)),En=(...e)=>e.reduce(Zd),xn=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Hs{constructor(){this.subscriptions=[]}add(t){return Bs(this.subscriptions,t),()=>zs(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;o<s;o++){const i=this.subscriptions[o];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ge=e=>e*1e3,Xe=e=>e/1e3;function Xa(e,t){return t?e*(1e3/t):0}const Fo=new Set;function Zs(e,t,n){e||Fo.has(t)||(console.warn(os(t,n)),Fo.add(t))}const Ja=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Wd=1e-7,Gd=12;function Kd(e,t,n,r,s){let o,i,a=0;do i=t+(n-t)/2,o=Ja(i,r,s)-e,o>0?n=i:t=i;while(Math.abs(o)>Wd&&++a<Gd);return i}function Tn(e,t,n,r){if(e===t&&n===r)return Ue;const s=o=>Kd(o,0,1,e,n);return o=>o===0||o===1?o:Ja(s(o),t,r)}const Qa=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ec=e=>t=>1-e(1-t),tc=Tn(.33,1.53,.69,.99),Ws=ec(tc),nc=Qa(Ws),rc=e=>(e*=2)<1?.5*Ws(e):.5*(2-Math.pow(2,-10*(e-1))),Gs=e=>1-Math.sin(Math.acos(e)),sc=ec(Gs),oc=Qa(Gs),Yd=Tn(.42,0,1,1),qd=Tn(0,0,.58,1),ic=Tn(.42,0,.58,1),Xd=e=>Array.isArray(e)&&typeof e[0]!="number",ac=e=>Array.isArray(e)&&typeof e[0]=="number",Oo={linear:Ue,easeIn:Yd,easeInOut:ic,easeOut:qd,circIn:Gs,circInOut:oc,circOut:sc,backIn:Ws,backInOut:nc,backOut:tc,anticipate:rc},Jd=e=>typeof e=="string",Lo=e=>{if(ac(e)){ot(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,s]=e;return Tn(t,n,r,s)}else if(Jd(e))return ot(Oo[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Oo[e];return e},Dn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Qd(e,t){let n=new Set,r=new Set,s=!1,o=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){i.has(u)&&(d.schedule(u),e()),u(a)}const d={schedule:(u,f=!1,h=!1)=>{const x=h&&s?n:r;return f&&i.add(u),x.has(u)||x.add(u),u},cancel:u=>{r.delete(u),i.delete(u)},process:u=>{if(a=u,s){o=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),n.clear(),s=!1,o&&(o=!1,d.process(u))}};return d}const eu=40;function cc(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Dn.reduce((E,w)=>(E[w]=Qd(o),E),{}),{setup:a,read:c,resolveKeyframes:d,preUpdate:u,update:f,preRender:h,render:p,postRender:x}=i,m=()=>{const E=it.useManualTiming?s.timestamp:performance.now();n=!1,it.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(E-s.timestamp,eu),1)),s.timestamp=E,s.isProcessing=!0,a.process(s),c.process(s),d.process(s),u.process(s),f.process(s),h.process(s),p.process(s),x.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(m))},b=()=>{n=!0,r=!0,s.isProcessing||e(m)};return{schedule:Dn.reduce((E,w)=>{const S=i[w];return E[w]=(A,M=!1,j=!1)=>(n||b(),S.schedule(A,M,j)),E},{}),cancel:E=>{for(let w=0;w<Dn.length;w++)i[Dn[w]].cancel(E)},state:s,steps:i}}const{schedule:ye,cancel:ut,state:Pe,steps:Mr}=cc(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ue,!0);let Gn;function tu(){Gn=void 0}const $e={now:()=>(Gn===void 0&&$e.set(Pe.isProcessing||it.useManualTiming?Pe.timestamp:performance.now()),Gn),set:e=>{Gn=e,queueMicrotask(tu)}},lc=e=>t=>typeof t=="string"&&t.startsWith(e),Ks=lc("--"),nu=lc("var(--"),Ys=e=>nu(e)?ru.test(e.split("/*")[0].trim()):!1,ru=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Xt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},bn={...Xt,transform:e=>st(0,1,e)},$n={...Xt,default:1},fn=e=>Math.round(e*1e5)/1e5,qs=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function su(e){return e==null}const ou=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Xs=(e,t)=>n=>!!(typeof n=="string"&&ou.test(n)&&n.startsWith(e)||t&&!su(n)&&Object.prototype.hasOwnProperty.call(n,t)),dc=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,a]=r.match(qs);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},iu=e=>st(0,255,e),Pr={...Xt,transform:e=>Math.round(iu(e))},vt={test:Xs("rgb","red"),parse:dc("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Pr.transform(e)+", "+Pr.transform(t)+", "+Pr.transform(n)+", "+fn(bn.transform(r))+")"};function au(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const is={test:Xs("#"),parse:au,transform:vt.transform},An=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),lt=An("deg"),Je=An("%"),Q=An("px"),cu=An("vh"),lu=An("vw"),_o={...Je,parse:e=>Je.parse(e)/100,transform:e=>Je.transform(e*100)},Ft={test:Xs("hsl","hue"),parse:dc("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Je.transform(fn(t))+", "+Je.transform(fn(n))+", "+fn(bn.transform(r))+")"},Ae={test:e=>vt.test(e)||is.test(e)||Ft.test(e),parse:e=>vt.test(e)?vt.parse(e):Ft.test(e)?Ft.parse(e):is.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?vt.transform(e):Ft.transform(e),getAnimatableNone:e=>{const t=Ae.parse(e);return t.alpha=0,Ae.transform(t)}},du=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function uu(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(qs))==null?void 0:t.length)||0)+(((n=e.match(du))==null?void 0:n.length)||0)>0}const uc="number",fc="color",fu="var",hu="var(",Bo="${}",mu=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function vn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const a=t.replace(mu,c=>(Ae.test(c)?(r.color.push(o),s.push(fc),n.push(Ae.parse(c))):c.startsWith(hu)?(r.var.push(o),s.push(fu),n.push(c)):(r.number.push(o),s.push(uc),n.push(parseFloat(c))),++o,Bo)).split(Bo);return{values:n,split:a,indexes:r,types:s}}function hc(e){return vn(e).values}function mc(e){const{split:t,types:n}=vn(e),r=t.length;return s=>{let o="";for(let i=0;i<r;i++)if(o+=t[i],s[i]!==void 0){const a=n[i];a===uc?o+=fn(s[i]):a===fc?o+=Ae.transform(s[i]):o+=s[i]}return o}}const gu=e=>typeof e=="number"?0:Ae.test(e)?Ae.getAnimatableNone(e):e;function pu(e){const t=hc(e);return mc(e)(t.map(gu))}const ft={test:uu,parse:hc,createTransformer:mc,getAnimatableNone:pu};function Vr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function yu({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,i=0;if(!t)s=o=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;s=Vr(c,a,e+1/3),o=Vr(c,a,e),i=Vr(c,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function er(e,t){return n=>n>0?t:e}const ve=(e,t,n)=>e+(t-e)*n,Nr=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},xu=[is,vt,Ft],bu=e=>xu.find(t=>t.test(e));function zo(e){const t=bu(e);if(qt(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===Ft&&(n=yu(n)),n}const Uo=(e,t)=>{const n=zo(e),r=zo(t);if(!n||!r)return er(e,t);const s={...n};return o=>(s.red=Nr(n.red,r.red,o),s.green=Nr(n.green,r.green,o),s.blue=Nr(n.blue,r.blue,o),s.alpha=ve(n.alpha,r.alpha,o),vt.transform(s))},as=new Set(["none","hidden"]);function vu(e,t){return as.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function wu(e,t){return n=>ve(e,t,n)}function Js(e){return typeof e=="number"?wu:typeof e=="string"?Ys(e)?er:Ae.test(e)?Uo:ku:Array.isArray(e)?gc:typeof e=="object"?Ae.test(e)?Uo:Su:er}function gc(e,t){const n=[...e],r=n.length,s=e.map((o,i)=>Js(o)(o,t[i]));return o=>{for(let i=0;i<r;i++)n[i]=s[i](o);return n}}function Su(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Js(e[s])(e[s],t[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function Cu(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],i=e.indexes[o][r[o]],a=e.values[i]??0;n[s]=a,r[o]++}return n}const ku=(e,t)=>{const n=ft.createTransformer(t),r=vn(e),s=vn(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?as.has(e)&&!s.values.length||as.has(t)&&!r.values.length?vu(e,t):En(gc(Cu(r,s),s.values),n):(qt(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),er(e,t))};function pc(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ve(e,t,n):Js(e)(e,t)}const Eu=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ye.update(t,n),stop:()=>ut(t),now:()=>Pe.isProcessing?Pe.timestamp:$e.now()}},yc=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)r+=Math.round(e(o/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},tr=2e4;function Qs(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<tr;)t+=n,r=e.next(t);return t>=tr?1/0:t}function Tu(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Qs(r),tr);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:Xe(s)}}const Au=5;function xc(e,t,n){const r=Math.max(t-Au,0);return Xa(n-e(r),t-r)}const be={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Rr=.001;function ju({duration:e=be.duration,bounce:t=be.bounce,velocity:n=be.velocity,mass:r=be.mass}){let s,o;qt(e<=Ge(be.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=st(be.minDamping,be.maxDamping,i),e=st(be.minDuration,be.maxDuration,Xe(e)),i<1?(s=d=>{const u=d*i,f=u*e,h=u-n,p=cs(d,i),x=Math.exp(-f);return Rr-h/p*x},o=d=>{const f=d*i*e,h=f*n+n,p=Math.pow(i,2)*Math.pow(d,2)*e,x=Math.exp(-f),m=cs(Math.pow(d,2),i);return(-s(d)+Rr>0?-1:1)*((h-p)*x)/m}):(s=d=>{const u=Math.exp(-d*e),f=(d-n)*e+1;return-Rr+u*f},o=d=>{const u=Math.exp(-d*e),f=(n-d)*(e*e);return u*f});const a=5/e,c=Pu(s,o,a);if(e=Ge(e),isNaN(c))return{stiffness:be.stiffness,damping:be.damping,duration:e};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:i*2*Math.sqrt(r*d),duration:e}}}const Mu=12;function Pu(e,t,n){let r=n;for(let s=1;s<Mu;s++)r=r-e(r)/t(r);return r}function cs(e,t){return e*Math.sqrt(1-t*t)}const Vu=["duration","bounce"],Nu=["stiffness","damping","mass"];function Ho(e,t){return t.some(n=>e[n]!==void 0)}function Ru(e){let t={velocity:be.velocity,stiffness:be.stiffness,damping:be.damping,mass:be.mass,isResolvedFromDuration:!1,...e};if(!Ho(e,Nu)&&Ho(e,Vu))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*st(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:be.mass,stiffness:s,damping:o}}else{const n=ju(e);t={...t,...n,mass:be.mass},t.isResolvedFromDuration=!0}return t}function nr(e=be.visualDuration,t=be.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:c,damping:d,mass:u,duration:f,velocity:h,isResolvedFromDuration:p}=Ru({...n,velocity:-Xe(n.velocity||0)}),x=h||0,m=d/(2*Math.sqrt(c*u)),b=i-o,k=Xe(Math.sqrt(c/u)),v=Math.abs(b)<5;r||(r=v?be.restSpeed.granular:be.restSpeed.default),s||(s=v?be.restDelta.granular:be.restDelta.default);let E;if(m<1){const S=cs(k,m);E=A=>{const M=Math.exp(-m*k*A);return i-M*((x+m*k*b)/S*Math.sin(S*A)+b*Math.cos(S*A))}}else if(m===1)E=S=>i-Math.exp(-k*S)*(b+(x+k*b)*S);else{const S=k*Math.sqrt(m*m-1);E=A=>{const M=Math.exp(-m*k*A),j=Math.min(S*A,300);return i-M*((x+m*k*b)*Math.sinh(j)+S*b*Math.cosh(j))/S}}const w={calculatedDuration:p&&f||null,next:S=>{const A=E(S);if(p)a.done=S>=f;else{let M=S===0?x:0;m<1&&(M=S===0?Ge(x):xc(E,S,A));const j=Math.abs(M)<=r,z=Math.abs(i-A)<=s;a.done=j&&z}return a.value=a.done?i:A,a},toString:()=>{const S=Math.min(Qs(w),tr),A=yc(M=>w.next(S*M).value,S,30);return S+"ms "+A},toTransition:()=>{}};return w}nr.applyToOptions=e=>{const t=Tu(e,100,nr);return e.ease=t.ease,e.duration=Ge(t.duration),e.type="keyframes",e};function ls({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:a,max:c,restDelta:d=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},p=j=>a!==void 0&&j<a||c!==void 0&&j>c,x=j=>a===void 0?c:c===void 0||Math.abs(a-j)<Math.abs(c-j)?a:c;let m=n*t;const b=f+m,k=i===void 0?b:i(b);k!==b&&(m=k-f);const v=j=>-m*Math.exp(-j/r),E=j=>k+v(j),w=j=>{const z=v(j),y=E(j);h.done=Math.abs(z)<=d,h.value=h.done?k:y};let S,A;const M=j=>{p(h.value)&&(S=j,A=nr({keyframes:[h.value,x(h.value)],velocity:xc(E,j,h.value),damping:s,stiffness:o,restDelta:d,restSpeed:u}))};return M(0),{calculatedDuration:null,next:j=>{let z=!1;return!A&&S===void 0&&(z=!0,w(j),M(j)),S!==void 0&&j>=S?A.next(j-S):(!z&&w(j),h)}}}function Iu(e,t,n){const r=[],s=n||it.mix||pc,o=e.length-1;for(let i=0;i<o;i++){let a=s(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||Ue:t;a=En(c,a)}r.push(a)}return r}function Du(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const o=e.length;if(ot(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Iu(t,r,s),c=a.length,d=u=>{if(i&&u<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=xn(e[f],e[f+1],u);return a[f](h)};return n?u=>d(st(e[0],e[o-1],u)):d}function $u(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=xn(0,t,r);e.push(ve(n,1,s))}}function Fu(e){const t=[0];return $u(t,e.length-1),t}function Ou(e,t){return e.map(n=>n*t)}function Lu(e,t){return e.map(()=>t||ic).splice(0,e.length-1)}function Ot({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=Xd(r)?r.map(Lo):Lo(r),o={done:!1,value:t[0]},i=Ou(n&&n.length===t.length?n:Fu(t),e),a=Du(i,t,{ease:Array.isArray(s)?s:Lu(t,s)});return{calculatedDuration:e,next:c=>(o.value=a(c),o.done=c>=e,o)}}const _u=e=>e!==null;function eo(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(_u),a=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!a||r===void 0?o[a]:r}const Bu={decay:ls,inertia:ls,tween:Ot,keyframes:Ot,spring:nr};function bc(e){typeof e.type=="string"&&(e.type=Bu[e.type])}class to{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const zu=e=>e/100;class no extends to{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==$e.now()&&this.tick($e.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;bc(t);const{type:n=Ot,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=t;let{keyframes:a}=t;const c=n||Ot;process.env.NODE_ENV!=="production"&&c!==Ot&&ot(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==Ot&&typeof a[0]!="number"&&(this.mixKeyframes=En(zu,pc(a[0],a[1])),a=[0,100]);const d=c({...t,keyframes:a});o==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),d.calculatedDuration===null&&(d.calculatedDuration=Qs(d));const{calculatedDuration:u}=d;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:u,repeat:f,repeatType:h,repeatDelay:p,type:x,onUpdate:m,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const k=this.currentTime-d*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?k<0:k>s;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let E=this.currentTime,w=r;if(f){const j=Math.min(this.currentTime,s)/a;let z=Math.floor(j),y=j%1;!y&&j>=1&&(y=1),y===1&&z--,z=Math.min(z,f+1),!!(z%2)&&(h==="reverse"?(y=1-y,p&&(y-=p/a)):h==="mirror"&&(w=i)),E=st(0,1,y)*a}const S=v?{done:!1,value:u[0]}:w.next(E);o&&(S.value=o(S.value));let{done:A}=S;!v&&c!==null&&(A=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return M&&x!==ls&&(S.value=eo(u,this.options,b,this.speed)),m&&m(S.value),M&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return Xe(this.calculatedDuration)}get time(){return Xe(this.currentTime)}set time(t){var n;t=Ge(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime($e.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Xe(this.currentTime))}play(){var s,o;if(this.isStopped)return;const{driver:t=Eu,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(s=this.options).onPlay)==null||o.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime($e.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function Uu(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const wt=e=>e*180/Math.PI,ds=e=>{const t=wt(Math.atan2(e[1],e[0]));return us(t)},Hu={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ds,rotateZ:ds,skewX:e=>wt(Math.atan(e[1])),skewY:e=>wt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},us=e=>(e=e%360,e<0&&(e+=360),e),Zo=ds,Wo=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Go=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Zu={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Wo,scaleY:Go,scale:e=>(Wo(e)+Go(e))/2,rotateX:e=>us(wt(Math.atan2(e[6],e[5]))),rotateY:e=>us(wt(Math.atan2(-e[2],e[0]))),rotateZ:Zo,rotate:Zo,skewX:e=>wt(Math.atan(e[4])),skewY:e=>wt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function fs(e){return e.includes("scale")?1:0}function hs(e,t){if(!e||e==="none")return fs(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Zu,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Hu,s=a}if(!s)return fs(t);const o=r[t],i=s[1].split(",").map(Gu);return typeof o=="function"?o(i):i[o]}const Wu=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return hs(n,t)};function Gu(e){return parseFloat(e.trim())}const Jt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Qt=new Set(Jt),Ko=e=>e===Xt||e===Q,Ku=new Set(["x","y","z"]),Yu=Jt.filter(e=>!Ku.has(e));function qu(e){const t=[];return Yu.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ct={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>hs(t,"x"),y:(e,{transform:t})=>hs(t,"y")};Ct.translateX=Ct.x;Ct.translateY=Ct.y;const kt=new Set;let ms=!1,gs=!1,ps=!1;function vc(){if(gs){const e=Array.from(kt).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=qu(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,i])=>{var a;(a=r.getValue(o))==null||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}gs=!1,ms=!1,kt.forEach(e=>e.complete(ps)),kt.clear()}function wc(){kt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(gs=!0)})}function Xu(){ps=!0,wc(),vc(),ps=!1}class ro{constructor(t,n,r,s,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(kt.add(this),ms||(ms=!0,ye.read(wc),ye.resolveKeyframes(vc))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s==null?void 0:s.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const a=r.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),s&&o===void 0&&s.set(t[0])}Uu(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),kt.delete(this)}cancel(){this.state==="scheduled"&&(kt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Ju=e=>e.startsWith("--");function Qu(e,t,n){Ju(t)?e.style.setProperty(t,n):e.style[t]=n}const ef=Us(()=>window.ScrollTimeline!==void 0),tf={};function nf(e,t){const n=Us(e);return()=>tf[t]??n()}const Sc=nf(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ln=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Yo={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ln([0,.65,.55,1]),circOut:ln([.55,0,1,.45]),backIn:ln([.31,.01,.66,-.59]),backOut:ln([.33,1.53,.69,.99])};function Cc(e,t){if(e)return typeof e=="function"?Sc()?yc(e,t):"ease-out":ac(e)?ln(e):Array.isArray(e)?e.map(n=>Cc(n,t)||Yo.easeOut):Yo[e]}function rf(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:a="easeOut",times:c}={},d=void 0){const u={[t]:n};c&&(u.offset=c);const f=Cc(a,s);Array.isArray(f)&&(u.easing=f);const h={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return d&&(h.pseudoElement=d),e.animate(u,h)}function kc(e){return typeof e=="function"&&"applyToOptions"in e}function sf({type:e,...t}){return kc(e)&&Sc()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class of extends to{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,ot(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const d=sf(t);this.animation=rf(n,r,s,d,o),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=eo(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Qu(n,r,u),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Xe(Number(t))}get time(){return Xe(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Ge(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&ef()?(this.animation.timeline=t,Ue):n(this)}}const Ec={anticipate:rc,backInOut:nc,circInOut:oc};function af(e){return e in Ec}function cf(e){typeof e.ease=="string"&&af(e.ease)&&(e.ease=Ec[e.ease])}const qo=10;class lf extends of{constructor(t){cf(t),bc(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new no({...i,autoplay:!1}),c=Ge(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-qo).value,a.sample(c).value,qo),a.stop()}}const Xo=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ft.test(e)||e==="0")&&!e.startsWith("url("));function df(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function uf(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=Xo(s,t),a=Xo(o,t);return qt(i===a,`You are trying to animate ${t} from "${s}" to "${o}". "${i?o:s}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:df(e)||(n==="spring"||kc(n))&&r}function ys(e){e.duration=0,e.type}const ff=new Set(["opacity","clipPath","filter","transform"]),hf=Us(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function mf(e){var u;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:i}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=t.owner.getProps();return hf()&&n&&ff.has(n)&&(n!=="transform"||!d)&&!c&&!r&&s!=="mirror"&&o!==0&&i!=="inertia"}const gf=40;class pf extends to{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:i="loop",keyframes:a,name:c,motionValue:d,element:u,...f}){var x;super(),this.stop=()=>{var m,b;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=$e.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:i,name:c,motionValue:d,element:u,...f},p=(u==null?void 0:u.KeyframeResolver)||ro;this.keyframeResolver=new p(a,(m,b,k)=>this.onKeyframesResolved(m,b,h,!k),c,d,u),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:o,type:i,velocity:a,delay:c,isHandoff:d,onUpdate:u}=r;this.resolvedAt=$e.now(),uf(t,o,i,a)||((it.instantAnimations||!c)&&(u==null||u(eo(t,r,n))),t[0]=t[t.length-1],ys(r),r.repeat=0);const h={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>gf?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},p=!d&&mf(h)?new lf({...h,element:h.motionValue.owner.current}):new no(h);p.finished.then(()=>this.notifyFinished()).catch(Ue),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Xu()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const yf=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xf(e){const t=yf.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const bf=4;function Tc(e,t,n=1){ot(n<=bf,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=xf(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const i=o.trim();return Ka(i)?parseFloat(i):i}return Ys(s)?Tc(s,t,n+1):s}function so(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Ac=new Set(["width","height","top","left","right","bottom",...Jt]),vf={test:e=>e==="auto",parse:e=>e},jc=e=>t=>t.test(e),Mc=[Xt,Q,Je,lt,lu,cu,vf],Jo=e=>Mc.find(jc(e));function wf(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||qa(e):!0}const Sf=new Set(["brightness","contrast","saturate","opacity"]);function Cf(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(qs)||[];if(!r)return e;const s=n.replace(r,"");let o=Sf.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const kf=/\b([a-z-]*)\(.*?\)/gu,xs={...ft,getAnimatableNone:e=>{const t=e.match(kf);return t?t.map(Cf).join(" "):e}},Qo={...Xt,transform:Math.round},Ef={rotate:lt,rotateX:lt,rotateY:lt,rotateZ:lt,scale:$n,scaleX:$n,scaleY:$n,scaleZ:$n,skew:lt,skewX:lt,skewY:lt,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:bn,originX:_o,originY:_o,originZ:Q},oo={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,radius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,top:Q,right:Q,bottom:Q,left:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,backgroundPositionX:Q,backgroundPositionY:Q,...Ef,zIndex:Qo,fillOpacity:bn,strokeOpacity:bn,numOctaves:Qo},Tf={...oo,color:Ae,backgroundColor:Ae,outlineColor:Ae,fill:Ae,stroke:Ae,borderColor:Ae,borderTopColor:Ae,borderRightColor:Ae,borderBottomColor:Ae,borderLeftColor:Ae,filter:xs,WebkitFilter:xs},Pc=e=>Tf[e];function Vc(e,t){let n=Pc(e);return n!==xs&&(n=ft),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Af=new Set(["auto","none","0"]);function jf(e,t,n){let r=0,s;for(;r<e.length&&!s;){const o=e[r];typeof o=="string"&&!Af.has(o)&&vn(o).values.length&&(s=e[r]),r++}if(s&&n)for(const o of t)e[o]=Vc(n,s)}class Mf extends ro{constructor(t,n,r,s,o){super(t,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let d=t[c];if(typeof d=="string"&&(d=d.trim(),Ys(d))){const u=Tc(d,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Ac.has(r)||t.length!==2)return;const[s,o]=t,i=Jo(s),a=Jo(o);if(i!==a)if(Ko(i)&&Ko(a))for(let c=0;c<t.length;c++){const d=t[c];typeof d=="string"&&(t[c]=parseFloat(d))}else Ct[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||wf(t[s]))&&r.push(s);r.length&&jf(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ct[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=r.length-1,i=r[o];r[o]=Ct[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,d])=>{t.getValue(c).set(d)}),this.resolveNoneKeyframes()}}function Pf(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const Nc=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Rc(e){return Ya(e)&&"offsetHeight"in e}const ei=30,Vf=e=>!isNaN(parseFloat(e));class Nf{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const s=$e.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=$e.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Vf(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Zs(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Hs);const r=this.events[t].add(n);return t==="change"?()=>{r(),ye.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=$e.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ei)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ei);return Xa(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Wt(e,t){return new Nf(e,t)}const{schedule:io}=cc(queueMicrotask,!1),We={x:!1,y:!1};function Ic(){return We.x||We.y}function Rf(e){return e==="x"||e==="y"?We[e]?null:(We[e]=!0,()=>{We[e]=!1}):We.x||We.y?null:(We.x=We.y=!0,()=>{We.x=We.y=!1})}function Dc(e,t){const n=Pf(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function ti(e){return!(e.pointerType==="touch"||Ic())}function If(e,t,n={}){const[r,s,o]=Dc(e,n),i=a=>{if(!ti(a))return;const{target:c}=a,d=t(c,a);if(typeof d!="function"||!c)return;const u=f=>{ti(f)&&(d(f),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,s)};return r.forEach(a=>{a.addEventListener("pointerenter",i,s)}),o}const $c=(e,t)=>t?e===t?!0:$c(e,t.parentElement):!1,ao=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Df=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function $f(e){return Df.has(e.tagName)||e.tabIndex!==-1}const Kn=new WeakSet;function ni(e){return t=>{t.key==="Enter"&&e(t)}}function Ir(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Ff=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ni(()=>{if(Kn.has(n))return;Ir(n,"down");const s=ni(()=>{Ir(n,"up")}),o=()=>Ir(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ri(e){return ao(e)&&!Ic()}function Of(e,t,n={}){const[r,s,o]=Dc(e,n),i=a=>{const c=a.currentTarget;if(!ri(a))return;Kn.add(c);const d=t(c,a),u=(p,x)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Kn.has(c)&&Kn.delete(c),ri(p)&&typeof d=="function"&&d(p,{success:x})},f=p=>{u(p,c===window||c===document||n.useGlobalTarget||$c(c,p.target))},h=p=>{u(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,s),Rc(a)&&(a.addEventListener("focus",d=>Ff(d,s)),!$f(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function Fc(e){return Ya(e)&&"ownerSVGElement"in e}function Lf(e){return Fc(e)&&e.tagName==="svg"}const Re=e=>!!(e&&e.getVelocity),_f=[...Mc,Ae,ft],Bf=e=>_f.find(jc(e)),co=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class zf extends g.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=Rc(r)&&r.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=s-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Uf({children:e,isPresent:t,anchorX:n,root:r}){const s=C.useId(),o=C.useRef(null),i=C.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=C.useContext(co);return C.useInsertionEffect(()=>{const{width:c,height:d,top:u,left:f,right:h}=i.current;if(t||!o.current||!c||!d)return;const p=n==="left"?`left: ${f}`:`right: ${h}`;o.current.dataset.motionPopId=s;const x=document.createElement("style");a&&(x.nonce=a);const m=r??document.head;return m.appendChild(x),x.sheet&&x.sheet.insertRule(`
2
+ [data-motion-pop-id="${s}"] {
3
3
  position: absolute !important;
4
4
  width: ${c}px !important;
5
5
  height: ${d}px !important;
6
- ${g}px !important;
6
+ ${p}px !important;
7
7
  top: ${u}px !important;
8
8
  }
9
- `),()=>{m.contains(x)&&m.removeChild(x)}},[t]),l.jsx(zf,{isPresent:t,childRef:o,sizeRef:i,children:p.cloneElement(e,{ref:o})})}const Uf=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:r,presenceAffectsLayout:o,mode:i,anchorX:a,root:c})=>{const d=Lr(Zf),u=C.useId();let f=!0,h=C.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:r,onExitComplete:g=>{d.set(g,!0);for(const x of d.values())if(!x)return;s&&s()},register:g=>(d.set(g,!1),()=>d.delete(g))}),[n,d,s]);return o&&f&&(h={...h}),C.useMemo(()=>{d.forEach((g,x)=>d.set(x,!1))},[n]),p.useEffect(()=>{!n&&!d.size&&s&&s()},[n]),i==="popLayout"&&(e=l.jsx(Hf,{isPresent:n,anchorX:a,root:c,children:e})),l.jsx(ls.Provider,{value:h,children:e})};function Zf(){return new Map}function Oc(e=!0){const t=C.useContext(ls);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,o=C.useId();C.useEffect(()=>{if(e)return r(o)},[e]);const i=C.useCallback(()=>e&&s&&s(o),[o,s,e]);return!n&&s?[!1,i]:[!0]}const Fn=e=>e.key||"";function ri(e){const t=[];return C.Children.forEach(e,n=>{C.isValidElement(n)&&t.push(n)}),t}const Ht=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:r=!0,mode:o="sync",propagate:i=!1,anchorX:a="left",root:c})=>{const[d,u]=Oc(i),f=C.useMemo(()=>ri(e),[e]),h=i&&!d?[]:f.map(Fn),g=C.useRef(!0),x=C.useRef(f),m=Lr(()=>new Map),[b,k]=C.useState(f),[v,T]=C.useState(f);Ga(()=>{g.current=!1,x.current=f;for(let A=0;A<v.length;A++){const M=Fn(v[A]);h.includes(M)?m.delete(M):m.get(M)!==!0&&m.set(M,!1)}},[v,h.length,h.join("-")]);const w=[];if(f!==b){let A=[...f];for(let M=0;M<v.length;M++){const j=v[M],z=Fn(j);h.includes(z)||(A.splice(M,0,j),w.push(j))}return o==="wait"&&w.length&&(A=w),T(ri(A)),k(f),null}process.env.NODE_ENV!=="production"&&o==="wait"&&v.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:S}=C.useContext(Or);return l.jsx(l.Fragment,{children:v.map(A=>{const M=Fn(A),j=i&&!d?!1:f===v||h.includes(M),z=()=>{if(m.has(M))m.set(M,!0);else return;let y=!0;m.forEach(D=>{D||(y=!1)}),y&&(S==null||S(),T(x.current),i&&(u==null||u()),s&&s())};return l.jsx(Uf,{isPresent:j,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:r,mode:o,root:c,onExitComplete:j?void 0:z,anchorX:a,children:A},M)})})},Lc=C.createContext({strict:!1}),oi={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Gt={};for(const e in oi)Gt[e]={isEnabled:t=>oi[e].some(n=>!!t[n])};function Wf(e){for(const t in e)Gt[t]={...Gt[t],...e[t]}}const Gf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ss(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Gf.has(e)}let _c=e=>!ss(e);function Kf(e){typeof e=="function"&&(_c=t=>t.startsWith("on")?!ss(t):e(t))}try{Kf(require("@emotion/is-prop-valid").default)}catch{}function Yf(e,t,n){const s={};for(const r in e)r==="values"&&typeof e.values=="object"||(_c(r)||n===!0&&ss(r)||!t&&!ss(r)||e.draggable&&r.startsWith("onDrag"))&&(s[r]=e[r]);return s}const ds=C.createContext({});function us(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function wn(e){return typeof e=="string"||Array.isArray(e)}const lo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],uo=["initial",...lo];function fs(e){return us(e.animate)||uo.some(t=>wn(e[t]))}function Bc(e){return!!(fs(e)||e.variants)}function qf(e,t){if(fs(e)){const{initial:n,animate:s}=e;return{initial:n===!1||wn(n)?n:void 0,animate:wn(s)?s:void 0}}return e.inherit!==!1?t:{}}function Xf(e){const{initial:t,animate:n}=qf(e,C.useContext(ds));return C.useMemo(()=>({initial:t,animate:n}),[ii(t),ii(n)])}function ii(e){return Array.isArray(e)?e.join(" "):e}const Sn={};function Jf(e){for(const t in e)Sn[t]=e[t],Kr(t)&&(Sn[t].isCSSVariable=!0)}function zc(e,{layout:t,layoutId:n}){return Qt.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Sn[e]||e==="opacity")}const Qf={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},eh=Jt.length;function th(e,t,n){let s="",r=!0;for(let o=0;o<eh;o++){const i=Jt[o],a=e[i];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(i.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const d=Nc(a,oo[i]);if(!c){r=!1;const u=Qf[i]||i;s+=`${u}(${d}) `}n&&(t[i]=d)}}return s=s.trim(),n?s=n(t,r?"":s):r&&(s="none"),s}function fo(e,t,n){const{style:s,vars:r,transformOrigin:o}=e;let i=!1,a=!1;for(const c in t){const d=t[c];if(Qt.has(c)){i=!0;continue}else if(Kr(c)){r[c]=d;continue}else{const u=Nc(d,oo[c]);c.startsWith("origin")?(a=!0,o[c]=u):s[c]=u}}if(t.transform||(i||n?s.transform=th(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:d="50%",originZ:u=0}=o;s.transformOrigin=`${c} ${d} ${u}`}}const ho=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Hc(e,t,n){for(const s in t)!Re(t[s])&&!zc(s,n)&&(e[s]=t[s])}function nh({transformTemplate:e},t){return C.useMemo(()=>{const n=ho();return fo(n,t,e),Object.assign({},n.vars,n.style)},[t])}function sh(e,t){const n=e.style||{},s={};return Hc(s,n,e),Object.assign(s,nh(e,t)),s}function rh(e,t){const n={},s=sh(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const oh={offset:"stroke-dashoffset",array:"stroke-dasharray"},ih={offset:"strokeDashoffset",array:"strokeDasharray"};function ah(e,t,n=1,s=0,r=!0){e.pathLength=1;const o=r?oh:ih;e[o.offset]=Q.transform(-s);const i=Q.transform(t),a=Q.transform(n);e[o.array]=`${i} ${a}`}function Uc(e,{attrX:t,attrY:n,attrScale:s,pathLength:r,pathSpacing:o=1,pathOffset:i=0,...a},c,d,u){if(fo(e,a,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),r!==void 0&&ah(f,r,o,i,!1)}const Zc=()=>({...ho(),attrs:{}}),Wc=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ch(e,t,n,s){const r=C.useMemo(()=>{const o=Zc();return Uc(o,t,Wc(s),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Hc(o,e.style,e),r.style={...o,...r.style}}return r}const lh=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function mo(e){return typeof e!="string"||e.includes("-")?!1:!!(lh.indexOf(e)>-1||/[A-Z]/u.test(e))}function dh(e,t,n,{latestValues:s},r,o=!1){const a=(mo(e)?ch:rh)(t,s,r,e),c=Yf(t,typeof e=="string",o),d=e!==C.Fragment?{...c,...a,ref:n}:{},{children:u}=t,f=C.useMemo(()=>Re(u)?u.get():u,[u]);return C.createElement(e,{...d,children:f})}function ai(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function po(e,t,n,s){if(typeof t=="function"){const[r,o]=ai(s);t=t(n!==void 0?n:e.custom,r,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,o]=ai(s);t=t(n!==void 0?n:e.custom,r,o)}return t}function Yn(e){return Re(e)?e.get():e}function uh({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,r){return{latestValues:fh(n,s,r,e),renderState:t()}}function fh(e,t,n,s){const r={},o=s(e,{});for(const h in o)r[h]=Yn(o[h]);let{initial:i,animate:a}=e;const c=fs(e),d=Bc(e);t&&d&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const f=u?a:i;if(f&&typeof f!="boolean"&&!us(f)){const h=Array.isArray(f)?f:[f];for(let g=0;g<h.length;g++){const x=po(e,h[g]);if(x){const{transitionEnd:m,transition:b,...k}=x;for(const v in k){let T=k[v];if(Array.isArray(T)){const w=u?T.length-1:0;T=T[w]}T!==null&&(r[v]=T)}for(const v in m)r[v]=m[v]}}}return r}const Gc=e=>(t,n)=>{const s=C.useContext(ds),r=C.useContext(ls),o=()=>uh(e,t,s,r);return n?o():Lr(o)};function go(e,t,n){var o;const{style:s}=e,r={};for(const i in s)(Re(s[i])||t.style&&Re(t.style[i])||zc(i,e)||((o=n==null?void 0:n.getValue(i))==null?void 0:o.liveStyle)!==void 0)&&(r[i]=s[i]);return r}const hh=Gc({scrapeMotionValuesFromProps:go,createRenderState:ho});function Kc(e,t,n){const s=go(e,t,n);for(const r in e)if(Re(e[r])||Re(t[r])){const o=Jt.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[o]=e[r]}return s}const mh=Gc({scrapeMotionValuesFromProps:Kc,createRenderState:Zc}),ph=Symbol.for("motionComponentSymbol");function Lt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function gh(e,t,n){return C.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):Lt(n)&&(n.current=s))},[t])}const yo=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),yh="framerAppearId",Yc="data-"+yo(yh),qc=C.createContext({});function xh(e,t,n,s,r){var m,b;const{visualElement:o}=C.useContext(ds),i=C.useContext(Lc),a=C.useContext(ls),c=C.useContext(co).reducedMotion,d=C.useRef(null);s=s||i.renderer,!d.current&&s&&(d.current=s(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}));const u=d.current,f=C.useContext(qc);u&&!u.projection&&r&&(u.type==="html"||u.type==="svg")&&bh(d.current,n,r,f);const h=C.useRef(!1);C.useInsertionEffect(()=>{u&&h.current&&u.update(n,a)});const g=n[Yc],x=C.useRef(!!g&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,g))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,g)));return Ga(()=>{u&&(h.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),x.current&&u.animationState&&u.animationState.animateChanges())}),C.useEffect(()=>{u&&(!x.current&&u.animationState&&u.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)==null||k.call(window,g)}),x.current=!1),u.enteringChildren=void 0)}),u}function bh(e,t,n,s){const{layoutId:r,layout:o,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:d,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Xc(e.parent)),e.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!i||a&&Lt(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:u,layoutScroll:c,layoutRoot:d})}function Xc(e){if(e)return e.options.allowProjection!==!1?e.projection:Xc(e.parent)}function Ds(e,{forwardMotionProps:t=!1}={},n,s){n&&Wf(n);const r=mo(e)?mh:hh;function o(a,c){let d;const u={...C.useContext(co),...a,layoutId:vh(a)},{isStatic:f}=u,h=Xf(a),g=r(a,f);if(!f&&_r){wh(u,n);const x=Sh(u);d=x.MeasureLayout,h.visualElement=xh(e,g,u,s,x.ProjectionNode)}return l.jsxs(ds.Provider,{value:h,children:[d&&h.visualElement?l.jsx(d,{visualElement:h.visualElement,...u}):null,dh(e,a,gh(g,h.visualElement,c),g,f,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const i=C.forwardRef(o);return i[ph]=e,i}function vh({layoutId:e}){const t=C.useContext(Or).id;return t&&e!==void 0?t+"-"+e:e}function wh(e,t){const n=C.useContext(Lc).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?qt(!1,s,"lazy-strict-mode"):ot(!1,s,"lazy-strict-mode")}}function Sh(e){const{drag:t,layout:n}=Gt;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function Ch(e,t){if(typeof Proxy>"u")return Ds;const n=new Map,s=(o,i)=>Ds(o,i,e,t),r=(o,i)=>(process.env.NODE_ENV!=="production"&&Zr(!1,"motion() is deprecated. Use motion.create() instead."),s(o,i));return new Proxy(r,{get:(o,i)=>i==="create"?s:(n.has(i)||n.set(i,Ds(i,void 0,e,t)),n.get(i))})}function Jc({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function kh({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Th(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function $s(e){return e===void 0||e===1}function br({scale:e,scaleX:t,scaleY:n}){return!$s(e)||!$s(t)||!$s(n)}function bt(e){return br(e)||Qc(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Qc(e){return ci(e.x)||ci(e.y)}function ci(e){return e&&e!=="0%"}function rs(e,t,n){const s=e-n,r=t*s;return n+r}function li(e,t,n,s,r){return r!==void 0&&(e=rs(e,r,s)),rs(e,n,s)+t}function vr(e,t=0,n=1,s,r){e.min=li(e.min,t,n,s,r),e.max=li(e.max,t,n,s,r)}function el(e,{x:t,y:n}){vr(e.x,t.translate,t.scale,t.originPoint),vr(e.y,n.translate,n.scale,n.originPoint)}const di=.999999999999,ui=1.0000000000001;function Eh(e,t,n,s=!1){const r=n.length;if(!r)return;t.x=t.y=1;let o,i;for(let a=0;a<r;a++){o=n[a],i=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Bt(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,el(e,i)),s&&bt(o.latestValues)&&Bt(e,o.latestValues))}t.x<ui&&t.x>di&&(t.x=1),t.y<ui&&t.y>di&&(t.y=1)}function _t(e,t){e.min=e.min+t,e.max=e.max+t}function fi(e,t,n,s,r=.5){const o=ve(e.min,e.max,r);vr(e,t,n,o,s)}function Bt(e,t){fi(e.x,t.x,t.scaleX,t.scale,t.originX),fi(e.y,t.y,t.scaleY,t.scale,t.originY)}function tl(e,t){return Jc(Th(e.getBoundingClientRect(),t))}function Ah(e,t,n){const s=tl(e,n),{scroll:r}=t;return r&&(_t(s.x,r.offset.x),_t(s.y,r.offset.y)),s}const hi=()=>({translate:0,scale:1,origin:0,originPoint:0}),zt=()=>({x:hi(),y:hi()}),mi=()=>({min:0,max:0}),Te=()=>({x:mi(),y:mi()}),wr={current:null},nl={current:!1};function jh(){if(nl.current=!0,!!_r)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>wr.current=e.matches;e.addEventListener("change",t),t()}else wr.current=!1}const Mh=new WeakMap;function Ph(e,t,n){for(const s in t){const r=t[s],o=n[s];if(Re(r))e.addValue(s,r);else if(Re(o))e.addValue(s,Wt(r,{owner:e}));else if(o!==r)if(e.hasValue(s)){const i=e.getValue(s);i.liveStyle===!0?i.jump(r):i.hasAnimated||i.set(r)}else{const i=e.getStaticValue(s);e.addValue(s,Wt(i!==void 0?i:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const pi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Vh{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=so,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=$e.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,ye.render(this.render,!1,!0))};const{latestValues:c,renderState:d}=i;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=fs(n),this.isVariantNode=Bc(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const g=f[h];c[h]!==void 0&&Re(g)&&g.set(c[h])}}mount(t){var n;this.current=t,Mh.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,r)=>this.bindToMotionValue(r,s)),nl.current||jh(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:wr.current,process.env.NODE_ENV!=="production"&&Zr(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),ut(this.notifyUpdate),ut(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=Qt.has(t);s&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&ye.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Gt){const n=Gt[t];if(!n)continue;const{isEnabled:s,Feature:r}=n;if(!this.features[t]&&r&&s(this.props)&&(this.features[t]=new r(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Te()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<pi.length;s++){const r=pi[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,i=t[o];i&&(this.propEventSubscriptions[r]=this.on(r,i))}this.prevMotionValues=Ph(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=Wt(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Ka(s)||qa(s))?s=parseFloat(s):!Bf(s)&&ft.test(n)&&(s=Vc(t,n)),this.setBaseTarget(t,Re(s)?s.get():s)),Re(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const i=po(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);i&&(s=i[t])}if(n&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!Re(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ur),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){io.render(this.render)}}class sl extends Vh{constructor(){super(...arguments),this.KeyframeResolver=Mf}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Re(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function rl(e,{style:t,vars:n},s,r){const o=e.style;let i;for(i in t)o[i]=t[i];r==null||r.applyProjectionStyles(o,s);for(i in n)o.setProperty(i,n[i])}function Nh(e){return window.getComputedStyle(e)}class Rh extends sl{constructor(){super(...arguments),this.type="html",this.renderInstance=rl}readValueFromInstance(t,n){var s;if(Qt.has(n))return(s=this.projection)!=null&&s.isProjecting?fr(n):Wu(t,n);{const r=Nh(t),o=(Kr(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return tl(t,n)}build(t,n,s){fo(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return go(t,n,s)}}const ol=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ih(e,t,n,s){rl(e,t,void 0,s);for(const r in t.attrs)e.setAttribute(ol.has(r)?r:yo(r),t.attrs[r])}class Dh extends sl{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Qt.has(n)){const s=Pc(n);return s&&s.default||0}return n=ol.has(n)?n:yo(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Kc(t,n,s)}build(t,n,s){Uc(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,r){Ih(t,n,s,r)}mount(t){this.isSVGTag=Wc(t.tagName),super.mount(t)}}const $h=(e,t)=>mo(e)?new Dh(t):new Rh(t,{allowProjection:e!==C.Fragment});function Ut(e,t,n){const s=e.getProps();return po(s,t,n!==void 0?n:s.custom,e)}const Sr=e=>Array.isArray(e);function Fh(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Wt(n))}function Oh(e){return Sr(e)?e[e.length-1]||0:e}function Lh(e,t){const n=Ut(e,t);let{transitionEnd:s={},transition:r={},...o}=n||{};o={...o,...s};for(const i in o){const a=Oh(o[i]);Fh(e,i,a)}}function _h(e){return!!(Re(e)&&e.add)}function Cr(e,t){const n=e.getValue("willChange");if(_h(n))return n.add(t);if(!n&&it.WillChange){const s=new it.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function il(e){return e.props[Yc]}const Bh=e=>e!==null;function zh(e,{repeat:t,repeatType:n="loop"},s){const r=e.filter(Bh),o=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[o]}const Hh={type:"spring",stiffness:500,damping:25,restSpeed:10},Uh=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Zh={type:"keyframes",duration:.8},Wh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Gh=(e,{keyframes:t})=>t.length>2?Zh:Qt.has(e)?e.startsWith("scale")?Uh(t[1]):Hh:Wh;function Kh({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:o,repeatType:i,repeatDelay:a,from:c,elapsed:d,...u}){return!!Object.keys(u).length}const xo=(e,t,n,s={},r,o)=>i=>{const a=ro(s,e)||{},c=a.delay||s.delay||0;let{elapsed:d=0}=s;d=d-Ge(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-d,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:r};Kh(a)||Object.assign(u,Gh(e,u)),u.duration&&(u.duration=Ge(u.duration)),u.repeatDelay&&(u.repeatDelay=Ge(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(yr(u),u.delay===0&&(f=!0)),(it.instantAnimations||it.skipAnimations)&&(f=!0,yr(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!o&&t.get()!==void 0){const h=zh(u.keyframes,a);if(h!==void 0){ye.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new no(u):new gf(u)};function Yh({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function al(e,t,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:i,...a}=t;s&&(o=s);const c=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),h=a[u];if(h===void 0||d&&Yh(d,u))continue;const g={delay:n,...ro(o||{},u)},x=f.get();if(x!==void 0&&!f.isAnimating&&!Array.isArray(h)&&h===x&&!g.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const k=il(e);if(k){const v=window.MotionHandoffAnimation(k,u,ye);v!==null&&(g.startTime=v,m=!0)}}Cr(e,u),f.start(xo(u,f,h,e.shouldReduceMotion&&Ac.has(u)?{type:!1}:g,e,m));const b=f.animation;b&&c.push(b)}return i&&Promise.all(c).then(()=>{ye.update(()=>{i&&Lh(e,i)})}),c}function cl(e,t,n,s=0,r=1){const o=Array.from(e).sort((d,u)=>d.sortNodePosition(u)).indexOf(t),i=e.size,a=(i-1)*s;return typeof n=="function"?n(o,i):r===1?o*s:a-o*s}function kr(e,t,n={}){var c;const s=Ut(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const o=s?()=>Promise.all(al(e,s,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=r;return qh(e,t,d,u,f,h,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[d,u]=a==="beforeChildren"?[o,i]:[i,o];return d().then(()=>u())}else return Promise.all([o(),i(n.delay)])}function qh(e,t,n=0,s=0,r=0,o=1,i){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(kr(c,t,{...i,delay:n+(typeof s=="function"?0:s)+cl(e.variantChildren,c,s,r,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function Xh(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const r=t.map(o=>kr(e,o,n));s=Promise.all(r)}else if(typeof t=="string")s=kr(e,t,n);else{const r=typeof t=="function"?Ut(e,t,n.custom):t;s=Promise.all(al(e,r,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}function ll(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const Jh=uo.length;function dl(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?dl(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Jh;n++){const s=uo[n],r=e.props[s];(wn(r)||r===!1)&&(t[s]=r)}return t}const Qh=[...lo].reverse(),em=lo.length;function tm(e){return t=>Promise.all(t.map(({animation:n,options:s})=>Xh(e,n,s)))}function nm(e){let t=tm(e),n=gi(),s=!0;const r=c=>(d,u)=>{var h;const f=Ut(e,u,c==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(f){const{transition:g,transitionEnd:x,...m}=f;d={...d,...m,...x}}return d};function o(c){t=c(e)}function i(c){const{props:d}=e,u=dl(e.parent)||{},f=[],h=new Set;let g={},x=1/0;for(let b=0;b<em;b++){const k=Qh[b],v=n[k],T=d[k]!==void 0?d[k]:u[k],w=wn(T),S=k===c?v.isActive:null;S===!1&&(x=b);let A=T===u[k]&&T!==d[k]&&w;if(A&&s&&e.manuallyAnimateOnMount&&(A=!1),v.protectedKeys={...g},!v.isActive&&S===null||!T&&!v.prevProp||us(T)||typeof T=="boolean")continue;const M=sm(v.prevProp,T);let j=M||k===c&&v.isActive&&!A&&w||b>x&&w,z=!1;const y=Array.isArray(T)?T:[T];let D=y.reduce(r(k),{});S===!1&&(D={});const{prevResolvedValues:_={}}=v,J={..._,...D},te=K=>{j=!0,h.has(K)&&(z=!0,h.delete(K)),v.needsAnimating[K]=!0;const R=e.getValue(K);R&&(R.liveStyle=!1)};for(const K in J){const R=D[K],X=_[K];if(g.hasOwnProperty(K))continue;let V=!1;Sr(R)&&Sr(X)?V=!ll(R,X):V=R!==X,V?R!=null?te(K):h.add(K):R!==void 0&&h.has(K)?te(K):v.protectedKeys[K]=!0}v.prevProp=T,v.prevResolvedValues=D,v.isActive&&(g={...g,...D}),s&&e.blockInitialAnimation&&(j=!1);const ee=A&&M;j&&(!ee||z)&&f.push(...y.map(K=>{const R={type:k};if(typeof K=="string"&&s&&!ee&&e.manuallyAnimateOnMount&&e.parent){const{parent:X}=e,V=Ut(X,K);if(X.enteringChildren&&V){const{delayChildren:U}=V.transition||{};R.delay=cl(X.enteringChildren,e,U)}}return{animation:K,options:R}}))}if(h.size){const b={};if(typeof d.initial!="boolean"){const k=Ut(e,Array.isArray(d.initial)?d.initial[0]:d.initial);k&&k.transition&&(b.transition=k.transition)}h.forEach(k=>{const v=e.getBaseTarget(k),T=e.getValue(k);T&&(T.liveStyle=!0),b[k]=v??null}),f.push({animation:b})}let m=!!f.length;return s&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(m=!1),s=!1,m?t(f):Promise.resolve()}function a(c,d){var f;if(n[c].isActive===d)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(h=>{var g;return(g=h.animationState)==null?void 0:g.setActive(c,d)}),n[c].isActive=d;const u=i(c);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:i,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=gi(),s=!0}}}function sm(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ll(t,e):!1}function yt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function gi(){return{animate:yt(!0),whileInView:yt(),whileHover:yt(),whileTap:yt(),whileDrag:yt(),whileFocus:yt(),exit:yt()}}class pt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class rm extends pt{constructor(t){super(t),t.animationState||(t.animationState=nm(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();us(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let om=0;class im extends pt{constructor(){super(...arguments),this.id=om++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const am={animation:{Feature:rm},exit:{Feature:im}};function Cn(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function jn(e){return{point:{x:e.pageX,y:e.pageY}}}const cm=e=>t=>ao(t)&&e(t,jn(t));function hn(e,t,n,s){return Cn(e,t,cm(n),s)}const ul=1e-4,lm=1-ul,dm=1+ul,fl=.01,um=0-fl,fm=0+fl;function De(e){return e.max-e.min}function hm(e,t,n){return Math.abs(e-t)<=n}function yi(e,t,n,s=.5){e.origin=s,e.originPoint=ve(t.min,t.max,e.origin),e.scale=De(n)/De(t),e.translate=ve(n.min,n.max,e.origin)-e.originPoint,(e.scale>=lm&&e.scale<=dm||isNaN(e.scale))&&(e.scale=1),(e.translate>=um&&e.translate<=fm||isNaN(e.translate))&&(e.translate=0)}function mn(e,t,n,s){yi(e.x,t.x,n.x,s?s.originX:void 0),yi(e.y,t.y,n.y,s?s.originY:void 0)}function xi(e,t,n){e.min=n.min+t.min,e.max=e.min+De(t)}function mm(e,t,n){xi(e.x,t.x,n.x),xi(e.y,t.y,n.y)}function bi(e,t,n){e.min=t.min-n.min,e.max=e.min+De(t)}function pn(e,t,n){bi(e.x,t.x,n.x),bi(e.y,t.y,n.y)}function _e(e){return[e("x"),e("y")]}const hl=({current:e})=>e?e.ownerDocument.defaultView:null,vi=(e,t)=>Math.abs(e-t);function pm(e,t){const n=vi(e.x,t.x),s=vi(e.y,t.y);return Math.sqrt(n**2+s**2)}class ml{constructor(t,n,{transformPagePoint:s,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:i=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=Os(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,x=pm(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!x)return;const{point:m}=h,{timestamp:b}=Pe;this.history.push({...m,timestamp:b});const{onStart:k,onMove:v}=this.handlers;g||(k&&k(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,h)},this.handlePointerMove=(h,g)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Fs(g,this.transformPagePoint),ye.update(this.updatePoint,!0)},this.handlePointerUp=(h,g)=>{this.end();const{onEnd:x,onSessionEnd:m,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=Os(h.type==="pointercancel"?this.lastMoveEventInfo:Fs(g,this.transformPagePoint),this.history);this.startEvent&&x&&x(h,k),m&&m(h,k)},!ao(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=i,this.contextWindow=r||window;const a=jn(t),c=Fs(a,this.transformPagePoint),{point:d}=c,{timestamp:u}=Pe;this.history=[{...d,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,Os(c,this.history)),this.removeListeners=Tn(hn(this.contextWindow,"pointermove",this.handlePointerMove),hn(this.contextWindow,"pointerup",this.handlePointerUp),hn(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ut(this.updatePoint)}}function Fs(e,t){return t?{point:t(e.point)}:e}function wi(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Os({point:e},t){return{point:e,delta:wi(e,pl(t)),offset:wi(e,gm(t)),velocity:ym(t,.1)}}function gm(e){return e[0]}function pl(e){return e[e.length-1]}function ym(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const r=pl(e);for(;n>=0&&(s=e[n],!(r.timestamp-s.timestamp>Ge(t)));)n--;if(!s)return{x:0,y:0};const o=Xe(r.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const i={x:(r.x-s.x)/o,y:(r.y-s.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function xm(e,{min:t,max:n},s){return t!==void 0&&e<t?e=s?ve(t,e,s.min):Math.max(e,t):n!==void 0&&e>n&&(e=s?ve(n,e,s.max):Math.min(e,n)),e}function Si(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function bm(e,{top:t,left:n,bottom:s,right:r}){return{x:Si(e.x,n,r),y:Si(e.y,t,s)}}function Ci(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,s]=[s,n]),{min:n,max:s}}function vm(e,t){return{x:Ci(e.x,t.x),y:Ci(e.y,t.y)}}function wm(e,t){let n=.5;const s=De(e),r=De(t);return r>s?n=xn(t.min,t.max-s,e.min):s>r&&(n=xn(e.min,e.max-r,t.min)),rt(0,1,n)}function Sm(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Tr=.35;function Cm(e=Tr){return e===!1?e=0:e===!0&&(e=Tr),{x:ki(e,"left","right"),y:ki(e,"top","bottom")}}function ki(e,t,n){return{min:Ti(e,t),max:Ti(e,n)}}function Ti(e,t){return typeof e=="number"?e:e[t]||0}const km=new WeakMap;class Tm{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Te(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=f=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(jn(f).point)},i=(f,h)=>{const{drag:g,dragPropagation:x,onDragStart:m}=this.getProps();if(g&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Rf(g),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),_e(k=>{let v=this.getAxisMotionValue(k).get()||0;if(Je.test(v)){const{projection:T}=this.visualElement;if(T&&T.layout){const w=T.layout.layoutBox[k];w&&(v=De(w)*(parseFloat(v)/100))}}this.originPoint[k]=v}),m&&ye.postRender(()=>m(f,h)),Cr(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:g,dragDirectionLock:x,onDirectionLock:m,onDrag:b}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:k}=h;if(x&&this.currentDirection===null){this.currentDirection=Em(k),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",h.point,k),this.updateAxis("y",h.point,k),this.visualElement.render(),b&&b(f,h)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>_e(f=>{var h;return this.getAnimationState(f)==="paused"&&((h=this.getAxisMotionValue(f).animation)==null?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new ml(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:s,contextWindow:hl(this.visualElement)})}stop(t,n){const s=t||this.latestPointerEvent,r=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!s)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&ye.postRender(()=>a(s,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,s){const{drag:r}=this.getProps();if(!s||!On(t,r,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(i=xm(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,r=this.constraints;t&&Lt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=bm(s.layoutBox,t):this.constraints=!1,this.elastic=Cm(n),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&_e(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Sm(s.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Lt(t))return!1;const s=t.current;ot(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=Ah(s,r.root,this.visualElement.getTransformPagePoint());let i=vm(r.layout.layoutBox,o);if(n){const a=n(kh(i));this.hasMutatedConstraints=!!a,a&&(i=Jc(a))}return i}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},d=_e(u=>{if(!On(u,n,this.currentDirection))return;let f=c&&c[u]||{};i&&(f={min:0,max:0});const h=r?200:1e6,g=r?40:1e7,x={type:"inertia",velocity:s?t[u]:0,bounceStiffness:h,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(u,x)});return Promise.all(d).then(a)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return Cr(this.visualElement,t),s.start(xo(t,s,0,n,this.visualElement,!1))}stopAnimation(){_e(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){_e(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),r=s[n];return r||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){_e(n=>{const{drag:s}=this.getProps();if(!On(n,s,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(n);if(r&&r.layout){const{min:i,max:a}=r.layout.layoutBox[n];o.set(t[n]-ve(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Lt(n)||!s||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};_e(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();r[i]=wm({min:c,max:c},this.constraints[i])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),_e(i=>{if(!On(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:d}=this.constraints[i];a.set(ve(c,d,r[i]))})}addListeners(){if(!this.visualElement.current)return;km.set(this.visualElement,this);const t=this.visualElement.current,n=hn(t,"pointerdown",c=>{const{drag:d,dragListener:u=!0}=this.getProps();d&&u&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();Lt(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,o=r.addEventListener("measure",s);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),ye.read(s);const i=Cn(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(_e(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=c[u].translate,f.set(f.get()+c[u].translate))}),this.visualElement.render())});return()=>{i(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=Tr,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function On(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Em(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Am extends pt{constructor(t){super(t),this.removeGroupControls=He,this.removeListeners=He,this.controls=new Tm(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||He}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ei=e=>(t,n)=>{e&&ye.postRender(()=>e(t,n))};class jm extends pt{constructor(){super(...arguments),this.removePointerDownListener=He}onPointerDown(t){this.session=new ml(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:hl(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ei(t),onStart:Ei(n),onMove:s,onEnd:(o,i)=>{delete this.session,r&&ye.postRender(()=>r(o,i))}}}mount(){this.removePointerDownListener=hn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const qn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ai(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const on={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Q.test(e))e=parseFloat(e);else return e;const n=Ai(e,t.target.x),s=Ai(e,t.target.y);return`${n}% ${s}%`}},Mm={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,r=ft.parse(e);if(r.length>5)return s;const o=ft.createTransformer(e),i=typeof r[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;r[0+i]/=a,r[1+i]/=c;const d=ve(a,c,.5);return typeof r[2+i]=="number"&&(r[2+i]/=d),typeof r[3+i]=="number"&&(r[3+i]/=d),o(r)}};let Ls=!1;class Pm extends C.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:r}=this.props,{projection:o}=t;Jf(Vm),o&&(n.group&&n.group.add(o),s&&s.register&&r&&s.register(o),Ls&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),qn.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:r,isPresent:o}=this.props,{projection:i}=s;return i&&(i.isPresent=o,Ls=!0,r||t.layoutDependency!==n||n===void 0||t.isPresent!==o?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||ye.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),io.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:r}=t;Ls=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),s&&s.deregister&&s.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function gl(e){const[t,n]=Oc(),s=C.useContext(Or);return l.jsx(Pm,{...e,layoutGroup:s,switchLayoutGroup:C.useContext(qc),isPresent:t,safeToRemove:n})}const Vm={borderRadius:{...on,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:on,borderTopRightRadius:on,borderBottomLeftRadius:on,borderBottomRightRadius:on,boxShadow:Mm};function Nm(e,t,n){const s=Re(e)?e:Wt(e);return s.start(xo("",s,t,n)),s.animation}const Rm=(e,t)=>e.depth-t.depth;class Im{constructor(){this.children=[],this.isDirty=!1}add(t){Br(this.children,t),this.isDirty=!0}remove(t){zr(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Rm),this.isDirty=!1,this.children.forEach(t)}}function Dm(e,t){const n=$e.now(),s=({timestamp:r})=>{const o=r-n;o>=t&&(ut(s),e(o-t))};return ye.setup(s,!0),()=>ut(s)}const yl=["TopLeft","TopRight","BottomLeft","BottomRight"],$m=yl.length,ji=e=>typeof e=="string"?parseFloat(e):e,Mi=e=>typeof e=="number"||Q.test(e);function Fm(e,t,n,s,r,o){r?(e.opacity=ve(0,n.opacity??1,Om(s)),e.opacityExit=ve(t.opacity??1,0,Lm(s))):o&&(e.opacity=ve(t.opacity??1,n.opacity??1,s));for(let i=0;i<$m;i++){const a=`border${yl[i]}Radius`;let c=Pi(t,a),d=Pi(n,a);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||Mi(c)===Mi(d)?(e[a]=Math.max(ve(ji(c),ji(d),s),0),(Je.test(d)||Je.test(c))&&(e[a]+="%")):e[a]=d}(t.rotate||n.rotate)&&(e.rotate=ve(t.rotate||0,n.rotate||0,s))}function Pi(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Om=xl(0,.5,rc),Lm=xl(.5,.95,He);function xl(e,t,n){return s=>s<e?0:s>t?1:n(xn(e,t,s))}function Vi(e,t){e.min=t.min,e.max=t.max}function Le(e,t){Vi(e.x,t.x),Vi(e.y,t.y)}function Ni(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ri(e,t,n,s,r){return e-=t,e=rs(e,1/n,s),r!==void 0&&(e=rs(e,1/r,s)),e}function _m(e,t=0,n=1,s=.5,r,o=e,i=e){if(Je.test(t)&&(t=parseFloat(t),t=ve(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=ve(o.min,o.max,s);e===o&&(a-=t),e.min=Ri(e.min,t,n,a,r),e.max=Ri(e.max,t,n,a,r)}function Ii(e,t,[n,s,r],o,i){_m(e,t[n],t[s],t[r],t.scale,o,i)}const Bm=["x","scaleX","originX"],zm=["y","scaleY","originY"];function Di(e,t,n,s){Ii(e.x,t,Bm,n?n.x:void 0,s?s.x:void 0),Ii(e.y,t,zm,n?n.y:void 0,s?s.y:void 0)}function $i(e){return e.translate===0&&e.scale===1}function bl(e){return $i(e.x)&&$i(e.y)}function Fi(e,t){return e.min===t.min&&e.max===t.max}function Hm(e,t){return Fi(e.x,t.x)&&Fi(e.y,t.y)}function Oi(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vl(e,t){return Oi(e.x,t.x)&&Oi(e.y,t.y)}function Li(e){return De(e.x)/De(e.y)}function _i(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Um{constructor(){this.members=[]}add(t){Br(this.members,t),t.scheduleRender()}remove(t){if(zr(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(r=>t===r);if(n===0)return!1;let s;for(let r=n;r>=0;r--){const o=this.members[r];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(t,n){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.instance&&s.scheduleRender(),t.scheduleRender(),t.resumeFrom=s,n&&(t.resumeFrom.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;r===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:s}=t;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Zm(e,t,n){let s="";const r=e.x.translate/t.x,o=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((r||o||i)&&(s=`translate3d(${r}px, ${o}px, ${i}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:u,rotateX:f,rotateY:h,skewX:g,skewY:x}=n;d&&(s=`perspective(${d}px) ${s}`),u&&(s+=`rotate(${u}deg) `),f&&(s+=`rotateX(${f}deg) `),h&&(s+=`rotateY(${h}deg) `),g&&(s+=`skewX(${g}deg) `),x&&(s+=`skewY(${x}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const _s=["","X","Y","Z"],Wm=1e3;let Gm=0;function Bs(e,t,n,s){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),s&&(s[e]=0))}function wl(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=il(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ye,!(r||o))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&wl(s)}function Sl({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:r}){return class{constructor(i={},a=t==null?void 0:t()){this.id=Gm++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(qm),this.nodes.forEach(ep),this.nodes.forEach(tp),this.nodes.forEach(Xm)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Im)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Ur),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Fc(i)&&!Lf(i),this.instance=i;const{layoutId:a,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const h=()=>this.root.updateBlockedByResize=!1;ye.read(()=>{f=window.innerWidth}),e(i,()=>{const g=window.innerWidth;g!==f&&(f=g,this.root.updateBlockedByResize=!0,u&&u(),u=Dm(h,250),qn.hasAnimatedSinceResize&&(qn.hasAnimatedSinceResize=!1,this.nodes.forEach(Hi)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&d&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||d.getDefaultTransition()||ip,{onLayoutAnimationStart:m,onLayoutAnimationComplete:b}=d.getProps(),k=!this.targetLayout||!vl(this.targetLayout,g),v=!f&&h;if(this.options.layoutRoot||this.resumeFrom||v||f&&(k||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...ro(x,"layout"),onPlay:m,onComplete:b};(d.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(u,v)}else f||Hi(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ut(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(np),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&wl(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Bi);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(zi);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Qm),this.nodes.forEach(Km),this.nodes.forEach(Ym)):this.nodes.forEach(zi),this.clearAllSnapshots();const a=$e.now();Pe.delta=rt(0,1e3/60,a-Pe.timestamp),Pe.timestamp=a,Pe.isProcessing=!0,Ms.update.process(Pe),Ms.preRender.process(Pe),Ms.render.process(Pe),Pe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,io.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Jm),this.sharedNodes.forEach(sp)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ye.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ye.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!De(this.snapshot.measuredBox.x)&&!De(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Te(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!r)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!bl(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,u=d!==this.prevTransformTemplateValue;i&&this.instance&&(a||bt(this.latestValues)||u)&&(r(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),ap(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:i}=this.options;if(!i)return Te();const a=i.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(cp))){const{scroll:u}=this.root;u&&(_t(a.x,u.offset.x),_t(a.y,u.offset.y))}return a}removeElementScroll(i){var c;const a=Te();if(Le(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let d=0;d<this.path.length;d++){const u=this.path[d],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Le(a,i),_t(a.x,f.offset.x),_t(a.y,f.offset.y))}return a}applyTransform(i,a=!1){const c=Te();Le(c,i);for(let d=0;d<this.path.length;d++){const u=this.path[d];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Bt(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),bt(u.latestValues)&&Bt(c,u.latestValues)}return bt(this.latestValues)&&Bt(c,this.latestValues),c}removeTransform(i){const a=Te();Le(a,i);for(let c=0;c<this.path.length;c++){const d=this.path[c];if(!d.instance||!bt(d.latestValues))continue;br(d.latestValues)&&d.updateSnapshot();const u=Te(),f=d.measurePageBox();Le(u,f),Di(a,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,u)}return bt(this.latestValues)&&Di(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Pe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var h;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!(!this.layout||!(u||f))){if(this.resolvedRelativeTargetAt=Pe.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),pn(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),Le(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Te(),this.targetWithTransforms=Te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),mm(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Le(this.target,this.layout.layoutBox),el(this.target,this.targetDelta)):Le(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),pn(this.relativeTargetOrigin,this.target,g.target),Le(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||br(this.parent.latestValues)||Qc(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var x;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Pe.timestamp&&(c=!1),c)return;const{layout:d,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||u))return;Le(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;Eh(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Te());const{target:g}=i;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ni(this.prevProjectionDelta.x,this.projectionDelta.x),Ni(this.prevProjectionDelta.y,this.projectionDelta.y)),mn(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!_i(this.projectionDelta.x,this.prevProjectionDelta.x)||!_i(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=zt(),this.projectionDelta=zt(),this.projectionDeltaWithTransform=zt()}setAnimationOrigin(i,a=!1){const c=this.snapshot,d=c?c.latestValues:{},u={...this.latestValues},f=zt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Te(),g=c?c.source:void 0,x=this.layout?this.layout.source:void 0,m=g!==x,b=this.getStack(),k=!b||b.members.length<=1,v=!!(m&&!k&&this.options.crossfade===!0&&!this.path.some(op));this.animationProgress=0;let T;this.mixTargetDelta=w=>{const S=w/1e3;Ui(f.x,i.x,S),Ui(f.y,i.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(pn(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),rp(this.relativeTarget,this.relativeTargetOrigin,h,S),T&&Hm(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Te()),Le(T,this.relativeTarget)),m&&(this.animationValues=u,Fm(u,d,this.latestValues,S,v,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,d;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(d=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||d.stop(),this.pendingAnimation&&(ut(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ye.update(()=>{qn.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Wt(0)),this.currentAnimation=Nm(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),i.onUpdate&&i.onUpdate(u)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Wm),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:d,latestValues:u}=i;if(!(!a||!c||!d)){if(this!==i&&this.layout&&d&&Cl(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Te();const f=De(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;const h=De(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}Le(a,c),Bt(a,u),mn(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new Um),this.sharedNodes.get(i).add(a);const d=a.options.initialPromotionConfig;a.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var a;const{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const d={};c.z&&Bs("z",i,d,this.animationValues);for(let u=0;u<_s.length;u++)Bs(`rotate${_s[u]}`,i,d,this.animationValues),Bs(`skew${_s[u]}`,i,d,this.animationValues);i.render();for(const u in d)i.setStaticValue(u,d[u]),this.animationValues&&(this.animationValues[u]=d[u]);i.scheduleRender()}applyProjectionStyles(i,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=Yn(a==null?void 0:a.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=Yn(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!bt(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const u=d.animationValues||d.latestValues;this.applyTransformsToTarget();let f=Zm(this.projectionDeltaWithTransform,this.treeScale,u);c&&(f=c(u,f)),i.transform=f;const{x:h,y:g}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${g.origin*100}% 0`,d.animationValues?i.opacity=d===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:i.opacity=d===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const x in Sn){if(u[x]===void 0)continue;const{correct:m,applyTo:b,isCSSVariable:k}=Sn[x],v=f==="none"?u[x]:m(u[x],d);if(b){const T=b.length;for(let w=0;w<T;w++)i[b[w]]=v}else k?this.options.visualElement.renderState.vars[x]=v:i[x]=v}this.options.layoutId&&(i.pointerEvents=d===this?Yn(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Bi),this.root.sharedNodes.clear()}}}function Km(e){e.updateLayout()}function Ym(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:r}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;o==="size"?_e(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],g=De(h);h.min=s[f].min,h.max=h.min+g}):Cl(o,t.layoutBox,s)&&_e(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],g=De(s[f]);h.max=h.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+g)});const a=zt();mn(a,s,t.layoutBox);const c=zt();i?mn(c,e.applyTransform(r,!0),t.measuredBox):mn(c,s,t.layoutBox);const d=!bl(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:g}=f;if(h&&g){const x=Te();pn(x,t.layoutBox,h.layoutBox);const m=Te();pn(m,s,g.layoutBox),vl(x,m)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=x,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:d,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function qm(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Xm(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Jm(e){e.clearSnapshot()}function Bi(e){e.clearMeasurements()}function zi(e){e.isLayoutDirty=!1}function Qm(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Hi(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ep(e){e.resolveTargetDelta()}function tp(e){e.calcProjection()}function np(e){e.resetSkewAndRotation()}function sp(e){e.removeLeadSnapshot()}function Ui(e,t,n){e.translate=ve(t.translate,0,n),e.scale=ve(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Zi(e,t,n,s){e.min=ve(t.min,n.min,s),e.max=ve(t.max,n.max,s)}function rp(e,t,n,s){Zi(e.x,t.x,n.x,s),Zi(e.y,t.y,n.y,s)}function op(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ip={duration:.45,ease:[.4,0,.1,1]},Wi=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Gi=Wi("applewebkit/")&&!Wi("chrome/")?Math.round:He;function Ki(e){e.min=Gi(e.min),e.max=Gi(e.max)}function ap(e){Ki(e.x),Ki(e.y)}function Cl(e,t,n){return e==="position"||e==="preserve-aspect"&&!hm(Li(t),Li(n),.2)}function cp(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const lp=Sl({attachResizeListener:(e,t)=>Cn(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),zs={current:void 0},kl=Sl({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!zs.current){const e=new lp({});e.mount(window),e.setOptions({layoutScroll:!0}),zs.current=e}return zs.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),dp={pan:{Feature:jm},drag:{Feature:Am,ProjectionNode:kl,MeasureLayout:gl}};function Yi(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,o=s[r];o&&ye.postRender(()=>o(t,jn(t)))}class up extends pt{mount(){const{current:t}=this.node;t&&(this.unmount=If(t,(n,s)=>(Yi(this.node,s,"Start"),r=>Yi(this.node,r,"End"))))}unmount(){}}class fp extends pt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Tn(Cn(this.node.current,"focus",()=>this.onFocus()),Cn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function qi(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),o=s[r];o&&ye.postRender(()=>o(t,jn(t)))}class hp extends pt{mount(){const{current:t}=this.node;t&&(this.unmount=Of(t,(n,s)=>(qi(this.node,s,"Start"),(r,{success:o})=>qi(this.node,r,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Er=new WeakMap,Hs=new WeakMap,mp=e=>{const t=Er.get(e.target);t&&t(e)},pp=e=>{e.forEach(mp)};function gp({root:e,...t}){const n=e||document;Hs.has(n)||Hs.set(n,{});const s=Hs.get(n),r=JSON.stringify(t);return s[r]||(s[r]=new IntersectionObserver(pp,{root:e,...t})),s[r]}function yp(e,t,n){const s=gp(t);return Er.set(e,n),s.observe(e),()=>{Er.delete(e),s.unobserve(e)}}const xp={some:0,all:1};class bp extends pt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:xp[r]},a=c=>{const{isIntersecting:d}=c;if(this.isInView===d||(this.isInView=d,o&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=d?u:f;h&&h(c)};return yp(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(vp(t,n))&&this.startObserver()}unmount(){}}function vp({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const wp={inView:{Feature:bp},tap:{Feature:hp},focus:{Feature:fp},hover:{Feature:up}},Sp={layout:{ProjectionNode:kl,MeasureLayout:gl}},Cp={...am,...wp,...dp,...Sp},ie=Ch(Cp,$h),Ke=p.forwardRef((e,t)=>{const{alt:n,color:s="currentColor",size:r="1em",weight:o="regular",mirrored:i=!1,children:a,weights:c,...d}=e;return p.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:s,viewBox:"0 0 256 256",transform:i?"scale(-1, 1)":void 0,...d},!!n&&p.createElement("title",null,n),a,c.get(o))});Ke.displayName="SSRBase";const kp=new Map([["bold",p.createElement(p.Fragment,null,p.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",p.createElement(p.Fragment,null,p.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),p.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",p.createElement(p.Fragment,null,p.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",p.createElement(p.Fragment,null,p.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",p.createElement(p.Fragment,null,p.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",p.createElement(p.Fragment,null,p.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),bo=p.forwardRef((e,t)=>p.createElement(Ke,{ref:t,...e,weights:kp}));bo.displayName="CaretDownIcon";const Tp=new Map([["bold",p.createElement(p.Fragment,null,p.createElement("path",{d:"M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z"}))],["duotone",p.createElement(p.Fragment,null,p.createElement("path",{d:"M208,160H48l80-80Z",opacity:"0.2"}),p.createElement("path",{d:"M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z"}))],["fill",p.createElement(p.Fragment,null,p.createElement("path",{d:"M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z"}))],["light",p.createElement(p.Fragment,null,p.createElement("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"}))],["regular",p.createElement(p.Fragment,null,p.createElement("path",{d:"M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"}))],["thin",p.createElement(p.Fragment,null,p.createElement("path",{d:"M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z"}))]]),Tl=p.forwardRef((e,t)=>p.createElement(Ke,{ref:t,...e,weights:Tp}));Tl.displayName="CaretUpIcon";const Ep=new Map([["bold",p.createElement(p.Fragment,null,p.createElement("path",{d:"M216,44H40A20,20,0,0,0,20,64V224A19.82,19.82,0,0,0,31.56,242.1a20.14,20.14,0,0,0,8.49,1.9,19.91,19.91,0,0,0,12.82-4.72l.12-.11L84.47,212H216a20,20,0,0,0,20-20V64A20,20,0,0,0,216,44Zm-4,144H80a11.93,11.93,0,0,0-7.84,2.92L44,215.23V68H212ZM84,108A12,12,0,0,1,96,96h64a12,12,0,1,1,0,24H96A12,12,0,0,1,84,108Zm0,40a12,12,0,0,1,12-12h64a12,12,0,0,1,0,24H96A12,12,0,0,1,84,148Z"}))],["duotone",p.createElement(p.Fragment,null,p.createElement("path",{d:"M224,64V192a8,8,0,0,1-8,8H80L45.15,230.11A8,8,0,0,1,32,224V64a8,8,0,0,1,8-8H216A8,8,0,0,1,224,64Z",opacity:"0.2"}),p.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"}))],["fill",p.createElement(p.Fragment,null,p.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.84,15.84,0,0,0,9.25,14.5A16.05,16.05,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM160,152H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z"}))],["light",p.createElement(p.Fragment,null,p.createElement("path",{d:"M216,50H40A14,14,0,0,0,26,64V224a13.88,13.88,0,0,0,8.09,12.69A14.11,14.11,0,0,0,40,238a13.87,13.87,0,0,0,9-3.31l.06-.05L82.23,206H216a14,14,0,0,0,14-14V64A14,14,0,0,0,216,50Zm2,142a2,2,0,0,1-2,2H80a6,6,0,0,0-3.92,1.46L41.26,225.53A2,2,0,0,1,38,224V64a2,2,0,0,1,2-2H216a2,2,0,0,1,2,2Zm-52-80a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,144Z"}))],["regular",p.createElement(p.Fragment,null,p.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"}))],["thin",p.createElement(p.Fragment,null,p.createElement("path",{d:"M216,52H40A12,12,0,0,0,28,64V224a11.89,11.89,0,0,0,6.93,10.88A12.17,12.17,0,0,0,40,236a11.89,11.89,0,0,0,7.69-2.83l0,0L81.49,204H216a12,12,0,0,0,12-12V64A12,12,0,0,0,216,52Zm4,140a4,4,0,0,1-4,4H80a4,4,0,0,0-2.62,1L42.56,227.06A4,4,0,0,1,36,224V64a4,4,0,0,1,4-4H216a4,4,0,0,1,4,4Zm-56-80a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,144Z"}))]]),El=p.forwardRef((e,t)=>p.createElement(Ke,{ref:t,...e,weights:Ep}));El.displayName="ChatTextIcon";const Ap=new Map([["bold",p.createElement(p.Fragment,null,p.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",p.createElement(p.Fragment,null,p.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),p.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",p.createElement(p.Fragment,null,p.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",p.createElement(p.Fragment,null,p.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",p.createElement(p.Fragment,null,p.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",p.createElement(p.Fragment,null,p.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),Al=p.forwardRef((e,t)=>p.createElement(Ke,{ref:t,...e,weights:Ap}));Al.displayName="CheckIcon";const jp=new Map([["bold",p.createElement(p.Fragment,null,p.createElement("path",{d:"M128,180a52.06,52.06,0,0,0,52-52V64A52,52,0,0,0,76,64v64A52.06,52.06,0,0,0,128,180ZM100,64a28,28,0,0,1,56,0v64a28,28,0,0,1-56,0Zm40,155.22V240a12,12,0,0,1-24,0V219.22A92.14,92.14,0,0,1,36,128a12,12,0,0,1,24,0,68,68,0,0,0,136,0,12,12,0,0,1,24,0A92.14,92.14,0,0,1,140,219.22Z"}))],["duotone",p.createElement(p.Fragment,null,p.createElement("path",{d:"M168,64v64a40,40,0,0,1-40,40h0a40,40,0,0,1-40-40V64a40,40,0,0,1,40-40h0A40,40,0,0,1,168,64Z",opacity:"0.2"}),p.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["fill",p.createElement(p.Fragment,null,p.createElement("path",{d:"M80,128V64a48,48,0,0,1,96,0v64a48,48,0,0,1-96,0Zm128,0a8,8,0,0,0-16,0,64,64,0,0,1-128,0,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.6A80.11,80.11,0,0,0,208,128Z"}))],["light",p.createElement(p.Fragment,null,p.createElement("path",{d:"M128,174a46.06,46.06,0,0,0,46-46V64a46,46,0,0,0-92,0v64A46.06,46.06,0,0,0,128,174ZM94,64a34,34,0,0,1,68,0v64a34,34,0,0,1-68,0Zm40,141.75V240a6,6,0,0,1-12,0V205.75A78.09,78.09,0,0,1,50,128a6,6,0,0,1,12,0,66,66,0,0,0,132,0,6,6,0,0,1,12,0A78.09,78.09,0,0,1,134,205.75Z"}))],["regular",p.createElement(p.Fragment,null,p.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["thin",p.createElement(p.Fragment,null,p.createElement("path",{d:"M128,172a44.05,44.05,0,0,0,44-44V64a44,44,0,0,0-88,0v64A44.05,44.05,0,0,0,128,172ZM92,64a36,36,0,0,1,72,0v64a36,36,0,0,1-72,0Zm40,139.89V240a4,4,0,0,1-8,0V203.89A76.09,76.09,0,0,1,52,128a4,4,0,0,1,8,0,68,68,0,0,0,136,0,4,4,0,0,1,8,0A76.09,76.09,0,0,1,132,203.89Z"}))]]),jl=p.forwardRef((e,t)=>p.createElement(Ke,{ref:t,...e,weights:jp}));jl.displayName="MicrophoneIcon";const Mp=new Map([["bold",p.createElement(p.Fragment,null,p.createElement("path",{d:"M56.88,39.93A12,12,0,1,0,39.12,56.07L76,96.64V128a52,52,0,0,0,72.11,48l11.26,12.39A67.34,67.34,0,0,1,128,196a68.07,68.07,0,0,1-68-68,12,12,0,0,0-24,0,92.14,92.14,0,0,0,80,91.22V240a12,12,0,0,0,24,0V219.23a90.39,90.39,0,0,0,35.92-12.68l23.2,25.52a12,12,0,0,0,17.76-16.14ZM128,156a28,28,0,0,1-28-28v-5l29.9,32.89C129.27,156,128.64,156,128,156Zm63-2.42A67.63,67.63,0,0,0,196,128a12,12,0,0,1,24,0,91.48,91.48,0,0,1-6.74,34.61,12,12,0,0,1-22.23-9ZM85.7,33.75A52,52,0,0,1,180,64v56.54a12,12,0,0,1-24,0V64a28,28,0,0,0-50.79-16.28,12,12,0,0,1-19.51-14Z"}))],["duotone",p.createElement(p.Fragment,null,p.createElement("path",{d:"M168,64v64a40,40,0,0,1-40,40h0a40,40,0,0,1-40-40V64a40,40,0,0,1,40-40h0A40,40,0,0,1,168,64Z",opacity:"0.2"}),p.createElement("path",{d:"M213.92,218.62l-160-176A8,8,0,0,0,42.08,53.38L80,95.09V128a48,48,0,0,0,69.11,43.12l11.1,12.2A63.41,63.41,0,0,1,128,192a64.07,64.07,0,0,1-64-64,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.59a78.83,78.83,0,0,0,35.16-12.22l30.92,34a8,8,0,1,0,11.84-10.76ZM128,160a32,32,0,0,1-32-32V112.69l41.66,45.82A32,32,0,0,1,128,160Zm57.52-3.91A63.32,63.32,0,0,0,192,128a8,8,0,0,1,16,0,79.16,79.16,0,0,1-8.11,35.12,8,8,0,0,1-7.19,4.49,7.88,7.88,0,0,1-3.51-.82A8,8,0,0,1,185.52,156.09ZM84,44.87A48,48,0,0,1,176,64v64a49.19,49.19,0,0,1-.26,5,8,8,0,0,1-8,7.17,8.13,8.13,0,0,1-.84,0,8,8,0,0,1-7.12-8.79c.11-1.1.17-2.24.17-3.36V64A32,32,0,0,0,98.64,51.25,8,8,0,1,1,84,44.87Z"}))],["fill",p.createElement(p.Fragment,null,p.createElement("path",{d:"M213.38,229.92a8,8,0,0,1-11.3-.54l-30.92-34A78.83,78.83,0,0,1,136,207.59V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64.07,64.07,0,0,0,64,64,63.41,63.41,0,0,0,32.21-8.68l-11.1-12.2A48,48,0,0,1,80,128V95.09L42.08,53.38A8,8,0,0,1,53.92,42.62l160,176A8,8,0,0,1,213.38,229.92Zm-24.19-63.13a7.88,7.88,0,0,0,3.51.82,8,8,0,0,0,7.19-4.49A79.16,79.16,0,0,0,208,128a8,8,0,0,0-16,0,63.32,63.32,0,0,1-6.48,28.09A8,8,0,0,0,189.19,166.79Zm-27.33-29.22A8,8,0,0,0,175.74,133a49.49,49.49,0,0,0,.26-5V64A48,48,0,0,0,84,44.87a8,8,0,0,0,1.41,8.57Z"}))],["light",p.createElement(p.Fragment,null,p.createElement("path",{d:"M212.44,220,52.44,44A6,6,0,0,0,43.56,52L82,94.32V128a46,46,0,0,0,67.56,40.64l13.75,15.12A65.26,65.26,0,0,1,128,194a66.08,66.08,0,0,1-66-66,6,6,0,0,0-12,0,78.09,78.09,0,0,0,72,77.75V240a6,6,0,0,0,12,0V205.77a76.93,76.93,0,0,0,37.48-13L203.56,228a6,6,0,0,0,8.88-8.08ZM128,162a34,34,0,0,1-34-34V107.52l47.12,51.84A33.82,33.82,0,0,1,128,162Zm59.32-5A65.38,65.38,0,0,0,194,128a6,6,0,0,1,12,0,77.33,77.33,0,0,1-7.9,34.25A6,6,0,1,1,187.32,157ZM85.8,45.67A46,46,0,0,1,174,64v64a45.17,45.17,0,0,1-.25,4.81,6,6,0,0,1-6,5.38q-.31,0-.63,0a6,6,0,0,1-5.34-6.59A35.41,35.41,0,0,0,162,128V64A34,34,0,0,0,96.8,50.45a6,6,0,0,1-11-4.78Z"}))],["regular",p.createElement(p.Fragment,null,p.createElement("path",{d:"M213.92,218.62l-160-176A8,8,0,0,0,42.08,53.38L80,95.09V128a48,48,0,0,0,69.11,43.12l11.1,12.2A63.41,63.41,0,0,1,128,192a64.07,64.07,0,0,1-64-64,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.59a78.83,78.83,0,0,0,35.16-12.22l30.92,34a8,8,0,1,0,11.84-10.76ZM128,160a32,32,0,0,1-32-32V112.69l41.66,45.82A32,32,0,0,1,128,160Zm57.52-3.91A63.32,63.32,0,0,0,192,128a8,8,0,0,1,16,0,79.16,79.16,0,0,1-8.11,35.12,8,8,0,0,1-7.19,4.49,7.88,7.88,0,0,1-3.51-.82A8,8,0,0,1,185.52,156.09ZM84,44.87A48,48,0,0,1,176,64v64a49.19,49.19,0,0,1-.26,5,8,8,0,0,1-8,7.17,8.13,8.13,0,0,1-.84,0,8,8,0,0,1-7.12-8.79c.11-1.1.17-2.24.17-3.36V64A32,32,0,0,0,98.64,51.25,8,8,0,1,1,84,44.87Z"}))],["thin",p.createElement(p.Fragment,null,p.createElement("path",{d:"M211,221.31,51,45.31A4,4,0,0,0,45,50.69L84,93.55V128a44,44,0,0,0,66,38.12l16.38,18A67.21,67.21,0,0,1,128,196a68.07,68.07,0,0,1-68-68,4,4,0,0,0-8,0,76.09,76.09,0,0,0,72,75.89V240a4,4,0,0,0,8,0V203.89a75.1,75.1,0,0,0,39.79-13.77L205,226.69a4,4,0,1,0,5.92-5.38ZM128,164a36,36,0,0,1-36-36V102.35L144.43,160A35.83,35.83,0,0,1,128,164Zm61.12-6.15A67.44,67.44,0,0,0,196,128a4,4,0,0,1,8,0,75.28,75.28,0,0,1-7.7,33.37,4,4,0,0,1-7.18-3.52ZM87.63,46.46A44,44,0,0,1,172,64v64a44.2,44.2,0,0,1-.24,4.61,4,4,0,0,1-4,3.58l-.42,0a4,4,0,0,1-3.57-4.39A36.67,36.67,0,0,0,164,128V64A36,36,0,0,0,95,49.66a4,4,0,0,1-7.34-3.2Z"}))]]),Ml=p.forwardRef((e,t)=>p.createElement(Ke,{ref:t,...e,weights:Mp}));Ml.displayName="MicrophoneSlashIcon";const Pp=new Map([["bold",p.createElement(p.Fragment,null,p.createElement("path",{d:"M208,36H48A28,28,0,0,0,20,64V176a28,28,0,0,0,28,28H208a28,28,0,0,0,28-28V64A28,28,0,0,0,208,36Zm4,140a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Zm-40,52a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,228ZM160.49,103.51a12,12,0,0,1-17,17L140,117v35a12,12,0,0,1-24,0V117l-3.51,3.52a12,12,0,0,1-17-17l24-24a12,12,0,0,1,17,0Z"}))],["duotone",p.createElement(p.Fragment,null,p.createElement("path",{d:"M224,64V176a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V64A16,16,0,0,1,48,48H208A16,16,0,0,1,224,64Z",opacity:"0.2"}),p.createElement("path",{d:"M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8Zm-48,48a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224ZM157.66,106.34a8,8,0,0,1-11.32,11.32L136,107.31V152a8,8,0,0,1-16,0V107.31l-10.34,10.35a8,8,0,0,1-11.32-11.32l24-24a8,8,0,0,1,11.32,0Z"}))],["fill",p.createElement(p.Fragment,null,p.createElement("path",{d:"M168,224a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224ZM232,64V176a24,24,0,0,1-24,24H48a24,24,0,0,1-24-24V64A24,24,0,0,1,48,40H208A24,24,0,0,1,232,64Zm-74.34,42.34-24-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,11.32,11.32L120,107.31V152a8,8,0,0,0,16,0V107.31l10.34,10.35a8,8,0,0,0,11.32-11.32Z"}))],["light",p.createElement(p.Fragment,null,p.createElement("path",{d:"M208,42H48A22,22,0,0,0,26,64V176a22,22,0,0,0,22,22H208a22,22,0,0,0,22-22V64A22,22,0,0,0,208,42Zm10,134a10,10,0,0,1-10,10H48a10,10,0,0,1-10-10V64A10,10,0,0,1,48,54H208a10,10,0,0,1,10,10Zm-52,48a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,224Zm-9.76-116.24a6,6,0,1,1-8.48,8.48L134,102.49V152a6,6,0,0,1-12,0V102.49l-13.76,13.75a6,6,0,0,1-8.48-8.48l24-24a6,6,0,0,1,8.48,0Z"}))],["regular",p.createElement(p.Fragment,null,p.createElement("path",{d:"M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8Zm-48,48a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224ZM157.66,106.34a8,8,0,0,1-11.32,11.32L136,107.31V152a8,8,0,0,1-16,0V107.31l-10.34,10.35a8,8,0,0,1-11.32-11.32l24-24a8,8,0,0,1,11.32,0Z"}))],["thin",p.createElement(p.Fragment,null,p.createElement("path",{d:"M208,44H48A20,20,0,0,0,28,64V176a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V64A20,20,0,0,0,208,44Zm12,132a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V64A12,12,0,0,1,48,52H208a12,12,0,0,1,12,12Zm-56,48a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,224Zm-9.17-114.83a4,4,0,0,1-5.66,5.66L132,97.66V152a4,4,0,0,1-8,0V97.66l-17.17,17.17a4,4,0,0,1-5.66-5.66l24-24a4,4,0,0,1,5.66,0Z"}))]]),Pl=p.forwardRef((e,t)=>p.createElement(Ke,{ref:t,...e,weights:Pp}));Pl.displayName="MonitorArrowUpIcon";const Vp=new Map([["bold",p.createElement(p.Fragment,null,p.createElement("path",{d:"M140,32V64a12,12,0,0,1-24,0V32a12,12,0,0,1,24,0Zm33.25,62.75a12,12,0,0,0,8.49-3.52L204.37,68.6a12,12,0,0,0-17-17L164.77,74.26a12,12,0,0,0,8.48,20.49ZM224,116H192a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24Zm-42.26,48.77a12,12,0,1,0-17,17l22.63,22.63a12,12,0,0,0,17-17ZM128,180a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V192A12,12,0,0,0,128,180ZM74.26,164.77,51.63,187.4a12,12,0,0,0,17,17l22.63-22.63a12,12,0,1,0-17-17ZM76,128a12,12,0,0,0-12-12H32a12,12,0,0,0,0,24H64A12,12,0,0,0,76,128ZM68.6,51.63a12,12,0,1,0-17,17L74.26,91.23a12,12,0,0,0,17-17Z"}))],["duotone",p.createElement(p.Fragment,null,p.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),p.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"}))],["fill",p.createElement(p.Fragment,null,p.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm33.94,58.75,17-17a8,8,0,0,1,11.32,11.32l-17,17a8,8,0,0,1-11.31-11.31ZM48,136a8,8,0,0,1,0-16H72a8,8,0,0,1,0,16Zm46.06,37.25-17,17a8,8,0,0,1-11.32-11.32l17-17a8,8,0,0,1,11.31,11.31Zm0-79.19a8,8,0,0,1-11.31,0l-17-17A8,8,0,0,1,77.09,65.77l17,17A8,8,0,0,1,94.06,94.06ZM136,208a8,8,0,0,1-16,0V184a8,8,0,0,1,16,0Zm0-136a8,8,0,0,1-16,0V48a8,8,0,0,1,16,0Zm54.23,118.23a8,8,0,0,1-11.32,0l-17-17a8,8,0,0,1,11.31-11.31l17,17A8,8,0,0,1,190.23,190.23ZM208,136H184a8,8,0,0,1,0-16h24a8,8,0,0,1,0,16Z"}))],["light",p.createElement(p.Fragment,null,p.createElement("path",{d:"M134,32V64a6,6,0,0,1-12,0V32a6,6,0,0,1,12,0Zm39.25,56.75A6,6,0,0,0,177.5,87l22.62-22.63a6,6,0,0,0-8.48-8.48L169,78.5a6,6,0,0,0,4.24,10.25ZM224,122H192a6,6,0,0,0,0,12h32a6,6,0,0,0,0-12Zm-46.5,47A6,6,0,0,0,169,177.5l22.63,22.62a6,6,0,0,0,8.48-8.48ZM128,186a6,6,0,0,0-6,6v32a6,6,0,0,0,12,0V192A6,6,0,0,0,128,186ZM78.5,169,55.88,191.64a6,6,0,1,0,8.48,8.48L87,177.5A6,6,0,1,0,78.5,169ZM70,128a6,6,0,0,0-6-6H32a6,6,0,0,0,0,12H64A6,6,0,0,0,70,128ZM64.36,55.88a6,6,0,0,0-8.48,8.48L78.5,87A6,6,0,1,0,87,78.5Z"}))],["regular",p.createElement(p.Fragment,null,p.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"}))],["thin",p.createElement(p.Fragment,null,p.createElement("path",{d:"M132,32V64a4,4,0,0,1-8,0V32a4,4,0,0,1,8,0Zm41.25,54.75a4,4,0,0,0,2.83-1.18L198.71,63a4,4,0,0,0-5.66-5.66L170.43,79.92a4,4,0,0,0,2.82,6.83ZM224,124H192a4,4,0,0,0,0,8h32a4,4,0,0,0,0-8Zm-47.92,46.43a4,4,0,1,0-5.65,5.65l22.62,22.63a4,4,0,0,0,5.66-5.66ZM128,188a4,4,0,0,0-4,4v32a4,4,0,0,0,8,0V192A4,4,0,0,0,128,188ZM79.92,170.43,57.29,193.05A4,4,0,0,0,63,198.71l22.62-22.63a4,4,0,1,0-5.65-5.65ZM68,128a4,4,0,0,0-4-4H32a4,4,0,0,0,0,8H64A4,4,0,0,0,68,128ZM63,57.29A4,4,0,0,0,57.29,63L79.92,85.57a4,4,0,1,0,5.65-5.65Z"}))]]),vo=p.forwardRef((e,t)=>p.createElement(Ke,{ref:t,...e,weights:Vp}));vo.displayName="SpinnerIcon";const Np=new Map([["bold",p.createElement(p.Fragment,null,p.createElement("path",{d:"M249.45,69.31a12,12,0,0,0-12.51,1L212,88.43V72a20,20,0,0,0-20-20H32A20,20,0,0,0,12,72V184a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V167.57l24.94,18.14A12,12,0,0,0,256,176V80A12,12,0,0,0,249.45,69.31ZM188,180H36V76H188Zm44-27.57-20-14.54V118.11l20-14.54Z"}))],["duotone",p.createElement(p.Fragment,null,p.createElement("path",{d:"M200,72V184a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V72a8,8,0,0,1,8-8H192A8,8,0,0,1,200,72Z",opacity:"0.2"}),p.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"}))],["fill",p.createElement(p.Fragment,null,p.createElement("path",{d:"M192,72V184a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V72A16,16,0,0,1,32,56H176A16,16,0,0,1,192,72Zm58,.25a8.23,8.23,0,0,0-6.63,1.22L209.78,95.86A4,4,0,0,0,208,99.19v57.62a4,4,0,0,0,1.78,3.33l33.78,22.52a8,8,0,0,0,8.58.19,8.33,8.33,0,0,0,3.86-7.17V80A8,8,0,0,0,250,72.25Z"}))],["light",p.createElement(p.Fragment,null,p.createElement("path",{d:"M250.83,74.71a6,6,0,0,0-6.16.3L206,100.79V72a14,14,0,0,0-14-14H32A14,14,0,0,0,18,72V184a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V155.21L244.67,181a6,6,0,0,0,9.33-5V80A6,6,0,0,0,250.83,74.71ZM194,184a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V72a2,2,0,0,1,2-2H192a2,2,0,0,1,2,2Zm48-19.21-36-24V115.21l36-24Z"}))],["regular",p.createElement(p.Fragment,null,p.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"}))],["thin",p.createElement(p.Fragment,null,p.createElement("path",{d:"M249.89,76.47a4,4,0,0,0-4.11.2L204,104.53V72a12,12,0,0,0-12-12H32A12,12,0,0,0,20,72V184a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V151.47l41.78,27.86A4,4,0,0,0,252,176V80A4,4,0,0,0,249.89,76.47ZM196,184a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V72a4,4,0,0,1,4-4H192a4,4,0,0,1,4,4Zm48-15.47-40-26.67V114.14l40-26.67Z"}))]]),Vl=p.forwardRef((e,t)=>p.createElement(Ke,{ref:t,...e,weights:Np}));Vl.displayName="VideoCameraIcon";const Rp=new Map([["bold",p.createElement(p.Fragment,null,p.createElement("path",{d:"M249.45,69.31a12,12,0,0,0-12.51,1L212,88.43V72a20,20,0,0,0-20-20H123.88a12,12,0,0,0,0,24H188v68a12,12,0,0,0,4.46,9.33c.15.13.31.25.48.38l44,32A12,12,0,0,0,256,176V80A12,12,0,0,0,249.45,69.31ZM232,152.43l-20-14.54V118.11l20-14.54ZM56.88,31.93A12,12,0,1,0,39.12,48.07L42.69,52H32A20,20,0,0,0,12,72V184a20,20,0,0,0,20,20H180.87l18.25,20.07a12,12,0,0,0,17.76-16.14ZM36,180V76H64.51l94.55,104Z"}))],["duotone",p.createElement(p.Fragment,null,p.createElement("path",{d:"M200,72V184a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V72a8,8,0,0,1,8-8H192A8,8,0,0,1,200,72Z",opacity:"0.2"}),p.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H113.06a8,8,0,0,0,0,16H192v87.63a8,8,0,0,0,16,0V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM240,161.05l-32-21.33V116.28L240,95ZM53.92,34.62A8,8,0,1,0,42.08,45.38L51.73,56H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H182.64l19.44,21.38a8,8,0,1,0,11.84-10.76ZM32,184V72H66.28L168.1,184Z"}))],["fill",p.createElement(p.Fragment,null,p.createElement("path",{d:"M256,80.23v95.45a8.33,8.33,0,0,1-3.86,7.17,8,8,0,0,1-8.58-.19l-33.78-22.52a4,4,0,0,1-1.78-3.33V99.19a4,4,0,0,1,1.78-3.32l33.78-22.53a8,8,0,0,1,9.73.66A8.23,8.23,0,0,1,256,80.23ZM53.92,34.62A8,8,0,1,0,42.08,45.38L51.73,56H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H182.64l19.44,21.38a8,8,0,1,0,11.84-10.76ZM185,155.07a4,4,0,0,0,7-2.7V72a16,16,0,0,0-16-16H104a4,4,0,0,0-3,6.69Z"}))],["light",p.createElement(p.Fragment,null,p.createElement("path",{d:"M250.83,74.71a6,6,0,0,0-6.16.3L206,100.79V72a14,14,0,0,0-14-14H113.06a6,6,0,0,0,0,12H192a2,2,0,0,1,2,2v87.63a6,6,0,0,0,12,0v-4.42L244.67,181a6,6,0,0,0,9.33-5V80A6,6,0,0,0,250.83,74.71ZM242,164.79l-36-24V115.21l36-24ZM52.44,36A6,6,0,0,0,43.56,44L56.25,58H32A14,14,0,0,0,18,72V184a14,14,0,0,0,14,14H183.53l20,22a6,6,0,0,0,8.88-8.08ZM32,186a2,2,0,0,1-2-2V72a2,2,0,0,1,2-2H67.16L172.62,186Z"}))],["regular",p.createElement(p.Fragment,null,p.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H113.06a8,8,0,0,0,0,16H192v87.63a8,8,0,0,0,16,0V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM240,161.05l-32-21.33V116.28L240,95ZM53.92,34.62A8,8,0,1,0,42.08,45.38L51.73,56H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H182.64l19.44,21.38a8,8,0,1,0,11.84-10.76ZM32,184V72H66.28L168.1,184Z"}))],["thin",p.createElement(p.Fragment,null,p.createElement("path",{d:"M249.89,76.47a4,4,0,0,0-4.11.2L204,104.53V72a12,12,0,0,0-12-12H113.06a4,4,0,0,0,0,8H192a4,4,0,0,1,4,4v87.63a4,4,0,0,0,8,0v-8.16l41.78,27.86A4,4,0,0,0,252,176V80A4,4,0,0,0,249.89,76.47ZM244,168.53l-40-26.67V114.14l40-26.67ZM51,37.31A4,4,0,0,0,45,42.69L60.78,60H32A12,12,0,0,0,20,72V184a12,12,0,0,0,12,12H184.41L205,218.69a4,4,0,1,0,5.92-5.38ZM32,188a4,4,0,0,1-4-4V72a4,4,0,0,1,4-4H68.05L177.14,188Z"}))]]),Nl=p.forwardRef((e,t)=>p.createElement(Ke,{ref:t,...e,weights:Rp}));Nl.displayName="VideoCameraSlashIcon";function Xi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ip(...e){return t=>{let n=!1;const s=e.map(r=>{const o=Xi(r,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let r=0;r<s.length;r++){const o=s[r];typeof o=="function"?o():Xi(e[r],null)}}}}function Dp(e){const t=Fp(e),n=p.forwardRef((s,r)=>{const{children:o,...i}=s,a=p.Children.toArray(o),c=a.find(Lp);if(c){const d=c.props.children,u=a.map(f=>f===c?p.Children.count(d)>1?p.Children.only(null):p.isValidElement(d)?d.props.children:null:f);return l.jsx(t,{...i,ref:r,children:p.isValidElement(d)?p.cloneElement(d,void 0,u):null})}return l.jsx(t,{...i,ref:r,children:o})});return n.displayName=`${e}.Slot`,n}var $p=Dp("Slot");function Fp(e){const t=p.forwardRef((n,s)=>{const{children:r,...o}=n;if(p.isValidElement(r)){const i=Bp(r),a=_p(o,r.props);return r.type!==p.Fragment&&(a.ref=s?Ip(s,i):i),p.cloneElement(r,a)}return p.Children.count(r)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Op=Symbol("radix.slottable");function Lp(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Op}function _p(e,t){const n={...t};for(const s in t){const r=e[s],o=t[s];/^on[A-Z]/.test(s)?r&&o?n[s]=(...a)=>{const c=o(...a);return r(...a),c}:r&&(n[s]=r):s==="style"?n[s]={...r,...o}:s==="className"&&(n[s]=[r,o].filter(Boolean).join(" "))}return{...e,...n}}function Bp(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const wo="-",zp=e=>{const t=Up(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:i=>{const a=i.split(wo);return a[0]===""&&a.length!==1&&a.shift(),Rl(a,t)||Hp(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&s[i]?[...c,...s[i]]:c}}},Rl=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),r=s?Rl(e.slice(1),s):void 0;if(r)return r;if(t.validators.length===0)return;const o=e.join(wo);return(i=t.validators.find(({validator:a})=>a(o)))==null?void 0:i.classGroupId},Ji=/^\[(.+)\]$/,Hp=e=>{if(Ji.test(e)){const t=Ji.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Up=e=>{const{theme:t,classGroups:n}=e,s={nextPart:new Map,validators:[]};for(const r in n)Ar(n[r],s,r,t);return s},Ar=(e,t,n,s)=>{e.forEach(r=>{if(typeof r=="string"){const o=r===""?t:Qi(t,r);o.classGroupId=n;return}if(typeof r=="function"){if(Zp(r)){Ar(r(s),t,n,s);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([o,i])=>{Ar(i,Qi(t,o),n,s)})})},Qi=(e,t)=>{let n=e;return t.split(wo).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},Zp=e=>e.isThemeGetter,Wp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const r=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,s=n,n=new Map)};return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=s.get(o))!==void 0)return r(o,i),i},set(o,i){n.has(o)?n.set(o,i):r(o,i)}}},jr="!",Mr=":",Gp=Mr.length,Kp=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=r=>{const o=[];let i=0,a=0,c=0,d;for(let x=0;x<r.length;x++){let m=r[x];if(i===0&&a===0){if(m===Mr){o.push(r.slice(c,x)),c=x+Gp;continue}if(m==="/"){d=x;continue}}m==="["?i++:m==="]"?i--:m==="("?a++:m===")"&&a--}const u=o.length===0?r:r.substring(c),f=Yp(u),h=f!==u,g=d&&d>c?d-c:void 0;return{modifiers:o,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:g}};if(t){const r=t+Mr,o=s;s=i=>i.startsWith(r)?o(i.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const r=s;s=o=>n({className:o,parseClassName:r})}return s},Yp=e=>e.endsWith(jr)?e.substring(0,e.length-1):e.startsWith(jr)?e.substring(1):e,qp=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(s=>[s,!0]));return s=>{if(s.length<=1)return s;const r=[];let o=[];return s.forEach(i=>{i[0]==="["||t[i]?(r.push(...o.sort(),i),o=[]):o.push(i)}),r.push(...o.sort()),r}},Xp=e=>({cache:Wp(e.cacheSize),parseClassName:Kp(e),sortModifiers:qp(e),...zp(e)}),Jp=/\s+/,Qp=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:r,sortModifiers:o}=t,i=[],a=e.trim().split(Jp);let c="";for(let d=a.length-1;d>=0;d-=1){const u=a[d],{isExternal:f,modifiers:h,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:m}=n(u);if(f){c=u+(c.length>0?" "+c:c);continue}let b=!!m,k=s(b?x.substring(0,m):x);if(!k){if(!b){c=u+(c.length>0?" "+c:c);continue}if(k=s(x),!k){c=u+(c.length>0?" "+c:c);continue}b=!1}const v=o(h).join(":"),T=g?v+jr:v,w=T+k;if(i.includes(w))continue;i.push(w);const S=r(k,b);for(let A=0;A<S.length;++A){const M=S[A];i.push(T+M)}c=u+(c.length>0?" "+c:c)}return c};function e0(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Il(t))&&(s&&(s+=" "),s+=n);return s}const Il=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=Il(e[s]))&&(n&&(n+=" "),n+=t);return n};function t0(e,...t){let n,s,r,o=i;function i(c){const d=t.reduce((u,f)=>f(u),e());return n=Xp(d),s=n.cache.get,r=n.cache.set,o=a,a(c)}function a(c){const d=s(c);if(d)return d;const u=Qp(c,n);return r(c,u),u}return function(){return o(e0.apply(null,arguments))}}const Me=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Dl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$l=/^\((?:(\w[\w-]*):)?(.+)\)$/i,n0=/^\d+\/\d+$/,s0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,r0=/\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$/,o0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,i0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mt=e=>n0.test(e),re=e=>!!e&&!Number.isNaN(Number(e)),ct=e=>!!e&&Number.isInteger(Number(e)),Us=e=>e.endsWith("%")&&re(e.slice(0,-1)),et=e=>s0.test(e),c0=()=>!0,l0=e=>r0.test(e)&&!o0.test(e),Fl=()=>!1,d0=e=>i0.test(e),u0=e=>a0.test(e),f0=e=>!W(e)&&!G(e),h0=e=>en(e,_l,Fl),W=e=>Dl.test(e),xt=e=>en(e,Bl,l0),Zs=e=>en(e,x0,re),ea=e=>en(e,Ol,Fl),m0=e=>en(e,Ll,u0),Ln=e=>en(e,zl,d0),G=e=>$l.test(e),an=e=>tn(e,Bl),p0=e=>tn(e,b0),ta=e=>tn(e,Ol),g0=e=>tn(e,_l),y0=e=>tn(e,Ll),_n=e=>tn(e,zl,!0),en=(e,t,n)=>{const s=Dl.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},tn=(e,t,n=!1)=>{const s=$l.exec(e);return s?s[1]?t(s[1]):n:!1},Ol=e=>e==="position"||e==="percentage",Ll=e=>e==="image"||e==="url",_l=e=>e==="length"||e==="size"||e==="bg-size",Bl=e=>e==="length",x0=e=>e==="number",b0=e=>e==="family-name",zl=e=>e==="shadow",v0=()=>{const e=Me("color"),t=Me("font"),n=Me("text"),s=Me("font-weight"),r=Me("tracking"),o=Me("leading"),i=Me("breakpoint"),a=Me("container"),c=Me("spacing"),d=Me("radius"),u=Me("shadow"),f=Me("inset-shadow"),h=Me("text-shadow"),g=Me("drop-shadow"),x=Me("blur"),m=Me("perspective"),b=Me("aspect"),k=Me("ease"),v=Me("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...w(),G,W],A=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],j=()=>[G,W,c],z=()=>[Mt,"full","auto",...j()],y=()=>[ct,"none","subgrid",G,W],D=()=>["auto",{span:["full",ct,G,W]},ct,G,W],_=()=>[ct,"auto",G,W],J=()=>["auto","min","max","fr",G,W],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],se=()=>["auto",...j()],K=()=>[Mt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],R=()=>[e,G,W],X=()=>[...w(),ta,ea,{position:[G,W]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",g0,h0,{size:[G,W]}],q=()=>[Us,an,xt],P=()=>["","none","full",d,G,W],E=()=>["",re,an,xt],O=()=>["solid","dashed","dotted","double"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>[re,Us,ta,ea],I=()=>["","none",x,G,W],H=()=>["none",re,G,W],B=()=>["none",re,G,W],oe=()=>[re,G,W],L=()=>[Mt,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[et],breakpoint:[et],color:[c0],container:[et],"drop-shadow":[et],ease:["in","out","in-out"],font:[f0],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[et],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[et],shadow:[et],spacing:["px",re],text:[et],"text-shadow":[et],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Mt,W,G,b]}],container:["container"],columns:[{columns:[re,W,G,a]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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"],sr:["sr-only","not-sr-only"],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:S()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{start:z()}],end:[{end:z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[ct,"auto",G,W]}],basis:[{basis:[Mt,"full","auto",a,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[re,Mt,"auto","initial","none",W]}],grow:[{grow:["",re,G,W]}],shrink:[{shrink:["",re,G,W]}],order:[{order:[ct,"first","last","none",G,W]}],"grid-cols":[{"grid-cols":y()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":y()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:se()}],mx:[{mx:se()}],my:[{my:se()}],ms:[{ms:se()}],me:[{me:se()}],mt:[{mt:se()}],mr:[{mr:se()}],mb:[{mb:se()}],ml:[{ml:se()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[a,"screen",...K()]}],"min-w":[{"min-w":[a,"screen","none",...K()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,an,xt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,G,Zs]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Us,W]}],"font-family":[{font:[p0,W,t]}],"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:[r,G,W]}],"line-clamp":[{"line-clamp":[re,"none",G,Zs]}],leading:[{leading:[o,...j()]}],"list-image":[{"list-image":["none",G,W]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",G,W]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:[re,"from-font","auto",G,xt]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[re,"auto",G,W]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",G,W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",G,W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ct,G,W],radial:["",G,W],conic:[ct,G,W]},y0,m0]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:E()}],"border-w-x":[{"border-x":E()}],"border-w-y":[{"border-y":E()}],"border-w-s":[{"border-s":E()}],"border-w-e":[{"border-e":E()}],"border-w-t":[{"border-t":E()}],"border-w-r":[{"border-r":E()}],"border-w-b":[{"border-b":E()}],"border-w-l":[{"border-l":E()}],"divide-x":[{"divide-x":E()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":E()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...O(),"hidden","none"]}],"divide-style":[{divide:[...O(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...O(),"none","hidden"]}],"outline-offset":[{"outline-offset":[re,G,W]}],"outline-w":[{outline:["",re,an,xt]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",u,_n,Ln]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",f,_n,Ln]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:E()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[re,xt]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":E()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",h,_n,Ln]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[re,G,W]}],"mix-blend":[{"mix-blend":[...F(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":F()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[re]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[G,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[re]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",G,W]}],filter:[{filter:["","none",G,W]}],blur:[{blur:I()}],brightness:[{brightness:[re,G,W]}],contrast:[{contrast:[re,G,W]}],"drop-shadow":[{"drop-shadow":["","none",g,_n,Ln]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",re,G,W]}],"hue-rotate":[{"hue-rotate":[re,G,W]}],invert:[{invert:["",re,G,W]}],saturate:[{saturate:[re,G,W]}],sepia:[{sepia:["",re,G,W]}],"backdrop-filter":[{"backdrop-filter":["","none",G,W]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[re,G,W]}],"backdrop-contrast":[{"backdrop-contrast":[re,G,W]}],"backdrop-grayscale":[{"backdrop-grayscale":["",re,G,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[re,G,W]}],"backdrop-invert":[{"backdrop-invert":["",re,G,W]}],"backdrop-opacity":[{"backdrop-opacity":[re,G,W]}],"backdrop-saturate":[{"backdrop-saturate":[re,G,W]}],"backdrop-sepia":[{"backdrop-sepia":["",re,G,W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",G,W]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[re,"initial",G,W]}],ease:[{ease:["linear","initial",k,G,W]}],delay:[{delay:[re,G,W]}],animate:[{animate:["none",v,G,W]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,G,W]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:H()}],"rotate-x":[{"rotate-x":H()}],"rotate-y":[{"rotate-y":H()}],"rotate-z":[{"rotate-z":H()}],scale:[{scale:B()}],"scale-x":[{"scale-x":B()}],"scale-y":[{"scale-y":B()}],"scale-z":[{"scale-z":B()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[G,W,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:L()}],"translate-x":[{"translate-x":L()}],"translate-y":[{"translate-y":L()}],"translate-z":[{"translate-z":L()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",G,W]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",G,W]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[re,an,xt,Zs]}],stroke:[{stroke:["none",...R()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},w0=t0(v0);function Y(...e){return w0($r.clsx(e))}function S0(e,t){return{id:e.streamInfo.id,timestamp:e.streamInfo.timestamp,message:e.text,from:e.participantInfo.identity===t.localParticipant.identity?t.localParticipant:Array.from(t.remoteParticipants.values()).find(n=>n.identity===e.participantInfo.identity)}}const C0=Dr.cva(["text-xs font-bold tracking-wider uppercase whitespace-nowrap","inline-flex items-center justify-center gap-2 shrink-0 rounded-full cursor-pointer outline-none transition-colors duration-300","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","disabled:pointer-events-none disabled:opacity-50","aria-invalid:ring-destructive/20 aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40 ","[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0"],{variants:{variant:{default:"bg-button text-button-foreground hover:bg-muted focus:bg-muted",destructive:["bg-destructive text-destructive-foreground","hover:bg-destructive-hover focus:bg-destructive-hover focus-visible:ring-destructive-foreground/20","dark:focus-visible:ring-destructive-foreground/40"],outline:["border bg-background","hover:bg-accent hover:text-accent-foreground","dark:bg-input/30 dark:border-input dark:hover:bg-input/50"],primary:"",secondary:"bg-secondary text-secondary-foregroun hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function k0({className:e,variant:t,size:n,asChild:s=!1,...r}){const o=s?$p:"button";return l.jsx(o,{"data-slot":"button",className:Y(C0({variant:t,size:n,className:e})),...r})}function T0({onSend:e,className:t,disabled:n,...s}){const r=C.useRef(null),[o,i]=C.useState(""),a=d=>{var u,f;d.preventDefault(),(u=s.onSubmit)==null||u.call(s,d),e==null||e(o),i(""),(f=r.current)==null||f.focus({preventScroll:!0})},c=n||o.trim().length===0;return l.jsxs("form",{...s,onSubmit:a,className:Y("flex items-center rounded-md pl-1 text-sm",t),children:[l.jsx("input",{ref:r,type:"text",className:"flex-1 focus:outline-none",placeholder:"Type something...",value:o,onChange:d=>i(d.target.value),disabled:n}),l.jsx(k0,{size:"sm",type:"submit",variant:c?"secondary":"primary",disabled:c,className:"font-mono",children:"SEND"})]})}const E0=Dr.cva(["inline-flex items-center justify-center gap-2 rounded-full","text-sm font-medium whitespace-nowrap","cursor-pointer outline-none transition-[color,border,background-color]","!focus:ring-0 !focus-visible:ring-0 !focus:border-none !focus-visible:border-none !ring-0 !border-none !outline-none","aria-invalid:ring-0 dark:aria-invalid:ring-0 aria-invalid:border-0","disabled:pointer-events-none disabled:opacity-50 disabled:not-allowed","data-[state=on]:bg-button-selected data-[state=on]:border-button-border-selected","[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0"],{variants:{variant:{default:"bg-button hover:bg-muted focus:bg-muted hover:text-muted-foreground focus:text-muted-foreground",primary:"text-fg1 bg-button hover:bg-button-hover focus:bg-button-hover data-[state=off]:bg-button-primary hover:data-[state=off]:bg-button-hover data-[state=off]:text-button-primary-foreground",secondary:"text-fg1 bg-button hover:bg-button-hover focus:bg-button-hover data-[state=on]:bg-button-secondary hover:data-[state=on]:bg-button-secondary data-[state=on]:text-button-secondary-foreground",outline:["border border-button-border bg-button text-button-foreground","hover:bg-background focus:bg-background"]},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function Hl({className:e,variant:t,size:n,...s}){return l.jsx(Ud.Root,{"data-slot":"toggle",className:Y(E0({variant:t,size:n,className:e})),...s})}function A0(e){const[t,n]=C.useState(()=>e.getPublishPermissions());return C.useEffect(()=>{const s=()=>{n(e.getPublishPermissions())},r=()=>{s()};return e.on("connection.connected",r),e.on("connection.disconnected",r),()=>{e.off("connection.connected",r),e.off("connection.disconnected",r)}},[e]),t}function Ul(e){const[t,n]=C.useState(()=>e.getLocalParticipant()),[s,r]=C.useState(()=>e.getMicrophoneTrack());return C.useEffect(()=>{const o=()=>{const a=e.getLocalParticipant(),c=e.getMicrophoneTrack();console.log("🎤 useVoxketLocalParticipant: Updating state:",{hasParticipant:!!a,hasMicTrack:!!c,isMicEnabled:e.isMicrophoneEnabled,trackPublications:a?a.trackPublications.size:0}),n(a),r(c)};o(),e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("track.muted",o),e.on("track.unmuted",o);const i=e.getRoom();if(i){const a=()=>{console.log("🎤 Track published, updating participant state"),o()},c=()=>{console.log("🎤 Track unpublished, updating participant state"),o()};return i.on("localTrackPublished",a),i.on("localTrackUnpublished",c),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o),i.off("localTrackPublished",a),i.off("localTrackUnpublished",c)}}else return()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o)}},[e]),{localParticipant:t,microphoneTrack:s}}function gn(e,t,n){const[s,r]=C.useState(!1),[o,i]=C.useState(!1);return C.useEffect(()=>{const c=()=>{let d=!1;switch(t){case"microphone":d=e.isMicrophoneEnabled;break;case"camera":d=e.isCameraEnabled;break;case"screenShare":d=e.isScreenShareEnabled;break}console.log(`useVoxketTrackToggle: ${t} enabled state updated to:`,d),r(d)};return c(),e.on("track.muted",c),e.on("track.unmuted",c),e.on("connection.connected",c),()=>{e.off("track.muted",c),e.off("track.unmuted",c),e.off("connection.connected",c)}},[e,t]),{enabled:s,pending:o,toggle:async c=>{var d;try{i(!0);const u=c!==void 0?c:!s;switch(t){case"microphone":await e.toggleMicrophone(u);break;case"camera":await e.toggleCamera(u);break;case"screenShare":u?await e.startScreenShare():await e.stopScreenShare();break}}catch(u){(d=n==null?void 0:n.onDeviceError)==null||d.call(n,u)}finally{i(!1)}}}}function Zl(e){const[t,n]=C.useState(()=>e.getRoom()),[s,r]=C.useState(()=>e.getConnectionState());return C.useEffect(()=>{const o=()=>{n(e.getRoom()),r(e.getConnectionState())};return e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("connection.connecting",o),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("connection.connecting",o)}},[e]),t}function j0(e,t){const[n,s]=C.useState([]),[r,o]=C.useState("");return C.useEffect(()=>{var d;const a=async()=>{try{const u=t==="audioinput"?await e.getAudioInputDevices():await e.getVideoInputDevices();s(u)}catch(u){console.error("Failed to load devices:",u)}};a();const c=()=>{a()};return(d=navigator.mediaDevices)==null||d.addEventListener("devicechange",c),()=>{var u;(u=navigator.mediaDevices)==null||u.removeEventListener("devicechange",c)}},[e,t]),{devices:n,activeDeviceId:r,setActiveMediaDevice:async a=>{try{t==="audioinput"?await e.setAudioInputDevice(a):await e.setVideoInputDevice(a),o(a)}catch(c){console.error("Failed to set device:",c)}}}}function M0(e){const{preventSave:t=!1}=e||{};return{saveAudioInputEnabled:i=>{t||localStorage.setItem("voxket-audio-input-enabled",i.toString())},saveAudioInputDeviceId:i=>{t||localStorage.setItem("voxket-audio-input-device-id",i)},saveVideoInputEnabled:i=>{t||localStorage.setItem("voxket-video-input-enabled",i.toString())},saveVideoInputDeviceId:i=>{t||localStorage.setItem("voxket-video-input-device-id",i)}}}function Wl(e){const[t,n]=C.useState(()=>e.getIsAgentConnected()),[s,r]=C.useState(()=>e.getCurrentSession()),[o,i]=C.useState(()=>e.getCurrentAgentInfo()),[a,c]=C.useState(()=>e.getAgentState()),[d,u]=C.useState(()=>e.getAgentAudioTrack()),[f,h]=C.useState(()=>e.getAgentVideoTrack());return C.useEffect(()=>{const g=()=>{const T=e.getIsAgentConnected(),w=e.getCurrentSession(),S=e.getCurrentAgentInfo(),A=e.getAgentState(),M=e.getAgentAudioTrack(),j=e.getAgentVideoTrack();console.log("🤖 useVoxketVoiceAssistant: Updating state:",{isAgentConnected:T,hasSession:!!w,sessionId:w==null?void 0:w.id,hasAgentInfo:!!S,agentState:A,hasAudioTrack:!!M,hasVideoTrack:!!j}),n(T),r(w),i(S),c(A),u(M),h(j)};g();const x=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent connected event"),g()},m=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent disconnected event"),g()},b=()=>{console.log("🤖 useVoxketVoiceAssistant: Session changed event"),g()},k=()=>{console.log("🤖 useVoxketVoiceAssistant: Connection changed event"),g()},v=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent state changed event"),g()};return e.on("agent.connected",x),e.on("agent.speaking",x),e.on("agent.thinking",x),e.on("agent.state.changed",v),e.on("connection.disconnected",m),e.on("session.created",b),e.on("session.ended",b),e.on("session.state.changed",b),e.on("connection.connected",k),()=>{e.off("agent.connected",x),e.off("agent.speaking",x),e.off("agent.thinking",x),e.off("agent.state.changed",v),e.off("connection.disconnected",m),e.off("session.created",b),e.off("session.ended",b),e.off("session.state.changed",b),e.off("connection.connected",k)}},[e]),{agent:{isActive:t,info:o},session:s,state:a,audioTrack:d,videoTrack:f}}function P0(e){const[t,n]=C.useState(()=>e.getVideoTrackRefs()),[s,r]=C.useState(()=>e.getCameraTrackRefs()),[o,i]=C.useState(()=>e.getScreenShareTrackRefs());return C.useEffect(()=>{const a=()=>{const d=e.getVideoTrackRefs(),u=e.getCameraTrackRefs(),f=e.getScreenShareTrackRefs();console.log("📹 useVoxketVideoTracks: Updating tracks:",{videoCount:d.length,cameraCount:u.length,screenShareCount:f.length}),n(d),r(u),i(f)};a(),e.on("connection.connected",a),e.on("connection.disconnected",a),e.on("track.muted",a),e.on("track.unmuted",a),e.on("participant.joined",a),e.on("participant.left",a);const c=e.getRoom();if(c){const d=()=>{console.log("📹 Track event, updating video tracks"),a()};return c.on("localTrackPublished",d),c.on("localTrackUnpublished",d),c.on("trackPublished",d),c.on("trackUnpublished",d),c.on("trackSubscribed",d),c.on("trackUnsubscribed",d),()=>{e.off("connection.connected",a),e.off("connection.disconnected",a),e.off("track.muted",a),e.off("track.unmuted",a),e.off("participant.joined",a),e.off("participant.left",a),c.off("localTrackPublished",d),c.off("localTrackUnpublished",d),c.off("trackPublished",d),c.off("trackUnpublished",d),c.off("trackSubscribed",d),c.off("trackUnsubscribed",d)}}else return()=>{e.off("connection.connected",a),e.off("connection.disconnected",a),e.off("track.muted",a),e.off("track.unmuted",a),e.off("participant.joined",a),e.off("participant.left",a)}},[e]),{videoTrackRefs:t,cameraTrackRefs:s,screenShareTrackRefs:o}}function na({...e}){return l.jsx(ze.Root,{"data-slot":"select",...e})}function sa({...e}){return l.jsx(ze.Value,{"data-slot":"select-value",...e})}function ra({className:e,size:t="default",children:n,...s}){return l.jsxs(ze.Trigger,{"data-slot":"select-trigger","data-size":t,className:Y(["flex w-fit cursor-pointer items-center justify-between gap-2","rounded-full px-3 py-2 text-sm whitespace-nowrap","bg-button transition-[color,border,background-color]","disabled:cursor-not-allowed disabled:opacity-50","hover:bg-muted hover:text-muted-foreground","!focus:ring-0 !focus-visible:ring-0 !focus:border-none !focus-visible:border-none !ring-0 !border-none !outline-none","aria-invalid:ring-0 dark:aria-invalid:ring-0","data-[placeholder]:text-muted-foreground","data-[size=default]:h-9 data-[size=sm]:h-8","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2","[&:not([class*='text-'])_svg:not([class*='text-'])]:text-muted-foreground","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"],e),...s,children:[n,l.jsx(ze.Icon,{asChild:!0,children:l.jsx(bo,{weight:"bold",className:"size-4 transition-colors"})})]})}function oa({className:e,children:t,position:n="popper",...s}){return l.jsx(ze.Portal,{children:l.jsxs(ze.Content,{"data-slot":"select-content",className:Y(["bg-[#18182a]/90 backdrop-blur-md text-white border border-[#23233a] shadow-2xl","relative z-50 overflow-x-hidden overflow-y-auto rounded-xl","max-h-(--radix-select-content-available-height) min-w-[8rem]","origin-(--radix-select-content-transform-origin)","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=top]:slide-in-from-bottom-2","data-[side=right]:slide-in-from-left-2","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2"],n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...s,children:[l.jsx(V0,{}),l.jsx(ze.Viewport,{className:Y("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),l.jsx(N0,{})]})})}function ia({className:e,children:t,...n}){return l.jsxs(ze.Item,{"data-slot":"select-item",className:Y(["relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none","cursor-pointer disabled:cursor-not-allowed","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2","[&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"],e),...n,children:[l.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:l.jsx(ze.ItemIndicator,{children:l.jsx(Al,{className:"size-4",weight:"bold"})})}),l.jsx(ze.ItemText,{children:t})]})}function V0({className:e,...t}){return l.jsx(ze.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:Y("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Tl,{className:"size-4",weight:"bold"})})}function N0({className:e,...t}){return l.jsx(ze.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:Y("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(bo,{className:"size-4",weight:"bold"})})}const aa=Dr.cva(["w-full rounded-full px-3 py-2 text-sm cursor-pointer","disabled:not-allowed hover:bg-button-hover focus:bg-button-hover"],{variants:{size:{default:"w-[180px]",sm:"w-auto"}},defaultVariants:{size:"default"}});function ca({kind:e,track:t,requestPermissions:n,onError:s,client:r,...o}){const i=o.size||"default";if(!r)return l.jsxs(na,{disabled:!0,children:[l.jsx(ra,{className:Y(aa({size:i}),o.className),children:l.jsx(sa,{placeholder:`Select a ${e}`})}),l.jsx(oa,{children:l.jsx(ia,{value:"none",children:"No devices available"})})]});const{devices:a,activeDeviceId:c,setActiveMediaDevice:d}=j0(r,e==="audioinput"?"audioinput":"videoinput");return l.jsxs(na,{value:c,onValueChange:d,children:[l.jsx(ra,{className:Y(aa({size:i}),o.className,"hover:bg"),children:i!=="sm"&&l.jsx(sa,{className:"font-mono text-sm",placeholder:`Select a ${e}`})}),l.jsx(oa,{children:a.map(u=>l.jsx(ia,{value:u.deviceId,className:"font-mono text-xs",children:u.label},u.deviceId))})]})}function R0(e,t,n=!1){if(n)return vo;switch(e){case Z.Track.Source.Microphone:return t?jl:Ml;case Z.Track.Source.Camera:return t?Vl:Nl;case Z.Track.Source.ScreenShare:return Pl;default:return p.Fragment}}function Ws({source:e,pressed:t,pending:n,className:s,...r}){const o=R0(e,t??!1,n),i=e===Z.Track.Source.Microphone&&!(t??!1)&&!n,a=e===Z.Track.Source.Camera&&!(t??!1)&&!n;return p.useEffect(()=>{console.log(`TrackToggle for ${e} changed: pressed=${t}, pending=${n}, actualState=${t?"enabled":"disabled"}`)},[e,t,n]),l.jsxs(Hl,{pressed:t,"aria-label":`Toggle ${e}`,className:Y(s),...r,children:[l.jsx(o,{weight:"bold",className:Y(n&&"animate-spin",i||a?"text-red-500":void 0)}),r.children]})}function I0(e){return e?A0(e):{camera:!0,microphone:!0,screenShare:!0,data:!0}}function D0(e={}){const{controls:t,saveUserChoices:n=!0,client:s}=e,r={leave:!0,...t};if(!s)return{micTrackRef:{participant:void 0,source:Z.Track.Source.Microphone,publication:void 0},visibleControls:r,microphoneToggle:{enabled:!1,pending:!1,toggle:async()=>{}},cameraToggle:{enabled:!1,pending:!1,toggle:async()=>{}},screenShareToggle:{enabled:!1,pending:!1,toggle:async()=>{}},handleDisconnect:()=>{},handleAudioDeviceChange:()=>{},handleVideoDeviceChange:()=>{}};const{microphoneTrack:o,localParticipant:i}=Ul(s),a=I0(s);Zl(s);const c=gn(s,"microphone",{onDeviceError:A=>{var M;return(M=e.onDeviceError)==null?void 0:M.call(e,{source:Z.Track.Source.Microphone,error:A})}}),d=gn(s,"camera",{onDeviceError:A=>{var M;return(M=e.onDeviceError)==null?void 0:M.call(e,{source:Z.Track.Source.Camera,error:A})}}),u=gn(s,"screenShare",{onDeviceError:A=>{var M;return(M=e.onDeviceError)==null?void 0:M.call(e,{source:Z.Track.Source.ScreenShare,error:A})}}),f=p.useMemo(()=>{let A;if(i){for(const[,M]of i.trackPublications)if(M.source===Z.Track.Source.Microphone){A=M;break}}return console.log("🎤 Creating micTrackRef:",{hasParticipant:!!i,hasPublication:!!A,isTrackSubscribed:A==null?void 0:A.isSubscribed,isMuted:A==null?void 0:A.isMuted,trackSid:A==null?void 0:A.trackSid}),{participant:i??void 0,source:Z.Track.Source.Microphone,publication:A}},[i,o]);r.microphone??(r.microphone=a.microphone),r.screenShare??(r.screenShare=a.screenShare),r.camera??(r.camera=a.camera),r.chat??(r.chat=a.data);const{saveAudioInputEnabled:h,saveAudioInputDeviceId:g,saveVideoInputEnabled:x,saveVideoInputDeviceId:m}=M0({preventSave:!n}),b=p.useCallback(()=>{s&&(typeof s.endSession=="function"?(s.endSession(),console.log("✅ AgentControlBar: Session ended via client.endSession()")):(s.disconnect(),console.log("⚠️ AgentControlBar: Using fallback client.disconnect()")))},[s]),k=p.useCallback(A=>{g(A??"default"),s&&s.setAudioInputDevice(A)},[g,s]),v=p.useCallback(A=>{m(A??"default"),s&&s.setVideoInputDevice(A)},[m,s]),T=p.useCallback(async A=>{u.enabled&&await u.toggle(!1),await d.toggle(A),x(!d.enabled)},[d,x,u]),w=p.useCallback(async A=>{await c.toggle(A),h(!c.enabled)},[c,h]),S=p.useCallback(async A=>{d.enabled&&await d.toggle(!1),await u.toggle(A)},[d,u]);return{micTrackRef:f,visibleControls:r,cameraToggle:{...d,toggle:T},microphoneToggle:{...c,toggle:w},screenShareToggle:{...u,toggle:S},handleDisconnect:b,handleAudioDeviceChange:k,handleVideoDeviceChange:v}}const $0={card:" bg-gradient-to-br from-black to-gray-900 border border-gray-900 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto rounded-2xl shadow-lg",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-black/90 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-gray-800/20 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-gray-600/10 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-gray-500/8 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-gray-400 to-gray-500 rounded-full blur-sm opacity-20 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-gray-500 to-gray-600 rounded-full blur-sm opacity-15 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-black to-gray-900 rounded-2xl shadow-xl p-0 overflow-hidden h-full",text:{primary:"text-white",secondary:"text-gray-300",muted:"text-gray-400",accent:"bg-clip-text text-transparent bg-gradient-to-r from-white via-gray-200 to-gray-300"},micButton:"absolute w-20 h-20 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 mic-glow shadow-2xl group",chatButton:"absolute w-20 h-20 bg-gradient-to-br from-[#10B981] to-[#059669] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",videoButton:"absolute w-20 h-20 bg-gradient-to-br from-[#8B5CF6] to-[#EC4899] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",popupTrigger:"bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] text-white font-medium hover:from-[#2563EB] hover:to-[#7C3AED] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-900",promptSlider:"absolute w-full py-3 px-2 bg-gray-900 rounded-xl text-center text-white text-sm transition-opacity duration-700 ease-in-out border border-gray-600",statusIndicator:"w-2 h-2 bg-gray-400 rounded-full animate-pulse",pulseRings:{ring1:"w-32 h-32 rounded-full border-2 border-gray-600/30 pulse-ring",ring2:"absolute w-28 h-28 rounded-full border-2 border-gray-500/20 pulse-ring",ring3:"absolute w-24 h-24 rounded-full border-2 border-gray-400/15 pulse-ring"},controlBar:"border border-gray-600 rounded-3xl py-4 flex flex-col justify-end h-full bg-gray-900/50 backdrop-blur-sm",chatInput:{container:"bg-gray-900 w-full border-gray-600",textarea:"bg-gray-800 border-none text-white placeholder-gray-400",sendButton:"bg-blue-600 hover:bg-blue-700 disabled:bg-gray-600 disabled:opacity-50 text-white",attachButton:"text-gray-400 hover:text-gray-300 hover:bg-gray-700",endButton:"bg-red-900/20 hover:bg-red-800/30 text-red-400 border-red-800"},chatMessage:{own:"bg-gray-600 text-white",other:"bg-gray-700 text-white"},chatHeader:{container:"bg-gray-900 border-gray-600",backButton:"text-gray-400 hover:text-white hover:bg-gray-700"},spinner:"w-10 h-10 animate-spin text-gray-400 mb-2",suggestedResponse:{container:"bg-gray-800 text-blue-300 border-gray-700 hover:bg-gray-700 hover:text-white"},video:{container:"bg-gradient-to-br from-black to-gray-900 text-white",header:"border-gray-700 bg-gray-900/50",headerButton:"bg-gray-800 hover:bg-gray-700 text-gray-300",statusDot:"bg-green-500 animate-pulse",controlsBackground:"bg-gray-900/80 backdrop-blur-sm border-t border-gray-700",controlEnabled:"bg-blue-600 hover:bg-blue-700 text-white",controlDisabled:"bg-gray-700 hover:bg-gray-600 text-gray-300",endCall:"bg-red-600 hover:bg-red-700 text-white",tile:"bg-gray-800 border border-gray-700 shadow-lg",placeholder:"bg-gray-800 text-gray-300",avatar:"bg-gray-700 text-gray-300",nameOverlay:"bg-black/70 text-white",mutedIndicator:"bg-red-600/80 text-white"}},F0={card:" bg-gradient-to-br from-white to-gray-50 border border-gray-200 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto shadow-lg",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-white/90 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-blue-500/5 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-purple-500/10 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-pink-500/8 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-blue-500 to-purple-500 rounded-full blur-sm opacity-30 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-pink-500 to-purple-500 rounded-full blur-sm opacity-20 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-white to-gray-50 rounded-2xl shadow-xl p-0 overflow-hidden h-full",text:{primary:"text-gray-900",secondary:"text-gray-700",muted:"text-gray-500",accent:"bg-clip-text text-transparent bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600"},micButton:"absolute text-white w-20 h-20 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 mic-glow shadow-2xl group",chatButton:"absolute text-white w-20 h-20 bg-gradient-to-br from-[#10B981] to-[#059669] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",videoButton:"absolute text-white w-20 h-20 bg-gradient-to-br from-[#8B5CF6] to-[#EC4899] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",popupTrigger:"bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] text-white font-medium hover:from-[#2563EB] hover:to-[#7C3AED] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-white",promptSlider:"absolute w-full py-3 px-2 bg-gray-100 rounded-xl text-center text-gray-700 text-sm transition-opacity duration-700 ease-in-out border border-gray-200",statusIndicator:"w-2 h-2 bg-green-500 rounded-full animate-pulse",pulseRings:{ring1:"w-32 h-32 rounded-full border-2 border-blue-500/20 pulse-ring",ring2:"absolute w-28 h-28 rounded-full border-2 border-purple-500/15 pulse-ring",ring3:"absolute w-24 h-24 rounded-full border-2 border-pink-500/10 pulse-ring"},controlBar:"border border-gray-200 rounded-3xl py-4 flex flex-col justify-end h-full bg-white/80 backdrop-blur-sm",chatInput:{container:"bg-white/90 border-gray-200 shadow-sm",textarea:"bg-white border-none text-gray-900 placeholder-gray-500 ",sendButton:"bg-blue-600 hover:bg-blue-700 disabled:bg-gray-300 disabled:opacity-50 text-white",attachButton:"text-gray-500 hover:text-gray-700 hover:bg-gray-100 bg-blue-50",endButton:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200"},chatMessage:{own:"bg-blue-50 text-gray-900 border border-blue-100",other:"bg-gray-50 text-gray-900 border border-gray-200"},chatHeader:{container:"bg-white border-gray-200",backButton:"text-gray-500 hover:text-gray-700 hover:bg-gray-100"},spinner:"w-10 h-10 animate-spin text-blue-500 mb-2",suggestedResponse:{container:"bg-white text-blue-700 border-blue-200 hover:bg-blue-50 hover:text-blue-900"},video:{container:"bg-gradient-to-br from-white to-gray-50 text-gray-900",header:"border-gray-200 bg-white/80",headerButton:"bg-gray-100 hover:bg-gray-200 text-gray-600",statusDot:"bg-green-500 animate-pulse",controlsBackground:"bg-white/90 backdrop-blur-sm border-t border-gray-200",controlEnabled:"bg-blue-600 hover:bg-blue-700 text-white",controlDisabled:"bg-gray-200 hover:bg-gray-300 text-gray-600",endCall:"bg-red-600 hover:bg-red-700 text-white",tile:"bg-white border border-gray-200 shadow-sm",placeholder:"bg-gray-50 text-gray-600",avatar:"bg-gray-200 text-gray-600",nameOverlay:"bg-black/70 text-white",mutedIndicator:"bg-red-600/80 text-white"}},O0={card:" text-white bg-gradient-to-br from-[#171727] to-[#12121F] border border-gray-800 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-[#171727]/90 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-[#3B82F6]/15 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-[#8B5CF6]/25 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-[#EC4899]/20 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full blur-sm opacity-50 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-[#EC4899] to-[#8B5CF6] rounded-full blur-sm opacity-40 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-[#171727] to-[#12121F] rounded-2xl shadow-xl p-0 overflow-hidden h-full",text:{primary:"text-white",secondary:"text-gray-300",muted:"text-gray-400",accent:"bg-clip-text text-transparent bg-gradient-to-r from-[#3B82F6] via-[#8B5CF6] to-[#EC4899]"},micButton:"absolute w-20 h-20 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 mic-glow shadow-2xl group",chatButton:"absolute w-20 h-20 bg-gradient-to-br from-[#10B981] to-[#059669] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",videoButton:"absolute w-20 h-20 bg-gradient-to-br from-[#8B5CF6] to-[#EC4899] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",popupTrigger:"bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] text-white font-medium hover:from-[#2563EB] hover:to-[#7C3AED] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-900 shadow-xl",promptSlider:"absolute w-full py-3 px-2 bg-[#1E1E2E] rounded-xl text-center text-gray-200 text-sm transition-opacity duration-700 ease-in-out border border-gray-700",statusIndicator:"w-2 h-2 bg-[#10B981] rounded-full animate-pulse",pulseRings:{ring1:"w-32 h-32 rounded-full border-2 border-[#3B82F6]/40 pulse-ring",ring2:"absolute w-28 h-28 rounded-full border-2 border-[#8B5CF6]/30 pulse-ring",ring3:"absolute w-24 h-24 rounded-full border-2 border-[#EC4899]/20 pulse-ring"},controlBar:"border border-border rounded-3xl py-4 flex flex-col justify-end h-full",chatInput:{container:"bg-[#1E1E2E] border-gray-700",textarea:"bg-[#1E1E2E] border-none text-white placeholder-gray-400",sendButton:"bg-[#3B82F6] hover:bg-[#2563EB] disabled:bg-gray-600 disabled:opacity-50 text-white",attachButton:"text-gray-400 hover:text-gray-300 hover:bg-gray-700",endButton:"bg-red-900/20 hover:bg-red-800/30 text-red-400 border-red-800"},chatMessage:{own:"bg-[#1E1E2E]/80 text-white",other:"bg-[#1E1E2E] text-white border border-gray-700"},chatHeader:{container:"bg-[#1E1E2E] border-gray-700",backButton:"text-gray-400 hover:text-white hover:bg-gray-700"},spinner:"w-10 h-10 animate-spin text-blue-400 mb-2",suggestedResponse:{container:"bg-[#221f3f] text-white border-none"},video:{container:"bg-gradient-to-br from-[#171727] to-[#12121F] text-white",header:"border-gray-700 bg-[#1E1E2E]/80",headerButton:"bg-[#1E1E2E] hover:bg-gray-700 text-gray-300",statusDot:"bg-[#10B981] animate-pulse",controlsBackground:"bg-[#1E1E2E]/90 backdrop-blur-sm border-t border-gray-700",controlEnabled:"bg-[#3B82F6] hover:bg-[#2563EB] text-white",controlDisabled:"bg-gray-700 hover:bg-gray-600 text-gray-300",endCall:"bg-red-600 hover:bg-red-700 text-white",tile:"bg-[#1E1E2E] border border-gray-700 shadow-xl",placeholder:"bg-[#1E1E2E] text-gray-300",avatar:"bg-gray-700 text-gray-300",nameOverlay:"bg-black/70 text-white",mutedIndicator:"bg-red-600/80 text-white"}},la={dark:$0,light:F0,vox:O0};function Ve(e){return la[e]||la.vox}function L0({controls:e,saveUserChoices:t=!0,capabilities:n,className:s,onSendMessage:r,onChatOpenChange:o,onDisconnect:i,onDeviceError:a,theme:c="vox",client:d,...u}){const[f,h]=p.useState(!1),[g,x]=p.useState(!1),m=Ve(c),{micTrackRef:b,visibleControls:k,cameraToggle:v,microphoneToggle:T,screenShareToggle:w,handleAudioDeviceChange:S,handleVideoDeviceChange:A,handleDisconnect:M}=D0({controls:e,saveUserChoices:t,client:d}),j=async z=>{x(!0);try{await(r==null?void 0:r(z))}finally{x(!1)}};return p.useEffect(()=>{o==null||o(f)},[f,o]),p.useEffect(()=>{var z,y,D,_;console.log("🎤 AgentControlBar: micTrackRef changed:",{hasParticipant:!!b.participant,hasPublication:!!b.publication,source:b.source,isSubscribed:(z=b.publication)==null?void 0:z.isSubscribed,isMuted:(y=b.publication)==null?void 0:y.isMuted,trackSid:(D=b.publication)==null?void 0:D.trackSid,hasTrack:!!((_=b.publication)!=null&&_.track)})},[b]),l.jsxs("div",{"aria-label":"Voice assistant controls",className:Y(m.controlBar,s),...u,children:[n.suportsChatInput&&l.jsxs("div",{inert:!f,className:Y("overflow-hidden transition-[height] relative duration-300 ease-in-out",f?"h-[64px] mb-3":"h-0"),children:[l.jsx("div",{className:"flex h-9 px-4 w-full",children:l.jsx(T0,{onSend:j,disabled:g,className:Y("w-full",m.chatInput)})}),l.jsx("hr",{className:"border-border my-2 mx-5"})]}),l.jsxs("div",{className:Y("flex flex-row items-center gap-2 rounded-2xl mx-auto border-none backdrop-blur-lg px-2 py-2",c==="light"?"bg-white/80":"bg-[#18182a]/80"),children:[l.jsxs("div",{className:"flex gap-y-2 justify-start",children:[k.microphone&&l.jsxs("div",{className:"flex gap-y-2 items-center rounded-full overflow-hidden border-none ",children:[l.jsx(Ws,{variant:"primary",source:Z.Track.Source.Microphone,pressed:T.enabled,disabled:T.pending,onPressedChange:T.toggle,className:"w-auto py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"}),l.jsx(Ne.BarVisualizer,{barCount:3,trackRef:b,options:{minHeight:5},className:"flex h-full w-auto items-center justify-center gap-x-0.5",children:l.jsx("span",{className:Y(["h-full w-0.5 origin-center rounded-2xl","bg-white","group-data-[state=on]/track:bg-white group-data-[state=off]/track:bg-white","data-lk-muted:bg-muted"])})}),l.jsx(ca,{size:"sm",kind:"audioinput",client:d,onError:a?z=>z instanceof Error?a({source:Z.Track.Source.Microphone,error:z}):void 0:void 0,onActiveDeviceChange:S,className:Y(["h-full py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/30 transition-colors","min-w-[2.5rem]"])})]}),n.suportsVideoInput&&k.camera&&l.jsxs("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:[l.jsx(Ws,{variant:"primary",source:Z.Track.Source.Camera,pressed:v.enabled,pending:v.pending,disabled:v.pending,onPressedChange:v.toggle,className:"w-auto py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"}),l.jsx(ca,{size:"sm",kind:"videoinput",client:d,onError:a?z=>z instanceof Error?a({source:Z.Track.Source.Camera,error:z}):void 0:void 0,onActiveDeviceChange:A,className:Y(["h-full py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors","min-w-[2.5rem]"])})]}),n.suportsScreenShare&&k.screenShare&&l.jsx("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:l.jsx(Ws,{variant:"secondary",source:Z.Track.Source.ScreenShare,pressed:w.enabled,disabled:w.pending,onPressedChange:w.toggle,className:"w-auto py-2 disabled:opacity-70 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"})})]}),k.chat&&l.jsx("div",{className:"flex items-center rounded-full overflow-hidden bg-secondary text-secondary-foreground border-none ",children:l.jsx(Hl,{variant:"secondary","aria-label":"Toggle chat",pressed:f,onPressedChange:z=>{h(z)},className:"aspect-square h-full py-3 rounded-none border-none bg-transparent text-inherit focus:bg-secondary/80 hover:bg-secondary/80 transition-colors flex items-center",children:l.jsx(El,{weight:"bold",className:"h-5 w-5"})})})]})]})}const _0=(e,t)=>{var a,c;const n=p.useMemo(()=>t?t(e.message):e.message,[e.message,t]),s=!!e.editTimestamp,r=new Date(e.timestamp),o=typeof navigator<"u"?navigator.language:"en-US",i=(a=e.from)!=null&&a.name&&e.from.name!==""?e.from.name:(c=e.from)==null?void 0:c.identity;return{message:n,hasBeenEdited:s,time:r,locale:o,name:i}},B0=({entry:e,messageFormatter:t,className:n,participantName:s,...r})=>{var u,f;const{message:o,time:i,locale:a}=_0(e,t),c=((u=e.from)==null?void 0:u.isLocal)??!1;Y("w-full px-3 py-2 rounded-2xl text-xs break-words whitespace-pre-line",c?" text-end border border-[#5078F2]/30":"bg-muted text-foreground border border-[#813aa7]/30","text-left");const d=Y("inline-flex items-center justify-center w-6 h-6 rounded-full text-xs font-bold flex-shrink-0",c?"bg-[#5078F2] text-white":"bg-[#813aa7] ml-1 text-white");return l.jsx("li",{title:i.toLocaleTimeString(a,{timeStyle:"full"}),className:Y("group flex mb-2",c?"justify-end":"justify-start",n),...r,children:l.jsxs("div",{className:Y("flex w-fit max-w-full rounded-2xl border",c?"flex-row-reverse items-center border-[#5078F2]/30":"flex-row items-center border-[#813aa7]/30 bg-muted text-foreground"),children:[l.jsx("span",{className:d,children:c?((f=s==null?void 0:s[0])==null?void 0:f.toUpperCase())||"U":"A"}),l.jsx("span",{className:Y("flex items-center text-xs break-words whitespace-pre-line",c?"ml-auto justify-end text-right":"justify-start text-left","px-3 py-2"),children:o})]})})};function z0(e){C.useEffect(()=>{function t(){const n=e.current;n&&(n.scrollTop=n.scrollHeight)}if(e.current){const n=new ResizeObserver(t);return n.observe(e.current),t(),()=>n.disconnect()}},[e])}const H0=({className:e,children:t,...n})=>{const s=C.useRef(null);return z0(s),l.jsx("div",{ref:s,className:Y("flex flex-col justify-end",e),...n,children:t})},U0=({state:e,audioTrack:t,className:n,ref:s})=>l.jsx("div",{ref:s,className:Y("",n),children:t?l.jsx(Ne.BarVisualizer,{barCount:5,state:e,options:{minHeight:5},trackRef:t,className:Y("flex aspect-video w-40 items-center justify-center gap-1"),children:l.jsx("span",{className:Y(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear","data-[lk-highlighted=true]:bg-[#5c64f6]","data-[lk-muted=true]:bg-[#222222]"])})}):l.jsx("div",{className:Y("flex aspect-video w-40 items-center justify-center"),children:l.jsx("div",{className:"flex flex-col items-center justify-center",children:l.jsx("div",{className:"flex gap-1",children:Array.from({length:5}).map((r,o)=>l.jsx("span",{className:Y(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear",e==="speaking"&&"animate-pulse bg-[#5c64f6]",e==="thinking"&&"animate-pulse bg-yellow-500"])},o))})})})}),Z0=({videoTrack:e,className:t,ref:n})=>{var s,r;return!e||!e.publication||!e.participant?l.jsx("div",{ref:n,className:Y(t),children:l.jsx("div",{className:"w-full h-full bg-gray-200 rounded-md flex items-center justify-center",children:l.jsx("span",{className:"text-gray-500",children:"No video available"})})}):l.jsx("div",{ref:n,className:Y(t),children:l.jsx(Ne.VideoTrack,{trackRef:e,width:((s=e.publication.dimensions)==null?void 0:s.width)??0,height:((r=e.publication.dimensions)==null?void 0:r.height)??0,className:"rounded-md"})})},W0=ie.create(Ne.VideoTrack),G0=({trackRef:e,className:t,ref:n})=>{var s,r;return l.jsx("div",{className:Y("bg-muted overflow-hidden rounded-md",t),children:l.jsx(W0,{ref:n,trackRef:e,width:((s=e==null?void 0:e.publication.dimensions)==null?void 0:s.width)??0,height:((r=e==null?void 0:e.publication.dimensions)==null?void 0:r.height)??0,className:Y("h-full w-auto")})})},da=ie.create(G0),K0=ie.create(U0),Y0=ie.create(Z0),tt={initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{type:"spring",stiffness:675,damping:75,mass:1}},Pt={grid:["h-full w-full","grid gap-x-2 place-content-center","grid-cols-[1fr_1fr] grid-rows-[90px_1fr_90px]"],agentChatOpenWithSecondTile:["col-start-1 row-start-1","self-center justify-self-end"],agentChatOpenWithoutSecondTile:["col-start-1 row-start-1","col-span-2","place-content-center"],agentChatClosed:["col-start-1 row-start-1","col-span-2 row-span-3","place-content-center"],secondTileChatOpen:["col-start-2 row-start-1","self-center justify-self-start"],secondTileChatClosed:["col-start-2 row-start-3","place-content-end"]};function q0(e,t){const{localParticipant:n}=Ul(t),s=n==null?void 0:n.getTrackPublication(e);return C.useMemo(()=>s&&n?{source:e,participant:n,publication:s}:void 0,[e,s,n])}function X0({chatOpen:e,client:t}){const{agent:{isActive:n=!1}={},session:s,state:r="idle",audioTrack:o,videoTrack:i}=t?Wl(t):{agent:{isActive:!1},session:null,state:"idle",audioTrack:null,videoTrack:null},[a]=Ne.useTracks([Z.Track.Source.ScreenShare]),c=q0(Z.Track.Source.Camera,t),d=c&&!c.publication.isMuted,u=a&&!a.publication.isMuted,f=d||u,h=n||s&&s.state==="active",g={...tt.transition,delay:e?0:.15},x={...tt.animate,scale:e?1:3,transition:g},m={...tt.animate,transition:g},b=g,k=g,v=i&&i.publication&&i.participant;return l.jsx("div",{className:"relative w-full h-full z-10 flex items-center justify-center",children:l.jsx("div",{className:"relative w-full h-full max-w-2xl px-4 md:px-0",children:l.jsxs("div",{className:Y(Pt.grid),children:[h&&l.jsx("div",{className:Y(["grid",!e&&Pt.agentChatClosed,e&&f&&Pt.agentChatOpenWithSecondTile,e&&!f&&Pt.agentChatOpenWithoutSecondTile]),children:l.jsxs("div",{className:"h-full flex items-center justify-center",children:[!v&&l.jsx(K0,{layoutId:"agent",...tt,animate:x,transition:b,state:r,audioTrack:o||void 0,className:Y(e?"h-[90px]":"h-auto w-full")},"agent"),v&&i&&l.jsx(Y0,{layoutId:"avatar",...tt,animate:m,transition:k,videoTrack:i,className:Y(e?"h-[90px] [&>video]:h-[90px] [&>video]:w-auto":"h-auto w-full")},"avatar")]})}),l.jsx("div",{className:Y(["grid",e&&Pt.secondTileChatOpen,!e&&Pt.secondTileChatClosed]),children:l.jsxs("div",{className:"w-full px-10 flex items-center shadow-2xl justify-between",children:[c&&d&&l.jsx(da,{layout:"position",layoutId:"camera",...tt,trackRef:c,transition:{...tt.transition,delay:e?0:.15},className:"h-[60px] order-1"},"camera"),u&&l.jsx(da,{layout:"position",layoutId:"screen",...tt,trackRef:a,transition:{...tt.transition,delay:e?0:.15},className:"h-[70px] order-2"},"screen")]})})]})})})}function ua({timeout:e}){const[t,n]=C.useState(100),s=C.useRef(null),r=C.useRef(null);return C.useEffect(()=>{if(!e||e<=0)return;n(100),r.current=Date.now();const o=()=>{if(!e||r.current===null)return;const i=Date.now()-r.current,a=Math.max(0,100-i/e*100);n(a),a>0&&(s.current=requestAnimationFrame(o))};return s.current=requestAnimationFrame(o),()=>{s.current&&cancelAnimationFrame(s.current)}},[e]),!e||e<=0?null:l.jsx("div",{className:"w-full h-1 relative top-1 rounded-t-4xl bg-gray-700 overflow-hidden",children:l.jsx(ie.div,{className:"h-1 rounded-t-4xl dark:bg-white bg-blue-200 ",initial:{width:"100%"},animate:{width:`${Math.max(t,2)}%`},transition:{duration:.1,ease:"linear"},style:{minWidth:"2%"}})})}function Kt({interaction:e,theme:t,onDismiss:n,client:s,addLocalMessage:r}){var a;if(!e||!e.isVisible||!e.component)return null;const[o]=p.useState(()=>Date.now()),i=()=>e.component?p.createElement(e.component,{handler:e.handler||void 0,timeout:e.timeout,loadData:async d=>{console.log("InteractiveComponent: Loading data:",d)},presentationMode:e.presentationMode,data:e.data,client:s,addLocalMessage:r}):l.jsx("div",{className:"p-4 text-red-500",children:"Component not found"});switch(e.presentationMode){case"fullscreen":return l.jsx(Ht,{children:l.jsxs(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black",children:[l.jsxs("div",{className:"flex flex-col",children:[l.jsx(ua,{timeout:e.timeout}),l.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/80 text-white border-b border-gray-700",children:[l.jsx("h3",{className:"text-lg font-semibold",children:e.methodName.replace(/_/g," ").replace(/\b\w/g,c=>c.toUpperCase())}),l.jsx("button",{onClick:n||((a=e.handler)==null?void 0:a.dismissView),className:"p-2 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors",children:l.jsx(je.X,{className:"w-5 h-5"})})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:i()})]})});case"embedded":default:return l.jsx(Ht,{children:l.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-fit rounded-lg ",children:l.jsxs("div",{children:[l.jsx(ua,{timeout:e.timeout}),i()]})})})}}function J0(){const e=Ne.useTranscriptions(),t=Ne.useChat(),n=Ne.useRoomContext();return{messages:C.useMemo(()=>[...e.map(o=>S0(o,n)),...t.chatMessages].sort((o,i)=>o.timestamp-i.timestamp),[e,t.chatMessages,n]),send:t.send}}const Q0=({logLevel:e}={})=>{const t=Ne.useRoomContext();p.useEffect(()=>(Z.setLogLevel(e??"debug"),window.__lk_room=t,()=>{window.__lk_room=void 0}),[t,e])},fa=e=>e,eg=()=>{let e=fa;return{configure(t){e=t},generate(t){return e(t)},reset(){e=fa}}},tg=eg();function ht(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(s=>n.searchParams.append("args[]",s)),`Minified MUI error #${e}; visit ${n} for the full message.`}function At(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":ht(7));return e.charAt(0).toUpperCase()+e.slice(1)}function ng(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bn={exports:{}},zn={exports:{}},le={};/** @license React v16.13.1
9
+ `),()=>{m.contains(x)&&m.removeChild(x)}},[t]),l.jsx(zf,{isPresent:t,childRef:o,sizeRef:i,children:g.cloneElement(e,{ref:o})})}const Hf=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:a,root:c})=>{const d=Ls(Zf),u=C.useId();let f=!0,h=C.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:s,onExitComplete:p=>{d.set(p,!0);for(const x of d.values())if(!x)return;r&&r()},register:p=>(d.set(p,!1),()=>d.delete(p))}),[n,d,r]);return o&&f&&(h={...h}),C.useMemo(()=>{d.forEach((p,x)=>d.set(x,!1))},[n]),g.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),i==="popLayout"&&(e=l.jsx(Uf,{isPresent:n,anchorX:a,root:c,children:e})),l.jsx(lr.Provider,{value:h,children:e})};function Zf(){return new Map}function Oc(e=!0){const t=C.useContext(lr);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=C.useId();C.useEffect(()=>{if(e)return s(o)},[e]);const i=C.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const Fn=e=>e.key||"";function si(e){const t=[];return C.Children.forEach(e,n=>{C.isValidElement(n)&&t.push(n)}),t}const Ut=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:a="left",root:c})=>{const[d,u]=Oc(i),f=C.useMemo(()=>si(e),[e]),h=i&&!d?[]:f.map(Fn),p=C.useRef(!0),x=C.useRef(f),m=Ls(()=>new Map),[b,k]=C.useState(f),[v,E]=C.useState(f);Ga(()=>{p.current=!1,x.current=f;for(let A=0;A<v.length;A++){const M=Fn(v[A]);h.includes(M)?m.delete(M):m.get(M)!==!0&&m.set(M,!1)}},[v,h.length,h.join("-")]);const w=[];if(f!==b){let A=[...f];for(let M=0;M<v.length;M++){const j=v[M],z=Fn(j);h.includes(z)||(A.splice(M,0,j),w.push(j))}return o==="wait"&&w.length&&(A=w),E(si(A)),k(f),null}process.env.NODE_ENV!=="production"&&o==="wait"&&v.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:S}=C.useContext(Os);return l.jsx(l.Fragment,{children:v.map(A=>{const M=Fn(A),j=i&&!d?!1:f===v||h.includes(M),z=()=>{if(m.has(M))m.set(M,!0);else return;let y=!0;m.forEach(D=>{D||(y=!1)}),y&&(S==null||S(),E(x.current),i&&(u==null||u()),r&&r())};return l.jsx(Hf,{isPresent:j,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:c,onExitComplete:j?void 0:z,anchorX:a,children:A},M)})})},Lc=C.createContext({strict:!1}),oi={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Gt={};for(const e in oi)Gt[e]={isEnabled:t=>oi[e].some(n=>!!t[n])};function Wf(e){for(const t in e)Gt[t]={...Gt[t],...e[t]}}const Gf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function rr(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Gf.has(e)}let _c=e=>!rr(e);function Kf(e){typeof e=="function"&&(_c=t=>t.startsWith("on")?!rr(t):e(t))}try{Kf(require("@emotion/is-prop-valid").default)}catch{}function Yf(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(_c(s)||n===!0&&rr(s)||!t&&!rr(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const dr=C.createContext({});function ur(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function wn(e){return typeof e=="string"||Array.isArray(e)}const lo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],uo=["initial",...lo];function fr(e){return ur(e.animate)||uo.some(t=>wn(e[t]))}function Bc(e){return!!(fr(e)||e.variants)}function qf(e,t){if(fr(e)){const{initial:n,animate:r}=e;return{initial:n===!1||wn(n)?n:void 0,animate:wn(r)?r:void 0}}return e.inherit!==!1?t:{}}function Xf(e){const{initial:t,animate:n}=qf(e,C.useContext(dr));return C.useMemo(()=>({initial:t,animate:n}),[ii(t),ii(n)])}function ii(e){return Array.isArray(e)?e.join(" "):e}const Sn={};function Jf(e){for(const t in e)Sn[t]=e[t],Ks(t)&&(Sn[t].isCSSVariable=!0)}function zc(e,{layout:t,layoutId:n}){return Qt.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Sn[e]||e==="opacity")}const Qf={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},eh=Jt.length;function th(e,t,n){let r="",s=!0;for(let o=0;o<eh;o++){const i=Jt[o],a=e[i];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(i.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const d=Nc(a,oo[i]);if(!c){s=!1;const u=Qf[i]||i;r+=`${u}(${d}) `}n&&(t[i]=d)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function fo(e,t,n){const{style:r,vars:s,transformOrigin:o}=e;let i=!1,a=!1;for(const c in t){const d=t[c];if(Qt.has(c)){i=!0;continue}else if(Ks(c)){s[c]=d;continue}else{const u=Nc(d,oo[c]);c.startsWith("origin")?(a=!0,o[c]=u):r[c]=u}}if(t.transform||(i||n?r.transform=th(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:d="50%",originZ:u=0}=o;r.transformOrigin=`${c} ${d} ${u}`}}const ho=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Uc(e,t,n){for(const r in t)!Re(t[r])&&!zc(r,n)&&(e[r]=t[r])}function nh({transformTemplate:e},t){return C.useMemo(()=>{const n=ho();return fo(n,t,e),Object.assign({},n.vars,n.style)},[t])}function rh(e,t){const n=e.style||{},r={};return Uc(r,n,e),Object.assign(r,nh(e,t)),r}function sh(e,t){const n={},r=rh(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const oh={offset:"stroke-dashoffset",array:"stroke-dasharray"},ih={offset:"strokeDashoffset",array:"strokeDasharray"};function ah(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?oh:ih;e[o.offset]=Q.transform(-r);const i=Q.transform(t),a=Q.transform(n);e[o.array]=`${i} ${a}`}function Hc(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:i=0,...a},c,d,u){if(fo(e,a,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&ah(f,s,o,i,!1)}const Zc=()=>({...ho(),attrs:{}}),Wc=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ch(e,t,n,r){const s=C.useMemo(()=>{const o=Zc();return Hc(o,t,Wc(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Uc(o,e.style,e),s.style={...o,...s.style}}return s}const lh=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function mo(e){return typeof e!="string"||e.includes("-")?!1:!!(lh.indexOf(e)>-1||/[A-Z]/u.test(e))}function dh(e,t,n,{latestValues:r},s,o=!1){const a=(mo(e)?ch:sh)(t,r,s,e),c=Yf(t,typeof e=="string",o),d=e!==C.Fragment?{...c,...a,ref:n}:{},{children:u}=t,f=C.useMemo(()=>Re(u)?u.get():u,[u]);return C.createElement(e,{...d,children:f})}function ai(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function go(e,t,n,r){if(typeof t=="function"){const[s,o]=ai(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=ai(r);t=t(n!==void 0?n:e.custom,s,o)}return t}function Yn(e){return Re(e)?e.get():e}function uh({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:fh(n,r,s,e),renderState:t()}}function fh(e,t,n,r){const s={},o=r(e,{});for(const h in o)s[h]=Yn(o[h]);let{initial:i,animate:a}=e;const c=fr(e),d=Bc(e);t&&d&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const f=u?a:i;if(f&&typeof f!="boolean"&&!ur(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const x=go(e,h[p]);if(x){const{transitionEnd:m,transition:b,...k}=x;for(const v in k){let E=k[v];if(Array.isArray(E)){const w=u?E.length-1:0;E=E[w]}E!==null&&(s[v]=E)}for(const v in m)s[v]=m[v]}}}return s}const Gc=e=>(t,n)=>{const r=C.useContext(dr),s=C.useContext(lr),o=()=>uh(e,t,r,s);return n?o():Ls(o)};function po(e,t,n){var o;const{style:r}=e,s={};for(const i in r)(Re(r[i])||t.style&&Re(t.style[i])||zc(i,e)||((o=n==null?void 0:n.getValue(i))==null?void 0:o.liveStyle)!==void 0)&&(s[i]=r[i]);return s}const hh=Gc({scrapeMotionValuesFromProps:po,createRenderState:ho});function Kc(e,t,n){const r=po(e,t,n);for(const s in e)if(Re(e[s])||Re(t[s])){const o=Jt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}const mh=Gc({scrapeMotionValuesFromProps:Kc,createRenderState:Zc}),gh=Symbol.for("motionComponentSymbol");function Lt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ph(e,t,n){return C.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Lt(n)&&(n.current=r))},[t])}const yo=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),yh="framerAppearId",Yc="data-"+yo(yh),qc=C.createContext({});function xh(e,t,n,r,s){var m,b;const{visualElement:o}=C.useContext(dr),i=C.useContext(Lc),a=C.useContext(lr),c=C.useContext(co).reducedMotion,d=C.useRef(null);r=r||i.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}));const u=d.current,f=C.useContext(qc);u&&!u.projection&&s&&(u.type==="html"||u.type==="svg")&&bh(d.current,n,s,f);const h=C.useRef(!1);C.useInsertionEffect(()=>{u&&h.current&&u.update(n,a)});const p=n[Yc],x=C.useRef(!!p&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,p))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,p)));return Ga(()=>{u&&(h.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),x.current&&u.animationState&&u.animationState.animateChanges())}),C.useEffect(()=>{u&&(!x.current&&u.animationState&&u.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)==null||k.call(window,p)}),x.current=!1),u.enteringChildren=void 0)}),u}function bh(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:d,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Xc(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||a&&Lt(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:d})}function Xc(e){if(e)return e.options.allowProjection!==!1?e.projection:Xc(e.parent)}function Dr(e,{forwardMotionProps:t=!1}={},n,r){n&&Wf(n);const s=mo(e)?mh:hh;function o(a,c){let d;const u={...C.useContext(co),...a,layoutId:vh(a)},{isStatic:f}=u,h=Xf(a),p=s(a,f);if(!f&&_s){wh(u,n);const x=Sh(u);d=x.MeasureLayout,h.visualElement=xh(e,p,u,r,x.ProjectionNode)}return l.jsxs(dr.Provider,{value:h,children:[d&&h.visualElement?l.jsx(d,{visualElement:h.visualElement,...u}):null,dh(e,a,ph(p,h.visualElement,c),p,f,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const i=C.forwardRef(o);return i[gh]=e,i}function vh({layoutId:e}){const t=C.useContext(Os).id;return t&&e!==void 0?t+"-"+e:e}function wh(e,t){const n=C.useContext(Lc).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?qt(!1,r,"lazy-strict-mode"):ot(!1,r,"lazy-strict-mode")}}function Sh(e){const{drag:t,layout:n}=Gt;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Ch(e,t){if(typeof Proxy>"u")return Dr;const n=new Map,r=(o,i)=>Dr(o,i,e,t),s=(o,i)=>(process.env.NODE_ENV!=="production"&&Zs(!1,"motion() is deprecated. Use motion.create() instead."),r(o,i));return new Proxy(s,{get:(o,i)=>i==="create"?r:(n.has(i)||n.set(i,Dr(i,void 0,e,t)),n.get(i))})}function Jc({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function kh({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Eh(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function $r(e){return e===void 0||e===1}function bs({scale:e,scaleX:t,scaleY:n}){return!$r(e)||!$r(t)||!$r(n)}function bt(e){return bs(e)||Qc(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Qc(e){return ci(e.x)||ci(e.y)}function ci(e){return e&&e!=="0%"}function sr(e,t,n){const r=e-n,s=t*r;return n+s}function li(e,t,n,r,s){return s!==void 0&&(e=sr(e,s,r)),sr(e,n,r)+t}function vs(e,t=0,n=1,r,s){e.min=li(e.min,t,n,r,s),e.max=li(e.max,t,n,r,s)}function el(e,{x:t,y:n}){vs(e.x,t.translate,t.scale,t.originPoint),vs(e.y,n.translate,n.scale,n.originPoint)}const di=.999999999999,ui=1.0000000000001;function Th(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let o,i;for(let a=0;a<s;a++){o=n[a],i=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Bt(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,el(e,i)),r&&bt(o.latestValues)&&Bt(e,o.latestValues))}t.x<ui&&t.x>di&&(t.x=1),t.y<ui&&t.y>di&&(t.y=1)}function _t(e,t){e.min=e.min+t,e.max=e.max+t}function fi(e,t,n,r,s=.5){const o=ve(e.min,e.max,s);vs(e,t,n,o,r)}function Bt(e,t){fi(e.x,t.x,t.scaleX,t.scale,t.originX),fi(e.y,t.y,t.scaleY,t.scale,t.originY)}function tl(e,t){return Jc(Eh(e.getBoundingClientRect(),t))}function Ah(e,t,n){const r=tl(e,n),{scroll:s}=t;return s&&(_t(r.x,s.offset.x),_t(r.y,s.offset.y)),r}const hi=()=>({translate:0,scale:1,origin:0,originPoint:0}),zt=()=>({x:hi(),y:hi()}),mi=()=>({min:0,max:0}),Ee=()=>({x:mi(),y:mi()}),ws={current:null},nl={current:!1};function jh(){if(nl.current=!0,!!_s)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ws.current=e.matches;e.addEventListener("change",t),t()}else ws.current=!1}const Mh=new WeakMap;function Ph(e,t,n){for(const r in t){const s=t[r],o=n[r];if(Re(s))e.addValue(r,s);else if(Re(o))e.addValue(r,Wt(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(s):i.hasAnimated||i.set(s)}else{const i=e.getStaticValue(r);e.addValue(r,Wt(i!==void 0?i:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const gi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Vh{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:o,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ro,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=$e.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,ye.render(this.render,!1,!0))};const{latestValues:c,renderState:d}=i;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=fr(n),this.isVariantNode=Bc(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const p=f[h];c[h]!==void 0&&Re(p)&&p.set(c[h])}}mount(t){var n;this.current=t,Mh.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,s)=>this.bindToMotionValue(s,r)),nl.current||jh(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ws.current,process.env.NODE_ENV!=="production"&&Zs(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),ut(this.notifyUpdate),ut(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Qt.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&ye.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Gt){const n=Gt[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ee()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<gi.length;r++){const s=gi[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,i=t[o];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=Ph(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Wt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Ka(r)||qa(r))?r=parseFloat(r):!Bf(r)&&ft.test(n)&&(r=Vc(t,n)),this.setBaseTarget(t,Re(r)?r.get():r)),Re(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=go(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Re(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Hs),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){io.render(this.render)}}class rl extends Vh{constructor(){super(...arguments),this.KeyframeResolver=Mf}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Re(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function sl(e,{style:t,vars:n},r,s){const o=e.style;let i;for(i in t)o[i]=t[i];s==null||s.applyProjectionStyles(o,r);for(i in n)o.setProperty(i,n[i])}function Nh(e){return window.getComputedStyle(e)}class Rh extends rl{constructor(){super(...arguments),this.type="html",this.renderInstance=sl}readValueFromInstance(t,n){var r;if(Qt.has(n))return(r=this.projection)!=null&&r.isProjecting?fs(n):Wu(t,n);{const s=Nh(t),o=(Ks(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return tl(t,n)}build(t,n,r){fo(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return po(t,n,r)}}const ol=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ih(e,t,n,r){sl(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(ol.has(s)?s:yo(s),t.attrs[s])}class Dh extends rl{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ee}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Qt.has(n)){const r=Pc(n);return r&&r.default||0}return n=ol.has(n)?n:yo(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Kc(t,n,r)}build(t,n,r){Hc(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){Ih(t,n,r,s)}mount(t){this.isSVGTag=Wc(t.tagName),super.mount(t)}}const $h=(e,t)=>mo(e)?new Dh(t):new Rh(t,{allowProjection:e!==C.Fragment});function Ht(e,t,n){const r=e.getProps();return go(r,t,n!==void 0?n:r.custom,e)}const Ss=e=>Array.isArray(e);function Fh(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Wt(n))}function Oh(e){return Ss(e)?e[e.length-1]||0:e}function Lh(e,t){const n=Ht(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const i in o){const a=Oh(o[i]);Fh(e,i,a)}}function _h(e){return!!(Re(e)&&e.add)}function Cs(e,t){const n=e.getValue("willChange");if(_h(n))return n.add(t);if(!n&&it.WillChange){const r=new it.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function il(e){return e.props[Yc]}const Bh=e=>e!==null;function zh(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Bh),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[o]}const Uh={type:"spring",stiffness:500,damping:25,restSpeed:10},Hh=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Zh={type:"keyframes",duration:.8},Wh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Gh=(e,{keyframes:t})=>t.length>2?Zh:Qt.has(e)?e.startsWith("scale")?Hh(t[1]):Uh:Wh;function Kh({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:i,repeatDelay:a,from:c,elapsed:d,...u}){return!!Object.keys(u).length}const xo=(e,t,n,r={},s,o)=>i=>{const a=so(r,e)||{},c=a.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Ge(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-d,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:s};Kh(a)||Object.assign(u,Gh(e,u)),u.duration&&(u.duration=Ge(u.duration)),u.repeatDelay&&(u.repeatDelay=Ge(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ys(u),u.delay===0&&(f=!0)),(it.instantAnimations||it.skipAnimations)&&(f=!0,ys(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!o&&t.get()!==void 0){const h=zh(u.keyframes,a);if(h!==void 0){ye.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new no(u):new pf(u)};function Yh({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function al(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:i,...a}=t;r&&(o=r);const c=[],d=s&&e.animationState&&e.animationState.getState()[s];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),h=a[u];if(h===void 0||d&&Yh(d,u))continue;const p={delay:n,...so(o||{},u)},x=f.get();if(x!==void 0&&!f.isAnimating&&!Array.isArray(h)&&h===x&&!p.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const k=il(e);if(k){const v=window.MotionHandoffAnimation(k,u,ye);v!==null&&(p.startTime=v,m=!0)}}Cs(e,u),f.start(xo(u,f,h,e.shouldReduceMotion&&Ac.has(u)?{type:!1}:p,e,m));const b=f.animation;b&&c.push(b)}return i&&Promise.all(c).then(()=>{ye.update(()=>{i&&Lh(e,i)})}),c}function cl(e,t,n,r=0,s=1){const o=Array.from(e).sort((d,u)=>d.sortNodePosition(u)).indexOf(t),i=e.size,a=(i-1)*r;return typeof n=="function"?n(o,i):s===1?o*r:a-o*r}function ks(e,t,n={}){var c;const r=Ht(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(al(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=s;return qh(e,t,d,u,f,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[d,u]=a==="beforeChildren"?[o,i]:[i,o];return d().then(()=>u())}else return Promise.all([o(),i(n.delay)])}function qh(e,t,n=0,r=0,s=0,o=1,i){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(ks(c,t,{...i,delay:n+(typeof r=="function"?0:r)+cl(e.variantChildren,c,r,s,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function Xh(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>ks(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=ks(e,t,n);else{const s=typeof t=="function"?Ht(e,t,n.custom):t;r=Promise.all(al(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function ll(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Jh=uo.length;function dl(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?dl(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Jh;n++){const r=uo[n],s=e.props[r];(wn(s)||s===!1)&&(t[r]=s)}return t}const Qh=[...lo].reverse(),em=lo.length;function tm(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Xh(e,n,r)))}function nm(e){let t=tm(e),n=pi(),r=!0;const s=c=>(d,u)=>{var h;const f=Ht(e,u,c==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(f){const{transition:p,transitionEnd:x,...m}=f;d={...d,...m,...x}}return d};function o(c){t=c(e)}function i(c){const{props:d}=e,u=dl(e.parent)||{},f=[],h=new Set;let p={},x=1/0;for(let b=0;b<em;b++){const k=Qh[b],v=n[k],E=d[k]!==void 0?d[k]:u[k],w=wn(E),S=k===c?v.isActive:null;S===!1&&(x=b);let A=E===u[k]&&E!==d[k]&&w;if(A&&r&&e.manuallyAnimateOnMount&&(A=!1),v.protectedKeys={...p},!v.isActive&&S===null||!E&&!v.prevProp||ur(E)||typeof E=="boolean")continue;const M=rm(v.prevProp,E);let j=M||k===c&&v.isActive&&!A&&w||b>x&&w,z=!1;const y=Array.isArray(E)?E:[E];let D=y.reduce(s(k),{});S===!1&&(D={});const{prevResolvedValues:_={}}=v,J={..._,...D},te=K=>{j=!0,h.has(K)&&(z=!0,h.delete(K)),v.needsAnimating[K]=!0;const R=e.getValue(K);R&&(R.liveStyle=!1)};for(const K in J){const R=D[K],X=_[K];if(p.hasOwnProperty(K))continue;let V=!1;Ss(R)&&Ss(X)?V=!ll(R,X):V=R!==X,V?R!=null?te(K):h.add(K):R!==void 0&&h.has(K)?te(K):v.protectedKeys[K]=!0}v.prevProp=E,v.prevResolvedValues=D,v.isActive&&(p={...p,...D}),r&&e.blockInitialAnimation&&(j=!1);const ee=A&&M;j&&(!ee||z)&&f.push(...y.map(K=>{const R={type:k};if(typeof K=="string"&&r&&!ee&&e.manuallyAnimateOnMount&&e.parent){const{parent:X}=e,V=Ht(X,K);if(X.enteringChildren&&V){const{delayChildren:H}=V.transition||{};R.delay=cl(X.enteringChildren,e,H)}}return{animation:K,options:R}}))}if(h.size){const b={};if(typeof d.initial!="boolean"){const k=Ht(e,Array.isArray(d.initial)?d.initial[0]:d.initial);k&&k.transition&&(b.transition=k.transition)}h.forEach(k=>{const v=e.getBaseTarget(k),E=e.getValue(k);E&&(E.liveStyle=!0),b[k]=v??null}),f.push({animation:b})}let m=!!f.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(f):Promise.resolve()}function a(c,d){var f;if(n[c].isActive===d)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(h=>{var p;return(p=h.animationState)==null?void 0:p.setActive(c,d)}),n[c].isActive=d;const u=i(c);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:i,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=pi(),r=!0}}}function rm(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ll(t,e):!1}function yt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function pi(){return{animate:yt(!0),whileInView:yt(),whileHover:yt(),whileTap:yt(),whileDrag:yt(),whileFocus:yt(),exit:yt()}}class gt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class sm extends gt{constructor(t){super(t),t.animationState||(t.animationState=nm(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ur(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let om=0;class im extends gt{constructor(){super(...arguments),this.id=om++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const am={animation:{Feature:sm},exit:{Feature:im}};function Cn(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function jn(e){return{point:{x:e.pageX,y:e.pageY}}}const cm=e=>t=>ao(t)&&e(t,jn(t));function hn(e,t,n,r){return Cn(e,t,cm(n),r)}const ul=1e-4,lm=1-ul,dm=1+ul,fl=.01,um=0-fl,fm=0+fl;function De(e){return e.max-e.min}function hm(e,t,n){return Math.abs(e-t)<=n}function yi(e,t,n,r=.5){e.origin=r,e.originPoint=ve(t.min,t.max,e.origin),e.scale=De(n)/De(t),e.translate=ve(n.min,n.max,e.origin)-e.originPoint,(e.scale>=lm&&e.scale<=dm||isNaN(e.scale))&&(e.scale=1),(e.translate>=um&&e.translate<=fm||isNaN(e.translate))&&(e.translate=0)}function mn(e,t,n,r){yi(e.x,t.x,n.x,r?r.originX:void 0),yi(e.y,t.y,n.y,r?r.originY:void 0)}function xi(e,t,n){e.min=n.min+t.min,e.max=e.min+De(t)}function mm(e,t,n){xi(e.x,t.x,n.x),xi(e.y,t.y,n.y)}function bi(e,t,n){e.min=t.min-n.min,e.max=e.min+De(t)}function gn(e,t,n){bi(e.x,t.x,n.x),bi(e.y,t.y,n.y)}function _e(e){return[e("x"),e("y")]}const hl=({current:e})=>e?e.ownerDocument.defaultView:null,vi=(e,t)=>Math.abs(e-t);function gm(e,t){const n=vi(e.x,t.x),r=vi(e.y,t.y);return Math.sqrt(n**2+r**2)}class ml{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:i=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=Or(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,x=gm(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!x)return;const{point:m}=h,{timestamp:b}=Pe;this.history.push({...m,timestamp:b});const{onStart:k,onMove:v}=this.handlers;p||(k&&k(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,h)},this.handlePointerMove=(h,p)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Fr(p,this.transformPagePoint),ye.update(this.updatePoint,!0)},this.handlePointerUp=(h,p)=>{this.end();const{onEnd:x,onSessionEnd:m,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=Or(h.type==="pointercancel"?this.lastMoveEventInfo:Fr(p,this.transformPagePoint),this.history);this.startEvent&&x&&x(h,k),m&&m(h,k)},!ao(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=s||window;const a=jn(t),c=Fr(a,this.transformPagePoint),{point:d}=c,{timestamp:u}=Pe;this.history=[{...d,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,Or(c,this.history)),this.removeListeners=En(hn(this.contextWindow,"pointermove",this.handlePointerMove),hn(this.contextWindow,"pointerup",this.handlePointerUp),hn(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ut(this.updatePoint)}}function Fr(e,t){return t?{point:t(e.point)}:e}function wi(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Or({point:e},t){return{point:e,delta:wi(e,gl(t)),offset:wi(e,pm(t)),velocity:ym(t,.1)}}function pm(e){return e[0]}function gl(e){return e[e.length-1]}function ym(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=gl(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Ge(t)));)n--;if(!r)return{x:0,y:0};const o=Xe(s.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const i={x:(s.x-r.x)/o,y:(s.y-r.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function xm(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ve(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ve(n,e,r.max):Math.min(e,n)),e}function Si(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function bm(e,{top:t,left:n,bottom:r,right:s}){return{x:Si(e.x,n,s),y:Si(e.y,t,r)}}function Ci(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function vm(e,t){return{x:Ci(e.x,t.x),y:Ci(e.y,t.y)}}function wm(e,t){let n=.5;const r=De(e),s=De(t);return s>r?n=xn(t.min,t.max-r,e.min):r>s&&(n=xn(e.min,e.max-s,t.min)),st(0,1,n)}function Sm(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Es=.35;function Cm(e=Es){return e===!1?e=0:e===!0&&(e=Es),{x:ki(e,"left","right"),y:ki(e,"top","bottom")}}function ki(e,t,n){return{min:Ei(e,t),max:Ei(e,n)}}function Ei(e,t){return typeof e=="number"?e:e[t]||0}const km=new WeakMap;class Em{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ee(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=f=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(jn(f).point)},i=(f,h)=>{const{drag:p,dragPropagation:x,onDragStart:m}=this.getProps();if(p&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Rf(p),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),_e(k=>{let v=this.getAxisMotionValue(k).get()||0;if(Je.test(v)){const{projection:E}=this.visualElement;if(E&&E.layout){const w=E.layout.layoutBox[k];w&&(v=De(w)*(parseFloat(v)/100))}}this.originPoint[k]=v}),m&&ye.postRender(()=>m(f,h)),Cs(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:x,onDirectionLock:m,onDrag:b}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:k}=h;if(x&&this.currentDirection===null){this.currentDirection=Tm(k),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",h.point,k),this.updateAxis("y",h.point,k),this.visualElement.render(),b&&b(f,h)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>_e(f=>{var h;return this.getAnimationState(f)==="paused"&&((h=this.getAxisMotionValue(f).animation)==null?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new ml(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:hl(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!r)return;const{velocity:i}=s;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&ye.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!On(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=xm(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,s=this.constraints;t&&Lt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=bm(r.layoutBox,t):this.constraints=!1,this.elastic=Cm(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&_e(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Sm(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Lt(t))return!1;const r=t.current;ot(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=Ah(r,s.root,this.visualElement.getTransformPagePoint());let i=vm(s.layout.layoutBox,o);if(n){const a=n(kh(i));this.hasMutatedConstraints=!!a,a&&(i=Jc(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},d=_e(u=>{if(!On(u,n,this.currentDirection))return;let f=c&&c[u]||{};i&&(f={min:0,max:0});const h=s?200:1e6,p=s?40:1e7,x={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(u,x)});return Promise.all(d).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Cs(this.visualElement,t),r.start(xo(t,r,0,n,this.visualElement,!1))}stopAnimation(){_e(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){_e(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){_e(n=>{const{drag:r}=this.getProps();if(!On(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:i,max:a}=s.layout.layoutBox[n];o.set(t[n]-ve(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Lt(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};_e(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();s[i]=wm({min:c,max:c},this.constraints[i])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),_e(i=>{if(!On(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:d}=this.constraints[i];a.set(ve(c,d,s[i]))})}addListeners(){if(!this.visualElement.current)return;km.set(this.visualElement,this);const t=this.visualElement.current,n=hn(t,"pointerdown",c=>{const{drag:d,dragListener:u=!0}=this.getProps();d&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Lt(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ye.read(r);const i=Cn(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(_e(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=c[u].translate,f.set(f.get()+c[u].translate))}),this.visualElement.render())});return()=>{i(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:i=Es,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function On(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Tm(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Am extends gt{constructor(t){super(t),this.removeGroupControls=Ue,this.removeListeners=Ue,this.controls=new Em(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ue}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ti=e=>(t,n)=>{e&&ye.postRender(()=>e(t,n))};class jm extends gt{constructor(){super(...arguments),this.removePointerDownListener=Ue}onPointerDown(t){this.session=new ml(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:hl(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Ti(t),onStart:Ti(n),onMove:r,onEnd:(o,i)=>{delete this.session,s&&ye.postRender(()=>s(o,i))}}}mount(){this.removePointerDownListener=hn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const qn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ai(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const on={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Q.test(e))e=parseFloat(e);else return e;const n=Ai(e,t.target.x),r=Ai(e,t.target.y);return`${n}% ${r}%`}},Mm={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=ft.parse(e);if(s.length>5)return r;const o=ft.createTransformer(e),i=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;s[0+i]/=a,s[1+i]/=c;const d=ve(a,c,.5);return typeof s[2+i]=="number"&&(s[2+i]/=d),typeof s[3+i]=="number"&&(s[3+i]/=d),o(s)}};let Lr=!1;class Pm extends C.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:o}=t;Jf(Vm),o&&(n.group&&n.group.add(o),r&&r.register&&s&&r.register(o),Lr&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),qn.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:o}=this.props,{projection:i}=r;return i&&(i.isPresent=o,Lr=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||ye.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),io.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;Lr=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function pl(e){const[t,n]=Oc(),r=C.useContext(Os);return l.jsx(Pm,{...e,layoutGroup:r,switchLayoutGroup:C.useContext(qc),isPresent:t,safeToRemove:n})}const Vm={borderRadius:{...on,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:on,borderTopRightRadius:on,borderBottomLeftRadius:on,borderBottomRightRadius:on,boxShadow:Mm};function Nm(e,t,n){const r=Re(e)?e:Wt(e);return r.start(xo("",r,t,n)),r.animation}const Rm=(e,t)=>e.depth-t.depth;class Im{constructor(){this.children=[],this.isDirty=!1}add(t){Bs(this.children,t),this.isDirty=!0}remove(t){zs(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Rm),this.isDirty=!1,this.children.forEach(t)}}function Dm(e,t){const n=$e.now(),r=({timestamp:s})=>{const o=s-n;o>=t&&(ut(r),e(o-t))};return ye.setup(r,!0),()=>ut(r)}const yl=["TopLeft","TopRight","BottomLeft","BottomRight"],$m=yl.length,ji=e=>typeof e=="string"?parseFloat(e):e,Mi=e=>typeof e=="number"||Q.test(e);function Fm(e,t,n,r,s,o){s?(e.opacity=ve(0,n.opacity??1,Om(r)),e.opacityExit=ve(t.opacity??1,0,Lm(r))):o&&(e.opacity=ve(t.opacity??1,n.opacity??1,r));for(let i=0;i<$m;i++){const a=`border${yl[i]}Radius`;let c=Pi(t,a),d=Pi(n,a);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||Mi(c)===Mi(d)?(e[a]=Math.max(ve(ji(c),ji(d),r),0),(Je.test(d)||Je.test(c))&&(e[a]+="%")):e[a]=d}(t.rotate||n.rotate)&&(e.rotate=ve(t.rotate||0,n.rotate||0,r))}function Pi(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Om=xl(0,.5,sc),Lm=xl(.5,.95,Ue);function xl(e,t,n){return r=>r<e?0:r>t?1:n(xn(e,t,r))}function Vi(e,t){e.min=t.min,e.max=t.max}function Le(e,t){Vi(e.x,t.x),Vi(e.y,t.y)}function Ni(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ri(e,t,n,r,s){return e-=t,e=sr(e,1/n,r),s!==void 0&&(e=sr(e,1/s,r)),e}function _m(e,t=0,n=1,r=.5,s,o=e,i=e){if(Je.test(t)&&(t=parseFloat(t),t=ve(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=ve(o.min,o.max,r);e===o&&(a-=t),e.min=Ri(e.min,t,n,a,s),e.max=Ri(e.max,t,n,a,s)}function Ii(e,t,[n,r,s],o,i){_m(e,t[n],t[r],t[s],t.scale,o,i)}const Bm=["x","scaleX","originX"],zm=["y","scaleY","originY"];function Di(e,t,n,r){Ii(e.x,t,Bm,n?n.x:void 0,r?r.x:void 0),Ii(e.y,t,zm,n?n.y:void 0,r?r.y:void 0)}function $i(e){return e.translate===0&&e.scale===1}function bl(e){return $i(e.x)&&$i(e.y)}function Fi(e,t){return e.min===t.min&&e.max===t.max}function Um(e,t){return Fi(e.x,t.x)&&Fi(e.y,t.y)}function Oi(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vl(e,t){return Oi(e.x,t.x)&&Oi(e.y,t.y)}function Li(e){return De(e.x)/De(e.y)}function _i(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Hm{constructor(){this.members=[]}add(t){Bs(this.members,t),t.scheduleRender()}remove(t){if(zs(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Zm(e,t,n){let r="";const s=e.x.translate/t.x,o=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((s||o||i)&&(r=`translate3d(${s}px, ${o}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:u,rotateX:f,rotateY:h,skewX:p,skewY:x}=n;d&&(r=`perspective(${d}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),x&&(r+=`skewY(${x}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const _r=["","X","Y","Z"],Wm=1e3;let Gm=0;function Br(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function wl(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=il(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ye,!(s||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&wl(r)}function Sl({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(i={},a=t==null?void 0:t()){this.id=Gm++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(qm),this.nodes.forEach(eg),this.nodes.forEach(tg),this.nodes.forEach(Xm)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Im)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Hs),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Fc(i)&&!Lf(i),this.instance=i;const{layoutId:a,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const h=()=>this.root.updateBlockedByResize=!1;ye.read(()=>{f=window.innerWidth}),e(i,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,u&&u(),u=Dm(h,250),qn.hasAnimatedSinceResize&&(qn.hasAnimatedSinceResize=!1,this.nodes.forEach(Ui)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&d&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||d.getDefaultTransition()||ig,{onLayoutAnimationStart:m,onLayoutAnimationComplete:b}=d.getProps(),k=!this.targetLayout||!vl(this.targetLayout,p),v=!f&&h;if(this.options.layoutRoot||this.resumeFrom||v||f&&(k||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const E={...so(x,"layout"),onPlay:m,onComplete:b};(d.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E),this.setAnimationOrigin(u,v)}else f||Ui(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ut(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ng),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&wl(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Bi);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(zi);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Qm),this.nodes.forEach(Km),this.nodes.forEach(Ym)):this.nodes.forEach(zi),this.clearAllSnapshots();const a=$e.now();Pe.delta=st(0,1e3/60,a-Pe.timestamp),Pe.timestamp=a,Pe.isProcessing=!0,Mr.update.process(Pe),Mr.preRender.process(Pe),Mr.render.process(Pe),Pe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,io.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Jm),this.sharedNodes.forEach(rg)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ye.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ye.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!De(this.snapshot.measuredBox.x)&&!De(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ee(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!bl(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,u=d!==this.prevTransformTemplateValue;i&&this.instance&&(a||bt(this.latestValues)||u)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),ag(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:i}=this.options;if(!i)return Ee();const a=i.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(cg))){const{scroll:u}=this.root;u&&(_t(a.x,u.offset.x),_t(a.y,u.offset.y))}return a}removeElementScroll(i){var c;const a=Ee();if(Le(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let d=0;d<this.path.length;d++){const u=this.path[d],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Le(a,i),_t(a.x,f.offset.x),_t(a.y,f.offset.y))}return a}applyTransform(i,a=!1){const c=Ee();Le(c,i);for(let d=0;d<this.path.length;d++){const u=this.path[d];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Bt(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),bt(u.latestValues)&&Bt(c,u.latestValues)}return bt(this.latestValues)&&Bt(c,this.latestValues),c}removeTransform(i){const a=Ee();Le(a,i);for(let c=0;c<this.path.length;c++){const d=this.path[c];if(!d.instance||!bt(d.latestValues))continue;bs(d.latestValues)&&d.updateSnapshot();const u=Ee(),f=d.measurePageBox();Le(u,f),Di(a,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,u)}return bt(this.latestValues)&&Di(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Pe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var h;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!(!this.layout||!(u||f))){if(this.resolvedRelativeTargetAt=Pe.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ee(),this.relativeTargetOrigin=Ee(),gn(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Le(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ee(),this.targetWithTransforms=Ee()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),mm(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Le(this.target,this.layout.layoutBox),el(this.target,this.targetDelta)):Le(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ee(),this.relativeTargetOrigin=Ee(),gn(this.relativeTargetOrigin,this.target,p.target),Le(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||bs(this.parent.latestValues)||Qc(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var x;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Pe.timestamp&&(c=!1),c)return;const{layout:d,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||u))return;Le(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;Th(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Ee());const{target:p}=i;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ni(this.prevProjectionDelta.x,this.projectionDelta.x),Ni(this.prevProjectionDelta.y,this.projectionDelta.y)),mn(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!_i(this.projectionDelta.x,this.prevProjectionDelta.x)||!_i(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=zt(),this.projectionDelta=zt(),this.projectionDeltaWithTransform=zt()}setAnimationOrigin(i,a=!1){const c=this.snapshot,d=c?c.latestValues:{},u={...this.latestValues},f=zt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Ee(),p=c?c.source:void 0,x=this.layout?this.layout.source:void 0,m=p!==x,b=this.getStack(),k=!b||b.members.length<=1,v=!!(m&&!k&&this.options.crossfade===!0&&!this.path.some(og));this.animationProgress=0;let E;this.mixTargetDelta=w=>{const S=w/1e3;Hi(f.x,i.x,S),Hi(f.y,i.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gn(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),sg(this.relativeTarget,this.relativeTargetOrigin,h,S),E&&Um(this.relativeTarget,E)&&(this.isProjectionDirty=!1),E||(E=Ee()),Le(E,this.relativeTarget)),m&&(this.animationValues=u,Fm(u,d,this.latestValues,S,v,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,d;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(d=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||d.stop(),this.pendingAnimation&&(ut(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ye.update(()=>{qn.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Wt(0)),this.currentAnimation=Nm(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),i.onUpdate&&i.onUpdate(u)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Wm),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:d,latestValues:u}=i;if(!(!a||!c||!d)){if(this!==i&&this.layout&&d&&Cl(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Ee();const f=De(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;const h=De(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}Le(a,c),Bt(a,u),mn(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new Hm),this.sharedNodes.get(i).add(a);const d=a.options.initialPromotionConfig;a.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var a;const{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const d={};c.z&&Br("z",i,d,this.animationValues);for(let u=0;u<_r.length;u++)Br(`rotate${_r[u]}`,i,d,this.animationValues),Br(`skew${_r[u]}`,i,d,this.animationValues);i.render();for(const u in d)i.setStaticValue(u,d[u]),this.animationValues&&(this.animationValues[u]=d[u]);i.scheduleRender()}applyProjectionStyles(i,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=Yn(a==null?void 0:a.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=Yn(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!bt(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const u=d.animationValues||d.latestValues;this.applyTransformsToTarget();let f=Zm(this.projectionDeltaWithTransform,this.treeScale,u);c&&(f=c(u,f)),i.transform=f;const{x:h,y:p}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,d.animationValues?i.opacity=d===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:i.opacity=d===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const x in Sn){if(u[x]===void 0)continue;const{correct:m,applyTo:b,isCSSVariable:k}=Sn[x],v=f==="none"?u[x]:m(u[x],d);if(b){const E=b.length;for(let w=0;w<E;w++)i[b[w]]=v}else k?this.options.visualElement.renderState.vars[x]=v:i[x]=v}this.options.layoutId&&(i.pointerEvents=d===this?Yn(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Bi),this.root.sharedNodes.clear()}}}function Km(e){e.updateLayout()}function Ym(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;o==="size"?_e(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],p=De(h);h.min=r[f].min,h.max=h.min+p}):Cl(o,t.layoutBox,r)&&_e(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],p=De(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=zt();mn(a,r,t.layoutBox);const c=zt();i?mn(c,e.applyTransform(s,!0),t.measuredBox):mn(c,r,t.layoutBox);const d=!bl(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const x=Ee();gn(x,t.layoutBox,h.layoutBox);const m=Ee();gn(m,r,p.layoutBox),vl(x,m)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=x,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:d,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function qm(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Xm(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Jm(e){e.clearSnapshot()}function Bi(e){e.clearMeasurements()}function zi(e){e.isLayoutDirty=!1}function Qm(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ui(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function eg(e){e.resolveTargetDelta()}function tg(e){e.calcProjection()}function ng(e){e.resetSkewAndRotation()}function rg(e){e.removeLeadSnapshot()}function Hi(e,t,n){e.translate=ve(t.translate,0,n),e.scale=ve(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Zi(e,t,n,r){e.min=ve(t.min,n.min,r),e.max=ve(t.max,n.max,r)}function sg(e,t,n,r){Zi(e.x,t.x,n.x,r),Zi(e.y,t.y,n.y,r)}function og(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ig={duration:.45,ease:[.4,0,.1,1]},Wi=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Gi=Wi("applewebkit/")&&!Wi("chrome/")?Math.round:Ue;function Ki(e){e.min=Gi(e.min),e.max=Gi(e.max)}function ag(e){Ki(e.x),Ki(e.y)}function Cl(e,t,n){return e==="position"||e==="preserve-aspect"&&!hm(Li(t),Li(n),.2)}function cg(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const lg=Sl({attachResizeListener:(e,t)=>Cn(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),zr={current:void 0},kl=Sl({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!zr.current){const e=new lg({});e.mount(window),e.setOptions({layoutScroll:!0}),zr.current=e}return zr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),dg={pan:{Feature:jm},drag:{Feature:Am,ProjectionNode:kl,MeasureLayout:pl}};function Yi(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&ye.postRender(()=>o(t,jn(t)))}class ug extends gt{mount(){const{current:t}=this.node;t&&(this.unmount=If(t,(n,r)=>(Yi(this.node,r,"Start"),s=>Yi(this.node,s,"End"))))}unmount(){}}class fg extends gt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=En(Cn(this.node.current,"focus",()=>this.onFocus()),Cn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function qi(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&ye.postRender(()=>o(t,jn(t)))}class hg extends gt{mount(){const{current:t}=this.node;t&&(this.unmount=Of(t,(n,r)=>(qi(this.node,r,"Start"),(s,{success:o})=>qi(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ts=new WeakMap,Ur=new WeakMap,mg=e=>{const t=Ts.get(e.target);t&&t(e)},gg=e=>{e.forEach(mg)};function pg({root:e,...t}){const n=e||document;Ur.has(n)||Ur.set(n,{});const r=Ur.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(gg,{root:e,...t})),r[s]}function yg(e,t,n){const r=pg(t);return Ts.set(e,n),r.observe(e),()=>{Ts.delete(e),r.unobserve(e)}}const xg={some:0,all:1};class bg extends gt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:xg[s]},a=c=>{const{isIntersecting:d}=c;if(this.isInView===d||(this.isInView=d,o&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=d?u:f;h&&h(c)};return yg(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(vg(t,n))&&this.startObserver()}unmount(){}}function vg({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const wg={inView:{Feature:bg},tap:{Feature:hg},focus:{Feature:fg},hover:{Feature:ug}},Sg={layout:{ProjectionNode:kl,MeasureLayout:pl}},Cg={...am,...wg,...dg,...Sg},ie=Ch(Cg,$h),Ke=g.forwardRef((e,t)=>{const{alt:n,color:r="currentColor",size:s="1em",weight:o="regular",mirrored:i=!1,children:a,weights:c,...d}=e;return g.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:r,viewBox:"0 0 256 256",transform:i?"scale(-1, 1)":void 0,...d},!!n&&g.createElement("title",null,n),a,c.get(o))});Ke.displayName="SSRBase";const kg=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),g.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),bo=g.forwardRef((e,t)=>g.createElement(Ke,{ref:t,...e,weights:kg}));bo.displayName="CaretDownIcon";const Eg=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,160H48l80-80Z",opacity:"0.2"}),g.createElement("path",{d:"M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z"}))]]),El=g.forwardRef((e,t)=>g.createElement(Ke,{ref:t,...e,weights:Eg}));El.displayName="CaretUpIcon";const Tg=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,44H40A20,20,0,0,0,20,64V224A19.82,19.82,0,0,0,31.56,242.1a20.14,20.14,0,0,0,8.49,1.9,19.91,19.91,0,0,0,12.82-4.72l.12-.11L84.47,212H216a20,20,0,0,0,20-20V64A20,20,0,0,0,216,44Zm-4,144H80a11.93,11.93,0,0,0-7.84,2.92L44,215.23V68H212ZM84,108A12,12,0,0,1,96,96h64a12,12,0,1,1,0,24H96A12,12,0,0,1,84,108Zm0,40a12,12,0,0,1,12-12h64a12,12,0,0,1,0,24H96A12,12,0,0,1,84,148Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,64V192a8,8,0,0,1-8,8H80L45.15,230.11A8,8,0,0,1,32,224V64a8,8,0,0,1,8-8H216A8,8,0,0,1,224,64Z",opacity:"0.2"}),g.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.84,15.84,0,0,0,9.25,14.5A16.05,16.05,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM160,152H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,50H40A14,14,0,0,0,26,64V224a13.88,13.88,0,0,0,8.09,12.69A14.11,14.11,0,0,0,40,238a13.87,13.87,0,0,0,9-3.31l.06-.05L82.23,206H216a14,14,0,0,0,14-14V64A14,14,0,0,0,216,50Zm2,142a2,2,0,0,1-2,2H80a6,6,0,0,0-3.92,1.46L41.26,225.53A2,2,0,0,1,38,224V64a2,2,0,0,1,2-2H216a2,2,0,0,1,2,2Zm-52-80a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,144Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,52H40A12,12,0,0,0,28,64V224a11.89,11.89,0,0,0,6.93,10.88A12.17,12.17,0,0,0,40,236a11.89,11.89,0,0,0,7.69-2.83l0,0L81.49,204H216a12,12,0,0,0,12-12V64A12,12,0,0,0,216,52Zm4,140a4,4,0,0,1-4,4H80a4,4,0,0,0-2.62,1L42.56,227.06A4,4,0,0,1,36,224V64a4,4,0,0,1,4-4H216a4,4,0,0,1,4,4Zm-56-80a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,144Z"}))]]),Tl=g.forwardRef((e,t)=>g.createElement(Ke,{ref:t,...e,weights:Tg}));Tl.displayName="ChatTextIcon";const Ag=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),Al=g.forwardRef((e,t)=>g.createElement(Ke,{ref:t,...e,weights:Ag}));Al.displayName="CheckIcon";const jg=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,180a52.06,52.06,0,0,0,52-52V64A52,52,0,0,0,76,64v64A52.06,52.06,0,0,0,128,180ZM100,64a28,28,0,0,1,56,0v64a28,28,0,0,1-56,0Zm40,155.22V240a12,12,0,0,1-24,0V219.22A92.14,92.14,0,0,1,36,128a12,12,0,0,1,24,0,68,68,0,0,0,136,0,12,12,0,0,1,24,0A92.14,92.14,0,0,1,140,219.22Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M168,64v64a40,40,0,0,1-40,40h0a40,40,0,0,1-40-40V64a40,40,0,0,1,40-40h0A40,40,0,0,1,168,64Z",opacity:"0.2"}),g.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M80,128V64a48,48,0,0,1,96,0v64a48,48,0,0,1-96,0Zm128,0a8,8,0,0,0-16,0,64,64,0,0,1-128,0,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.6A80.11,80.11,0,0,0,208,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,174a46.06,46.06,0,0,0,46-46V64a46,46,0,0,0-92,0v64A46.06,46.06,0,0,0,128,174ZM94,64a34,34,0,0,1,68,0v64a34,34,0,0,1-68,0Zm40,141.75V240a6,6,0,0,1-12,0V205.75A78.09,78.09,0,0,1,50,128a6,6,0,0,1,12,0,66,66,0,0,0,132,0,6,6,0,0,1,12,0A78.09,78.09,0,0,1,134,205.75Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,172a44.05,44.05,0,0,0,44-44V64a44,44,0,0,0-88,0v64A44.05,44.05,0,0,0,128,172ZM92,64a36,36,0,0,1,72,0v64a36,36,0,0,1-72,0Zm40,139.89V240a4,4,0,0,1-8,0V203.89A76.09,76.09,0,0,1,52,128a4,4,0,0,1,8,0,68,68,0,0,0,136,0,4,4,0,0,1,8,0A76.09,76.09,0,0,1,132,203.89Z"}))]]),jl=g.forwardRef((e,t)=>g.createElement(Ke,{ref:t,...e,weights:jg}));jl.displayName="MicrophoneIcon";const Mg=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M56.88,39.93A12,12,0,1,0,39.12,56.07L76,96.64V128a52,52,0,0,0,72.11,48l11.26,12.39A67.34,67.34,0,0,1,128,196a68.07,68.07,0,0,1-68-68,12,12,0,0,0-24,0,92.14,92.14,0,0,0,80,91.22V240a12,12,0,0,0,24,0V219.23a90.39,90.39,0,0,0,35.92-12.68l23.2,25.52a12,12,0,0,0,17.76-16.14ZM128,156a28,28,0,0,1-28-28v-5l29.9,32.89C129.27,156,128.64,156,128,156Zm63-2.42A67.63,67.63,0,0,0,196,128a12,12,0,0,1,24,0,91.48,91.48,0,0,1-6.74,34.61,12,12,0,0,1-22.23-9ZM85.7,33.75A52,52,0,0,1,180,64v56.54a12,12,0,0,1-24,0V64a28,28,0,0,0-50.79-16.28,12,12,0,0,1-19.51-14Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M168,64v64a40,40,0,0,1-40,40h0a40,40,0,0,1-40-40V64a40,40,0,0,1,40-40h0A40,40,0,0,1,168,64Z",opacity:"0.2"}),g.createElement("path",{d:"M213.92,218.62l-160-176A8,8,0,0,0,42.08,53.38L80,95.09V128a48,48,0,0,0,69.11,43.12l11.1,12.2A63.41,63.41,0,0,1,128,192a64.07,64.07,0,0,1-64-64,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.59a78.83,78.83,0,0,0,35.16-12.22l30.92,34a8,8,0,1,0,11.84-10.76ZM128,160a32,32,0,0,1-32-32V112.69l41.66,45.82A32,32,0,0,1,128,160Zm57.52-3.91A63.32,63.32,0,0,0,192,128a8,8,0,0,1,16,0,79.16,79.16,0,0,1-8.11,35.12,8,8,0,0,1-7.19,4.49,7.88,7.88,0,0,1-3.51-.82A8,8,0,0,1,185.52,156.09ZM84,44.87A48,48,0,0,1,176,64v64a49.19,49.19,0,0,1-.26,5,8,8,0,0,1-8,7.17,8.13,8.13,0,0,1-.84,0,8,8,0,0,1-7.12-8.79c.11-1.1.17-2.24.17-3.36V64A32,32,0,0,0,98.64,51.25,8,8,0,1,1,84,44.87Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.38,229.92a8,8,0,0,1-11.3-.54l-30.92-34A78.83,78.83,0,0,1,136,207.59V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64.07,64.07,0,0,0,64,64,63.41,63.41,0,0,0,32.21-8.68l-11.1-12.2A48,48,0,0,1,80,128V95.09L42.08,53.38A8,8,0,0,1,53.92,42.62l160,176A8,8,0,0,1,213.38,229.92Zm-24.19-63.13a7.88,7.88,0,0,0,3.51.82,8,8,0,0,0,7.19-4.49A79.16,79.16,0,0,0,208,128a8,8,0,0,0-16,0,63.32,63.32,0,0,1-6.48,28.09A8,8,0,0,0,189.19,166.79Zm-27.33-29.22A8,8,0,0,0,175.74,133a49.49,49.49,0,0,0,.26-5V64A48,48,0,0,0,84,44.87a8,8,0,0,0,1.41,8.57Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M212.44,220,52.44,44A6,6,0,0,0,43.56,52L82,94.32V128a46,46,0,0,0,67.56,40.64l13.75,15.12A65.26,65.26,0,0,1,128,194a66.08,66.08,0,0,1-66-66,6,6,0,0,0-12,0,78.09,78.09,0,0,0,72,77.75V240a6,6,0,0,0,12,0V205.77a76.93,76.93,0,0,0,37.48-13L203.56,228a6,6,0,0,0,8.88-8.08ZM128,162a34,34,0,0,1-34-34V107.52l47.12,51.84A33.82,33.82,0,0,1,128,162Zm59.32-5A65.38,65.38,0,0,0,194,128a6,6,0,0,1,12,0,77.33,77.33,0,0,1-7.9,34.25A6,6,0,1,1,187.32,157ZM85.8,45.67A46,46,0,0,1,174,64v64a45.17,45.17,0,0,1-.25,4.81,6,6,0,0,1-6,5.38q-.31,0-.63,0a6,6,0,0,1-5.34-6.59A35.41,35.41,0,0,0,162,128V64A34,34,0,0,0,96.8,50.45a6,6,0,0,1-11-4.78Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.92,218.62l-160-176A8,8,0,0,0,42.08,53.38L80,95.09V128a48,48,0,0,0,69.11,43.12l11.1,12.2A63.41,63.41,0,0,1,128,192a64.07,64.07,0,0,1-64-64,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.59a78.83,78.83,0,0,0,35.16-12.22l30.92,34a8,8,0,1,0,11.84-10.76ZM128,160a32,32,0,0,1-32-32V112.69l41.66,45.82A32,32,0,0,1,128,160Zm57.52-3.91A63.32,63.32,0,0,0,192,128a8,8,0,0,1,16,0,79.16,79.16,0,0,1-8.11,35.12,8,8,0,0,1-7.19,4.49,7.88,7.88,0,0,1-3.51-.82A8,8,0,0,1,185.52,156.09ZM84,44.87A48,48,0,0,1,176,64v64a49.19,49.19,0,0,1-.26,5,8,8,0,0,1-8,7.17,8.13,8.13,0,0,1-.84,0,8,8,0,0,1-7.12-8.79c.11-1.1.17-2.24.17-3.36V64A32,32,0,0,0,98.64,51.25,8,8,0,1,1,84,44.87Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M211,221.31,51,45.31A4,4,0,0,0,45,50.69L84,93.55V128a44,44,0,0,0,66,38.12l16.38,18A67.21,67.21,0,0,1,128,196a68.07,68.07,0,0,1-68-68,4,4,0,0,0-8,0,76.09,76.09,0,0,0,72,75.89V240a4,4,0,0,0,8,0V203.89a75.1,75.1,0,0,0,39.79-13.77L205,226.69a4,4,0,1,0,5.92-5.38ZM128,164a36,36,0,0,1-36-36V102.35L144.43,160A35.83,35.83,0,0,1,128,164Zm61.12-6.15A67.44,67.44,0,0,0,196,128a4,4,0,0,1,8,0,75.28,75.28,0,0,1-7.7,33.37,4,4,0,0,1-7.18-3.52ZM87.63,46.46A44,44,0,0,1,172,64v64a44.2,44.2,0,0,1-.24,4.61,4,4,0,0,1-4,3.58l-.42,0a4,4,0,0,1-3.57-4.39A36.67,36.67,0,0,0,164,128V64A36,36,0,0,0,95,49.66a4,4,0,0,1-7.34-3.2Z"}))]]),Ml=g.forwardRef((e,t)=>g.createElement(Ke,{ref:t,...e,weights:Mg}));Ml.displayName="MicrophoneSlashIcon";const Pg=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,36H48A28,28,0,0,0,20,64V176a28,28,0,0,0,28,28H208a28,28,0,0,0,28-28V64A28,28,0,0,0,208,36Zm4,140a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Zm-40,52a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,228ZM160.49,103.51a12,12,0,0,1-17,17L140,117v35a12,12,0,0,1-24,0V117l-3.51,3.52a12,12,0,0,1-17-17l24-24a12,12,0,0,1,17,0Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,64V176a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V64A16,16,0,0,1,48,48H208A16,16,0,0,1,224,64Z",opacity:"0.2"}),g.createElement("path",{d:"M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8Zm-48,48a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224ZM157.66,106.34a8,8,0,0,1-11.32,11.32L136,107.31V152a8,8,0,0,1-16,0V107.31l-10.34,10.35a8,8,0,0,1-11.32-11.32l24-24a8,8,0,0,1,11.32,0Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M168,224a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224ZM232,64V176a24,24,0,0,1-24,24H48a24,24,0,0,1-24-24V64A24,24,0,0,1,48,40H208A24,24,0,0,1,232,64Zm-74.34,42.34-24-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,11.32,11.32L120,107.31V152a8,8,0,0,0,16,0V107.31l10.34,10.35a8,8,0,0,0,11.32-11.32Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,42H48A22,22,0,0,0,26,64V176a22,22,0,0,0,22,22H208a22,22,0,0,0,22-22V64A22,22,0,0,0,208,42Zm10,134a10,10,0,0,1-10,10H48a10,10,0,0,1-10-10V64A10,10,0,0,1,48,54H208a10,10,0,0,1,10,10Zm-52,48a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,224Zm-9.76-116.24a6,6,0,1,1-8.48,8.48L134,102.49V152a6,6,0,0,1-12,0V102.49l-13.76,13.75a6,6,0,0,1-8.48-8.48l24-24a6,6,0,0,1,8.48,0Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8Zm-48,48a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224ZM157.66,106.34a8,8,0,0,1-11.32,11.32L136,107.31V152a8,8,0,0,1-16,0V107.31l-10.34,10.35a8,8,0,0,1-11.32-11.32l24-24a8,8,0,0,1,11.32,0Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,44H48A20,20,0,0,0,28,64V176a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V64A20,20,0,0,0,208,44Zm12,132a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V64A12,12,0,0,1,48,52H208a12,12,0,0,1,12,12Zm-56,48a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,224Zm-9.17-114.83a4,4,0,0,1-5.66,5.66L132,97.66V152a4,4,0,0,1-8,0V97.66l-17.17,17.17a4,4,0,0,1-5.66-5.66l24-24a4,4,0,0,1,5.66,0Z"}))]]),Pl=g.forwardRef((e,t)=>g.createElement(Ke,{ref:t,...e,weights:Pg}));Pl.displayName="MonitorArrowUpIcon";const Vg=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M140,32V64a12,12,0,0,1-24,0V32a12,12,0,0,1,24,0Zm33.25,62.75a12,12,0,0,0,8.49-3.52L204.37,68.6a12,12,0,0,0-17-17L164.77,74.26a12,12,0,0,0,8.48,20.49ZM224,116H192a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24Zm-42.26,48.77a12,12,0,1,0-17,17l22.63,22.63a12,12,0,0,0,17-17ZM128,180a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V192A12,12,0,0,0,128,180ZM74.26,164.77,51.63,187.4a12,12,0,0,0,17,17l22.63-22.63a12,12,0,1,0-17-17ZM76,128a12,12,0,0,0-12-12H32a12,12,0,0,0,0,24H64A12,12,0,0,0,76,128ZM68.6,51.63a12,12,0,1,0-17,17L74.26,91.23a12,12,0,0,0,17-17Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),g.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm33.94,58.75,17-17a8,8,0,0,1,11.32,11.32l-17,17a8,8,0,0,1-11.31-11.31ZM48,136a8,8,0,0,1,0-16H72a8,8,0,0,1,0,16Zm46.06,37.25-17,17a8,8,0,0,1-11.32-11.32l17-17a8,8,0,0,1,11.31,11.31Zm0-79.19a8,8,0,0,1-11.31,0l-17-17A8,8,0,0,1,77.09,65.77l17,17A8,8,0,0,1,94.06,94.06ZM136,208a8,8,0,0,1-16,0V184a8,8,0,0,1,16,0Zm0-136a8,8,0,0,1-16,0V48a8,8,0,0,1,16,0Zm54.23,118.23a8,8,0,0,1-11.32,0l-17-17a8,8,0,0,1,11.31-11.31l17,17A8,8,0,0,1,190.23,190.23ZM208,136H184a8,8,0,0,1,0-16h24a8,8,0,0,1,0,16Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M134,32V64a6,6,0,0,1-12,0V32a6,6,0,0,1,12,0Zm39.25,56.75A6,6,0,0,0,177.5,87l22.62-22.63a6,6,0,0,0-8.48-8.48L169,78.5a6,6,0,0,0,4.24,10.25ZM224,122H192a6,6,0,0,0,0,12h32a6,6,0,0,0,0-12Zm-46.5,47A6,6,0,0,0,169,177.5l22.63,22.62a6,6,0,0,0,8.48-8.48ZM128,186a6,6,0,0,0-6,6v32a6,6,0,0,0,12,0V192A6,6,0,0,0,128,186ZM78.5,169,55.88,191.64a6,6,0,1,0,8.48,8.48L87,177.5A6,6,0,1,0,78.5,169ZM70,128a6,6,0,0,0-6-6H32a6,6,0,0,0,0,12H64A6,6,0,0,0,70,128ZM64.36,55.88a6,6,0,0,0-8.48,8.48L78.5,87A6,6,0,1,0,87,78.5Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M132,32V64a4,4,0,0,1-8,0V32a4,4,0,0,1,8,0Zm41.25,54.75a4,4,0,0,0,2.83-1.18L198.71,63a4,4,0,0,0-5.66-5.66L170.43,79.92a4,4,0,0,0,2.82,6.83ZM224,124H192a4,4,0,0,0,0,8h32a4,4,0,0,0,0-8Zm-47.92,46.43a4,4,0,1,0-5.65,5.65l22.62,22.63a4,4,0,0,0,5.66-5.66ZM128,188a4,4,0,0,0-4,4v32a4,4,0,0,0,8,0V192A4,4,0,0,0,128,188ZM79.92,170.43,57.29,193.05A4,4,0,0,0,63,198.71l22.62-22.63a4,4,0,1,0-5.65-5.65ZM68,128a4,4,0,0,0-4-4H32a4,4,0,0,0,0,8H64A4,4,0,0,0,68,128ZM63,57.29A4,4,0,0,0,57.29,63L79.92,85.57a4,4,0,1,0,5.65-5.65Z"}))]]),vo=g.forwardRef((e,t)=>g.createElement(Ke,{ref:t,...e,weights:Vg}));vo.displayName="SpinnerIcon";const Ng=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M249.45,69.31a12,12,0,0,0-12.51,1L212,88.43V72a20,20,0,0,0-20-20H32A20,20,0,0,0,12,72V184a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V167.57l24.94,18.14A12,12,0,0,0,256,176V80A12,12,0,0,0,249.45,69.31ZM188,180H36V76H188Zm44-27.57-20-14.54V118.11l20-14.54Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,72V184a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V72a8,8,0,0,1,8-8H192A8,8,0,0,1,200,72Z",opacity:"0.2"}),g.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M192,72V184a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V72A16,16,0,0,1,32,56H176A16,16,0,0,1,192,72Zm58,.25a8.23,8.23,0,0,0-6.63,1.22L209.78,95.86A4,4,0,0,0,208,99.19v57.62a4,4,0,0,0,1.78,3.33l33.78,22.52a8,8,0,0,0,8.58.19,8.33,8.33,0,0,0,3.86-7.17V80A8,8,0,0,0,250,72.25Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M250.83,74.71a6,6,0,0,0-6.16.3L206,100.79V72a14,14,0,0,0-14-14H32A14,14,0,0,0,18,72V184a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V155.21L244.67,181a6,6,0,0,0,9.33-5V80A6,6,0,0,0,250.83,74.71ZM194,184a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V72a2,2,0,0,1,2-2H192a2,2,0,0,1,2,2Zm48-19.21-36-24V115.21l36-24Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M249.89,76.47a4,4,0,0,0-4.11.2L204,104.53V72a12,12,0,0,0-12-12H32A12,12,0,0,0,20,72V184a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V151.47l41.78,27.86A4,4,0,0,0,252,176V80A4,4,0,0,0,249.89,76.47ZM196,184a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V72a4,4,0,0,1,4-4H192a4,4,0,0,1,4,4Zm48-15.47-40-26.67V114.14l40-26.67Z"}))]]),Vl=g.forwardRef((e,t)=>g.createElement(Ke,{ref:t,...e,weights:Ng}));Vl.displayName="VideoCameraIcon";const Rg=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M249.45,69.31a12,12,0,0,0-12.51,1L212,88.43V72a20,20,0,0,0-20-20H123.88a12,12,0,0,0,0,24H188v68a12,12,0,0,0,4.46,9.33c.15.13.31.25.48.38l44,32A12,12,0,0,0,256,176V80A12,12,0,0,0,249.45,69.31ZM232,152.43l-20-14.54V118.11l20-14.54ZM56.88,31.93A12,12,0,1,0,39.12,48.07L42.69,52H32A20,20,0,0,0,12,72V184a20,20,0,0,0,20,20H180.87l18.25,20.07a12,12,0,0,0,17.76-16.14ZM36,180V76H64.51l94.55,104Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,72V184a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V72a8,8,0,0,1,8-8H192A8,8,0,0,1,200,72Z",opacity:"0.2"}),g.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H113.06a8,8,0,0,0,0,16H192v87.63a8,8,0,0,0,16,0V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM240,161.05l-32-21.33V116.28L240,95ZM53.92,34.62A8,8,0,1,0,42.08,45.38L51.73,56H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H182.64l19.44,21.38a8,8,0,1,0,11.84-10.76ZM32,184V72H66.28L168.1,184Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M256,80.23v95.45a8.33,8.33,0,0,1-3.86,7.17,8,8,0,0,1-8.58-.19l-33.78-22.52a4,4,0,0,1-1.78-3.33V99.19a4,4,0,0,1,1.78-3.32l33.78-22.53a8,8,0,0,1,9.73.66A8.23,8.23,0,0,1,256,80.23ZM53.92,34.62A8,8,0,1,0,42.08,45.38L51.73,56H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H182.64l19.44,21.38a8,8,0,1,0,11.84-10.76ZM185,155.07a4,4,0,0,0,7-2.7V72a16,16,0,0,0-16-16H104a4,4,0,0,0-3,6.69Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M250.83,74.71a6,6,0,0,0-6.16.3L206,100.79V72a14,14,0,0,0-14-14H113.06a6,6,0,0,0,0,12H192a2,2,0,0,1,2,2v87.63a6,6,0,0,0,12,0v-4.42L244.67,181a6,6,0,0,0,9.33-5V80A6,6,0,0,0,250.83,74.71ZM242,164.79l-36-24V115.21l36-24ZM52.44,36A6,6,0,0,0,43.56,44L56.25,58H32A14,14,0,0,0,18,72V184a14,14,0,0,0,14,14H183.53l20,22a6,6,0,0,0,8.88-8.08ZM32,186a2,2,0,0,1-2-2V72a2,2,0,0,1,2-2H67.16L172.62,186Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H113.06a8,8,0,0,0,0,16H192v87.63a8,8,0,0,0,16,0V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM240,161.05l-32-21.33V116.28L240,95ZM53.92,34.62A8,8,0,1,0,42.08,45.38L51.73,56H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H182.64l19.44,21.38a8,8,0,1,0,11.84-10.76ZM32,184V72H66.28L168.1,184Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M249.89,76.47a4,4,0,0,0-4.11.2L204,104.53V72a12,12,0,0,0-12-12H113.06a4,4,0,0,0,0,8H192a4,4,0,0,1,4,4v87.63a4,4,0,0,0,8,0v-8.16l41.78,27.86A4,4,0,0,0,252,176V80A4,4,0,0,0,249.89,76.47ZM244,168.53l-40-26.67V114.14l40-26.67ZM51,37.31A4,4,0,0,0,45,42.69L60.78,60H32A12,12,0,0,0,20,72V184a12,12,0,0,0,12,12H184.41L205,218.69a4,4,0,1,0,5.92-5.38ZM32,188a4,4,0,0,1-4-4V72a4,4,0,0,1,4-4H68.05L177.14,188Z"}))]]),Nl=g.forwardRef((e,t)=>g.createElement(Ke,{ref:t,...e,weights:Rg}));Nl.displayName="VideoCameraSlashIcon";function Xi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ig(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Xi(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Xi(e[s],null)}}}}function Dg(e){const t=Fg(e),n=g.forwardRef((r,s)=>{const{children:o,...i}=r,a=g.Children.toArray(o),c=a.find(Lg);if(c){const d=c.props.children,u=a.map(f=>f===c?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:f);return l.jsx(t,{...i,ref:s,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return l.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var $g=Dg("Slot");function Fg(e){const t=g.forwardRef((n,r)=>{const{children:s,...o}=n;if(g.isValidElement(s)){const i=Bg(s),a=_g(o,s.props);return s.type!==g.Fragment&&(a.ref=r?Ig(r,i):i),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Og=Symbol("radix.slottable");function Lg(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Og}function _g(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Bg(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const wo="-",zg=e=>{const t=Hg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(wo);return a[0]===""&&a.length!==1&&a.shift(),Rl(a,t)||Ug(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},Rl=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Rl(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(wo);return(i=t.validators.find(({validator:a})=>a(o)))==null?void 0:i.classGroupId},Ji=/^\[(.+)\]$/,Ug=e=>{if(Ji.test(e)){const t=Ji.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Hg=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const s in n)As(n[s],r,s,t);return r},As=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Qi(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(Zg(s)){As(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{As(i,Qi(t,o),n,r)})})},Qi=(e,t)=>{let n=e;return t.split(wo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Zg=e=>e.isThemeGetter,Wg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return s(o,i),i},set(o,i){n.has(o)?n.set(o,i):s(o,i)}}},js="!",Ms=":",Gg=Ms.length,Kg=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const o=[];let i=0,a=0,c=0,d;for(let x=0;x<s.length;x++){let m=s[x];if(i===0&&a===0){if(m===Ms){o.push(s.slice(c,x)),c=x+Gg;continue}if(m==="/"){d=x;continue}}m==="["?i++:m==="]"?i--:m==="("?a++:m===")"&&a--}const u=o.length===0?s:s.substring(c),f=Yg(u),h=f!==u,p=d&&d>c?d-c:void 0;return{modifiers:o,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:p}};if(t){const s=t+Ms,o=r;r=i=>i.startsWith(s)?o(i.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},Yg=e=>e.endsWith(js)?e.substring(0,e.length-1):e.startsWith(js)?e.substring(1):e,qg=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const s=[];let o=[];return r.forEach(i=>{i[0]==="["||t[i]?(s.push(...o.sort(),i),o=[]):o.push(i)}),s.push(...o.sort()),s}},Xg=e=>({cache:Wg(e.cacheSize),parseClassName:Kg(e),sortModifiers:qg(e),...zg(e)}),Jg=/\s+/,Qg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o}=t,i=[],a=e.trim().split(Jg);let c="";for(let d=a.length-1;d>=0;d-=1){const u=a[d],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:m}=n(u);if(f){c=u+(c.length>0?" "+c:c);continue}let b=!!m,k=r(b?x.substring(0,m):x);if(!k){if(!b){c=u+(c.length>0?" "+c:c);continue}if(k=r(x),!k){c=u+(c.length>0?" "+c:c);continue}b=!1}const v=o(h).join(":"),E=p?v+js:v,w=E+k;if(i.includes(w))continue;i.push(w);const S=s(k,b);for(let A=0;A<S.length;++A){const M=S[A];i.push(E+M)}c=u+(c.length>0?" "+c:c)}return c};function ep(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Il(t))&&(r&&(r+=" "),r+=n);return r}const Il=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Il(e[r]))&&(n&&(n+=" "),n+=t);return n};function tp(e,...t){let n,r,s,o=i;function i(c){const d=t.reduce((u,f)=>f(u),e());return n=Xg(d),r=n.cache.get,s=n.cache.set,o=a,a(c)}function a(c){const d=r(c);if(d)return d;const u=Qg(c,n);return s(c,u),u}return function(){return o(ep.apply(null,arguments))}}const Me=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Dl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$l=/^\((?:(\w[\w-]*):)?(.+)\)$/i,np=/^\d+\/\d+$/,rp=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sp=/\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$/,op=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ip=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ap=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mt=e=>np.test(e),se=e=>!!e&&!Number.isNaN(Number(e)),ct=e=>!!e&&Number.isInteger(Number(e)),Hr=e=>e.endsWith("%")&&se(e.slice(0,-1)),et=e=>rp.test(e),cp=()=>!0,lp=e=>sp.test(e)&&!op.test(e),Fl=()=>!1,dp=e=>ip.test(e),up=e=>ap.test(e),fp=e=>!W(e)&&!G(e),hp=e=>en(e,_l,Fl),W=e=>Dl.test(e),xt=e=>en(e,Bl,lp),Zr=e=>en(e,xp,se),ea=e=>en(e,Ol,Fl),mp=e=>en(e,Ll,up),Ln=e=>en(e,zl,dp),G=e=>$l.test(e),an=e=>tn(e,Bl),gp=e=>tn(e,bp),ta=e=>tn(e,Ol),pp=e=>tn(e,_l),yp=e=>tn(e,Ll),_n=e=>tn(e,zl,!0),en=(e,t,n)=>{const r=Dl.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},tn=(e,t,n=!1)=>{const r=$l.exec(e);return r?r[1]?t(r[1]):n:!1},Ol=e=>e==="position"||e==="percentage",Ll=e=>e==="image"||e==="url",_l=e=>e==="length"||e==="size"||e==="bg-size",Bl=e=>e==="length",xp=e=>e==="number",bp=e=>e==="family-name",zl=e=>e==="shadow",vp=()=>{const e=Me("color"),t=Me("font"),n=Me("text"),r=Me("font-weight"),s=Me("tracking"),o=Me("leading"),i=Me("breakpoint"),a=Me("container"),c=Me("spacing"),d=Me("radius"),u=Me("shadow"),f=Me("inset-shadow"),h=Me("text-shadow"),p=Me("drop-shadow"),x=Me("blur"),m=Me("perspective"),b=Me("aspect"),k=Me("ease"),v=Me("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...w(),G,W],A=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],j=()=>[G,W,c],z=()=>[Mt,"full","auto",...j()],y=()=>[ct,"none","subgrid",G,W],D=()=>["auto",{span:["full",ct,G,W]},ct,G,W],_=()=>[ct,"auto",G,W],J=()=>["auto","min","max","fr",G,W],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],re=()=>["auto",...j()],K=()=>[Mt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],R=()=>[e,G,W],X=()=>[...w(),ta,ea,{position:[G,W]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",pp,hp,{size:[G,W]}],q=()=>[Hr,an,xt],P=()=>["","none","full",d,G,W],T=()=>["",se,an,xt],O=()=>["solid","dashed","dotted","double"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>[se,Hr,ta,ea],I=()=>["","none",x,G,W],U=()=>["none",se,G,W],B=()=>["none",se,G,W],oe=()=>[se,G,W],L=()=>[Mt,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[et],breakpoint:[et],color:[cp],container:[et],"drop-shadow":[et],ease:["in","out","in-out"],font:[fp],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[et],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[et],shadow:[et],spacing:["px",se],text:[et],"text-shadow":[et],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Mt,W,G,b]}],container:["container"],columns:[{columns:[se,W,G,a]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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"],sr:["sr-only","not-sr-only"],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:S()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{start:z()}],end:[{end:z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[ct,"auto",G,W]}],basis:[{basis:[Mt,"full","auto",a,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[se,Mt,"auto","initial","none",W]}],grow:[{grow:["",se,G,W]}],shrink:[{shrink:["",se,G,W]}],order:[{order:[ct,"first","last","none",G,W]}],"grid-cols":[{"grid-cols":y()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":y()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:re()}],mx:[{mx:re()}],my:[{my:re()}],ms:[{ms:re()}],me:[{me:re()}],mt:[{mt:re()}],mr:[{mr:re()}],mb:[{mb:re()}],ml:[{ml:re()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[a,"screen",...K()]}],"min-w":[{"min-w":[a,"screen","none",...K()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,an,xt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,G,Zr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Hr,W]}],"font-family":[{font:[gp,W,t]}],"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:[s,G,W]}],"line-clamp":[{"line-clamp":[se,"none",G,Zr]}],leading:[{leading:[o,...j()]}],"list-image":[{"list-image":["none",G,W]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",G,W]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:[se,"from-font","auto",G,xt]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[se,"auto",G,W]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",G,W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",G,W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ct,G,W],radial:["",G,W],conic:[ct,G,W]},yp,mp]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:T()}],"border-w-x":[{"border-x":T()}],"border-w-y":[{"border-y":T()}],"border-w-s":[{"border-s":T()}],"border-w-e":[{"border-e":T()}],"border-w-t":[{"border-t":T()}],"border-w-r":[{"border-r":T()}],"border-w-b":[{"border-b":T()}],"border-w-l":[{"border-l":T()}],"divide-x":[{"divide-x":T()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":T()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...O(),"hidden","none"]}],"divide-style":[{divide:[...O(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...O(),"none","hidden"]}],"outline-offset":[{"outline-offset":[se,G,W]}],"outline-w":[{outline:["",se,an,xt]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",u,_n,Ln]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",f,_n,Ln]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[se,xt]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":T()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",h,_n,Ln]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[se,G,W]}],"mix-blend":[{"mix-blend":[...F(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":F()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[se]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[G,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[se]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",G,W]}],filter:[{filter:["","none",G,W]}],blur:[{blur:I()}],brightness:[{brightness:[se,G,W]}],contrast:[{contrast:[se,G,W]}],"drop-shadow":[{"drop-shadow":["","none",p,_n,Ln]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",se,G,W]}],"hue-rotate":[{"hue-rotate":[se,G,W]}],invert:[{invert:["",se,G,W]}],saturate:[{saturate:[se,G,W]}],sepia:[{sepia:["",se,G,W]}],"backdrop-filter":[{"backdrop-filter":["","none",G,W]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[se,G,W]}],"backdrop-contrast":[{"backdrop-contrast":[se,G,W]}],"backdrop-grayscale":[{"backdrop-grayscale":["",se,G,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[se,G,W]}],"backdrop-invert":[{"backdrop-invert":["",se,G,W]}],"backdrop-opacity":[{"backdrop-opacity":[se,G,W]}],"backdrop-saturate":[{"backdrop-saturate":[se,G,W]}],"backdrop-sepia":[{"backdrop-sepia":["",se,G,W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",G,W]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[se,"initial",G,W]}],ease:[{ease:["linear","initial",k,G,W]}],delay:[{delay:[se,G,W]}],animate:[{animate:["none",v,G,W]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,G,W]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:B()}],"scale-x":[{"scale-x":B()}],"scale-y":[{"scale-y":B()}],"scale-z":[{"scale-z":B()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[G,W,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:L()}],"translate-x":[{"translate-x":L()}],"translate-y":[{"translate-y":L()}],"translate-z":[{"translate-z":L()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",G,W]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",G,W]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[se,an,xt,Zr]}],stroke:[{stroke:["none",...R()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},wp=tp(vp);function Y(...e){return wp($s.clsx(e))}function Sp(e,t){return{id:e.streamInfo.id,timestamp:e.streamInfo.timestamp,message:e.text,from:e.participantInfo.identity===t.localParticipant.identity?t.localParticipant:Array.from(t.remoteParticipants.values()).find(n=>n.identity===e.participantInfo.identity)}}const Cp=Ds.cva(["text-xs font-bold tracking-wider uppercase whitespace-nowrap","inline-flex items-center justify-center gap-2 shrink-0 rounded-full cursor-pointer outline-none transition-colors duration-300","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","disabled:pointer-events-none disabled:opacity-50","aria-invalid:ring-destructive/20 aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40 ","[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0"],{variants:{variant:{default:"bg-button text-button-foreground hover:bg-muted focus:bg-muted",destructive:["bg-destructive text-destructive-foreground","hover:bg-destructive-hover focus:bg-destructive-hover focus-visible:ring-destructive-foreground/20","dark:focus-visible:ring-destructive-foreground/40"],outline:["border bg-background","hover:bg-accent hover:text-accent-foreground","dark:bg-input/30 dark:border-input dark:hover:bg-input/50"],primary:"",secondary:"bg-secondary text-secondary-foregroun hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function kp({className:e,variant:t,size:n,asChild:r=!1,...s}){const o=r?$g:"button";return l.jsx(o,{"data-slot":"button",className:Y(Cp({variant:t,size:n,className:e})),...s})}function Ep({onSend:e,className:t,disabled:n,...r}){const s=C.useRef(null),[o,i]=C.useState(""),a=d=>{var u,f;d.preventDefault(),(u=r.onSubmit)==null||u.call(r,d),e==null||e(o),i(""),(f=s.current)==null||f.focus({preventScroll:!0})},c=n||o.trim().length===0;return l.jsxs("form",{...r,onSubmit:a,className:Y("flex items-center rounded-md pl-1 text-sm",t),children:[l.jsx("input",{ref:s,type:"text",className:"flex-1 focus:outline-none",placeholder:"Type something...",value:o,onChange:d=>i(d.target.value),disabled:n}),l.jsx(kp,{size:"sm",type:"submit",variant:c?"secondary":"primary",disabled:c,className:"font-mono",children:"SEND"})]})}const Tp=Ds.cva(["inline-flex items-center justify-center gap-2 rounded-full","text-sm font-medium whitespace-nowrap","cursor-pointer outline-none transition-[color,border,background-color]","!focus:ring-0 !focus-visible:ring-0 !focus:border-none !focus-visible:border-none !ring-0 !border-none !outline-none","aria-invalid:ring-0 dark:aria-invalid:ring-0 aria-invalid:border-0","disabled:pointer-events-none disabled:opacity-50 disabled:not-allowed","data-[state=on]:bg-button-selected data-[state=on]:border-button-border-selected","[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0"],{variants:{variant:{default:"bg-button hover:bg-muted focus:bg-muted hover:text-muted-foreground focus:text-muted-foreground",primary:"text-fg1 bg-button hover:bg-button-hover focus:bg-button-hover data-[state=off]:bg-button-primary hover:data-[state=off]:bg-button-hover data-[state=off]:text-button-primary-foreground",secondary:"text-fg1 bg-button hover:bg-button-hover focus:bg-button-hover data-[state=on]:bg-button-secondary hover:data-[state=on]:bg-button-secondary data-[state=on]:text-button-secondary-foreground",outline:["border border-button-border bg-button text-button-foreground","hover:bg-background focus:bg-background"]},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function Ul({className:e,variant:t,size:n,...r}){return l.jsx(Hd.Root,{"data-slot":"toggle",className:Y(Tp({variant:t,size:n,className:e})),...r})}function Ap(e){const[t,n]=C.useState(()=>e.getPublishPermissions());return C.useEffect(()=>{const r=()=>{n(e.getPublishPermissions())},s=()=>{r()};return e.on("connection.connected",s),e.on("connection.disconnected",s),()=>{e.off("connection.connected",s),e.off("connection.disconnected",s)}},[e]),t}function Hl(e){const[t,n]=C.useState(()=>e.getLocalParticipant()),[r,s]=C.useState(()=>e.getMicrophoneTrack());return C.useEffect(()=>{const o=()=>{const a=e.getLocalParticipant(),c=e.getMicrophoneTrack();console.log("🎤 useVoxketLocalParticipant: Updating state:",{hasParticipant:!!a,hasMicTrack:!!c,isMicEnabled:e.isMicrophoneEnabled,trackPublications:a?a.trackPublications.size:0}),n(a),s(c)};o(),e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("track.muted",o),e.on("track.unmuted",o);const i=e.getRoom();if(i){const a=()=>{console.log("🎤 Track published, updating participant state"),o()},c=()=>{console.log("🎤 Track unpublished, updating participant state"),o()};return i.on("localTrackPublished",a),i.on("localTrackUnpublished",c),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o),i.off("localTrackPublished",a),i.off("localTrackUnpublished",c)}}else return()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o)}},[e]),{localParticipant:t,microphoneTrack:r}}function pn(e,t,n){const[r,s]=C.useState(!1),[o,i]=C.useState(!1);return C.useEffect(()=>{const c=()=>{let d=!1;switch(t){case"microphone":d=e.isMicrophoneEnabled;break;case"camera":d=e.isCameraEnabled;break;case"screenShare":d=e.isScreenShareEnabled;break}console.log(`useVoxketTrackToggle: ${t} enabled state updated to:`,d),s(d)};return c(),e.on("track.muted",c),e.on("track.unmuted",c),e.on("connection.connected",c),()=>{e.off("track.muted",c),e.off("track.unmuted",c),e.off("connection.connected",c)}},[e,t]),{enabled:r,pending:o,toggle:async c=>{var d;try{i(!0);const u=c!==void 0?c:!r;switch(t){case"microphone":await e.toggleMicrophone(u);break;case"camera":await e.toggleCamera(u);break;case"screenShare":u?await e.startScreenShare():await e.stopScreenShare();break}}catch(u){(d=n==null?void 0:n.onDeviceError)==null||d.call(n,u)}finally{i(!1)}}}}function Zl(e){const[t,n]=C.useState(()=>e.getRoom()),[r,s]=C.useState(()=>e.getConnectionState());return C.useEffect(()=>{const o=()=>{n(e.getRoom()),s(e.getConnectionState())};return e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("connection.connecting",o),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("connection.connecting",o)}},[e]),t}function jp(e,t){const[n,r]=C.useState([]),[s,o]=C.useState("");return C.useEffect(()=>{var d;const a=async()=>{try{const u=t==="audioinput"?await e.getAudioInputDevices():await e.getVideoInputDevices();r(u)}catch(u){console.error("Failed to load devices:",u)}};a();const c=()=>{a()};return(d=navigator.mediaDevices)==null||d.addEventListener("devicechange",c),()=>{var u;(u=navigator.mediaDevices)==null||u.removeEventListener("devicechange",c)}},[e,t]),{devices:n,activeDeviceId:s,setActiveMediaDevice:async a=>{try{t==="audioinput"?await e.setAudioInputDevice(a):await e.setVideoInputDevice(a),o(a)}catch(c){console.error("Failed to set device:",c)}}}}function Mp(e){const{preventSave:t=!1}=e||{};return{saveAudioInputEnabled:i=>{t||localStorage.setItem("voxket-audio-input-enabled",i.toString())},saveAudioInputDeviceId:i=>{t||localStorage.setItem("voxket-audio-input-device-id",i)},saveVideoInputEnabled:i=>{t||localStorage.setItem("voxket-video-input-enabled",i.toString())},saveVideoInputDeviceId:i=>{t||localStorage.setItem("voxket-video-input-device-id",i)}}}function Wl(e){const[t,n]=C.useState(()=>e.getIsAgentConnected()),[r,s]=C.useState(()=>e.getCurrentSession()),[o,i]=C.useState(()=>e.getCurrentAgentInfo()),[a,c]=C.useState(()=>e.getAgentState()),[d,u]=C.useState(()=>e.getAgentAudioTrack()),[f,h]=C.useState(()=>e.getAgentVideoTrack());return C.useEffect(()=>{const p=()=>{const E=e.getIsAgentConnected(),w=e.getCurrentSession(),S=e.getCurrentAgentInfo(),A=e.getAgentState(),M=e.getAgentAudioTrack(),j=e.getAgentVideoTrack();console.log("🤖 useVoxketVoiceAssistant: Updating state:",{isAgentConnected:E,hasSession:!!w,sessionId:w==null?void 0:w.id,hasAgentInfo:!!S,agentState:A,hasAudioTrack:!!M,hasVideoTrack:!!j}),n(E),s(w),i(S),c(A),u(M),h(j)};p();const x=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent connected event"),p()},m=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent disconnected event"),p()},b=()=>{console.log("🤖 useVoxketVoiceAssistant: Session changed event"),p()},k=()=>{console.log("🤖 useVoxketVoiceAssistant: Connection changed event"),p()},v=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent state changed event"),p()};return e.on("agent.connected",x),e.on("agent.speaking",x),e.on("agent.thinking",x),e.on("agent.state.changed",v),e.on("connection.disconnected",m),e.on("session.created",b),e.on("session.ended",b),e.on("session.state.changed",b),e.on("connection.connected",k),()=>{e.off("agent.connected",x),e.off("agent.speaking",x),e.off("agent.thinking",x),e.off("agent.state.changed",v),e.off("connection.disconnected",m),e.off("session.created",b),e.off("session.ended",b),e.off("session.state.changed",b),e.off("connection.connected",k)}},[e]),{agent:{isActive:t,info:o},session:r,state:a,audioTrack:d,videoTrack:f}}function Pp(e){const[t,n]=C.useState(()=>e.getVideoTrackRefs()),[r,s]=C.useState(()=>e.getCameraTrackRefs()),[o,i]=C.useState(()=>e.getScreenShareTrackRefs());return C.useEffect(()=>{const a=()=>{const d=e.getVideoTrackRefs(),u=e.getCameraTrackRefs(),f=e.getScreenShareTrackRefs();console.log("📹 useVoxketVideoTracks: Updating tracks:",{videoCount:d.length,cameraCount:u.length,screenShareCount:f.length}),n(d),s(u),i(f)};a(),e.on("connection.connected",a),e.on("connection.disconnected",a),e.on("track.muted",a),e.on("track.unmuted",a),e.on("participant.joined",a),e.on("participant.left",a);const c=e.getRoom();if(c){const d=()=>{console.log("📹 Track event, updating video tracks"),a()};return c.on("localTrackPublished",d),c.on("localTrackUnpublished",d),c.on("trackPublished",d),c.on("trackUnpublished",d),c.on("trackSubscribed",d),c.on("trackUnsubscribed",d),()=>{e.off("connection.connected",a),e.off("connection.disconnected",a),e.off("track.muted",a),e.off("track.unmuted",a),e.off("participant.joined",a),e.off("participant.left",a),c.off("localTrackPublished",d),c.off("localTrackUnpublished",d),c.off("trackPublished",d),c.off("trackUnpublished",d),c.off("trackSubscribed",d),c.off("trackUnsubscribed",d)}}else return()=>{e.off("connection.connected",a),e.off("connection.disconnected",a),e.off("track.muted",a),e.off("track.unmuted",a),e.off("participant.joined",a),e.off("participant.left",a)}},[e]),{videoTrackRefs:t,cameraTrackRefs:r,screenShareTrackRefs:o}}function na({...e}){return l.jsx(ze.Root,{"data-slot":"select",...e})}function ra({...e}){return l.jsx(ze.Value,{"data-slot":"select-value",...e})}function sa({className:e,size:t="default",children:n,...r}){return l.jsxs(ze.Trigger,{"data-slot":"select-trigger","data-size":t,className:Y(["flex w-fit cursor-pointer items-center justify-between gap-2","rounded-full px-3 py-2 text-sm whitespace-nowrap","bg-button transition-[color,border,background-color]","disabled:cursor-not-allowed disabled:opacity-50","hover:bg-muted hover:text-muted-foreground","!focus:ring-0 !focus-visible:ring-0 !focus:border-none !focus-visible:border-none !ring-0 !border-none !outline-none","aria-invalid:ring-0 dark:aria-invalid:ring-0","data-[placeholder]:text-muted-foreground","data-[size=default]:h-9 data-[size=sm]:h-8","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2","[&:not([class*='text-'])_svg:not([class*='text-'])]:text-muted-foreground","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"],e),...r,children:[n,l.jsx(ze.Icon,{asChild:!0,children:l.jsx(bo,{weight:"bold",className:"size-4 transition-colors"})})]})}function oa({className:e,children:t,position:n="popper",...r}){return l.jsx(ze.Portal,{children:l.jsxs(ze.Content,{"data-slot":"select-content",className:Y(["bg-[#18182a]/90 backdrop-blur-md text-white border border-[#23233a] shadow-2xl","relative z-50 overflow-x-hidden overflow-y-auto rounded-xl","max-h-(--radix-select-content-available-height) min-w-[8rem]","origin-(--radix-select-content-transform-origin)","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=top]:slide-in-from-bottom-2","data-[side=right]:slide-in-from-left-2","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2"],n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[l.jsx(Vp,{}),l.jsx(ze.Viewport,{className:Y("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),l.jsx(Np,{})]})})}function ia({className:e,children:t,...n}){return l.jsxs(ze.Item,{"data-slot":"select-item",className:Y(["relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none","cursor-pointer disabled:cursor-not-allowed","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2","[&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"],e),...n,children:[l.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:l.jsx(ze.ItemIndicator,{children:l.jsx(Al,{className:"size-4",weight:"bold"})})}),l.jsx(ze.ItemText,{children:t})]})}function Vp({className:e,...t}){return l.jsx(ze.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:Y("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(El,{className:"size-4",weight:"bold"})})}function Np({className:e,...t}){return l.jsx(ze.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:Y("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(bo,{className:"size-4",weight:"bold"})})}const aa=Ds.cva(["w-full rounded-full px-3 py-2 text-sm cursor-pointer","disabled:not-allowed hover:bg-button-hover focus:bg-button-hover"],{variants:{size:{default:"w-[180px]",sm:"w-auto"}},defaultVariants:{size:"default"}});function ca({kind:e,track:t,requestPermissions:n,onError:r,client:s,...o}){const i=o.size||"default";if(!s)return l.jsxs(na,{disabled:!0,children:[l.jsx(sa,{className:Y(aa({size:i}),o.className),children:l.jsx(ra,{placeholder:`Select a ${e}`})}),l.jsx(oa,{children:l.jsx(ia,{value:"none",children:"No devices available"})})]});const{devices:a,activeDeviceId:c,setActiveMediaDevice:d}=jp(s,e==="audioinput"?"audioinput":"videoinput");return l.jsxs(na,{value:c,onValueChange:d,children:[l.jsx(sa,{className:Y(aa({size:i}),o.className,"hover:bg"),children:i!=="sm"&&l.jsx(ra,{className:"font-mono text-sm",placeholder:`Select a ${e}`})}),l.jsx(oa,{children:a.map(u=>l.jsx(ia,{value:u.deviceId,className:"font-mono text-xs",children:u.label},u.deviceId))})]})}function Rp(e,t,n=!1){if(n)return vo;switch(e){case Z.Track.Source.Microphone:return t?jl:Ml;case Z.Track.Source.Camera:return t?Vl:Nl;case Z.Track.Source.ScreenShare:return Pl;default:return g.Fragment}}function Wr({source:e,pressed:t,pending:n,className:r,...s}){const o=Rp(e,t??!1,n),i=e===Z.Track.Source.Microphone&&!(t??!1)&&!n,a=e===Z.Track.Source.Camera&&!(t??!1)&&!n;return g.useEffect(()=>{console.log(`TrackToggle for ${e} changed: pressed=${t}, pending=${n}, actualState=${t?"enabled":"disabled"}`)},[e,t,n]),l.jsxs(Ul,{pressed:t,"aria-label":`Toggle ${e}`,className:Y(r),...s,children:[l.jsx(o,{weight:"bold",className:Y(n&&"animate-spin",i||a?"text-red-500":void 0)}),s.children]})}function Ip(e){return e?Ap(e):{camera:!0,microphone:!0,screenShare:!0,data:!0}}function Dp(e={}){const{controls:t,saveUserChoices:n=!0,client:r}=e,s={leave:!0,...t};if(!r)return{micTrackRef:{participant:void 0,source:Z.Track.Source.Microphone,publication:void 0},visibleControls:s,microphoneToggle:{enabled:!1,pending:!1,toggle:async()=>{}},cameraToggle:{enabled:!1,pending:!1,toggle:async()=>{}},screenShareToggle:{enabled:!1,pending:!1,toggle:async()=>{}},handleDisconnect:()=>{},handleAudioDeviceChange:()=>{},handleVideoDeviceChange:()=>{}};const{microphoneTrack:o,localParticipant:i}=Hl(r),a=Ip(r);Zl(r);const c=pn(r,"microphone",{onDeviceError:A=>{var M;return(M=e.onDeviceError)==null?void 0:M.call(e,{source:Z.Track.Source.Microphone,error:A})}}),d=pn(r,"camera",{onDeviceError:A=>{var M;return(M=e.onDeviceError)==null?void 0:M.call(e,{source:Z.Track.Source.Camera,error:A})}}),u=pn(r,"screenShare",{onDeviceError:A=>{var M;return(M=e.onDeviceError)==null?void 0:M.call(e,{source:Z.Track.Source.ScreenShare,error:A})}}),f=g.useMemo(()=>{let A;if(i){for(const[,M]of i.trackPublications)if(M.source===Z.Track.Source.Microphone){A=M;break}}return console.log("🎤 Creating micTrackRef:",{hasParticipant:!!i,hasPublication:!!A,isTrackSubscribed:A==null?void 0:A.isSubscribed,isMuted:A==null?void 0:A.isMuted,trackSid:A==null?void 0:A.trackSid}),{participant:i??void 0,source:Z.Track.Source.Microphone,publication:A}},[i,o]);s.microphone??(s.microphone=a.microphone),s.screenShare??(s.screenShare=a.screenShare),s.camera??(s.camera=a.camera),s.chat??(s.chat=a.data);const{saveAudioInputEnabled:h,saveAudioInputDeviceId:p,saveVideoInputEnabled:x,saveVideoInputDeviceId:m}=Mp({preventSave:!n}),b=g.useCallback(()=>{r&&(typeof r.endSession=="function"?(r.endSession(),console.log("✅ AgentControlBar: Session ended via client.endSession()")):(r.disconnect(),console.log("⚠️ AgentControlBar: Using fallback client.disconnect()")))},[r]),k=g.useCallback(A=>{p(A??"default"),r&&r.setAudioInputDevice(A)},[p,r]),v=g.useCallback(A=>{m(A??"default"),r&&r.setVideoInputDevice(A)},[m,r]),E=g.useCallback(async A=>{u.enabled&&await u.toggle(!1),await d.toggle(A),x(!d.enabled)},[d,x,u]),w=g.useCallback(async A=>{await c.toggle(A),h(!c.enabled)},[c,h]),S=g.useCallback(async A=>{d.enabled&&await d.toggle(!1),await u.toggle(A)},[d,u]);return{micTrackRef:f,visibleControls:s,cameraToggle:{...d,toggle:E},microphoneToggle:{...c,toggle:w},screenShareToggle:{...u,toggle:S},handleDisconnect:b,handleAudioDeviceChange:k,handleVideoDeviceChange:v}}const $p={card:"relative bg-gradient-to-br from-black to-gray-900 border border-gray-900 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto rounded-2xl shadow-lg",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-black/90 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-gray-800/20 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-gray-600/10 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-gray-500/8 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-gray-400 to-gray-500 rounded-full blur-sm opacity-20 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-gray-500 to-gray-600 rounded-full blur-sm opacity-15 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-black to-gray-900 rounded-2xl shadow-xl p-0 overflow-hidden h-full",text:{primary:"text-white",secondary:"text-gray-300",muted:"text-gray-400",accent:"bg-clip-text text-transparent bg-gradient-to-r from-white via-gray-200 to-gray-300"},micButton:"absolute w-20 h-20 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 mic-glow shadow-2xl group",chatButton:"absolute w-20 h-20 bg-gradient-to-br from-[#10B981] to-[#059669] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",videoButton:"absolute w-20 h-20 bg-gradient-to-br from-[#8B5CF6] to-[#EC4899] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",popupTrigger:"bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] text-white font-medium hover:from-[#2563EB] hover:to-[#7C3AED] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-900",promptSlider:"absolute w-full py-3 px-2 bg-gray-900 rounded-xl text-center text-white text-sm transition-opacity duration-700 ease-in-out border border-gray-600",statusIndicator:"w-2 h-2 bg-gray-400 rounded-full animate-pulse",pulseRings:{ring1:"w-32 h-32 rounded-full border-2 border-gray-600/30 pulse-ring",ring2:"absolute w-28 h-28 rounded-full border-2 border-gray-500/20 pulse-ring",ring3:"absolute w-24 h-24 rounded-full border-2 border-gray-400/15 pulse-ring"},controlBar:"border border-gray-600 rounded-3xl py-4 flex flex-col justify-end h-full bg-gray-900/50 backdrop-blur-sm",chatInput:{container:"bg-gray-900 w-full border-gray-600",textarea:"bg-gray-800 border-none text-white placeholder-gray-400",sendButton:"bg-blue-600 hover:bg-blue-700 disabled:bg-gray-600 disabled:opacity-50 text-white",attachButton:"text-gray-400 hover:text-gray-300 hover:bg-gray-700",endButton:"bg-red-900/20 hover:bg-red-800/30 text-red-400 border-red-800"},chatMessage:{own:"bg-gray-600 text-white",other:"bg-gray-700 text-white"},chatHeader:{container:"bg-gray-900 border-gray-600",backButton:"text-gray-400 hover:text-white hover:bg-gray-700"},spinner:"w-10 h-10 animate-spin text-gray-400 mb-2",suggestedResponse:{container:"bg-gray-800 text-blue-300 border-gray-700 hover:bg-gray-700 hover:text-white"},video:{container:"bg-gradient-to-br from-black to-gray-900 text-white",header:"border-gray-700 bg-gray-900/50",headerButton:"bg-gray-800 hover:bg-gray-700 text-gray-300",statusDot:"bg-green-500 animate-pulse",controlsBackground:"bg-gray-900/80 backdrop-blur-sm border-t border-gray-700",controlEnabled:"bg-blue-600 hover:bg-blue-700 text-white",controlDisabled:"bg-gray-700 hover:bg-gray-600 text-gray-300",endCall:"bg-red-600 hover:bg-red-700 text-white",tile:"bg-gray-800 border border-gray-700 shadow-lg",placeholder:"bg-gray-800 text-gray-300",avatar:"bg-gray-700 text-gray-300",nameOverlay:"bg-black/70 text-white",mutedIndicator:"bg-red-600/80 text-white"}},Fp={card:" bg-gradient-to-br from-white to-gray-50 border border-gray-200 w-full h-full flex flex-col justify-between overflow-hidden mx-auto my-auto shadow-lg",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-white/90 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-blue-500/5 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-purple-500/10 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-pink-500/8 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-blue-500 to-purple-500 rounded-full blur-sm opacity-30 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-pink-500 to-purple-500 rounded-full blur-sm opacity-20 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-white to-gray-50 rounded-2xl shadow-xl p-0 overflow-hidden h-full",text:{primary:"text-gray-900",secondary:"text-gray-700",muted:"text-gray-500",accent:"bg-clip-text text-transparent bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600"},micButton:"absolute text-white w-20 h-20 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 mic-glow shadow-2xl group",chatButton:"absolute text-white w-20 h-20 bg-gradient-to-br from-[#10B981] to-[#059669] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",videoButton:"absolute text-white w-20 h-20 bg-gradient-to-br from-[#8B5CF6] to-[#EC4899] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",popupTrigger:"bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] text-white font-medium hover:from-[#2563EB] hover:to-[#7C3AED] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-white",promptSlider:"absolute w-full py-3 px-2 bg-gray-100 rounded-xl text-center text-gray-700 text-sm transition-opacity duration-700 ease-in-out border border-gray-200",statusIndicator:"w-2 h-2 bg-green-500 rounded-full animate-pulse",pulseRings:{ring1:"w-32 h-32 rounded-full border-2 border-blue-500/20 pulse-ring",ring2:"absolute w-28 h-28 rounded-full border-2 border-purple-500/15 pulse-ring",ring3:"absolute w-24 h-24 rounded-full border-2 border-pink-500/10 pulse-ring"},controlBar:"border border-gray-200 rounded-3xl py-4 flex flex-col justify-end h-full bg-white/80 backdrop-blur-sm",chatInput:{container:"bg-white/90 border-gray-200 shadow-sm",textarea:"bg-white border-none text-gray-900 placeholder-gray-500 ",sendButton:"bg-blue-600 hover:bg-blue-700 disabled:bg-gray-300 disabled:opacity-50 text-white",attachButton:"text-gray-500 hover:text-gray-700 hover:bg-gray-100 bg-blue-50",endButton:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200"},chatMessage:{own:"bg-blue-50 text-gray-900 border border-blue-100",other:"bg-gray-50 text-gray-900 border border-gray-200"},chatHeader:{container:"bg-white border-gray-200",backButton:"text-gray-500 hover:text-gray-700 hover:bg-gray-100"},spinner:"w-10 h-10 animate-spin text-blue-500 mb-2",suggestedResponse:{container:"bg-white text-blue-700 border-blue-200 hover:bg-blue-50 hover:text-blue-900"},video:{container:"bg-gradient-to-br from-white to-gray-50 text-gray-900",header:"border-gray-200 bg-white/80",headerButton:"bg-gray-100 hover:bg-gray-200 text-gray-600",statusDot:"bg-green-500 animate-pulse",controlsBackground:"bg-white/90 backdrop-blur-sm border-t border-gray-200",controlEnabled:"bg-blue-600 hover:bg-blue-700 text-white",controlDisabled:"bg-gray-200 hover:bg-gray-300 text-gray-600",endCall:"bg-red-600 hover:bg-red-700 text-white",tile:"bg-white border border-gray-200 shadow-sm",placeholder:"bg-gray-50 text-gray-600",avatar:"bg-gray-200 text-gray-600",nameOverlay:"bg-black/70 text-white",mutedIndicator:"bg-red-600/80 text-white"}},Op={card:"relative bg-gradient-to-br from-[#171727] to-[#12121F] border border-gray-800 w-full h-full flex flex-col items-center justify-between overflow-hidden mx-auto my-auto",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-[#171727]/90 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-[#3B82F6]/15 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-[#8B5CF6]/25 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-[#EC4899]/20 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full blur-sm opacity-50 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-[#EC4899] to-[#8B5CF6] rounded-full blur-sm opacity-40 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-[#171727] to-[#12121F] rounded-2xl shadow-xl p-0 overflow-hidden h-full",text:{primary:"text-white",secondary:"text-gray-300",muted:"text-gray-400",accent:"text-white font-semibold"},micButton:"absolute w-20 h-20 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 mic-glow shadow-2xl group",chatButton:"absolute w-20 h-20 bg-gradient-to-br from-[#10B981] to-[#059669] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",videoButton:"absolute w-20 h-20 bg-gradient-to-br from-[#8B5CF6] to-[#EC4899] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",popupTrigger:"bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] text-white font-medium hover:from-[#2563EB] hover:to-[#7C3AED] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-900 shadow-xl",promptSlider:"absolute w-full py-3 px-2 bg-[#1E1E2E] rounded-xl text-center text-gray-200 text-sm transition-opacity duration-700 ease-in-out border border-gray-700",statusIndicator:"w-2 h-2 bg-[#10B981] rounded-full animate-pulse",pulseRings:{ring1:"w-32 h-32 rounded-full border-2 border-[#3B82F6]/40 pulse-ring",ring2:"absolute w-28 h-28 rounded-full border-2 border-[#8B5CF6]/30 pulse-ring",ring3:"absolute w-24 h-24 rounded-full border-2 border-[#EC4899]/20 pulse-ring"},controlBar:"border border-border rounded-3xl py-4 flex flex-col justify-end h-full",chatInput:{container:"bg-[#1E1E2E] border-gray-700",textarea:"bg-[#1E1E2E] border-none text-white placeholder-gray-400",sendButton:"bg-[#3B82F6] hover:bg-[#2563EB] disabled:bg-gray-600 disabled:opacity-50 text-white",attachButton:"text-gray-400 hover:text-gray-300 hover:bg-gray-700",endButton:"bg-red-900/20 hover:bg-red-800/30 text-red-400 border-red-800"},chatMessage:{own:"bg-[#1E1E2E]/80 text-white",other:"bg-[#1E1E2E] text-white border border-gray-700"},chatHeader:{container:"bg-[#1E1E2E] border-gray-700",backButton:"text-gray-400 hover:text-white hover:bg-gray-700"},spinner:"w-10 h-10 animate-spin text-blue-400 mb-2",suggestedResponse:{container:"bg-[#221f3f] text-white border-none"},video:{container:"bg-gradient-to-br from-[#171727] to-[#12121F] text-white",header:"border-gray-700 bg-[#1E1E2E]/80",headerButton:"bg-[#1E1E2E] hover:bg-gray-700 text-gray-300",statusDot:"bg-[#10B981] animate-pulse",controlsBackground:"bg-[#1E1E2E]/90 backdrop-blur-sm border-t border-gray-700",controlEnabled:"bg-[#3B82F6] hover:bg-[#2563EB] text-white",controlDisabled:"bg-gray-700 hover:bg-gray-600 text-gray-300",endCall:"bg-red-600 hover:bg-red-700 text-white",tile:"bg-[#1E1E2E] border border-gray-700 shadow-xl",placeholder:"bg-[#1E1E2E] text-gray-300",avatar:"bg-gray-700 text-gray-300",nameOverlay:"bg-black/70 text-white",mutedIndicator:"bg-red-600/80 text-white"}},la={dark:$p,light:Fp,vox:Op};function Ve(e){return la[e]||la.vox}function Lp({controls:e,saveUserChoices:t=!0,capabilities:n,className:r,onSendMessage:s,onChatOpenChange:o,onDisconnect:i,onDeviceError:a,theme:c="vox",client:d,...u}){const[f,h]=g.useState(!1),[p,x]=g.useState(!1),m=Ve(c),{micTrackRef:b,visibleControls:k,cameraToggle:v,microphoneToggle:E,screenShareToggle:w,handleAudioDeviceChange:S,handleVideoDeviceChange:A,handleDisconnect:M}=Dp({controls:e,saveUserChoices:t,client:d}),j=async z=>{x(!0);try{await(s==null?void 0:s(z))}finally{x(!1)}};return g.useEffect(()=>{o==null||o(f)},[f,o]),g.useEffect(()=>{var z,y,D,_;console.log("🎤 AgentControlBar: micTrackRef changed:",{hasParticipant:!!b.participant,hasPublication:!!b.publication,source:b.source,isSubscribed:(z=b.publication)==null?void 0:z.isSubscribed,isMuted:(y=b.publication)==null?void 0:y.isMuted,trackSid:(D=b.publication)==null?void 0:D.trackSid,hasTrack:!!((_=b.publication)!=null&&_.track)})},[b]),l.jsxs("div",{"aria-label":"Voice assistant controls",className:Y(m.controlBar,r),...u,children:[n.suportsChatInput&&l.jsxs("div",{inert:!f,className:Y("overflow-hidden transition-[height] relative duration-300 ease-in-out",f?"h-[64px] mb-3":"h-0"),children:[l.jsx("div",{className:"flex h-9 px-4 w-full",children:l.jsx(Ep,{onSend:j,disabled:p,className:Y("w-full",m.chatInput)})}),l.jsx("hr",{className:"border-border my-2 mx-5"})]}),l.jsxs("div",{className:Y("flex flex-row items-center gap-2 rounded-2xl mx-auto border-none backdrop-blur-lg px-2 py-2",c==="light"?"bg-white/80":"bg-[#18182a]/80"),children:[l.jsxs("div",{className:"flex gap-y-2 justify-start",children:[k.microphone&&l.jsxs("div",{className:"flex gap-y-2 items-center rounded-full overflow-hidden border-none ",children:[l.jsx(Wr,{variant:"primary",source:Z.Track.Source.Microphone,pressed:E.enabled,disabled:E.pending,onPressedChange:E.toggle,className:"w-auto py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"}),l.jsx(Ne.BarVisualizer,{barCount:3,trackRef:b,options:{minHeight:5},className:"flex h-full w-auto items-center justify-center gap-x-0.5",children:l.jsx("span",{className:Y(["h-full w-0.5 origin-center rounded-2xl","bg-white","group-data-[state=on]/track:bg-white group-data-[state=off]/track:bg-white","data-lk-muted:bg-muted"])})}),l.jsx(ca,{size:"sm",kind:"audioinput",client:d,onError:a?z=>z instanceof Error?a({source:Z.Track.Source.Microphone,error:z}):void 0:void 0,onActiveDeviceChange:S,className:Y(["h-full py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/30 transition-colors","min-w-[2.5rem]"])})]}),n.suportsVideoInput&&k.camera&&l.jsxs("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:[l.jsx(Wr,{variant:"primary",source:Z.Track.Source.Camera,pressed:v.enabled,pending:v.pending,disabled:v.pending,onPressedChange:v.toggle,className:"w-auto py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"}),l.jsx(ca,{size:"sm",kind:"videoinput",client:d,onError:a?z=>z instanceof Error?a({source:Z.Track.Source.Camera,error:z}):void 0:void 0,onActiveDeviceChange:A,className:Y(["h-full py-2 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors","min-w-[2.5rem]"])})]}),n.suportsScreenShare&&k.screenShare&&l.jsx("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:l.jsx(Wr,{variant:"secondary",source:Z.Track.Source.ScreenShare,pressed:w.enabled,disabled:w.pending,onPressedChange:w.toggle,className:"w-auto py-2 disabled:opacity-70 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"})})]}),k.chat&&l.jsx("div",{className:"flex items-center rounded-full overflow-hidden bg-secondary text-secondary-foreground border-none ",children:l.jsx(Ul,{variant:"secondary","aria-label":"Toggle chat",pressed:f,onPressedChange:z=>{h(z)},className:"aspect-square h-full py-3 rounded-none border-none bg-transparent text-inherit focus:bg-secondary/80 hover:bg-secondary/80 transition-colors flex items-center",children:l.jsx(Tl,{weight:"bold",className:"h-5 w-5"})})})]})]})}const _p=(e,t)=>{var a,c;const n=g.useMemo(()=>t?t(e.message):e.message,[e.message,t]),r=!!e.editTimestamp,s=new Date(e.timestamp),o=typeof navigator<"u"?navigator.language:"en-US",i=(a=e.from)!=null&&a.name&&e.from.name!==""?e.from.name:(c=e.from)==null?void 0:c.identity;return{message:n,hasBeenEdited:r,time:s,locale:o,name:i}},Bp=({entry:e,messageFormatter:t,className:n,participantName:r,...s})=>{var u,f;const{message:o,time:i,locale:a}=_p(e,t),c=((u=e.from)==null?void 0:u.isLocal)??!1;Y("w-full px-3 py-2 rounded-2xl text-xs break-words whitespace-pre-line",c?" text-end border border-[#5078F2]/30":"bg-muted text-foreground border border-[#813aa7]/30","text-left");const d=Y("inline-flex items-center justify-center w-6 h-6 rounded-full text-xs font-bold flex-shrink-0",c?"bg-[#5078F2] text-white":"bg-[#813aa7] ml-1 text-white");return l.jsx("li",{title:i.toLocaleTimeString(a,{timeStyle:"full"}),className:Y("group flex mb-2",c?"justify-end":"justify-start",n),...s,children:l.jsxs("div",{className:Y("flex w-fit max-w-full rounded-2xl border",c?"flex-row-reverse items-center border-[#5078F2]/30":"flex-row items-center border-[#813aa7]/30 bg-muted text-foreground"),children:[l.jsx("span",{className:d,children:c?((f=r==null?void 0:r[0])==null?void 0:f.toUpperCase())||"U":"A"}),l.jsx("span",{className:Y("flex items-center text-xs break-words whitespace-pre-line",c?"ml-auto justify-end text-right":"justify-start text-left","px-3 py-2"),children:o})]})})};function zp(e){C.useEffect(()=>{function t(){const n=e.current;n&&(n.scrollTop=n.scrollHeight)}if(e.current){const n=new ResizeObserver(t);return n.observe(e.current),t(),()=>n.disconnect()}},[e])}const Up=({className:e,children:t,...n})=>{const r=C.useRef(null);return zp(r),l.jsx("div",{ref:r,className:Y("flex flex-col justify-end",e),...n,children:t})},Hp=({state:e,audioTrack:t,className:n,ref:r})=>l.jsx("div",{ref:r,className:Y("",n),children:t?l.jsx(Ne.BarVisualizer,{barCount:5,state:e,options:{minHeight:5},trackRef:t,className:Y("flex aspect-video w-40 items-center justify-center gap-1"),children:l.jsx("span",{className:Y(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear","data-[lk-highlighted=true]:bg-[#5c64f6]","data-[lk-muted=true]:bg-[#222222]"])})}):l.jsx("div",{className:Y("flex aspect-video w-40 items-center justify-center"),children:l.jsx("div",{className:"flex flex-col items-center justify-center",children:l.jsx("div",{className:"flex gap-1",children:Array.from({length:5}).map((s,o)=>l.jsx("span",{className:Y(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear",e==="speaking"&&"animate-pulse bg-[#5c64f6]",e==="thinking"&&"animate-pulse bg-yellow-500"])},o))})})})}),Zp=({videoTrack:e,className:t,ref:n})=>{var r,s;return!e||!e.publication||!e.participant?l.jsx("div",{ref:n,className:Y(t),children:l.jsx("div",{className:"w-full h-full bg-gray-200 rounded-md flex items-center justify-center",children:l.jsx("span",{className:"text-gray-500",children:"No video available"})})}):l.jsx("div",{ref:n,className:Y(t),children:l.jsx(Ne.VideoTrack,{trackRef:e,width:((r=e.publication.dimensions)==null?void 0:r.width)??0,height:((s=e.publication.dimensions)==null?void 0:s.height)??0,className:"rounded-md"})})},Wp=ie.create(Ne.VideoTrack),Gp=({trackRef:e,className:t,ref:n})=>{var r,s;return l.jsx("div",{className:Y("bg-muted overflow-hidden rounded-md",t),children:l.jsx(Wp,{ref:n,trackRef:e,width:((r=e==null?void 0:e.publication.dimensions)==null?void 0:r.width)??0,height:((s=e==null?void 0:e.publication.dimensions)==null?void 0:s.height)??0,className:Y("h-full w-auto")})})},da=ie.create(Gp),Kp=ie.create(Hp),Yp=ie.create(Zp),tt={initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{type:"spring",stiffness:675,damping:75,mass:1}},Pt={grid:["h-full w-full","grid gap-x-2 place-content-center","grid-cols-[1fr_1fr] grid-rows-[90px_1fr_90px]"],agentChatOpenWithSecondTile:["col-start-1 row-start-1","self-center justify-self-end"],agentChatOpenWithoutSecondTile:["col-start-1 row-start-1","col-span-2","place-content-center"],agentChatClosed:["col-start-1 row-start-1","col-span-2 row-span-3","place-content-center"],secondTileChatOpen:["col-start-2 row-start-1","self-center justify-self-start"],secondTileChatClosed:["col-start-2 row-start-3","place-content-end"]};function qp(e,t){const{localParticipant:n}=Hl(t),r=n==null?void 0:n.getTrackPublication(e);return C.useMemo(()=>r&&n?{source:e,participant:n,publication:r}:void 0,[e,r,n])}function Xp({chatOpen:e,client:t}){const{agent:{isActive:n=!1}={},session:r,state:s="idle",audioTrack:o,videoTrack:i}=t?Wl(t):{agent:{isActive:!1},session:null,state:"idle",audioTrack:null,videoTrack:null},[a]=Ne.useTracks([Z.Track.Source.ScreenShare]),c=qp(Z.Track.Source.Camera,t),d=c&&!c.publication.isMuted,u=a&&!a.publication.isMuted,f=d||u,h=n||r&&r.state==="active",p={...tt.transition,delay:e?0:.15},x={...tt.animate,scale:e?1:3,transition:p},m={...tt.animate,transition:p},b=p,k=p,v=i&&i.publication&&i.participant;return l.jsx("div",{className:"relative w-full h-full z-10 flex items-center justify-center",children:l.jsx("div",{className:"relative w-full h-full max-w-2xl px-4 md:px-0",children:l.jsxs("div",{className:Y(Pt.grid),children:[h&&l.jsx("div",{className:Y(["grid",!e&&Pt.agentChatClosed,e&&f&&Pt.agentChatOpenWithSecondTile,e&&!f&&Pt.agentChatOpenWithoutSecondTile]),children:l.jsxs("div",{className:"h-full flex items-center justify-center",children:[!v&&l.jsx(Kp,{layoutId:"agent",...tt,animate:x,transition:b,state:s,audioTrack:o||void 0,className:Y(e?"h-[90px]":"h-auto w-full")},"agent"),v&&i&&l.jsx(Yp,{layoutId:"avatar",...tt,animate:m,transition:k,videoTrack:i,className:Y(e?"h-[90px] [&>video]:h-[90px] [&>video]:w-auto":"h-auto w-full")},"avatar")]})}),l.jsx("div",{className:Y(["grid",e&&Pt.secondTileChatOpen,!e&&Pt.secondTileChatClosed]),children:l.jsxs("div",{className:"w-full px-10 flex items-center shadow-2xl justify-between",children:[c&&d&&l.jsx(da,{layout:"position",layoutId:"camera",...tt,trackRef:c,transition:{...tt.transition,delay:e?0:.15},className:"h-[60px] order-1"},"camera"),u&&l.jsx(da,{layout:"position",layoutId:"screen",...tt,trackRef:a,transition:{...tt.transition,delay:e?0:.15},className:"h-[70px] order-2"},"screen")]})})]})})})}function ua({timeout:e}){const[t,n]=C.useState(100),r=C.useRef(null),s=C.useRef(null);return C.useEffect(()=>{if(!e||e<=0)return;n(100),s.current=Date.now();const o=()=>{if(!e||s.current===null)return;const i=Date.now()-s.current,a=Math.max(0,100-i/e*100);n(a),a>0&&(r.current=requestAnimationFrame(o))};return r.current=requestAnimationFrame(o),()=>{r.current&&cancelAnimationFrame(r.current)}},[e]),!e||e<=0?null:l.jsx("div",{className:"w-full h-1 relative top-1 rounded-t-4xl bg-gray-700 overflow-hidden",children:l.jsx(ie.div,{className:"h-1 rounded-t-4xl dark:bg-white bg-blue-200 ",initial:{width:"100%"},animate:{width:`${Math.max(t,2)}%`},transition:{duration:.1,ease:"linear"},style:{minWidth:"2%"}})})}function Kt({interaction:e,theme:t,onDismiss:n,client:r,addLocalMessage:s}){var a;if(!e||!e.isVisible||!e.component)return null;const[o]=g.useState(()=>Date.now()),i=()=>e.component?g.createElement(e.component,{handler:e.handler||void 0,timeout:e.timeout,loadData:async d=>{console.log("InteractiveComponent: Loading data:",d)},presentationMode:e.presentationMode,data:e.data,client:r,addLocalMessage:s}):l.jsx("div",{className:"p-4 text-red-500",children:"Component not found"});switch(e.presentationMode){case"fullscreen":return l.jsx(Ut,{children:l.jsxs(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black",children:[l.jsxs("div",{className:"flex flex-col",children:[l.jsx(ua,{timeout:e.timeout}),l.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/80 text-white border-b border-gray-700",children:[l.jsx("h3",{className:"text-lg font-semibold",children:e.methodName.replace(/_/g," ").replace(/\b\w/g,c=>c.toUpperCase())}),l.jsx("button",{onClick:n||((a=e.handler)==null?void 0:a.dismissView),className:"p-2 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors",children:l.jsx(je.X,{className:"w-5 h-5"})})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:i()})]})});case"embedded":default:return l.jsx(Ut,{children:l.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-fit rounded-lg ",children:l.jsxs("div",{children:[l.jsx(ua,{timeout:e.timeout}),i()]})})})}}function Jp(){const e=Ne.useTranscriptions(),t=Ne.useChat(),n=Ne.useRoomContext();return{messages:C.useMemo(()=>[...e.map(o=>Sp(o,n)),...t.chatMessages].sort((o,i)=>o.timestamp-i.timestamp),[e,t.chatMessages,n]),send:t.send}}const Qp=({logLevel:e}={})=>{const t=Ne.useRoomContext();g.useEffect(()=>(Z.setLogLevel(e??"debug"),window.__lk_room=t,()=>{window.__lk_room=void 0}),[t,e])},fa=e=>e,e0=()=>{let e=fa;return{configure(t){e=t},generate(t){return e(t)},reset(){e=fa}}},t0=e0();function ht(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function At(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":ht(7));return e.charAt(0).toUpperCase()+e.slice(1)}function n0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bn={exports:{}},zn={exports:{}},le={};/** @license React v16.13.1
10
10
  * react-is.production.min.js
11
11
  *
12
12
  * Copyright (c) Facebook, Inc. and its affiliates.
13
13
  *
14
14
  * This source code is licensed under the MIT license found in the
15
15
  * LICENSE file in the root directory of this source tree.
16
- */var ha;function sg(){if(ha)return le;ha=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,s=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,x=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,k=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function T(S){if(typeof S=="object"&&S!==null){var A=S.$$typeof;switch(A){case t:switch(S=S.type,S){case c:case d:case s:case o:case r:case f:return S;default:switch(S=S&&S.$$typeof,S){case a:case u:case x:case g:case i:return S;default:return A}}case n:return A}}}function w(S){return T(S)===d}return le.AsyncMode=c,le.ConcurrentMode=d,le.ContextConsumer=a,le.ContextProvider=i,le.Element=t,le.ForwardRef=u,le.Fragment=s,le.Lazy=x,le.Memo=g,le.Portal=n,le.Profiler=o,le.StrictMode=r,le.Suspense=f,le.isAsyncMode=function(S){return w(S)||T(S)===c},le.isConcurrentMode=w,le.isContextConsumer=function(S){return T(S)===a},le.isContextProvider=function(S){return T(S)===i},le.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===t},le.isForwardRef=function(S){return T(S)===u},le.isFragment=function(S){return T(S)===s},le.isLazy=function(S){return T(S)===x},le.isMemo=function(S){return T(S)===g},le.isPortal=function(S){return T(S)===n},le.isProfiler=function(S){return T(S)===o},le.isStrictMode=function(S){return T(S)===r},le.isSuspense=function(S){return T(S)===f},le.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===s||S===d||S===o||S===r||S===f||S===h||typeof S=="object"&&S!==null&&(S.$$typeof===x||S.$$typeof===g||S.$$typeof===i||S.$$typeof===a||S.$$typeof===u||S.$$typeof===b||S.$$typeof===k||S.$$typeof===v||S.$$typeof===m)},le.typeOf=T,le}var de={};/** @license React v16.13.1
16
+ */var ha;function r0(){if(ha)return le;ha=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,x=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,k=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function E(S){if(typeof S=="object"&&S!==null){var A=S.$$typeof;switch(A){case t:switch(S=S.type,S){case c:case d:case r:case o:case s:case f:return S;default:switch(S=S&&S.$$typeof,S){case a:case u:case x:case p:case i:return S;default:return A}}case n:return A}}}function w(S){return E(S)===d}return le.AsyncMode=c,le.ConcurrentMode=d,le.ContextConsumer=a,le.ContextProvider=i,le.Element=t,le.ForwardRef=u,le.Fragment=r,le.Lazy=x,le.Memo=p,le.Portal=n,le.Profiler=o,le.StrictMode=s,le.Suspense=f,le.isAsyncMode=function(S){return w(S)||E(S)===c},le.isConcurrentMode=w,le.isContextConsumer=function(S){return E(S)===a},le.isContextProvider=function(S){return E(S)===i},le.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===t},le.isForwardRef=function(S){return E(S)===u},le.isFragment=function(S){return E(S)===r},le.isLazy=function(S){return E(S)===x},le.isMemo=function(S){return E(S)===p},le.isPortal=function(S){return E(S)===n},le.isProfiler=function(S){return E(S)===o},le.isStrictMode=function(S){return E(S)===s},le.isSuspense=function(S){return E(S)===f},le.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===d||S===o||S===s||S===f||S===h||typeof S=="object"&&S!==null&&(S.$$typeof===x||S.$$typeof===p||S.$$typeof===i||S.$$typeof===a||S.$$typeof===u||S.$$typeof===b||S.$$typeof===k||S.$$typeof===v||S.$$typeof===m)},le.typeOf=E,le}var de={};/** @license React v16.13.1
17
17
  * react-is.development.js
18
18
  *
19
19
  * Copyright (c) Facebook, Inc. and its affiliates.
20
20
  *
21
21
  * This source code is licensed under the MIT license found in the
22
22
  * LICENSE file in the root directory of this source tree.
23
- */var ma;function rg(){return ma||(ma=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,s=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,x=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,k=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function T(L){return typeof L=="string"||typeof L=="function"||L===s||L===d||L===o||L===r||L===f||L===h||typeof L=="object"&&L!==null&&(L.$$typeof===x||L.$$typeof===g||L.$$typeof===i||L.$$typeof===a||L.$$typeof===u||L.$$typeof===b||L.$$typeof===k||L.$$typeof===v||L.$$typeof===m)}function w(L){if(typeof L=="object"&&L!==null){var ae=L.$$typeof;switch(ae){case t:var xe=L.type;switch(xe){case c:case d:case s:case o:case r:case f:return xe;default:var Ie=xe&&xe.$$typeof;switch(Ie){case a:case u:case x:case g:case i:return Ie;default:return ae}}case n:return ae}}}var S=c,A=d,M=a,j=i,z=t,y=u,D=s,_=x,J=g,te=n,ee=o,se=r,K=f,R=!1;function X(L){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),V(L)||w(L)===c}function V(L){return w(L)===d}function U(L){return w(L)===a}function q(L){return w(L)===i}function P(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function E(L){return w(L)===u}function O(L){return w(L)===s}function F(L){return w(L)===x}function $(L){return w(L)===g}function I(L){return w(L)===n}function H(L){return w(L)===o}function B(L){return w(L)===r}function oe(L){return w(L)===f}de.AsyncMode=S,de.ConcurrentMode=A,de.ContextConsumer=M,de.ContextProvider=j,de.Element=z,de.ForwardRef=y,de.Fragment=D,de.Lazy=_,de.Memo=J,de.Portal=te,de.Profiler=ee,de.StrictMode=se,de.Suspense=K,de.isAsyncMode=X,de.isConcurrentMode=V,de.isContextConsumer=U,de.isContextProvider=q,de.isElement=P,de.isForwardRef=E,de.isFragment=O,de.isLazy=F,de.isMemo=$,de.isPortal=I,de.isProfiler=H,de.isStrictMode=B,de.isSuspense=oe,de.isValidElementType=T,de.typeOf=w}()),de}var pa;function Gl(){return pa||(pa=1,process.env.NODE_ENV==="production"?zn.exports=sg():zn.exports=rg()),zn.exports}/*
23
+ */var ma;function s0(){return ma||(ma=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,x=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,k=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function E(L){return typeof L=="string"||typeof L=="function"||L===r||L===d||L===o||L===s||L===f||L===h||typeof L=="object"&&L!==null&&(L.$$typeof===x||L.$$typeof===p||L.$$typeof===i||L.$$typeof===a||L.$$typeof===u||L.$$typeof===b||L.$$typeof===k||L.$$typeof===v||L.$$typeof===m)}function w(L){if(typeof L=="object"&&L!==null){var ae=L.$$typeof;switch(ae){case t:var xe=L.type;switch(xe){case c:case d:case r:case o:case s:case f:return xe;default:var Ie=xe&&xe.$$typeof;switch(Ie){case a:case u:case x:case p:case i:return Ie;default:return ae}}case n:return ae}}}var S=c,A=d,M=a,j=i,z=t,y=u,D=r,_=x,J=p,te=n,ee=o,re=s,K=f,R=!1;function X(L){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),V(L)||w(L)===c}function V(L){return w(L)===d}function H(L){return w(L)===a}function q(L){return w(L)===i}function P(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function T(L){return w(L)===u}function O(L){return w(L)===r}function F(L){return w(L)===x}function $(L){return w(L)===p}function I(L){return w(L)===n}function U(L){return w(L)===o}function B(L){return w(L)===s}function oe(L){return w(L)===f}de.AsyncMode=S,de.ConcurrentMode=A,de.ContextConsumer=M,de.ContextProvider=j,de.Element=z,de.ForwardRef=y,de.Fragment=D,de.Lazy=_,de.Memo=J,de.Portal=te,de.Profiler=ee,de.StrictMode=re,de.Suspense=K,de.isAsyncMode=X,de.isConcurrentMode=V,de.isContextConsumer=H,de.isContextProvider=q,de.isElement=P,de.isForwardRef=T,de.isFragment=O,de.isLazy=F,de.isMemo=$,de.isPortal=I,de.isProfiler=U,de.isStrictMode=B,de.isSuspense=oe,de.isValidElementType=E,de.typeOf=w}()),de}var ga;function Gl(){return ga||(ga=1,process.env.NODE_ENV==="production"?zn.exports=r0():zn.exports=s0()),zn.exports}/*
24
24
  object-assign
25
25
  (c) Sindre Sorhus
26
26
  @license MIT
27
- */var Gs,ga;function og(){if(ga)return Gs;ga=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function s(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function r(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var c=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(c.join("")!=="0123456789")return!1;var d={};return"abcdefghijklmnopqrst".split("").forEach(function(u){d[u]=u}),Object.keys(Object.assign({},d)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Gs=r()?Object.assign:function(o,i){for(var a,c=s(o),d,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)t.call(a,f)&&(c[f]=a[f]);if(e){d=e(a);for(var h=0;h<d.length;h++)n.call(a,d[h])&&(c[d[h]]=a[d[h]])}}return c},Gs}var Ks,ya;function So(){if(ya)return Ks;ya=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ks=e,Ks}var Ys,xa;function Kl(){return xa||(xa=1,Ys=Function.call.bind(Object.prototype.hasOwnProperty)),Ys}var qs,ba;function ig(){if(ba)return qs;ba=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=So(),n={},s=Kl();e=function(o){var i="Warning: "+o;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function r(o,i,a,c,d){if(process.env.NODE_ENV!=="production"){for(var u in o)if(s(o,u)){var f;try{if(typeof o[u]!="function"){var h=Error((c||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=o[u](i,u,c,a,null,t)}catch(x){f=x}if(f&&!(f instanceof Error)&&e((c||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var g=d?d():"";e("Failed "+a+" type: "+f.message+(g??""))}}}}return r.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},qs=r,qs}var Xs,va;function ag(){if(va)return Xs;va=1;var e=Gl(),t=og(),n=So(),s=Kl(),r=ig(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var c="Warning: "+a;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return Xs=function(a,c){var d=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(V){var U=V&&(d&&V[d]||V[u]);if(typeof U=="function")return U}var h="<<anonymous>>",g={array:k("array"),bigint:k("bigint"),bool:k("boolean"),func:k("function"),number:k("number"),object:k("object"),string:k("string"),symbol:k("symbol"),any:v(),arrayOf:T,element:w(),elementType:S(),instanceOf:A,node:y(),objectOf:j,oneOf:M,oneOfType:z,shape:_,exact:J};function x(V,U){return V===U?V!==0||1/V===1/U:V!==V&&U!==U}function m(V,U){this.message=V,this.data=U&&typeof U=="object"?U:{},this.stack=""}m.prototype=Error.prototype;function b(V){if(process.env.NODE_ENV!=="production")var U={},q=0;function P(O,F,$,I,H,B,oe){if(I=I||h,B=B||$,oe!==n){if(c){var L=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw L.name="Invariant Violation",L}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ae=I+":"+$;!U[ae]&&q<3&&(o("You are manually calling a React.PropTypes validation function for the `"+B+"` prop on `"+I+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),U[ae]=!0,q++)}}return F[$]==null?O?F[$]===null?new m("The "+H+" `"+B+"` is marked as required "+("in `"+I+"`, but its value is `null`.")):new m("The "+H+" `"+B+"` is marked as required in "+("`"+I+"`, but its value is `undefined`.")):null:V(F,$,I,H,B)}var E=P.bind(null,!1);return E.isRequired=P.bind(null,!0),E}function k(V){function U(q,P,E,O,F,$){var I=q[P],H=se(I);if(H!==V){var B=K(I);return new m("Invalid "+O+" `"+F+"` of type "+("`"+B+"` supplied to `"+E+"`, expected ")+("`"+V+"`."),{expectedType:V})}return null}return b(U)}function v(){return b(i)}function T(V){function U(q,P,E,O,F){if(typeof V!="function")return new m("Property `"+F+"` of component `"+E+"` has invalid PropType notation inside arrayOf.");var $=q[P];if(!Array.isArray($)){var I=se($);return new m("Invalid "+O+" `"+F+"` of type "+("`"+I+"` supplied to `"+E+"`, expected an array."))}for(var H=0;H<$.length;H++){var B=V($,H,E,O,F+"["+H+"]",n);if(B instanceof Error)return B}return null}return b(U)}function w(){function V(U,q,P,E,O){var F=U[q];if(!a(F)){var $=se(F);return new m("Invalid "+E+" `"+O+"` of type "+("`"+$+"` supplied to `"+P+"`, expected a single ReactElement."))}return null}return b(V)}function S(){function V(U,q,P,E,O){var F=U[q];if(!e.isValidElementType(F)){var $=se(F);return new m("Invalid "+E+" `"+O+"` of type "+("`"+$+"` supplied to `"+P+"`, expected a single ReactElement type."))}return null}return b(V)}function A(V){function U(q,P,E,O,F){if(!(q[P]instanceof V)){var $=V.name||h,I=X(q[P]);return new m("Invalid "+O+" `"+F+"` of type "+("`"+I+"` supplied to `"+E+"`, expected ")+("instance of `"+$+"`."))}return null}return b(U)}function M(V){if(!Array.isArray(V))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),i;function U(q,P,E,O,F){for(var $=q[P],I=0;I<V.length;I++)if(x($,V[I]))return null;var H=JSON.stringify(V,function(oe,L){var ae=K(L);return ae==="symbol"?String(L):L});return new m("Invalid "+O+" `"+F+"` of value `"+String($)+"` "+("supplied to `"+E+"`, expected one of "+H+"."))}return b(U)}function j(V){function U(q,P,E,O,F){if(typeof V!="function")return new m("Property `"+F+"` of component `"+E+"` has invalid PropType notation inside objectOf.");var $=q[P],I=se($);if(I!=="object")return new m("Invalid "+O+" `"+F+"` of type "+("`"+I+"` supplied to `"+E+"`, expected an object."));for(var H in $)if(s($,H)){var B=V($,H,E,O,F+"."+H,n);if(B instanceof Error)return B}return null}return b(U)}function z(V){if(!Array.isArray(V))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var U=0;U<V.length;U++){var q=V[U];if(typeof q!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+R(q)+" at index "+U+"."),i}function P(E,O,F,$,I){for(var H=[],B=0;B<V.length;B++){var oe=V[B],L=oe(E,O,F,$,I,n);if(L==null)return null;L.data&&s(L.data,"expectedType")&&H.push(L.data.expectedType)}var ae=H.length>0?", expected one of type ["+H.join(", ")+"]":"";return new m("Invalid "+$+" `"+I+"` supplied to "+("`"+F+"`"+ae+"."))}return b(P)}function y(){function V(U,q,P,E,O){return te(U[q])?null:new m("Invalid "+E+" `"+O+"` supplied to "+("`"+P+"`, expected a ReactNode."))}return b(V)}function D(V,U,q,P,E){return new m((V||"React class")+": "+U+" type `"+q+"."+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+E+"`.")}function _(V){function U(q,P,E,O,F){var $=q[P],I=se($);if(I!=="object")return new m("Invalid "+O+" `"+F+"` of type `"+I+"` "+("supplied to `"+E+"`, expected `object`."));for(var H in V){var B=V[H];if(typeof B!="function")return D(E,O,F,H,K(B));var oe=B($,H,E,O,F+"."+H,n);if(oe)return oe}return null}return b(U)}function J(V){function U(q,P,E,O,F){var $=q[P],I=se($);if(I!=="object")return new m("Invalid "+O+" `"+F+"` of type `"+I+"` "+("supplied to `"+E+"`, expected `object`."));var H=t({},q[P],V);for(var B in H){var oe=V[B];if(s(V,B)&&typeof oe!="function")return D(E,O,F,B,K(oe));if(!oe)return new m("Invalid "+O+" `"+F+"` key `"+B+"` supplied to `"+E+"`.\nBad object: "+JSON.stringify(q[P],null," ")+`
28
- Valid keys: `+JSON.stringify(Object.keys(V),null," "));var L=oe($,B,E,O,F+"."+B,n);if(L)return L}return null}return b(U)}function te(V){switch(typeof V){case"number":case"string":case"undefined":return!0;case"boolean":return!V;case"object":if(Array.isArray(V))return V.every(te);if(V===null||a(V))return!0;var U=f(V);if(U){var q=U.call(V),P;if(U!==V.entries){for(;!(P=q.next()).done;)if(!te(P.value))return!1}else for(;!(P=q.next()).done;){var E=P.value;if(E&&!te(E[1]))return!1}}else return!1;return!0;default:return!1}}function ee(V,U){return V==="symbol"?!0:U?U["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&U instanceof Symbol:!1}function se(V){var U=typeof V;return Array.isArray(V)?"array":V instanceof RegExp?"object":ee(U,V)?"symbol":U}function K(V){if(typeof V>"u"||V===null)return""+V;var U=se(V);if(U==="object"){if(V instanceof Date)return"date";if(V instanceof RegExp)return"regexp"}return U}function R(V){var U=K(V);switch(U){case"array":case"object":return"an "+U;case"boolean":case"date":case"regexp":return"a "+U;default:return U}}function X(V){return!V.constructor||!V.constructor.name?h:V.constructor.name}return g.checkPropTypes=r,g.resetWarningCache=r.resetWarningCache,g.PropTypes=g,g},Xs}var Js,wa;function cg(){if(wa)return Js;wa=1;var e=So();function t(){}function n(){}return n.resetWarningCache=t,Js=function(){function s(i,a,c,d,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}s.isRequired=s;function r(){return s}var o={array:s,bigint:s,bool:s,func:s,number:s,object:s,string:s,symbol:s,any:s,arrayOf:r,element:s,elementType:s,instanceOf:r,node:s,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Js}var Sa;function lg(){if(Sa)return Bn.exports;if(Sa=1,process.env.NODE_ENV!=="production"){var e=Gl(),t=!0;Bn.exports=ag()(e.isElement,t)}else Bn.exports=cg()();return Bn.exports}var dg=lg();const ce=ng(dg);function ug(e,t,n=void 0){const s={};for(const r in e){const o=e[r];let i="",a=!0;for(let c=0;c<o.length;c+=1){const d=o[c];d&&(i+=(a===!0?"":" ")+t(d),a=!1,n&&n[d]&&(i+=" "+n[d]))}s[r]=i}return s}var Hn={exports:{}},ue={};/**
27
+ */var Gr,pa;function o0(){if(pa)return Gr;pa=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function s(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var c=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(c.join("")!=="0123456789")return!1;var d={};return"abcdefghijklmnopqrst".split("").forEach(function(u){d[u]=u}),Object.keys(Object.assign({},d)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Gr=s()?Object.assign:function(o,i){for(var a,c=r(o),d,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)t.call(a,f)&&(c[f]=a[f]);if(e){d=e(a);for(var h=0;h<d.length;h++)n.call(a,d[h])&&(c[d[h]]=a[d[h]])}}return c},Gr}var Kr,ya;function So(){if(ya)return Kr;ya=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Kr=e,Kr}var Yr,xa;function Kl(){return xa||(xa=1,Yr=Function.call.bind(Object.prototype.hasOwnProperty)),Yr}var qr,ba;function i0(){if(ba)return qr;ba=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=So(),n={},r=Kl();e=function(o){var i="Warning: "+o;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(o,i,a,c,d){if(process.env.NODE_ENV!=="production"){for(var u in o)if(r(o,u)){var f;try{if(typeof o[u]!="function"){var h=Error((c||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=o[u](i,u,c,a,null,t)}catch(x){f=x}if(f&&!(f instanceof Error)&&e((c||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var p=d?d():"";e("Failed "+a+" type: "+f.message+(p??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},qr=s,qr}var Xr,va;function a0(){if(va)return Xr;va=1;var e=Gl(),t=o0(),n=So(),r=Kl(),s=i0(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var c="Warning: "+a;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return Xr=function(a,c){var d=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(V){var H=V&&(d&&V[d]||V[u]);if(typeof H=="function")return H}var h="<<anonymous>>",p={array:k("array"),bigint:k("bigint"),bool:k("boolean"),func:k("function"),number:k("number"),object:k("object"),string:k("string"),symbol:k("symbol"),any:v(),arrayOf:E,element:w(),elementType:S(),instanceOf:A,node:y(),objectOf:j,oneOf:M,oneOfType:z,shape:_,exact:J};function x(V,H){return V===H?V!==0||1/V===1/H:V!==V&&H!==H}function m(V,H){this.message=V,this.data=H&&typeof H=="object"?H:{},this.stack=""}m.prototype=Error.prototype;function b(V){if(process.env.NODE_ENV!=="production")var H={},q=0;function P(O,F,$,I,U,B,oe){if(I=I||h,B=B||$,oe!==n){if(c){var L=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw L.name="Invariant Violation",L}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ae=I+":"+$;!H[ae]&&q<3&&(o("You are manually calling a React.PropTypes validation function for the `"+B+"` prop on `"+I+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),H[ae]=!0,q++)}}return F[$]==null?O?F[$]===null?new m("The "+U+" `"+B+"` is marked as required "+("in `"+I+"`, but its value is `null`.")):new m("The "+U+" `"+B+"` is marked as required in "+("`"+I+"`, but its value is `undefined`.")):null:V(F,$,I,U,B)}var T=P.bind(null,!1);return T.isRequired=P.bind(null,!0),T}function k(V){function H(q,P,T,O,F,$){var I=q[P],U=re(I);if(U!==V){var B=K(I);return new m("Invalid "+O+" `"+F+"` of type "+("`"+B+"` supplied to `"+T+"`, expected ")+("`"+V+"`."),{expectedType:V})}return null}return b(H)}function v(){return b(i)}function E(V){function H(q,P,T,O,F){if(typeof V!="function")return new m("Property `"+F+"` of component `"+T+"` has invalid PropType notation inside arrayOf.");var $=q[P];if(!Array.isArray($)){var I=re($);return new m("Invalid "+O+" `"+F+"` of type "+("`"+I+"` supplied to `"+T+"`, expected an array."))}for(var U=0;U<$.length;U++){var B=V($,U,T,O,F+"["+U+"]",n);if(B instanceof Error)return B}return null}return b(H)}function w(){function V(H,q,P,T,O){var F=H[q];if(!a(F)){var $=re(F);return new m("Invalid "+T+" `"+O+"` of type "+("`"+$+"` supplied to `"+P+"`, expected a single ReactElement."))}return null}return b(V)}function S(){function V(H,q,P,T,O){var F=H[q];if(!e.isValidElementType(F)){var $=re(F);return new m("Invalid "+T+" `"+O+"` of type "+("`"+$+"` supplied to `"+P+"`, expected a single ReactElement type."))}return null}return b(V)}function A(V){function H(q,P,T,O,F){if(!(q[P]instanceof V)){var $=V.name||h,I=X(q[P]);return new m("Invalid "+O+" `"+F+"` of type "+("`"+I+"` supplied to `"+T+"`, expected ")+("instance of `"+$+"`."))}return null}return b(H)}function M(V){if(!Array.isArray(V))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),i;function H(q,P,T,O,F){for(var $=q[P],I=0;I<V.length;I++)if(x($,V[I]))return null;var U=JSON.stringify(V,function(oe,L){var ae=K(L);return ae==="symbol"?String(L):L});return new m("Invalid "+O+" `"+F+"` of value `"+String($)+"` "+("supplied to `"+T+"`, expected one of "+U+"."))}return b(H)}function j(V){function H(q,P,T,O,F){if(typeof V!="function")return new m("Property `"+F+"` of component `"+T+"` has invalid PropType notation inside objectOf.");var $=q[P],I=re($);if(I!=="object")return new m("Invalid "+O+" `"+F+"` of type "+("`"+I+"` supplied to `"+T+"`, expected an object."));for(var U in $)if(r($,U)){var B=V($,U,T,O,F+"."+U,n);if(B instanceof Error)return B}return null}return b(H)}function z(V){if(!Array.isArray(V))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var H=0;H<V.length;H++){var q=V[H];if(typeof q!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+R(q)+" at index "+H+"."),i}function P(T,O,F,$,I){for(var U=[],B=0;B<V.length;B++){var oe=V[B],L=oe(T,O,F,$,I,n);if(L==null)return null;L.data&&r(L.data,"expectedType")&&U.push(L.data.expectedType)}var ae=U.length>0?", expected one of type ["+U.join(", ")+"]":"";return new m("Invalid "+$+" `"+I+"` supplied to "+("`"+F+"`"+ae+"."))}return b(P)}function y(){function V(H,q,P,T,O){return te(H[q])?null:new m("Invalid "+T+" `"+O+"` supplied to "+("`"+P+"`, expected a ReactNode."))}return b(V)}function D(V,H,q,P,T){return new m((V||"React class")+": "+H+" type `"+q+"."+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+T+"`.")}function _(V){function H(q,P,T,O,F){var $=q[P],I=re($);if(I!=="object")return new m("Invalid "+O+" `"+F+"` of type `"+I+"` "+("supplied to `"+T+"`, expected `object`."));for(var U in V){var B=V[U];if(typeof B!="function")return D(T,O,F,U,K(B));var oe=B($,U,T,O,F+"."+U,n);if(oe)return oe}return null}return b(H)}function J(V){function H(q,P,T,O,F){var $=q[P],I=re($);if(I!=="object")return new m("Invalid "+O+" `"+F+"` of type `"+I+"` "+("supplied to `"+T+"`, expected `object`."));var U=t({},q[P],V);for(var B in U){var oe=V[B];if(r(V,B)&&typeof oe!="function")return D(T,O,F,B,K(oe));if(!oe)return new m("Invalid "+O+" `"+F+"` key `"+B+"` supplied to `"+T+"`.\nBad object: "+JSON.stringify(q[P],null," ")+`
28
+ Valid keys: `+JSON.stringify(Object.keys(V),null," "));var L=oe($,B,T,O,F+"."+B,n);if(L)return L}return null}return b(H)}function te(V){switch(typeof V){case"number":case"string":case"undefined":return!0;case"boolean":return!V;case"object":if(Array.isArray(V))return V.every(te);if(V===null||a(V))return!0;var H=f(V);if(H){var q=H.call(V),P;if(H!==V.entries){for(;!(P=q.next()).done;)if(!te(P.value))return!1}else for(;!(P=q.next()).done;){var T=P.value;if(T&&!te(T[1]))return!1}}else return!1;return!0;default:return!1}}function ee(V,H){return V==="symbol"?!0:H?H["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&H instanceof Symbol:!1}function re(V){var H=typeof V;return Array.isArray(V)?"array":V instanceof RegExp?"object":ee(H,V)?"symbol":H}function K(V){if(typeof V>"u"||V===null)return""+V;var H=re(V);if(H==="object"){if(V instanceof Date)return"date";if(V instanceof RegExp)return"regexp"}return H}function R(V){var H=K(V);switch(H){case"array":case"object":return"an "+H;case"boolean":case"date":case"regexp":return"a "+H;default:return H}}function X(V){return!V.constructor||!V.constructor.name?h:V.constructor.name}return p.checkPropTypes=s,p.resetWarningCache=s.resetWarningCache,p.PropTypes=p,p},Xr}var Jr,wa;function c0(){if(wa)return Jr;wa=1;var e=So();function t(){}function n(){}return n.resetWarningCache=t,Jr=function(){function r(i,a,c,d,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function s(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Jr}var Sa;function l0(){if(Sa)return Bn.exports;if(Sa=1,process.env.NODE_ENV!=="production"){var e=Gl(),t=!0;Bn.exports=a0()(e.isElement,t)}else Bn.exports=c0()();return Bn.exports}var d0=l0();const ce=n0(d0);function u0(e,t,n=void 0){const r={};for(const s in e){const o=e[s];let i="",a=!0;for(let c=0;c<o.length;c+=1){const d=o[c];d&&(i+=(a===!0?"":" ")+t(d),a=!1,n&&n[d]&&(i+=" "+n[d]))}r[s]=i}return r}var Un={exports:{}},ue={};/**
29
29
  * @license React
30
30
  * react-is.production.js
31
31
  *
@@ -33,7 +33,7 @@ Valid keys: `+JSON.stringify(Object.keys(V),null," "));var L=oe($,B,E,O,F+"."+B
33
33
  *
34
34
  * This source code is licensed under the MIT license found in the
35
35
  * LICENSE file in the root directory of this source tree.
36
- */var Ca;function fg(){if(Ca)return ue;Ca=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),i=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),g=Symbol.for("react.client.reference");function x(m){if(typeof m=="object"&&m!==null){var b=m.$$typeof;switch(b){case e:switch(m=m.type,m){case n:case r:case s:case c:case d:case h:return m;default:switch(m=m&&m.$$typeof,m){case i:case a:case f:case u:return m;case o:return m;default:return b}}case t:return b}}}return ue.ContextConsumer=o,ue.ContextProvider=i,ue.Element=e,ue.ForwardRef=a,ue.Fragment=n,ue.Lazy=f,ue.Memo=u,ue.Portal=t,ue.Profiler=r,ue.StrictMode=s,ue.Suspense=c,ue.SuspenseList=d,ue.isContextConsumer=function(m){return x(m)===o},ue.isContextProvider=function(m){return x(m)===i},ue.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===e},ue.isForwardRef=function(m){return x(m)===a},ue.isFragment=function(m){return x(m)===n},ue.isLazy=function(m){return x(m)===f},ue.isMemo=function(m){return x(m)===u},ue.isPortal=function(m){return x(m)===t},ue.isProfiler=function(m){return x(m)===r},ue.isStrictMode=function(m){return x(m)===s},ue.isSuspense=function(m){return x(m)===c},ue.isSuspenseList=function(m){return x(m)===d},ue.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===r||m===s||m===c||m===d||typeof m=="object"&&m!==null&&(m.$$typeof===f||m.$$typeof===u||m.$$typeof===i||m.$$typeof===o||m.$$typeof===a||m.$$typeof===g||m.getModuleId!==void 0)},ue.typeOf=x,ue}var fe={};/**
36
+ */var Ca;function f0(){if(Ca)return ue;Ca=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),i=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),p=Symbol.for("react.client.reference");function x(m){if(typeof m=="object"&&m!==null){var b=m.$$typeof;switch(b){case e:switch(m=m.type,m){case n:case s:case r:case c:case d:case h:return m;default:switch(m=m&&m.$$typeof,m){case i:case a:case f:case u:return m;case o:return m;default:return b}}case t:return b}}}return ue.ContextConsumer=o,ue.ContextProvider=i,ue.Element=e,ue.ForwardRef=a,ue.Fragment=n,ue.Lazy=f,ue.Memo=u,ue.Portal=t,ue.Profiler=s,ue.StrictMode=r,ue.Suspense=c,ue.SuspenseList=d,ue.isContextConsumer=function(m){return x(m)===o},ue.isContextProvider=function(m){return x(m)===i},ue.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===e},ue.isForwardRef=function(m){return x(m)===a},ue.isFragment=function(m){return x(m)===n},ue.isLazy=function(m){return x(m)===f},ue.isMemo=function(m){return x(m)===u},ue.isPortal=function(m){return x(m)===t},ue.isProfiler=function(m){return x(m)===s},ue.isStrictMode=function(m){return x(m)===r},ue.isSuspense=function(m){return x(m)===c},ue.isSuspenseList=function(m){return x(m)===d},ue.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===s||m===r||m===c||m===d||typeof m=="object"&&m!==null&&(m.$$typeof===f||m.$$typeof===u||m.$$typeof===i||m.$$typeof===o||m.$$typeof===a||m.$$typeof===p||m.getModuleId!==void 0)},ue.typeOf=x,ue}var fe={};/**
37
37
  * @license React
38
38
  * react-is.development.js
39
39
  *
@@ -41,21 +41,21 @@ Valid keys: `+JSON.stringify(Object.keys(V),null," "));var L=oe($,B,E,O,F+"."+B
41
41
  *
42
42
  * This source code is licensed under the MIT license found in the
43
43
  * LICENSE file in the root directory of this source tree.
44
- */var ka;function hg(){return ka||(ka=1,process.env.NODE_ENV!=="production"&&function(){function e(m){if(typeof m=="object"&&m!==null){var b=m.$$typeof;switch(b){case t:switch(m=m.type,m){case s:case o:case r:case d:case u:case g:return m;default:switch(m=m&&m.$$typeof,m){case a:case c:case h:case f:return m;case i:return m;default:return b}}case n:return b}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");fe.ContextConsumer=i,fe.ContextProvider=a,fe.Element=t,fe.ForwardRef=c,fe.Fragment=s,fe.Lazy=h,fe.Memo=f,fe.Portal=n,fe.Profiler=o,fe.StrictMode=r,fe.Suspense=d,fe.SuspenseList=u,fe.isContextConsumer=function(m){return e(m)===i},fe.isContextProvider=function(m){return e(m)===a},fe.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===t},fe.isForwardRef=function(m){return e(m)===c},fe.isFragment=function(m){return e(m)===s},fe.isLazy=function(m){return e(m)===h},fe.isMemo=function(m){return e(m)===f},fe.isPortal=function(m){return e(m)===n},fe.isProfiler=function(m){return e(m)===o},fe.isStrictMode=function(m){return e(m)===r},fe.isSuspense=function(m){return e(m)===d},fe.isSuspenseList=function(m){return e(m)===u},fe.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===s||m===o||m===r||m===d||m===u||typeof m=="object"&&m!==null&&(m.$$typeof===h||m.$$typeof===f||m.$$typeof===a||m.$$typeof===i||m.$$typeof===c||m.$$typeof===x||m.getModuleId!==void 0)},fe.typeOf=e}()),fe}var Ta;function mg(){return Ta||(Ta=1,process.env.NODE_ENV==="production"?Hn.exports=fg():Hn.exports=hg()),Hn.exports}var os=mg();function st(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Yl(e){if(p.isValidElement(e)||os.isValidElementType(e)||!st(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Yl(e[n])}),t}function Oe(e,t,n={clone:!0}){const s=n.clone?{...e}:e;return st(e)&&st(t)&&Object.keys(t).forEach(r=>{p.isValidElement(t[r])||os.isValidElementType(t[r])?s[r]=t[r]:st(t[r])&&Object.prototype.hasOwnProperty.call(e,r)&&st(e[r])?s[r]=Oe(e[r],t[r],n):n.clone?s[r]=st(t[r])?Yl(t[r]):t[r]:s[r]=t[r]}),s}function yn(e,t){return t?Oe(e,t,{clone:!1}):e}const gt=process.env.NODE_ENV!=="production"?ce.oneOfType([ce.number,ce.string,ce.object,ce.array]):{};function Ea(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(s=>s.startsWith("@container")).sort((s,r)=>{var i,a;const o=/min-width:\s*([0-9.]+)/;return+(((i=s.match(o))==null?void 0:i[1])||0)-+(((a=r.match(o))==null?void 0:a[1])||0)});return n.length?n.reduce((s,r)=>{const o=t[r];return delete s[r],s[r]=o,s},{...t}):t}function pg(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function gg(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n){if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
45
- For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:ht(18,`(${t})`));return null}const[,s,r]=n,o=Number.isNaN(+s)?s||0:+s;return e.containerQueries(r).up(o)}function yg(e){const t=(o,i)=>o.replace("@media",i?`@container ${i}`:"@container");function n(o,i){o.up=(...a)=>t(e.breakpoints.up(...a),i),o.down=(...a)=>t(e.breakpoints.down(...a),i),o.between=(...a)=>t(e.breakpoints.between(...a),i),o.only=(...a)=>t(e.breakpoints.only(...a),i),o.not=(...a)=>{const c=t(e.breakpoints.not(...a),i);return c.includes("not all and")?c.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):c}}const s={},r=o=>(n(s,o),s);return n(r),{...e,containerQueries:r}}const hs={xs:0,sm:600,md:900,lg:1200,xl:1536},Aa={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${hs[e]}px)`},xg={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:hs[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function at(e,t,n){const s=e.theme||{};if(Array.isArray(t)){const o=s.breakpoints||Aa;return t.reduce((i,a,c)=>(i[o.up(o.keys[c])]=n(t[c]),i),{})}if(typeof t=="object"){const o=s.breakpoints||Aa;return Object.keys(t).reduce((i,a)=>{if(pg(o.keys,a)){const c=gg(s.containerQueries?s:xg,a);c&&(i[c]=n(t[a],a))}else if(Object.keys(o.values||hs).includes(a)){const c=o.up(a);i[c]=n(t[a],a)}else{const c=a;i[c]=t[c]}return i},{})}return n(t)}function bg(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((s,r)=>{const o=e.up(r);return s[o]={},s},{}))||{}}function ja(e,t){return e.reduce((n,s)=>{const r=n[s];return(!r||Object.keys(r).length===0)&&delete n[s],n},t)}function ms(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const s=`vars.${t}`.split(".").reduce((r,o)=>r&&r[o]?r[o]:null,e);if(s!=null)return s}return t.split(".").reduce((s,r)=>s&&s[r]!=null?s[r]:null,e)}function is(e,t,n,s=n){let r;return typeof e=="function"?r=e(n):Array.isArray(e)?r=e[n]||s:r=ms(e,n)||s,t&&(r=t(r,s,e)),r}function Ee(e){const{prop:t,cssProperty:n=e.prop,themeKey:s,transform:r}=e,o=i=>{if(i[t]==null)return null;const a=i[t],c=i.theme,d=ms(c,s)||{};return at(i,a,f=>{let h=is(d,r,f);return f===h&&typeof f=="string"&&(h=is(d,r,`${t}${f==="default"?"":At(f)}`,f)),n===!1?h:{[n]:h}})};return o.propTypes=process.env.NODE_ENV!=="production"?{[t]:gt}:{},o.filterProps=[t],o}function vg(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const wg={m:"margin",p:"padding"},Sg={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Ma={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Cg=vg(e=>{if(e.length>2)if(Ma[e])e=Ma[e];else return[e];const[t,n]=e.split(""),s=wg[t],r=Sg[n]||"";return Array.isArray(r)?r.map(o=>s+o):[s+r]}),ps=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],gs=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],kg=[...ps,...gs];function Mn(e,t,n,s){const r=ms(e,t,!0)??n;return typeof r=="number"||typeof r=="string"?o=>typeof o=="string"?o:(process.env.NODE_ENV!=="production"&&typeof o!="number"&&console.error(`MUI: Expected ${s} argument to be a number or a string, got ${o}.`),typeof r=="string"?r.startsWith("var(")&&o===0?0:r.startsWith("var(")&&o===1?r:`calc(${o} * ${r})`:r*o):Array.isArray(r)?o=>{if(typeof o=="string")return o;const i=Math.abs(o);process.env.NODE_ENV!=="production"&&(Number.isInteger(i)?i>r.length-1&&console.error([`MUI: The value provided (${i}) overflows.`,`The supported values are: ${JSON.stringify(r)}.`,`${i} > ${r.length-1}, you need to add the missing values.`].join(`
44
+ */var ka;function h0(){return ka||(ka=1,process.env.NODE_ENV!=="production"&&function(){function e(m){if(typeof m=="object"&&m!==null){var b=m.$$typeof;switch(b){case t:switch(m=m.type,m){case r:case o:case s:case d:case u:case p:return m;default:switch(m=m&&m.$$typeof,m){case a:case c:case h:case f:return m;case i:return m;default:return b}}case n:return b}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");fe.ContextConsumer=i,fe.ContextProvider=a,fe.Element=t,fe.ForwardRef=c,fe.Fragment=r,fe.Lazy=h,fe.Memo=f,fe.Portal=n,fe.Profiler=o,fe.StrictMode=s,fe.Suspense=d,fe.SuspenseList=u,fe.isContextConsumer=function(m){return e(m)===i},fe.isContextProvider=function(m){return e(m)===a},fe.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===t},fe.isForwardRef=function(m){return e(m)===c},fe.isFragment=function(m){return e(m)===r},fe.isLazy=function(m){return e(m)===h},fe.isMemo=function(m){return e(m)===f},fe.isPortal=function(m){return e(m)===n},fe.isProfiler=function(m){return e(m)===o},fe.isStrictMode=function(m){return e(m)===s},fe.isSuspense=function(m){return e(m)===d},fe.isSuspenseList=function(m){return e(m)===u},fe.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===r||m===o||m===s||m===d||m===u||typeof m=="object"&&m!==null&&(m.$$typeof===h||m.$$typeof===f||m.$$typeof===a||m.$$typeof===i||m.$$typeof===c||m.$$typeof===x||m.getModuleId!==void 0)},fe.typeOf=e}()),fe}var Ea;function m0(){return Ea||(Ea=1,process.env.NODE_ENV==="production"?Un.exports=f0():Un.exports=h0()),Un.exports}var or=m0();function rt(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Yl(e){if(g.isValidElement(e)||or.isValidElementType(e)||!rt(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Yl(e[n])}),t}function Oe(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return rt(e)&&rt(t)&&Object.keys(t).forEach(s=>{g.isValidElement(t[s])||or.isValidElementType(t[s])?r[s]=t[s]:rt(t[s])&&Object.prototype.hasOwnProperty.call(e,s)&&rt(e[s])?r[s]=Oe(e[s],t[s],n):n.clone?r[s]=rt(t[s])?Yl(t[s]):t[s]:r[s]=t[s]}),r}function yn(e,t){return t?Oe(e,t,{clone:!1}):e}const pt=process.env.NODE_ENV!=="production"?ce.oneOfType([ce.number,ce.string,ce.object,ce.array]):{};function Ta(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,s)=>{var i,a;const o=/min-width:\s*([0-9.]+)/;return+(((i=r.match(o))==null?void 0:i[1])||0)-+(((a=s.match(o))==null?void 0:a[1])||0)});return n.length?n.reduce((r,s)=>{const o=t[s];return delete r[s],r[s]=o,r},{...t}):t}function g0(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function p0(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n){if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
45
+ For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:ht(18,`(${t})`));return null}const[,r,s]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(s).up(o)}function y0(e){const t=(o,i)=>o.replace("@media",i?`@container ${i}`:"@container");function n(o,i){o.up=(...a)=>t(e.breakpoints.up(...a),i),o.down=(...a)=>t(e.breakpoints.down(...a),i),o.between=(...a)=>t(e.breakpoints.between(...a),i),o.only=(...a)=>t(e.breakpoints.only(...a),i),o.not=(...a)=>{const c=t(e.breakpoints.not(...a),i);return c.includes("not all and")?c.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):c}}const r={},s=o=>(n(r,o),r);return n(s),{...e,containerQueries:s}}const hr={xs:0,sm:600,md:900,lg:1200,xl:1536},Aa={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${hr[e]}px)`},x0={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:hr[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function at(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||Aa;return t.reduce((i,a,c)=>(i[o.up(o.keys[c])]=n(t[c]),i),{})}if(typeof t=="object"){const o=r.breakpoints||Aa;return Object.keys(t).reduce((i,a)=>{if(g0(o.keys,a)){const c=p0(r.containerQueries?r:x0,a);c&&(i[c]=n(t[a],a))}else if(Object.keys(o.values||hr).includes(a)){const c=o.up(a);i[c]=n(t[a],a)}else{const c=a;i[c]=t[c]}return i},{})}return n(t)}function b0(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,s)=>{const o=e.up(s);return r[o]={},r},{}))||{}}function ja(e,t){return e.reduce((n,r)=>{const s=n[r];return(!s||Object.keys(s).length===0)&&delete n[r],n},t)}function mr(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((s,o)=>s&&s[o]?s[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,s)=>r&&r[s]!=null?r[s]:null,e)}function ir(e,t,n,r=n){let s;return typeof e=="function"?s=e(n):Array.isArray(e)?s=e[n]||r:s=mr(e,n)||r,t&&(s=t(s,r,e)),s}function Te(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:s}=e,o=i=>{if(i[t]==null)return null;const a=i[t],c=i.theme,d=mr(c,r)||{};return at(i,a,f=>{let h=ir(d,s,f);return f===h&&typeof f=="string"&&(h=ir(d,s,`${t}${f==="default"?"":At(f)}`,f)),n===!1?h:{[n]:h}})};return o.propTypes=process.env.NODE_ENV!=="production"?{[t]:pt}:{},o.filterProps=[t],o}function v0(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const w0={m:"margin",p:"padding"},S0={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Ma={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},C0=v0(e=>{if(e.length>2)if(Ma[e])e=Ma[e];else return[e];const[t,n]=e.split(""),r=w0[t],s=S0[n]||"";return Array.isArray(s)?s.map(o=>r+o):[r+s]}),gr=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],pr=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],k0=[...gr,...pr];function Mn(e,t,n,r){const s=mr(e,t,!0)??n;return typeof s=="number"||typeof s=="string"?o=>typeof o=="string"?o:(process.env.NODE_ENV!=="production"&&typeof o!="number"&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${o}.`),typeof s=="string"?s.startsWith("var(")&&o===0?0:s.startsWith("var(")&&o===1?s:`calc(${o} * ${s})`:s*o):Array.isArray(s)?o=>{if(typeof o=="string")return o;const i=Math.abs(o);process.env.NODE_ENV!=="production"&&(Number.isInteger(i)?i>s.length-1&&console.error([`MUI: The value provided (${i}) overflows.`,`The supported values are: ${JSON.stringify(s)}.`,`${i} > ${s.length-1}, you need to add the missing values.`].join(`
46
46
  `)):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join(`
47
- `)));const a=r[i];return o>=0?a:typeof a=="number"?-a:typeof a=="string"&&a.startsWith("var(")?`calc(-1 * ${a})`:`-${a}`}:typeof r=="function"?r:(process.env.NODE_ENV!=="production"&&console.error([`MUI: The \`theme.${t}\` value (${r}) is invalid.`,"It should be a number, an array or a function."].join(`
48
- `)),()=>{})}function Co(e){return Mn(e,"spacing",8,"spacing")}function Pn(e,t){return typeof t=="string"||t==null?t:e(t)}function Tg(e,t){return n=>e.reduce((s,r)=>(s[r]=Pn(t,n),s),{})}function Eg(e,t,n,s){if(!t.includes(n))return null;const r=Cg(n),o=Tg(r,s),i=e[n];return at(e,i,o)}function ql(e,t){const n=Co(e.theme);return Object.keys(e).map(s=>Eg(e,t,s,n)).reduce(yn,{})}function Ce(e){return ql(e,ps)}Ce.propTypes=process.env.NODE_ENV!=="production"?ps.reduce((e,t)=>(e[t]=gt,e),{}):{};Ce.filterProps=ps;function ke(e){return ql(e,gs)}ke.propTypes=process.env.NODE_ENV!=="production"?gs.reduce((e,t)=>(e[t]=gt,e),{}):{};ke.filterProps=gs;process.env.NODE_ENV!=="production"&&kg.reduce((e,t)=>(e[t]=gt,e),{});function ys(...e){const t=e.reduce((s,r)=>(r.filterProps.forEach(o=>{s[o]=r}),s),{}),n=s=>Object.keys(s).reduce((r,o)=>t[o]?yn(r,t[o](s)):r,{});return n.propTypes=process.env.NODE_ENV!=="production"?e.reduce((s,r)=>Object.assign(s,r.propTypes),{}):{},n.filterProps=e.reduce((s,r)=>s.concat(r.filterProps),[]),n}function Be(e){return typeof e!="number"?e:`${e}px solid`}function Ue(e,t){return Ee({prop:e,themeKey:"borders",transform:t})}const Ag=Ue("border",Be),jg=Ue("borderTop",Be),Mg=Ue("borderRight",Be),Pg=Ue("borderBottom",Be),Vg=Ue("borderLeft",Be),Ng=Ue("borderColor"),Rg=Ue("borderTopColor"),Ig=Ue("borderRightColor"),Dg=Ue("borderBottomColor"),$g=Ue("borderLeftColor"),Fg=Ue("outline",Be),Og=Ue("outlineColor"),xs=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Mn(e.theme,"shape.borderRadius",4,"borderRadius"),n=s=>({borderRadius:Pn(t,s)});return at(e,e.borderRadius,n)}return null};xs.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:gt}:{};xs.filterProps=["borderRadius"];ys(Ag,jg,Mg,Pg,Vg,Ng,Rg,Ig,Dg,$g,xs,Fg,Og);const bs=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Mn(e.theme,"spacing",8,"gap"),n=s=>({gap:Pn(t,s)});return at(e,e.gap,n)}return null};bs.propTypes=process.env.NODE_ENV!=="production"?{gap:gt}:{};bs.filterProps=["gap"];const vs=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Mn(e.theme,"spacing",8,"columnGap"),n=s=>({columnGap:Pn(t,s)});return at(e,e.columnGap,n)}return null};vs.propTypes=process.env.NODE_ENV!=="production"?{columnGap:gt}:{};vs.filterProps=["columnGap"];const ws=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Mn(e.theme,"spacing",8,"rowGap"),n=s=>({rowGap:Pn(t,s)});return at(e,e.rowGap,n)}return null};ws.propTypes=process.env.NODE_ENV!=="production"?{rowGap:gt}:{};ws.filterProps=["rowGap"];const Lg=Ee({prop:"gridColumn"}),_g=Ee({prop:"gridRow"}),Bg=Ee({prop:"gridAutoFlow"}),zg=Ee({prop:"gridAutoColumns"}),Hg=Ee({prop:"gridAutoRows"}),Ug=Ee({prop:"gridTemplateColumns"}),Zg=Ee({prop:"gridTemplateRows"}),Wg=Ee({prop:"gridTemplateAreas"}),Gg=Ee({prop:"gridArea"});ys(bs,vs,ws,Lg,_g,Bg,zg,Hg,Ug,Zg,Wg,Gg);function Zt(e,t){return t==="grey"?t:e}const Kg=Ee({prop:"color",themeKey:"palette",transform:Zt}),Yg=Ee({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Zt}),qg=Ee({prop:"backgroundColor",themeKey:"palette",transform:Zt});ys(Kg,Yg,qg);function Fe(e){return e<=1&&e!==0?`${e*100}%`:e}const Xg=Ee({prop:"width",transform:Fe}),ko=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var r,o,i,a,c;const s=((i=(o=(r=e.theme)==null?void 0:r.breakpoints)==null?void 0:o.values)==null?void 0:i[n])||hs[n];return s?((c=(a=e.theme)==null?void 0:a.breakpoints)==null?void 0:c.unit)!=="px"?{maxWidth:`${s}${e.theme.breakpoints.unit}`}:{maxWidth:s}:{maxWidth:Fe(n)}};return at(e,e.maxWidth,t)}return null};ko.filterProps=["maxWidth"];const Jg=Ee({prop:"minWidth",transform:Fe}),Qg=Ee({prop:"height",transform:Fe}),ey=Ee({prop:"maxHeight",transform:Fe}),ty=Ee({prop:"minHeight",transform:Fe});Ee({prop:"size",cssProperty:"width",transform:Fe});Ee({prop:"size",cssProperty:"height",transform:Fe});const ny=Ee({prop:"boxSizing"});ys(Xg,ko,Jg,Qg,ey,ty,ny);const Ss={border:{themeKey:"borders",transform:Be},borderTop:{themeKey:"borders",transform:Be},borderRight:{themeKey:"borders",transform:Be},borderBottom:{themeKey:"borders",transform:Be},borderLeft:{themeKey:"borders",transform:Be},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Be},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:xs},color:{themeKey:"palette",transform:Zt},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Zt},backgroundColor:{themeKey:"palette",transform:Zt},p:{style:ke},pt:{style:ke},pr:{style:ke},pb:{style:ke},pl:{style:ke},px:{style:ke},py:{style:ke},padding:{style:ke},paddingTop:{style:ke},paddingRight:{style:ke},paddingBottom:{style:ke},paddingLeft:{style:ke},paddingX:{style:ke},paddingY:{style:ke},paddingInline:{style:ke},paddingInlineStart:{style:ke},paddingInlineEnd:{style:ke},paddingBlock:{style:ke},paddingBlockStart:{style:ke},paddingBlockEnd:{style:ke},m:{style:Ce},mt:{style:Ce},mr:{style:Ce},mb:{style:Ce},ml:{style:Ce},mx:{style:Ce},my:{style:Ce},margin:{style:Ce},marginTop:{style:Ce},marginRight:{style:Ce},marginBottom:{style:Ce},marginLeft:{style:Ce},marginX:{style:Ce},marginY:{style:Ce},marginInline:{style:Ce},marginInlineStart:{style:Ce},marginInlineEnd:{style:Ce},marginBlock:{style:Ce},marginBlockStart:{style:Ce},marginBlockEnd:{style:Ce},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:bs},rowGap:{style:ws},columnGap:{style:vs},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Fe},maxWidth:{style:ko},minWidth:{transform:Fe},height:{transform:Fe},maxHeight:{transform:Fe},minHeight:{transform:Fe},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function sy(...e){const t=e.reduce((s,r)=>s.concat(Object.keys(r)),[]),n=new Set(t);return e.every(s=>n.size===Object.keys(s).length)}function ry(e,t){return typeof e=="function"?e(t):e}function oy(){function e(n,s,r,o){const i={[n]:s,theme:r},a=o[n];if(!a)return{[n]:s};const{cssProperty:c=n,themeKey:d,transform:u,style:f}=a;if(s==null)return null;if(d==="typography"&&s==="inherit")return{[n]:s};const h=ms(r,d)||{};return f?f(i):at(i,s,x=>{let m=is(h,u,x);return x===m&&typeof x=="string"&&(m=is(h,u,`${n}${x==="default"?"":At(x)}`,x)),c===!1?m:{[c]:m}})}function t(n){const{sx:s,theme:r={},nested:o}=n||{};if(!s)return null;const i=r.unstable_sxConfig??Ss;function a(c){let d=c;if(typeof c=="function")d=c(r);else if(typeof c!="object")return c;if(!d)return null;const u=bg(r.breakpoints),f=Object.keys(u);let h=u;return Object.keys(d).forEach(g=>{const x=ry(d[g],r);if(x!=null)if(typeof x=="object")if(i[g])h=yn(h,e(g,x,r,i));else{const m=at({theme:r},x,b=>({[g]:b}));sy(m,x)?h[g]=t({sx:x,theme:r,nested:!0}):h=yn(h,m)}else h=yn(h,e(g,x,r,i))}),!o&&r.modularCssLayers?{"@layer sx":Ea(r,ja(f,h))}:Ea(r,ja(f,h))}return Array.isArray(s)?s.map(a):a(s)}return t}const Yt=oy();Yt.filterProps=["sx"];function iy(e){for(var t=0,n,s=0,r=e.length;r>=4;++s,r-=4)n=e.charCodeAt(s)&255|(e.charCodeAt(++s)&255)<<8|(e.charCodeAt(++s)&255)<<16|(e.charCodeAt(++s)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(r){case 3:t^=(e.charCodeAt(s+2)&255)<<16;case 2:t^=(e.charCodeAt(s+1)&255)<<8;case 1:t^=e.charCodeAt(s)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var ay={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function cy(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var ly=/[A-Z]|^ms/g,dy=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Xl=function(t){return t.charCodeAt(1)===45},Pa=function(t){return t!=null&&typeof t!="boolean"},Qs=cy(function(e){return Xl(e)?e:e.replace(ly,"-$&").toLowerCase()}),Va=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(dy,function(s,r,o){return dt={name:r,styles:o,next:dt},r})}return ay[t]!==1&&!Xl(t)&&typeof n=="number"&&n!==0?n+"px":n};function as(e,t,n){if(n==null)return"";var s=n;if(s.__emotion_styles!==void 0)return s;switch(typeof n){case"boolean":return"";case"object":{var r=n;if(r.anim===1)return dt={name:r.name,styles:r.styles,next:dt},r.name;var o=n;if(o.styles!==void 0){var i=o.next;if(i!==void 0)for(;i!==void 0;)dt={name:i.name,styles:i.styles,next:dt},i=i.next;var a=o.styles+";";return a}return uy(e,t,n)}}var c=n;return c}function uy(e,t,n){var s="";if(Array.isArray(n))for(var r=0;r<n.length;r++)s+=as(e,t,n[r])+";";else for(var o in n){var i=n[o];if(typeof i!="object"){var a=i;Pa(a)&&(s+=Qs(o)+":"+Va(o,a)+";")}else if(Array.isArray(i)&&typeof i[0]=="string"&&t==null)for(var c=0;c<i.length;c++)Pa(i[c])&&(s+=Qs(o)+":"+Va(o,i[c])+";");else{var d=as(e,t,i);switch(o){case"animation":case"animationName":{s+=Qs(o)+":"+d+";";break}default:s+=o+"{"+d+"}"}}}return s}var Na=/label:\s*([^\s;{]+)\s*(;|$)/g,dt;function fy(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var s=!0,r="";dt=void 0;var o=e[0];if(o==null||o.raw===void 0)s=!1,r+=as(n,t,o);else{var i=o;r+=i[0]}for(var a=1;a<e.length;a++)if(r+=as(n,t,e[a]),s){var c=o;r+=c[a]}Na.lastIndex=0;for(var d="",u;(u=Na.exec(r))!==null;)d+="-"+u[1];var f=iy(r)+d;return{name:f,styles:r,next:dt}}/**
47
+ `)));const a=s[i];return o>=0?a:typeof a=="number"?-a:typeof a=="string"&&a.startsWith("var(")?`calc(-1 * ${a})`:`-${a}`}:typeof s=="function"?s:(process.env.NODE_ENV!=="production"&&console.error([`MUI: The \`theme.${t}\` value (${s}) is invalid.`,"It should be a number, an array or a function."].join(`
48
+ `)),()=>{})}function Co(e){return Mn(e,"spacing",8,"spacing")}function Pn(e,t){return typeof t=="string"||t==null?t:e(t)}function E0(e,t){return n=>e.reduce((r,s)=>(r[s]=Pn(t,n),r),{})}function T0(e,t,n,r){if(!t.includes(n))return null;const s=C0(n),o=E0(s,r),i=e[n];return at(e,i,o)}function ql(e,t){const n=Co(e.theme);return Object.keys(e).map(r=>T0(e,t,r,n)).reduce(yn,{})}function Ce(e){return ql(e,gr)}Ce.propTypes=process.env.NODE_ENV!=="production"?gr.reduce((e,t)=>(e[t]=pt,e),{}):{};Ce.filterProps=gr;function ke(e){return ql(e,pr)}ke.propTypes=process.env.NODE_ENV!=="production"?pr.reduce((e,t)=>(e[t]=pt,e),{}):{};ke.filterProps=pr;process.env.NODE_ENV!=="production"&&k0.reduce((e,t)=>(e[t]=pt,e),{});function yr(...e){const t=e.reduce((r,s)=>(s.filterProps.forEach(o=>{r[o]=s}),r),{}),n=r=>Object.keys(r).reduce((s,o)=>t[o]?yn(s,t[o](r)):s,{});return n.propTypes=process.env.NODE_ENV!=="production"?e.reduce((r,s)=>Object.assign(r,s.propTypes),{}):{},n.filterProps=e.reduce((r,s)=>r.concat(s.filterProps),[]),n}function Be(e){return typeof e!="number"?e:`${e}px solid`}function He(e,t){return Te({prop:e,themeKey:"borders",transform:t})}const A0=He("border",Be),j0=He("borderTop",Be),M0=He("borderRight",Be),P0=He("borderBottom",Be),V0=He("borderLeft",Be),N0=He("borderColor"),R0=He("borderTopColor"),I0=He("borderRightColor"),D0=He("borderBottomColor"),$0=He("borderLeftColor"),F0=He("outline",Be),O0=He("outlineColor"),xr=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Mn(e.theme,"shape.borderRadius",4,"borderRadius"),n=r=>({borderRadius:Pn(t,r)});return at(e,e.borderRadius,n)}return null};xr.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:pt}:{};xr.filterProps=["borderRadius"];yr(A0,j0,M0,P0,V0,N0,R0,I0,D0,$0,xr,F0,O0);const br=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Mn(e.theme,"spacing",8,"gap"),n=r=>({gap:Pn(t,r)});return at(e,e.gap,n)}return null};br.propTypes=process.env.NODE_ENV!=="production"?{gap:pt}:{};br.filterProps=["gap"];const vr=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Mn(e.theme,"spacing",8,"columnGap"),n=r=>({columnGap:Pn(t,r)});return at(e,e.columnGap,n)}return null};vr.propTypes=process.env.NODE_ENV!=="production"?{columnGap:pt}:{};vr.filterProps=["columnGap"];const wr=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Mn(e.theme,"spacing",8,"rowGap"),n=r=>({rowGap:Pn(t,r)});return at(e,e.rowGap,n)}return null};wr.propTypes=process.env.NODE_ENV!=="production"?{rowGap:pt}:{};wr.filterProps=["rowGap"];const L0=Te({prop:"gridColumn"}),_0=Te({prop:"gridRow"}),B0=Te({prop:"gridAutoFlow"}),z0=Te({prop:"gridAutoColumns"}),U0=Te({prop:"gridAutoRows"}),H0=Te({prop:"gridTemplateColumns"}),Z0=Te({prop:"gridTemplateRows"}),W0=Te({prop:"gridTemplateAreas"}),G0=Te({prop:"gridArea"});yr(br,vr,wr,L0,_0,B0,z0,U0,H0,Z0,W0,G0);function Zt(e,t){return t==="grey"?t:e}const K0=Te({prop:"color",themeKey:"palette",transform:Zt}),Y0=Te({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Zt}),q0=Te({prop:"backgroundColor",themeKey:"palette",transform:Zt});yr(K0,Y0,q0);function Fe(e){return e<=1&&e!==0?`${e*100}%`:e}const X0=Te({prop:"width",transform:Fe}),ko=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var s,o,i,a,c;const r=((i=(o=(s=e.theme)==null?void 0:s.breakpoints)==null?void 0:o.values)==null?void 0:i[n])||hr[n];return r?((c=(a=e.theme)==null?void 0:a.breakpoints)==null?void 0:c.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Fe(n)}};return at(e,e.maxWidth,t)}return null};ko.filterProps=["maxWidth"];const J0=Te({prop:"minWidth",transform:Fe}),Q0=Te({prop:"height",transform:Fe}),e1=Te({prop:"maxHeight",transform:Fe}),t1=Te({prop:"minHeight",transform:Fe});Te({prop:"size",cssProperty:"width",transform:Fe});Te({prop:"size",cssProperty:"height",transform:Fe});const n1=Te({prop:"boxSizing"});yr(X0,ko,J0,Q0,e1,t1,n1);const Sr={border:{themeKey:"borders",transform:Be},borderTop:{themeKey:"borders",transform:Be},borderRight:{themeKey:"borders",transform:Be},borderBottom:{themeKey:"borders",transform:Be},borderLeft:{themeKey:"borders",transform:Be},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Be},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:xr},color:{themeKey:"palette",transform:Zt},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Zt},backgroundColor:{themeKey:"palette",transform:Zt},p:{style:ke},pt:{style:ke},pr:{style:ke},pb:{style:ke},pl:{style:ke},px:{style:ke},py:{style:ke},padding:{style:ke},paddingTop:{style:ke},paddingRight:{style:ke},paddingBottom:{style:ke},paddingLeft:{style:ke},paddingX:{style:ke},paddingY:{style:ke},paddingInline:{style:ke},paddingInlineStart:{style:ke},paddingInlineEnd:{style:ke},paddingBlock:{style:ke},paddingBlockStart:{style:ke},paddingBlockEnd:{style:ke},m:{style:Ce},mt:{style:Ce},mr:{style:Ce},mb:{style:Ce},ml:{style:Ce},mx:{style:Ce},my:{style:Ce},margin:{style:Ce},marginTop:{style:Ce},marginRight:{style:Ce},marginBottom:{style:Ce},marginLeft:{style:Ce},marginX:{style:Ce},marginY:{style:Ce},marginInline:{style:Ce},marginInlineStart:{style:Ce},marginInlineEnd:{style:Ce},marginBlock:{style:Ce},marginBlockStart:{style:Ce},marginBlockEnd:{style:Ce},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:br},rowGap:{style:wr},columnGap:{style:vr},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Fe},maxWidth:{style:ko},minWidth:{transform:Fe},height:{transform:Fe},maxHeight:{transform:Fe},minHeight:{transform:Fe},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function r1(...e){const t=e.reduce((r,s)=>r.concat(Object.keys(s)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function s1(e,t){return typeof e=="function"?e(t):e}function o1(){function e(n,r,s,o){const i={[n]:r,theme:s},a=o[n];if(!a)return{[n]:r};const{cssProperty:c=n,themeKey:d,transform:u,style:f}=a;if(r==null)return null;if(d==="typography"&&r==="inherit")return{[n]:r};const h=mr(s,d)||{};return f?f(i):at(i,r,x=>{let m=ir(h,u,x);return x===m&&typeof x=="string"&&(m=ir(h,u,`${n}${x==="default"?"":At(x)}`,x)),c===!1?m:{[c]:m}})}function t(n){const{sx:r,theme:s={},nested:o}=n||{};if(!r)return null;const i=s.unstable_sxConfig??Sr;function a(c){let d=c;if(typeof c=="function")d=c(s);else if(typeof c!="object")return c;if(!d)return null;const u=b0(s.breakpoints),f=Object.keys(u);let h=u;return Object.keys(d).forEach(p=>{const x=s1(d[p],s);if(x!=null)if(typeof x=="object")if(i[p])h=yn(h,e(p,x,s,i));else{const m=at({theme:s},x,b=>({[p]:b}));r1(m,x)?h[p]=t({sx:x,theme:s,nested:!0}):h=yn(h,m)}else h=yn(h,e(p,x,s,i))}),!o&&s.modularCssLayers?{"@layer sx":Ta(s,ja(f,h))}:Ta(s,ja(f,h))}return Array.isArray(r)?r.map(a):a(r)}return t}const Yt=o1();Yt.filterProps=["sx"];function i1(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var a1={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function c1(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var l1=/[A-Z]|^ms/g,d1=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Xl=function(t){return t.charCodeAt(1)===45},Pa=function(t){return t!=null&&typeof t!="boolean"},Qr=c1(function(e){return Xl(e)?e:e.replace(l1,"-$&").toLowerCase()}),Va=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(d1,function(r,s,o){return dt={name:s,styles:o,next:dt},s})}return a1[t]!==1&&!Xl(t)&&typeof n=="number"&&n!==0?n+"px":n};function ar(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return dt={name:s.name,styles:s.styles,next:dt},s.name;var o=n;if(o.styles!==void 0){var i=o.next;if(i!==void 0)for(;i!==void 0;)dt={name:i.name,styles:i.styles,next:dt},i=i.next;var a=o.styles+";";return a}return u1(e,t,n)}}var c=n;return c}function u1(e,t,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=ar(e,t,n[s])+";";else for(var o in n){var i=n[o];if(typeof i!="object"){var a=i;Pa(a)&&(r+=Qr(o)+":"+Va(o,a)+";")}else if(Array.isArray(i)&&typeof i[0]=="string"&&t==null)for(var c=0;c<i.length;c++)Pa(i[c])&&(r+=Qr(o)+":"+Va(o,i[c])+";");else{var d=ar(e,t,i);switch(o){case"animation":case"animationName":{r+=Qr(o)+":"+d+";";break}default:r+=o+"{"+d+"}"}}}return r}var Na=/label:\s*([^\s;{]+)\s*(;|$)/g,dt;function f1(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,s="";dt=void 0;var o=e[0];if(o==null||o.raw===void 0)r=!1,s+=ar(n,t,o);else{var i=o;s+=i[0]}for(var a=1;a<e.length;a++)if(s+=ar(n,t,e[a]),r){var c=o;s+=c[a]}Na.lastIndex=0;for(var d="",u;(u=Na.exec(s))!==null;)d+="-"+u[1];var f=i1(s)+d;return{name:f,styles:s,next:dt}}/**
49
49
  * @mui/styled-engine v7.2.0
50
50
  *
51
51
  * @license MIT
52
52
  * This source code is licensed under the MIT license found in the
53
53
  * LICENSE file in the root directory of this source tree.
54
- */function hy(e,t){const n=zd(e,t);return process.env.NODE_ENV!=="production"?(...s)=>{const r=typeof e=="string"?`"${e}"`:"component";return s.length===0?console.error([`MUI: Seems like you called \`styled(${r})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
55
- `)):s.some(o=>o===void 0)&&console.error(`MUI: the styled(${r})(...args) API requires all its args to be defined.`),n(...s)}:n}function my(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Ra=[];function Tt(e){return Ra[0]=e,fy(Ra)}const py=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,s)=>n.val-s.val),t.reduce((n,s)=>({...n,[s.key]:s.val}),{})};function gy(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:s=5,...r}=e,o=py(t),i=Object.keys(o);function a(h){return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n})`}function c(h){return`@media (max-width:${(typeof t[h]=="number"?t[h]:h)-s/100}${n})`}function d(h,g){const x=i.indexOf(g);return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n}) and (max-width:${(x!==-1&&typeof t[i[x]]=="number"?t[i[x]]:g)-s/100}${n})`}function u(h){return i.indexOf(h)+1<i.length?d(h,i[i.indexOf(h)+1]):a(h)}function f(h){const g=i.indexOf(h);return g===0?a(i[1]):g===i.length-1?c(i[g]):d(h,i[i.indexOf(h)+1]).replace("@media","@media not all and")}return{keys:i,values:o,up:a,down:c,between:d,only:u,not:f,unit:n,...r}}const yy={borderRadius:4};function Jl(e=8,t=Co({spacing:e})){if(e.mui)return e;const n=(...s)=>(process.env.NODE_ENV!=="production"&&(s.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${s.length}`)),(s.length===0?[1]:s).map(o=>{const i=t(o);return typeof i=="number"?`${i}px`:i}).join(" "));return n.mui=!0,n}function xy(e,t){var s;const n=this;if(n.vars){if(!((s=n.colorSchemes)!=null&&s[e])||typeof n.getColorSchemeSelector!="function")return{};let r=n.getColorSchemeSelector(e);return r==="&"?t:((r.includes("data-")||r.includes("."))&&(r=`*:where(${r.replace(/\s*&$/,"")}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function Ql(e={},...t){const{breakpoints:n={},palette:s={},spacing:r,shape:o={},...i}=e,a=gy(n),c=Jl(r);let d=Oe({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...s},spacing:c,shape:{...yy,...o}},i);return d=yg(d),d.applyStyles=xy,d=t.reduce((u,f)=>Oe(u,f),d),d.unstable_sxConfig={...Ss,...i==null?void 0:i.unstable_sxConfig},d.unstable_sx=function(f){return Yt({sx:f,theme:this})},d}const by={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function To(e,t,n="Mui"){const s=by[t];return s?`${n}-${s}`:`${tg.generate(e)}-${t}`}function vy(e,t,n="Mui"){const s={};return t.forEach(r=>{s[r]=To(e,r,n)}),s}function ed(e,t=""){return e.displayName||e.name||t}function Ia(e,t,n){const s=ed(t);return e.displayName||(s!==""?`${n}(${s})`:n)}function wy(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return ed(e,"Component");if(typeof e=="object")switch(e.$$typeof){case os.ForwardRef:return Ia(e,e.render,"ForwardRef");case os.Memo:return Ia(e,e.type,"memo");default:return}}}function td(e){const{variants:t,...n}=e,s={variants:t,style:Tt(n),isProcessed:!0};return s.style===n||t&&t.forEach(r=>{typeof r.style!="function"&&(r.style=Tt(r.style))}),s}const Sy=Ql();function er(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function St(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function Cy(e){return e?(t,n)=>n[e]:null}function ky(e,t,n){e.theme=jy(e.theme)?n:e.theme[t]||e.theme}function Xn(e,t,n){const s=typeof t=="function"?t(e):t;if(Array.isArray(s))return s.flatMap(r=>Xn(e,r,n));if(Array.isArray(s==null?void 0:s.variants)){let r;if(s.isProcessed)r=n?St(s.style,n):s.style;else{const{variants:o,...i}=s;r=n?St(Tt(i),n):i}return nd(e,s.variants,[r],n)}return s!=null&&s.isProcessed?n?St(Tt(s.style),n):s.style:n?St(Tt(s),n):s}function nd(e,t,n=[],s=void 0){var o;let r;e:for(let i=0;i<t.length;i+=1){const a=t[i];if(typeof a.props=="function"){if(r??(r={...e,...e.ownerState,ownerState:e.ownerState}),!a.props(r))continue}else for(const c in a.props)if(e[c]!==a.props[c]&&((o=e.ownerState)==null?void 0:o[c])!==a.props[c])continue e;typeof a.style=="function"?(r??(r={...e,...e.ownerState,ownerState:e.ownerState}),n.push(s?St(Tt(a.style(r)),s):a.style(r))):n.push(s?St(Tt(a.style),s):a.style)}return n}function Ty(e={}){const{themeId:t,defaultTheme:n=Sy,rootShouldForwardProp:s=er,slotShouldForwardProp:r=er}=e;function o(a){ky(a,t,n)}return(a,c={})=>{my(a,A=>A.filter(M=>M!==Yt));const{name:d,slot:u,skipVariantsResolver:f,skipSx:h,overridesResolver:g=Cy(sd(u)),...x}=c,m=d&&d.startsWith("Mui")||u?"components":"custom",b=f!==void 0?f:u&&u!=="Root"&&u!=="root"||!1,k=h||!1;let v=er;u==="Root"||u==="root"?v=s:u?v=r:My(a)&&(v=void 0);const T=hy(a,{shouldForwardProp:v,label:Ay(d,u),...x}),w=A=>{if(A.__emotion_real===A)return A;if(typeof A=="function")return function(j){return Xn(j,A,j.theme.modularCssLayers?m:void 0)};if(st(A)){const M=td(A);return function(z){return M.variants?Xn(z,M,z.theme.modularCssLayers?m:void 0):z.theme.modularCssLayers?St(M.style,m):M.style}}return A},S=(...A)=>{const M=[],j=A.map(w),z=[];if(M.push(o),d&&g&&z.push(function(J){var K,R;const ee=(R=(K=J.theme.components)==null?void 0:K[d])==null?void 0:R.styleOverrides;if(!ee)return null;const se={};for(const X in ee)se[X]=Xn(J,ee[X],J.theme.modularCssLayers?"theme":void 0);return g(J,se)}),d&&!b&&z.push(function(J){var se,K;const te=J.theme,ee=(K=(se=te==null?void 0:te.components)==null?void 0:se[d])==null?void 0:K.variants;return ee?nd(J,ee,[],J.theme.modularCssLayers?"theme":void 0):null}),k||z.push(Yt),Array.isArray(j[0])){const _=j.shift(),J=new Array(M.length).fill(""),te=new Array(z.length).fill("");let ee;ee=[...J,..._,...te],ee.raw=[...J,..._.raw,...te],M.unshift(ee)}const y=[...M,...j,...z],D=T(...y);return a.muiName&&(D.muiName=a.muiName),process.env.NODE_ENV!=="production"&&(D.displayName=Ey(d,u,a)),D};return T.withConfig&&(S.withConfig=T.withConfig),S}}function Ey(e,t,n){return e?`${e}${At(t||"")}`:`Styled(${wy(n)})`}function Ay(e,t){let n;return process.env.NODE_ENV!=="production"&&e&&(n=`${e}-${sd(t||"Root")}`),n}function jy(e){for(const t in e)return!1;return!0}function My(e){return typeof e=="string"&&e.charCodeAt(0)>96}function sd(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Pr(e,t,n=!1){const s={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const o=r;if(o==="components"||o==="slots")s[o]={...e[o],...s[o]};else if(o==="componentsProps"||o==="slotProps"){const i=e[o],a=t[o];if(!a)s[o]=i||{};else if(!i)s[o]=a;else{s[o]={...a};for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c)){const d=c;s[o][d]=Pr(i[d],a[d],n)}}}else o==="className"&&n&&t.className?s.className=$r(e==null?void 0:e.className,t==null?void 0:t.className):o==="style"&&n&&t.style?s.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:s[o]===void 0&&(s[o]=e[o])}return s}function Py(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Eo(e,t=0,n=1){return process.env.NODE_ENV!=="production"&&(e<t||e>n)&&console.error(`MUI: The value provided ${e} is out of range [${t}, ${n}].`),Py(e,t,n)}function Vy(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(s=>s+s)),process.env.NODE_ENV!=="production"&&e.length!==e.trim().length&&console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`),n?`rgb${n.length===4?"a":""}(${n.map((s,r)=>r<3?parseInt(s,16):Math.round(parseInt(s,16)/255*1e3)/1e3).join(", ")})`:""}function mt(e){if(e.type)return e;if(e.charAt(0)==="#")return mt(Vy(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(process.env.NODE_ENV!=="production"?`MUI: Unsupported \`${e}\` color.
56
- The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:ht(9,e));let s=e.substring(t+1,e.length-1),r;if(n==="color"){if(s=s.split(" "),r=s.shift(),s.length===4&&s[3].charAt(0)==="/"&&(s[3]=s[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(r))throw new Error(process.env.NODE_ENV!=="production"?`MUI: unsupported \`${r}\` color space.
57
- The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:ht(10,r))}else s=s.split(",");return s=s.map(o=>parseFloat(o)),{type:n,values:s,colorSpace:r}}const Ny=e=>{const t=mt(e);return t.values.slice(0,3).map((n,s)=>t.type.includes("hsl")&&s!==0?`${n}%`:n).join(" ")},dn=(e,t)=>{try{return Ny(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Cs(e){const{type:t,colorSpace:n}=e;let{values:s}=e;return t.includes("rgb")?s=s.map((r,o)=>o<3?parseInt(r,10):r):t.includes("hsl")&&(s[1]=`${s[1]}%`,s[2]=`${s[2]}%`),t.includes("color")?s=`${n} ${s.join(" ")}`:s=`${s.join(", ")}`,`${t}(${s})`}function rd(e){e=mt(e);const{values:t}=e,n=t[0],s=t[1]/100,r=t[2]/100,o=s*Math.min(r,1-r),i=(d,u=(d+n/30)%12)=>r-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const c=[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)];return e.type==="hsla"&&(a+="a",c.push(t[3])),Cs({type:a,values:c})}function Vr(e){e=mt(e);let t=e.type==="hsl"||e.type==="hsla"?mt(rd(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Da(e,t){const n=Vr(e),s=Vr(t);return(Math.max(n,s)+.05)/(Math.min(n,s)+.05)}function Ry(e,t){return e=mt(e),t=Eo(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Cs(e)}function Un(e,t,n){try{return Ry(e,t)}catch{return e}}function Ao(e,t){if(e=mt(e),t=Eo(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return Cs(e)}function me(e,t,n){try{return Ao(e,t)}catch{return e}}function jo(e,t){if(e=mt(e),t=Eo(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return Cs(e)}function pe(e,t,n){try{return jo(e,t)}catch{return e}}function Iy(e,t=.15){return Vr(e)>.5?Ao(e,t):jo(e,t)}function Zn(e,t,n){try{return Iy(e,t)}catch{return e}}const Dy=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(ce.node,ce.object);function $y(e){const{theme:t,name:n,props:s}=e;if(!t||!t.components||!t.components[n])return s;const r=t.components[n];return r.defaultProps?Pr(r.defaultProps,s,t.components.mergeClassNameAndStyle):!r.styleOverrides&&!r.variants?Pr(r,s,t.components.mergeClassNameAndStyle):s}function Fy({props:e,name:t}){const n=p.useContext(Dy);return $y({props:e,name:t,theme:{components:n}})}const $a={theme:void 0};function Oy(e){let t,n;return function(r){let o=t;return(o===void 0||r.theme!==n)&&($a.theme=r.theme,o=td(e($a)),t=o,n=r.theme),o}}function Ly(e=""){function t(...s){if(!s.length)return"";const r=s[0];return typeof r=="string"&&!r.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${r}${t(...s.slice(1))})`:`, ${r}`}return(s,...r)=>`var(--${e?`${e}-`:""}${s}${t(...r)})`}const Fa=(e,t,n,s=[])=>{let r=e;t.forEach((o,i)=>{i===t.length-1?Array.isArray(r)?r[Number(o)]=n:r&&typeof r=="object"&&(r[o]=n):r&&typeof r=="object"&&(r[o]||(r[o]=s.includes(o)?[]:{}),r=r[o])})},_y=(e,t,n)=>{function s(r,o=[],i=[]){Object.entries(r).forEach(([a,c])=>{(!n||n&&!n([...o,a]))&&c!=null&&(typeof c=="object"&&Object.keys(c).length>0?s(c,[...o,a],Array.isArray(c)?[...i,a]:i):t([...o,a],c,i))})}s(e)},By=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(s=>e.includes(s))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function tr(e,t){const{prefix:n,shouldSkipGeneratingVar:s}=t||{},r={},o={},i={};return _y(e,(a,c,d)=>{if((typeof c=="string"||typeof c=="number")&&(!s||!s(a,c))){const u=`--${n?`${n}-`:""}${a.join("-")}`,f=By(a,c);Object.assign(r,{[u]:f}),Fa(o,a,`var(${u})`,d),Fa(i,a,`var(${u}, ${f})`,d)}},a=>a[0]==="vars"),{css:r,vars:o,varsWithDefaults:i}}function zy(e,t={}){const{getSelector:n=b,disableCssColorScheme:s,colorSchemeSelector:r}=t,{colorSchemes:o={},components:i,defaultColorScheme:a="light",...c}=e,{vars:d,css:u,varsWithDefaults:f}=tr(c,t);let h=f;const g={},{[a]:x,...m}=o;if(Object.entries(m||{}).forEach(([T,w])=>{const{vars:S,css:A,varsWithDefaults:M}=tr(w,t);h=Oe(h,M),g[T]={css:A,vars:S}}),x){const{css:T,vars:w,varsWithDefaults:S}=tr(x,t);h=Oe(h,S),g[a]={css:T,vars:w}}function b(T,w){var A,M;let S=r;if(r==="class"&&(S=".%s"),r==="data"&&(S="[data-%s]"),r!=null&&r.startsWith("data-")&&!r.includes("%s")&&(S=`[${r}="%s"]`),T){if(S==="media")return e.defaultColorScheme===T?":root":{[`@media (prefers-color-scheme: ${((M=(A=o[T])==null?void 0:A.palette)==null?void 0:M.mode)||T})`]:{":root":w}};if(S)return e.defaultColorScheme===T?`:root, ${S.replace("%s",String(T))}`:S.replace("%s",String(T))}return":root"}return{vars:h,generateThemeVars:()=>{let T={...d};return Object.entries(g).forEach(([,{vars:w}])=>{T=Oe(T,w)}),T},generateStyleSheets:()=>{var j,z;const T=[],w=e.defaultColorScheme||"light";function S(y,D){Object.keys(D).length&&T.push(typeof y=="string"?{[y]:{...D}}:y)}S(n(void 0,{...u}),u);const{[w]:A,...M}=g;if(A){const{css:y}=A,D=(z=(j=o[w])==null?void 0:j.palette)==null?void 0:z.mode,_=!s&&D?{colorScheme:D,...y}:{...y};S(n(w,{..._}),_)}return Object.entries(M).forEach(([y,{css:D}])=>{var te,ee;const _=(ee=(te=o[y])==null?void 0:te.palette)==null?void 0:ee.mode,J=!s&&_?{colorScheme:_,...D}:{...D};S(n(y,{...J}),J)}),T}}}function Hy(e){return function(n){return e==="media"?(process.env.NODE_ENV!=="production"&&n!=="light"&&n!=="dark"&&console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${n}'.`),`@media (prefers-color-scheme: ${n})`):e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const kn={black:"#000",white:"#fff"},Uy={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Vt={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Nt={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},cn={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Rt={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},It={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Dt={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function od(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:kn.white,default:kn.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const Zy=od();function id(){return{text:{primary:kn.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:kn.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const Oa=id();function La(e,t,n,s){const r=s.light||s,o=s.dark||s*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=jo(e.main,r):t==="dark"&&(e.dark=Ao(e.main,o)))}function Wy(e="light"){return e==="dark"?{main:Rt[200],light:Rt[50],dark:Rt[400]}:{main:Rt[700],light:Rt[400],dark:Rt[800]}}function Gy(e="light"){return e==="dark"?{main:Vt[200],light:Vt[50],dark:Vt[400]}:{main:Vt[500],light:Vt[300],dark:Vt[700]}}function Ky(e="light"){return e==="dark"?{main:Nt[500],light:Nt[300],dark:Nt[700]}:{main:Nt[700],light:Nt[400],dark:Nt[800]}}function Yy(e="light"){return e==="dark"?{main:It[400],light:It[300],dark:It[700]}:{main:It[700],light:It[500],dark:It[900]}}function qy(e="light"){return e==="dark"?{main:Dt[400],light:Dt[300],dark:Dt[700]}:{main:Dt[800],light:Dt[500],dark:Dt[900]}}function Xy(e="light"){return e==="dark"?{main:cn[400],light:cn[300],dark:cn[700]}:{main:"#ed6c02",light:cn[500],dark:cn[900]}}function Mo(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:s=.2,...r}=e,o=e.primary||Wy(t),i=e.secondary||Gy(t),a=e.error||Ky(t),c=e.info||Yy(t),d=e.success||qy(t),u=e.warning||Xy(t);function f(m){const b=Da(m,Oa.text.primary)>=n?Oa.text.primary:Zy.text.primary;if(process.env.NODE_ENV!=="production"){const k=Da(m,b);k<3&&console.error([`MUI: The contrast ratio of ${k}:1 for ${b} on ${m}`,"falls below the WCAG recommended absolute minimum contrast ratio of 3:1.","https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join(`
58
- `))}return b}const h=({color:m,name:b,mainShade:k=500,lightShade:v=300,darkShade:T=700})=>{if(m={...m},!m.main&&m[k]&&(m.main=m[k]),!m.hasOwnProperty("main"))throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${b?` (${b})`:""} provided to augmentColor(color) is invalid.
54
+ */function h1(e,t){const n=zd(e,t);return process.env.NODE_ENV!=="production"?(...r)=>{const s=typeof e=="string"?`"${e}"`:"component";return r.length===0?console.error([`MUI: Seems like you called \`styled(${s})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
55
+ `)):r.some(o=>o===void 0)&&console.error(`MUI: the styled(${s})(...args) API requires all its args to be defined.`),n(...r)}:n}function m1(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Ra=[];function Et(e){return Ra[0]=e,f1(Ra)}const g1=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function p1(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...s}=e,o=g1(t),i=Object.keys(o);function a(h){return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n})`}function c(h){return`@media (max-width:${(typeof t[h]=="number"?t[h]:h)-r/100}${n})`}function d(h,p){const x=i.indexOf(p);return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n}) and (max-width:${(x!==-1&&typeof t[i[x]]=="number"?t[i[x]]:p)-r/100}${n})`}function u(h){return i.indexOf(h)+1<i.length?d(h,i[i.indexOf(h)+1]):a(h)}function f(h){const p=i.indexOf(h);return p===0?a(i[1]):p===i.length-1?c(i[p]):d(h,i[i.indexOf(h)+1]).replace("@media","@media not all and")}return{keys:i,values:o,up:a,down:c,between:d,only:u,not:f,unit:n,...s}}const y1={borderRadius:4};function Jl(e=8,t=Co({spacing:e})){if(e.mui)return e;const n=(...r)=>(process.env.NODE_ENV!=="production"&&(r.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${r.length}`)),(r.length===0?[1]:r).map(o=>{const i=t(o);return typeof i=="number"?`${i}px`:i}).join(" "));return n.mui=!0,n}function x1(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let s=n.getColorSchemeSelector(e);return s==="&"?t:((s.includes("data-")||s.includes("."))&&(s=`*:where(${s.replace(/\s*&$/,"")}) &`),{[s]:t})}return n.palette.mode===e?t:{}}function Ql(e={},...t){const{breakpoints:n={},palette:r={},spacing:s,shape:o={},...i}=e,a=p1(n),c=Jl(s);let d=Oe({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:c,shape:{...y1,...o}},i);return d=y0(d),d.applyStyles=x1,d=t.reduce((u,f)=>Oe(u,f),d),d.unstable_sxConfig={...Sr,...i==null?void 0:i.unstable_sxConfig},d.unstable_sx=function(f){return Yt({sx:f,theme:this})},d}const b1={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Eo(e,t,n="Mui"){const r=b1[t];return r?`${n}-${r}`:`${t0.generate(e)}-${t}`}function v1(e,t,n="Mui"){const r={};return t.forEach(s=>{r[s]=Eo(e,s,n)}),r}function ed(e,t=""){return e.displayName||e.name||t}function Ia(e,t,n){const r=ed(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function w1(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return ed(e,"Component");if(typeof e=="object")switch(e.$$typeof){case or.ForwardRef:return Ia(e,e.render,"ForwardRef");case or.Memo:return Ia(e,e.type,"memo");default:return}}}function td(e){const{variants:t,...n}=e,r={variants:t,style:Et(n),isProcessed:!0};return r.style===n||t&&t.forEach(s=>{typeof s.style!="function"&&(s.style=Et(s.style))}),r}const S1=Ql();function es(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function St(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function C1(e){return e?(t,n)=>n[e]:null}function k1(e,t,n){e.theme=j1(e.theme)?n:e.theme[t]||e.theme}function Xn(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(s=>Xn(e,s,n));if(Array.isArray(r==null?void 0:r.variants)){let s;if(r.isProcessed)s=n?St(r.style,n):r.style;else{const{variants:o,...i}=r;s=n?St(Et(i),n):i}return nd(e,r.variants,[s],n)}return r!=null&&r.isProcessed?n?St(Et(r.style),n):r.style:n?St(Et(r),n):r}function nd(e,t,n=[],r=void 0){var o;let s;e:for(let i=0;i<t.length;i+=1){const a=t[i];if(typeof a.props=="function"){if(s??(s={...e,...e.ownerState,ownerState:e.ownerState}),!a.props(s))continue}else for(const c in a.props)if(e[c]!==a.props[c]&&((o=e.ownerState)==null?void 0:o[c])!==a.props[c])continue e;typeof a.style=="function"?(s??(s={...e,...e.ownerState,ownerState:e.ownerState}),n.push(r?St(Et(a.style(s)),r):a.style(s))):n.push(r?St(Et(a.style),r):a.style)}return n}function E1(e={}){const{themeId:t,defaultTheme:n=S1,rootShouldForwardProp:r=es,slotShouldForwardProp:s=es}=e;function o(a){k1(a,t,n)}return(a,c={})=>{m1(a,A=>A.filter(M=>M!==Yt));const{name:d,slot:u,skipVariantsResolver:f,skipSx:h,overridesResolver:p=C1(rd(u)),...x}=c,m=d&&d.startsWith("Mui")||u?"components":"custom",b=f!==void 0?f:u&&u!=="Root"&&u!=="root"||!1,k=h||!1;let v=es;u==="Root"||u==="root"?v=r:u?v=s:M1(a)&&(v=void 0);const E=h1(a,{shouldForwardProp:v,label:A1(d,u),...x}),w=A=>{if(A.__emotion_real===A)return A;if(typeof A=="function")return function(j){return Xn(j,A,j.theme.modularCssLayers?m:void 0)};if(rt(A)){const M=td(A);return function(z){return M.variants?Xn(z,M,z.theme.modularCssLayers?m:void 0):z.theme.modularCssLayers?St(M.style,m):M.style}}return A},S=(...A)=>{const M=[],j=A.map(w),z=[];if(M.push(o),d&&p&&z.push(function(J){var K,R;const ee=(R=(K=J.theme.components)==null?void 0:K[d])==null?void 0:R.styleOverrides;if(!ee)return null;const re={};for(const X in ee)re[X]=Xn(J,ee[X],J.theme.modularCssLayers?"theme":void 0);return p(J,re)}),d&&!b&&z.push(function(J){var re,K;const te=J.theme,ee=(K=(re=te==null?void 0:te.components)==null?void 0:re[d])==null?void 0:K.variants;return ee?nd(J,ee,[],J.theme.modularCssLayers?"theme":void 0):null}),k||z.push(Yt),Array.isArray(j[0])){const _=j.shift(),J=new Array(M.length).fill(""),te=new Array(z.length).fill("");let ee;ee=[...J,..._,...te],ee.raw=[...J,..._.raw,...te],M.unshift(ee)}const y=[...M,...j,...z],D=E(...y);return a.muiName&&(D.muiName=a.muiName),process.env.NODE_ENV!=="production"&&(D.displayName=T1(d,u,a)),D};return E.withConfig&&(S.withConfig=E.withConfig),S}}function T1(e,t,n){return e?`${e}${At(t||"")}`:`Styled(${w1(n)})`}function A1(e,t){let n;return process.env.NODE_ENV!=="production"&&e&&(n=`${e}-${rd(t||"Root")}`),n}function j1(e){for(const t in e)return!1;return!0}function M1(e){return typeof e=="string"&&e.charCodeAt(0)>96}function rd(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Ps(e,t,n=!1){const r={...t};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const o=s;if(o==="components"||o==="slots")r[o]={...e[o],...r[o]};else if(o==="componentsProps"||o==="slotProps"){const i=e[o],a=t[o];if(!a)r[o]=i||{};else if(!i)r[o]=a;else{r[o]={...a};for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c)){const d=c;r[o][d]=Ps(i[d],a[d],n)}}}else o==="className"&&n&&t.className?r.className=$s(e==null?void 0:e.className,t==null?void 0:t.className):o==="style"&&n&&t.style?r.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:r[o]===void 0&&(r[o]=e[o])}return r}function P1(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function To(e,t=0,n=1){return process.env.NODE_ENV!=="production"&&(e<t||e>n)&&console.error(`MUI: The value provided ${e} is out of range [${t}, ${n}].`),P1(e,t,n)}function V1(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),process.env.NODE_ENV!=="production"&&e.length!==e.trim().length&&console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`),n?`rgb${n.length===4?"a":""}(${n.map((r,s)=>s<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function mt(e){if(e.type)return e;if(e.charAt(0)==="#")return mt(V1(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(process.env.NODE_ENV!=="production"?`MUI: Unsupported \`${e}\` color.
56
+ The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:ht(9,e));let r=e.substring(t+1,e.length-1),s;if(n==="color"){if(r=r.split(" "),s=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(s))throw new Error(process.env.NODE_ENV!=="production"?`MUI: unsupported \`${s}\` color space.
57
+ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:ht(10,s))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:s}}const N1=e=>{const t=mt(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},dn=(e,t)=>{try{return N1(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Cr(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((s,o)=>o<3?parseInt(s,10):s):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function sd(e){e=mt(e);const{values:t}=e,n=t[0],r=t[1]/100,s=t[2]/100,o=r*Math.min(s,1-s),i=(d,u=(d+n/30)%12)=>s-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const c=[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)];return e.type==="hsla"&&(a+="a",c.push(t[3])),Cr({type:a,values:c})}function Vs(e){e=mt(e);let t=e.type==="hsl"||e.type==="hsla"?mt(sd(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Da(e,t){const n=Vs(e),r=Vs(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function R1(e,t){return e=mt(e),t=To(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Cr(e)}function Hn(e,t,n){try{return R1(e,t)}catch{return e}}function Ao(e,t){if(e=mt(e),t=To(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return Cr(e)}function me(e,t,n){try{return Ao(e,t)}catch{return e}}function jo(e,t){if(e=mt(e),t=To(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return Cr(e)}function ge(e,t,n){try{return jo(e,t)}catch{return e}}function I1(e,t=.15){return Vs(e)>.5?Ao(e,t):jo(e,t)}function Zn(e,t,n){try{return I1(e,t)}catch{return e}}const D1=g.createContext(void 0);process.env.NODE_ENV!=="production"&&(ce.node,ce.object);function $1(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const s=t.components[n];return s.defaultProps?Ps(s.defaultProps,r,t.components.mergeClassNameAndStyle):!s.styleOverrides&&!s.variants?Ps(s,r,t.components.mergeClassNameAndStyle):r}function F1({props:e,name:t}){const n=g.useContext(D1);return $1({props:e,name:t,theme:{components:n}})}const $a={theme:void 0};function O1(e){let t,n;return function(s){let o=t;return(o===void 0||s.theme!==n)&&($a.theme=s.theme,o=td(e($a)),t=o,n=s.theme),o}}function L1(e=""){function t(...r){if(!r.length)return"";const s=r[0];return typeof s=="string"&&!s.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${s}${t(...r.slice(1))})`:`, ${s}`}return(r,...s)=>`var(--${e?`${e}-`:""}${r}${t(...s)})`}const Fa=(e,t,n,r=[])=>{let s=e;t.forEach((o,i)=>{i===t.length-1?Array.isArray(s)?s[Number(o)]=n:s&&typeof s=="object"&&(s[o]=n):s&&typeof s=="object"&&(s[o]||(s[o]=r.includes(o)?[]:{}),s=s[o])})},_1=(e,t,n)=>{function r(s,o=[],i=[]){Object.entries(s).forEach(([a,c])=>{(!n||n&&!n([...o,a]))&&c!=null&&(typeof c=="object"&&Object.keys(c).length>0?r(c,[...o,a],Array.isArray(c)?[...i,a]:i):t([...o,a],c,i))})}r(e)},B1=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function ts(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},s={},o={},i={};return _1(e,(a,c,d)=>{if((typeof c=="string"||typeof c=="number")&&(!r||!r(a,c))){const u=`--${n?`${n}-`:""}${a.join("-")}`,f=B1(a,c);Object.assign(s,{[u]:f}),Fa(o,a,`var(${u})`,d),Fa(i,a,`var(${u}, ${f})`,d)}},a=>a[0]==="vars"),{css:s,vars:o,varsWithDefaults:i}}function z1(e,t={}){const{getSelector:n=b,disableCssColorScheme:r,colorSchemeSelector:s}=t,{colorSchemes:o={},components:i,defaultColorScheme:a="light",...c}=e,{vars:d,css:u,varsWithDefaults:f}=ts(c,t);let h=f;const p={},{[a]:x,...m}=o;if(Object.entries(m||{}).forEach(([E,w])=>{const{vars:S,css:A,varsWithDefaults:M}=ts(w,t);h=Oe(h,M),p[E]={css:A,vars:S}}),x){const{css:E,vars:w,varsWithDefaults:S}=ts(x,t);h=Oe(h,S),p[a]={css:E,vars:w}}function b(E,w){var A,M;let S=s;if(s==="class"&&(S=".%s"),s==="data"&&(S="[data-%s]"),s!=null&&s.startsWith("data-")&&!s.includes("%s")&&(S=`[${s}="%s"]`),E){if(S==="media")return e.defaultColorScheme===E?":root":{[`@media (prefers-color-scheme: ${((M=(A=o[E])==null?void 0:A.palette)==null?void 0:M.mode)||E})`]:{":root":w}};if(S)return e.defaultColorScheme===E?`:root, ${S.replace("%s",String(E))}`:S.replace("%s",String(E))}return":root"}return{vars:h,generateThemeVars:()=>{let E={...d};return Object.entries(p).forEach(([,{vars:w}])=>{E=Oe(E,w)}),E},generateStyleSheets:()=>{var j,z;const E=[],w=e.defaultColorScheme||"light";function S(y,D){Object.keys(D).length&&E.push(typeof y=="string"?{[y]:{...D}}:y)}S(n(void 0,{...u}),u);const{[w]:A,...M}=p;if(A){const{css:y}=A,D=(z=(j=o[w])==null?void 0:j.palette)==null?void 0:z.mode,_=!r&&D?{colorScheme:D,...y}:{...y};S(n(w,{..._}),_)}return Object.entries(M).forEach(([y,{css:D}])=>{var te,ee;const _=(ee=(te=o[y])==null?void 0:te.palette)==null?void 0:ee.mode,J=!r&&_?{colorScheme:_,...D}:{...D};S(n(y,{...J}),J)}),E}}}function U1(e){return function(n){return e==="media"?(process.env.NODE_ENV!=="production"&&n!=="light"&&n!=="dark"&&console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${n}'.`),`@media (prefers-color-scheme: ${n})`):e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const kn={black:"#000",white:"#fff"},H1={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Vt={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Nt={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},cn={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Rt={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},It={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Dt={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function od(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:kn.white,default:kn.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const Z1=od();function id(){return{text:{primary:kn.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:kn.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const Oa=id();function La(e,t,n,r){const s=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=jo(e.main,s):t==="dark"&&(e.dark=Ao(e.main,o)))}function W1(e="light"){return e==="dark"?{main:Rt[200],light:Rt[50],dark:Rt[400]}:{main:Rt[700],light:Rt[400],dark:Rt[800]}}function G1(e="light"){return e==="dark"?{main:Vt[200],light:Vt[50],dark:Vt[400]}:{main:Vt[500],light:Vt[300],dark:Vt[700]}}function K1(e="light"){return e==="dark"?{main:Nt[500],light:Nt[300],dark:Nt[700]}:{main:Nt[700],light:Nt[400],dark:Nt[800]}}function Y1(e="light"){return e==="dark"?{main:It[400],light:It[300],dark:It[700]}:{main:It[700],light:It[500],dark:It[900]}}function q1(e="light"){return e==="dark"?{main:Dt[400],light:Dt[300],dark:Dt[700]}:{main:Dt[800],light:Dt[500],dark:Dt[900]}}function X1(e="light"){return e==="dark"?{main:cn[400],light:cn[300],dark:cn[700]}:{main:"#ed6c02",light:cn[500],dark:cn[900]}}function Mo(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,...s}=e,o=e.primary||W1(t),i=e.secondary||G1(t),a=e.error||K1(t),c=e.info||Y1(t),d=e.success||q1(t),u=e.warning||X1(t);function f(m){const b=Da(m,Oa.text.primary)>=n?Oa.text.primary:Z1.text.primary;if(process.env.NODE_ENV!=="production"){const k=Da(m,b);k<3&&console.error([`MUI: The contrast ratio of ${k}:1 for ${b} on ${m}`,"falls below the WCAG recommended absolute minimum contrast ratio of 3:1.","https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join(`
58
+ `))}return b}const h=({color:m,name:b,mainShade:k=500,lightShade:v=300,darkShade:E=700})=>{if(m={...m},!m.main&&m[k]&&(m.main=m[k]),!m.hasOwnProperty("main"))throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${b?` (${b})`:""} provided to augmentColor(color) is invalid.
59
59
  The color object needs to have a \`main\` property or a \`${k}\` property.`:ht(11,b?` (${b})`:"",k));if(typeof m.main!="string")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${b?` (${b})`:""} provided to augmentColor(color) is invalid.
60
60
  \`color.main\` should be a string, but \`${JSON.stringify(m.main)}\` was provided instead.
61
61
 
@@ -69,40 +69,40 @@ const theme1 = createTheme({ palette: {
69
69
 
70
70
  const theme2 = createTheme({ palette: {
71
71
  primary: { main: green[500] },
72
- } });`:ht(12,b?` (${b})`:"",JSON.stringify(m.main)));return La(m,"light",v,s),La(m,"dark",T,s),m.contrastText||(m.contrastText=f(m.main)),m};let g;return t==="light"?g=od():t==="dark"&&(g=id()),process.env.NODE_ENV!=="production"&&(g||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),Oe({common:{...kn},mode:t,primary:h({color:o,name:"primary"}),secondary:h({color:i,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:a,name:"error"}),warning:h({color:u,name:"warning"}),info:h({color:c,name:"info"}),success:h({color:d,name:"success"}),grey:Uy,contrastThreshold:n,getContrastText:f,augmentColor:h,tonalOffset:s,...g},r)}function Jy(e){const t={};return Object.entries(e).forEach(s=>{const[r,o]=s;typeof o=="object"&&(t[r]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),t}function Qy(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function e1(e){return Math.round(e*1e5)/1e5}const _a={textTransform:"uppercase"},Ba='"Roboto", "Helvetica", "Arial", sans-serif';function t1(e,t){const{fontFamily:n=Ba,fontSize:s=14,fontWeightLight:r=300,fontWeightRegular:o=400,fontWeightMedium:i=500,fontWeightBold:a=700,htmlFontSize:c=16,allVariants:d,pxToRem:u,...f}=typeof t=="function"?t(e):t;process.env.NODE_ENV!=="production"&&(typeof s!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof c!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const h=s/14,g=u||(b=>`${b/c*h}rem`),x=(b,k,v,T,w)=>({fontFamily:n,fontWeight:b,fontSize:g(k),lineHeight:v,...n===Ba?{letterSpacing:`${e1(T/k)}em`}:{},...w,...d}),m={h1:x(r,96,1.167,-1.5),h2:x(r,60,1.2,-.5),h3:x(o,48,1.167,0),h4:x(o,34,1.235,.25),h5:x(o,24,1.334,0),h6:x(i,20,1.6,.15),subtitle1:x(o,16,1.75,.15),subtitle2:x(i,14,1.57,.1),body1:x(o,16,1.5,.15),body2:x(o,14,1.43,.15),button:x(i,14,1.75,.4,_a),caption:x(o,12,1.66,.4),overline:x(o,12,2.66,1,_a),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Oe({htmlFontSize:c,pxToRem:g,fontFamily:n,fontSize:s,fontWeightLight:r,fontWeightRegular:o,fontWeightMedium:i,fontWeightBold:a,...m},f,{clone:!1})}const n1=.2,s1=.14,r1=.12;function ge(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${n1})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${s1})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${r1})`].join(",")}const o1=["none",ge(0,2,1,-1,0,1,1,0,0,1,3,0),ge(0,3,1,-2,0,2,2,0,0,1,5,0),ge(0,3,3,-2,0,3,4,0,0,1,8,0),ge(0,2,4,-1,0,4,5,0,0,1,10,0),ge(0,3,5,-1,0,5,8,0,0,1,14,0),ge(0,3,5,-1,0,6,10,0,0,1,18,0),ge(0,4,5,-2,0,7,10,1,0,2,16,1),ge(0,5,5,-3,0,8,10,1,0,3,14,2),ge(0,5,6,-3,0,9,12,1,0,3,16,2),ge(0,6,6,-3,0,10,14,1,0,4,18,3),ge(0,6,7,-4,0,11,15,1,0,4,20,3),ge(0,7,8,-4,0,12,17,2,0,5,22,4),ge(0,7,8,-4,0,13,19,2,0,5,24,4),ge(0,7,9,-4,0,14,21,2,0,5,26,4),ge(0,8,9,-5,0,15,22,2,0,6,28,5),ge(0,8,10,-5,0,16,24,2,0,6,30,5),ge(0,8,11,-5,0,17,26,2,0,6,32,5),ge(0,9,11,-5,0,18,28,2,0,7,34,6),ge(0,9,12,-6,0,19,29,2,0,7,36,6),ge(0,10,13,-6,0,20,31,3,0,8,38,7),ge(0,10,13,-6,0,21,33,3,0,8,40,7),ge(0,10,14,-6,0,22,35,3,0,8,42,7),ge(0,11,14,-7,0,23,36,3,0,9,44,8),ge(0,11,15,-7,0,24,38,3,0,9,46,8)],i1={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},a1={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function za(e){return`${Math.round(e)}ms`}function c1(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function l1(e){const t={...i1,...e.easing},n={...a1,...e.duration};return{getAutoHeightDuration:c1,create:(r=["all"],o={})=>{const{duration:i=n.standard,easing:a=t.easeInOut,delay:c=0,...d}=o;if(process.env.NODE_ENV!=="production"){const u=h=>typeof h=="string",f=h=>!Number.isNaN(parseFloat(h));!u(r)&&!Array.isArray(r)&&console.error('MUI: Argument "props" must be a string or Array.'),!f(i)&&!u(i)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${i}.`),u(a)||console.error('MUI: Argument "easing" must be a string.'),!f(c)&&!u(c)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof o!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
73
- `)),Object.keys(d).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(d).join(",")}].`)}return(Array.isArray(r)?r:[r]).map(u=>`${u} ${typeof i=="string"?i:za(i)} ${a} ${typeof c=="string"?c:za(c)}`).join(",")},...e,easing:t,duration:n}}const d1={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function u1(e){return st(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function ad(e={}){const t={...e};function n(s){const r=Object.entries(s);for(let o=0;o<r.length;o++){const[i,a]=r[o];!u1(a)||i.startsWith("unstable_")?delete s[i]:st(a)&&(s[i]={...a},n(s[i]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
72
+ } });`:ht(12,b?` (${b})`:"",JSON.stringify(m.main)));return La(m,"light",v,r),La(m,"dark",E,r),m.contrastText||(m.contrastText=f(m.main)),m};let p;return t==="light"?p=od():t==="dark"&&(p=id()),process.env.NODE_ENV!=="production"&&(p||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),Oe({common:{...kn},mode:t,primary:h({color:o,name:"primary"}),secondary:h({color:i,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:a,name:"error"}),warning:h({color:u,name:"warning"}),info:h({color:c,name:"info"}),success:h({color:d,name:"success"}),grey:H1,contrastThreshold:n,getContrastText:f,augmentColor:h,tonalOffset:r,...p},s)}function J1(e){const t={};return Object.entries(e).forEach(r=>{const[s,o]=r;typeof o=="object"&&(t[s]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),t}function Q1(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function ey(e){return Math.round(e*1e5)/1e5}const _a={textTransform:"uppercase"},Ba='"Roboto", "Helvetica", "Arial", sans-serif';function ty(e,t){const{fontFamily:n=Ba,fontSize:r=14,fontWeightLight:s=300,fontWeightRegular:o=400,fontWeightMedium:i=500,fontWeightBold:a=700,htmlFontSize:c=16,allVariants:d,pxToRem:u,...f}=typeof t=="function"?t(e):t;process.env.NODE_ENV!=="production"&&(typeof r!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof c!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const h=r/14,p=u||(b=>`${b/c*h}rem`),x=(b,k,v,E,w)=>({fontFamily:n,fontWeight:b,fontSize:p(k),lineHeight:v,...n===Ba?{letterSpacing:`${ey(E/k)}em`}:{},...w,...d}),m={h1:x(s,96,1.167,-1.5),h2:x(s,60,1.2,-.5),h3:x(o,48,1.167,0),h4:x(o,34,1.235,.25),h5:x(o,24,1.334,0),h6:x(i,20,1.6,.15),subtitle1:x(o,16,1.75,.15),subtitle2:x(i,14,1.57,.1),body1:x(o,16,1.5,.15),body2:x(o,14,1.43,.15),button:x(i,14,1.75,.4,_a),caption:x(o,12,1.66,.4),overline:x(o,12,2.66,1,_a),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Oe({htmlFontSize:c,pxToRem:p,fontFamily:n,fontSize:r,fontWeightLight:s,fontWeightRegular:o,fontWeightMedium:i,fontWeightBold:a,...m},f,{clone:!1})}const ny=.2,ry=.14,sy=.12;function pe(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${ny})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${ry})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${sy})`].join(",")}const oy=["none",pe(0,2,1,-1,0,1,1,0,0,1,3,0),pe(0,3,1,-2,0,2,2,0,0,1,5,0),pe(0,3,3,-2,0,3,4,0,0,1,8,0),pe(0,2,4,-1,0,4,5,0,0,1,10,0),pe(0,3,5,-1,0,5,8,0,0,1,14,0),pe(0,3,5,-1,0,6,10,0,0,1,18,0),pe(0,4,5,-2,0,7,10,1,0,2,16,1),pe(0,5,5,-3,0,8,10,1,0,3,14,2),pe(0,5,6,-3,0,9,12,1,0,3,16,2),pe(0,6,6,-3,0,10,14,1,0,4,18,3),pe(0,6,7,-4,0,11,15,1,0,4,20,3),pe(0,7,8,-4,0,12,17,2,0,5,22,4),pe(0,7,8,-4,0,13,19,2,0,5,24,4),pe(0,7,9,-4,0,14,21,2,0,5,26,4),pe(0,8,9,-5,0,15,22,2,0,6,28,5),pe(0,8,10,-5,0,16,24,2,0,6,30,5),pe(0,8,11,-5,0,17,26,2,0,6,32,5),pe(0,9,11,-5,0,18,28,2,0,7,34,6),pe(0,9,12,-6,0,19,29,2,0,7,36,6),pe(0,10,13,-6,0,20,31,3,0,8,38,7),pe(0,10,13,-6,0,21,33,3,0,8,40,7),pe(0,10,14,-6,0,22,35,3,0,8,42,7),pe(0,11,14,-7,0,23,36,3,0,9,44,8),pe(0,11,15,-7,0,24,38,3,0,9,46,8)],iy={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},ay={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function za(e){return`${Math.round(e)}ms`}function cy(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function ly(e){const t={...iy,...e.easing},n={...ay,...e.duration};return{getAutoHeightDuration:cy,create:(s=["all"],o={})=>{const{duration:i=n.standard,easing:a=t.easeInOut,delay:c=0,...d}=o;if(process.env.NODE_ENV!=="production"){const u=h=>typeof h=="string",f=h=>!Number.isNaN(parseFloat(h));!u(s)&&!Array.isArray(s)&&console.error('MUI: Argument "props" must be a string or Array.'),!f(i)&&!u(i)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${i}.`),u(a)||console.error('MUI: Argument "easing" must be a string.'),!f(c)&&!u(c)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof o!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
73
+ `)),Object.keys(d).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(d).join(",")}].`)}return(Array.isArray(s)?s:[s]).map(u=>`${u} ${typeof i=="string"?i:za(i)} ${a} ${typeof c=="string"?c:za(c)}`).join(",")},...e,easing:t,duration:n}}const dy={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function uy(e){return rt(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function ad(e={}){const t={...e};function n(r){const s=Object.entries(r);for(let o=0;o<s.length;o++){const[i,a]=s[o];!uy(a)||i.startsWith("unstable_")?delete r[i]:rt(a)&&(r[i]={...a},n(r[i]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
74
74
 
75
75
  const theme = ${JSON.stringify(t,null,2)};
76
76
 
77
77
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
78
78
  theme.transitions = createTransitions(theme.transitions || {});
79
79
 
80
- export default theme;`}function Nr(e={},...t){const{breakpoints:n,mixins:s={},spacing:r,palette:o={},transitions:i={},typography:a={},shape:c,...d}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":ht(20));const u=Mo(o),f=Ql(e);let h=Oe(f,{mixins:Qy(f.breakpoints,s),palette:u,shadows:o1.slice(),typography:t1(u,a),transitions:l1(i),zIndex:{...d1}});if(h=Oe(h,d),h=t.reduce((g,x)=>Oe(g,x),h),process.env.NODE_ENV!=="production"){const g=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],x=(m,b)=>{let k;for(k in m){const v=m[k];if(g.includes(k)&&Object.keys(v).length>0){if(process.env.NODE_ENV!=="production"){const T=To("",k);console.error([`MUI: The \`${b}\` component increases the CSS specificity of the \`${k}\` internal state.`,"You can not override it like this: ",JSON.stringify(m,null,2),"",`Instead, you need to use the '&.${T}' syntax:`,JSON.stringify({root:{[`&.${T}`]:v}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
81
- `))}m[k]={}}}};Object.keys(h.components).forEach(m=>{const b=h.components[m].styleOverrides;b&&m.startsWith("Mui")&&x(b,m)})}return h.unstable_sxConfig={...Ss,...d==null?void 0:d.unstable_sxConfig},h.unstable_sx=function(x){return Yt({sx:x,theme:this})},h.toRuntimeSource=ad,h}function f1(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const h1=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=f1(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function cd(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function ld(e){return e==="dark"?h1:[]}function m1(e){const{palette:t={mode:"light"},opacity:n,overlays:s,...r}=e,o=Mo(t);return{palette:o,opacity:{...cd(o.mode),...n},overlays:s||ld(o.mode),...r}}function p1(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const g1=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],y1=e=>(t,n)=>{const s=e.rootSelector||":root",r=e.colorSchemeSelector;let o=r;if(r==="class"&&(o=".%s"),r==="data"&&(o="[data-%s]"),r!=null&&r.startsWith("data-")&&!r.includes("%s")&&(o=`[${r}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const i={};return g1(e.cssVarPrefix).forEach(a=>{i[a]=n[a],delete n[a]}),o==="media"?{[s]:n,"@media (prefers-color-scheme: dark)":{[s]:i}}:o?{[o.replace("%s",t)]:i,[`${s}, ${o.replace("%s",t)}`]:n}:{[s]:{...n,...i}}}if(o&&o!=="media")return`${s}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[s]:n}};if(o)return o.replace("%s",String(t))}return s};function x1(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function N(e,t,n){!e[t]&&n&&(e[t]=n)}function un(e){return typeof e!="string"||!e.startsWith("hsl")?e:rd(e)}function nt(e,t){`${t}Channel`in e||(e[`${t}Channel`]=dn(un(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
82
- To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function b1(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const qe=e=>{try{return e()}catch{}},v1=(e="mui")=>Ly(e);function nr(e,t,n,s){if(!t)return;t=t===!0?{}:t;const r=s==="dark"?"dark":"light";if(!n){e[s]=m1({...t,palette:{mode:r,...t==null?void 0:t.palette}});return}const{palette:o,...i}=Nr({...n,palette:{mode:r,...t==null?void 0:t.palette}});return e[s]={...t,palette:o,opacity:{...cd(r),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||ld(r)},i}function w1(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:s,disableCssColorScheme:r=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:i=p1,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:c=":root",...d}=e,u=Object.keys(n)[0],f=s||(n.light&&u!=="light"?"light":u),h=v1(o),{[f]:g,light:x,dark:m,...b}=n,k={...b};let v=g;if((f==="dark"&&!("dark"in n)||f==="light"&&!("light"in n))&&(v=!0),!v)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${f}\` option is either missing or invalid.`:ht(21,f));const T=nr(k,v,d,f);x&&!k.light&&nr(k,x,void 0,"light"),m&&!k.dark&&nr(k,m,void 0,"dark");let w={defaultColorScheme:f,...T,cssVarPrefix:o,colorSchemeSelector:a,rootSelector:c,getCssVar:h,colorSchemes:k,font:{...Jy(T.typography),...T.font},spacing:b1(d.spacing)};Object.keys(w.colorSchemes).forEach(z=>{const y=w.colorSchemes[z].palette,D=_=>{const J=_.split("-"),te=J[1],ee=J[2];return h(_,y[te][ee])};if(y.mode==="light"&&(N(y.common,"background","#fff"),N(y.common,"onBackground","#000")),y.mode==="dark"&&(N(y.common,"background","#000"),N(y.common,"onBackground","#fff")),x1(y,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),y.mode==="light"){N(y.Alert,"errorColor",me(y.error.light,.6)),N(y.Alert,"infoColor",me(y.info.light,.6)),N(y.Alert,"successColor",me(y.success.light,.6)),N(y.Alert,"warningColor",me(y.warning.light,.6)),N(y.Alert,"errorFilledBg",D("palette-error-main")),N(y.Alert,"infoFilledBg",D("palette-info-main")),N(y.Alert,"successFilledBg",D("palette-success-main")),N(y.Alert,"warningFilledBg",D("palette-warning-main")),N(y.Alert,"errorFilledColor",qe(()=>y.getContrastText(y.error.main))),N(y.Alert,"infoFilledColor",qe(()=>y.getContrastText(y.info.main))),N(y.Alert,"successFilledColor",qe(()=>y.getContrastText(y.success.main))),N(y.Alert,"warningFilledColor",qe(()=>y.getContrastText(y.warning.main))),N(y.Alert,"errorStandardBg",pe(y.error.light,.9)),N(y.Alert,"infoStandardBg",pe(y.info.light,.9)),N(y.Alert,"successStandardBg",pe(y.success.light,.9)),N(y.Alert,"warningStandardBg",pe(y.warning.light,.9)),N(y.Alert,"errorIconColor",D("palette-error-main")),N(y.Alert,"infoIconColor",D("palette-info-main")),N(y.Alert,"successIconColor",D("palette-success-main")),N(y.Alert,"warningIconColor",D("palette-warning-main")),N(y.AppBar,"defaultBg",D("palette-grey-100")),N(y.Avatar,"defaultBg",D("palette-grey-400")),N(y.Button,"inheritContainedBg",D("palette-grey-300")),N(y.Button,"inheritContainedHoverBg",D("palette-grey-A100")),N(y.Chip,"defaultBorder",D("palette-grey-400")),N(y.Chip,"defaultAvatarColor",D("palette-grey-700")),N(y.Chip,"defaultIconColor",D("palette-grey-700")),N(y.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),N(y.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),N(y.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),N(y.LinearProgress,"primaryBg",pe(y.primary.main,.62)),N(y.LinearProgress,"secondaryBg",pe(y.secondary.main,.62)),N(y.LinearProgress,"errorBg",pe(y.error.main,.62)),N(y.LinearProgress,"infoBg",pe(y.info.main,.62)),N(y.LinearProgress,"successBg",pe(y.success.main,.62)),N(y.LinearProgress,"warningBg",pe(y.warning.main,.62)),N(y.Skeleton,"bg",`rgba(${D("palette-text-primaryChannel")} / 0.11)`),N(y.Slider,"primaryTrack",pe(y.primary.main,.62)),N(y.Slider,"secondaryTrack",pe(y.secondary.main,.62)),N(y.Slider,"errorTrack",pe(y.error.main,.62)),N(y.Slider,"infoTrack",pe(y.info.main,.62)),N(y.Slider,"successTrack",pe(y.success.main,.62)),N(y.Slider,"warningTrack",pe(y.warning.main,.62));const _=Zn(y.background.default,.8);N(y.SnackbarContent,"bg",_),N(y.SnackbarContent,"color",qe(()=>y.getContrastText(_))),N(y.SpeedDialAction,"fabHoverBg",Zn(y.background.paper,.15)),N(y.StepConnector,"border",D("palette-grey-400")),N(y.StepContent,"border",D("palette-grey-400")),N(y.Switch,"defaultColor",D("palette-common-white")),N(y.Switch,"defaultDisabledColor",D("palette-grey-100")),N(y.Switch,"primaryDisabledColor",pe(y.primary.main,.62)),N(y.Switch,"secondaryDisabledColor",pe(y.secondary.main,.62)),N(y.Switch,"errorDisabledColor",pe(y.error.main,.62)),N(y.Switch,"infoDisabledColor",pe(y.info.main,.62)),N(y.Switch,"successDisabledColor",pe(y.success.main,.62)),N(y.Switch,"warningDisabledColor",pe(y.warning.main,.62)),N(y.TableCell,"border",pe(Un(y.divider,1),.88)),N(y.Tooltip,"bg",Un(y.grey[700],.92))}if(y.mode==="dark"){N(y.Alert,"errorColor",pe(y.error.light,.6)),N(y.Alert,"infoColor",pe(y.info.light,.6)),N(y.Alert,"successColor",pe(y.success.light,.6)),N(y.Alert,"warningColor",pe(y.warning.light,.6)),N(y.Alert,"errorFilledBg",D("palette-error-dark")),N(y.Alert,"infoFilledBg",D("palette-info-dark")),N(y.Alert,"successFilledBg",D("palette-success-dark")),N(y.Alert,"warningFilledBg",D("palette-warning-dark")),N(y.Alert,"errorFilledColor",qe(()=>y.getContrastText(y.error.dark))),N(y.Alert,"infoFilledColor",qe(()=>y.getContrastText(y.info.dark))),N(y.Alert,"successFilledColor",qe(()=>y.getContrastText(y.success.dark))),N(y.Alert,"warningFilledColor",qe(()=>y.getContrastText(y.warning.dark))),N(y.Alert,"errorStandardBg",me(y.error.light,.9)),N(y.Alert,"infoStandardBg",me(y.info.light,.9)),N(y.Alert,"successStandardBg",me(y.success.light,.9)),N(y.Alert,"warningStandardBg",me(y.warning.light,.9)),N(y.Alert,"errorIconColor",D("palette-error-main")),N(y.Alert,"infoIconColor",D("palette-info-main")),N(y.Alert,"successIconColor",D("palette-success-main")),N(y.Alert,"warningIconColor",D("palette-warning-main")),N(y.AppBar,"defaultBg",D("palette-grey-900")),N(y.AppBar,"darkBg",D("palette-background-paper")),N(y.AppBar,"darkColor",D("palette-text-primary")),N(y.Avatar,"defaultBg",D("palette-grey-600")),N(y.Button,"inheritContainedBg",D("palette-grey-800")),N(y.Button,"inheritContainedHoverBg",D("palette-grey-700")),N(y.Chip,"defaultBorder",D("palette-grey-700")),N(y.Chip,"defaultAvatarColor",D("palette-grey-300")),N(y.Chip,"defaultIconColor",D("palette-grey-300")),N(y.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),N(y.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),N(y.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),N(y.LinearProgress,"primaryBg",me(y.primary.main,.5)),N(y.LinearProgress,"secondaryBg",me(y.secondary.main,.5)),N(y.LinearProgress,"errorBg",me(y.error.main,.5)),N(y.LinearProgress,"infoBg",me(y.info.main,.5)),N(y.LinearProgress,"successBg",me(y.success.main,.5)),N(y.LinearProgress,"warningBg",me(y.warning.main,.5)),N(y.Skeleton,"bg",`rgba(${D("palette-text-primaryChannel")} / 0.13)`),N(y.Slider,"primaryTrack",me(y.primary.main,.5)),N(y.Slider,"secondaryTrack",me(y.secondary.main,.5)),N(y.Slider,"errorTrack",me(y.error.main,.5)),N(y.Slider,"infoTrack",me(y.info.main,.5)),N(y.Slider,"successTrack",me(y.success.main,.5)),N(y.Slider,"warningTrack",me(y.warning.main,.5));const _=Zn(y.background.default,.98);N(y.SnackbarContent,"bg",_),N(y.SnackbarContent,"color",qe(()=>y.getContrastText(_))),N(y.SpeedDialAction,"fabHoverBg",Zn(y.background.paper,.15)),N(y.StepConnector,"border",D("palette-grey-600")),N(y.StepContent,"border",D("palette-grey-600")),N(y.Switch,"defaultColor",D("palette-grey-300")),N(y.Switch,"defaultDisabledColor",D("palette-grey-600")),N(y.Switch,"primaryDisabledColor",me(y.primary.main,.55)),N(y.Switch,"secondaryDisabledColor",me(y.secondary.main,.55)),N(y.Switch,"errorDisabledColor",me(y.error.main,.55)),N(y.Switch,"infoDisabledColor",me(y.info.main,.55)),N(y.Switch,"successDisabledColor",me(y.success.main,.55)),N(y.Switch,"warningDisabledColor",me(y.warning.main,.55)),N(y.TableCell,"border",me(Un(y.divider,1),.68)),N(y.Tooltip,"bg",Un(y.grey[700],.92))}nt(y.background,"default"),nt(y.background,"paper"),nt(y.common,"background"),nt(y.common,"onBackground"),nt(y,"divider"),Object.keys(y).forEach(_=>{const J=y[_];_!=="tonalOffset"&&J&&typeof J=="object"&&(J.main&&N(y[_],"mainChannel",dn(un(J.main))),J.light&&N(y[_],"lightChannel",dn(un(J.light))),J.dark&&N(y[_],"darkChannel",dn(un(J.dark))),J.contrastText&&N(y[_],"contrastTextChannel",dn(un(J.contrastText))),_==="text"&&(nt(y[_],"primary"),nt(y[_],"secondary")),_==="action"&&(J.active&&nt(y[_],"active"),J.selected&&nt(y[_],"selected")))})}),w=t.reduce((z,y)=>Oe(z,y),w);const S={prefix:o,disableCssColorScheme:r,shouldSkipGeneratingVar:i,getSelector:y1(w)},{vars:A,generateThemeVars:M,generateStyleSheets:j}=zy(w,S);return w.vars=A,Object.entries(w.colorSchemes[w.defaultColorScheme]).forEach(([z,y])=>{w[z]=y}),w.generateThemeVars=M,w.generateStyleSheets=j,w.generateSpacing=function(){return Jl(d.spacing,Co(this))},w.getColorSchemeSelector=Hy(a),w.spacing=w.generateSpacing(),w.shouldSkipGeneratingVar=i,w.unstable_sxConfig={...Ss,...d==null?void 0:d.unstable_sxConfig},w.unstable_sx=function(y){return Yt({sx:y,theme:this})},w.toRuntimeSource=ad,w}function Ha(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Mo({...n===!0?{}:n.palette,mode:t})})}function S1(e={},...t){const{palette:n,cssVariables:s=!1,colorSchemes:r=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...i}=e,a=o||"light",c=r==null?void 0:r[a],d={...r,...n?{[a]:{...typeof c!="boolean"&&c,palette:n}}:void 0};if(s===!1){if(!("colorSchemes"in e))return Nr(e,...t);let u=n;"palette"in e||d[a]&&(d[a]!==!0?u=d[a].palette:a==="dark"&&(u={mode:"dark"}));const f=Nr({...e,palette:u},...t);return f.defaultColorScheme=a,f.colorSchemes=d,f.palette.mode==="light"&&(f.colorSchemes.light={...d.light!==!0&&d.light,palette:f.palette},Ha(f,"dark",d.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...d.dark!==!0&&d.dark,palette:f.palette},Ha(f,"light",d.light)),f}return!n&&!("light"in d)&&a==="light"&&(d.light=!0),w1({...i,colorSchemes:d,defaultColorScheme:a,...typeof s!="boolean"&&s},...t)}const C1=S1(),k1="$$material";function T1(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const E1=e=>T1(e)&&e!=="classes",A1=Ty({themeId:k1,defaultTheme:C1,rootShouldForwardProp:E1}),j1=Oy;process.env.NODE_ENV!=="production"&&(ce.node,ce.object.isRequired);function M1(e){return Fy(e)}function P1(e){return To("MuiSvgIcon",e)}vy("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const V1=e=>{const{color:t,fontSize:n,classes:s}=e,r={root:["root",t!=="inherit"&&`color${At(t)}`,`fontSize${At(n)}`]};return ug(r,P1,s)},N1=A1("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${At(n.color)}`],t[`fontSize${At(n.fontSize)}`]]}})(j1(({theme:e})=>{var t,n,s,r,o,i,a,c,d,u,f,h,g,x;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(r=(t=e.transitions)==null?void 0:t.create)==null?void 0:r.call(t,"fill",{duration:(s=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:s.shorter}),variants:[{props:m=>!m.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((i=(o=e.typography)==null?void 0:o.pxToRem)==null?void 0:i.call(o,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((c=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:c.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((u=(d=e.typography)==null?void 0:d.pxToRem)==null?void 0:u.call(d,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,m])=>m&&m.main).map(([m])=>{var b,k;return{props:{color:m},style:{color:(k=(b=(e.vars??e).palette)==null?void 0:b[m])==null?void 0:k.main}}}),{props:{color:"action"},style:{color:(h=(f=(e.vars??e).palette)==null?void 0:f.action)==null?void 0:h.active}},{props:{color:"disabled"},style:{color:(x=(g=(e.vars??e).palette)==null?void 0:g.action)==null?void 0:x.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),cs=p.forwardRef(function(t,n){const s=M1({props:t,name:"MuiSvgIcon"}),{children:r,className:o,color:i="inherit",component:a="svg",fontSize:c="medium",htmlColor:d,inheritViewBox:u=!1,titleAccess:f,viewBox:h="0 0 24 24",...g}=s,x=p.isValidElement(r)&&r.type==="svg",m={...s,color:i,component:a,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:h,hasSvgAsChild:x},b={};u||(b.viewBox=h);const k=V1(m);return l.jsxs(N1,{as:a,className:$r(k.root,o),focusable:"false",color:d,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...b,...g,...x&&r.props,ownerState:m,children:[x?r.props.children:r,f?l.jsx("title",{children:f}):null]})});process.env.NODE_ENV!=="production"&&(cs.propTypes={children:ce.node,classes:ce.object,className:ce.string,color:ce.oneOfType([ce.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),ce.string]),component:ce.elementType,fontSize:ce.oneOfType([ce.oneOf(["inherit","large","medium","small"]),ce.string]),htmlColor:ce.string,inheritViewBox:ce.bool,shapeRendering:ce.string,sx:ce.oneOfType([ce.arrayOf(ce.oneOfType([ce.func,ce.object,ce.bool])),ce.func,ce.object]),titleAccess:ce.string,viewBox:ce.string});cs.muiName="SvgIcon";function nn(e,t){function n(s,r){return l.jsx(cs,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:r,...s,children:e})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=cs.muiName,p.memo(p.forwardRef(n))}const R1=nn(l.jsx("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"}),"AttachFile"),I1=nn(l.jsx("path",{d:"M12 9c-1.6 0-3.15.25-4.6.72v3.1c0 .39-.23.74-.56.9-.98.49-1.87 1.12-2.66 1.85-.18.18-.43.28-.7.28-.28 0-.53-.11-.71-.29L.29 13.08c-.18-.17-.29-.42-.29-.7s.11-.53.29-.71C3.34 8.78 7.46 7 12 7s8.66 1.78 11.71 4.67c.18.18.29.43.29.71s-.11.53-.29.71l-2.48 2.48c-.18.18-.43.29-.71.29-.27 0-.52-.11-.7-.28-.79-.74-1.69-1.36-2.67-1.85-.33-.16-.56-.5-.56-.9v-3.1C15.15 9.25 13.6 9 12 9"}),"CallEnd"),D1=nn([l.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),l.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"CameraAlt"),dd=nn(l.jsx("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M6 9h12v2H6zm8 5H6v-2h8zm4-6H6V6h12z"}),"Chat"),ud=nn(l.jsx("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3m5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72z"}),"Mic"),fd=nn(l.jsx("path",{d:"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11z"}),"Videocam"),$1=({disabled:e,capabilities:t,sessionStarted:n,ref:s,participantName:r="User",loadingText:o="Waiting for agent to connect...",theme:i="vox",client:a,displayType:c="widget",onBack:d})=>{var K,R,X,V,U,q,P;const[u,f]=C.useState(!1),[h,g]=C.useState(!1),[x,m]=C.useState(!1),[b,k]=C.useState(()=>{var O;const E=(O=a==null?void 0:a.getCurrentInteraction)==null?void 0:O.call(a);return console.log("SessionView: Initializing with existing interaction:",(E==null?void 0:E.methodName)||"none"),E||null}),{messages:v,send:T}=J0(),w=C.useRef(null),S=C.useRef(null),{agent:{isActive:A=!1}={}}=a?Wl(a):{agent:{isActive:!1}},M=Ve(i),j=C.useMemo(()=>a&&typeof a.getCurrentSession=="function"?!!a.getCurrentSession():!1,[a]),z=C.useMemo(()=>a&&typeof a.getIsAgentConnected=="function"&&a.getIsAgentConnected()||x,[a,x]),y=A||z;C.useEffect(()=>{var E,O;console.log("🤖 SessionView agent state:",{isAgentActive:A,hasActiveSession:j,isAgentActuallyConnected:z,effectiveAgentActive:y,sessionStarted:n,clientSession:(O=(E=a==null?void 0:a.getCurrentSession)==null?void 0:E.call(a))==null?void 0:O.id})},[A,j,z,y,n,a]),C.useEffect(()=>{console.log("🤖 Agent active state changed:",A)},[A]),C.useEffect(()=>{console.log("📋 Session state changed:",{sessionStarted:n,disabled:e,participantName:r,effectiveAgentActive:y,chatOpen:u,currentInteraction:(b==null?void 0:b.methodName)||"none"})},[n,e,r,y,u,b]),C.useEffect(()=>{if(n&&!y){console.log("⏰ Starting agent timeout detection...");const E=setTimeout(()=>{j&&!y&&(console.log("⚡ Fallback: Assuming agent is connected after 5 seconds with active session"),m(!0),g(!1))},5e3),O=setTimeout(()=>{y||(console.log("⚠️ Agent timeout: Agent did not become active within 30 seconds"),g(!0))},3e4);return()=>{clearTimeout(E),clearTimeout(O)}}else y&&(console.log("✅ Agent is active, clearing timeout"),g(!1))},[n,y,j]),C.useEffect(()=>{if(!a)return;const E=()=>{console.log("🔄 Client connection state changed:",a.connected)},O=F=>{console.log("🔴 Client disconnected:",F),k(null),f(!1),g(!1)};return a.on("connection.connected",E),a.on("connection.disconnected",O),()=>{a.off("connection.connected",E),a.off("connection.disconnected",O)}},[a]),C.useEffect(()=>{if(!a)return;const E=I=>{console.log("🤖 SessionView: Agent connected!",I),m(!0),g(!1)},O=I=>{console.log("🗣️ SessionView: Agent speaking detected!",I),x||(m(!0),g(!1))},F=I=>{console.log("🤔 SessionView: Agent thinking detected!",I),x||(m(!0),g(!1))},$=()=>{console.log("🤖 SessionView: Agent disconnected"),m(!1)};return a.on("agent.connected",E),a.on("agent.speaking",O),a.on("agent.thinking",F),a.on("connection.disconnected",$),()=>{a.off("agent.connected",E),a.off("agent.speaking",O),a.off("agent.thinking",F),a.off("connection.disconnected",$)}},[a,x]),C.useEffect(()=>{if(!a)return;const E=I=>{console.log("🎯 SessionView: RPC Interaction started:",I);const H=a.getCurrentInteraction();H&&(console.log("📱 SessionView: Setting current interaction:",H.methodName,"mode:",H.presentationMode),k(H))},O=I=>{console.log("✅ SessionView: RPC Interaction completed:",I),k(null)},F=async I=>{console.log("⏰ SessionView: RPC Interaction timeout:",I),k(null)},$=async I=>{console.log("❌ SessionView: RPC Interaction dismissed:",I),k(null)};return a.on("rpc.interaction.started",E),a.on("rpc.interaction.completed",O),a.on("rpc.interaction.timeout",F),a.on("rpc.interaction.dismissed",$),()=>{a.off("rpc.interaction.started",E),a.off("rpc.interaction.completed",O),a.off("rpc.interaction.timeout",F),a.off("rpc.interaction.dismissed",$)}},[a]),C.useEffect(()=>{if(!a)return;const E=a.getCurrentInteraction();E?(console.log("🔄 SessionView: Syncing with existing interaction:",E.methodName),k(E)):k(null)},[a]),C.useEffect(()=>{console.log("🎭 SessionView: Current interaction changed:",(b==null?void 0:b.methodName)||"none","mode:",(b==null?void 0:b.presentationMode)||"none")},[b]),C.useEffect(()=>{var E,O,F;console.log("📱 SessionView: Display type changed to:",c),console.log("📱 SessionView: Current session state during display change:",{sessionStarted:n,effectiveAgentActive:y,hasSession:!!((E=a==null?void 0:a.getCurrentSession)!=null&&E.call(a)),sessionId:(F=(O=a==null?void 0:a.getCurrentSession)==null?void 0:O.call(a))==null?void 0:F.id})},[c,n,y,a]),C.useEffect(()=>{console.log("💬 SessionView: Chat open state changed:",u)},[u]),C.useEffect(()=>{b&&u&&(console.log("🎭 SessionView: Interactive UI appeared, closing chat"),f(!1))},[b,u]),Q0(),C.useEffect(()=>{w.current&&u&&v.length>0&&(console.log("📜 SessionView: Auto-scrolling to latest message, count:",v.length),setTimeout(()=>{if(w.current){let E=w.current.parentElement;for(;E&&E.scrollHeight<=E.clientHeight;)E=E.parentElement;E?(console.log("📜 SessionView: Scrolling container found, scrolling to bottom"),E.scrollTo({top:E.scrollHeight,behavior:"smooth"})):(console.log("📜 SessionView: Using fallback scroll method"),w.current.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}))}},100))},[v.length,u]),C.useEffect(()=>{var F,$;console.log("📝 SessionView: Messages updated, count:",v.length),v.length>0&&console.log("📝 SessionView: Latest messages:",v.slice(-3).map(I=>{var H,B,oe,L,ae,xe,Ie;return{id:I.id,message:I.message,timestamp:I.timestamp,from:((H=I.from)==null?void 0:H.name)||((B=I.from)==null?void 0:B.identity),fromType:I.from===void 0?"unknown":"participant",isLocal:((oe=I.from)==null?void 0:oe.identity)===((xe=(ae=(L=a==null?void 0:a.getCurrentSession)==null?void 0:L.call(a))==null?void 0:ae.localParticipant)==null?void 0:xe.identity),messageLength:((Ie=I.message)==null?void 0:Ie.length)||0}}));const E=((F=a==null?void 0:a.getTranscriptions)==null?void 0:F.call(a))||[],O=(($=a==null?void 0:a.getChatMessages)==null?void 0:$.call(a))||[];console.log("📝 SessionView: Raw transcriptions count:",E.length),console.log("📝 SessionView: Raw chat messages count:",O.length)},[v.length,v,a]),C.useEffect(()=>{console.log("💬 SessionView: Chat state changed:",{chatOpen:u,messagesCount:v.length,displayType:c,hasMessages:v.length>0})},[u,v.length,c]);async function D(E){await T(E)}const _=C.useCallback(E=>{console.log("📝 SessionView: Adding local message for voice session context:",E)},[]),J=C.useCallback(async E=>{try{a&&typeof a.sendAttachments=="function"&&(await a.sendAttachments(E),console.log("📎 SessionView: Attachments sent successfully:",E.map(O=>O.name)))}catch(O){console.error("❌ SessionView: Failed to send attachments:",O)}},[a]),te=C.useCallback(()=>{try{console.log("📞 SessionView: Ending call..."),console.log("📞 SessionView: Current state before ending:",{sessionStarted:n,effectiveAgentActive:y,chatOpen:u,currentInteraction:b==null?void 0:b.methodName,hasOnBack:!!d}),b&&(console.log("🎭 SessionView: Dismissing current interaction:",b.methodName),k(null),a&&typeof a.dismissCurrentInteraction=="function"&&a.dismissCurrentInteraction()),f(!1),g(!1),console.log("✅ SessionView: Local state reset"),a&&typeof a.endSession=="function"&&(a.endSession(),console.log("✅ SessionView: Session ended via client.endSession()")),a&&typeof a.disconnect=="function"&&(a.disconnect(),console.log("✅ SessionView: Client disconnected")),d?(console.log("🔄 SessionView: Calling onBack to return to welcome..."),setTimeout(()=>{d(),console.log("✅ SessionView: onBack called")},150)):console.warn("⚠️ SessionView: No onBack function provided - cannot return to welcome"),console.log("🏁 SessionView: Call ended and cleanup completed")}catch(E){console.error("❌ SessionView: Failed to end call:",E),k(null),f(!1),g(!1),d&&(console.log("🔄 SessionView: Error occurred, still calling onBack..."),d())}},[a,d,b,n,y,u]);C.useEffect(()=>(console.log("🔄 SessionView: Component mounted/props changed:",{sessionStarted:n,disabled:e,participantName:r,displayType:c,hasOnBack:!!d,hasClient:!!a}),()=>{console.log("🧹 SessionView: Component unmounting or props changing")}),[n,e,r,c,d,a]),C.useEffect(()=>{console.log("🔗 SessionView: onBack prop:",{hasOnBack:!!d,onBackType:typeof d})},[d]),C.useEffect(()=>{var O,F;const E=((F=(O=a==null?void 0:a.getCurrentSession)==null?void 0:O.call(a))==null?void 0:F.id)||null;S.current&&!E&&console.warn("⚠️ SessionView: Session was lost unexpectedly!",{previousSession:S.current,currentSession:E,displayType:c,sessionStarted:n,effectiveAgentActive:y}),S.current=E},[a,c,n,y]);const ee=Y("w-full flex flex-col items-center justify-center",c==="fullscreen"?"w-full max-w-none mx-0 h-full":"w-full mx-auto",M.main,c==="fullscreen"?"max-w-none":"","overflow-hidden","h-full"),se=d&&(c==="popup"||c==="fullscreen");return l.jsxs("main",{ref:s,className:Y(ee,"relative",e&&"pointer-events-none opacity-50"),style:{minHeight:0},children:[se&&l.jsx("div",{className:`flex items-center justify-between w-full p-4 border-b ${((K=M.chatHeader)==null?void 0:K.container)||"border-gray-200"}`,children:l.jsx("div",{className:"flex items-center",children:l.jsxs("div",{children:[l.jsx("h3",{className:`font-semibold ${M.text.primary}`,children:"Voice Session"}),l.jsx("p",{className:`text-sm ${M.text.muted}`,children:r})]})})}),l.jsxs("div",{className:"w-full flex-1 flex flex-col items-center px-0 min-h-0 overflow-hidden",children:[!y&&l.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full min-h-[180px]",children:[l.jsx(ie.div,{animate:{rotate:360,scale:[1,1.1,1]},transition:{rotate:{duration:2,repeat:1/0,ease:"linear"},scale:{duration:1,repeat:1/0,ease:"easeInOut"}},className:"w-12 h-12 mb-4",children:l.jsx(vo,{className:M.spinner,weight:"bold"})}),l.jsx(ie.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-sm opacity-80 ${M.text.muted} text-center max-w-xs`,children:h?"Agent is taking longer than expected...":o}),l.jsx(ie.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${M.text.muted} mt-2 text-center opacity-60`,children:h?"Please check your connection or try again.":"Agent is connecting... This may take a moment."}),h&&d&&l.jsx(ie.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:d,className:`mt-4 px-4 py-2 rounded-lg ${((R=M.chatHeader)==null?void 0:R.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]}),y&&l.jsxs(l.Fragment,{children:[u&&l.jsxs("div",{className:Y("absolute inset-0 w-full h-full flex flex-col transition-[opacity,translate] duration-300 ease-out z-10",i==="light"?"bg-white":"bg-gray-900/95 backdrop-blur-sm",u?"translate-y-0 opacity-100 delay-200":"translate-y-10 opacity-0"),children:[l.jsxs("div",{className:Y("flex-shrink-0 px-4 py-3 border-b",c==="fullscreen"?"px-8":"px-5",((X=M.chatHeader)==null?void 0:X.container)||"border-gray-200 dark:border-gray-700"),children:[l.jsx("h3",{className:Y("font-semibold text-lg",((V=M.text)==null?void 0:V.primary)||"text-gray-900 dark:text-white"),children:"Transcription & Chat"}),l.jsxs("p",{className:Y("text-sm",((U=M.text)==null?void 0:U.muted)||"text-gray-600 dark:text-gray-400"),children:[v.length," messages"]})]}),l.jsx("div",{className:Y("flex-1 flex flex-col min-h-0",c==="fullscreen"?"px-8":"px-5"),children:l.jsx(H0,{className:"flex-1 flex flex-col min-h-0 h-full",children:l.jsxs("div",{className:`flex-1 flex flex-col h-full ${Y("overflow-y-auto scrollbar-hide py-4")}`,style:{scrollbarWidth:"none",scrollBehavior:"smooth",paddingBottom:"120px"},children:[v.length===0&&l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:Y("text-lg font-medium mb-2",((q=M.text)==null?void 0:q.primary)||"text-gray-900 dark:text-white"),children:"Start Speaking"}),l.jsx("p",{className:Y("text-sm",((P=M.text)==null?void 0:P.muted)||"text-gray-600 dark:text-gray-400"),children:"Your conversation will appear here"})]})}),v.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex-1 min-h-4"}),l.jsx("div",{ref:w,className:"space-y-4 relative whitespace-pre-wrap z-0",children:l.jsx(Ht,{mode:"popLayout",children:v.map((E,O)=>l.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3,ease:"easeOut",delay:O*.02},layout:!0,children:l.jsx(B0,{participantName:r,entry:E})},E.id||`message-${O}`))})})]})]})})})]}),!u&&l.jsxs("div",{className:Y("flex-1 flex flex-col items-center w-full h-full min-h-0",(b==null?void 0:b.presentationMode)==="embedded"?"justify-end":"justify-center"),children:[l.jsx(ie.div,{className:"w-full flex justify-center",animate:{y:(b==null?void 0:b.presentationMode)==="embedded"?-8:0},transition:{duration:.3,ease:"easeOut"},children:l.jsx(X0,{chatOpen:u,client:a})}),l.jsx(Ht,{mode:"wait",children:b&&b.presentationMode==="embedded"&&l.jsx(ie.div,{initial:{opacity:0,y:20,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:20,height:0},transition:{duration:.3,ease:"easeOut"},className:Y("w-full relative mt-4 flex justify-center",c==="fullscreen"?"max-w-4xl":"max-w-md"),children:l.jsx("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl border border-white/20 shadow-lg overflow-hidden",children:l.jsx(Kt,{interaction:b,theme:i,onDismiss:()=>{var E;return(E=a==null?void 0:a.dismissCurrentInteraction)==null?void 0:E.call(a)},client:a,addLocalMessage:_})})},`embedded-${b.methodName}`)})]})]})]}),l.jsx(Ht,{mode:"wait",children:b&&b.presentationMode!=="embedded"&&!u&&l.jsx("div",{className:Y("absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm",c==="fullscreen"?"bg-black/70":"bg-black/50"),children:l.jsx(ie.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},className:Y("relative w-full overflow-hidden",c==="fullscreen"?"max-w-2xl mx-8 max-h-[85vh]":"max-w-lg mx-4 max-h-[80vh]","bg-white dark:bg-gray-900 rounded-2xl shadow-2xl","border border-gray-200 dark:border-gray-700"),children:l.jsx(Kt,{interaction:b,theme:i,onDismiss:()=>{var E;return(E=a==null?void 0:a.dismissCurrentInteraction)==null?void 0:E.call(a)},client:a,addLocalMessage:_})},`modal-${b.methodName}`)})}),l.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"absolute bottom-0 left-0 right-0 flex-shrink-0 w-full z-20",children:l.jsx(F1,{capabilities:t,onSendMessage:D,onSendAttachments:J,onEndCall:te,onChatOpenChange:f,disabled:e,theme:i,client:a,sessionStarted:n})})]})};function F1({capabilities:e,onSendMessage:t,onSendAttachments:n,onEndCall:s,onChatOpenChange:r,disabled:o=!1,theme:i,client:a,sessionStarted:c=!1}){const[d,u]=C.useState(!1),f=C.useRef(null),h=C.useRef(null);C.useEffect(()=>{const v=()=>{const T=navigator.userAgent.toLowerCase(),S=["android","iphone","ipad","mobile","tablet"].some(j=>T.includes(j)),A="ontouchstart"in window||navigator.maxTouchPoints>0,M=window.innerWidth<=768;u(S||A&&M)};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);const g=v=>{const T=v.target.files;if(T&&T.length>0){const S=Array.from(T).filter(A=>A.type.startsWith("image/"));if(S.length===0){console.warn("No valid image files selected");return}n&&n(S),f.current&&(f.current.value="")}},x=v=>{const T=v.target.files;if(T&&T.length>0){const w=T[0];w.type.startsWith("image/")&&n&&n([w]),h.current&&(h.current.value="")}},m=()=>{!o&&f.current&&f.current.click()},b=()=>{!o&&d&&h.current&&h.current.click()},k=()=>{console.log("🔴 VoiceControlPanel: End call button clicked"),console.log("🔴 VoiceControlPanel: Current state:",{disabled:o,sessionStarted:c,hasOnEndCall:!!s}),s?s():console.warn("⚠️ VoiceControlPanel: No onEndCall function provided")};return l.jsx("div",{className:Y("px-4 py-3 !w-full backdrop-blur-xl border-0 shadow-lg",i==="light"?"bg-white/95 border-t border-gray-200":"bg-gray-900/95 border-t border-gray-700"),children:l.jsxs("div",{className:"flex items-center justify-between !w-full mx-auto max-w-4xl",children:[l.jsx("input",{ref:f,type:"file",multiple:!0,onChange:g,className:"hidden",accept:"image/*"}),l.jsx("input",{ref:h,type:"file",onChange:x,className:"hidden",accept:"image/*",capture:"environment"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:m,disabled:o,className:Y("p-3 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",o?"opacity-50 cursor-not-allowed":"hover:shadow-md",i==="light"?"bg-gray-100 hover:bg-gray-200 text-gray-600":"bg-gray-700/50 hover:bg-gray-600/50 text-gray-300"),title:"Attach files",children:l.jsx(R1,{className:"w-5 h-5"})}),d&&l.jsx("button",{onClick:b,disabled:o,className:Y("p-3 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",o?"opacity-50 cursor-not-allowed":"hover:shadow-md",i==="light"?"bg-gray-100 hover:bg-gray-200 text-gray-600":"bg-gray-700/50 hover:bg-gray-600/50 text-gray-300"),title:"Take photo",children:l.jsx(D1,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"flex-1 flex justify-center px-4",children:l.jsx(L0,{capabilities:e,onChatOpenChange:r,onSendMessage:t,theme:i,client:a,className:"border-none py-1 rounded-xl max-w-md w-full"})}),l.jsx("div",{className:"flex items-center",children:l.jsx("button",{onClick:k,disabled:o||!c,className:Y("p-3 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",o||!c?"opacity-50 cursor-not-allowed":"hover:shadow-md","bg-red-500 hover:bg-red-600 text-white"),title:"End call",children:l.jsx(I1,{className:"w-5 h-5"})})})]})})}function O1({onSendMessage:e,onSendAttachments:t,disabled:n,theme:s,onEndChat:r}){const[o,i]=p.useState(""),[a,c]=p.useState(!1),d=p.useRef(null),u=p.useRef(null),[f,h]=p.useState(!1),g=Ve(s);p.useEffect(()=>{const w=()=>{const S=navigator.userAgent.toLowerCase(),M=["android","iphone","ipad","mobile","tablet"].some(y=>S.includes(y)),j="ontouchstart"in window||navigator.maxTouchPoints>0,z=window.innerWidth<=768;h(M||j&&z)};return w(),window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[]);const x=w=>{w.preventDefault(),o.trim()&&!n&&(e(o.trim()),i(""))},m=w=>{w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),x(w))},b=w=>{const S=w.target.files;if(S&&S.length>0){const A=Array.from(S),M=A.filter(j=>j.type.startsWith("image/"));if(M.length===0){console.warn("No valid image files selected");return}M.length!==A.length&&console.warn("Some non-image files were filtered out"),console.log("Selected image files:",M),t(M),d.current&&(d.current.value="")}},k=()=>{!n&&d.current&&d.current.click()},v=()=>{!n&&f&&u.current&&u.current.click()},T=w=>{const S=w.target.files;if(S&&S.length>0){const A=S[0];A.type.startsWith("image/")?t([A]):console.warn("Selected file is not an image"),u.current&&(u.current.value="")}};return l.jsx("div",{className:"px-4 py-3 !w-full backdrop-blur-xl border-0 shadow-lg ",children:l.jsx("form",{onSubmit:x,className:"flex items-center !w-full mx-auto max-w-4xl",children:l.jsxs("div",{className:`flex items-center gap-2 !w-full backdrop-blur-md rounded-full px-3 py-2 shadow-sm hover:shadow-md focus-within:shadow-lg focus-within:ring-2 focus-within:ring-blue-500/30 focus-within:border-blue-500/50 transition-all duration-200 border ${s==="light"?"bg-white/90 border-gray-200":g.chatInput.container}`,children:[l.jsx(ie.button,{type:"button",onClick:k,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${g.chatInput.attachButton}`,disabled:n,"aria-label":"Attach file",children:l.jsx(je.Paperclip,{className:"w-4 h-4"})}),f&&l.jsx(ie.button,{type:"button",onClick:v,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${g.chatInput.attachButton}`,disabled:n,"aria-label":"Take photo",children:l.jsx(je.Camera,{className:"w-4 h-4"})}),l.jsx("input",{ref:d,type:"file",multiple:!0,onChange:b,className:"hidden",accept:"image/*"}),l.jsx("input",{ref:u,type:"file",onChange:T,className:"hidden",accept:"image/*",capture:"environment"}),l.jsx("textarea",{value:o,onChange:w=>i(w.target.value),onKeyDown:m,onFocus:()=>c(!0),onBlur:()=>c(!1),placeholder:"Type your message...",disabled:n,className:`flex-1 px-2 py-1 bg-transparent resize-none min-h-[32px] max-h-20 focus:outline-none text-sm border-0 ${g.chatInput.textarea}`,rows:1,style:{height:"auto",minHeight:"32px"},onInput:w=>{const S=w.target;S.style.height="auto",S.style.height=`${Math.min(S.scrollHeight,80)}px`}}),l.jsx(ie.button,{type:"submit",disabled:n||!o.trim(),whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 flex-shrink-0 ${o.trim()&&!n?g.chatInput.sendButton:s==="light"?"bg-gray-200 text-gray-400 cursor-not-allowed opacity-70":"bg-gray-600/50 text-gray-500 cursor-not-allowed opacity-50"}`,"aria-label":"Send message",children:l.jsx(je.SendHorizontal,{className:"w-4 h-4"})}),r&&l.jsx(ie.button,{type:"button",onClick:r,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 flex-shrink-0 ${g.chatInput.endButton}`,"aria-label":"End chat",children:l.jsx(je.PhoneOff,{className:"w-4 h-4"})})]})})})}function L1({text:e,isComplete:t,isRealTimeStream:n=!1,speed:s=50}){const[r,o]=p.useState(""),[i,a]=p.useState(0);return p.useEffect(()=>{if(n){o(e);return}if(t){o(e);return}if(i<e.length){const c=setTimeout(()=>{o(e.slice(0,i+1)),a(i+1)},s);return()=>clearTimeout(c)}},[e,i,t,s,n]),p.useEffect(()=>{n||(a(0),o(""))},[e,n]),l.jsxs("span",{className:"relative",children:[l.jsx("span",{className:"inline-block",children:r}),!t&&l.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(c=>l.jsx(ie.span,{className:"w-1.5 h-1.5 bg-current rounded-full mx-0.5",animate:{y:[0,-4,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:c*.2,ease:"easeInOut"}},c))})]})}function _1({message:e,theme:t,isOwn:n,isStreaming:s=!1}){var i,a;const r=Ve(t),o=e.sender.name?e.sender.name.split(" ").map(c=>c[0]).join("").toUpperCase().slice(0,2):"U";return l.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-1`,children:l.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 max-w-[85%]`,children:[l.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${n?t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700":t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:o}),l.jsxs("div",{className:`
80
+ export default theme;`}function Ns(e={},...t){const{breakpoints:n,mixins:r={},spacing:s,palette:o={},transitions:i={},typography:a={},shape:c,...d}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":ht(20));const u=Mo(o),f=Ql(e);let h=Oe(f,{mixins:Q1(f.breakpoints,r),palette:u,shadows:oy.slice(),typography:ty(u,a),transitions:ly(i),zIndex:{...dy}});if(h=Oe(h,d),h=t.reduce((p,x)=>Oe(p,x),h),process.env.NODE_ENV!=="production"){const p=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],x=(m,b)=>{let k;for(k in m){const v=m[k];if(p.includes(k)&&Object.keys(v).length>0){if(process.env.NODE_ENV!=="production"){const E=Eo("",k);console.error([`MUI: The \`${b}\` component increases the CSS specificity of the \`${k}\` internal state.`,"You can not override it like this: ",JSON.stringify(m,null,2),"",`Instead, you need to use the '&.${E}' syntax:`,JSON.stringify({root:{[`&.${E}`]:v}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
81
+ `))}m[k]={}}}};Object.keys(h.components).forEach(m=>{const b=h.components[m].styleOverrides;b&&m.startsWith("Mui")&&x(b,m)})}return h.unstable_sxConfig={...Sr,...d==null?void 0:d.unstable_sxConfig},h.unstable_sx=function(x){return Yt({sx:x,theme:this})},h.toRuntimeSource=ad,h}function fy(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const hy=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=fy(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function cd(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function ld(e){return e==="dark"?hy:[]}function my(e){const{palette:t={mode:"light"},opacity:n,overlays:r,...s}=e,o=Mo(t);return{palette:o,opacity:{...cd(o.mode),...n},overlays:r||ld(o.mode),...s}}function gy(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const py=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],yy=e=>(t,n)=>{const r=e.rootSelector||":root",s=e.colorSchemeSelector;let o=s;if(s==="class"&&(o=".%s"),s==="data"&&(o="[data-%s]"),s!=null&&s.startsWith("data-")&&!s.includes("%s")&&(o=`[${s}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const i={};return py(e.cssVarPrefix).forEach(a=>{i[a]=n[a],delete n[a]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:i}}:o?{[o.replace("%s",t)]:i,[`${r}, ${o.replace("%s",t)}`]:n}:{[r]:{...n,...i}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(o)return o.replace("%s",String(t))}return r};function xy(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function N(e,t,n){!e[t]&&n&&(e[t]=n)}function un(e){return typeof e!="string"||!e.startsWith("hsl")?e:sd(e)}function nt(e,t){`${t}Channel`in e||(e[`${t}Channel`]=dn(un(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
82
+ To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function by(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const qe=e=>{try{return e()}catch{}},vy=(e="mui")=>L1(e);function ns(e,t,n,r){if(!t)return;t=t===!0?{}:t;const s=r==="dark"?"dark":"light";if(!n){e[r]=my({...t,palette:{mode:s,...t==null?void 0:t.palette}});return}const{palette:o,...i}=Ns({...n,palette:{mode:s,...t==null?void 0:t.palette}});return e[r]={...t,palette:o,opacity:{...cd(s),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||ld(s)},i}function wy(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:s=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:i=gy,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:c=":root",...d}=e,u=Object.keys(n)[0],f=r||(n.light&&u!=="light"?"light":u),h=vy(o),{[f]:p,light:x,dark:m,...b}=n,k={...b};let v=p;if((f==="dark"&&!("dark"in n)||f==="light"&&!("light"in n))&&(v=!0),!v)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${f}\` option is either missing or invalid.`:ht(21,f));const E=ns(k,v,d,f);x&&!k.light&&ns(k,x,void 0,"light"),m&&!k.dark&&ns(k,m,void 0,"dark");let w={defaultColorScheme:f,...E,cssVarPrefix:o,colorSchemeSelector:a,rootSelector:c,getCssVar:h,colorSchemes:k,font:{...J1(E.typography),...E.font},spacing:by(d.spacing)};Object.keys(w.colorSchemes).forEach(z=>{const y=w.colorSchemes[z].palette,D=_=>{const J=_.split("-"),te=J[1],ee=J[2];return h(_,y[te][ee])};if(y.mode==="light"&&(N(y.common,"background","#fff"),N(y.common,"onBackground","#000")),y.mode==="dark"&&(N(y.common,"background","#000"),N(y.common,"onBackground","#fff")),xy(y,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),y.mode==="light"){N(y.Alert,"errorColor",me(y.error.light,.6)),N(y.Alert,"infoColor",me(y.info.light,.6)),N(y.Alert,"successColor",me(y.success.light,.6)),N(y.Alert,"warningColor",me(y.warning.light,.6)),N(y.Alert,"errorFilledBg",D("palette-error-main")),N(y.Alert,"infoFilledBg",D("palette-info-main")),N(y.Alert,"successFilledBg",D("palette-success-main")),N(y.Alert,"warningFilledBg",D("palette-warning-main")),N(y.Alert,"errorFilledColor",qe(()=>y.getContrastText(y.error.main))),N(y.Alert,"infoFilledColor",qe(()=>y.getContrastText(y.info.main))),N(y.Alert,"successFilledColor",qe(()=>y.getContrastText(y.success.main))),N(y.Alert,"warningFilledColor",qe(()=>y.getContrastText(y.warning.main))),N(y.Alert,"errorStandardBg",ge(y.error.light,.9)),N(y.Alert,"infoStandardBg",ge(y.info.light,.9)),N(y.Alert,"successStandardBg",ge(y.success.light,.9)),N(y.Alert,"warningStandardBg",ge(y.warning.light,.9)),N(y.Alert,"errorIconColor",D("palette-error-main")),N(y.Alert,"infoIconColor",D("palette-info-main")),N(y.Alert,"successIconColor",D("palette-success-main")),N(y.Alert,"warningIconColor",D("palette-warning-main")),N(y.AppBar,"defaultBg",D("palette-grey-100")),N(y.Avatar,"defaultBg",D("palette-grey-400")),N(y.Button,"inheritContainedBg",D("palette-grey-300")),N(y.Button,"inheritContainedHoverBg",D("palette-grey-A100")),N(y.Chip,"defaultBorder",D("palette-grey-400")),N(y.Chip,"defaultAvatarColor",D("palette-grey-700")),N(y.Chip,"defaultIconColor",D("palette-grey-700")),N(y.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),N(y.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),N(y.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),N(y.LinearProgress,"primaryBg",ge(y.primary.main,.62)),N(y.LinearProgress,"secondaryBg",ge(y.secondary.main,.62)),N(y.LinearProgress,"errorBg",ge(y.error.main,.62)),N(y.LinearProgress,"infoBg",ge(y.info.main,.62)),N(y.LinearProgress,"successBg",ge(y.success.main,.62)),N(y.LinearProgress,"warningBg",ge(y.warning.main,.62)),N(y.Skeleton,"bg",`rgba(${D("palette-text-primaryChannel")} / 0.11)`),N(y.Slider,"primaryTrack",ge(y.primary.main,.62)),N(y.Slider,"secondaryTrack",ge(y.secondary.main,.62)),N(y.Slider,"errorTrack",ge(y.error.main,.62)),N(y.Slider,"infoTrack",ge(y.info.main,.62)),N(y.Slider,"successTrack",ge(y.success.main,.62)),N(y.Slider,"warningTrack",ge(y.warning.main,.62));const _=Zn(y.background.default,.8);N(y.SnackbarContent,"bg",_),N(y.SnackbarContent,"color",qe(()=>y.getContrastText(_))),N(y.SpeedDialAction,"fabHoverBg",Zn(y.background.paper,.15)),N(y.StepConnector,"border",D("palette-grey-400")),N(y.StepContent,"border",D("palette-grey-400")),N(y.Switch,"defaultColor",D("palette-common-white")),N(y.Switch,"defaultDisabledColor",D("palette-grey-100")),N(y.Switch,"primaryDisabledColor",ge(y.primary.main,.62)),N(y.Switch,"secondaryDisabledColor",ge(y.secondary.main,.62)),N(y.Switch,"errorDisabledColor",ge(y.error.main,.62)),N(y.Switch,"infoDisabledColor",ge(y.info.main,.62)),N(y.Switch,"successDisabledColor",ge(y.success.main,.62)),N(y.Switch,"warningDisabledColor",ge(y.warning.main,.62)),N(y.TableCell,"border",ge(Hn(y.divider,1),.88)),N(y.Tooltip,"bg",Hn(y.grey[700],.92))}if(y.mode==="dark"){N(y.Alert,"errorColor",ge(y.error.light,.6)),N(y.Alert,"infoColor",ge(y.info.light,.6)),N(y.Alert,"successColor",ge(y.success.light,.6)),N(y.Alert,"warningColor",ge(y.warning.light,.6)),N(y.Alert,"errorFilledBg",D("palette-error-dark")),N(y.Alert,"infoFilledBg",D("palette-info-dark")),N(y.Alert,"successFilledBg",D("palette-success-dark")),N(y.Alert,"warningFilledBg",D("palette-warning-dark")),N(y.Alert,"errorFilledColor",qe(()=>y.getContrastText(y.error.dark))),N(y.Alert,"infoFilledColor",qe(()=>y.getContrastText(y.info.dark))),N(y.Alert,"successFilledColor",qe(()=>y.getContrastText(y.success.dark))),N(y.Alert,"warningFilledColor",qe(()=>y.getContrastText(y.warning.dark))),N(y.Alert,"errorStandardBg",me(y.error.light,.9)),N(y.Alert,"infoStandardBg",me(y.info.light,.9)),N(y.Alert,"successStandardBg",me(y.success.light,.9)),N(y.Alert,"warningStandardBg",me(y.warning.light,.9)),N(y.Alert,"errorIconColor",D("palette-error-main")),N(y.Alert,"infoIconColor",D("palette-info-main")),N(y.Alert,"successIconColor",D("palette-success-main")),N(y.Alert,"warningIconColor",D("palette-warning-main")),N(y.AppBar,"defaultBg",D("palette-grey-900")),N(y.AppBar,"darkBg",D("palette-background-paper")),N(y.AppBar,"darkColor",D("palette-text-primary")),N(y.Avatar,"defaultBg",D("palette-grey-600")),N(y.Button,"inheritContainedBg",D("palette-grey-800")),N(y.Button,"inheritContainedHoverBg",D("palette-grey-700")),N(y.Chip,"defaultBorder",D("palette-grey-700")),N(y.Chip,"defaultAvatarColor",D("palette-grey-300")),N(y.Chip,"defaultIconColor",D("palette-grey-300")),N(y.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),N(y.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),N(y.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),N(y.LinearProgress,"primaryBg",me(y.primary.main,.5)),N(y.LinearProgress,"secondaryBg",me(y.secondary.main,.5)),N(y.LinearProgress,"errorBg",me(y.error.main,.5)),N(y.LinearProgress,"infoBg",me(y.info.main,.5)),N(y.LinearProgress,"successBg",me(y.success.main,.5)),N(y.LinearProgress,"warningBg",me(y.warning.main,.5)),N(y.Skeleton,"bg",`rgba(${D("palette-text-primaryChannel")} / 0.13)`),N(y.Slider,"primaryTrack",me(y.primary.main,.5)),N(y.Slider,"secondaryTrack",me(y.secondary.main,.5)),N(y.Slider,"errorTrack",me(y.error.main,.5)),N(y.Slider,"infoTrack",me(y.info.main,.5)),N(y.Slider,"successTrack",me(y.success.main,.5)),N(y.Slider,"warningTrack",me(y.warning.main,.5));const _=Zn(y.background.default,.98);N(y.SnackbarContent,"bg",_),N(y.SnackbarContent,"color",qe(()=>y.getContrastText(_))),N(y.SpeedDialAction,"fabHoverBg",Zn(y.background.paper,.15)),N(y.StepConnector,"border",D("palette-grey-600")),N(y.StepContent,"border",D("palette-grey-600")),N(y.Switch,"defaultColor",D("palette-grey-300")),N(y.Switch,"defaultDisabledColor",D("palette-grey-600")),N(y.Switch,"primaryDisabledColor",me(y.primary.main,.55)),N(y.Switch,"secondaryDisabledColor",me(y.secondary.main,.55)),N(y.Switch,"errorDisabledColor",me(y.error.main,.55)),N(y.Switch,"infoDisabledColor",me(y.info.main,.55)),N(y.Switch,"successDisabledColor",me(y.success.main,.55)),N(y.Switch,"warningDisabledColor",me(y.warning.main,.55)),N(y.TableCell,"border",me(Hn(y.divider,1),.68)),N(y.Tooltip,"bg",Hn(y.grey[700],.92))}nt(y.background,"default"),nt(y.background,"paper"),nt(y.common,"background"),nt(y.common,"onBackground"),nt(y,"divider"),Object.keys(y).forEach(_=>{const J=y[_];_!=="tonalOffset"&&J&&typeof J=="object"&&(J.main&&N(y[_],"mainChannel",dn(un(J.main))),J.light&&N(y[_],"lightChannel",dn(un(J.light))),J.dark&&N(y[_],"darkChannel",dn(un(J.dark))),J.contrastText&&N(y[_],"contrastTextChannel",dn(un(J.contrastText))),_==="text"&&(nt(y[_],"primary"),nt(y[_],"secondary")),_==="action"&&(J.active&&nt(y[_],"active"),J.selected&&nt(y[_],"selected")))})}),w=t.reduce((z,y)=>Oe(z,y),w);const S={prefix:o,disableCssColorScheme:s,shouldSkipGeneratingVar:i,getSelector:yy(w)},{vars:A,generateThemeVars:M,generateStyleSheets:j}=z1(w,S);return w.vars=A,Object.entries(w.colorSchemes[w.defaultColorScheme]).forEach(([z,y])=>{w[z]=y}),w.generateThemeVars=M,w.generateStyleSheets=j,w.generateSpacing=function(){return Jl(d.spacing,Co(this))},w.getColorSchemeSelector=U1(a),w.spacing=w.generateSpacing(),w.shouldSkipGeneratingVar=i,w.unstable_sxConfig={...Sr,...d==null?void 0:d.unstable_sxConfig},w.unstable_sx=function(y){return Yt({sx:y,theme:this})},w.toRuntimeSource=ad,w}function Ua(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Mo({...n===!0?{}:n.palette,mode:t})})}function Sy(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:s=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...i}=e,a=o||"light",c=s==null?void 0:s[a],d={...s,...n?{[a]:{...typeof c!="boolean"&&c,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return Ns(e,...t);let u=n;"palette"in e||d[a]&&(d[a]!==!0?u=d[a].palette:a==="dark"&&(u={mode:"dark"}));const f=Ns({...e,palette:u},...t);return f.defaultColorScheme=a,f.colorSchemes=d,f.palette.mode==="light"&&(f.colorSchemes.light={...d.light!==!0&&d.light,palette:f.palette},Ua(f,"dark",d.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...d.dark!==!0&&d.dark,palette:f.palette},Ua(f,"light",d.light)),f}return!n&&!("light"in d)&&a==="light"&&(d.light=!0),wy({...i,colorSchemes:d,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}const Cy=Sy(),ky="$$material";function Ey(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Ty=e=>Ey(e)&&e!=="classes",Ay=E1({themeId:ky,defaultTheme:Cy,rootShouldForwardProp:Ty}),jy=O1;process.env.NODE_ENV!=="production"&&(ce.node,ce.object.isRequired);function My(e){return F1(e)}function Py(e){return Eo("MuiSvgIcon",e)}v1("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Vy=e=>{const{color:t,fontSize:n,classes:r}=e,s={root:["root",t!=="inherit"&&`color${At(t)}`,`fontSize${At(n)}`]};return u0(s,Py,r)},Ny=Ay("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${At(n.color)}`],t[`fontSize${At(n.fontSize)}`]]}})(jy(({theme:e})=>{var t,n,r,s,o,i,a,c,d,u,f,h,p,x;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(s=(t=e.transitions)==null?void 0:t.create)==null?void 0:s.call(t,"fill",{duration:(r=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:m=>!m.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((i=(o=e.typography)==null?void 0:o.pxToRem)==null?void 0:i.call(o,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((c=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:c.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((u=(d=e.typography)==null?void 0:d.pxToRem)==null?void 0:u.call(d,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,m])=>m&&m.main).map(([m])=>{var b,k;return{props:{color:m},style:{color:(k=(b=(e.vars??e).palette)==null?void 0:b[m])==null?void 0:k.main}}}),{props:{color:"action"},style:{color:(h=(f=(e.vars??e).palette)==null?void 0:f.action)==null?void 0:h.active}},{props:{color:"disabled"},style:{color:(x=(p=(e.vars??e).palette)==null?void 0:p.action)==null?void 0:x.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),cr=g.forwardRef(function(t,n){const r=My({props:t,name:"MuiSvgIcon"}),{children:s,className:o,color:i="inherit",component:a="svg",fontSize:c="medium",htmlColor:d,inheritViewBox:u=!1,titleAccess:f,viewBox:h="0 0 24 24",...p}=r,x=g.isValidElement(s)&&s.type==="svg",m={...r,color:i,component:a,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:h,hasSvgAsChild:x},b={};u||(b.viewBox=h);const k=Vy(m);return l.jsxs(Ny,{as:a,className:$s(k.root,o),focusable:"false",color:d,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...b,...p,...x&&s.props,ownerState:m,children:[x?s.props.children:s,f?l.jsx("title",{children:f}):null]})});process.env.NODE_ENV!=="production"&&(cr.propTypes={children:ce.node,classes:ce.object,className:ce.string,color:ce.oneOfType([ce.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),ce.string]),component:ce.elementType,fontSize:ce.oneOfType([ce.oneOf(["inherit","large","medium","small"]),ce.string]),htmlColor:ce.string,inheritViewBox:ce.bool,shapeRendering:ce.string,sx:ce.oneOfType([ce.arrayOf(ce.oneOfType([ce.func,ce.object,ce.bool])),ce.func,ce.object]),titleAccess:ce.string,viewBox:ce.string});cr.muiName="SvgIcon";function nn(e,t){function n(r,s){return l.jsx(cr,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:s,...r,children:e})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=cr.muiName,g.memo(g.forwardRef(n))}const Ry=nn(l.jsx("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"}),"AttachFile"),Iy=nn(l.jsx("path",{d:"M12 9c-1.6 0-3.15.25-4.6.72v3.1c0 .39-.23.74-.56.9-.98.49-1.87 1.12-2.66 1.85-.18.18-.43.28-.7.28-.28 0-.53-.11-.71-.29L.29 13.08c-.18-.17-.29-.42-.29-.7s.11-.53.29-.71C3.34 8.78 7.46 7 12 7s8.66 1.78 11.71 4.67c.18.18.29.43.29.71s-.11.53-.29.71l-2.48 2.48c-.18.18-.43.29-.71.29-.27 0-.52-.11-.7-.28-.79-.74-1.69-1.36-2.67-1.85-.33-.16-.56-.5-.56-.9v-3.1C15.15 9.25 13.6 9 12 9"}),"CallEnd"),Dy=nn([l.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),l.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"CameraAlt"),dd=nn(l.jsx("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M6 9h12v2H6zm8 5H6v-2h8zm4-6H6V6h12z"}),"Chat"),ud=nn(l.jsx("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3m5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72z"}),"Mic"),fd=nn(l.jsx("path",{d:"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11z"}),"Videocam"),$y=({disabled:e,capabilities:t,sessionStarted:n,ref:r,participantName:s="User",loadingText:o="Waiting for agent to connect...",theme:i="vox",client:a,displayType:c="widget",onBack:d})=>{var K,R,X,V,H,q,P;const[u,f]=C.useState(!1),[h,p]=C.useState(!1),[x,m]=C.useState(!1),[b,k]=C.useState(()=>{var O;const T=(O=a==null?void 0:a.getCurrentInteraction)==null?void 0:O.call(a);return console.log("SessionView: Initializing with existing interaction:",(T==null?void 0:T.methodName)||"none"),T||null}),{messages:v,send:E}=Jp(),w=C.useRef(null),S=C.useRef(null),{agent:{isActive:A=!1}={}}=a?Wl(a):{agent:{isActive:!1}},M=Ve(i),j=C.useMemo(()=>a&&typeof a.getCurrentSession=="function"?!!a.getCurrentSession():!1,[a]),z=C.useMemo(()=>a&&typeof a.getIsAgentConnected=="function"&&a.getIsAgentConnected()||x,[a,x]),y=A||z;C.useEffect(()=>{var T,O;console.log("🤖 SessionView agent state:",{isAgentActive:A,hasActiveSession:j,isAgentActuallyConnected:z,effectiveAgentActive:y,sessionStarted:n,clientSession:(O=(T=a==null?void 0:a.getCurrentSession)==null?void 0:T.call(a))==null?void 0:O.id})},[A,j,z,y,n,a]),C.useEffect(()=>{console.log("🤖 Agent active state changed:",A)},[A]),C.useEffect(()=>{console.log("📋 Session state changed:",{sessionStarted:n,disabled:e,participantName:s,effectiveAgentActive:y,chatOpen:u,currentInteraction:(b==null?void 0:b.methodName)||"none"})},[n,e,s,y,u,b]),C.useEffect(()=>{if(n&&!y){console.log("⏰ Starting agent timeout detection...");const T=setTimeout(()=>{j&&!y&&(console.log("⚡ Fallback: Assuming agent is connected after 5 seconds with active session"),m(!0),p(!1))},5e3),O=setTimeout(()=>{y||(console.log("⚠️ Agent timeout: Agent did not become active within 30 seconds"),p(!0))},3e4);return()=>{clearTimeout(T),clearTimeout(O)}}else y&&(console.log("✅ Agent is active, clearing timeout"),p(!1))},[n,y,j]),C.useEffect(()=>{if(!a)return;const T=()=>{console.log("🔄 Client connection state changed:",a.connected)},O=F=>{console.log("🔴 Client disconnected:",F),k(null),f(!1),p(!1)};return a.on("connection.connected",T),a.on("connection.disconnected",O),()=>{a.off("connection.connected",T),a.off("connection.disconnected",O)}},[a]),C.useEffect(()=>{if(!a)return;const T=I=>{console.log("🤖 SessionView: Agent connected!",I),m(!0),p(!1)},O=I=>{console.log("🗣️ SessionView: Agent speaking detected!",I),x||(m(!0),p(!1))},F=I=>{console.log("🤔 SessionView: Agent thinking detected!",I),x||(m(!0),p(!1))},$=()=>{console.log("🤖 SessionView: Agent disconnected"),m(!1)};return a.on("agent.connected",T),a.on("agent.speaking",O),a.on("agent.thinking",F),a.on("connection.disconnected",$),()=>{a.off("agent.connected",T),a.off("agent.speaking",O),a.off("agent.thinking",F),a.off("connection.disconnected",$)}},[a,x]),C.useEffect(()=>{if(!a)return;const T=I=>{console.log("🎯 SessionView: RPC Interaction started:",I);const U=a.getCurrentInteraction();U&&(console.log("📱 SessionView: Setting current interaction:",U.methodName,"mode:",U.presentationMode),k(U))},O=I=>{console.log("✅ SessionView: RPC Interaction completed:",I),k(null)},F=async I=>{console.log("⏰ SessionView: RPC Interaction timeout:",I),k(null)},$=async I=>{console.log("❌ SessionView: RPC Interaction dismissed:",I),k(null)};return a.on("rpc.interaction.started",T),a.on("rpc.interaction.completed",O),a.on("rpc.interaction.timeout",F),a.on("rpc.interaction.dismissed",$),()=>{a.off("rpc.interaction.started",T),a.off("rpc.interaction.completed",O),a.off("rpc.interaction.timeout",F),a.off("rpc.interaction.dismissed",$)}},[a]),C.useEffect(()=>{if(!a)return;const T=a.getCurrentInteraction();T?(console.log("🔄 SessionView: Syncing with existing interaction:",T.methodName),k(T)):k(null)},[a]),C.useEffect(()=>{console.log("🎭 SessionView: Current interaction changed:",(b==null?void 0:b.methodName)||"none","mode:",(b==null?void 0:b.presentationMode)||"none")},[b]),C.useEffect(()=>{var T,O,F;console.log("📱 SessionView: Display type changed to:",c),console.log("📱 SessionView: Current session state during display change:",{sessionStarted:n,effectiveAgentActive:y,hasSession:!!((T=a==null?void 0:a.getCurrentSession)!=null&&T.call(a)),sessionId:(F=(O=a==null?void 0:a.getCurrentSession)==null?void 0:O.call(a))==null?void 0:F.id})},[c,n,y,a]),C.useEffect(()=>{console.log("💬 SessionView: Chat open state changed:",u)},[u]),C.useEffect(()=>{b&&u&&(console.log("🎭 SessionView: Interactive UI appeared, closing chat"),f(!1))},[b,u]),Qp(),C.useEffect(()=>{w.current&&u&&v.length>0&&(console.log("📜 SessionView: Auto-scrolling to latest message, count:",v.length),setTimeout(()=>{if(w.current){let T=w.current.parentElement;for(;T&&T.scrollHeight<=T.clientHeight;)T=T.parentElement;T?(console.log("📜 SessionView: Scrolling container found, scrolling to bottom"),T.scrollTo({top:T.scrollHeight,behavior:"smooth"})):(console.log("📜 SessionView: Using fallback scroll method"),w.current.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"}))}},100))},[v.length,u]),C.useEffect(()=>{var F,$;console.log("📝 SessionView: Messages updated, count:",v.length),v.length>0&&console.log("📝 SessionView: Latest messages:",v.slice(-3).map(I=>{var U,B,oe,L,ae,xe,Ie;return{id:I.id,message:I.message,timestamp:I.timestamp,from:((U=I.from)==null?void 0:U.name)||((B=I.from)==null?void 0:B.identity),fromType:I.from===void 0?"unknown":"participant",isLocal:((oe=I.from)==null?void 0:oe.identity)===((xe=(ae=(L=a==null?void 0:a.getCurrentSession)==null?void 0:L.call(a))==null?void 0:ae.localParticipant)==null?void 0:xe.identity),messageLength:((Ie=I.message)==null?void 0:Ie.length)||0}}));const T=((F=a==null?void 0:a.getTranscriptions)==null?void 0:F.call(a))||[],O=(($=a==null?void 0:a.getChatMessages)==null?void 0:$.call(a))||[];console.log("📝 SessionView: Raw transcriptions count:",T.length),console.log("📝 SessionView: Raw chat messages count:",O.length)},[v.length,v,a]),C.useEffect(()=>{console.log("💬 SessionView: Chat state changed:",{chatOpen:u,messagesCount:v.length,displayType:c,hasMessages:v.length>0})},[u,v.length,c]);async function D(T){await E(T)}const _=C.useCallback(T=>{console.log("📝 SessionView: Adding local message for voice session context:",T)},[]),J=C.useCallback(async T=>{try{a&&typeof a.sendAttachments=="function"&&(await a.sendAttachments(T),console.log("📎 SessionView: Attachments sent successfully:",T.map(O=>O.name)))}catch(O){console.error("❌ SessionView: Failed to send attachments:",O)}},[a]),te=C.useCallback(()=>{try{console.log("📞 SessionView: Ending call..."),console.log("📞 SessionView: Current state before ending:",{sessionStarted:n,effectiveAgentActive:y,chatOpen:u,currentInteraction:b==null?void 0:b.methodName,hasOnBack:!!d}),b&&(console.log("🎭 SessionView: Dismissing current interaction:",b.methodName),k(null),a&&typeof a.dismissCurrentInteraction=="function"&&a.dismissCurrentInteraction()),f(!1),p(!1),console.log("✅ SessionView: Local state reset"),a&&typeof a.endSession=="function"&&(a.endSession(),console.log("✅ SessionView: Session ended via client.endSession()")),a&&typeof a.disconnect=="function"&&(a.disconnect(),console.log("✅ SessionView: Client disconnected")),d?(console.log("🔄 SessionView: Calling onBack to return to welcome..."),setTimeout(()=>{d(),console.log("✅ SessionView: onBack called")},150)):console.warn("⚠️ SessionView: No onBack function provided - cannot return to welcome"),console.log("🏁 SessionView: Call ended and cleanup completed")}catch(T){console.error("❌ SessionView: Failed to end call:",T),k(null),f(!1),p(!1),d&&(console.log("🔄 SessionView: Error occurred, still calling onBack..."),d())}},[a,d,b,n,y,u]);C.useEffect(()=>(console.log("🔄 SessionView: Component mounted/props changed:",{sessionStarted:n,disabled:e,participantName:s,displayType:c,hasOnBack:!!d,hasClient:!!a}),()=>{console.log("🧹 SessionView: Component unmounting or props changing")}),[n,e,s,c,d,a]),C.useEffect(()=>{console.log("🔗 SessionView: onBack prop:",{hasOnBack:!!d,onBackType:typeof d})},[d]),C.useEffect(()=>{var O,F;const T=((F=(O=a==null?void 0:a.getCurrentSession)==null?void 0:O.call(a))==null?void 0:F.id)||null;S.current&&!T&&console.warn("⚠️ SessionView: Session was lost unexpectedly!",{previousSession:S.current,currentSession:T,displayType:c,sessionStarted:n,effectiveAgentActive:y}),S.current=T},[a,c,n,y]);const ee=Y("w-full flex flex-col items-center justify-center",c==="fullscreen"?"w-full max-w-none mx-0 h-full":"w-full mx-auto",M.main,c==="fullscreen"?"max-w-none":"","overflow-hidden","h-full"),re=d&&(c==="popup"||c==="fullscreen");return l.jsxs("main",{ref:r,className:Y(ee,"relative",e&&"pointer-events-none opacity-50"),style:{minHeight:0},children:[re&&l.jsx("div",{className:`flex items-center justify-between w-full p-4 border-b ${((K=M.chatHeader)==null?void 0:K.container)||"border-gray-200"}`,children:l.jsx("div",{className:"flex items-center",children:l.jsxs("div",{children:[l.jsx("h3",{className:`font-semibold ${M.text.primary}`,children:"Voice Session"}),l.jsx("p",{className:`text-sm ${M.text.muted}`,children:s})]})})}),l.jsxs("div",{className:"w-full flex-1 flex flex-col items-center px-0 min-h-0 overflow-hidden",children:[!y&&l.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full min-h-[180px]",children:[l.jsx(ie.div,{animate:{rotate:360,scale:[1,1.1,1]},transition:{rotate:{duration:2,repeat:1/0,ease:"linear"},scale:{duration:1,repeat:1/0,ease:"easeInOut"}},className:"w-12 h-12 mb-4",children:l.jsx(vo,{className:M.spinner,weight:"bold"})}),l.jsx(ie.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-sm opacity-80 ${M.text.muted} text-center max-w-xs`,children:h?"Agent is taking longer than expected...":o}),l.jsx(ie.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${M.text.muted} mt-2 text-center opacity-60`,children:h?"Please check your connection or try again.":"Agent is connecting... This may take a moment."}),h&&d&&l.jsx(ie.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:d,className:`mt-4 px-4 py-2 rounded-lg ${((R=M.chatHeader)==null?void 0:R.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]}),y&&l.jsxs(l.Fragment,{children:[u&&l.jsxs("div",{className:Y("absolute inset-0 w-full h-full flex flex-col transition-[opacity,translate] duration-300 ease-out z-10",i==="light"?"bg-white":"bg-gray-900/95 backdrop-blur-sm",u?"translate-y-0 opacity-100 delay-200":"translate-y-10 opacity-0"),children:[l.jsxs("div",{className:Y("flex-shrink-0 px-4 py-3 border-b",c==="fullscreen"?"px-8":"px-5",((X=M.chatHeader)==null?void 0:X.container)||"border-gray-200 dark:border-gray-700"),children:[l.jsx("h3",{className:Y("font-semibold text-lg",((V=M.text)==null?void 0:V.primary)||"text-gray-900 dark:text-white"),children:"Transcription & Chat"}),l.jsxs("p",{className:Y("text-sm",((H=M.text)==null?void 0:H.muted)||"text-gray-600 dark:text-gray-400"),children:[v.length," messages"]})]}),l.jsx("div",{className:Y("flex-1 flex flex-col min-h-0",c==="fullscreen"?"px-8":"px-5"),children:l.jsx(Up,{className:"flex-1 flex flex-col min-h-0 h-full",children:l.jsxs("div",{className:`flex-1 flex flex-col h-full ${Y("overflow-y-auto scrollbar-hide py-4")}`,style:{scrollbarWidth:"none",scrollBehavior:"smooth",paddingBottom:"120px"},children:[v.length===0&&l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:Y("text-lg font-medium mb-2",((q=M.text)==null?void 0:q.primary)||"text-gray-900 dark:text-white"),children:"Start Speaking"}),l.jsx("p",{className:Y("text-sm",((P=M.text)==null?void 0:P.muted)||"text-gray-600 dark:text-gray-400"),children:"Your conversation will appear here"})]})}),v.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex-1 min-h-4"}),l.jsx("div",{ref:w,className:"space-y-4 relative whitespace-pre-wrap z-0",children:l.jsx(Ut,{mode:"popLayout",children:v.map((T,O)=>l.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3,ease:"easeOut",delay:O*.02},layout:!0,children:l.jsx(Bp,{participantName:s,entry:T})},T.id||`message-${O}`))})})]})]})})})]}),!u&&l.jsxs("div",{className:Y("flex-1 flex flex-col items-center w-full h-full min-h-0",(b==null?void 0:b.presentationMode)==="embedded"?"justify-end":"justify-center"),children:[l.jsx(ie.div,{className:"w-full flex justify-center",animate:{y:(b==null?void 0:b.presentationMode)==="embedded"?-8:0},transition:{duration:.3,ease:"easeOut"},children:l.jsx(Xp,{chatOpen:u,client:a})}),l.jsx(Ut,{mode:"wait",children:b&&b.presentationMode==="embedded"&&l.jsx(ie.div,{initial:{opacity:0,y:20,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:20,height:0},transition:{duration:.3,ease:"easeOut"},className:Y("w-full relative mt-4 flex justify-center",c==="fullscreen"?"max-w-4xl":"max-w-md"),children:l.jsx("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl border border-white/20 shadow-lg overflow-hidden",children:l.jsx(Kt,{interaction:b,theme:i,onDismiss:()=>{var T;return(T=a==null?void 0:a.dismissCurrentInteraction)==null?void 0:T.call(a)},client:a,addLocalMessage:_})})},`embedded-${b.methodName}`)})]})]})]}),l.jsx(Ut,{mode:"wait",children:b&&b.presentationMode!=="embedded"&&!u&&l.jsx("div",{className:Y("absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm",c==="fullscreen"?"bg-black/70":"bg-black/50"),children:l.jsx(ie.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},className:Y("relative w-full overflow-hidden",c==="fullscreen"?"max-w-2xl mx-8 max-h-[85vh]":"max-w-lg mx-4 max-h-[80vh]","bg-white dark:bg-gray-900 rounded-2xl shadow-2xl","border border-gray-200 dark:border-gray-700"),children:l.jsx(Kt,{interaction:b,theme:i,onDismiss:()=>{var T;return(T=a==null?void 0:a.dismissCurrentInteraction)==null?void 0:T.call(a)},client:a,addLocalMessage:_})},`modal-${b.methodName}`)})}),l.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"absolute bottom-0 left-0 right-0 flex-shrink-0 w-full z-20",children:l.jsx(Fy,{capabilities:t,onSendMessage:D,onSendAttachments:J,onEndCall:te,onChatOpenChange:f,disabled:e,theme:i,client:a,sessionStarted:n})})]})};function Fy({capabilities:e,onSendMessage:t,onSendAttachments:n,onEndCall:r,onChatOpenChange:s,disabled:o=!1,theme:i,client:a,sessionStarted:c=!1}){const[d,u]=C.useState(!1),f=C.useRef(null),h=C.useRef(null);C.useEffect(()=>{const v=()=>{const E=navigator.userAgent.toLowerCase(),S=["android","iphone","ipad","mobile","tablet"].some(j=>E.includes(j)),A="ontouchstart"in window||navigator.maxTouchPoints>0,M=window.innerWidth<=768;u(S||A&&M)};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);const p=v=>{const E=v.target.files;if(E&&E.length>0){const S=Array.from(E).filter(A=>A.type.startsWith("image/"));if(S.length===0){console.warn("No valid image files selected");return}n&&n(S),f.current&&(f.current.value="")}},x=v=>{const E=v.target.files;if(E&&E.length>0){const w=E[0];w.type.startsWith("image/")&&n&&n([w]),h.current&&(h.current.value="")}},m=()=>{!o&&f.current&&f.current.click()},b=()=>{!o&&d&&h.current&&h.current.click()},k=()=>{console.log("🔴 VoiceControlPanel: End call button clicked"),console.log("🔴 VoiceControlPanel: Current state:",{disabled:o,sessionStarted:c,hasOnEndCall:!!r}),r?r():console.warn("⚠️ VoiceControlPanel: No onEndCall function provided")};return l.jsx("div",{className:Y("px-4 py-3 !w-full backdrop-blur-xl border-0 shadow-lg",i==="light"?"bg-white/95 border-t border-gray-200":"bg-gray-900/95 border-t border-gray-700"),children:l.jsxs("div",{className:"flex items-center justify-between !w-full mx-auto max-w-4xl",children:[l.jsx("input",{ref:f,type:"file",multiple:!0,onChange:p,className:"hidden",accept:"image/*"}),l.jsx("input",{ref:h,type:"file",onChange:x,className:"hidden",accept:"image/*",capture:"environment"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:m,disabled:o,className:Y("p-3 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",o?"opacity-50 cursor-not-allowed":"hover:shadow-md",i==="light"?"bg-gray-100 hover:bg-gray-200 text-gray-600":"bg-gray-700/50 hover:bg-gray-600/50 text-gray-300"),title:"Attach files",children:l.jsx(Ry,{className:"w-5 h-5"})}),d&&l.jsx("button",{onClick:b,disabled:o,className:Y("p-3 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",o?"opacity-50 cursor-not-allowed":"hover:shadow-md",i==="light"?"bg-gray-100 hover:bg-gray-200 text-gray-600":"bg-gray-700/50 hover:bg-gray-600/50 text-gray-300"),title:"Take photo",children:l.jsx(Dy,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"flex-1 flex justify-center px-4",children:l.jsx(Lp,{capabilities:e,onChatOpenChange:s,onSendMessage:t,theme:i,client:a,className:"border-none py-1 rounded-xl max-w-md w-full"})}),l.jsx("div",{className:"flex items-center",children:l.jsx("button",{onClick:k,disabled:o||!c,className:Y("p-3 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",o||!c?"opacity-50 cursor-not-allowed":"hover:shadow-md","bg-red-500 hover:bg-red-600 text-white"),title:"End call",children:l.jsx(Iy,{className:"w-5 h-5"})})})]})})}function Oy({onSendMessage:e,onSendAttachments:t,disabled:n,theme:r,onEndChat:s}){const[o,i]=g.useState(""),[a,c]=g.useState(!1),d=g.useRef(null),u=g.useRef(null),[f,h]=g.useState(!1),p=Ve(r);g.useEffect(()=>{const w=()=>{const S=navigator.userAgent.toLowerCase(),M=["android","iphone","ipad","mobile","tablet"].some(y=>S.includes(y)),j="ontouchstart"in window||navigator.maxTouchPoints>0,z=window.innerWidth<=768;h(M||j&&z)};return w(),window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[]);const x=w=>{w.preventDefault(),o.trim()&&!n&&(e(o.trim()),i(""))},m=w=>{w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),x(w))},b=w=>{const S=w.target.files;if(S&&S.length>0){const A=Array.from(S),M=A.filter(j=>j.type.startsWith("image/"));if(M.length===0){console.warn("No valid image files selected");return}M.length!==A.length&&console.warn("Some non-image files were filtered out"),console.log("Selected image files:",M),t(M),d.current&&(d.current.value="")}},k=()=>{!n&&d.current&&d.current.click()},v=()=>{!n&&f&&u.current&&u.current.click()},E=w=>{const S=w.target.files;if(S&&S.length>0){const A=S[0];A.type.startsWith("image/")?t([A]):console.warn("Selected file is not an image"),u.current&&(u.current.value="")}};return l.jsx("div",{className:"px-4 py-3 !w-full backdrop-blur-xl border-0 shadow-lg ",children:l.jsx("form",{onSubmit:x,className:"flex items-center !w-full mx-auto max-w-4xl",children:l.jsxs("div",{className:`flex items-center gap-2 !w-full backdrop-blur-md rounded-full px-3 py-2 shadow-sm hover:shadow-md focus-within:shadow-lg focus-within:ring-2 focus-within:ring-blue-500/30 focus-within:border-blue-500/50 transition-all duration-200 border ${r==="light"?"bg-white/90 border-gray-200":p.chatInput.container}`,children:[l.jsx(ie.button,{type:"button",onClick:k,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${p.chatInput.attachButton}`,disabled:n,"aria-label":"Attach file",children:l.jsx(je.Paperclip,{className:"w-4 h-4"})}),f&&l.jsx(ie.button,{type:"button",onClick:v,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${p.chatInput.attachButton}`,disabled:n,"aria-label":"Take photo",children:l.jsx(je.Camera,{className:"w-4 h-4"})}),l.jsx("input",{ref:d,type:"file",multiple:!0,onChange:b,className:"hidden",accept:"image/*"}),l.jsx("input",{ref:u,type:"file",onChange:E,className:"hidden",accept:"image/*",capture:"environment"}),l.jsx("textarea",{value:o,onChange:w=>i(w.target.value),onKeyDown:m,onFocus:()=>c(!0),onBlur:()=>c(!1),placeholder:"Type your message...",disabled:n,className:`flex-1 px-2 py-1 bg-transparent resize-none min-h-[32px] max-h-20 focus:outline-none text-sm border-0 ${p.chatInput.textarea}`,rows:1,style:{height:"auto",minHeight:"32px"},onInput:w=>{const S=w.target;S.style.height="auto",S.style.height=`${Math.min(S.scrollHeight,80)}px`}}),l.jsx(ie.button,{type:"submit",disabled:n||!o.trim(),whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 flex-shrink-0 ${o.trim()&&!n?p.chatInput.sendButton:r==="light"?"bg-gray-200 text-gray-400 cursor-not-allowed opacity-70":"bg-gray-600/50 text-gray-500 cursor-not-allowed opacity-50"}`,"aria-label":"Send message",children:l.jsx(je.SendHorizontal,{className:"w-4 h-4"})}),s&&l.jsx(ie.button,{type:"button",onClick:s,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 flex-shrink-0 ${p.chatInput.endButton}`,"aria-label":"End chat",children:l.jsx(je.PhoneOff,{className:"w-4 h-4"})})]})})})}function Ly({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[s,o]=g.useState(""),[i,a]=g.useState(0);return g.useEffect(()=>{if(n){o(e);return}if(t){o(e);return}if(i<e.length){const c=setTimeout(()=>{o(e.slice(0,i+1)),a(i+1)},r);return()=>clearTimeout(c)}},[e,i,t,r,n]),g.useEffect(()=>{n||(a(0),o(""))},[e,n]),l.jsxs("span",{className:"relative",children:[l.jsx("span",{className:"inline-block",children:s}),!t&&l.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(c=>l.jsx(ie.span,{className:"w-1.5 h-1.5 bg-current rounded-full mx-0.5",animate:{y:[0,-4,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:c*.2,ease:"easeInOut"}},c))})]})}function _y({message:e,theme:t,isOwn:n,isStreaming:r=!1}){var i,a;const s=Ve(t),o=e.sender.name?e.sender.name.split(" ").map(c=>c[0]).join("").toUpperCase().slice(0,2):"U";return l.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-1`,children:l.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 max-w-[85%]`,children:[l.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${n?t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700":t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:o}),l.jsxs("div",{className:`
83
83
  relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover
84
- ${n?`${r.chatMessage.own} rounded-br-md`:`${r.chatMessage.other} rounded-bl-md`}
85
- ${s?"shimmer":""}
84
+ ${n?`${s.chatMessage.own} rounded-br-md`:`${s.chatMessage.other} rounded-bl-md`}
85
+ ${r?"shimmer":""}
86
86
  transition-all duration-200 group-hover:scale-[1.02]
87
- `,style:{wordWrap:"break-word",overflowWrap:"break-word"},children:[l.jsx("div",{className:"whitespace-pre-wrap break-words leading-relaxed text-sm",children:((i=e.metadata)==null?void 0:i.type)==="attachment"?l.jsx(H1,{message:e,theme:t,isOwn:n}):s&&!n?l.jsx(L1,{text:e.content,isComplete:!s,isRealTimeStream:((a=e.metadata)==null?void 0:a.streaming)===!0,speed:35}):e.content}),l.jsx("div",{className:"text-xs",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}function B1(e,t){return e.startsWith("image/")?je.Image:e.startsWith("video/")?je.Video:e.startsWith("audio/")?je.Music:e.includes("zip")||e.includes("rar")||e.includes("archive")?je.Archive:je.FileText}function z1(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],s=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,s)).toFixed(2))+" "+n[s]}function H1({message:e,theme:t,isOwn:n}){const s=Ve(t),r=e.metadata,o=(r==null?void 0:r.fileName)||"Unknown file",i=(r==null?void 0:r.fileSize)||0,a=(r==null?void 0:r.mimeType)||"application/octet-stream",c=r==null?void 0:r.downloading,d=r==null?void 0:r.uploading,u=(r==null?void 0:r.downloadProgress)||0,f=(r==null?void 0:r.uploadProgress)||0,h=r==null?void 0:r.downloadUrl,g=r==null?void 0:r.file,x=B1(a),m=c||d,b=c?u:f,k=c?"Downloading...":d?"Uploading...":"Complete",[v,T]=p.useState(null);p.useEffect(()=>{if(h)T(h);else if(g&&a.startsWith("image/")){const M=URL.createObjectURL(g);return T(M),()=>URL.revokeObjectURL(M)}else T(null)},[h,g,a]);const w=()=>{if(h){const M=document.createElement("a");M.href=h,M.download=o,M.click()}},A=a.startsWith("image/")&&v;return l.jsxs("div",{className:"flex flex-col gap-2 max-w-sm",children:[A&&l.jsxs("div",{className:"relative rounded-lg overflow-hidden",children:[l.jsx("img",{src:v,alt:o,className:"max-w-full h-auto max-h-48 object-cover rounded-lg cursor-pointer",onClick:w}),l.jsx("div",{className:"absolute inset-0 bg-black/0 hover:bg-black/10 transition-colors duration-200 cursor-pointer"})]}),l.jsxs("div",{className:`
87
+ `,style:{wordWrap:"break-word",overflowWrap:"break-word"},children:[l.jsx("div",{className:"whitespace-pre-wrap break-words leading-relaxed text-sm",children:((i=e.metadata)==null?void 0:i.type)==="attachment"?l.jsx(Uy,{message:e,theme:t,isOwn:n}):r&&!n?l.jsx(Ly,{text:e.content,isComplete:!r,isRealTimeStream:((a=e.metadata)==null?void 0:a.streaming)===!0,speed:35}):e.content}),l.jsx("div",{className:"text-xs",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}function By(e,t){return e.startsWith("image/")?je.Image:e.startsWith("video/")?je.Video:e.startsWith("audio/")?je.Music:e.includes("zip")||e.includes("rar")||e.includes("archive")?je.Archive:je.FileText}function zy(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]}function Uy({message:e,theme:t,isOwn:n}){const r=Ve(t),s=e.metadata,o=(s==null?void 0:s.fileName)||"Unknown file",i=(s==null?void 0:s.fileSize)||0,a=(s==null?void 0:s.mimeType)||"application/octet-stream",c=s==null?void 0:s.downloading,d=s==null?void 0:s.uploading,u=(s==null?void 0:s.downloadProgress)||0,f=(s==null?void 0:s.uploadProgress)||0,h=s==null?void 0:s.downloadUrl,p=s==null?void 0:s.file,x=By(a),m=c||d,b=c?u:f,k=c?"Downloading...":d?"Uploading...":"Complete",[v,E]=g.useState(null);g.useEffect(()=>{if(h)E(h);else if(p&&a.startsWith("image/")){const M=URL.createObjectURL(p);return E(M),()=>URL.revokeObjectURL(M)}else E(null)},[h,p,a]);const w=()=>{if(h){const M=document.createElement("a");M.href=h,M.download=o,M.click()}},A=a.startsWith("image/")&&v;return l.jsxs("div",{className:"flex flex-col gap-2 max-w-sm",children:[A&&l.jsxs("div",{className:"relative rounded-lg overflow-hidden",children:[l.jsx("img",{src:v,alt:o,className:"max-w-full h-auto max-h-48 object-cover rounded-lg cursor-pointer",onClick:w}),l.jsx("div",{className:"absolute inset-0 bg-black/0 hover:bg-black/10 transition-colors duration-200 cursor-pointer"})]}),l.jsxs("div",{className:`
88
88
  flex items-center gap-3 p-3 rounded-lg border transition-all duration-200
89
89
  ${t==="light"?"bg-gray-50 border-gray-200 hover:bg-gray-100":"bg-gray-800/50 border-gray-700 hover:bg-gray-700/50"}
90
90
  `,children:[l.jsx("div",{className:`
91
91
  p-2 rounded-lg flex-shrink-0
92
92
  ${t==="light"?"bg-blue-100 text-blue-600":"bg-blue-900/50 text-blue-400"}
93
- `,children:l.jsx(x,{className:"w-5 h-5"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:`font-medium text-sm truncate ${s.text.primary}`,children:o}),l.jsxs("div",{className:`text-xs ${s.text.muted}`,children:[i>0&&z1(i),m&&l.jsxs(l.Fragment,{children:[i>0&&" • ",k," ",Math.round(b*100),"%"]})]}),m&&l.jsx("div",{className:`
93
+ `,children:l.jsx(x,{className:"w-5 h-5"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:`font-medium text-sm truncate ${r.text.primary}`,children:o}),l.jsxs("div",{className:`text-xs ${r.text.muted}`,children:[i>0&&zy(i),m&&l.jsxs(l.Fragment,{children:[i>0&&" • ",k," ",Math.round(b*100),"%"]})]}),m&&l.jsx("div",{className:`
94
94
  w-full h-1 rounded-full mt-1 overflow-hidden
95
95
  ${t==="light"?"bg-gray-200":"bg-gray-700"}
96
96
  `,children:l.jsx(ie.div,{className:`h-full ${t==="light"?"bg-blue-500":"bg-blue-400"}`,initial:{width:0},animate:{width:`${b*100}%`},transition:{duration:.3}})})]}),h&&!m&&l.jsx(ie.button,{onClick:w,whileHover:{scale:1.05},whileTap:{scale:.95},className:`
97
97
  p-2 rounded-lg transition-colors duration-200
98
98
  ${t==="light"?"hover:bg-gray-200 text-gray-600 hover:text-gray-800":"hover:bg-gray-600 text-gray-400 hover:text-gray-200"}
99
- `,"aria-label":"Download file",children:l.jsx(je.Download,{className:"w-4 h-4"})})]})]})}function U1(){return l.jsxs("div",{className:"max-w-xs mx-auto bg-green-50 border border-green-200 rounded-lg shadow p-3 flex flex-col items-center",children:[l.jsx("div",{className:"text-2xl mb-2",children:"✅"}),l.jsx("div",{className:"text-green-700 font-semibold text-sm mb-1",children:"Success!"}),l.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"Your action was completed successfully."})]})}function Z1(){return l.jsxs("div",{className:"max-w-xs mx-auto bg-yellow-50 border border-yellow-200 rounded-lg shadow p-3 flex flex-col items-center",children:[l.jsx("div",{className:"text-2xl mb-2",children:"⏰"}),l.jsx("div",{className:"text-yellow-700 font-semibold text-sm mb-1",children:"Interaction timed out"}),l.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"No response was provided in time."})]})}function W1({client:e,theme:t="vox",onBack:n,disabled:s=!1,displayType:r="widget",onEndChat:o}){const[i,a]=p.useState(()=>{if(e&&typeof e.getChatMessages=="function"){const P=e.getChatMessages();return console.log("🔄 ChatView: Initializing with existing messages:",P.length),P}return[]}),[c,d]=p.useState(!0),[u,f]=p.useState(()=>{const P=e&&typeof e.getCurrentSession=="function"&&!!e.getCurrentSession(),E=e&&typeof e.getChatMessages=="function"&&e.getChatMessages().length>0;return!P&&!E}),[h,g]=p.useState(new Set),[x,m]=p.useState([]),[b,k]=p.useState(!1),[v,T]=p.useState(!1),[w,S]=p.useState(()=>{const P=e.getCurrentInteraction();return console.log("ChatView: Initializing with existing interaction:",(P==null?void 0:P.methodName)||"none"),P}),A=p.useRef(null),M=Ve(t);p.useEffect(()=>{const P=()=>{const E=navigator.userAgent.toLowerCase(),F=["android","iphone","ipad","mobile","tablet"].some(B=>E.includes(B)),$="ontouchstart"in window||navigator.maxTouchPoints>0,I=window.innerWidth<=768,H=F||$&&I;k(H),H&&r==="widget"&&T(!0)};return P(),window.addEventListener("resize",P),()=>window.removeEventListener("resize",P)},[r]),p.useEffect(()=>(v&&b&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.height="100%",document.documentElement.requestFullscreen&&document.documentElement.requestFullscreen().catch(console.log)),()=>{v&&b&&(document.body.style.overflow="unset",document.body.style.position="unset",document.body.style.width="unset",document.body.style.height="unset",document.fullscreenElement&&document.exitFullscreen().catch(console.log))}),[v,b]);const j=e.getCurrentAgentInfo(),z=(j==null?void 0:j.name)||"AI Assistant",y=z.split(" ").map(P=>P[0]).join("").toUpperCase().slice(0,2),D=p.useCallback(P=>{const E={id:`local_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:P,timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{isLocal:!0}};a(O=>(console.log("ChatView: Adding local message:",E.id),[...O,E]))},[]);p.useEffect(()=>{var P,E,O,F,$;console.log("💬 ChatView loading state:",{isLoading:u,hasActiveSession:!!((P=e==null?void 0:e.getCurrentSession)!=null&&P.call(e)),messagesCount:i.length,sessionId:(O=(E=e==null?void 0:e.getCurrentSession)==null?void 0:E.call(e))==null?void 0:O.id,hasStoredMessages:!!(($=(F=e==null?void 0:e.getChatMessages)==null?void 0:F.call(e))!=null&&$.length),isMobile:b,isFullscreen:v})},[u,i.length,e,b,v]);const _=p.useCallback((P=!1)=>{A.current&&(P?A.current.scrollIntoView({behavior:"auto"}):A.current.scrollIntoView({behavior:"smooth"}))},[]);p.useEffect(()=>{_(!0);const P=setTimeout(()=>{_(!1)},10);return()=>clearTimeout(P)},[i.length,_]),p.useEffect(()=>{if(w){_(!0);const P=setTimeout(()=>{_(!1)},50);return()=>clearTimeout(P)}},[w,_]),p.useEffect(()=>{const P=F=>{if(console.log("ChatView: Received message:",F),f(!1),w&&F.sender.type==="agent"){console.log("ChatView: Queuing agent message due to active interaction:",w.methodName),m($=>[...$,F]);return}F.sender.type==="agent"&&d(!1),a($=>{var H;if($.some(B=>B.id===F.id))return console.log("ChatView: Message already exists, skipping:",F.id),$;if(console.log("ChatView: Adding new message:",F.id),F.sender.type==="agent"&&(g(B=>new Set(B).add(F.id)),!((H=F.metadata)!=null&&H.streaming))){const B=F.content.length*35+1e3;setTimeout(()=>{g(oe=>{const L=new Set(oe);return L.delete(F.id),L})},B)}return[...$,F]}),setTimeout(()=>_(!0),0)},E=F=>{var $;if(console.log("ChatView: Updated message:",F),w&&F.sender.type==="agent"){console.log("ChatView: Queuing agent message update due to active interaction:",w.methodName),m(I=>{const H=I.findIndex(B=>B.id===F.id);if(H>=0){const B=[...I];return B[H]=F,B}else return[...I,F]});return}a(I=>I.map(H=>H.id===F.id?{...F}:H)),setTimeout(()=>_(!0),0),($=F.metadata)!=null&&$.streaming||g(I=>{const H=new Set(I);return H.delete(F.id),H})},O=F=>{console.log("ChatView: Sent message:",F),f(!1),a($=>$.some(H=>H.id===F.id)?(console.log("ChatView: Sent message already exists, skipping:",F.id),$):(console.log("ChatView: Adding sent message:",F.id),[...$,F])),setTimeout(()=>_(!0),0)};return e.on("chat.message.received",P),e.on("chat.message.updated",E),e.on("chat.message.sent",O),()=>{e.off("chat.message.received",P),e.off("chat.message.updated",E),e.off("chat.message.sent",O)}},[e,w]),p.useEffect(()=>{const P=$=>{console.log("ChatView: RPC interaction started:",$);const I=e.getCurrentInteraction();console.log("ChatView: Got interaction from client:",I==null?void 0:I.methodName),S(I),d(!1),_(!0),setTimeout(()=>{_(!1)},100)},E=$=>{if(console.log("ChatView: RPC interaction completed:",$),S(null),x.length>0&&(console.log("ChatView: Processing",x.length,"queued messages"),a(I=>{const H=[...I];return x.forEach(B=>{var L;if(!H.some(ae=>ae.id===B.id)&&(console.log("ChatView: Adding queued message:",B.id),H.push(B),B.sender.type==="agent"&&(g(ae=>new Set(ae).add(B.id)),!((L=B.metadata)!=null&&L.streaming)))){const ae=B.content.length*35+1e3;setTimeout(()=>{g(xe=>{const Ie=new Set(xe);return Ie.delete(B.id),Ie})},ae)}}),H}),m([]),setTimeout(()=>_(!0),0)),$&&$.response&&$.response.success){let I=null;$.response.successView?I=$.response.successView:$.successView&&(I=$.successView),a(H=>{const B=[...H].reverse().findIndex(xe=>xe.sender.type==="participant");let oe=H.length;B!==-1&&(oe=H.length-B);const L={id:`success_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{type:"successView",view:I||l.jsx(U1,{})}};e&&typeof e.addChatMessage=="function"&&e.addChatMessage(L);const ae=[...H];return ae.splice(oe,0,L),ae})}},O=async $=>{w&&(console.log("ChatView: Dismissing active interaction due to timeout"),e.dismissCurrentInteraction()),S(null),x.length>0&&(console.log("ChatView: Processing",x.length,"queued messages after timeout"),a(H=>{const B=[...H];return x.forEach(oe=>{var ae;if(!B.some(xe=>xe.id===oe.id)&&(B.push(oe),oe.sender.type==="agent"&&(g(xe=>new Set(xe).add(oe.id)),!((ae=oe.metadata)!=null&&ae.streaming)))){const xe=oe.content.length*35+1e3;setTimeout(()=>{g(Ie=>{const Rn=new Set(Ie);return Rn.delete(oe.id),Rn})},xe)}}),B}),m([]),setTimeout(()=>_(!0),0));let I=null;$&&$.response&&$.response.timeoutView?I=$.response.timeoutView:$&&$.timeoutView&&(I=$.timeoutView),a(H=>{const B={id:`timeout_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"agent",name:z,type:"agent"},metadata:{type:"timeoutView",view:I||l.jsx(Z1,{})}};return e&&typeof e.addChatMessage=="function"&&e.addChatMessage(B),[...H,B]}),setTimeout(()=>{e.getCurrentInteraction()||S(null)},100)},F=async $=>{console.log("ChatView: RPC interaction dismissed:",$),console.log("ChatView: Current interaction before dismiss:",w==null?void 0:w.methodName),S(null),x.length>0&&(console.log("ChatView: Processing",x.length,"queued messages after dismissal"),a(I=>{const H=[...I];return x.forEach(B=>{var L;if(!H.some(ae=>ae.id===B.id)&&(H.push(B),B.sender.type==="agent"&&(g(ae=>new Set(ae).add(B.id)),!((L=B.metadata)!=null&&L.streaming)))){const ae=B.content.length*35+1e3;setTimeout(()=>{g(xe=>{const Ie=new Set(xe);return Ie.delete(B.id),Ie})},ae)}}),H}),m([]),setTimeout(()=>_(!0),0)),setTimeout(()=>{const I=e.getCurrentInteraction();console.log("ChatView: Latest interaction from client after dismiss:",(I==null?void 0:I.methodName)||"null"),I===null&&S(null)},50),console.log("ChatView: Set currentInteraction to null after dismiss")};return e.on("rpc.interaction.started",P),e.on("rpc.interaction.completed",E),e.on("rpc.interaction.timeout",O),e.on("rpc.interaction.dismissed",F),()=>{e.off("rpc.interaction.started",P),e.off("rpc.interaction.completed",E),e.off("rpc.interaction.timeout",O),e.off("rpc.interaction.dismissed",F)}},[e]),p.useEffect(()=>{const P=()=>{if(console.log("ChatView: Agent is thinking"),w){console.log("ChatView: Suppressing thinking indicator due to active interaction:",w.methodName);return}d(!0)},E=()=>{console.log("ChatView: Agent is speaking"),d(!1)};return e.on("agent.thinking",P),e.on("agent.speaking",E),()=>{e.off("agent.thinking",P),e.off("agent.speaking",E)}},[e,w]),p.useEffect(()=>{const P=e.getCurrentInteraction();P?(console.log("ChatView: Restoring interaction state on mount/client change:",P.methodName),S(P)):S(null)},[e]),p.useEffect(()=>{console.log("ChatView: Display type changed to:",r,"Current interaction:",(w==null?void 0:w.methodName)||"none")},[r,w]);const J=async P=>{try{w&&(console.log("ChatView: Dismissing active interaction due to user message send"),e.dismissCurrentInteraction(),S(null)),await e.sendChatMessage(P)}catch(E){console.error("Failed to send message:",E)}},te=async P=>{try{w&&(console.log("ChatView: Dismissing active interaction due to user attachment send"),e.dismissCurrentInteraction(),S(null)),await e.sendAttachments(P),console.log("Attachments sent successfully:",P.map(E=>E.name))}catch(E){console.error("Failed to send attachments:",E)}},[ee,se]=p.useState([]);if(p.useEffect(()=>{const P=E=>{se(Array.isArray(E)?E:["tes","hello how are you","algebra make me learn that ","what is the meaning of life"])};return e.on("suggested.response",P),()=>{e.off("suggested.response",P)}},[e]),u){const P=v&&b?"fixed inset-0 z-[9999] flex flex-col items-center justify-center h-screen w-screen bg-black":"flex w-full flex-col items-center justify-center h-full p-8";return l.jsxs("div",{className:P,children:[l.jsx("div",{className:`${M.spinner} w-12 h-12 mb-6`}),l.jsxs("p",{className:`text-sm text-center ${v&&b?"text-white":""}`,children:["Connecting to ",z,"..."]})]})}const K=v&&b?"fullscreen":r,R=K==="fullscreen"?v&&b?"fixed inset-0 z-[9999] flex flex-col h-screen w-screen bg-black":"flex flex-col h-full w-full max-w-none":"flex flex-col h-full w-full backdrop-blur-sm max-h-full overflow-hidden",X=K==="fullscreen"?v&&b?"flex items-center w-full justify-between px-4 pt-3 pb-3 bg-black/80 text-white border-b border-gray-700":`flex items-center w-full justify-between px-6 pt-5 pb-4 border-b ${M.chatHeader.container}`:`flex items-center w-full justify-between px-4 pt-5 pb-4 border-b ${M.chatHeader.container}`,V=K==="fullscreen"?v&&b?"flex-1 overflow-y-auto scrollbar-hide p-4 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto scrollbar-hide p-6 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto scrollbar-hide w-full p-4 chat-scrollable min-h-0",U="flex-shrink-0 !w-full",q=()=>{T(!1),n&&n()};return l.jsxs("div",{className:R,children:[l.jsx("div",{className:X,children:l.jsxs("div",{className:"flex items-center gap-2",children:[v&&b&&l.jsx(ie.button,{onClick:q,whileHover:{scale:1.05},whileTap:{scale:.95},className:"p-2 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors mr-2","aria-label":"Exit fullscreen",children:"✕"}),l.jsxs("div",{children:[l.jsx("h3",{className:`font-semibold text-base leading-tight ${v&&b?"text-white":M.text.primary}`,children:z}),l.jsxs("p",{className:`text-xs flex items-center gap-1.5 mt-0.5 ${v&&b?"text-gray-300":M.text.muted}`,children:[l.jsx("span",{className:"w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse"}),"Online"]})]})]})}),l.jsxs("div",{className:`${V} flex flex-col`,style:{scrollBehavior:"smooth",scrollbarWidth:"none"},children:[" ",i.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-center py-12",children:[l.jsx(ie.div,{transition:{duration:2,repeat:1/0,ease:"easeInOut"},className:"w-16 h-16 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white font-bold text-xl mb-6 shadow-xl",children:y}),l.jsxs("p",{className:`text-base mb-2 ${v&&b?"text-white":M.text.secondary}`,children:[z," is joining..."]}),l.jsx("p",{className:`text-xs ${v&&b?"text-gray-300":M.text.muted}`,children:"Your conversation will begin shortly"})]}):l.jsx("div",{className:"w-full max-w-5xl mx-auto space-y-3 py-4 flex-1 flex flex-col justify-end",children:l.jsxs("div",{className:"space-y-3",children:[i.map((P,E)=>{var O,F;return l.jsx("div",{children:((O=P.metadata)==null?void 0:O.type)==="successView"?l.jsx("div",{className:"flex w-full justify-end mb-4 px-1",children:l.jsxs("div",{className:"relative group flex-row-reverse flex items-end gap-3 max-w-[85%]",children:[l.jsx(ie.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1},className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:"Y"}),l.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-br-md message-hover border-gray-200 dark:border-gray-700 ${M.chatMessage.own}`,children:[P.metadata.view,l.jsx("div",{className:`text-xs ${M.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:P.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((F=P.metadata)==null?void 0:F.type)==="timeoutView"?l.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:l.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[l.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:y}),l.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${M.chatMessage.other}`,children:[P.metadata.view,l.jsx("div",{className:`text-xs ${M.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:P.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):l.jsx(_1,{message:P,theme:t,isOwn:P.sender.type==="participant",isStreaming:h.has(P.id)})},P.id)}),c&&!w&&l.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:i.length*.1},className:"flex w-full justify-start mb-4 px-1",children:l.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[l.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:y}),l.jsx("div",{className:`relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover ${M.chatMessage.other} rounded-bl-md transition-all duration-200 group-hover:scale-[1.02]`,style:{wordWrap:"break-word",overflowWrap:"break-word",minWidth:48},children:l.jsx("span",{className:"inline-flex items-center",children:[0,1,2].map(P=>l.jsx(ie.span,{className:"w-1.5 h-1.5 bg-current rounded-full mx-0.5",animate:{y:[0,-4,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:P*.2,ease:"easeInOut"}},P))})})]})}),w&&w.presentationMode==="embedded"&&l.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[l.jsx(ie.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1},className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:y}),l.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${M.chatMessage.other}`,children:[l.jsx(Kt,{interaction:w,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:D},w.methodName),l.jsx(ie.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:`text-xs ${M.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]}),l.jsx("div",{ref:A})]})})]}),ee.length>0&&l.jsx("div",{className:"w-full flex overflow-x-auto gap-2 px-4 py-2 mb-1 scrollbar-hide",children:ee.map((P,E)=>{var O;return l.jsx("button",{className:`whitespace-nowrap px-3 py-1 rounded-full border shadow-sm flex-shrink-0 transition-all duration-150 font-medium text-sm focus:outline-none focus:ring-2 focus:ring-blue-400/40
99
+ `,"aria-label":"Download file",children:l.jsx(je.Download,{className:"w-4 h-4"})})]})]})}function Hy(){return l.jsxs("div",{className:"max-w-xs mx-auto bg-green-50 border border-green-200 rounded-lg shadow p-3 flex flex-col items-center",children:[l.jsx("div",{className:"text-2xl mb-2",children:"✅"}),l.jsx("div",{className:"text-green-700 font-semibold text-sm mb-1",children:"Success!"}),l.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"Your action was completed successfully."})]})}function Zy(){return l.jsxs("div",{className:"max-w-xs mx-auto bg-yellow-50 border border-yellow-200 rounded-lg shadow p-3 flex flex-col items-center",children:[l.jsx("div",{className:"text-2xl mb-2",children:"⏰"}),l.jsx("div",{className:"text-yellow-700 font-semibold text-sm mb-1",children:"Interaction timed out"}),l.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"No response was provided in time."})]})}function Wy({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:s="widget",onEndChat:o}){const[i,a]=g.useState(()=>{if(e&&typeof e.getChatMessages=="function"){const P=e.getChatMessages();return console.log("🔄 ChatView: Initializing with existing messages:",P.length),P}return[]}),[c,d]=g.useState(!0),[u,f]=g.useState(()=>{const P=e&&typeof e.getCurrentSession=="function"&&!!e.getCurrentSession(),T=e&&typeof e.getChatMessages=="function"&&e.getChatMessages().length>0;return!P&&!T}),[h,p]=g.useState(new Set),[x,m]=g.useState([]),[b,k]=g.useState(!1),[v,E]=g.useState(!1),[w,S]=g.useState(()=>{const P=e.getCurrentInteraction();return console.log("ChatView: Initializing with existing interaction:",(P==null?void 0:P.methodName)||"none"),P}),A=g.useRef(null),M=Ve(t);g.useEffect(()=>{const P=()=>{const T=navigator.userAgent.toLowerCase(),F=["android","iphone","ipad","mobile","tablet"].some(B=>T.includes(B)),$="ontouchstart"in window||navigator.maxTouchPoints>0,I=window.innerWidth<=768,U=F||$&&I;k(U),U&&s==="widget"&&E(!0)};return P(),window.addEventListener("resize",P),()=>window.removeEventListener("resize",P)},[s]),g.useEffect(()=>(v&&b&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.height="100%",document.documentElement.requestFullscreen&&document.documentElement.requestFullscreen().catch(console.log)),()=>{v&&b&&(document.body.style.overflow="unset",document.body.style.position="unset",document.body.style.width="unset",document.body.style.height="unset",document.fullscreenElement&&document.exitFullscreen().catch(console.log))}),[v,b]);const j=e.getCurrentAgentInfo(),z=(j==null?void 0:j.name)||"AI Assistant",y=z.split(" ").map(P=>P[0]).join("").toUpperCase().slice(0,2),D=g.useCallback(P=>{const T={id:`local_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:P,timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{isLocal:!0}};a(O=>(console.log("ChatView: Adding local message:",T.id),[...O,T]))},[]);g.useEffect(()=>{var P,T,O,F,$;console.log("💬 ChatView loading state:",{isLoading:u,hasActiveSession:!!((P=e==null?void 0:e.getCurrentSession)!=null&&P.call(e)),messagesCount:i.length,sessionId:(O=(T=e==null?void 0:e.getCurrentSession)==null?void 0:T.call(e))==null?void 0:O.id,hasStoredMessages:!!(($=(F=e==null?void 0:e.getChatMessages)==null?void 0:F.call(e))!=null&&$.length),isMobile:b,isFullscreen:v})},[u,i.length,e,b,v]);const _=g.useCallback((P=!1)=>{A.current&&(P?A.current.scrollIntoView({behavior:"auto"}):A.current.scrollIntoView({behavior:"smooth"}))},[]);g.useEffect(()=>{_(!0);const P=setTimeout(()=>{_(!1)},10);return()=>clearTimeout(P)},[i.length,_]),g.useEffect(()=>{if(w){_(!0);const P=setTimeout(()=>{_(!1)},50);return()=>clearTimeout(P)}},[w,_]),g.useEffect(()=>{const P=F=>{if(console.log("ChatView: Received message:",F),f(!1),w&&F.sender.type==="agent"){console.log("ChatView: Queuing agent message due to active interaction:",w.methodName),m($=>[...$,F]);return}F.sender.type==="agent"&&d(!1),a($=>{var U;if($.some(B=>B.id===F.id))return console.log("ChatView: Message already exists, skipping:",F.id),$;if(console.log("ChatView: Adding new message:",F.id),F.sender.type==="agent"&&(p(B=>new Set(B).add(F.id)),!((U=F.metadata)!=null&&U.streaming))){const B=F.content.length*35+1e3;setTimeout(()=>{p(oe=>{const L=new Set(oe);return L.delete(F.id),L})},B)}return[...$,F]}),setTimeout(()=>_(!0),0)},T=F=>{var $;if(console.log("ChatView: Updated message:",F),w&&F.sender.type==="agent"){console.log("ChatView: Queuing agent message update due to active interaction:",w.methodName),m(I=>{const U=I.findIndex(B=>B.id===F.id);if(U>=0){const B=[...I];return B[U]=F,B}else return[...I,F]});return}a(I=>I.map(U=>U.id===F.id?{...F}:U)),setTimeout(()=>_(!0),0),($=F.metadata)!=null&&$.streaming||p(I=>{const U=new Set(I);return U.delete(F.id),U})},O=F=>{console.log("ChatView: Sent message:",F),f(!1),a($=>$.some(U=>U.id===F.id)?(console.log("ChatView: Sent message already exists, skipping:",F.id),$):(console.log("ChatView: Adding sent message:",F.id),[...$,F])),setTimeout(()=>_(!0),0)};return e.on("chat.message.received",P),e.on("chat.message.updated",T),e.on("chat.message.sent",O),()=>{e.off("chat.message.received",P),e.off("chat.message.updated",T),e.off("chat.message.sent",O)}},[e,w]),g.useEffect(()=>{const P=$=>{console.log("ChatView: RPC interaction started:",$);const I=e.getCurrentInteraction();console.log("ChatView: Got interaction from client:",I==null?void 0:I.methodName),S(I),d(!1),_(!0),setTimeout(()=>{_(!1)},100)},T=$=>{if(console.log("ChatView: RPC interaction completed:",$),S(null),x.length>0&&(console.log("ChatView: Processing",x.length,"queued messages"),a(I=>{const U=[...I];return x.forEach(B=>{var L;if(!U.some(ae=>ae.id===B.id)&&(console.log("ChatView: Adding queued message:",B.id),U.push(B),B.sender.type==="agent"&&(p(ae=>new Set(ae).add(B.id)),!((L=B.metadata)!=null&&L.streaming)))){const ae=B.content.length*35+1e3;setTimeout(()=>{p(xe=>{const Ie=new Set(xe);return Ie.delete(B.id),Ie})},ae)}}),U}),m([]),setTimeout(()=>_(!0),0)),$&&$.response&&$.response.success){let I=null;$.response.successView?I=$.response.successView:$.successView&&(I=$.successView),a(U=>{const B=[...U].reverse().findIndex(xe=>xe.sender.type==="participant");let oe=U.length;B!==-1&&(oe=U.length-B);const L={id:`success_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{type:"successView",view:I||l.jsx(Hy,{})}};e&&typeof e.addChatMessage=="function"&&e.addChatMessage(L);const ae=[...U];return ae.splice(oe,0,L),ae})}},O=async $=>{w&&(console.log("ChatView: Dismissing active interaction due to timeout"),e.dismissCurrentInteraction()),S(null),x.length>0&&(console.log("ChatView: Processing",x.length,"queued messages after timeout"),a(U=>{const B=[...U];return x.forEach(oe=>{var ae;if(!B.some(xe=>xe.id===oe.id)&&(B.push(oe),oe.sender.type==="agent"&&(p(xe=>new Set(xe).add(oe.id)),!((ae=oe.metadata)!=null&&ae.streaming)))){const xe=oe.content.length*35+1e3;setTimeout(()=>{p(Ie=>{const Rn=new Set(Ie);return Rn.delete(oe.id),Rn})},xe)}}),B}),m([]),setTimeout(()=>_(!0),0));let I=null;$&&$.response&&$.response.timeoutView?I=$.response.timeoutView:$&&$.timeoutView&&(I=$.timeoutView),a(U=>{const B={id:`timeout_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"agent",name:z,type:"agent"},metadata:{type:"timeoutView",view:I||l.jsx(Zy,{})}};return e&&typeof e.addChatMessage=="function"&&e.addChatMessage(B),[...U,B]}),setTimeout(()=>{e.getCurrentInteraction()||S(null)},100)},F=async $=>{console.log("ChatView: RPC interaction dismissed:",$),console.log("ChatView: Current interaction before dismiss:",w==null?void 0:w.methodName),S(null),x.length>0&&(console.log("ChatView: Processing",x.length,"queued messages after dismissal"),a(I=>{const U=[...I];return x.forEach(B=>{var L;if(!U.some(ae=>ae.id===B.id)&&(U.push(B),B.sender.type==="agent"&&(p(ae=>new Set(ae).add(B.id)),!((L=B.metadata)!=null&&L.streaming)))){const ae=B.content.length*35+1e3;setTimeout(()=>{p(xe=>{const Ie=new Set(xe);return Ie.delete(B.id),Ie})},ae)}}),U}),m([]),setTimeout(()=>_(!0),0)),setTimeout(()=>{const I=e.getCurrentInteraction();console.log("ChatView: Latest interaction from client after dismiss:",(I==null?void 0:I.methodName)||"null"),I===null&&S(null)},50),console.log("ChatView: Set currentInteraction to null after dismiss")};return e.on("rpc.interaction.started",P),e.on("rpc.interaction.completed",T),e.on("rpc.interaction.timeout",O),e.on("rpc.interaction.dismissed",F),()=>{e.off("rpc.interaction.started",P),e.off("rpc.interaction.completed",T),e.off("rpc.interaction.timeout",O),e.off("rpc.interaction.dismissed",F)}},[e]),g.useEffect(()=>{const P=()=>{if(console.log("ChatView: Agent is thinking"),w){console.log("ChatView: Suppressing thinking indicator due to active interaction:",w.methodName);return}d(!0)},T=()=>{console.log("ChatView: Agent is speaking"),d(!1)};return e.on("agent.thinking",P),e.on("agent.speaking",T),()=>{e.off("agent.thinking",P),e.off("agent.speaking",T)}},[e,w]),g.useEffect(()=>{const P=e.getCurrentInteraction();P?(console.log("ChatView: Restoring interaction state on mount/client change:",P.methodName),S(P)):S(null)},[e]),g.useEffect(()=>{console.log("ChatView: Display type changed to:",s,"Current interaction:",(w==null?void 0:w.methodName)||"none")},[s,w]);const J=async P=>{try{w&&(console.log("ChatView: Dismissing active interaction due to user message send"),e.dismissCurrentInteraction(),S(null)),await e.sendChatMessage(P)}catch(T){console.error("Failed to send message:",T)}},te=async P=>{try{w&&(console.log("ChatView: Dismissing active interaction due to user attachment send"),e.dismissCurrentInteraction(),S(null)),await e.sendAttachments(P),console.log("Attachments sent successfully:",P.map(T=>T.name))}catch(T){console.error("Failed to send attachments:",T)}},[ee,re]=g.useState([]);if(g.useEffect(()=>{const P=T=>{re(Array.isArray(T)?T:["tes","hello how are you","algebra make me learn that ","what is the meaning of life"])};return e.on("suggested.response",P),()=>{e.off("suggested.response",P)}},[e]),u){const P=v&&b?"fixed inset-0 z-[9999] flex flex-col items-center justify-center h-screen w-screen bg-black":"flex w-full flex-col items-center justify-center h-full p-8";return l.jsxs("div",{className:P,children:[l.jsx("div",{className:`${M.spinner} w-12 h-12 mb-6`}),l.jsxs("p",{className:`text-sm text-center ${v&&b?"text-white":""}`,children:["Connecting to ",z,"..."]})]})}const K=v&&b?"fullscreen":s,R=K==="fullscreen"?v&&b?"fixed inset-0 z-[9999] flex flex-col h-screen w-screen bg-black":"flex flex-col h-full w-full max-w-none":"flex flex-col h-full w-full backdrop-blur-sm max-h-full overflow-hidden",X=K==="fullscreen"?v&&b?"flex items-center w-full justify-between px-4 pt-3 pb-3 bg-black/80 text-white border-b border-gray-700":`flex items-center w-full justify-between px-6 pt-5 pb-4 border-b ${M.chatHeader.container}`:`flex items-center w-full justify-between px-4 pt-5 pb-4 border-b ${M.chatHeader.container}`,V=K==="fullscreen"?v&&b?"flex-1 overflow-y-auto scrollbar-hide p-4 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto scrollbar-hide p-6 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto scrollbar-hide w-full p-4 chat-scrollable min-h-0",H="flex-shrink-0 !w-full",q=()=>{E(!1),n&&n()};return l.jsxs("div",{className:R,children:[l.jsx("div",{className:X,children:l.jsxs("div",{className:"flex items-center gap-2",children:[v&&b&&l.jsx(ie.button,{onClick:q,whileHover:{scale:1.05},whileTap:{scale:.95},className:"p-2 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors mr-2","aria-label":"Exit fullscreen",children:"✕"}),l.jsxs("div",{children:[l.jsx("h3",{className:`font-semibold text-base leading-tight ${v&&b?"text-white":M.text.primary}`,children:z}),l.jsxs("p",{className:`text-xs flex items-center gap-1.5 mt-0.5 ${v&&b?"text-gray-300":M.text.muted}`,children:[l.jsx("span",{className:"w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse"}),"Online"]})]})]})}),l.jsxs("div",{className:`${V} flex flex-col`,style:{scrollBehavior:"smooth",scrollbarWidth:"none"},children:[" ",i.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-center py-12",children:[l.jsx(ie.div,{transition:{duration:2,repeat:1/0,ease:"easeInOut"},className:"w-16 h-16 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white font-bold text-xl mb-6 shadow-xl",children:y}),l.jsxs("p",{className:`text-base mb-2 ${v&&b?"text-white":M.text.secondary}`,children:[z," is joining..."]}),l.jsx("p",{className:`text-xs ${v&&b?"text-gray-300":M.text.muted}`,children:"Your conversation will begin shortly"})]}):l.jsx("div",{className:"w-full max-w-5xl mx-auto space-y-3 py-4 flex-1 flex flex-col justify-end",children:l.jsxs("div",{className:"space-y-3",children:[i.map((P,T)=>{var O,F;return l.jsx("div",{children:((O=P.metadata)==null?void 0:O.type)==="successView"?l.jsx("div",{className:"flex w-full justify-end mb-4 px-1",children:l.jsxs("div",{className:"relative group flex-row-reverse flex items-end gap-3 max-w-[85%]",children:[l.jsx(ie.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1},className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:"Y"}),l.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-br-md message-hover border-gray-200 dark:border-gray-700 ${M.chatMessage.own}`,children:[P.metadata.view,l.jsx("div",{className:`text-xs ${M.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:P.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((F=P.metadata)==null?void 0:F.type)==="timeoutView"?l.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:l.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[l.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:y}),l.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${M.chatMessage.other}`,children:[P.metadata.view,l.jsx("div",{className:`text-xs ${M.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:P.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):l.jsx(_y,{message:P,theme:t,isOwn:P.sender.type==="participant",isStreaming:h.has(P.id)})},P.id)}),c&&!w&&l.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:i.length*.1},className:"flex w-full justify-start mb-4 px-1",children:l.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[l.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:y}),l.jsx("div",{className:`relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover ${M.chatMessage.other} rounded-bl-md transition-all duration-200 group-hover:scale-[1.02]`,style:{wordWrap:"break-word",overflowWrap:"break-word",minWidth:48},children:l.jsx("span",{className:"inline-flex items-center",children:[0,1,2].map(P=>l.jsx(ie.span,{className:"w-1.5 h-1.5 bg-current rounded-full mx-0.5",animate:{y:[0,-4,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:P*.2,ease:"easeInOut"}},P))})})]})}),w&&w.presentationMode==="embedded"&&l.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[l.jsx(ie.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1},className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:y}),l.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${M.chatMessage.other}`,children:[l.jsx(Kt,{interaction:w,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:D},w.methodName),l.jsx(ie.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:`text-xs ${M.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]}),l.jsx("div",{ref:A})]})})]}),ee.length>0&&l.jsx("div",{className:"w-full flex overflow-x-auto gap-2 px-4 py-2 mb-1 scrollbar-hide",children:ee.map((P,T)=>{var O;return l.jsx("button",{className:`whitespace-nowrap px-3 py-1 rounded-full border shadow-sm flex-shrink-0 transition-all duration-150 font-medium text-sm focus:outline-none focus:ring-2 focus:ring-blue-400/40
100
100
  ${t==="light"?"bg-white text-blue-700 border-blue-200 hover:bg-blue-50 hover:text-blue-900":t==="dark"?"bg-gray-800 text-blue-300 border-gray-700 hover:bg-gray-700 hover:text-white":((O=M.suggestedResponse)==null?void 0:O.container)||"bg-gradient-to-br from-blue-500 to-purple-600 text-white border-blue-400 hover:from-blue-600 hover:to-purple-700"}
101
- `,style:{boxShadow:t==="vox"?"0 2px 8px 0 rgba(80,60,200,0.10)":void 0,borderWidth:1},onClick:()=>{J(P),se([])},children:P},P+E)})}),w&&w.presentationMode!=="embedded"&&l.jsx(Kt,{interaction:w,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:D},w.methodName),l.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:U,children:l.jsx(O1,{onSendMessage:J,onSendAttachments:te,disabled:s,theme:t,onEndChat:o})})]})}function G1({onToggleCamera:e,onToggleScreenShare:t,onEndCall:n,onBack:s,theme:r,cameraEnabled:o,screenShareEnabled:i,isCameraLoading:a,isScreenShareLoading:c,disabled:d}){const u=Ve(r);return l.jsxs("div",{className:`flex items-center justify-center gap-3 p-4 ${u.video.controlsBackground}`,children:[l.jsx("button",{onClick:e,disabled:d||a,className:`p-3 rounded-full transition-all duration-200 ${o?u.video.controlEnabled:u.video.controlDisabled} ${d?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:o?"Turn off camera":"Turn on camera",children:a?l.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):o?l.jsx(je.Camera,{className:"w-5 h-5"}):l.jsx(je.CameraOff,{className:"w-5 h-5"})}),l.jsx("button",{onClick:t,disabled:d||c,className:`p-3 rounded-full transition-all duration-200 ${i?u.video.controlEnabled:u.video.controlDisabled} ${d?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:i?"Stop screen share":"Share screen",children:c?l.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):i?l.jsx(je.MonitorOff,{className:"w-5 h-5"}):l.jsx(je.Monitor,{className:"w-5 h-5"})}),n&&l.jsx("button",{onClick:n,disabled:d,className:`p-3 rounded-full transition-all duration-200 ${u.video.endCall} ${d?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"End call",children:l.jsx(je.PhoneOff,{className:"w-5 h-5"})}),s&&l.jsx("button",{onClick:s,disabled:d,className:`p-3 rounded-full transition-all duration-200 ${u.video.controlDisabled} ${d?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"Back",children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})})})]})}function Ua({trackRef:e,participant:t,isLocal:n=!1,className:s="",theme:r}){var c;const o=Ve(r),i=(t==null?void 0:t.name)||(t==null?void 0:t.identity)||(n?"You":"Participant"),a=(e==null?void 0:e.publication)&&!e.publication.isMuted;return l.jsxs("div",{className:`relative rounded-lg overflow-hidden ${o.video.tile} ${s}`,children:[a?l.jsx(Ne.VideoTrack,{trackRef:e,className:"w-full h-full object-cover"}):l.jsx("div",{className:`w-full h-full flex items-center justify-center ${o.video.placeholder}`,children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:`w-16 h-16 mx-auto mb-2 rounded-full flex items-center justify-center ${o.video.avatar}`,children:l.jsx(je.User,{className:"w-8 h-8"})}),l.jsx("p",{className:"text-sm opacity-80",children:i}),l.jsx("p",{className:"text-xs opacity-60",children:"Camera off"})]})}),l.jsx("div",{className:`absolute bottom-2 left-2 px-2 py-1 rounded text-xs ${o.video.nameOverlay}`,children:i}),((c=e==null?void 0:e.publication)==null?void 0:c.isMuted)&&l.jsx("div",{className:`absolute top-2 right-2 p-1 rounded ${o.video.mutedIndicator}`,children:l.jsx(je.CameraOff,{className:"w-4 h-4"})})]})}function K1({trackRefs:e,participants:t,theme:n,localParticipant:s}){const r=e.find(u=>u.source===Z.Track.Source.Camera&&u.participant===s),o=e.filter(u=>u.participant!==s),i=e.length,a=i<=1?1:i<=4?2:3,c="grid gap-2 h-full",d={gridTemplateColumns:`repeat(${a}, 1fr)`,gridAutoRows:"minmax(0, 1fr)"};return l.jsxs("div",{className:c,style:d,children:[r&&s&&l.jsx(Ua,{trackRef:r,participant:s,isLocal:!0,theme:n,className:"min-h-0"}),o.map((u,f)=>{var h;return l.jsx(Ua,{trackRef:u,participant:u.participant,isLocal:!1,theme:n,className:"min-h-0"},((h=u.publication)==null?void 0:h.trackSid)||f)}),i===0&&l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsxs("div",{className:"text-center",children:[l.jsx(je.Users,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),l.jsx("p",{className:"text-lg opacity-70",children:"Waiting for participants..."}),l.jsx("p",{className:"text-sm opacity-50",children:"Turn on your camera to start the video call"})]})})]})}function Y1({client:e,theme:t="vox",onBack:n,disabled:s=!1,displayType:r,onEndCall:o}){const i=Ve(t),a=Zl(e),{videoTrackRefs:c}=P0(e),d=p.useMemo(()=>e.getRemoteParticipants(),[e,a]),u=gn(e,"camera"),f=gn(e,"screenShare"),[h,g]=p.useState(null),x=p.useCallback(async()=>{u.pending||await u.toggle()},[u]),m=p.useCallback(async()=>{f.pending||await f.toggle()},[f]),b=p.useCallback(()=>{o?o():n&&n()},[o,n]);return p.useEffect(()=>{if(!e)return;const k=v=>{console.log("📺 Video: Interactive UI state updated:",v),g(v)};return e.on("interactive.ui.update",k),e.on("interactive.ui.show",k),()=>{e.off("interactive.ui.update",k),e.off("interactive.ui.show",k)}},[e]),l.jsxs("div",{className:`flex flex-col h-full ${i.video.container}`,children:[l.jsxs("div",{className:`flex items-center justify-between p-4 border-b ${i.video.header}`,children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:`w-3 h-3 rounded-full ${i.video.statusDot}`}),l.jsx("span",{className:"font-medium",children:"Video Call"}),l.jsxs("span",{className:"text-sm opacity-70",children:[d.length+1," participant",d.length!==0?"s":""]})]}),l.jsx("div",{className:"flex items-center gap-2",children:l.jsx("button",{className:`p-2 rounded-lg transition-colors ${i.video.headerButton}`,title:"Layout options",children:l.jsx(je.LayoutGrid,{className:"w-4 h-4"})})})]}),l.jsx("div",{className:"flex-1 p-4 min-h-0",children:l.jsx(K1,{trackRefs:c,participants:d,localParticipant:a==null?void 0:a.localParticipant,theme:t})}),h&&l.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},className:"absolute inset-4 z-10",children:l.jsx(Kt,{interaction:h,onDismiss:()=>g(null),theme:t})}),l.jsx(G1,{onToggleCamera:x,onToggleScreenShare:m,onEndCall:b,onBack:n,theme:t,cameraEnabled:u.enabled,screenShareEnabled:f.enabled,isCameraLoading:u.pending,isScreenShareLoading:f.pending,disabled:s})]})}function Wn({onClick:e,disabled:t,theme:n}){const s=Ve(n);return l.jsx("button",{className:s.micButton,onClick:e,disabled:t,"aria-label":"Start Voice Session",type:"button",children:l.jsx(ud,{})})}function sr({onClick:e,disabled:t,theme:n}){const s=Ve(n);return l.jsx("button",{className:s.chatButton,onClick:e,disabled:t,"aria-label":"Start Chat Session",type:"button",children:l.jsx(dd,{})})}function rr({onClick:e,disabled:t,theme:n}){const s=Ve(n);return l.jsx("button",{className:s.videoButton,onClick:e,disabled:t,"aria-label":"Start Video Session",type:"button",children:l.jsx(fd,{})})}function q1({prompts:e,theme:t}){const n=Ve(t),[s,r]=C.useState(0);return C.useEffect(()=>{const o=setInterval(()=>{r(i=>(i+1)%e.length)},3e3);return()=>clearInterval(o)},[e.length]),l.jsx("div",{className:"w-96 min-h-[3rem] h-12 relative overflow-hidden flex items-center justify-center",children:e.map((o,i)=>l.jsx("div",{className:`
101
+ `,style:{boxShadow:t==="vox"?"0 2px 8px 0 rgba(80,60,200,0.10)":void 0,borderWidth:1},onClick:()=>{J(P),re([])},children:P},P+T)})}),w&&w.presentationMode!=="embedded"&&l.jsx(Kt,{interaction:w,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:D},w.methodName),l.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:H,children:l.jsx(Oy,{onSendMessage:J,onSendAttachments:te,disabled:r,theme:t,onEndChat:o})})]})}function Gy({onToggleCamera:e,onToggleScreenShare:t,onEndCall:n,onBack:r,theme:s,cameraEnabled:o,screenShareEnabled:i,isCameraLoading:a,isScreenShareLoading:c,disabled:d}){const u=Ve(s);return l.jsxs("div",{className:`flex items-center justify-center gap-3 p-4 ${u.video.controlsBackground}`,children:[l.jsx("button",{onClick:e,disabled:d||a,className:`p-3 rounded-full transition-all duration-200 ${o?u.video.controlEnabled:u.video.controlDisabled} ${d?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:o?"Turn off camera":"Turn on camera",children:a?l.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):o?l.jsx(je.Camera,{className:"w-5 h-5"}):l.jsx(je.CameraOff,{className:"w-5 h-5"})}),l.jsx("button",{onClick:t,disabled:d||c,className:`p-3 rounded-full transition-all duration-200 ${i?u.video.controlEnabled:u.video.controlDisabled} ${d?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:i?"Stop screen share":"Share screen",children:c?l.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):i?l.jsx(je.MonitorOff,{className:"w-5 h-5"}):l.jsx(je.Monitor,{className:"w-5 h-5"})}),n&&l.jsx("button",{onClick:n,disabled:d,className:`p-3 rounded-full transition-all duration-200 ${u.video.endCall} ${d?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"End call",children:l.jsx(je.PhoneOff,{className:"w-5 h-5"})}),r&&l.jsx("button",{onClick:r,disabled:d,className:`p-3 rounded-full transition-all duration-200 ${u.video.controlDisabled} ${d?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"Back",children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})})})]})}function Ha({trackRef:e,participant:t,isLocal:n=!1,className:r="",theme:s}){var c;const o=Ve(s),i=(t==null?void 0:t.name)||(t==null?void 0:t.identity)||(n?"You":"Participant"),a=(e==null?void 0:e.publication)&&!e.publication.isMuted;return l.jsxs("div",{className:`relative rounded-lg overflow-hidden ${o.video.tile} ${r}`,children:[a?l.jsx(Ne.VideoTrack,{trackRef:e,className:"w-full h-full object-cover"}):l.jsx("div",{className:`w-full h-full flex items-center justify-center ${o.video.placeholder}`,children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:`w-16 h-16 mx-auto mb-2 rounded-full flex items-center justify-center ${o.video.avatar}`,children:l.jsx(je.User,{className:"w-8 h-8"})}),l.jsx("p",{className:"text-sm opacity-80",children:i}),l.jsx("p",{className:"text-xs opacity-60",children:"Camera off"})]})}),l.jsx("div",{className:`absolute bottom-2 left-2 px-2 py-1 rounded text-xs ${o.video.nameOverlay}`,children:i}),((c=e==null?void 0:e.publication)==null?void 0:c.isMuted)&&l.jsx("div",{className:`absolute top-2 right-2 p-1 rounded ${o.video.mutedIndicator}`,children:l.jsx(je.CameraOff,{className:"w-4 h-4"})})]})}function Ky({trackRefs:e,participants:t,theme:n,localParticipant:r}){const s=e.find(u=>u.source===Z.Track.Source.Camera&&u.participant===r),o=e.filter(u=>u.participant!==r),i=e.length,a=i<=1?1:i<=4?2:3,c="grid gap-2 h-full",d={gridTemplateColumns:`repeat(${a}, 1fr)`,gridAutoRows:"minmax(0, 1fr)"};return l.jsxs("div",{className:c,style:d,children:[s&&r&&l.jsx(Ha,{trackRef:s,participant:r,isLocal:!0,theme:n,className:"min-h-0"}),o.map((u,f)=>{var h;return l.jsx(Ha,{trackRef:u,participant:u.participant,isLocal:!1,theme:n,className:"min-h-0"},((h=u.publication)==null?void 0:h.trackSid)||f)}),i===0&&l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsxs("div",{className:"text-center",children:[l.jsx(je.Users,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),l.jsx("p",{className:"text-lg opacity-70",children:"Waiting for participants..."}),l.jsx("p",{className:"text-sm opacity-50",children:"Turn on your camera to start the video call"})]})})]})}function Yy({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:s,onEndCall:o}){const i=Ve(t),a=Zl(e),{videoTrackRefs:c}=Pp(e),d=g.useMemo(()=>e.getRemoteParticipants(),[e,a]),u=pn(e,"camera"),f=pn(e,"screenShare"),[h,p]=g.useState(null),x=g.useCallback(async()=>{u.pending||await u.toggle()},[u]),m=g.useCallback(async()=>{f.pending||await f.toggle()},[f]),b=g.useCallback(()=>{o?o():n&&n()},[o,n]);return g.useEffect(()=>{if(!e)return;const k=v=>{console.log("📺 Video: Interactive UI state updated:",v),p(v)};return e.on("interactive.ui.update",k),e.on("interactive.ui.show",k),()=>{e.off("interactive.ui.update",k),e.off("interactive.ui.show",k)}},[e]),l.jsxs("div",{className:`flex flex-col h-full ${i.video.container}`,children:[l.jsxs("div",{className:`flex items-center justify-between p-4 border-b ${i.video.header}`,children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:`w-3 h-3 rounded-full ${i.video.statusDot}`}),l.jsx("span",{className:"font-medium",children:"Video Call"}),l.jsxs("span",{className:"text-sm opacity-70",children:[d.length+1," participant",d.length!==0?"s":""]})]}),l.jsx("div",{className:"flex items-center gap-2",children:l.jsx("button",{className:`p-2 rounded-lg transition-colors ${i.video.headerButton}`,title:"Layout options",children:l.jsx(je.LayoutGrid,{className:"w-4 h-4"})})})]}),l.jsx("div",{className:"flex-1 p-4 min-h-0",children:l.jsx(Ky,{trackRefs:c,participants:d,localParticipant:a==null?void 0:a.localParticipant,theme:t})}),h&&l.jsx(ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},className:"absolute inset-4 z-10",children:l.jsx(Kt,{interaction:h,onDismiss:()=>p(null),theme:t})}),l.jsx(Gy,{onToggleCamera:x,onToggleScreenShare:m,onEndCall:b,onBack:n,theme:t,cameraEnabled:u.enabled,screenShareEnabled:f.enabled,isCameraLoading:u.pending,isScreenShareLoading:f.pending,disabled:r})]})}function Wn({onClick:e,disabled:t,theme:n}){const r=Ve(n);return l.jsx("button",{className:r.micButton,onClick:e,disabled:t,"aria-label":"Start Voice Session",type:"button",children:l.jsx(ud,{})})}function rs({onClick:e,disabled:t,theme:n}){const r=Ve(n);return l.jsx("button",{className:r.chatButton,onClick:e,disabled:t,"aria-label":"Start Chat Session",type:"button",children:l.jsx(dd,{})})}function ss({onClick:e,disabled:t,theme:n}){const r=Ve(n);return l.jsx("button",{className:r.videoButton,onClick:e,disabled:t,"aria-label":"Start Video Session",type:"button",children:l.jsx(fd,{})})}function qy({prompts:e,theme:t}){const n=Ve(t),[r,s]=C.useState(0);return C.useEffect(()=>{const o=setInterval(()=>{s(i=>(i+1)%e.length)},3e3);return()=>clearInterval(o)},[e.length]),l.jsx("div",{className:"w-96 min-h-[3rem] h-12 relative overflow-hidden flex items-center justify-center",children:e.map((o,i)=>l.jsx("div",{className:`
102
102
  ${n.promptSlider}
103
- ${i===s?"opacity-100":"opacity-0"}
103
+ ${i===r?"opacity-100":"opacity-0"}
104
104
  whitespace-pre-line break-words
105
- `,style:{minHeight:"2.5rem",display:i===s?"block":"none"},children:o},i))})}function X1({statusMessage:e,theme:t}){const n=Ve(t);return l.jsxs("div",{className:"z-10 flex items-center space-x-2 mt-2 pb-2",children:[l.jsx("div",{className:n.statusIndicator}),l.jsx("span",{className:`text-xs ${n.text.muted}`,children:e})]})}const J1=({disabled:e,onStartCall:t,onStartChat:n,onStartVideo:s,prompts:r=['"Book a meeting with the marketing team"',`"What's the status of project Alpha?"`,`"Summarize yesterday's sales report"`,'"Find a good Italian restaurant nearby"','"Remind me to call John tomorrow at 10 AM"'],statusMessage:o="Agent is ready",title:i="Choose how to interact",subTitle:a="Ask me anything or give me a task to complete",theme:c="vox",modalities:d=["voice","chat","video"]})=>{const u=Ve(c),f=d.includes("voice"),h=d.includes("chat"),g=d.includes("video"),x=[f,h,g].filter(Boolean).length;return console.log("🎯 Welcome component debug:",{modalities:d,hasVoice:f,hasChat:h,hasVideo:g,totalButtons:x,onStartVideo:!!s}),l.jsxs("div",{className:"flex p-8 flex-col items-center h-full justify-center w-full","aria-disabled":e,children:[l.jsxs("div",{className:"mt-1 relative flex items-center justify-center mb-8 w-full",style:{minHeight:"120px"},children:[l.jsxs("div",{className:"absolute inset-0 flex items-center justify-center",children:[l.jsx("div",{className:u.pulseRings.ring1}),l.jsx("div",{className:u.pulseRings.ring2,style:{animationDelay:"0.5s"}}),l.jsx("div",{className:u.pulseRings.ring3,style:{animationDelay:"1s"}})]}),l.jsx("div",{className:"relative z-10 flex items-center justify-center",children:f&&h&&g?l.jsxs("div",{className:"flex gap-4 items-center justify-center",children:[l.jsx(Wn,{onClick:t,disabled:e,theme:c}),l.jsx(sr,{onClick:n,disabled:e,theme:c}),l.jsx(rr,{onClick:s||t,disabled:e,theme:c})]}):x>1?l.jsxs("div",{className:"flex gap-6 items-center justify-center",children:[f&&l.jsx(Wn,{onClick:t,disabled:e,theme:c}),h&&l.jsx(sr,{onClick:n,disabled:e,theme:c}),g&&s&&l.jsx(rr,{onClick:s,disabled:e,theme:c})]}):l.jsx("div",{className:"flex items-center justify-center",children:f?l.jsx(Wn,{onClick:t,disabled:e,theme:c}):h?l.jsx(sr,{onClick:n,disabled:e,theme:c}):g&&s?l.jsx(rr,{onClick:s,disabled:e,theme:c}):l.jsx(Wn,{onClick:t,disabled:e,theme:c})})})]}),l.jsxs("div",{className:"text-center flex flex-col items-center gap-y-2 mb-6 w-full",children:[l.jsx("h3",{className:`text-xl font-semibold mb-2 ${u.text.accent}`,children:i}),l.jsx("p",{className:`text-sm leading-relaxed px-4 ${u.text.secondary}`,children:a}),x>1&&l.jsxs("div",{className:"flex gap-6 mt-4 text-xs justify-center",children:[f&&l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx(ud,{className:"w-4 h-4"}),l.jsx("span",{className:u.text.muted,children:"Voice"})]}),h&&l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx(dd,{className:"w-4 h-4"}),l.jsx("span",{className:u.text.muted,children:"Chat"})]}),g&&l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx(fd,{className:"w-4 h-4"}),l.jsx("span",{className:u.text.muted,children:"Video"})]})]})]}),l.jsx(q1,{prompts:r,theme:c}),l.jsx(X1,{statusMessage:o,theme:c})]})};function hd({room:e,onSessionEnd:t,onSessionStart:n,enableConsoleLogging:s=!0,enableLocalStorage:r=!0,voxketSessionId:o}={}){const[i,a]=p.useState(null),[c,d]=p.useState([]),[u,f]=p.useState(null),[h,g]=p.useState([]),x=p.useCallback((v,T)=>{const w={timestamp:new Date,event:v,data:T,sessionId:i==null?void 0:i.sessionId,participantId:u==null?void 0:u.identity};if(d(S=>[...S,w]),r){const S=JSON.parse(localStorage.getItem("voxket-session-logs")||"[]");S.push(w),localStorage.setItem("voxket-session-logs",JSON.stringify(S))}return w},[i==null?void 0:i.sessionId,u==null?void 0:u.identity,s,r]);p.useEffect(()=>{if(!e)return;const v=()=>{const y=o||`session-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,D=new Date,_={sessionId:y,startTime:D,totalMessages:0,connectionIssues:0,participantCount:h.length,events:[]};a(_),x("SESSION_STARTED",{sessionId:y,startTime:D}),n==null||n(y)},T=()=>{if(i){const y=new Date,D=y.getTime()-i.startTime.getTime(),_={...i,endTime:y,duration:D,events:c};x("SESSION_ENDED",{sessionId:i.sessionId,duration:`${Math.round(D/1e3)}s`,totalMessages:i.totalMessages,connectionIssues:i.connectionIssues}),t==null||t(_),a(null),d([])}},w=y=>{x("CONNECTION_STATE_CHANGED",{state:y}),y===Z.ConnectionState.Reconnecting&&i&&(a(D=>D?{...D,connectionIssues:D.connectionIssues+1}:null),x("CONNECTION_ISSUE",{type:"reconnecting"}))},S=y=>{x("TRACK_PUBLISHED",{trackKind:y.kind,trackSource:y.source})},A=y=>{x("TRACK_UNPUBLISHED",{trackKind:y.kind,trackSource:y.source})},M=(y,D)=>{i&&a(_=>_?{..._,totalMessages:_.totalMessages+1}:null),x("DATA_RECEIVED",{participantId:D==null?void 0:D.identity,dataSize:y.length})},j=y=>{x("PARTICIPANT_CONNECTED",{participantId:y.identity,participantName:y.name}),g(D=>[...D,y]),i&&a(D=>D?{...D,participantCount:D.participantCount+1}:null)},z=y=>{x("PARTICIPANT_DISCONNECTED",{participantId:y.identity,participantName:y.name}),g(D=>D.filter(_=>_.identity!==y.identity))};return e.localParticipant&&f(e.localParticipant),e.on(Z.RoomEvent.Connected,v),e.on(Z.RoomEvent.Disconnected,T),e.on(Z.RoomEvent.ConnectionStateChanged,w),e.on(Z.RoomEvent.TrackPublished,S),e.on(Z.RoomEvent.TrackUnpublished,A),e.on(Z.RoomEvent.DataReceived,M),e.on(Z.RoomEvent.ParticipantConnected,j),e.on(Z.RoomEvent.ParticipantDisconnected,z),()=>{e.off(Z.RoomEvent.Connected,v),e.off(Z.RoomEvent.Disconnected,T),e.off(Z.RoomEvent.ConnectionStateChanged,w),e.off(Z.RoomEvent.TrackPublished,S),e.off(Z.RoomEvent.TrackUnpublished,A),e.off(Z.RoomEvent.DataReceived,M),e.off(Z.RoomEvent.ParticipantConnected,j),e.off(Z.RoomEvent.ParticipantDisconnected,z)}},[e,i,c,h.length,x,t,n]);const m=p.useCallback(()=>r?JSON.parse(localStorage.getItem("voxket-session-logs")||"[]"):c,[c,r]),b=p.useCallback(()=>{r&&localStorage.removeItem("voxket-session-logs"),d([])},[r]),k=p.useCallback(()=>{const v=m(),T=JSON.stringify(v,null,2),w="data:application/json;charset=utf-8,"+encodeURIComponent(T),S=`voxket-session-logs-${new Date().toISOString().split("T")[0]}.json`,A=document.createElement("a");A.setAttribute("href",w),A.setAttribute("download",S),A.click()},[m]);return{sessionMetrics:i,sessionLogs:c,logEvent:x,getSessionLogs:m,clearSessionLogs:b,exportSessionLogs:k}}class Po{constructor(){Se(this,"listeners",{})}on(t,n){return this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n),()=>this.off(t,n)}once(t,n){const s=(...r)=>{this.off(t,s),n(...r)};return this.on(t,s)}off(t,n){const s=this.listeners[t];if(!s)return;const r=s.indexOf(n);r>-1&&s.splice(r,1)}removeAllListeners(t){t?delete this.listeners[t]:this.listeners={}}emit(t,...n){const s=this.listeners[t];if(!s)return;const r=[...s];for(const o of r)try{o(...n)}catch(i){console.error(`Error in event listener for ${String(t)}:`,i)}}listenerCount(t){var n;return((n=this.listeners[t])==null?void 0:n.length)??0}eventNames(){return Object.keys(this.listeners)}}class md{constructor(t){Se(this,"plugins",new Map);Se(this,"installedPlugins",new Set);Se(this,"context");this.context={client:t,emit:t.emit.bind(t),on:t.on.bind(t),config:{}}}register(t){if(this.plugins.has(t.name))throw new Error(`Plugin '${t.name}' is already registered`);if(t.dependencies){for(const n of t.dependencies)if(!this.plugins.has(n))throw new Error(`Plugin '${t.name}' depends on '${n}' which is not registered`)}this.plugins.set(t.name,t)}async install(t,n){const s=this.plugins.get(t);if(!s)throw new Error(`Plugin '${t}' is not registered`);if(this.installedPlugins.has(t))throw new Error(`Plugin '${t}' is already installed`);if(s.dependencies)for(const o of s.dependencies)this.installedPlugins.has(o)||await this.install(o);const r={...this.context,config:{...s.config,...n}};s.install&&await s.install(r),this.installedPlugins.add(t),this.setupPluginEvents(s,r)}async uninstall(t){var s;const n=this.plugins.get(t);if(!n)throw new Error(`Plugin '${t}' is not registered`);if(this.installedPlugins.has(t)){for(const[r,o]of this.plugins)if(this.installedPlugins.has(r)&&((s=o.dependencies)!=null&&s.includes(t)))throw new Error(`Cannot uninstall '${t}' because '${r}' depends on it`);n.uninstall&&await n.uninstall(this.context),this.installedPlugins.delete(t)}}isInstalled(t){return this.installedPlugins.has(t)}getInstalledPlugins(){return Array.from(this.installedPlugins)}getAvailablePlugins(){return Array.from(this.plugins.keys())}getPluginInfo(t){return this.plugins.get(t)}setupPluginEvents(t,n){t.onSessionStart&&n.on("session.started",s=>{t.onSessionStart(n,s.id)}),t.onSessionEnd&&n.on("session.ended",s=>{t.onSessionEnd(n,s.id)}),t.onAgentResponse&&n.on("agent.response",s=>{t.onAgentResponse(n,s)})}}function Q1(e){return e}function Vo(e,t,n){return{name:e,version:"1.0.0",description:`${t} modality plugin`,install:async s=>{n.onActivate&&await n.onActivate(s)},uninstall:async s=>{n.onDeactivate&&await n.onDeactivate(s)},onAgentResponse:n.onMessage}}const ex={name:"analytics",version:"1.0.0",description:"Built-in analytics tracking",install:async e=>{console.log("Analytics plugin installed"),e.on("session.started",t=>{console.log("Analytics: Session started",t.id)}),e.on("session.ended",(t,n)=>{console.log("Analytics: Session ended",t.id,n)}),e.on("chat.message.sent",t=>{console.log("Analytics: User message sent",t.content.length)})}},tx={name:"debug",version:"1.0.0",description:"Debug logging and development tools",install:async e=>{console.log("Debug plugin installed");const t=e.emit;e.emit=(n,...s)=>(console.log(`[Debug] Event: ${String(n)}`,s),t(n,...s))}},nx={name:"metrics",version:"1.0.0",description:"Advanced metrics collection",install:async e=>{console.log("Metrics plugin installed");const t=new Map;e.on("session.started",n=>{t.set(n.id,{startTime:Date.now(),events:[]})}),e.on("agent.response",n=>{console.log("Metrics: Agent response analyzed",{type:n.type,length:n.content.length,timestamp:n.timestamp})})}},pd=C.createContext(null);function gd({config:e,children:t,autoConnect:n=!1}){const[s,r]=C.useState(null),[o,i]=C.useState(!1),[a,c]=C.useState(!1),[d,u]=C.useState(null),[f,h]=C.useState(null),[g,x]=C.useState("idle"),[m,b]=C.useState(null),[k,v]=C.useState([]),[T,w]=C.useState([]),[S,A]=C.useState([]);C.useEffect(()=>{const R=new Vn(e);return r(R),M(R),n&&j(R),()=>{R.disconnect().catch(console.error)}},[e,n]);const M=R=>{R.on("connection.connecting",()=>{c(!0),u(null)}),R.on("connection.connected",()=>{i(!0),c(!1),u(null)}),R.on("connection.disconnected",()=>{i(!1),c(!1),h(null),x("idle"),v([]),w([]),A([])}),R.on("connection.error",X=>{u(X),c(!1)}),R.on("session.created",X=>{h(X),x(X.state)}),R.on("session.state.changed",X=>{x(X),f&&h({...f,state:X})}),R.on("session.ended",(X,V)=>{h(null),x("idle"),b(V),v([]),w([]),A([])}),R.on("participant.joined",X=>{v(V=>[...V,X])}),R.on("participant.left",X=>{v(V=>V.filter(U=>U.id!==X.id))}),R.on("chat.message.received",X=>{w(V=>[...V,X])}),R.on("chat.message.sent",X=>{w(V=>[...V,X])}),R.on("transcription.received",X=>{A(V=>[...V,X])})},j=async R=>{const X=R||s;if(X)try{await X.connect()}catch(V){console.error("Failed to connect:",V)}},K={client:s,isConnected:o,isConnecting:a,connectionError:d,currentSession:f,sessionState:g,sessionMetrics:m,participants:k,chatMessages:T,transcriptions:S,connect:()=>j(),disconnect:async()=>{if(s)try{await s.disconnect()}catch(R){console.error("Failed to disconnect:",R)}},createSession:async(R,X={})=>{if(!s)throw new Error("Client not initialized");const V={agentId:R,participantName:X.participantName||"User",metadata:X.metadata,modalities:X.modalities||["voice"]};return await s.createSession(V)},endSession:async()=>s?await s.endSession():null,sendChatMessage:async R=>{if(!s)throw new Error("Client not initialized");await s.sendChatMessage(R)},setMicrophoneEnabled:async R=>{if(!s)throw new Error("Client not initialized");await s.setMicrophoneEnabled(R)},setCameraEnabled:async R=>{if(!s)throw new Error("Client not initialized");await s.setCameraEnabled(R)},startScreenShare:async()=>{if(!s)throw new Error("Client not initialized");await s.startScreenShare()},stopScreenShare:async()=>{if(!s)throw new Error("Client not initialized");await s.stopScreenShare()}};return l.jsx(pd.Provider,{value:K,children:t})}function Qe(){const e=C.useContext(pd);if(!e)throw new Error("useVoxket must be used within a VoxketProvider");return e}class sx extends Po{constructor(n){super();Se(this,"room",null);Se(this,"registeredMethods",new Map);Se(this,"activeInteractions",new Map);Se(this,"currentInteraction",null);n&&this.setRoom(n)}setRoom(n){this.room=n}async registerFrontendRPC(n,s,r="embedded"){if(console.log(`RpcManager: Starting registration for method '${n}'`),!this.room)throw console.error(`RpcManager: Cannot register '${n}' - no room instance`),new Error("Room not initialized. Cannot register RPC method.");if(!this.room.localParticipant)throw console.error(`RpcManager: Cannot register '${n}' - no local participant`),new Error("Local participant not available for RPC registration");console.log(`RpcManager: Room state: ${this.room.state}`),console.log(`RpcManager: Local participant: ${this.room.localParticipant.identity}`),console.log(`RpcManager: Registering frontend RPC method: ${n}`);const o={methodName:n,component:s,presentationMode:r};this.registeredMethods.set(n,o);try{this.room.registerRpcMethod(n,async i=>{console.log(`RpcManager: RPC method '${n}' called by ${i.callerIdentity}`),console.log("RpcManager: Payload:",i.payload),this.emit("rpc.method.called",{methodName:n,data:i});let a;console.log(`RpcManager: Current registration for '${n}':`,o);let c=i.responseTimeout||30;try{a=JSON.parse(i.payload)}catch{a=i.payload}try{const d=await this.awaitUserInteraction(n,s,r,a,c);return JSON.stringify(d)}catch(d){throw console.error(`RpcManager: Error in RPC method '${n}':`,d),d}}),this.emit("rpc.method.registered",{methodName:n}),console.log(`RpcManager: Successfully registered RPC method: ${n}`)}catch(i){throw console.error(`RpcManager: Failed to register RPC method '${n}':`,i),i}}async awaitUserInteraction(n,s,r,o,i){return new Promise((a,c)=>{const d=`${n}_${Date.now()}`;console.log(`RpcManager: Starting user interaction for method: ${n}, timeout: ${i} seconds`);const u={didSuccess:(h,g)=>{console.log(`RpcManager: User interaction successful for method: ${n}`,h),this.clearInteraction(d),this.currentInteraction=null;const x={success:!0,message:"User interaction completed successfully",data:h,timestamp:new Date,...g?{successView:g}:{}};this.emit("rpc.interaction.completed",{methodName:n,response:x}),a(x)},didFail:h=>{console.log(`RpcManager: User interaction failed for method: ${n}`,h),this.clearInteraction(d);const g={success:!1,message:"User interaction failed",error:h,timestamp:new Date};this.emit("rpc.interaction.completed",{methodName:n,response:g}),a(g)},dismissView:()=>{var g;console.log(`RpcManager: User dismissed interaction for method: ${n}`),console.log("RpcManager: Current interaction before dismiss:",(g=this.currentInteraction)==null?void 0:g.methodName),this.clearInteraction(d),this.currentInteraction=null,console.log("RpcManager: Current interaction after dismiss:",this.currentInteraction);const h={success:!0,data:{dismissed:!0,reason:"User dismissed the interaction"},message:"User interaction dismissed",timestamp:new Date};this.emit("rpc.interaction.dismissed",{methodName:n,response:h}),this.emit("rpc.interaction.completed",{methodName:n,response:h}),setTimeout(()=>{var x;((x=this.currentInteraction)==null?void 0:x.methodName)===n&&(console.log(`RpcManager: Force clearing interaction for ${n}`),this.currentInteraction=null)},0),a(h)},didTimeout:h=>{console.log(`RpcManager: User interaction timeout for method: ${n}`),this.clearInteraction(d),this.currentInteraction=null;const g={success:!0,message:`User interaction timed out after ${i} seconds, it should be considered as declined, agent don't need to retry`,timestamp:new Date,...h?{timeoutView:h}:{}};this.emit("rpc.interaction.timeout",{methodName:n,response:g}),setTimeout(()=>{var x;((x=this.currentInteraction)==null?void 0:x.methodName)===n&&(console.log(`RpcManager: Force clearing interaction for ${n}`),this.currentInteraction=null)},0),a(g)}},f=setTimeout(()=>{u.didTimeout&&u.didTimeout()},i);this.activeInteractions.set(d,{resolve:h=>a(JSON.parse(h)),reject:c,timeoutId:f}),this.currentInteraction={isVisible:!0,methodName:n,component:s,presentationMode:r,timeout:i,data:o,handler:u},this.emit("rpc.interaction.started",{methodName:n,presentationMode:r}),setTimeout(async()=>{var h;if((h=this.currentInteraction)!=null&&h.handler)try{console.log(`RpcManager: Component created for method: ${n} with data:`,o)}catch(g){console.error("RpcManager: Error loading data into component:",g),u.didFail({error:"Failed to load data into component"})}},100)})}clearInteraction(n){const s=this.activeInteractions.get(n);s&&(console.log(`RpcManager: Clearing interaction: ${n}`),clearTimeout(s.timeoutId),this.activeInteractions.delete(n))}getCurrentInteraction(){return this.currentInteraction}dismissCurrentInteraction(){var n;this.currentInteraction&&(console.log(`RpcManager: Dismissing current interaction: ${this.currentInteraction.methodName}`),(n=this.currentInteraction.handler)==null||n.dismissView(),setTimeout(()=>{this.currentInteraction&&(console.log("RpcManager: Force clearing lingering interaction"),this.currentInteraction=null)},0))}getRegisteredMethods(){return Array.from(this.registeredMethods.keys())}unregisterMethod(n){this.registeredMethods.delete(n),console.log(`RpcManager: Unregistered RPC method: ${n}`)}clear(){for(const[n,s]of this.activeInteractions)clearTimeout(s.timeoutId);this.activeInteractions.clear(),this.registeredMethods.clear(),this.currentInteraction=null,console.log("RpcManager: Cleared all registrations and interactions")}}let Za=!1;function yd(){if(Za||typeof document>"u")return;const e=`
105
+ `,style:{minHeight:"2.5rem",display:i===r?"block":"none"},children:o},i))})}function Xy({statusMessage:e,theme:t}){const n=Ve(t);return l.jsxs("div",{className:"z-10 flex items-center space-x-2 mt-2 pb-2",children:[l.jsx("div",{className:n.statusIndicator}),l.jsx("span",{className:`text-xs ${n.text.muted}`,children:e})]})}const Jy=({disabled:e,onStartCall:t,onStartChat:n,onStartVideo:r,prompts:s=['"Book a meeting with the marketing team"',`"What's the status of project Alpha?"`,`"Summarize yesterday's sales report"`,'"Find a good Italian restaurant nearby"','"Remind me to call John tomorrow at 10 AM"'],statusMessage:o="Agent is ready",title:i="Choose how to interact",subTitle:a="Ask me anything or give me a task to complete",theme:c="vox",modalities:d=["voice","chat","video"]})=>{const u=Ve(c),f=d.includes("voice"),h=d.includes("chat"),p=d.includes("video"),x=[f,h,p].filter(Boolean).length;return console.log("🎯 Welcome component debug:",{modalities:d,hasVoice:f,hasChat:h,hasVideo:p,totalButtons:x,onStartVideo:!!r}),l.jsxs("div",{className:"flex p-8 flex-col items-center h-full justify-center w-full","aria-disabled":e,children:[l.jsxs("div",{className:"mt-1 relative flex items-center justify-center mb-8 w-full",style:{minHeight:"120px"},children:[l.jsxs("div",{className:"absolute inset-0 flex items-center justify-center",children:[l.jsx("div",{className:u.pulseRings.ring1}),l.jsx("div",{className:u.pulseRings.ring2,style:{animationDelay:"0.5s"}}),l.jsx("div",{className:u.pulseRings.ring3,style:{animationDelay:"1s"}})]}),l.jsx("div",{className:"relative z-10 flex items-center justify-center",children:f&&h&&p?l.jsxs("div",{className:"flex gap-4 items-center justify-center",children:[l.jsx(Wn,{onClick:t,disabled:e,theme:c}),l.jsx(rs,{onClick:n,disabled:e,theme:c}),l.jsx(ss,{onClick:r||t,disabled:e,theme:c})]}):x>1?l.jsxs("div",{className:"flex gap-6 items-center justify-center",children:[f&&l.jsx(Wn,{onClick:t,disabled:e,theme:c}),h&&l.jsx(rs,{onClick:n,disabled:e,theme:c}),p&&r&&l.jsx(ss,{onClick:r,disabled:e,theme:c})]}):l.jsx("div",{className:"flex items-center justify-center",children:f?l.jsx(Wn,{onClick:t,disabled:e,theme:c}):h?l.jsx(rs,{onClick:n,disabled:e,theme:c}):p&&r?l.jsx(ss,{onClick:r,disabled:e,theme:c}):l.jsx(Wn,{onClick:t,disabled:e,theme:c})})})]}),l.jsxs("div",{className:"text-center flex flex-col items-center gap-y-2 mb-6 w-full",children:[l.jsx("h3",{className:`text-xl font-semibold mb-2 ${u.text.accent}`,children:i}),l.jsx("p",{className:`text-sm leading-relaxed px-4 ${u.text.secondary}`,children:a}),x>1&&l.jsxs("div",{className:"flex gap-6 mt-4 text-xs justify-center",children:[f&&l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx(ud,{className:"w-4 h-4"}),l.jsx("span",{className:u.text.muted,children:"Voice"})]}),h&&l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx(dd,{className:"w-4 h-4"}),l.jsx("span",{className:u.text.muted,children:"Chat"})]}),p&&l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx(fd,{className:"w-4 h-4"}),l.jsx("span",{className:u.text.muted,children:"Video"})]})]})]}),l.jsx(qy,{prompts:s,theme:c}),l.jsx(Xy,{statusMessage:o,theme:c})]})};function hd({room:e,onSessionEnd:t,onSessionStart:n,enableConsoleLogging:r=!0,enableLocalStorage:s=!0,voxketSessionId:o}={}){const[i,a]=g.useState(null),[c,d]=g.useState([]),[u,f]=g.useState(null),[h,p]=g.useState([]),x=g.useCallback((v,E)=>{const w={timestamp:new Date,event:v,data:E,sessionId:i==null?void 0:i.sessionId,participantId:u==null?void 0:u.identity};if(d(S=>[...S,w]),s){const S=JSON.parse(localStorage.getItem("voxket-session-logs")||"[]");S.push(w),localStorage.setItem("voxket-session-logs",JSON.stringify(S))}return w},[i==null?void 0:i.sessionId,u==null?void 0:u.identity,r,s]);g.useEffect(()=>{if(!e)return;const v=()=>{const y=o||`session-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,D=new Date,_={sessionId:y,startTime:D,totalMessages:0,connectionIssues:0,participantCount:h.length,events:[]};a(_),x("SESSION_STARTED",{sessionId:y,startTime:D}),n==null||n(y)},E=()=>{if(i){const y=new Date,D=y.getTime()-i.startTime.getTime(),_={...i,endTime:y,duration:D,events:c};x("SESSION_ENDED",{sessionId:i.sessionId,duration:`${Math.round(D/1e3)}s`,totalMessages:i.totalMessages,connectionIssues:i.connectionIssues}),t==null||t(_),a(null),d([])}},w=y=>{x("CONNECTION_STATE_CHANGED",{state:y}),y===Z.ConnectionState.Reconnecting&&i&&(a(D=>D?{...D,connectionIssues:D.connectionIssues+1}:null),x("CONNECTION_ISSUE",{type:"reconnecting"}))},S=y=>{x("TRACK_PUBLISHED",{trackKind:y.kind,trackSource:y.source})},A=y=>{x("TRACK_UNPUBLISHED",{trackKind:y.kind,trackSource:y.source})},M=(y,D)=>{i&&a(_=>_?{..._,totalMessages:_.totalMessages+1}:null),x("DATA_RECEIVED",{participantId:D==null?void 0:D.identity,dataSize:y.length})},j=y=>{x("PARTICIPANT_CONNECTED",{participantId:y.identity,participantName:y.name}),p(D=>[...D,y]),i&&a(D=>D?{...D,participantCount:D.participantCount+1}:null)},z=y=>{x("PARTICIPANT_DISCONNECTED",{participantId:y.identity,participantName:y.name}),p(D=>D.filter(_=>_.identity!==y.identity))};return e.localParticipant&&f(e.localParticipant),e.on(Z.RoomEvent.Connected,v),e.on(Z.RoomEvent.Disconnected,E),e.on(Z.RoomEvent.ConnectionStateChanged,w),e.on(Z.RoomEvent.TrackPublished,S),e.on(Z.RoomEvent.TrackUnpublished,A),e.on(Z.RoomEvent.DataReceived,M),e.on(Z.RoomEvent.ParticipantConnected,j),e.on(Z.RoomEvent.ParticipantDisconnected,z),()=>{e.off(Z.RoomEvent.Connected,v),e.off(Z.RoomEvent.Disconnected,E),e.off(Z.RoomEvent.ConnectionStateChanged,w),e.off(Z.RoomEvent.TrackPublished,S),e.off(Z.RoomEvent.TrackUnpublished,A),e.off(Z.RoomEvent.DataReceived,M),e.off(Z.RoomEvent.ParticipantConnected,j),e.off(Z.RoomEvent.ParticipantDisconnected,z)}},[e,i,c,h.length,x,t,n]);const m=g.useCallback(()=>s?JSON.parse(localStorage.getItem("voxket-session-logs")||"[]"):c,[c,s]),b=g.useCallback(()=>{s&&localStorage.removeItem("voxket-session-logs"),d([])},[s]),k=g.useCallback(()=>{const v=m(),E=JSON.stringify(v,null,2),w="data:application/json;charset=utf-8,"+encodeURIComponent(E),S=`voxket-session-logs-${new Date().toISOString().split("T")[0]}.json`,A=document.createElement("a");A.setAttribute("href",w),A.setAttribute("download",S),A.click()},[m]);return{sessionMetrics:i,sessionLogs:c,logEvent:x,getSessionLogs:m,clearSessionLogs:b,exportSessionLogs:k}}class Po{constructor(){Se(this,"listeners",{})}on(t,n){return this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n),()=>this.off(t,n)}once(t,n){const r=(...s)=>{this.off(t,r),n(...s)};return this.on(t,r)}off(t,n){const r=this.listeners[t];if(!r)return;const s=r.indexOf(n);s>-1&&r.splice(s,1)}removeAllListeners(t){t?delete this.listeners[t]:this.listeners={}}emit(t,...n){const r=this.listeners[t];if(!r)return;const s=[...r];for(const o of s)try{o(...n)}catch(i){console.error(`Error in event listener for ${String(t)}:`,i)}}listenerCount(t){var n;return((n=this.listeners[t])==null?void 0:n.length)??0}eventNames(){return Object.keys(this.listeners)}}class md{constructor(t){Se(this,"plugins",new Map);Se(this,"installedPlugins",new Set);Se(this,"context");this.context={client:t,emit:t.emit.bind(t),on:t.on.bind(t),config:{}}}register(t){if(this.plugins.has(t.name))throw new Error(`Plugin '${t.name}' is already registered`);if(t.dependencies){for(const n of t.dependencies)if(!this.plugins.has(n))throw new Error(`Plugin '${t.name}' depends on '${n}' which is not registered`)}this.plugins.set(t.name,t)}async install(t,n){const r=this.plugins.get(t);if(!r)throw new Error(`Plugin '${t}' is not registered`);if(this.installedPlugins.has(t))throw new Error(`Plugin '${t}' is already installed`);if(r.dependencies)for(const o of r.dependencies)this.installedPlugins.has(o)||await this.install(o);const s={...this.context,config:{...r.config,...n}};r.install&&await r.install(s),this.installedPlugins.add(t),this.setupPluginEvents(r,s)}async uninstall(t){var r;const n=this.plugins.get(t);if(!n)throw new Error(`Plugin '${t}' is not registered`);if(this.installedPlugins.has(t)){for(const[s,o]of this.plugins)if(this.installedPlugins.has(s)&&((r=o.dependencies)!=null&&r.includes(t)))throw new Error(`Cannot uninstall '${t}' because '${s}' depends on it`);n.uninstall&&await n.uninstall(this.context),this.installedPlugins.delete(t)}}isInstalled(t){return this.installedPlugins.has(t)}getInstalledPlugins(){return Array.from(this.installedPlugins)}getAvailablePlugins(){return Array.from(this.plugins.keys())}getPluginInfo(t){return this.plugins.get(t)}setupPluginEvents(t,n){t.onSessionStart&&n.on("session.started",r=>{t.onSessionStart(n,r.id)}),t.onSessionEnd&&n.on("session.ended",r=>{t.onSessionEnd(n,r.id)}),t.onAgentResponse&&n.on("agent.response",r=>{t.onAgentResponse(n,r)})}}function Qy(e){return e}function Vo(e,t,n){return{name:e,version:"1.0.0",description:`${t} modality plugin`,install:async r=>{n.onActivate&&await n.onActivate(r)},uninstall:async r=>{n.onDeactivate&&await n.onDeactivate(r)},onAgentResponse:n.onMessage}}const ex={name:"analytics",version:"1.0.0",description:"Built-in analytics tracking",install:async e=>{console.log("Analytics plugin installed"),e.on("session.started",t=>{console.log("Analytics: Session started",t.id)}),e.on("session.ended",(t,n)=>{console.log("Analytics: Session ended",t.id,n)}),e.on("chat.message.sent",t=>{console.log("Analytics: User message sent",t.content.length)})}},tx={name:"debug",version:"1.0.0",description:"Debug logging and development tools",install:async e=>{console.log("Debug plugin installed");const t=e.emit;e.emit=(n,...r)=>(console.log(`[Debug] Event: ${String(n)}`,r),t(n,...r))}},nx={name:"metrics",version:"1.0.0",description:"Advanced metrics collection",install:async e=>{console.log("Metrics plugin installed");const t=new Map;e.on("session.started",n=>{t.set(n.id,{startTime:Date.now(),events:[]})}),e.on("agent.response",n=>{console.log("Metrics: Agent response analyzed",{type:n.type,length:n.content.length,timestamp:n.timestamp})})}},gd=C.createContext(null);function pd({config:e,children:t,autoConnect:n=!1}){const[r,s]=C.useState(null),[o,i]=C.useState(!1),[a,c]=C.useState(!1),[d,u]=C.useState(null),[f,h]=C.useState(null),[p,x]=C.useState("idle"),[m,b]=C.useState(null),[k,v]=C.useState([]),[E,w]=C.useState([]),[S,A]=C.useState([]);C.useEffect(()=>{const R=new Vn(e);return s(R),M(R),n&&j(R),()=>{R.disconnect().catch(console.error)}},[e,n]);const M=R=>{R.on("connection.connecting",()=>{c(!0),u(null)}),R.on("connection.connected",()=>{i(!0),c(!1),u(null)}),R.on("connection.disconnected",()=>{i(!1),c(!1),h(null),x("idle"),v([]),w([]),A([])}),R.on("connection.error",X=>{u(X),c(!1)}),R.on("session.created",X=>{h(X),x(X.state)}),R.on("session.state.changed",X=>{x(X),f&&h({...f,state:X})}),R.on("session.ended",(X,V)=>{h(null),x("idle"),b(V),v([]),w([]),A([])}),R.on("participant.joined",X=>{v(V=>[...V,X])}),R.on("participant.left",X=>{v(V=>V.filter(H=>H.id!==X.id))}),R.on("chat.message.received",X=>{w(V=>[...V,X])}),R.on("chat.message.sent",X=>{w(V=>[...V,X])}),R.on("transcription.received",X=>{A(V=>[...V,X])})},j=async R=>{const X=R||r;if(X)try{await X.connect()}catch(V){console.error("Failed to connect:",V)}},K={client:r,isConnected:o,isConnecting:a,connectionError:d,currentSession:f,sessionState:p,sessionMetrics:m,participants:k,chatMessages:E,transcriptions:S,connect:()=>j(),disconnect:async()=>{if(r)try{await r.disconnect()}catch(R){console.error("Failed to disconnect:",R)}},createSession:async(R,X={})=>{if(!r)throw new Error("Client not initialized");const V={agentId:R,participantName:X.participantName||"User",metadata:X.metadata,modalities:X.modalities||["voice"]};return await r.createSession(V)},endSession:async()=>r?await r.endSession():null,sendChatMessage:async R=>{if(!r)throw new Error("Client not initialized");await r.sendChatMessage(R)},setMicrophoneEnabled:async R=>{if(!r)throw new Error("Client not initialized");await r.setMicrophoneEnabled(R)},setCameraEnabled:async R=>{if(!r)throw new Error("Client not initialized");await r.setCameraEnabled(R)},startScreenShare:async()=>{if(!r)throw new Error("Client not initialized");await r.startScreenShare()},stopScreenShare:async()=>{if(!r)throw new Error("Client not initialized");await r.stopScreenShare()}};return l.jsx(gd.Provider,{value:K,children:t})}function Qe(){const e=C.useContext(gd);if(!e)throw new Error("useVoxket must be used within a VoxketProvider");return e}class rx extends Po{constructor(n){super();Se(this,"room",null);Se(this,"registeredMethods",new Map);Se(this,"activeInteractions",new Map);Se(this,"currentInteraction",null);n&&this.setRoom(n)}setRoom(n){this.room=n}async registerFrontendRPC(n,r,s="embedded"){if(console.log(`RpcManager: Starting registration for method '${n}'`),!this.room)throw console.error(`RpcManager: Cannot register '${n}' - no room instance`),new Error("Room not initialized. Cannot register RPC method.");if(!this.room.localParticipant)throw console.error(`RpcManager: Cannot register '${n}' - no local participant`),new Error("Local participant not available for RPC registration");console.log(`RpcManager: Room state: ${this.room.state}`),console.log(`RpcManager: Local participant: ${this.room.localParticipant.identity}`),console.log(`RpcManager: Registering frontend RPC method: ${n}`);const o={methodName:n,component:r,presentationMode:s};this.registeredMethods.set(n,o);try{this.room.registerRpcMethod(n,async i=>{console.log(`RpcManager: RPC method '${n}' called by ${i.callerIdentity}`),console.log("RpcManager: Payload:",i.payload),this.emit("rpc.method.called",{methodName:n,data:i});let a;console.log(`RpcManager: Current registration for '${n}':`,o);let c=i.responseTimeout||30;try{a=JSON.parse(i.payload)}catch{a=i.payload}try{const d=await this.awaitUserInteraction(n,r,s,a,c);return JSON.stringify(d)}catch(d){throw console.error(`RpcManager: Error in RPC method '${n}':`,d),d}}),this.emit("rpc.method.registered",{methodName:n}),console.log(`RpcManager: Successfully registered RPC method: ${n}`)}catch(i){throw console.error(`RpcManager: Failed to register RPC method '${n}':`,i),i}}async awaitUserInteraction(n,r,s,o,i){return new Promise((a,c)=>{const d=`${n}_${Date.now()}`;console.log(`RpcManager: Starting user interaction for method: ${n}, timeout: ${i} seconds`);const u={didSuccess:(h,p)=>{console.log(`RpcManager: User interaction successful for method: ${n}`,h),this.clearInteraction(d),this.currentInteraction=null;const x={success:!0,message:"User interaction completed successfully",data:h,timestamp:new Date,...p?{successView:p}:{}};this.emit("rpc.interaction.completed",{methodName:n,response:x}),a(x)},didFail:h=>{console.log(`RpcManager: User interaction failed for method: ${n}`,h),this.clearInteraction(d);const p={success:!1,message:"User interaction failed",error:h,timestamp:new Date};this.emit("rpc.interaction.completed",{methodName:n,response:p}),a(p)},dismissView:()=>{var p;console.log(`RpcManager: User dismissed interaction for method: ${n}`),console.log("RpcManager: Current interaction before dismiss:",(p=this.currentInteraction)==null?void 0:p.methodName),this.clearInteraction(d),this.currentInteraction=null,console.log("RpcManager: Current interaction after dismiss:",this.currentInteraction);const h={success:!0,data:{dismissed:!0,reason:"User dismissed the interaction"},message:"User interaction dismissed",timestamp:new Date};this.emit("rpc.interaction.dismissed",{methodName:n,response:h}),this.emit("rpc.interaction.completed",{methodName:n,response:h}),setTimeout(()=>{var x;((x=this.currentInteraction)==null?void 0:x.methodName)===n&&(console.log(`RpcManager: Force clearing interaction for ${n}`),this.currentInteraction=null)},0),a(h)},didTimeout:h=>{console.log(`RpcManager: User interaction timeout for method: ${n}`),this.clearInteraction(d),this.currentInteraction=null;const p={success:!0,message:`User interaction timed out after ${i} seconds, it should be considered as declined, agent don't need to retry`,timestamp:new Date,...h?{timeoutView:h}:{}};this.emit("rpc.interaction.timeout",{methodName:n,response:p}),setTimeout(()=>{var x;((x=this.currentInteraction)==null?void 0:x.methodName)===n&&(console.log(`RpcManager: Force clearing interaction for ${n}`),this.currentInteraction=null)},0),a(p)}},f=setTimeout(()=>{u.didTimeout&&u.didTimeout()},i);this.activeInteractions.set(d,{resolve:h=>a(JSON.parse(h)),reject:c,timeoutId:f}),this.currentInteraction={isVisible:!0,methodName:n,component:r,presentationMode:s,timeout:i,data:o,handler:u},this.emit("rpc.interaction.started",{methodName:n,presentationMode:s}),setTimeout(async()=>{var h;if((h=this.currentInteraction)!=null&&h.handler)try{console.log(`RpcManager: Component created for method: ${n} with data:`,o)}catch(p){console.error("RpcManager: Error loading data into component:",p),u.didFail({error:"Failed to load data into component"})}},100)})}clearInteraction(n){const r=this.activeInteractions.get(n);r&&(console.log(`RpcManager: Clearing interaction: ${n}`),clearTimeout(r.timeoutId),this.activeInteractions.delete(n))}getCurrentInteraction(){return this.currentInteraction}dismissCurrentInteraction(){var n;this.currentInteraction&&(console.log(`RpcManager: Dismissing current interaction: ${this.currentInteraction.methodName}`),(n=this.currentInteraction.handler)==null||n.dismissView(),setTimeout(()=>{this.currentInteraction&&(console.log("RpcManager: Force clearing lingering interaction"),this.currentInteraction=null)},0))}getRegisteredMethods(){return Array.from(this.registeredMethods.keys())}unregisterMethod(n){this.registeredMethods.delete(n),console.log(`RpcManager: Unregistered RPC method: ${n}`)}clear(){for(const[n,r]of this.activeInteractions)clearTimeout(r.timeoutId);this.activeInteractions.clear(),this.registeredMethods.clear(),this.currentInteraction=null,console.log("RpcManager: Cleared all registrations and interactions")}}let Za=!1;function yd(){if(Za||typeof document>"u")return;const e=`
106
106
  /* Custom scrollbar styles for chat */
107
107
  .chat-scrollable {
108
108
  scrollbar-width: thin;
@@ -324,7 +324,436 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
324
324
  .voxket-widget-root .relative {
325
325
  position: relative;
326
326
  }
327
- `,t=document.createElement("style");t.type="text/css",t.setAttribute("data-voxket-styles","true"),t.textContent=e,document.head.appendChild(t),Za=!0}class he extends Error{constructor(t,n,s){super(t),this.code=n,this.details=s,this.name="VoxketError"}}class Vn extends Po{constructor(n){super();Se(this,"config");Se(this,"room",null);Se(this,"pluginManager");Se(this,"rpcManager");Se(this,"isConnected",!1);Se(this,"currentSession",null);Se(this,"connectionState",Z.ConnectionState.Disconnected);Se(this,"renderedComponents",new Map);Se(this,"textStreamHandlersRegistered",!1);Se(this,"currentAgentInfo",null);Se(this,"chatMessages",[]);Se(this,"isAgentConnected",!1);Se(this,"agentState","idle");yd(),this.config=n,this.pluginManager=new md(this),this.rpcManager=new sx,this.setupEventListeners(),this.initializeClient()}setupEventListeners(){this.on("connection.connected",()=>{var n,s;this.isConnected=!0,(s=(n=this.config).onConnected)==null||s.call(n)}),this.on("connection.disconnected",n=>{var s,r;this.isConnected=!1,(r=(s=this.config).onDisconnected)==null||r.call(s,n)}),this.on("connection.error",n=>{var s,r;(r=(s=this.config).onError)==null||r.call(s,n)}),this.on("chat.message.received",n=>{var s,r;this.addChatMessage(n),(r=(s=this.config).onMessageReceived)==null||r.call(s,n)}),this.on("chat.message.updated",n=>{this.updateChatMessage(n)}),this.on("chat.message.sent",n=>{this.addChatMessage(n)}),this.on("transcription.received",n=>{var s,r;(r=(s=this.config).onTranscriptionReceived)==null||r.call(s,n)}),this.on("session.state.changed",n=>{var s,r;(r=(s=this.config).onSessionStateChanged)==null||r.call(s,n)}),this.on("session.created",n=>{var s,r;(r=(s=this.config).onSessionStart)==null||r.call(s,n.id)}),this.on("session.ended",(n,s)=>{var r,o;(o=(r=this.config).onSessionEnd)==null||o.call(r,s)}),this.on("participant.joined",n=>{var s,r;(r=(s=this.config).onUserJoined)==null||r.call(s,n.id)}),this.on("participant.left",n=>{var s,r;(r=(s=this.config).onUserLeft)==null||r.call(s,n.id)}),this.setupRpcEventForwarding()}setupRpcEventForwarding(){if(!this.rpcManager){console.warn("RpcManager not initialized, skipping event forwarding setup");return}this.rpcManager.on("rpc.method.registered",n=>this.emit("rpc.method.registered",n)),this.rpcManager.on("rpc.method.called",n=>this.emit("rpc.method.called",n)),this.rpcManager.on("rpc.interaction.started",n=>this.emit("rpc.interaction.started",n)),this.rpcManager.on("rpc.interaction.completed",n=>this.emit("rpc.interaction.completed",n)),this.rpcManager.on("rpc.interaction.timeout",n=>this.emit("rpc.interaction.timeout",n)),this.rpcManager.on("rpc.interaction.dismissed",n=>this.emit("rpc.interaction.dismissed",n))}initializeClient(){this.room=new Z.Room,this.setupRoomEventListeners()}setupRoomEventListeners(){this.room&&(this.room.on(Z.RoomEvent.Connected,()=>{var n,s;this.connectionState=Z.ConnectionState.Connected,this.emit("connection.connected"),this.rpcManager.setRoom(this.room),(s=(n=this.currentSession)==null?void 0:n.activeModalities)!=null&&s.includes("voice")&&setTimeout(async()=>{var r;try{(r=this.room)!=null&&r.localParticipant&&(this.room.localParticipant.isMicrophoneEnabled?this.emit("track.unmuted",{source:"microphone",enabled:!0}):(await this.room.localParticipant.setMicrophoneEnabled(!0),this.emit("track.unmuted",{source:"microphone",enabled:!0})))}catch(o){console.warn("VoxketClient: Failed to enable microphone after room connection:",o)}},1e3),this.textStreamHandlersRegistered||this.setupTextStreamHandlers()}),this.room.on(Z.RoomEvent.Disconnected,n=>{var s;console.log("🔴 VoxketClient: Room disconnected, reason:",n),this.connectionState=Z.ConnectionState.Disconnected,this.textStreamHandlersRegistered=!1,this.isAgentConnected=!1,console.log("🤖 VoxketClient: Agent marked as disconnected"),n&&console.log("🔍 VoxketClient: Disconnect reason details:",{reason:n.toString(),currentSession:(s=this.currentSession)==null?void 0:s.id,agentConnected:this.isAgentConnected,connectionState:this.connectionState}),this.emit("connection.disconnected",n==null?void 0:n.toString())}),this.room.on(Z.RoomEvent.ConnectionStateChanged,n=>{this.connectionState=n,n===Z.ConnectionState.Connecting&&this.emit("connection.connecting")}),this.room.on(Z.RoomEvent.ParticipantConnected,n=>{const s={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.joined",s)}),this.room.on(Z.RoomEvent.ParticipantDisconnected,n=>{const s={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.left",s)}))}setupTextStreamHandlers(){if(!this.room)return;try{this.room.registerTextStreamHandler("lk.chat",async(s,r)=>{try{const o=await s.readAll(),i={id:`msg_${Date.now()}_${r.identity||"user"}_${Math.random().toString(36).substr(2,9)}`,content:o,timestamp:new Date,sender:{id:r.identity||"user",name:r.identity||"User",type:"participant"},metadata:{topic:"lk.chat"}};this.emit("chat.message.received",i)}catch(o){console.error("VoxketClient: Failed to process lk.chat message:",o)}})}catch(s){console.warn("VoxketClient: lk.chat handler already registered, skipping:",s)}try{this.room.registerTextStreamHandler("lk.transcription",async(s,r)=>{var o,i;try{const a=`msg_${Date.now()}_agent_transcription_${Math.random().toString(36).substr(2,9)}`;let c="";const d=((o=this.currentAgentInfo)==null?void 0:o.name)||r.identity||"AI Assistant",u={id:a,content:"",timestamp:new Date,sender:{id:r.identity||"agent",name:d,type:"agent"},metadata:{topic:"lk.transcription",streaming:!0}};this.emit("chat.message.received",u);for await(const g of s){c+=g;const x=this.convertMarkdownToText(c),m={...u,content:x,metadata:{...u.metadata,streaming:!0}};this.emit("chat.message.updated",m)}const f=this.convertMarkdownToText(c),h={...u,content:f,metadata:{...u.metadata,streaming:!1}};this.emit("chat.message.updated",h)}catch(a){console.error("VoxketClient: Failed to process lk.transcription message:",a);try{const c=await s.readAll(),d=((i=this.currentAgentInfo)==null?void 0:i.name)||r.identity||"AI Assistant",u={id:`msg_${Date.now()}_agent_transcription_${Math.random().toString(36).substr(2,9)}`,content:c,timestamp:new Date,sender:{id:r.identity||"agent",name:d,type:"agent"},metadata:{topic:"lk.transcription"}};this.emit("chat.message.received",u)}catch(c){console.error("VoxketClient: Fallback failed for lk.transcription:",c)}}})}catch(s){console.warn("VoxketClient: lk.transcription handler already registered, skipping:",s)}try{this.room.registerTextStreamHandler("suggested_response",async s=>{const r=await s.readAll();let o=[];try{o=["tes","hello how are you","algebra make me learn that ","what is the meaning of life"]}catch(i){console.warn("VoxketClient: Failed to parse suggested_response:",i,r)}this.emit("suggested.response",o)})}catch(s){console.warn("VoxketClient: suggested_response handler already registered, skipping:",s)}try{this.room.registerTextStreamHandler("agent_state_changed",async(s,r)=>{const o=await s.readAll();console.log("🤖 VoxketClient: agent_state_changed stream received:",o);let i={};try{i=typeof o=="string"?JSON.parse(o.replace(/'/g,'"')):o}catch(a){console.warn("VoxketClient: Failed to parse agent_state_changed:",a,o)}this.isAgentConnected||(this.isAgentConnected=!0,console.log("🤖 VoxketClient: Agent marked as connected (first state change received)"),this.emit("agent.connected",i)),i.new_state==="speaking"?(this.setAgentState("speaking"),this.emit("agent.speaking",i)):i.new_state==="thinking"?(this.setAgentState("thinking"),this.emit("agent.thinking",i)):(i.new_state==="idle"||i.new_state==="listening")&&this.setAgentState("idle")})}catch(s){console.warn("VoxketClient: conversation_item_added handler already registered, skipping:",s)}try{this.room.registerTextStreamHandler("images",async(s,r)=>{try{const o=await s.readAll()}catch(o){console.error("VoxketClient: Error processing images stream:",o)}})}catch(s){console.warn("VoxketClient: images handler already registered, skipping:",s)}try{this.room.registerByteStreamHandler("images",async(s,r)=>{var o,i;try{const a=s.info,c={id:`img_${Date.now()}_${r.identity||"agent"}_${Math.random().toString(36).substr(2,9)}`,content:`�️ ${a.name||"Image"}`,sender:{id:r.identity||"agent",name:r.identity||"Agent",type:r.identity===((i=(o=this.room)==null?void 0:o.localParticipant)==null?void 0:i.identity)?"participant":"agent"},timestamp:new Date,metadata:{type:"attachment",fileName:a.name,fileSize:a.size,mimeType:a.mimeType,streamId:a.id,downloading:!0}};this.emit("chat.message.received",c),s.onProgress&&(s.onProgress=g=>{const x={...c,metadata:{...c.metadata,downloadProgress:g||0}};this.emit("chat.message.updated",x)});const d=[];for await(const g of s)d.push(g);const u=new Blob(d,{type:a.mimeType||"application/octet-stream"}),f=URL.createObjectURL(u),h={...c,metadata:{...c.metadata,downloading:!1,downloadProgress:1,downloadUrl:f,blob:u}};this.emit("chat.message.updated",h)}catch(a){console.error("VoxketClient: Error processing image attachment:",a)}})}catch(s){console.warn("VoxketClient: image handler already registered, skipping:",s)}["error","warning","status","system","debug","info"].forEach(s=>{try{this.room.registerTextStreamHandler(s,async(r,o)=>{try{const i=await r.readAll();if(console.log(`📝 VoxketClient: Received '${s}' stream:`,i),s==="error"){let a={};try{a=typeof i=="string"?JSON.parse(i):i}catch{a={message:i}}console.warn("� VoxketClient: Agent error:",a),this.emit("agent.error",a)}else this.emit("text.stream.received",{topic:s,data:i,participantInfo:o})}catch(i){console.error(`VoxketClient: Failed to process '${s}' stream:`,i)}})}catch(r){console.warn(`VoxketClient: Handler for '${s}' already registered, skipping:`,r)}});try{this.room.registerTextStreamHandler("*",async(s,r)=>{var o;try{const i=await s.readAll(),a=((o=s.info)==null?void 0:o.topic)||"unknown";console.log(`📝 VoxketClient: Received unhandled text stream for topic '${a}':`,i),this.emit("text.stream.unhandled",{topic:a,data:i,participantInfo:r})}catch(i){console.error("VoxketClient: Failed to process unhandled text stream:",i)}})}catch(s){console.warn("VoxketClient: Generic text stream handler already registered, skipping:",s)}this.textStreamHandlersRegistered=!0}async fetchConnectionDetails(n,s,r){const o=n||this.config.agentId||"default-agent",i=s||this.config.participantName||"User",a=r||this.config.modalities||["voice"];try{const c={agent_id:o,participant_name:i,participant_metadata:{user_id:""},modality:a[0],modalities:a};console.log("🔗 VoxketClient: Creating session with modalities:",a);const d=await fetch(`${this.config.baseUrl}/api/live/agent/session`,{method:"POST",headers:{accept:"application/json","X-APP-ID":this.config.appId,"X-APP-SECRET":this.config.appSecret,"Content-Type":"application/json"},body:JSON.stringify(c)});if(!d.ok){let h=`HTTP ${d.status}: Failed to fetch connection details`;try{const g=await d.json();g&&(g.error?h=`API Error: ${g.error}`:g.detail?h=`API Error: ${g.detail}`:g.message&&(h=`API Error: ${g.message}`))}catch{try{const x=await d.text();x&&(h=`API Error: ${x}`)}catch{}}throw new Error(h)}const u=await d.json();let f;return u.agent_info&&(f={id:u.agent_info.id||o,name:u.agent_info.name||"AI Assistant",avatar:u.agent_info.avatar,capabilities:u.agent_info.capabilities||["voice_interaction","text_chat"],metadata:u.agent_info.metadata||{}},this.currentAgentInfo=f),{serverUrl:u.wss_url,participantToken:u.token,voxketSessionId:u.session_id,agentInfo:f}}catch(c){console.error("VoxketClient: fetchConnectionDetails failed:",c);const d=new he(`Failed to fetch connection details: ${c instanceof Error?c.message:"Unknown error"}`,"CONNECTION_FAILED",c);throw this.emit("connection.error",d),d}}async connect(n,s,r){var o;try{this.emit("connection.connecting");const i=await this.fetchConnectionDetails(n,s,r);return await((o=this.room)==null?void 0:o.connect(i.serverUrl,i.participantToken)),this.isConnected=!0,i}catch(i){console.error("VoxketClient: Connection failed:",i);const a=new he(`Failed to connect to Voxket services: ${i instanceof Error?i.message:"Unknown error"}`,"CONNECTION_FAILED",i);throw this.emit("connection.error",a),a}}async disconnect(){var n;try{await((n=this.room)==null?void 0:n.disconnect()),this.isConnected=!1,this.currentSession=null,this.currentAgentInfo=null,this.textStreamHandlersRegistered=!1,this.clearChatMessages(),this.room=new Z.Room,this.setupRoomEventListeners()}catch(s){const r=new he("Failed to disconnect properly","NETWORK_ERROR",s);throw this.emit("connection.error",r),r}}async createSession(n){var s,r,o,i;try{const a=await this.connect(n.agentId,n.participantName,n.modalities),c={id:a.voxketSessionId,agentId:n.agentId,state:"connecting",startedAt:new Date,metadata:n.metadata||{},activeModalities:n.modalities||["voice"],agentInfo:a.agentInfo||this.currentAgentInfo};if(this.currentSession=c,this.emit("session.created",c),(s=n.modalities)!=null&&s.includes("voice"))try{await new Promise(d=>setTimeout(d,500)),(r=this.room)!=null&&r.localParticipant?(await this.room.localParticipant.setMicrophoneEnabled(!0,void 0,{preConnectBuffer:!0}),this.emit("track.unmuted",{source:"microphone",enabled:!0})):console.warn("VoxketClient: No local participant found, microphone not enabled")}catch(d){console.warn("VoxketClient: Failed to enable microphone, but continuing with session:",d)}if((o=n.modalities)!=null&&o.includes("video"))try{await new Promise(d=>setTimeout(d,200)),(i=this.room)!=null&&i.localParticipant&&(console.log("🎥 VoxketClient: Attempting to enable camera for video session"),await this.room.localParticipant.setCameraEnabled(!0),this.emit("track.unmuted",{source:"camera",enabled:!0}),console.log("🎥 VoxketClient: Camera enabled successfully"))}catch(d){console.warn("VoxketClient: Failed to enable camera, but continuing with session:",d)}return setTimeout(()=>{var d;this.currentSession&&(this.currentSession.state="active",this.emit("session.state.changed","active",this.currentSession.state),this.forceAgentConnected(),console.log("🤖 VoxketClient: Session marked as active:",{sessionId:this.currentSession.id,modalities:this.currentSession.activeModalities,agentConnected:this.isAgentConnected,hasRoom:!!this.room,remoteParticipants:((d=this.room)==null?void 0:d.remoteParticipants.size)||0}))},1e3),c}catch(a){throw console.error("VoxketClient: Failed to create session:",a),a instanceof he?a:a instanceof TypeError&&a.message.includes("fetch")?new he("Network connection failed","CONNECTION_FAILED",a):a instanceof Error&&a.message.includes("Failed to fetch connection details")?new he(`API connection failed: ${a.message}`,"CONNECTION_FAILED",a):new he(`Failed to create session: ${a instanceof Error?a.message:"Unknown error"}`,"SESSION_NOT_FOUND",a)}}async startSession(n,s){const r={agentId:n||this.config.agentId||"default-agent",participantName:(s==null?void 0:s.participantName)||this.config.participantName||"User",modalities:(s==null?void 0:s.modalities)||this.config.modalities||["voice","chat"],metadata:s==null?void 0:s.metadata};return this.createSession(r)}async endSession(){var n,s;if(!this.currentSession)return null;try{const r={sessionId:this.currentSession.id,duration:Date.now()-(((n=this.currentSession.startedAt)==null?void 0:n.getTime())||0),messageCount:0,participantCount:((s=this.room)==null?void 0:s.remoteParticipants.size)||0,audioQuality:{avgBitrate:64e3,avgLatency:150,packetLoss:.01,jitter:.05},videoQuality:{avgBitrate:5e5,avgLatency:150,packetLoss:.01,jitter:.05},networkStats:{totalBytesReceived:0,totalBytesSent:0,connectionType:"webrtc",avgRoundTripTime:150},events:[]};return this.currentSession.endedAt=new Date,this.currentSession.state="disconnected",this.emit("session.ended",this.currentSession,r),await this.disconnect(),r}catch(r){throw new he("Failed to end session","SESSION_NOT_FOUND",r)}}getCurrentSession(){return this.currentSession}getCurrentAgentInfo(){return this.currentAgentInfo}getIsAgentConnected(){return this.isAgentConnected}forceAgentConnected(){this.isAgentConnected||(this.isAgentConnected=!0,console.log("🤖 VoxketClient: Agent manually marked as connected"),this.emit("agent.connected",{forced:!0}))}getAgentState(){return this.agentState}setAgentState(n){this.agentState!==n&&(this.agentState=n,this.emit("agent.state.changed",{state:n}))}getAgentAudioTrack(){const n=this.getRemoteParticipants();for(const s of n){const r=s.getTrackPublication(Z.Track.Source.Microphone);if(r!=null&&r.track)return{source:Z.Track.Source.Microphone,participant:s,publication:r}}return null}getAgentVideoTrack(){const n=this.getRemoteParticipants();for(const s of n){const r=s.getTrackPublication(Z.Track.Source.Camera);if(r!=null&&r.track)return{source:Z.Track.Source.Camera,participant:s,publication:r}}return null}getVideoTrackRefs(){const n=[],s=this.getLocalParticipant();if(s){const o=s.getTrackPublication(Z.Track.Source.Camera);o!=null&&o.track&&n.push({source:Z.Track.Source.Camera,participant:s,publication:o});const i=s.getTrackPublication(Z.Track.Source.ScreenShare);i!=null&&i.track&&n.push({source:Z.Track.Source.ScreenShare,participant:s,publication:i})}const r=this.getRemoteParticipants();for(const o of r){const i=o.getTrackPublication(Z.Track.Source.Camera);i!=null&&i.track&&n.push({source:Z.Track.Source.Camera,participant:o,publication:i});const a=o.getTrackPublication(Z.Track.Source.ScreenShare);a!=null&&a.track&&n.push({source:Z.Track.Source.ScreenShare,participant:o,publication:a})}return n}getCameraTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===Z.Track.Source.Camera)}getScreenShareTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===Z.Track.Source.ScreenShare)}getChatMessages(){return[...this.chatMessages]}addChatMessage(n){this.chatMessages.some(r=>r.id===n.id)||this.chatMessages.push(n)}updateChatMessage(n){const s=this.chatMessages.findIndex(r=>r.id===n.id);s!==-1&&(this.chatMessages[s]=n)}clearChatMessages(){this.chatMessages=[],this.dismissCurrentInteraction(),this.renderedComponents.clear(),this.forceCleanupFullscreenOverlays(),this.emit("chat.history.cleared")}renderUI(n={}){var c,d,u;const s=this.resolveTarget(n.target||"body"),r=this.getTargetKey(s),o=this.renderedComponents.get(r);o&&o.target===s||this.removeUI(s);const i=(o==null?void 0:o.root)||Hd.createRoot(s),a={agentId:n.agentId||this.config.agentId||"default-agent",participantName:n.participantName||this.config.participantName||"User",baseUrl:this.config.baseUrl,appSecret:this.config.appSecret,appId:this.config.appId,className:n.className,theme:typeof n.theme=="string"?n.theme:void 0,modalities:n.modality||this.config.modalities||["voice"],suportsChatInput:((c=n.modality)==null?void 0:c.includes("chat"))!==!1,suportsVideoInput:((d=n.modality)==null?void 0:d.includes("video"))===!0,suportsScreenShare:((u=n.modality)==null?void 0:u.includes("screen_share"))===!0,autoStart:n.autoStart,displayType:n.displayType||"widget",popupPosition:n.popupPosition||"bottom-right",popupTriggerText:n.popupTriggerText||"Open Chat",width:n.width,height:n.height,onDisplayTypeChange:n.onDisplayTypeChange,prompts:n.prompts,statusMessage:n.statusMessage,welcomeTitle:n.welcomeTitle,welcomeSubTitle:n.welcomeSubTitle,loadingText:n.loadingText,voxketClient:this};if(!i||typeof i.render!="function")throw new Error("Invalid React root. Make sure React 18+ is properly installed and configured.");try{i.render(C.createElement(gd,{config:this.config,autoConnect:n.autoStart||!1,children:C.createElement(xd,a)}))}catch(f){throw console.error("Error rendering Voxket widget:",f),new Error(`Failed to render Voxket widget: ${f instanceof Error?f.message:"Unknown error"}`)}this.renderedComponents.set(r,{root:i,target:s})}removeUI(n){const s=n?this.resolveTarget(n):null;if(s){const r=this.getTargetKey(s),o=this.renderedComponents.get(r);o&&(o.root.unmount(),this.renderedComponents.delete(r),s.querySelectorAll('[id*="voxket"], [class*="voxket"], .fixed.inset-0.z-50').forEach(a=>{try{a.remove()}catch(c){console.warn("Failed to remove element:",c)}}),s===document.body&&s.querySelectorAll(".fixed.z-50, .fixed.inset-0").forEach(c=>{if(c.classList.contains("bg-black")&&c.classList.contains("backdrop-blur-sm"))try{c.remove()}catch(d){console.warn("Failed to remove fixed element:",d)}}))}}removeAllUI(){for(const[n,s]of this.renderedComponents)s.root.unmount();this.renderedComponents.clear(),this.forceCleanupFullscreenOverlays()}forceCleanupFullscreenOverlays(){document.body.querySelectorAll(".fixed.inset-0.z-50").forEach(s=>{if(s.classList.contains("bg-black")&&(s.classList.contains("backdrop-blur-sm")||s.classList.contains("bg-opacity-30")))try{s.remove()}catch(r){console.warn("Failed to remove overlay:",r)}})}resolveTarget(n){if(typeof n=="string"){const s=document.querySelector(n);if(!s)throw new Error(`Target element not found: ${n}`);return s}return n}getTargetKey(n){return n.id?n.id:n.className?n.tagName+"_"+n.className.replace(/\s+/g,"_"):n.tagName+"_"+n.outerHTML.length%1e3}async sendMessage(n,s){var r;if(!this.currentSession)throw console.error("VoxketClient: No active session found"),new he("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new he("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new he("No local participant","CONNECTION_FAILED");this.dismissCurrentInteraction();try{const o={id:`msg_${Date.now()}`,content:n,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:s||{}},i=await((r=this.room)==null?void 0:r.localParticipant.sendText(n,{topic:"lk.chat",destinationIdentities:[]}));this.emit("chat.message.sent",o)}catch(o){throw console.error("VoxketClient: Failed to send chat message:",o),new he("Failed to send message","NETWORK_ERROR",o)}}async sendChatMessage(n,s){return this.sendMessage(n,s)}async sendAttachments(n,s){if(!this.currentSession)throw console.error("VoxketClient: No active session found"),new he("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new he("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new he("No local participant","CONNECTION_FAILED");if(!n||n.length===0)throw new he("No files provided","INVALID_PARAMETER");this.dismissCurrentInteraction();const r=n.filter(o=>o.type.startsWith("image/"));if(r.length===0)throw new he("Only image files are allowed","INVALID_PARAMETER");r.length!==n.length&&console.warn("VoxketClient: Some non-image files were filtered out");try{const o=r.map(async(i,a)=>{const d={id:`att_${Date.now()}_${a}`,content:`📎 ${i.name}`,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:{...s,type:"attachment",fileName:i.name,fileSize:i.size,mimeType:i.type,uploading:!0}};this.emit("chat.message.sent",d);const u=await this.room.localParticipant.sendFile(i,{mimeType:i.type,topic:"images",onProgress:h=>{const g={...d,metadata:{...d.metadata,uploadProgress:h}};this.emit("chat.message.updated",g)}});try{const h=new FileReader,g=new Promise((b,k)=>{h.onload=()=>{typeof h.result=="string"?b(h.result):k(new Error("Failed to convert to base64"))},h.onerror=k});h.readAsDataURL(i);const m={type:"image",data:await g,filename:i.name,mimeType:i.type,size:i.size};await this.room.localParticipant.sendText(JSON.stringify(m),{topic:"images",destinationIdentities:[]})}catch(h){console.warn("VoxketClient: Failed to send image data to agent:",h);try{const g=`I've shared an image: ${i.name}`;await this.room.localParticipant.sendText(g,{topic:"lk.chat",destinationIdentities:[]})}catch(g){console.warn("VoxketClient: Failed to send image notification to agent:",g)}}const f={...d,metadata:{...d.metadata,uploading:!1,uploadProgress:1,streamId:u.id}};return this.emit("chat.message.updated",f),u});await Promise.all(o)}catch(o){throw console.error("VoxketClient: Failed to send attachments:",o),new he("Failed to send attachments","NETWORK_ERROR",o)}}async sendAttachment(n,s){return this.sendAttachments([n],s)}toggleMicrophone(n){return this.setMicrophoneEnabled(n!==!1)}async setMicrophoneEnabled(n){var s,r;try{const o=(s=this.room)==null?void 0:s.localParticipant.isMicrophoneEnabled,i=n??!o;await((r=this.room)==null?void 0:r.localParticipant.setMicrophoneEnabled(i)),i?this.emit("track.unmuted",{source:"microphone",enabled:!0}):this.emit("track.muted",{source:"microphone",enabled:!1})}catch(o){throw console.error("VoxketClient: Failed to toggle microphone:",o),new he("Failed to toggle microphone","PERMISSION_DENIED",o)}}toggleCamera(n){return this.setCameraEnabled(n!==!1)}async setCameraEnabled(n){var s,r;try{const o=(s=this.room)==null?void 0:s.localParticipant.isCameraEnabled,i=n??!o;await((r=this.room)==null?void 0:r.localParticipant.setCameraEnabled(i)),i?this.emit("track.unmuted",{source:"camera",enabled:!0}):this.emit("track.muted",{source:"camera",enabled:!1})}catch(o){throw console.error("VoxketClient: Failed to toggle camera:",o),new he("Failed to toggle camera","PERMISSION_DENIED",o)}}async enableCamera(){return this.setCameraEnabled(!0)}async disableCamera(){return this.setCameraEnabled(!1)}async startScreenShare(){var n;try{await((n=this.room)==null?void 0:n.localParticipant.setScreenShareEnabled(!0))}catch(s){throw new he("Failed to start screen share","PERMISSION_DENIED",s)}}async stopScreenShare(){var n;try{await((n=this.room)==null?void 0:n.localParticipant.setScreenShareEnabled(!1))}catch(s){throw new he("Failed to stop screen share","PERMISSION_DENIED",s)}}async getAudioInputDevices(){try{return(await navigator.mediaDevices.enumerateDevices()).filter(s=>s.kind==="audioinput")}catch(n){throw new he("Failed to get audio input devices","DEVICE_ERROR",n)}}async getVideoInputDevices(){try{return(await navigator.mediaDevices.enumerateDevices()).filter(s=>s.kind==="videoinput")}catch(n){throw new he("Failed to get video input devices","DEVICE_ERROR",n)}}async setAudioInputDevice(n){var s;try{if(!((s=this.room)!=null&&s.localParticipant))throw new Error("Not connected to room")}catch(r){throw new he("Failed to set audio input device","DEVICE_ERROR",r)}}async setVideoInputDevice(n){var s;try{if(!((s=this.room)!=null&&s.localParticipant))throw new Error("Not connected to room")}catch(r){throw new he("Failed to set video input device","DEVICE_ERROR",r)}}getLocalParticipant(){var n;return((n=this.room)==null?void 0:n.localParticipant)??null}getRemoteParticipants(){var n;return Array.from(((n=this.room)==null?void 0:n.remoteParticipants.values())??[])}getPublishPermissions(){const n=this.getLocalParticipant();if(!n)return{camera:!1,microphone:!1,screenShare:!1,data:!1};const s=n.permissions;if(!s)return{camera:!0,microphone:!0,screenShare:!0,data:!0};const r=o=>!!s.canPublish&&(s.canPublishSources.length===0||s.canPublishSources.includes(o));return{camera:r(1),microphone:r(2),screenShare:r(3),data:s.canPublishData??!1}}canPublishSource(n){return this.getPublishPermissions()[n]}getRoom(){return this.room}getConnectionState(){return this.connectionState}get connected(){return this.isConnected&&this.connectionState===Z.ConnectionState.Connected}getMicrophoneTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,s]of n.trackPublications)if(s.source===Z.Track.Source.Microphone)return s.track;return null}getCameraTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,s]of n.trackPublications)if(s.source===Z.Track.Source.Camera)return s.track;return null}getScreenShareTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,s]of n.trackPublications)if(s.source===Z.Track.Source.ScreenShare)return s.track;return null}get isMicrophoneEnabled(){const n=this.getMicrophoneTrack();return n?!n.isMuted:!1}get isCameraEnabled(){const n=this.getCameraTrack();return n?!n.isMuted:!1}get isScreenShareEnabled(){const n=this.getScreenShareTrack();return n?!n.isMuted:!1}registerPlugin(n){this.pluginManager.register(n)}getPluginManager(){return this.pluginManager}getParticipants(){if(!this.room)return[];const n=[];return this.room.localParticipant&&n.push({id:this.room.localParticipant.identity,name:this.room.localParticipant.name||this.room.localParticipant.identity,isLocal:!0}),this.room.remoteParticipants.forEach(s=>{n.push({id:s.identity,name:s.name||s.identity,isLocal:!1})}),n}getSessionMetrics(){var n,s;return this.currentSession?{sessionId:this.currentSession.id,duration:Date.now()-(((n=this.currentSession.startedAt)==null?void 0:n.getTime())||0),messageCount:0,participantCount:((s=this.room)==null?void 0:s.remoteParticipants.size)||0,audioQuality:{avgBitrate:64e3,avgLatency:150,packetLoss:.01,jitter:.05},videoQuality:{avgBitrate:5e5,avgLatency:150,packetLoss:.01,jitter:.05},networkStats:{totalBytesReceived:0,totalBytesSent:0,connectionType:"webrtc",avgRoundTripTime:150},events:[]}:null}updateConfig(n){this.config={...this.config,...n}}async startRecording(){var n;try{this.emit("recording.started",{sessionId:(n=this.currentSession)==null?void 0:n.id,timestamp:new Date})}catch(s){throw new he("Failed to start recording","RECORDING_ERROR",s)}}async stopRecording(){var n;try{this.emit("recording.stopped",{sessionId:(n=this.currentSession)==null?void 0:n.id,timestamp:new Date})}catch(s){throw new he("Failed to stop recording","RECORDING_ERROR",s)}}async registerFrontendRPC(n,s,r="embedded"){return this.rpcManager.registerFrontendRPC(n,s,r)}getCurrentInteraction(){return this.rpcManager.getCurrentInteraction()}dismissCurrentInteraction(){this.rpcManager.dismissCurrentInteraction()}getRegisteredRpcMethods(){return this.rpcManager.getRegisteredMethods()}unregisterRpcMethod(n){this.rpcManager.unregisterMethod(n)}registerEventListener(n,s){return this.on(n,s)}registerEventEmitter(n,s){if(!this.room)throw new Error("Room not available");try{this.room.registerTextStreamHandler(n,async r=>{try{const o=await r.readAll();s(o)}catch(o){console.error(`Error processing event for topic '${n}':`,o)}})}catch(r){console.warn(`VoxketClient: Handler for topic '${n}' may already be registered:`,r)}}convertMarkdownToText(n){if(!n)return"";let s=n;return s=s.replace(/\*\*(.*?)\*\*/g,"$1"),s=s.replace(/__(.*?)__/g,"$1"),s=s.replace(/\*(.*?)\*/g,"$1"),s=s.replace(/_(.*?)_/g,"$1"),s=s.replace(/~~(.*?)~~/g,"$1"),s=s.replace(/`([^`]+)`/g,"$1"),s=s.replace(/```[\s\S]*?```/g,""),s=s.replace(/^#{1,6}\s+/gm,""),s=s.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1"),s.trim()}}function $t({title:e,description:t}){console.error(`${e}: ${t}`)}const rx=ie.create($1),ox=ie.create(W1),ix=ie.create(Y1),ax=ie.create(J1);function cx({onClick:e,text:t="Open Chat",position:n="bottom-right",theme:s}){const r={"top-left":"top-4 left-4","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4"},o=Ve(s);return l.jsx(ie.button,{onClick:e,className:`fixed ${r[n]} z-50 px-4 py-2 rounded-full shadow-lg ${o.popupTrigger} transition-all duration-200 hover:scale-105`,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},whileHover:{scale:1.05},whileTap:{scale:.95},children:t})}function Wa({children:e,theme:t,displayType:n="widget",onClose:s,popupPosition:r="bottom-right",onExpand:o}){const i=Ve(t);if(n==="fullscreen")return l.jsx("div",{className:"fixed inset-0 z-[9999] bg-black/40 bg-opacity-30 backdrop-blur-sm flex items-center justify-center p-8",onClick:a=>{a.target===a.currentTarget&&s&&s()},children:l.jsxs("div",{className:"w-full h-full max-w-6xl max-h-[90vh] rounded-2xl relative bg-transparent",onClick:a=>{a.stopPropagation()},children:[s&&l.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),s()},className:"absolute top-4 cursor-pointer right-4 z-[10000] w-12 h-12 rounded-full bg-gray-900 bg-opacity-90 text-white flex items-center justify-center hover:bg-gray-800 transition-all duration-200 shadow-lg border border-gray-700 backdrop-blur-sm",title:"Exit Fullscreen",type:"button",children:l.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})})}),l.jsxs("div",{id:"voice-card",className:`${i.card} w-full h-full flex flex-col rounded-xl shadow-2xl`,style:{minHeight:"600px"},children:[l.jsx("div",{className:i.cardTopGradient}),l.jsx("div",{className:i.cardPurpleBlur}),l.jsx("div",{className:i.cardPinkBlur}),l.jsx("div",{className:" flex flex-col h-full",children:e}),l.jsx("div",{className:i.cardPulse1}),l.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})]})});if(n==="popup"){const a={"top-left":"top-4 left-4","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4"};return l.jsx("div",{className:"fixed rounded-2xl inset-0 z-[9999] pointer-events-none",children:l.jsxs("div",{className:`fixed rounded-2xl ${a[r]} pointer-events-auto`,children:[s&&l.jsx("button",{onClick:s,className:"absolute -top-2 -right-2 z-10 w-8 h-8 rounded-full bg-gray-900 bg-opacity-90 text-white flex items-center justify-center hover:bg-gray-800 transition-all duration-200 text-sm shadow-lg border border-gray-700",children:"×"}),l.jsxs("div",{id:"voice-card",className:`${i.card} rounded-2xl flex flex-col`,style:{width:"300px",height:"450px"},children:[l.jsx("div",{className:i.cardPurpleBlur}),l.jsx("div",{className:i.cardPinkBlur}),l.jsx("div",{className:" flex flex-col h-full",children:e}),l.jsx("div",{className:i.cardPulse1}),l.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})]})})}return l.jsxs("div",{id:"voice-card",className:`${i.card}`,style:{height:"100%",maxHeight:"100%"},children:[o&&l.jsx("button",{onClick:o,className:"absolute top-4 right-4 z-20 w-10 h-10 rounded-full bg-gray-900 bg-opacity-90 text-white flex items-center justify-center hover:bg-gray-800 transition-all duration-200 shadow-lg border border-gray-700 backdrop-blur-sm",title:"Enter Fullscreen",children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("path",{d:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"})})}),l.jsx("div",{className:i.cardTopGradient}),l.jsx("div",{className:i.cardPurpleBlur}),l.jsx("div",{className:i.cardPinkBlur}),e,l.jsx("div",{className:i.cardPulse1}),l.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})}function xd(e){if(typeof window>"u")return null;console.log("🎯 Widget component rendering with props:",{displayType:e.displayType,popupPosition:e.popupPosition,theme:e.theme});const{agentId:t,participantName:n,baseUrl:s,appSecret:r,appId:o,prompts:i,statusMessage:a,welcomeTitle:c,welcomeSubTitle:d,className:u,width:f,height:h,loadingText:g,suportsChatInput:x=!0,suportsVideoInput:m=!0,suportsScreenShare:b=!0,theme:k="vox",onSessionStart:v,onSessionEnd:T,enableSessionLogging:w=!0,onSessionLogsUpdate:S,onSessionMetricsUpdate:A,modalities:M=["voice"],displayType:j="widget",popupPosition:z="bottom-right",popupTriggerText:y="Open Chat",onPopupToggle:D,voxketClient:_,onDisplayTypeChange:J}=e,[te,ee]=p.useState(()=>_?!!_.getCurrentSession():!1),[se,K]=p.useState(!1),[R,X]=p.useState(t||""),[V,U]=p.useState(n||"User"),[q,P]=p.useState(()=>_?_.getCurrentSession():null),[E,O]=p.useState(()=>{var ne,Ye,Ze;if(_){const we=_.getCurrentSession();if((ne=we==null?void 0:we.activeModalities)!=null&&ne.includes("chat"))return"chat";if((Ye=we==null?void 0:we.activeModalities)!=null&&Ye.includes("voice"))return"voice";if((Ze=we==null?void 0:we.activeModalities)!=null&&Ze.includes("video"))return"video"}return"welcome"}),[F,$]=p.useState(!1);p.useEffect(()=>{console.log("🎯 Widget displayType prop changed to:",j)},[j]),p.useEffect(()=>{console.log("📊 Session state changed:",{currentMode:E,sessionStarted:te,loading:se,currentSession:q==null?void 0:q.id,isPopupOpen:F})},[E,te,se,q,F]);const I=p.useMemo(()=>{if(_)return console.log("🔄 Using passed VoxketClient to preserve session state"),_;console.log("🆕 Creating new VoxketClient instance");const ne={appId:o,appSecret:r,baseUrl:s,agentId:R,participantName:V||"User",modalities:M};return new Vn(ne)},[_,o,r,s,R,V,M]),H=M,B=p.useMemo(()=>I.getRoom()||new Z.Room,[I]),oe={suportsChatInput:x,suportsVideoInput:m,suportsScreenShare:b},{sessionMetrics:L,sessionLogs:ae,logEvent:xe}=hd({room:B,onSessionStart:v,onSessionEnd:T,enableConsoleLogging:w,enableLocalStorage:w,voxketSessionId:q==null?void 0:q.id});p.useEffect(()=>{S&&S(ae)},[ae,S]),p.useEffect(()=>{A&&L&&A(L)},[L,A]),p.useEffect(()=>{const ne=Ze=>{console.log("🔴 Room disconnected:",Ze),K(!1),ee(!1),P(null),O("welcome")},Ye=Ze=>{console.log("📹 Media devices error:",Ze),$t({title:"Allow access to your microphone/camera",description:`${Ze.name}: ${Ze.message}`})};return B.on(Z.RoomEvent.MediaDevicesError,Ye),B.on(Z.RoomEvent.Disconnected,ne),()=>{B.off(Z.RoomEvent.Disconnected,ne),B.off(Z.RoomEvent.MediaDevicesError,Ye)}},[B]);const Ie=async()=>{try{console.log("🎤 Starting voice session...",{agentId:R,participantName:V}),console.log("🎤 Pre-start state:",{currentMode:E,sessionStarted:te,loading:se}),K(!0),ee(!0),O("voice"),console.log("🎤 State after mode change:",{currentMode:"voice",sessionStarted:!0,loading:!0}),xe("USER_STARTED_VOICE_SESSION",{agentId:R,participantName:V});const ne=await I.startSession(R,{participantName:V||"User",modalities:["voice",...m?["video"]:[]]});console.log("✅ Voice session started successfully:",ne.id),P(ne),K(!1),v&&v(ne.id)}catch(ne){console.error("❌ Failed to start voice session:",ne),$t({title:"Failed to start voice session",description:ne instanceof Error?ne.message:"Unknown error occurred"}),K(!1),ee(!1),O("welcome")}},Rn=async()=>{try{K(!0),ee(!0),O("chat"),xe("USER_STARTED_CHAT_SESSION",{agentId:R,participantName:V});const ne=await I.startSession(R,{participantName:V||"User",modalities:["chat"]});P(ne),K(!1),v&&v(ne.id)}catch(ne){console.error("Failed to start chat session:",ne),$t({title:"Failed to start chat session",description:ne instanceof Error?ne.message:"Unknown error occurred"}),K(!1),ee(!1),O("welcome")}},Id=async()=>{try{console.log("📺 Starting video session...",{agentId:R,participantName:V}),console.log("📺 Pre-start state:",{currentMode:E,sessionStarted:te,loading:se}),K(!0),ee(!0),O("video"),console.log("📺 State after mode change:",{currentMode:"video",sessionStarted:!0,loading:!0}),xe("USER_STARTED_VIDEO_SESSION",{agentId:R,participantName:V});const ne=await I.startSession(R,{participantName:V||"User",modalities:["video","voice"]});console.log("✅ Video session started successfully:",ne.id),P(ne),K(!1),v&&v(ne.id)}catch(ne){console.error("❌ Failed to start video session:",ne),$t({title:"Failed to start video session",description:ne instanceof Error?ne.message:"Unknown error occurred"}),K(!1),ee(!1),O("welcome")}},sn=()=>{O("welcome"),J&&J(e.displayType||"widget"),q&&te&&(ee(!1),P(null),I.disconnect()),j==="popup"&&!F&&$(!0)},rn=()=>{const ne=!F;$(ne),D&&D(ne),!ne&&!(q&&te)&&(O("welcome"),ee(!1),P(null))},Dd=()=>{console.log("🔄 Closing fullscreen, switching to widget display type"),e.onDisplayTypeChange?e.onDisplayTypeChange("widget"):console.warn("⚠️ No onDisplayTypeChange callback provided")},$d=()=>{if(console.log("🔄 Expand to fullscreen requested"),e.onDisplayTypeChange)e.onDisplayTypeChange("fullscreen");else{console.warn("⚠️ No onDisplayTypeChange callback provided for expand functionality");const ne=document.getElementById("voice-card")||document.querySelector(".voxket-widget-container");ne&&ne.requestFullscreen?ne.requestFullscreen().catch(Ye=>{console.warn("⚠️ Fullscreen API not supported or failed:",Ye),$t({title:"Expand functionality unavailable",description:"Please implement onDisplayTypeChange callback for expand functionality"})}):$t({title:"Expand functionality unavailable",description:"Please implement onDisplayTypeChange callback for expand functionality"})}};p.useEffect(()=>{var ne,Ye,Ze;if(_&&I){console.log("🔄 Syncing widget state with existing client session state");const we=I.getCurrentSession(),Fd=I.connected;console.log("🔍 Existing session state:",{hasSession:!!we,sessionId:we==null?void 0:we.id,isConnected:Fd,activeModalities:we==null?void 0:we.activeModalities}),we&&(console.log("✅ Restoring session state from existing client"),P(we),ee(!0),K(!1),(ne=we.activeModalities)!=null&&ne.includes("chat")?O("chat"):(Ye=we.activeModalities)!=null&&Ye.includes("voice")?O("voice"):(Ze=we.activeModalities)!=null&&Ze.includes("video")&&O("video"))}},[_,I]),p.useEffect(()=>()=>{console.log("🧹 Cleaning up widget component"),_?console.log("🔄 Widget cleanup: preserving passed client instance"):(console.log("🧹 Widget cleanup: disconnecting self-created client"),I.disconnect())},[I,_]);let Ts="w-96",Es="h-[25rem]",As={};if(f&&(f.startsWith("w-")?Ts=f:(As.width=f,Ts="")),h&&(h.startsWith("h-")?Es=h:(As.height=h,Es="")),j==="popup"&&!F)return console.log("🟡 Showing popup trigger button"),l.jsx(cx,{onClick:rn,text:y,position:z,theme:k});console.log("🟢 Rendering widget content, displayType:",j,"isPopupOpen:",F,"currentMode:",E,"sessionStarted:",te,"loading:",se);let js=`voxket-widget-root theme-${k}`,In={scrollMargin:0,scrollPadding:0,contain:"layout style paint"};j==="widget"?(js+=` flex items-center justify-center min-h-fit ${Ts} ${Es} ${u}`,In={...In,...As}):(js=`${u||""}`,In={});const $o=l.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:l.jsxs(Ht,{mode:"wait",children:[E==="welcome"&&!se&&l.jsx(ax,{agentId:R,participantName:V||"",onAgentIdChange:X,onParticipantNameChange:U,onStartCall:Ie,onStartChat:Rn,onStartVideo:Id,disabled:te||se,prompts:i,statusMessage:a,title:c,subTitle:d,theme:k,modalities:H,initial:{opacity:0,y:0},animate:{opacity:1,y:0},exit:{opacity:0,y:40},transition:{duration:.3,ease:"easeInOut"}},"welcome"),E==="voice"&&l.jsxs(Ne.RoomContext.Provider,{value:B,children:[l.jsx(Ne.RoomAudioRenderer,{}),l.jsx(Ne.StartAudio,{label:"Start Audio"}),l.jsx(rx,{loadingText:g,participantName:V||"User",capabilities:oe,sessionStarted:te,disabled:!te,theme:k,client:I,displayType:j,onBack:j==="popup"?rn:sn,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"session-view")]}),E==="chat"&&l.jsx(ox,{client:I,theme:k,displayType:j,onBack:j==="popup"?rn:sn,onEndChat:sn,disabled:!te,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"chat-view"),E==="video"&&l.jsxs(Ne.RoomContext.Provider,{value:B,children:[l.jsx(Ne.RoomAudioRenderer,{}),l.jsx(Ne.StartAudio,{label:"Start Audio"}),l.jsx(ix,{client:I,theme:k,displayType:j,onBack:j==="popup"?rn:sn,onEndCall:sn,disabled:!te,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"video-view")]})]})});return j==="fullscreen"||j==="popup"?(console.log("📱 Rendering fullscreen/popup mode, displayType:",j),l.jsx(Wa,{theme:k,displayType:j,popupPosition:z,onClose:j==="fullscreen"?Dd:rn,children:$o})):(console.log("📦 Rendering widget mode"),l.jsx("div",{className:js,style:In,children:l.jsx(Wa,{theme:k,displayType:j,popupPosition:z,onExpand:$d,children:$o})}))}class bd extends p.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("VoxketWidget Error:",t,n)}render(){if(this.state.hasError){if(this.props.fallback){const t=this.props.fallback;return p.createElement(t,{error:this.state.error})}return p.createElement("div",{style:{padding:"20px",border:"1px solid #ff4444",borderRadius:"8px",background:"#fff5f5",color:"#cc0000"}},"VoxketWidget encountered an error. Please check the console for details.")}return this.props.children}}function lx({logs:e,onClear:t,onExport:n}){const[s,r]=C.useState(!1),[o,i]=C.useState(""),a=e.filter(c=>!o||c.event.toLowerCase().includes(o.toLowerCase()));return s?l.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:l.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-4xl w-full max-h-[80vh] flex flex-col m-4",children:[l.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[l.jsxs("h2",{className:"text-lg font-semibold",children:["Session Logs (",e.length,")"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",placeholder:"Filter events...",value:o,onChange:c=>i(c.target.value),className:"px-3 py-1 border rounded text-sm"}),l.jsx("button",{onClick:t,className:"px-3 py-1 bg-red-600 text-white rounded text-sm hover:bg-red-700",children:"Clear"}),l.jsx("button",{onClick:n,className:"px-3 py-1 bg-green-600 text-white rounded text-sm hover:bg-green-700",children:"Export"}),l.jsx("button",{onClick:()=>r(!1),className:"px-3 py-1 bg-gray-600 text-white rounded text-sm hover:bg-gray-700",children:"Close"})]})]}),l.jsx("div",{className:"flex-1 overflow-auto p-4",children:a.length===0?l.jsx("p",{className:"text-gray-500 text-center py-8",children:"No logs found"}):l.jsx("div",{className:"space-y-2",children:a.map((c,d)=>l.jsxs("div",{className:"border rounded p-3 text-sm",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx("span",{className:"font-semibold text-blue-600",children:c.event}),l.jsx("span",{className:"text-gray-500 text-xs",children:new Date(c.timestamp).toLocaleTimeString()})]}),c.sessionId&&l.jsxs("div",{className:"text-xs text-gray-600 mb-1",children:["Session: ",c.sessionId]}),c.data&&l.jsx("div",{className:"bg-gray-50 p-2 rounded text-xs",children:l.jsx("pre",{className:"whitespace-pre-wrap overflow-auto",children:JSON.stringify(c.data,null,2)})})]},d))})})]})}):l.jsxs("button",{onClick:()=>r(!0),className:"fixed bottom-4 right-4 bg-blue-600 text-white px-4 py-2 rounded-lg shadow-lg hover:bg-blue-700 transition-colors text-sm z-50",children:["Session Logs (",e.length,")"]})}function dx({metrics:e}){return e?l.jsxs("div",{className:"bg-gray-100 p-4 rounded-lg",children:[l.jsx("h3",{className:"font-semibold mb-2",children:"Current Session"}),l.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Session ID:"}),l.jsx("div",{className:"font-mono text-xs",children:e.sessionId})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Start Time:"}),l.jsx("div",{children:new Date(e.startTime).toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Messages:"}),l.jsx("div",{children:e.totalMessages})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Participants:"}),l.jsx("div",{children:e.participantCount})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Connection Issues:"}),l.jsx("div",{children:e.connectionIssues})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Duration:"}),l.jsxs("div",{children:[Math.round((Date.now()-new Date(e.startTime).getTime())/1e3),"s"]})]})]})]}):null}function jt(){const{currentSession:e,sessionState:t,sessionMetrics:n,createSession:s,endSession:r}=Qe(),o=C.useCallback(async(a,c)=>await s(a,c),[s]),i=C.useCallback(async()=>await r(),[r]);return{session:e,state:t,metrics:n,isActive:e!==null&&t!=="disconnected",isConnecting:t==="connecting",isConnected:t==="connected"||t==="active",start:o,stop:i}}function vd(){const{sessionMetrics:e,currentSession:t}=Qe();return{metrics:e,sessionId:t==null?void 0:t.id,duration:e==null?void 0:e.duration,participantCount:e==null?void 0:e.participantCount,messageCount:e==null?void 0:e.messageCount,audioQuality:e==null?void 0:e.audioQuality,networkStats:e==null?void 0:e.networkStats}}function wd(){const{setMicrophoneEnabled:e,client:t}=Qe(),[n,s]=C.useState(!1),[r,o]=C.useState(!1),i=C.useCallback(async()=>{if(!r){o(!0);try{const d=!n;await e(d),s(d)}catch(d){console.error("Failed to toggle microphone:",d)}finally{o(!1)}}},[n,r,e]),a=C.useCallback(async()=>{if(!(n||r)){o(!0);try{await e(!0),s(!0)}catch(d){console.error("Failed to enable microphone:",d)}finally{o(!1)}}},[n,r,e]),c=C.useCallback(async()=>{if(!(!n||r)){o(!0);try{await e(!1),s(!1)}catch(d){console.error("Failed to disable microphone:",d)}finally{o(!1)}}},[n,r,e]);return{isEnabled:n,isLoading:r,toggle:i,enable:a,disable:c}}function Sd(){const{setCameraEnabled:e}=Qe(),[t,n]=C.useState(!1),[s,r]=C.useState(!1),o=C.useCallback(async()=>{if(!s){r(!0);try{const c=!t;await e(c),n(c)}catch(c){console.error("Failed to toggle camera:",c)}finally{r(!1)}}},[t,s,e]),i=C.useCallback(async()=>{if(!(t||s)){r(!0);try{await e(!0),n(!0)}catch(c){console.error("Failed to enable camera:",c)}finally{r(!1)}}},[t,s,e]),a=C.useCallback(async()=>{if(!(!t||s)){r(!0);try{await e(!1),n(!1)}catch(c){console.error("Failed to disable camera:",c)}finally{r(!1)}}},[t,s,e]);return{isEnabled:t,isLoading:s,toggle:o,enable:i,disable:a}}function Cd(){const{startScreenShare:e,stopScreenShare:t}=Qe(),[n,s]=C.useState(!1),[r,o]=C.useState(!1),i=C.useCallback(async()=>{if(!(n||r)){o(!0);try{await e(),s(!0)}catch(d){console.error("Failed to start screen share:",d)}finally{o(!1)}}},[n,r,e]),a=C.useCallback(async()=>{if(!(!n||r)){o(!0);try{await t(),s(!1)}catch(d){console.error("Failed to stop screen share:",d)}finally{o(!1)}}},[n,r,t]),c=C.useCallback(async()=>{n?await a():await i()},[n,i,a]);return{isSharing:n,isLoading:r,start:i,stop:a,toggle:c}}function ux(){const{client:e}=Qe(),[t,n]=C.useState({tracks:[],layout:{type:"grid",showLocalVideo:!0,aspectRatio:"16:9"},isRecording:!1}),s=C.useMemo(()=>t.tracks.find(m=>m.isLocal),[t.tracks]),r=C.useMemo(()=>t.tracks.filter(m=>!m.isLocal),[t.tracks]),o=C.useCallback(async()=>{try{s!=null&&s.isEnabled?await(e==null?void 0:e.disableCamera()):await(e==null?void 0:e.enableCamera())}catch(m){throw console.error("Failed to toggle camera:",m),m}},[e,s]),i=C.useCallback(async()=>{try{t.tracks.find(b=>b.isScreenShare)?await(e==null?void 0:e.stopScreenShare()):await(e==null?void 0:e.startScreenShare())}catch(m){throw console.error("Failed to toggle screen share:",m),m}},[e,t.tracks]),a=C.useCallback(m=>{n(b=>({...b,layout:m}))},[]),c=C.useCallback(m=>{n(b=>({...b,pinnedTrack:m}))},[]),d=C.useCallback(()=>{n(m=>({...m,pinnedTrack:void 0}))},[]),u=C.useCallback(async()=>{try{await(e==null?void 0:e.startRecording()),n(m=>({...m,isRecording:!0}))}catch(m){throw console.error("Failed to start recording:",m),m}},[e]),f=C.useCallback(async()=>{try{await(e==null?void 0:e.stopRecording()),n(m=>({...m,isRecording:!1}))}catch(m){throw console.error("Failed to stop recording:",m),m}},[e]),h=C.useCallback(m=>t.tracks.find(b=>b.id===m),[t.tracks]),g=C.useCallback(m=>t.tracks.filter(b=>b.participantId===m),[t.tracks]),x=C.useCallback(m=>m.isEnabled&&t.tracks.includes(m),[t.tracks]);return C.useEffect(()=>{if(!e)return;const m=v=>{n(T=>({...T,tracks:[...T.tracks.filter(w=>w.id!==v.id),v]}))},b=v=>{n(T=>{var w;return{...T,tracks:T.tracks.filter(S=>S.id!==v),pinnedTrack:((w=T.pinnedTrack)==null?void 0:w.id)===v?void 0:T.pinnedTrack}})},k=v=>{n(T=>({...T,tracks:T.tracks.map(w=>w.id===v.id?v:w)}))};return e.on("videoTrackAdded",m),e.on("videoTrackRemoved",b),e.on("videoTrackUpdated",k),()=>{e.off("videoTrackAdded",m),e.off("videoTrackRemoved",b),e.off("videoTrackUpdated",k)}},[e]),{tracks:t.tracks,localTrack:s,remoteTraracks:r,pinnedTrack:t.pinnedTrack,layout:t.layout,isRecording:t.isRecording,toggleCamera:o,toggleScreenShare:i,setLayout:a,pinTrack:c,unpinTrack:d,startRecording:u,stopRecording:f,getTrackById:h,getTracksByParticipant:g,isTrackActive:x}}function ks(){const{chatMessages:e,sendChatMessage:t,currentSession:n}=Qe(),[s,r]=C.useState(!1),o=C.useCallback(async d=>{if(!(!d.trim()||s||!n)){r(!0);try{await t(d.trim())}catch(u){throw console.error("Failed to send chat message:",u),u}finally{r(!1)}}},[t,s,n]),{userMessages:i,agentMessages:a,allMessages:c}=C.useMemo(()=>{const d=e.filter(f=>f.sender.type==="participant"),u=e.filter(f=>f.sender.type==="agent");return{userMessages:d,agentMessages:u,allMessages:e}},[e]);return{messages:c,userMessages:i,agentMessages:a,messageCount:c.length,isSending:s,canSend:!!n&&!s,send:o}}function fx(){const{send:e,isSending:t,canSend:n}=ks(),[s,r]=C.useState(""),o=C.useCallback(async()=>{if(!(!s.trim()||!n))try{await e(s),r("")}catch(a){throw a}},[s,e,n]),i=C.useCallback(a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),o())},[o]);return{value:s,setValue:r,send:o,handleKeyPress:i,isSending:t,canSend:n&&s.trim().length>0}}function No(){const{isConnected:e,isConnecting:t,connectionError:n,connect:s,disconnect:r}=Qe(),o=C.useCallback(async()=>{if(!(e||t))try{await s()}catch(a){throw console.error("Failed to connect:",a),a}},[s,e,t]),i=C.useCallback(async()=>{if(e)try{await r()}catch(a){throw console.error("Failed to disconnect:",a),a}},[r,e]);return{isConnected:e,isConnecting:t,isDisconnected:!e&&!t,error:n,hasError:!!n,connect:o,disconnect:i}}function kd(){const{participants:e}=Qe();return{participants:e,count:e.length,localParticipant:e.find(t=>t.isLocal),remoteParticipants:e.filter(t=>!t.isLocal)}}const Td=C.createContext({}),Nn=()=>C.useContext(Td);function Ed({children:e,...t}){return l.jsx(Td.Provider,{value:t,children:e})}function Jn({name:e,children:t,fallback:n,className:s}){return l.jsx("div",{className:`voxket-slot voxket-slot--${e} ${s||""}`,children:t||n})}function Ad(e,t={}){return Object.assign(e,t)}function jd({showMicrophoneControl:e=!0,showCameraControl:t=!0,showScreenShareControl:n=!0,showSessionActions:s=!0,customControls:r,className:o=""}){const i=jt(),a=wd(),c=Sd(),d=Cd(),u=Nn(),f=["voxket-session-controls",`voxket-session-controls--${u.variant||"default"}`,`voxket-session-controls--${u.size||"md"}`,i.isActive?"voxket-session-controls--active":"voxket-session-controls--inactive",o].filter(Boolean).join(" ");return!i.isActive&&!s?l.jsx("div",{className:f,children:l.jsx("div",{className:"voxket-controls-inactive",children:l.jsx("p",{children:"Controls available during active session"})})}):l.jsxs("div",{className:f,children:[s&&l.jsx("div",{className:"voxket-session-actions",children:i.isActive?l.jsx("button",{onClick:i.stop,className:"voxket-button voxket-button--danger",children:"End Session"}):l.jsx(hx,{})}),i.isActive&&l.jsxs("div",{className:"voxket-media-controls",children:[e&&l.jsxs("button",{onClick:a.toggle,disabled:a.isLoading,className:`voxket-button voxket-button--media ${a.isEnabled?"voxket-button--active":""}`,title:a.isEnabled?"Mute microphone":"Unmute microphone",children:[l.jsx("span",{className:"voxket-icon",children:"🎤"}),a.isLoading?"Loading...":a.isEnabled?"Mute":"Unmute"]}),t&&l.jsxs("button",{onClick:c.toggle,disabled:c.isLoading,className:`voxket-button voxket-button--media ${c.isEnabled?"voxket-button--active":""}`,title:c.isEnabled?"Stop camera":"Start camera",children:[l.jsx("span",{className:"voxket-icon",children:"📹"}),c.isLoading?"Loading...":c.isEnabled?"Stop Video":"Start Video"]}),n&&l.jsxs("button",{onClick:d.toggle,disabled:d.isLoading,className:`voxket-button voxket-button--media ${d.isSharing?"voxket-button--active":""}`,title:d.isSharing?"Stop screen share":"Start screen share",children:[l.jsx("span",{className:"voxket-icon",children:"🖥️"}),d.isLoading?"Loading...":d.isSharing?"Stop Share":"Share Screen"]})]}),r&&l.jsx("div",{className:"voxket-custom-controls",children:r})]})}function hx(){jt();const[e,t]=C.useState(!1),n=async()=>{t(!0);try{console.log("Start session - agentId needed")}catch(s){console.error("Failed to start session:",s)}finally{t(!1)}};return l.jsx("button",{onClick:n,disabled:e,className:"voxket-button voxket-button--primary",children:e?"Starting...":"Start Session"})}function Ro({showConnectionStatus:e=!0,showSessionInfo:t=!0,showAgentInfo:n=!0,className:s=""}){const r=jt(),o=No(),i=Nn(),a=["voxket-session-header",`voxket-session-header--${i.variant||"default"}`,`voxket-session-header--${i.size||"md"}`,s].filter(Boolean).join(" ");return l.jsxs("div",{className:a,children:[e&&l.jsxs("div",{className:"voxket-connection-status",children:[l.jsx("div",{className:`voxket-status-indicator ${o.isConnected?"connected":"disconnected"}`}),l.jsx("span",{className:"voxket-status-text",children:o.isConnecting?"Connecting...":o.isConnected?"Connected":"Disconnected"})]}),t&&r.session&&l.jsxs("div",{className:"voxket-session-info",children:[l.jsxs("div",{className:"voxket-session-id",children:["Session: ",r.session.id.slice(-8)]}),l.jsxs("div",{className:"voxket-session-state",children:["State: ",r.state]})]}),n&&r.session&&l.jsxs("div",{className:"voxket-agent-info",children:[l.jsxs("div",{className:"voxket-agent-id",children:["Agent: ",r.session.agentId]}),l.jsxs("div",{className:"voxket-modalities",children:["Modalities: ",r.session.activeModalities.join(", ")]})]}),o.error&&l.jsxs("div",{className:"voxket-error-message",children:["Error: ",o.error.message]})]})}function Io({showChat:e=!0,showTranscriptions:t=!1,customContent:n,className:s=""}){const r=jt(),o=ks(),i=Nn(),a=["voxket-session-content",`voxket-session-content--${i.variant||"default"}`,`voxket-session-content--${i.size||"md"}`,s].filter(Boolean).join(" ");return r.isActive?l.jsx("div",{className:a,children:n||l.jsxs(l.Fragment,{children:[e&&l.jsxs("div",{className:"voxket-chat-container",children:[l.jsxs("div",{className:"voxket-chat-messages",children:[o.messages.map(c=>l.jsxs("div",{className:`voxket-message voxket-message--${c.sender.type}`,children:[l.jsxs("div",{className:"voxket-message-header",children:[l.jsx("span",{className:"voxket-message-sender",children:c.sender.name}),l.jsx("span",{className:"voxket-message-time",children:c.timestamp.toLocaleTimeString()})]}),l.jsx("div",{className:"voxket-message-content",children:c.content})]},c.id)),o.messages.length===0&&l.jsx("div",{className:"voxket-empty-messages",children:l.jsx("p",{children:"No messages yet. Start the conversation!"})})]}),l.jsx(mx,{})]}),t&&l.jsx("div",{className:"voxket-transcriptions",children:l.jsx("div",{className:"voxket-transcription-placeholder",children:l.jsx("p",{children:"Voice transcriptions will appear here"})})})]})}):l.jsx("div",{className:a,children:l.jsx("div",{className:"voxket-inactive-state",children:l.jsxs("div",{className:"voxket-inactive-message",children:[l.jsx("h3",{children:"Start a conversation"}),l.jsx("p",{children:"Begin a session to start chatting with the AI agent"})]})})})}function mx(){const e=ks(),[t,n]=C.useState(""),s=async()=>{if(!(!t.trim()||!e.canSend))try{await e.send(t),n("")}catch(o){console.error("Failed to send message:",o)}},r=o=>{o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),s())};return l.jsxs("div",{className:"voxket-chat-input",children:[l.jsx("input",{type:"text",value:t,onChange:o=>n(o.target.value),onKeyPress:r,placeholder:"Type your message...",disabled:!e.canSend,className:"voxket-input"}),l.jsx("button",{onClick:s,disabled:!e.canSend||!t.trim(),className:"voxket-send-button",children:e.isSending?"Sending...":"Send"})]})}function Do({showMetrics:e=!0,showParticipants:t=!0,showStatus:n=!0,customFooter:s,className:r=""}){const o=jt(),i=vd(),a=kd(),c=Nn(),d=["voxket-session-footer",`voxket-session-footer--${c.variant||"default"}`,`voxket-session-footer--${c.size||"md"}`,r].filter(Boolean).join(" ");return o.isActive?l.jsx("div",{className:d,children:s||l.jsxs(l.Fragment,{children:[n&&l.jsxs("div",{className:"voxket-session-status",children:[l.jsx("div",{className:"voxket-status-indicator voxket-status-indicator--active"}),l.jsx("span",{className:"voxket-status-text",children:"Session Active"})]}),e&&i.metrics&&l.jsxs("div",{className:"voxket-session-metrics",children:[l.jsxs("div",{className:"voxket-metric",children:[l.jsx("span",{className:"voxket-metric-label",children:"Duration:"}),l.jsx("span",{className:"voxket-metric-value",children:px(i.duration||0)})]}),l.jsxs("div",{className:"voxket-metric",children:[l.jsx("span",{className:"voxket-metric-label",children:"Messages:"}),l.jsx("span",{className:"voxket-metric-value",children:i.metrics.messageCount})]})]}),t&&l.jsxs("div",{className:"voxket-participants-info",children:[l.jsxs("span",{className:"voxket-participants-count",children:[a.count," participant",a.count!==1?"s":""]}),a.remoteParticipants.length>0&&l.jsx("div",{className:"voxket-participant-list",children:a.remoteParticipants.map(u=>l.jsx("span",{className:"voxket-participant-name",children:u.name},u.id))})]})]})}):l.jsx("div",{className:d,children:l.jsx("div",{className:"voxket-footer-inactive",children:l.jsx("span",{className:"voxket-status-text",children:"Ready to start session"})})})}function px(e){const t=Math.floor(e/1e3),n=Math.floor(t/60),s=Math.floor(n/60);return s>0?`${s}:${(n%60).toString().padStart(2,"0")}:${(t%60).toString().padStart(2,"0")}`:`${n}:${(t%60).toString().padStart(2,"0")}`}function gx({agentId:e,sessionConfig:t,autoStart:n=!1,onSessionStart:s,onSessionEnd:r,variant:o="default",size:i="md",theme:a,className:c="",children:d}){var g;const u=jt(),f=No();C.useEffect(()=>{n&&e&&f.isConnected&&!u.isActive&&u.start(e,t).catch(console.error)},[n,e,f.isConnected,u.isActive]),C.useEffect(()=>{var x;(x=u.session)!=null&&x.id&&s&&s(u.session.id)},[(g=u.session)==null?void 0:g.id,s]),C.useEffect(()=>()=>{u.isActive&&r&&u.stop().then(r).catch(console.error)},[]);const h=["voxket-session",`voxket-session--${o}`,`voxket-session--${i}`,u.isActive?"voxket-session--active":"voxket-session--inactive",c].filter(Boolean).join(" ");return l.jsx(Ed,{variant:o,size:i,theme:a,className:c,children:l.jsx("div",{className:h,children:d||l.jsxs(l.Fragment,{children:[l.jsx(Jn,{name:"header",fallback:l.jsx(Ro,{})}),l.jsx(Jn,{name:"content",fallback:l.jsx(Io,{})}),l.jsx(Jn,{name:"footer",fallback:l.jsx(Do,{})})]})})})}const Md=Ad(gx,{Header:Ro,Content:Io,Footer:Do,Controls:jd}),Et={name:"default",colors:{primary:"#3B82F6",secondary:"#6B7280",accent:"#8B5CF6",background:"#FFFFFF",surface:"#F9FAFB",text:{primary:"#111827",secondary:"#6B7280",muted:"#9CA3AF",inverse:"#FFFFFF"},status:{success:"#10B981",warning:"#F59E0B",error:"#EF4444",info:"#3B82F6"},border:"#E5E7EB",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1)"},typography:{fontFamily:"system-ui, -apple-system, sans-serif",fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},fontWeight:{normal:400,medium:500,semibold:600,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem"},borderRadius:{none:"0",sm:"0.25rem",md:"0.5rem",lg:"0.75rem",full:"9999px"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1)"}},Rr={...Et,name:"dark",colors:{primary:"#60A5FA",secondary:"#9CA3AF",accent:"#A78BFA",background:"#111827",surface:"#1F2937",text:{primary:"#F9FAFB",secondary:"#D1D5DB",muted:"#9CA3AF",inverse:"#111827"},status:{success:"#34D399",warning:"#FBBF24",error:"#F87171",info:"#60A5FA"},border:"#374151",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.3)"}},Ir={...Et,name:"enterprise",colors:{primary:"#1E40AF",secondary:"#64748B",accent:"#7C3AED",background:"#FFFFFF",surface:"#F8FAFC",text:{primary:"#0F172A",secondary:"#475569",muted:"#94A3B8",inverse:"#FFFFFF"},status:{success:"#059669",warning:"#D97706",error:"#DC2626",info:"#1E40AF"},border:"#CBD5E1",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1)"},borderRadius:{none:"0",sm:"0.125rem",md:"0.25rem",lg:"0.375rem",full:"9999px"}},Pd=C.createContext(null),Vd=()=>{const e=C.useContext(Pd);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e};function yx({theme:e="default",themes:t={},children:n,cssVariables:s=!0,className:r=""}){const[o,i]=C.useState(()=>{const h={default:Et,dark:Rr,enterprise:Ir,...t};return typeof e=="string"?h[e]||Et:e}),[a,c]=C.useState(()=>({default:Et,dark:Rr,enterprise:Ir,...t})),d=h=>{if(typeof h=="string"){const g=a[h];g&&i(g)}else i(h)},u=h=>{c(g=>({...g,[h.name]:h}))};C.useEffect(()=>{if(s&&typeof document<"u"){const h=document.documentElement;Object.entries(Nd(o)).forEach(([g,x])=>{h.style.setProperty(`--voxket-${g}`,x)})}},[o,s]);const f={theme:o,setTheme:d,themes:a,registerTheme:u};return l.jsx(Pd.Provider,{value:f,children:l.jsx("div",{className:`voxket-theme voxket-theme--${o.name} ${r}`,children:n})})}function Nd(e){const t={},n=(s,r="")=>{for(const[o,i]of Object.entries(s)){const a=r?`${r}-${o}`:o;typeof i=="object"&&i!==null&&!Array.isArray(i)?n(i,a):t[a]=String(i)}};return n(e),t}function xx(e=Et,t){return{...e,...t,colors:{...e.colors,...t.colors},typography:{...e.typography,...t.typography},spacing:{...e.spacing,...t.spacing},borderRadius:{...e.borderRadius,...t.borderRadius},shadows:{...e.shadows,...t.shadows}}}function bx(e){var n;const{theme:t}=Vd();return((n=t.components)==null?void 0:n[e])||{}}const vx=Vo("voice-modality","voice",{onActivate:async e=>{const t=e.config;t.enableTranscription&&wx(e),t.enableVoiceActivation&&Sx(e,t),console.log("Voice modality activated",t)},onDeactivate:async e=>{console.log("Voice modality deactivated")},onMessage:async(e,t)=>{t.type==="audio"&&Cx(e,t)}});function wx(e,t){e.on("participant.speaking.started",n=>{console.log("Transcription: Started for",n.name)}),e.on("participant.speaking.stopped",n=>{console.log("Transcription: Stopped for",n.name)})}function Sx(e,t){const n=t.silenceThreshold||-50;console.log("Voice activation setup with threshold:",n)}function Cx(e,t){console.log("Playing audio response:",t.content)}const kx=Vo("chat-modality","chat",{onActivate:async e=>{const t=e.config;t.enableRichText&&Tx(),t.enableFileUpload&&Ex(e),t.enableCustomComponents&&Ax(),console.log("Chat modality activated",t)},onDeactivate:async e=>{console.log("Chat modality deactivated")},onMessage:async(e,t)=>{const n=e.config;t.type==="ui_component"?jx(e,t):t.type==="text"&&n.enableRichText&&Mx(e,t)}});function Tx(e){console.log("Rich text support enabled")}function Ex(e){console.log("File upload enabled"),e.on("chat.file.uploaded",t=>{console.log("File uploaded:",t.name)})}function Ax(e){console.log("Custom components enabled");const t=new Map;t.set("quick-actions",Px),t.set("form",Vx),t.set("card",Nx),t.set("chart",Rx)}function jx(e,t){const{componentType:n,props:s}=t.metadata;console.log("Rendering custom component:",n,s),e.emit("chat.component.render",{type:n,props:s,timestamp:new Date})}function Mx(e,t){console.log("Processing rich text message:",t.content)}function Px(e){return{type:"quick-actions",actions:e.actions||[],layout:e.layout||"horizontal"}}function Vx(e){return{type:"form",fields:e.fields||[],submitAction:e.submitAction,validation:e.validation}}function Nx(e){return{type:"card",title:e.title,content:e.content,actions:e.actions,variant:e.variant||"default"}}function Rx(e){return{type:"chart",chartType:e.chartType||"line",data:e.data,options:e.options}}function Qn({track:e,participantName:t,showControls:n=!0,showName:s=!0,showMuteIndicator:r=!0,isPinned:o=!1,className:i="",onClick:a,onPin:c,onUnpin:d}){const u=C.useRef(null),[f,h]=C.useState(!1);C.useEffect(()=>{if(!u.current||!e.isEnabled)return;const b=u.current;return b.srcObject=null,()=>{b.srcObject&&(b.srcObject=null)}},[e]);const g=()=>{a==null||a(e)},x=b=>{b.stopPropagation(),o?d==null||d(e):c==null||c(e)},m=["voxket-video-tile",e.isLocal?"voxket-video-tile--local":"voxket-video-tile--remote",e.isScreenShare?"voxket-video-tile--screen-share":"voxket-video-tile--camera",o?"voxket-video-tile--pinned":"",e.isEnabled?"":"voxket-video-tile--disabled",f?"voxket-video-tile--hovered":"",i].filter(Boolean).join(" ");return l.jsxs("div",{className:m,onClick:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{aspectRatio:e.dimensions?`${e.dimensions.width} / ${e.dimensions.height}`:"16 / 9"},children:[l.jsx("video",{ref:u,className:"voxket-video-element",autoPlay:!0,playsInline:!0,muted:e.isLocal}),!e.isEnabled&&l.jsxs("div",{className:"voxket-video-placeholder",children:[l.jsx("div",{className:"voxket-video-placeholder-icon",children:e.isScreenShare?"🖥️":"📹"}),l.jsx("p",{className:"voxket-video-placeholder-text",children:e.isScreenShare?"Screen sharing paused":"Camera off"})]}),l.jsxs("div",{className:"voxket-video-overlay",children:[s&&t&&l.jsxs("div",{className:"voxket-video-name",children:[t,e.isLocal&&" (You)"]}),r&&!e.isEnabled&&l.jsx("div",{className:"voxket-video-mute-indicator",children:"🔇"}),n&&(f||o)&&l.jsxs("div",{className:"voxket-video-controls",children:[l.jsx("button",{className:`voxket-video-control-btn ${o?"voxket-video-control-btn--active":""}`,onClick:x,title:o?"Unpin video":"Pin video",children:"📌"}),e.isScreenShare&&l.jsx("div",{className:"voxket-video-indicator",children:"🖥️"}),e.source&&l.jsx("div",{className:"voxket-video-source",children:e.source})]})]}),!e.isEnabled&&l.jsx("div",{className:"voxket-video-loading",children:l.jsx("div",{className:"voxket-spinner"})})]})}function Ix({tracks:e,layout:t,className:n="",onLayoutChange:s,onTrackClick:r,maxVisibleTracks:o=9,showPagination:i=!0}){const[a,c]=C.useState(0),[d,u]=C.useState(null),f=C.useMemo(()=>{let v=[...e];t.type==="speaker"&&d&&(v=[d,...e.filter(S=>S.id!==d.id)]);const T=a*o,w=T+o;return v.slice(T,w)},[e,t,d,a,o]),h=Math.ceil(e.length/o),g=C.useMemo(()=>{const v=f.length;switch(t.type){case"grid":const T=Math.ceil(Math.sqrt(v)),w=Math.ceil(v/T);return{display:"grid",gridTemplateColumns:`repeat(${T}, 1fr)`,gridTemplateRows:`repeat(${w}, 1fr)`,gap:"8px"};case"speaker":return{display:"flex",flexDirection:"column",gap:"8px"};case"sidebar":return{display:"flex",gap:"8px"};case"gallery":return{display:"flex",flexWrap:"wrap",gap:"8px",justifyContent:"center"};default:return{}}},[t.type,f.length]),x=v=>{u(v)},m=()=>{u(null)},b=v=>{s==null||s({...t,type:v})},k=["voxket-video-grid",`voxket-video-grid--${t.type}`,`voxket-video-grid--${f.length}-tracks`,n].filter(Boolean).join(" ");return e.length===0?l.jsx("div",{className:"voxket-video-grid-empty",children:l.jsxs("div",{className:"voxket-video-grid-empty-content",children:[l.jsx("div",{className:"voxket-video-grid-empty-icon",children:"📹"}),l.jsx("p",{children:"No video tracks available"})]})}):l.jsxs("div",{className:k,children:[l.jsxs("div",{className:"voxket-video-grid-controls",children:[l.jsx("div",{className:"voxket-video-layout-controls",children:["grid","speaker","sidebar","gallery"].map(v=>l.jsx("button",{className:`voxket-layout-btn ${t.type===v?"voxket-layout-btn--active":""}`,onClick:()=>b(v),title:`Switch to ${v} layout`,children:Dx(v)},v))}),l.jsxs("div",{className:"voxket-video-count",children:[e.length," participant",e.length!==1?"s":""]})]}),l.jsx("div",{className:"voxket-video-grid-content",style:g,children:t.type==="speaker"&&d?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"voxket-video-speaker-main",children:l.jsx(Qn,{track:d,participantName:`Participant ${d.participantId}`,isPinned:!0,onClick:r,onUnpin:m})}),l.jsx("div",{className:"voxket-video-speaker-sidebar",children:f.filter(v=>v.id!==d.id).map(v=>l.jsx(Qn,{track:v,participantName:`Participant ${v.participantId}`,showControls:!1,onClick:r,onPin:x},v.id))})]}):f.map(v=>l.jsx(Qn,{track:v,participantName:`Participant ${v.participantId}`,isPinned:(d==null?void 0:d.id)===v.id,onClick:r,onPin:x,onUnpin:m},v.id))}),i&&h>1&&l.jsxs("div",{className:"voxket-video-pagination",children:[l.jsx("button",{className:"voxket-pagination-btn",onClick:()=>c(Math.max(0,a-1)),disabled:a===0,children:"←"}),l.jsxs("span",{className:"voxket-pagination-info",children:["Page ",a+1," of ",h]}),l.jsx("button",{className:"voxket-pagination-btn",onClick:()=>c(Math.min(h-1,a+1)),disabled:a===h-1,children:"→"})]})]})}function Dx(e){switch(e){case"grid":return"⊞";case"speaker":return"🎤";case"sidebar":return"⫸";case"gallery":return"⊡";case"picture-in-picture":return"⧉";default:return"⊞"}}function $x({localTrack:e,onToggleCamera:t,onToggleScreenShare:n,onLayoutChange:s,showLayoutControls:r=!0,showCameraControls:o=!0,showScreenShareControls:i=!0,className:a=""}){const c=["voxket-video-controls",a].filter(Boolean).join(" "),d=u=>{s==null||s({type:u,showLocalVideo:!0,aspectRatio:"16:9"})};return l.jsxs("div",{className:c,children:[o&&l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Camera"}),l.jsxs("button",{className:`voxket-control-btn ${e!=null&&e.isEnabled?"voxket-control-btn--active":""}`,onClick:t,title:e!=null&&e.isEnabled?"Turn off camera":"Turn on camera",children:[l.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isEnabled?"📹":"📷"}),l.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isEnabled?"Camera On":"Camera Off"})]}),(e==null?void 0:e.dimensions)&&l.jsxs("div",{className:"voxket-video-info",children:[e.dimensions.width," × ",e.dimensions.height]})]}),i&&l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Screen Share"}),l.jsxs("button",{className:`voxket-control-btn ${e!=null&&e.isScreenShare?"voxket-control-btn--active":""}`,onClick:n,title:e!=null&&e.isScreenShare?"Stop screen sharing":"Start screen sharing",children:[l.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isScreenShare?"🛑":"🖥️"}),l.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isScreenShare?"Stop Sharing":"Share Screen"})]})]}),r&&l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Layout"}),l.jsx("div",{className:"voxket-layout-buttons",children:[{type:"grid",icon:"⊞",label:"Grid"},{type:"speaker",icon:"🎤",label:"Speaker"},{type:"sidebar",icon:"⫸",label:"Sidebar"},{type:"gallery",icon:"⊡",label:"Gallery"}].map(({type:u,icon:f,label:h})=>l.jsxs("button",{className:"voxket-layout-control-btn",onClick:()=>d(u),title:`Switch to ${h} layout`,children:[l.jsx("span",{className:"voxket-control-icon",children:f}),l.jsx("span",{className:"voxket-control-label",children:h})]},u))})]}),l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Video Settings"}),l.jsxs("div",{className:"voxket-video-settings",children:[l.jsxs("div",{className:"voxket-setting-group",children:[l.jsx("label",{className:"voxket-setting-label",children:"Quality"}),l.jsxs("select",{className:"voxket-setting-select",children:[l.jsx("option",{value:"high",children:"High (720p)"}),l.jsx("option",{value:"medium",children:"Medium (480p)"}),l.jsx("option",{value:"low",children:"Low (240p)"})]})]}),l.jsxs("div",{className:"voxket-setting-group",children:[l.jsx("label",{className:"voxket-setting-label",children:"Frame Rate"}),l.jsxs("select",{className:"voxket-setting-select",children:[l.jsx("option",{value:"30",children:"30 fps"}),l.jsx("option",{value:"15",children:"15 fps"}),l.jsx("option",{value:"10",children:"10 fps"})]})]}),l.jsxs("div",{className:"voxket-setting-group",children:[l.jsx("label",{className:"voxket-setting-label",children:"Bandwidth"}),l.jsxs("select",{className:"voxket-setting-select",children:[l.jsx("option",{value:"unlimited",children:"Unlimited"}),l.jsx("option",{value:"1000",children:"1 Mbps"}),l.jsx("option",{value:"500",children:"500 Kbps"}),l.jsx("option",{value:"250",children:"250 Kbps"})]})]})]})]}),l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Statistics"}),l.jsxs("div",{className:"voxket-video-stats",children:[l.jsxs("div",{className:"voxket-stat-item",children:[l.jsx("span",{className:"voxket-stat-label",children:"Resolution:"}),l.jsx("span",{className:"voxket-stat-value",children:e!=null&&e.dimensions?`${e.dimensions.width}×${e.dimensions.height}`:"N/A"})]}),l.jsxs("div",{className:"voxket-stat-item",children:[l.jsx("span",{className:"voxket-stat-label",children:"Source:"}),l.jsx("span",{className:"voxket-stat-value",children:(e==null?void 0:e.source)||"None"})]}),l.jsxs("div",{className:"voxket-stat-item",children:[l.jsx("span",{className:"voxket-stat-label",children:"Status:"}),l.jsx("span",{className:`voxket-stat-value ${e!=null&&e.isEnabled?"voxket-stat-value--active":"voxket-stat-value--inactive"}`,children:e!=null&&e.isEnabled?"Active":"Inactive"})]})]})]})]})}const Rd=({handler:e,loadData:t,data:n,client:s,addLocalMessage:r})=>{const[o,i]=p.useState(null),[a,c]=p.useState(!0),[d,u]=p.useState(!1),[f]=p.useState(Date.now());p.useEffect(()=>{(async()=>{try{if(c(!0),console.log("📋 AssignmentView: Loading assignment data..."),console.log("📋 AssignmentView: Received data from RPC:",n),n&&typeof n=="object"){const b={title:n.title||"Untitled Assignment",description:n.description||"No description provided",estimated_time_of_completion:n.estimated_time_of_completion||"Unknown"};i(b),console.log("📋 AssignmentView: Assignment loaded from RPC data:",b)}}catch(b){console.error("📋 AssignmentView: Error loading assignment:",b),i({title:"Assignment Loading Error",description:"There was an error loading the assignment details. Please try again.",estimated_time_of_completion:"Unknown"})}finally{c(!1)}})()},[n,t]);const h=({message:m,assignment:b})=>{const k=m.toLowerCase().includes("declined"),v=k?"bg-red-50 border-red-200":"bg-green-50 border-green-200",T=k?"text-red-700":"text-green-700",w=k?"❌":"🎉";return l.jsxs("div",{className:`max-w-sm mx-auto ${v} border rounded-lg shadow p-3 flex flex-col items-center`,children:[l.jsx("div",{className:"text-2xl mb-2",children:w}),l.jsx("div",{className:`${T} font-semibold text-sm mb-1`,children:m}),l.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:b.title}),l.jsx("div",{className:"text-xs text-gray-500",children:"Thank you for your response!"})]})},g=async()=>{if(!(!o||!e)){u(!0);try{const m={message:"accepted"};console.log("📋 AssignmentView: Assignment accepted:",m),e.didSuccess(m,l.jsx(h,{message:"Assignment accepted!",assignment:o}))}catch(m){console.error("📋 AssignmentView: Error accepting assignment:",m),e.didFail({error:"Failed to accept assignment"})}finally{u(!1)}}},x=async()=>{if(!(!o||!e)){u(!0);try{const m={message:"declined"};console.log("📋 AssignmentView: Assignment declined:",m),e.didSuccess(m,l.jsx(h,{message:"Assignment declined",assignment:o}))}catch(m){console.error("📋 AssignmentView: Error declining assignment:",m),e.didFail({error:"Failed to decline assignment"})}finally{u(!1)}}};return a?l.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:l.jsxs("div",{className:"flex items-center justify-center py-4",children:[l.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),l.jsx("span",{className:"ml-2 text-xs text-gray-600",children:"Loading assignment..."})]})}):o?l.jsxs("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg overflow-hidden",children:[l.jsx("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 text-white p-3",children:l.jsx("div",{className:"flex items-center justify-between",children:l.jsx("h3",{className:"text-xs font-semibold text-white truncate",children:o.title})})}),l.jsxs("div",{className:"p-3",children:[l.jsx("div",{className:"bg-gray-50 rounded p-2 mb-3",children:l.jsx("p",{className:"text-xs text-gray-700 leading-snug",children:o.description})}),l.jsx("div",{className:"mb-3",children:l.jsxs("div",{className:"flex items-center text-xs text-gray-600",children:[l.jsx("span",{className:"text-xs mr-1",children:"📅"}),l.jsxs("span",{children:["Est: ",o.estimated_time_of_completion]})]})}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:g,disabled:d,className:"flex-1 bg-green-600 text-white py-2 px-3 rounded text-xs font-medium hover:bg-green-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:d?l.jsxs("span",{className:"flex items-center justify-center",children:[l.jsx("div",{className:"animate-spin rounded-full h-2 w-2 border-b-2 border-white mr-1"}),l.jsx("span",{className:"text-xs",children:"Processing..."})]}):"Accept"}),l.jsx("button",{onClick:x,disabled:d,className:"flex-1 bg-red-600 text-white py-2 px-3 rounded text-xs font-medium hover:bg-red-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Decline"})]})]})]}):l.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:l.jsxs("div",{className:"text-center py-4",children:[l.jsx("div",{className:"text-red-600 text-sm font-semibold mb-2",children:"⚠️ Assignment Error"}),l.jsx("p",{className:"text-xs text-gray-600 mb-3",children:"Failed to load assignment details."})]})})};function Fx(){const[e,t]=p.useState(null),[n,s]=p.useState([]);p.useEffect(()=>{const a=new Vn({appId:"your-app-id",appSecret:"your-app-secret",baseUrl:"https://your-voxket-api.com",agentId:"your-agent-id",participantName:"User",modalities:["chat"]});return t(a),a.on("rpc.method.called",c=>{console.log("RPC Method Called:",c)}),a.on("rpc.interaction.completed",c=>{console.log("RPC Interaction Completed:",c)}),()=>{a.disconnect()}},[]);const r=async()=>{if(e)try{await e.registerFrontendRPC("give_assignment",Rd,"embedded");const a=e.getRegisteredRpcMethods();s(a),console.log("✅ Assignment RPC registered successfully")}catch(a){console.error("❌ Failed to register assignment RPC:",a)}},o=async()=>{if(!e)return;const a=({handler:c,timeout:d})=>{const[u,f]=p.useState(""),h=[{id:"pro",name:"Pro Plan",price:"$29/month"},{id:"enterprise",name:"Enterprise Plan",price:"$99/month"},{id:"basic",name:"Basic Plan",price:"$9/month"}],g=m=>{f(m)},x=()=>{const m=h.find(b=>b.id===u);c==null||c.didSuccess({selectedProduct:u,productName:m==null?void 0:m.name,price:m==null?void 0:m.price,timestamp:new Date().toISOString()})};return l.jsxs("div",{className:"p-6 bg-white rounded-lg",children:[l.jsx("h3",{className:"text-xl font-bold mb-4",children:"Choose Your Plan"}),l.jsx("p",{className:"text-gray-600 mb-4",children:"Select the plan that best fits your needs:"}),l.jsx("div",{className:"space-y-3 mb-6",children:h.map(m=>l.jsx("div",{onClick:()=>g(m.id),className:`p-4 border rounded-lg cursor-pointer transition-all ${u===m.id?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-gray-300"}`,children:l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"font-medium",children:m.name}),l.jsx("p",{className:"text-gray-600 text-sm",children:m.price})]}),l.jsx("div",{className:`w-4 h-4 rounded-full ${u===m.id?"bg-blue-500":"border-2 border-gray-300"}`})]})},m.id))}),l.jsxs("div",{className:"flex justify-end space-x-3",children:[l.jsx("button",{onClick:()=>c==null?void 0:c.dismissView(),className:"px-4 py-2 border border-gray-300 text-gray-700 rounded hover:bg-gray-50",children:"Cancel"}),l.jsx("button",{onClick:x,disabled:!u,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50",children:"Select Plan"})]}),d&&l.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Time remaining: ",d," seconds"]})]})};try{await e.registerFrontendRPC("recommend_product",a,"modal");const c=e.getRegisteredRpcMethods();s(c),console.log("✅ Product Recommendation RPC registered successfully")}catch(c){console.error("❌ Failed to register product recommendation RPC:",c)}},i=async()=>{if(!e)return;const a=({handler:c})=>{const[d,u]=p.useState(0),[f,h]=p.useState(""),g=()=>{c==null||c.didSuccess({rating:d,comment:f,timestamp:new Date().toISOString()})};return l.jsxs("div",{className:"p-4 bg-white rounded-lg",children:[l.jsx("h3",{className:"text-lg font-semibold mb-3",children:"How was your experience?"}),l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Rate your experience:"}),l.jsx("div",{className:"flex space-x-1",children:[1,2,3,4,5].map(x=>l.jsx("button",{onClick:()=>u(x),className:`text-2xl ${x<=d?"text-yellow-400":"text-gray-300"}`,children:"⭐"},x))})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Additional comments:"}),l.jsx("textarea",{value:f,onChange:x=>h(x.target.value),className:"w-full p-2 border border-gray-300 rounded text-sm",rows:3,placeholder:"Tell us more about your experience..."})]}),l.jsxs("div",{className:"flex justify-end space-x-2",children:[l.jsx("button",{onClick:()=>c==null?void 0:c.dismissView(),className:"px-3 py-1 text-sm border border-gray-300 text-gray-700 rounded hover:bg-gray-50",children:"Skip"}),l.jsx("button",{onClick:g,disabled:d===0,className:"px-3 py-1 text-sm bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50",children:"Submit"})]})]})};try{await e.registerFrontendRPC("collect_feedback",a,"embedded");const c=e.getRegisteredRpcMethods();s(c),console.log("✅ Feedback RPC registered successfully")}catch(c){console.error("❌ Failed to register feedback RPC:",c)}};return l.jsxs("div",{className:"p-6",children:[l.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Frontend RPC Examples"}),l.jsxs("div",{className:"space-y-4 mb-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Register RPC Methods"}),l.jsxs("div",{className:"space-x-2",children:[l.jsx("button",{onClick:r,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Register Assignment RPC"}),l.jsx("button",{onClick:o,className:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600",children:"Register Product Recommendation RPC"}),l.jsx("button",{onClick:i,className:"px-4 py-2 bg-purple-500 text-white rounded hover:bg-purple-600",children:"Register Feedback RPC"})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Registered Methods"}),n.length>0?l.jsx("ul",{className:"list-disc list-inside space-y-1",children:n.map(a=>l.jsx("li",{className:"text-gray-700",children:l.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:a})},a))}):l.jsx("p",{className:"text-gray-500",children:"No methods registered yet"})]})]}),l.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"How it works"}),l.jsxs("ol",{className:"list-decimal list-inside space-y-2 text-sm text-gray-700",children:[l.jsxs("li",{children:["Register RPC methods with React components using ",l.jsx("code",{children:"client.registerFrontendRPC()"})]}),l.jsx("li",{children:"When the agent calls an RPC method, the corresponding component will be displayed"}),l.jsx("li",{children:"Users interact with the component, and the response is sent back to the agent"}),l.jsx("li",{children:"Components can be displayed in different modes: embedded, modal, or fullscreen"}),l.jsx("li",{children:"Each component has a timeout and can handle success/failure scenarios"})]})]}),l.jsxs("div",{className:"mt-6 bg-blue-50 p-4 rounded-lg",children:[l.jsx("h3",{className:"text-lg font-semibold mb-2 text-blue-800",children:"Agent Side"}),l.jsx("p",{className:"text-sm text-blue-700 mb-2",children:"On the agent side, you can call these RPC methods like this:"}),l.jsx("pre",{className:"bg-white p-3 rounded text-xs text-gray-800 overflow-x-auto",children:`// Agent calls RPC method
327
+
328
+ /* Essential layout utilities */
329
+ .voxket-widget-root .flex {
330
+ display: flex;
331
+ }
332
+
333
+ .voxket-widget-root .flex-col {
334
+ flex-direction: column;
335
+ }
336
+
337
+ .voxket-widget-root .items-center {
338
+ align-items: center;
339
+ }
340
+
341
+ .voxket-widget-root .justify-center {
342
+ justify-content: center;
343
+ }
344
+
345
+ .voxket-widget-root .justify-between {
346
+ justify-content: space-between;
347
+ }
348
+
349
+ .voxket-widget-root .h-full {
350
+ height: 100%;
351
+ }
352
+
353
+ .voxket-widget-root .w-full {
354
+ width: 100%;
355
+ }
356
+
357
+ .voxket-widget-root .overflow-hidden {
358
+ overflow: hidden;
359
+ }
360
+
361
+ .voxket-widget-root .rounded-2xl {
362
+ border-radius: 1rem;
363
+ }
364
+
365
+ .voxket-widget-root .rounded-full {
366
+ border-radius: 9999px;
367
+ }
368
+
369
+ .voxket-widget-root .rounded-xl {
370
+ border-radius: 0.75rem;
371
+ }
372
+
373
+ .voxket-widget-root .shadow-lg {
374
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
375
+ }
376
+
377
+ .voxket-widget-root .shadow-2xl {
378
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
379
+ }
380
+
381
+ .voxket-widget-root .shadow-xl {
382
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
383
+ }
384
+
385
+ .voxket-widget-root .transition-all {
386
+ transition-property: all;
387
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
388
+ transition-duration: 150ms;
389
+ }
390
+
391
+ .voxket-widget-root .duration-200 {
392
+ transition-duration: 200ms;
393
+ }
394
+
395
+ .voxket-widget-root .duration-300 {
396
+ transition-duration: 300ms;
397
+ }
398
+
399
+ .voxket-widget-root .ease-in-out {
400
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
401
+ }
402
+
403
+ .voxket-widget-root .hover\\:scale-105:hover {
404
+ transform: scale(1.05);
405
+ }
406
+
407
+ .voxket-widget-root .group {
408
+ /* Group parent for hover effects */
409
+ }
410
+
411
+ /* ESSENTIAL GRADIENT BACKGROUNDS - These are the missing styles! */
412
+
413
+ /* Background gradient utilities */
414
+ .voxket-widget-root .bg-gradient-to-br {
415
+ background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
416
+ }
417
+
418
+ .voxket-widget-root .bg-gradient-to-b {
419
+ background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
420
+ }
421
+
422
+ .voxket-widget-root .bg-gradient-to-r {
423
+ background-image: linear-gradient(to right, var(--tw-gradient-stops));
424
+ }
425
+
426
+ .voxket-widget-root .bg-gradient-to-tr {
427
+ background-image: linear-gradient(to top right, var(--tw-gradient-stops));
428
+ }
429
+
430
+ /* Gradient stops for theme colors */
431
+ .voxket-widget-root .from-black {
432
+ --tw-gradient-from: #000000;
433
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(0, 0, 0, 0));
434
+ }
435
+
436
+ .voxket-widget-root .to-gray-900 {
437
+ --tw-gradient-to: #111827;
438
+ }
439
+
440
+ .voxket-widget-root .from-white {
441
+ --tw-gradient-from: #ffffff;
442
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(255, 255, 255, 0));
443
+ }
444
+
445
+ .voxket-widget-root .to-gray-50 {
446
+ --tw-gradient-to: #f9fafb;
447
+ }
448
+
449
+ .voxket-widget-root .from-\\[\\#171727\\] {
450
+ --tw-gradient-from: #171727;
451
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(23, 23, 39, 0));
452
+ }
453
+
454
+ .voxket-widget-root .to-\\[\\#12121F\\] {
455
+ --tw-gradient-to: #12121F;
456
+ }
457
+
458
+ .voxket-widget-root .from-\\[\\#3B82F6\\] {
459
+ --tw-gradient-from: #3B82F6;
460
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(59, 130, 246, 0));
461
+ }
462
+
463
+ .voxket-widget-root .to-\\[\\#8B5CF6\\] {
464
+ --tw-gradient-to: #8B5CF6;
465
+ }
466
+
467
+ .voxket-widget-root .from-\\[\\#10B981\\] {
468
+ --tw-gradient-from: #10B981;
469
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(16, 185, 129, 0));
470
+ }
471
+
472
+ .voxket-widget-root .to-\\[\\#059669\\] {
473
+ --tw-gradient-to: #059669;
474
+ }
475
+
476
+ .voxket-widget-root .from-\\[\\#8B5CF6\\] {
477
+ --tw-gradient-from: #8B5CF6;
478
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(139, 92, 246, 0));
479
+ }
480
+
481
+ .voxket-widget-root .to-\\[\\#EC4899\\] {
482
+ --tw-gradient-to: #EC4899;
483
+ }
484
+
485
+ .voxket-widget-root .via-\\[\\#8B5CF6\\] {
486
+ --tw-gradient-to: rgba(139, 92, 246, 0);
487
+ --tw-gradient-stops: var(--tw-gradient-from), #8B5CF6, var(--tw-gradient-to, rgba(139, 92, 246, 0));
488
+ }
489
+
490
+ .voxket-widget-root .from-gray-400 {
491
+ --tw-gradient-from: #9CA3AF;
492
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(156, 163, 175, 0));
493
+ }
494
+
495
+ .voxket-widget-root .to-gray-500 {
496
+ --tw-gradient-to: #6B7280;
497
+ }
498
+
499
+ .voxket-widget-root .to-gray-600 {
500
+ --tw-gradient-to: #4B5563;
501
+ }
502
+
503
+ /* Background colors with opacity */
504
+ .voxket-widget-root .bg-black\\/90 {
505
+ background-color: rgba(0, 0, 0, 0.9);
506
+ }
507
+
508
+ .voxket-widget-root .bg-white\\/90 {
509
+ background-color: rgba(255, 255, 255, 0.9);
510
+ }
511
+
512
+ .voxket-widget-root .bg-\\[\\#171727\\]\\/90 {
513
+ background-color: rgba(23, 23, 39, 0.9);
514
+ }
515
+
516
+ .voxket-widget-root .bg-\\[\\#1E1E2E\\] {
517
+ background-color: #1E1E2E;
518
+ }
519
+
520
+ .voxket-widget-root .bg-\\[\\#1E1E2E\\]\\/80 {
521
+ background-color: rgba(30, 30, 46, 0.8);
522
+ }
523
+
524
+ .voxket-widget-root .bg-\\[\\#1E1E2E\\]\\/90 {
525
+ background-color: rgba(30, 30, 46, 0.9);
526
+ }
527
+
528
+ .voxket-widget-root .bg-gray-900 {
529
+ background-color: #111827;
530
+ }
531
+
532
+ .voxket-widget-root .bg-gray-800 {
533
+ background-color: #1F2937;
534
+ }
535
+
536
+ .voxket-widget-root .bg-gray-600 {
537
+ background-color: #4B5563;
538
+ }
539
+
540
+ .voxket-widget-root .bg-gray-700 {
541
+ background-color: #374151;
542
+ }
543
+
544
+ .voxket-widget-root .bg-gray-900\\/50 {
545
+ background-color: rgba(17, 24, 39, 0.5);
546
+ }
547
+
548
+ /* Text gradient effects */
549
+ .voxket-widget-root .bg-clip-text {
550
+ -webkit-background-clip: text;
551
+ background-clip: text;
552
+ }
553
+
554
+ .voxket-widget-root .text-transparent {
555
+ color: transparent;
556
+ }
557
+
558
+ /* Border utilities */
559
+ .voxket-widget-root .border {
560
+ border-width: 1px;
561
+ }
562
+
563
+ .voxket-widget-root .border-2 {
564
+ border-width: 2px;
565
+ }
566
+
567
+ .voxket-widget-root .border-gray-900 {
568
+ border-color: #111827;
569
+ }
570
+
571
+ .voxket-widget-root .border-gray-800 {
572
+ border-color: #1F2937;
573
+ }
574
+
575
+ .voxket-widget-root .border-gray-700 {
576
+ border-color: #374151;
577
+ }
578
+
579
+ .voxket-widget-root .border-gray-600 {
580
+ border-color: #4B5563;
581
+ }
582
+
583
+ .voxket-widget-root .border-gray-200 {
584
+ border-color: #E5E7EB;
585
+ }
586
+
587
+ /* Opacity utilities */
588
+ .voxket-widget-root .opacity-20 {
589
+ opacity: 0.2;
590
+ }
591
+
592
+ .voxket-widget-root .opacity-15 {
593
+ opacity: 0.15;
594
+ }
595
+
596
+ /* Blur utilities */
597
+ .voxket-widget-root .blur-2xl {
598
+ filter: blur(40px);
599
+ }
600
+
601
+ .voxket-widget-root .blur-xl {
602
+ filter: blur(24px);
603
+ }
604
+
605
+ .voxket-widget-root .blur-sm {
606
+ filter: blur(4px);
607
+ }
608
+
609
+ /* Size utilities */
610
+ .voxket-widget-root .w-32 {
611
+ width: 8rem;
612
+ }
613
+
614
+ .voxket-widget-root .h-32 {
615
+ height: 8rem;
616
+ }
617
+
618
+ .voxket-widget-root .w-28 {
619
+ width: 7rem;
620
+ }
621
+
622
+ .voxket-widget-root .h-28 {
623
+ height: 7rem;
624
+ }
625
+
626
+ .voxket-widget-root .w-24 {
627
+ width: 6rem;
628
+ }
629
+
630
+ .voxket-widget-root .h-24 {
631
+ height: 6rem;
632
+ }
633
+
634
+ .voxket-widget-root .w-20 {
635
+ width: 5rem;
636
+ }
637
+
638
+ .voxket-widget-root .h-20 {
639
+ height: 5rem;
640
+ }
641
+
642
+ .voxket-widget-root .w-6 {
643
+ width: 1.5rem;
644
+ }
645
+
646
+ .voxket-widget-root .h-6 {
647
+ height: 1.5rem;
648
+ }
649
+
650
+ .voxket-widget-root .w-4 {
651
+ width: 1rem;
652
+ }
653
+
654
+ .voxket-widget-root .h-4 {
655
+ height: 1rem;
656
+ }
657
+
658
+ .voxket-widget-root .w-2 {
659
+ width: 0.5rem;
660
+ }
661
+
662
+ .voxket-widget-root .h-2 {
663
+ height: 0.5rem;
664
+ }
665
+
666
+ .voxket-widget-root .max-w-md {
667
+ max-width: 28rem;
668
+ }
669
+
670
+ /* Positioning utilities */
671
+ .voxket-widget-root .top-0 {
672
+ top: 0px;
673
+ }
674
+
675
+ .voxket-widget-root .right-0 {
676
+ right: 0px;
677
+ }
678
+
679
+ .voxket-widget-root .bottom-0 {
680
+ bottom: 0px;
681
+ }
682
+
683
+ .voxket-widget-root .left-0 {
684
+ left: 0px;
685
+ }
686
+
687
+ .voxket-widget-root .-top-2 {
688
+ top: -0.5rem;
689
+ }
690
+
691
+ .voxket-widget-root .-left-2 {
692
+ left: -0.5rem;
693
+ }
694
+
695
+ .voxket-widget-root .-bottom-2 {
696
+ bottom: -0.5rem;
697
+ }
698
+
699
+ .voxket-widget-root .-right-2 {
700
+ right: -0.5rem;
701
+ }
702
+
703
+ .voxket-widget-root .inset-0 {
704
+ inset: 0px;
705
+ }
706
+
707
+ /* Z-index utilities */
708
+ .voxket-widget-root .z-10 {
709
+ z-index: 10;
710
+ }
711
+
712
+ /* Padding utilities */
713
+ .voxket-widget-root .p-0 {
714
+ padding: 0px;
715
+ }
716
+
717
+ /* Animation utilities */
718
+ .voxket-widget-root .animate-pulse {
719
+ animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
720
+ }
721
+
722
+ @keyframes pulse {
723
+ 0%, 100% {
724
+ opacity: 1;
725
+ }
726
+ 50% {
727
+ opacity: .5;
728
+ }
729
+ }
730
+
731
+ /* Text utilities */
732
+ .voxket-widget-root .text-white {
733
+ color: #ffffff;
734
+ }
735
+
736
+ .voxket-widget-root .text-gray-300 {
737
+ color: #d1d5db;
738
+ }
739
+
740
+ .voxket-widget-root .text-gray-400 {
741
+ color: #9ca3af;
742
+ }
743
+
744
+ .voxket-widget-root .text-gray-200 {
745
+ color: #e5e7eb;
746
+ }
747
+
748
+ .voxket-widget-root .font-medium {
749
+ font-weight: 500;
750
+ }
751
+
752
+ /* Pointer events */
753
+ .voxket-widget-root .pointer-events-none {
754
+ pointer-events: none;
755
+ }
756
+ `,t=document.createElement("style");t.type="text/css",t.setAttribute("data-voxket-styles","true"),t.textContent=e,document.head.appendChild(t),Za=!0}class he extends Error{constructor(t,n,r){super(t),this.code=n,this.details=r,this.name="VoxketError"}}class Vn extends Po{constructor(n){super();Se(this,"config");Se(this,"room",null);Se(this,"pluginManager");Se(this,"rpcManager");Se(this,"isConnected",!1);Se(this,"currentSession",null);Se(this,"connectionState",Z.ConnectionState.Disconnected);Se(this,"renderedComponents",new Map);Se(this,"textStreamHandlersRegistered",!1);Se(this,"currentAgentInfo",null);Se(this,"chatMessages",[]);Se(this,"isAgentConnected",!1);Se(this,"agentState","idle");yd(),this.config=n,this.pluginManager=new md(this),this.rpcManager=new rx,this.setupEventListeners(),this.initializeClient()}setupEventListeners(){this.on("connection.connected",()=>{var n,r;this.isConnected=!0,(r=(n=this.config).onConnected)==null||r.call(n)}),this.on("connection.disconnected",n=>{var r,s;this.isConnected=!1,(s=(r=this.config).onDisconnected)==null||s.call(r,n)}),this.on("connection.error",n=>{var r,s;(s=(r=this.config).onError)==null||s.call(r,n)}),this.on("chat.message.received",n=>{var r,s;this.addChatMessage(n),(s=(r=this.config).onMessageReceived)==null||s.call(r,n)}),this.on("chat.message.updated",n=>{this.updateChatMessage(n)}),this.on("chat.message.sent",n=>{this.addChatMessage(n)}),this.on("transcription.received",n=>{var r,s;(s=(r=this.config).onTranscriptionReceived)==null||s.call(r,n)}),this.on("session.state.changed",n=>{var r,s;(s=(r=this.config).onSessionStateChanged)==null||s.call(r,n)}),this.on("session.created",n=>{var r,s;(s=(r=this.config).onSessionStart)==null||s.call(r,n.id)}),this.on("session.ended",(n,r)=>{var s,o;(o=(s=this.config).onSessionEnd)==null||o.call(s,r)}),this.on("participant.joined",n=>{var r,s;(s=(r=this.config).onUserJoined)==null||s.call(r,n.id)}),this.on("participant.left",n=>{var r,s;(s=(r=this.config).onUserLeft)==null||s.call(r,n.id)}),this.setupRpcEventForwarding()}setupRpcEventForwarding(){if(!this.rpcManager){console.warn("RpcManager not initialized, skipping event forwarding setup");return}this.rpcManager.on("rpc.method.registered",n=>this.emit("rpc.method.registered",n)),this.rpcManager.on("rpc.method.called",n=>this.emit("rpc.method.called",n)),this.rpcManager.on("rpc.interaction.started",n=>this.emit("rpc.interaction.started",n)),this.rpcManager.on("rpc.interaction.completed",n=>this.emit("rpc.interaction.completed",n)),this.rpcManager.on("rpc.interaction.timeout",n=>this.emit("rpc.interaction.timeout",n)),this.rpcManager.on("rpc.interaction.dismissed",n=>this.emit("rpc.interaction.dismissed",n))}initializeClient(){this.room=new Z.Room,this.setupRoomEventListeners()}setupRoomEventListeners(){this.room&&(this.room.on(Z.RoomEvent.Connected,()=>{var n,r;this.connectionState=Z.ConnectionState.Connected,this.emit("connection.connected"),this.rpcManager.setRoom(this.room),(r=(n=this.currentSession)==null?void 0:n.activeModalities)!=null&&r.includes("voice")&&setTimeout(async()=>{var s;try{(s=this.room)!=null&&s.localParticipant&&(this.room.localParticipant.isMicrophoneEnabled?this.emit("track.unmuted",{source:"microphone",enabled:!0}):(await this.room.localParticipant.setMicrophoneEnabled(!0),this.emit("track.unmuted",{source:"microphone",enabled:!0})))}catch(o){console.warn("VoxketClient: Failed to enable microphone after room connection:",o)}},1e3),this.textStreamHandlersRegistered||this.setupTextStreamHandlers()}),this.room.on(Z.RoomEvent.Disconnected,n=>{var r;console.log("🔴 VoxketClient: Room disconnected, reason:",n),this.connectionState=Z.ConnectionState.Disconnected,this.textStreamHandlersRegistered=!1,this.isAgentConnected=!1,console.log("🤖 VoxketClient: Agent marked as disconnected"),n&&console.log("🔍 VoxketClient: Disconnect reason details:",{reason:n.toString(),currentSession:(r=this.currentSession)==null?void 0:r.id,agentConnected:this.isAgentConnected,connectionState:this.connectionState}),this.emit("connection.disconnected",n==null?void 0:n.toString())}),this.room.on(Z.RoomEvent.ConnectionStateChanged,n=>{this.connectionState=n,n===Z.ConnectionState.Connecting&&this.emit("connection.connecting")}),this.room.on(Z.RoomEvent.ParticipantConnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.joined",r)}),this.room.on(Z.RoomEvent.ParticipantDisconnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.left",r)}))}setupTextStreamHandlers(){if(!this.room)return;try{this.room.registerTextStreamHandler("lk.chat",async(r,s)=>{try{const o=await r.readAll(),i={id:`msg_${Date.now()}_${s.identity||"user"}_${Math.random().toString(36).substr(2,9)}`,content:o,timestamp:new Date,sender:{id:s.identity||"user",name:s.identity||"User",type:"participant"},metadata:{topic:"lk.chat"}};this.emit("chat.message.received",i)}catch(o){console.error("VoxketClient: Failed to process lk.chat message:",o)}})}catch(r){console.warn("VoxketClient: lk.chat handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("lk.transcription",async(r,s)=>{var o,i;try{const a=`msg_${Date.now()}_agent_transcription_${Math.random().toString(36).substr(2,9)}`;let c="";const d=((o=this.currentAgentInfo)==null?void 0:o.name)||s.identity||"AI Assistant",u={id:a,content:"",timestamp:new Date,sender:{id:s.identity||"agent",name:d,type:"agent"},metadata:{topic:"lk.transcription",streaming:!0}};this.emit("chat.message.received",u);for await(const p of r){c+=p;const x=this.convertMarkdownToText(c),m={...u,content:x,metadata:{...u.metadata,streaming:!0}};this.emit("chat.message.updated",m)}const f=this.convertMarkdownToText(c),h={...u,content:f,metadata:{...u.metadata,streaming:!1}};this.emit("chat.message.updated",h)}catch(a){console.error("VoxketClient: Failed to process lk.transcription message:",a);try{const c=await r.readAll(),d=((i=this.currentAgentInfo)==null?void 0:i.name)||s.identity||"AI Assistant",u={id:`msg_${Date.now()}_agent_transcription_${Math.random().toString(36).substr(2,9)}`,content:c,timestamp:new Date,sender:{id:s.identity||"agent",name:d,type:"agent"},metadata:{topic:"lk.transcription"}};this.emit("chat.message.received",u)}catch(c){console.error("VoxketClient: Fallback failed for lk.transcription:",c)}}})}catch(r){console.warn("VoxketClient: lk.transcription handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("suggested_response",async r=>{const s=await r.readAll();let o=[];try{o=["tes","hello how are you","algebra make me learn that ","what is the meaning of life"]}catch(i){console.warn("VoxketClient: Failed to parse suggested_response:",i,s)}this.emit("suggested.response",o)})}catch(r){console.warn("VoxketClient: suggested_response handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("agent_state_changed",async(r,s)=>{const o=await r.readAll();console.log("🤖 VoxketClient: agent_state_changed stream received:",o);let i={};try{i=typeof o=="string"?JSON.parse(o.replace(/'/g,'"')):o}catch(a){console.warn("VoxketClient: Failed to parse agent_state_changed:",a,o)}this.isAgentConnected||(this.isAgentConnected=!0,console.log("🤖 VoxketClient: Agent marked as connected (first state change received)"),this.emit("agent.connected",i)),i.new_state==="speaking"?(this.setAgentState("speaking"),this.emit("agent.speaking",i)):i.new_state==="thinking"?(this.setAgentState("thinking"),this.emit("agent.thinking",i)):(i.new_state==="idle"||i.new_state==="listening")&&this.setAgentState("idle")})}catch(r){console.warn("VoxketClient: conversation_item_added handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("images",async(r,s)=>{try{const o=await r.readAll()}catch(o){console.error("VoxketClient: Error processing images stream:",o)}})}catch(r){console.warn("VoxketClient: images handler already registered, skipping:",r)}try{this.room.registerByteStreamHandler("images",async(r,s)=>{var o,i;try{const a=r.info,c={id:`img_${Date.now()}_${s.identity||"agent"}_${Math.random().toString(36).substr(2,9)}`,content:`�️ ${a.name||"Image"}`,sender:{id:s.identity||"agent",name:s.identity||"Agent",type:s.identity===((i=(o=this.room)==null?void 0:o.localParticipant)==null?void 0:i.identity)?"participant":"agent"},timestamp:new Date,metadata:{type:"attachment",fileName:a.name,fileSize:a.size,mimeType:a.mimeType,streamId:a.id,downloading:!0}};this.emit("chat.message.received",c),r.onProgress&&(r.onProgress=p=>{const x={...c,metadata:{...c.metadata,downloadProgress:p||0}};this.emit("chat.message.updated",x)});const d=[];for await(const p of r)d.push(p);const u=new Blob(d,{type:a.mimeType||"application/octet-stream"}),f=URL.createObjectURL(u),h={...c,metadata:{...c.metadata,downloading:!1,downloadProgress:1,downloadUrl:f,blob:u}};this.emit("chat.message.updated",h)}catch(a){console.error("VoxketClient: Error processing image attachment:",a)}})}catch(r){console.warn("VoxketClient: image handler already registered, skipping:",r)}["error","warning","status","system","debug","info"].forEach(r=>{try{this.room.registerTextStreamHandler(r,async(s,o)=>{try{const i=await s.readAll();if(console.log(`📝 VoxketClient: Received '${r}' stream:`,i),r==="error"){let a={};try{a=typeof i=="string"?JSON.parse(i):i}catch{a={message:i}}console.warn("� VoxketClient: Agent error:",a),this.emit("agent.error",a)}else this.emit("text.stream.received",{topic:r,data:i,participantInfo:o})}catch(i){console.error(`VoxketClient: Failed to process '${r}' stream:`,i)}})}catch(s){console.warn(`VoxketClient: Handler for '${r}' already registered, skipping:`,s)}});try{this.room.registerTextStreamHandler("*",async(r,s)=>{var o;try{const i=await r.readAll(),a=((o=r.info)==null?void 0:o.topic)||"unknown";console.log(`📝 VoxketClient: Received unhandled text stream for topic '${a}':`,i),this.emit("text.stream.unhandled",{topic:a,data:i,participantInfo:s})}catch(i){console.error("VoxketClient: Failed to process unhandled text stream:",i)}})}catch(r){console.warn("VoxketClient: Generic text stream handler already registered, skipping:",r)}this.textStreamHandlersRegistered=!0}async fetchConnectionDetails(n,r,s){const o=n||this.config.agentId||"default-agent",i=r||this.config.participantName||"User",a=s||this.config.modalities||["voice"];try{const c={agent_id:o,participant_name:i,participant_metadata:{user_id:""},modality:a[0],modalities:a};console.log("🔗 VoxketClient: Creating session with modalities:",a);const d=await fetch(`${this.config.baseUrl}/api/live/agent/session`,{method:"POST",headers:{accept:"application/json","X-APP-ID":this.config.appId,"X-APP-SECRET":this.config.appSecret,"Content-Type":"application/json"},body:JSON.stringify(c)});if(!d.ok){let h=`HTTP ${d.status}: Failed to fetch connection details`;try{const p=await d.json();p&&(p.error?h=`API Error: ${p.error}`:p.detail?h=`API Error: ${p.detail}`:p.message&&(h=`API Error: ${p.message}`))}catch{try{const x=await d.text();x&&(h=`API Error: ${x}`)}catch{}}throw new Error(h)}const u=await d.json();let f;return u.agent_info&&(f={id:u.agent_info.id||o,name:u.agent_info.name||"AI Assistant",avatar:u.agent_info.avatar,capabilities:u.agent_info.capabilities||["voice_interaction","text_chat"],metadata:u.agent_info.metadata||{}},this.currentAgentInfo=f),{serverUrl:u.wss_url,participantToken:u.token,voxketSessionId:u.session_id,agentInfo:f}}catch(c){console.error("VoxketClient: fetchConnectionDetails failed:",c);const d=new he(`Failed to fetch connection details: ${c instanceof Error?c.message:"Unknown error"}`,"CONNECTION_FAILED",c);throw this.emit("connection.error",d),d}}async connect(n,r,s){var o;try{this.emit("connection.connecting");const i=await this.fetchConnectionDetails(n,r,s);return await((o=this.room)==null?void 0:o.connect(i.serverUrl,i.participantToken)),this.isConnected=!0,i}catch(i){console.error("VoxketClient: Connection failed:",i);const a=new he(`Failed to connect to Voxket services: ${i instanceof Error?i.message:"Unknown error"}`,"CONNECTION_FAILED",i);throw this.emit("connection.error",a),a}}async disconnect(){var n;try{await((n=this.room)==null?void 0:n.disconnect()),this.isConnected=!1,this.currentSession=null,this.currentAgentInfo=null,this.textStreamHandlersRegistered=!1,this.clearChatMessages(),this.room=new Z.Room,this.setupRoomEventListeners()}catch(r){const s=new he("Failed to disconnect properly","NETWORK_ERROR",r);throw this.emit("connection.error",s),s}}async createSession(n){var r,s,o,i;try{const a=await this.connect(n.agentId,n.participantName,n.modalities),c={id:a.voxketSessionId,agentId:n.agentId,state:"connecting",startedAt:new Date,metadata:n.metadata||{},activeModalities:n.modalities||["voice"],agentInfo:a.agentInfo||this.currentAgentInfo};if(this.currentSession=c,this.emit("session.created",c),(r=n.modalities)!=null&&r.includes("voice"))try{await new Promise(d=>setTimeout(d,500)),(s=this.room)!=null&&s.localParticipant?(await this.room.localParticipant.setMicrophoneEnabled(!0,void 0,{preConnectBuffer:!0}),this.emit("track.unmuted",{source:"microphone",enabled:!0})):console.warn("VoxketClient: No local participant found, microphone not enabled")}catch(d){console.warn("VoxketClient: Failed to enable microphone, but continuing with session:",d)}if((o=n.modalities)!=null&&o.includes("video"))try{await new Promise(d=>setTimeout(d,200)),(i=this.room)!=null&&i.localParticipant&&(console.log("🎥 VoxketClient: Attempting to enable camera for video session"),await this.room.localParticipant.setCameraEnabled(!0),this.emit("track.unmuted",{source:"camera",enabled:!0}),console.log("🎥 VoxketClient: Camera enabled successfully"))}catch(d){console.warn("VoxketClient: Failed to enable camera, but continuing with session:",d)}return setTimeout(()=>{var d;this.currentSession&&(this.currentSession.state="active",this.emit("session.state.changed","active",this.currentSession.state),this.forceAgentConnected(),console.log("🤖 VoxketClient: Session marked as active:",{sessionId:this.currentSession.id,modalities:this.currentSession.activeModalities,agentConnected:this.isAgentConnected,hasRoom:!!this.room,remoteParticipants:((d=this.room)==null?void 0:d.remoteParticipants.size)||0}))},1e3),c}catch(a){throw console.error("VoxketClient: Failed to create session:",a),a instanceof he?a:a instanceof TypeError&&a.message.includes("fetch")?new he("Network connection failed","CONNECTION_FAILED",a):a instanceof Error&&a.message.includes("Failed to fetch connection details")?new he(`API connection failed: ${a.message}`,"CONNECTION_FAILED",a):new he(`Failed to create session: ${a instanceof Error?a.message:"Unknown error"}`,"SESSION_NOT_FOUND",a)}}async startSession(n,r){const s={agentId:n||this.config.agentId||"default-agent",participantName:(r==null?void 0:r.participantName)||this.config.participantName||"User",modalities:(r==null?void 0:r.modalities)||this.config.modalities||["voice","chat"],metadata:r==null?void 0:r.metadata};return this.createSession(s)}async endSession(){var n,r;if(!this.currentSession)return null;try{const s={sessionId:this.currentSession.id,duration:Date.now()-(((n=this.currentSession.startedAt)==null?void 0:n.getTime())||0),messageCount:0,participantCount:((r=this.room)==null?void 0:r.remoteParticipants.size)||0,audioQuality:{avgBitrate:64e3,avgLatency:150,packetLoss:.01,jitter:.05},videoQuality:{avgBitrate:5e5,avgLatency:150,packetLoss:.01,jitter:.05},networkStats:{totalBytesReceived:0,totalBytesSent:0,connectionType:"webrtc",avgRoundTripTime:150},events:[]};return this.currentSession.endedAt=new Date,this.currentSession.state="disconnected",this.emit("session.ended",this.currentSession,s),await this.disconnect(),s}catch(s){throw new he("Failed to end session","SESSION_NOT_FOUND",s)}}getCurrentSession(){return this.currentSession}getCurrentAgentInfo(){return this.currentAgentInfo}getIsAgentConnected(){return this.isAgentConnected}forceAgentConnected(){this.isAgentConnected||(this.isAgentConnected=!0,console.log("🤖 VoxketClient: Agent manually marked as connected"),this.emit("agent.connected",{forced:!0}))}getAgentState(){return this.agentState}setAgentState(n){this.agentState!==n&&(this.agentState=n,this.emit("agent.state.changed",{state:n}))}getAgentAudioTrack(){const n=this.getRemoteParticipants();for(const r of n){const s=r.getTrackPublication(Z.Track.Source.Microphone);if(s!=null&&s.track)return{source:Z.Track.Source.Microphone,participant:r,publication:s}}return null}getAgentVideoTrack(){const n=this.getRemoteParticipants();for(const r of n){const s=r.getTrackPublication(Z.Track.Source.Camera);if(s!=null&&s.track)return{source:Z.Track.Source.Camera,participant:r,publication:s}}return null}getVideoTrackRefs(){const n=[],r=this.getLocalParticipant();if(r){const o=r.getTrackPublication(Z.Track.Source.Camera);o!=null&&o.track&&n.push({source:Z.Track.Source.Camera,participant:r,publication:o});const i=r.getTrackPublication(Z.Track.Source.ScreenShare);i!=null&&i.track&&n.push({source:Z.Track.Source.ScreenShare,participant:r,publication:i})}const s=this.getRemoteParticipants();for(const o of s){const i=o.getTrackPublication(Z.Track.Source.Camera);i!=null&&i.track&&n.push({source:Z.Track.Source.Camera,participant:o,publication:i});const a=o.getTrackPublication(Z.Track.Source.ScreenShare);a!=null&&a.track&&n.push({source:Z.Track.Source.ScreenShare,participant:o,publication:a})}return n}getCameraTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===Z.Track.Source.Camera)}getScreenShareTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===Z.Track.Source.ScreenShare)}getChatMessages(){return[...this.chatMessages]}addChatMessage(n){this.chatMessages.some(s=>s.id===n.id)||this.chatMessages.push(n)}updateChatMessage(n){const r=this.chatMessages.findIndex(s=>s.id===n.id);r!==-1&&(this.chatMessages[r]=n)}clearChatMessages(){this.chatMessages=[],this.dismissCurrentInteraction(),this.renderedComponents.clear(),this.forceCleanupFullscreenOverlays(),this.emit("chat.history.cleared")}renderUI(n={}){var c,d,u;const r=this.resolveTarget(n.target||"body"),s=this.getTargetKey(r),o=this.renderedComponents.get(s);o&&o.target===r||this.removeUI(r);const i=(o==null?void 0:o.root)||Ud.createRoot(r),a={agentId:n.agentId||this.config.agentId||"default-agent",participantName:n.participantName||this.config.participantName||"User",baseUrl:this.config.baseUrl,appSecret:this.config.appSecret,appId:this.config.appId,className:n.className,theme:typeof n.theme=="string"?n.theme:void 0,modalities:n.modality||this.config.modalities||["voice"],suportsChatInput:((c=n.modality)==null?void 0:c.includes("chat"))!==!1,suportsVideoInput:((d=n.modality)==null?void 0:d.includes("video"))===!0,suportsScreenShare:((u=n.modality)==null?void 0:u.includes("screen_share"))===!0,autoStart:n.autoStart,displayType:n.displayType||"widget",popupPosition:n.popupPosition||"bottom-right",popupTriggerText:n.popupTriggerText||"Open Chat",width:n.width,height:n.height,onDisplayTypeChange:n.onDisplayTypeChange,prompts:n.prompts,statusMessage:n.statusMessage,welcomeTitle:n.welcomeTitle,welcomeSubTitle:n.welcomeSubTitle,loadingText:n.loadingText,voxketClient:this};if(!i||typeof i.render!="function")throw new Error("Invalid React root. Make sure React 18+ is properly installed and configured.");try{i.render(C.createElement(pd,{config:this.config,autoConnect:n.autoStart||!1,children:C.createElement(xd,a)}))}catch(f){throw console.error("Error rendering Voxket widget:",f),new Error(`Failed to render Voxket widget: ${f instanceof Error?f.message:"Unknown error"}`)}this.renderedComponents.set(s,{root:i,target:r})}removeUI(n){const r=n?this.resolveTarget(n):null;if(r){const s=this.getTargetKey(r),o=this.renderedComponents.get(s);o&&(o.root.unmount(),this.renderedComponents.delete(s),r.querySelectorAll('[id*="voxket"], [class*="voxket"], .fixed.inset-0.z-50').forEach(a=>{try{a.remove()}catch(c){console.warn("Failed to remove element:",c)}}),r===document.body&&r.querySelectorAll(".fixed.z-50, .fixed.inset-0").forEach(c=>{if(c.classList.contains("bg-black")&&c.classList.contains("backdrop-blur-sm"))try{c.remove()}catch(d){console.warn("Failed to remove fixed element:",d)}}))}}removeAllUI(){for(const[n,r]of this.renderedComponents)r.root.unmount();this.renderedComponents.clear(),this.forceCleanupFullscreenOverlays()}forceCleanupFullscreenOverlays(){document.body.querySelectorAll(".fixed.inset-0.z-50").forEach(r=>{if(r.classList.contains("bg-black")&&(r.classList.contains("backdrop-blur-sm")||r.classList.contains("bg-opacity-30")))try{r.remove()}catch(s){console.warn("Failed to remove overlay:",s)}})}resolveTarget(n){if(typeof n=="string"){const r=document.querySelector(n);if(!r)throw new Error(`Target element not found: ${n}`);return r}return n}getTargetKey(n){return n.id?n.id:n.className?n.tagName+"_"+n.className.replace(/\s+/g,"_"):n.tagName+"_"+n.outerHTML.length%1e3}async sendMessage(n,r){var s;if(!this.currentSession)throw console.error("VoxketClient: No active session found"),new he("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new he("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new he("No local participant","CONNECTION_FAILED");this.dismissCurrentInteraction();try{const o={id:`msg_${Date.now()}`,content:n,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:r||{}},i=await((s=this.room)==null?void 0:s.localParticipant.sendText(n,{topic:"lk.chat",destinationIdentities:[]}));this.emit("chat.message.sent",o)}catch(o){throw console.error("VoxketClient: Failed to send chat message:",o),new he("Failed to send message","NETWORK_ERROR",o)}}async sendChatMessage(n,r){return this.sendMessage(n,r)}async sendAttachments(n,r){if(!this.currentSession)throw console.error("VoxketClient: No active session found"),new he("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new he("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new he("No local participant","CONNECTION_FAILED");if(!n||n.length===0)throw new he("No files provided","INVALID_PARAMETER");this.dismissCurrentInteraction();const s=n.filter(o=>o.type.startsWith("image/"));if(s.length===0)throw new he("Only image files are allowed","INVALID_PARAMETER");s.length!==n.length&&console.warn("VoxketClient: Some non-image files were filtered out");try{const o=s.map(async(i,a)=>{const d={id:`att_${Date.now()}_${a}`,content:`📎 ${i.name}`,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:{...r,type:"attachment",fileName:i.name,fileSize:i.size,mimeType:i.type,uploading:!0}};this.emit("chat.message.sent",d);const u=await this.room.localParticipant.sendFile(i,{mimeType:i.type,topic:"images",onProgress:h=>{const p={...d,metadata:{...d.metadata,uploadProgress:h}};this.emit("chat.message.updated",p)}});try{const h=new FileReader,p=new Promise((b,k)=>{h.onload=()=>{typeof h.result=="string"?b(h.result):k(new Error("Failed to convert to base64"))},h.onerror=k});h.readAsDataURL(i);const m={type:"image",data:await p,filename:i.name,mimeType:i.type,size:i.size};await this.room.localParticipant.sendText(JSON.stringify(m),{topic:"images",destinationIdentities:[]})}catch(h){console.warn("VoxketClient: Failed to send image data to agent:",h);try{const p=`I've shared an image: ${i.name}`;await this.room.localParticipant.sendText(p,{topic:"lk.chat",destinationIdentities:[]})}catch(p){console.warn("VoxketClient: Failed to send image notification to agent:",p)}}const f={...d,metadata:{...d.metadata,uploading:!1,uploadProgress:1,streamId:u.id}};return this.emit("chat.message.updated",f),u});await Promise.all(o)}catch(o){throw console.error("VoxketClient: Failed to send attachments:",o),new he("Failed to send attachments","NETWORK_ERROR",o)}}async sendAttachment(n,r){return this.sendAttachments([n],r)}toggleMicrophone(n){return this.setMicrophoneEnabled(n!==!1)}async setMicrophoneEnabled(n){var r,s;try{const o=(r=this.room)==null?void 0:r.localParticipant.isMicrophoneEnabled,i=n??!o;await((s=this.room)==null?void 0:s.localParticipant.setMicrophoneEnabled(i)),i?this.emit("track.unmuted",{source:"microphone",enabled:!0}):this.emit("track.muted",{source:"microphone",enabled:!1})}catch(o){throw console.error("VoxketClient: Failed to toggle microphone:",o),new he("Failed to toggle microphone","PERMISSION_DENIED",o)}}toggleCamera(n){return this.setCameraEnabled(n!==!1)}async setCameraEnabled(n){var r,s;try{const o=(r=this.room)==null?void 0:r.localParticipant.isCameraEnabled,i=n??!o;await((s=this.room)==null?void 0:s.localParticipant.setCameraEnabled(i)),i?this.emit("track.unmuted",{source:"camera",enabled:!0}):this.emit("track.muted",{source:"camera",enabled:!1})}catch(o){throw console.error("VoxketClient: Failed to toggle camera:",o),new he("Failed to toggle camera","PERMISSION_DENIED",o)}}async enableCamera(){return this.setCameraEnabled(!0)}async disableCamera(){return this.setCameraEnabled(!1)}async startScreenShare(){var n;try{await((n=this.room)==null?void 0:n.localParticipant.setScreenShareEnabled(!0))}catch(r){throw new he("Failed to start screen share","PERMISSION_DENIED",r)}}async stopScreenShare(){var n;try{await((n=this.room)==null?void 0:n.localParticipant.setScreenShareEnabled(!1))}catch(r){throw new he("Failed to stop screen share","PERMISSION_DENIED",r)}}async getAudioInputDevices(){try{return(await navigator.mediaDevices.enumerateDevices()).filter(r=>r.kind==="audioinput")}catch(n){throw new he("Failed to get audio input devices","DEVICE_ERROR",n)}}async getVideoInputDevices(){try{return(await navigator.mediaDevices.enumerateDevices()).filter(r=>r.kind==="videoinput")}catch(n){throw new he("Failed to get video input devices","DEVICE_ERROR",n)}}async setAudioInputDevice(n){var r;try{if(!((r=this.room)!=null&&r.localParticipant))throw new Error("Not connected to room")}catch(s){throw new he("Failed to set audio input device","DEVICE_ERROR",s)}}async setVideoInputDevice(n){var r;try{if(!((r=this.room)!=null&&r.localParticipant))throw new Error("Not connected to room")}catch(s){throw new he("Failed to set video input device","DEVICE_ERROR",s)}}getLocalParticipant(){var n;return((n=this.room)==null?void 0:n.localParticipant)??null}getRemoteParticipants(){var n;return Array.from(((n=this.room)==null?void 0:n.remoteParticipants.values())??[])}getPublishPermissions(){const n=this.getLocalParticipant();if(!n)return{camera:!1,microphone:!1,screenShare:!1,data:!1};const r=n.permissions;if(!r)return{camera:!0,microphone:!0,screenShare:!0,data:!0};const s=o=>!!r.canPublish&&(r.canPublishSources.length===0||r.canPublishSources.includes(o));return{camera:s(1),microphone:s(2),screenShare:s(3),data:r.canPublishData??!1}}canPublishSource(n){return this.getPublishPermissions()[n]}getRoom(){return this.room}getConnectionState(){return this.connectionState}get connected(){return this.isConnected&&this.connectionState===Z.ConnectionState.Connected}getMicrophoneTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===Z.Track.Source.Microphone)return r.track;return null}getCameraTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===Z.Track.Source.Camera)return r.track;return null}getScreenShareTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===Z.Track.Source.ScreenShare)return r.track;return null}get isMicrophoneEnabled(){const n=this.getMicrophoneTrack();return n?!n.isMuted:!1}get isCameraEnabled(){const n=this.getCameraTrack();return n?!n.isMuted:!1}get isScreenShareEnabled(){const n=this.getScreenShareTrack();return n?!n.isMuted:!1}registerPlugin(n){this.pluginManager.register(n)}getPluginManager(){return this.pluginManager}getParticipants(){if(!this.room)return[];const n=[];return this.room.localParticipant&&n.push({id:this.room.localParticipant.identity,name:this.room.localParticipant.name||this.room.localParticipant.identity,isLocal:!0}),this.room.remoteParticipants.forEach(r=>{n.push({id:r.identity,name:r.name||r.identity,isLocal:!1})}),n}getSessionMetrics(){var n,r;return this.currentSession?{sessionId:this.currentSession.id,duration:Date.now()-(((n=this.currentSession.startedAt)==null?void 0:n.getTime())||0),messageCount:0,participantCount:((r=this.room)==null?void 0:r.remoteParticipants.size)||0,audioQuality:{avgBitrate:64e3,avgLatency:150,packetLoss:.01,jitter:.05},videoQuality:{avgBitrate:5e5,avgLatency:150,packetLoss:.01,jitter:.05},networkStats:{totalBytesReceived:0,totalBytesSent:0,connectionType:"webrtc",avgRoundTripTime:150},events:[]}:null}updateConfig(n){this.config={...this.config,...n}}async startRecording(){var n;try{this.emit("recording.started",{sessionId:(n=this.currentSession)==null?void 0:n.id,timestamp:new Date})}catch(r){throw new he("Failed to start recording","RECORDING_ERROR",r)}}async stopRecording(){var n;try{this.emit("recording.stopped",{sessionId:(n=this.currentSession)==null?void 0:n.id,timestamp:new Date})}catch(r){throw new he("Failed to stop recording","RECORDING_ERROR",r)}}async registerFrontendRPC(n,r,s="embedded"){return this.rpcManager.registerFrontendRPC(n,r,s)}getCurrentInteraction(){return this.rpcManager.getCurrentInteraction()}dismissCurrentInteraction(){this.rpcManager.dismissCurrentInteraction()}getRegisteredRpcMethods(){return this.rpcManager.getRegisteredMethods()}unregisterRpcMethod(n){this.rpcManager.unregisterMethod(n)}registerEventListener(n,r){return this.on(n,r)}registerEventEmitter(n,r){if(!this.room)throw new Error("Room not available");try{this.room.registerTextStreamHandler(n,async s=>{try{const o=await s.readAll();r(o)}catch(o){console.error(`Error processing event for topic '${n}':`,o)}})}catch(s){console.warn(`VoxketClient: Handler for topic '${n}' may already be registered:`,s)}}convertMarkdownToText(n){if(!n)return"";let r=n;return r=r.replace(/\*\*(.*?)\*\*/g,"$1"),r=r.replace(/__(.*?)__/g,"$1"),r=r.replace(/\*(.*?)\*/g,"$1"),r=r.replace(/_(.*?)_/g,"$1"),r=r.replace(/~~(.*?)~~/g,"$1"),r=r.replace(/`([^`]+)`/g,"$1"),r=r.replace(/```[\s\S]*?```/g,""),r=r.replace(/^#{1,6}\s+/gm,""),r=r.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1"),r.trim()}}function $t({title:e,description:t}){console.error(`${e}: ${t}`)}const sx=ie.create($y),ox=ie.create(Wy),ix=ie.create(Yy),ax=ie.create(Jy);function cx({onClick:e,text:t="Open Chat",position:n="bottom-right",theme:r}){const s={"top-left":"top-4 left-4","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4"},o=Ve(r);return l.jsx(ie.button,{onClick:e,className:`fixed ${s[n]} z-50 px-4 py-2 rounded-full shadow-lg ${o.popupTrigger} transition-all duration-200 hover:scale-105`,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},whileHover:{scale:1.05},whileTap:{scale:.95},children:t})}function Wa({children:e,theme:t,displayType:n="widget",onClose:r,popupPosition:s="bottom-right",onExpand:o}){const i=Ve(t);if(n==="fullscreen")return l.jsx("div",{className:"fixed inset-0 z-[9999] bg-black/40 bg-opacity-30 backdrop-blur-sm flex items-center justify-center p-8",onClick:a=>{a.target===a.currentTarget&&r&&r()},children:l.jsxs("div",{className:"w-full h-full max-w-6xl max-h-[90vh] rounded-2xl relative bg-transparent",onClick:a=>{a.stopPropagation()},children:[r&&l.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),r()},className:"absolute top-4 cursor-pointer right-4 z-[10000] w-12 h-12 rounded-full bg-gray-900 bg-opacity-90 text-white flex items-center justify-center hover:bg-gray-800 transition-all duration-200 shadow-lg border border-gray-700 backdrop-blur-sm",title:"Exit Fullscreen",type:"button",children:l.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})})}),l.jsxs("div",{id:"voice-card",className:`${i.card} w-full h-full flex flex-col rounded-xl shadow-2xl`,style:{minHeight:"600px"},children:[l.jsx("div",{className:i.cardTopGradient}),l.jsx("div",{className:i.cardPurpleBlur}),l.jsx("div",{className:i.cardPinkBlur}),l.jsx("div",{className:" flex flex-col h-full",children:e}),l.jsx("div",{className:i.cardPulse1}),l.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})]})});if(n==="popup"){const a={"top-left":"top-4 left-4","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4"};return l.jsx("div",{className:"fixed rounded-2xl inset-0 z-[9999] pointer-events-none",children:l.jsxs("div",{className:`fixed rounded-2xl ${a[s]} pointer-events-auto`,children:[r&&l.jsx("button",{onClick:r,className:"absolute -top-2 -right-2 z-10 w-8 h-8 rounded-full bg-gray-900 bg-opacity-90 text-white flex items-center justify-center hover:bg-gray-800 transition-all duration-200 text-sm shadow-lg border border-gray-700",children:"×"}),l.jsxs("div",{id:"voice-card",className:`${i.card} rounded-2xl flex flex-col`,style:{width:"300px",height:"450px"},children:[l.jsx("div",{className:i.cardPurpleBlur}),l.jsx("div",{className:i.cardPinkBlur}),l.jsx("div",{className:" flex flex-col h-full",children:e}),l.jsx("div",{className:i.cardPulse1}),l.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})]})})}return l.jsxs("div",{id:"voice-card",className:`${i.card}`,style:{height:"100%",maxHeight:"100%"},children:[o&&l.jsx("button",{onClick:o,className:"absolute top-4 right-4 z-20 w-10 h-10 rounded-full bg-gray-900 bg-opacity-90 text-white flex items-center justify-center hover:bg-gray-800 transition-all duration-200 shadow-lg border border-gray-700 backdrop-blur-sm",title:"Enter Fullscreen",children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("path",{d:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"})})}),l.jsx("div",{className:i.cardTopGradient}),l.jsx("div",{className:i.cardPurpleBlur}),l.jsx("div",{className:i.cardPinkBlur}),e,l.jsx("div",{className:i.cardPulse1}),l.jsx("div",{className:i.cardPulse2,style:{animationDelay:"1s"}})]})}function xd(e){if(typeof window>"u")return null;console.log("🎯 Widget component rendering with props:",{displayType:e.displayType,popupPosition:e.popupPosition,theme:e.theme});const{agentId:t,participantName:n,baseUrl:r,appSecret:s,appId:o,prompts:i,statusMessage:a,welcomeTitle:c,welcomeSubTitle:d,className:u,width:f,height:h,loadingText:p,suportsChatInput:x=!0,suportsVideoInput:m=!0,suportsScreenShare:b=!0,theme:k="vox",onSessionStart:v,onSessionEnd:E,enableSessionLogging:w=!0,onSessionLogsUpdate:S,onSessionMetricsUpdate:A,modalities:M=["voice"],displayType:j="widget",popupPosition:z="bottom-right",popupTriggerText:y="Open Chat",onPopupToggle:D,voxketClient:_,onDisplayTypeChange:J}=e,[te,ee]=g.useState(()=>_?!!_.getCurrentSession():!1),[re,K]=g.useState(!1),[R,X]=g.useState(t||""),[V,H]=g.useState(n||"User"),[q,P]=g.useState(()=>_?_.getCurrentSession():null),[T,O]=g.useState(()=>{var ne,Ye,Ze;if(_){const we=_.getCurrentSession();if((ne=we==null?void 0:we.activeModalities)!=null&&ne.includes("chat"))return"chat";if((Ye=we==null?void 0:we.activeModalities)!=null&&Ye.includes("voice"))return"voice";if((Ze=we==null?void 0:we.activeModalities)!=null&&Ze.includes("video"))return"video"}return"welcome"}),[F,$]=g.useState(!1);g.useEffect(()=>{console.log("🎯 Widget displayType prop changed to:",j)},[j]),g.useEffect(()=>{console.log("📊 Session state changed:",{currentMode:T,sessionStarted:te,loading:re,currentSession:q==null?void 0:q.id,isPopupOpen:F})},[T,te,re,q,F]);const I=g.useMemo(()=>{if(_)return console.log("🔄 Using passed VoxketClient to preserve session state"),_;console.log("🆕 Creating new VoxketClient instance");const ne={appId:o,appSecret:s,baseUrl:r,agentId:R,participantName:V||"User",modalities:M};return new Vn(ne)},[_,o,s,r,R,V,M]),U=M,B=g.useMemo(()=>I.getRoom()||new Z.Room,[I]),oe={suportsChatInput:x,suportsVideoInput:m,suportsScreenShare:b},{sessionMetrics:L,sessionLogs:ae,logEvent:xe}=hd({room:B,onSessionStart:v,onSessionEnd:E,enableConsoleLogging:w,enableLocalStorage:w,voxketSessionId:q==null?void 0:q.id});g.useEffect(()=>{S&&S(ae)},[ae,S]),g.useEffect(()=>{A&&L&&A(L)},[L,A]),g.useEffect(()=>{const ne=Ze=>{console.log("🔴 Room disconnected:",Ze),K(!1),ee(!1),P(null),O("welcome")},Ye=Ze=>{console.log("📹 Media devices error:",Ze),$t({title:"Allow access to your microphone/camera",description:`${Ze.name}: ${Ze.message}`})};return B.on(Z.RoomEvent.MediaDevicesError,Ye),B.on(Z.RoomEvent.Disconnected,ne),()=>{B.off(Z.RoomEvent.Disconnected,ne),B.off(Z.RoomEvent.MediaDevicesError,Ye)}},[B]);const Ie=async()=>{try{console.log("🎤 Starting voice session...",{agentId:R,participantName:V}),console.log("🎤 Pre-start state:",{currentMode:T,sessionStarted:te,loading:re}),K(!0),ee(!0),O("voice"),console.log("🎤 State after mode change:",{currentMode:"voice",sessionStarted:!0,loading:!0}),xe("USER_STARTED_VOICE_SESSION",{agentId:R,participantName:V});const ne=await I.startSession(R,{participantName:V||"User",modalities:["voice",...m?["video"]:[]]});console.log("✅ Voice session started successfully:",ne.id),P(ne),K(!1),v&&v(ne.id)}catch(ne){console.error("❌ Failed to start voice session:",ne),$t({title:"Failed to start voice session",description:ne instanceof Error?ne.message:"Unknown error occurred"}),K(!1),ee(!1),O("welcome")}},Rn=async()=>{try{K(!0),ee(!0),O("chat"),xe("USER_STARTED_CHAT_SESSION",{agentId:R,participantName:V});const ne=await I.startSession(R,{participantName:V||"User",modalities:["chat"]});P(ne),K(!1),v&&v(ne.id)}catch(ne){console.error("Failed to start chat session:",ne),$t({title:"Failed to start chat session",description:ne instanceof Error?ne.message:"Unknown error occurred"}),K(!1),ee(!1),O("welcome")}},Id=async()=>{try{console.log("📺 Starting video session...",{agentId:R,participantName:V}),console.log("📺 Pre-start state:",{currentMode:T,sessionStarted:te,loading:re}),K(!0),ee(!0),O("video"),console.log("📺 State after mode change:",{currentMode:"video",sessionStarted:!0,loading:!0}),xe("USER_STARTED_VIDEO_SESSION",{agentId:R,participantName:V});const ne=await I.startSession(R,{participantName:V||"User",modalities:["video","voice"]});console.log("✅ Video session started successfully:",ne.id),P(ne),K(!1),v&&v(ne.id)}catch(ne){console.error("❌ Failed to start video session:",ne),$t({title:"Failed to start video session",description:ne instanceof Error?ne.message:"Unknown error occurred"}),K(!1),ee(!1),O("welcome")}},rn=()=>{O("welcome"),J&&J(e.displayType||"widget"),q&&te&&(ee(!1),P(null),I.disconnect()),j==="popup"&&!F&&$(!0)},sn=()=>{const ne=!F;$(ne),D&&D(ne),!ne&&!(q&&te)&&(O("welcome"),ee(!1),P(null))},Dd=()=>{console.log("🔄 Closing fullscreen, switching to widget display type"),e.onDisplayTypeChange?e.onDisplayTypeChange("widget"):console.warn("⚠️ No onDisplayTypeChange callback provided")},$d=()=>{if(console.log("🔄 Expand to fullscreen requested"),e.onDisplayTypeChange)e.onDisplayTypeChange("fullscreen");else{console.warn("⚠️ No onDisplayTypeChange callback provided for expand functionality");const ne=document.getElementById("voice-card")||document.querySelector(".voxket-widget-container");ne&&ne.requestFullscreen?ne.requestFullscreen().catch(Ye=>{console.warn("⚠️ Fullscreen API not supported or failed:",Ye),$t({title:"Expand functionality unavailable",description:"Please implement onDisplayTypeChange callback for expand functionality"})}):$t({title:"Expand functionality unavailable",description:"Please implement onDisplayTypeChange callback for expand functionality"})}};g.useEffect(()=>{var ne,Ye,Ze;if(_&&I){console.log("🔄 Syncing widget state with existing client session state");const we=I.getCurrentSession(),Fd=I.connected;console.log("🔍 Existing session state:",{hasSession:!!we,sessionId:we==null?void 0:we.id,isConnected:Fd,activeModalities:we==null?void 0:we.activeModalities}),we&&(console.log("✅ Restoring session state from existing client"),P(we),ee(!0),K(!1),(ne=we.activeModalities)!=null&&ne.includes("chat")?O("chat"):(Ye=we.activeModalities)!=null&&Ye.includes("voice")?O("voice"):(Ze=we.activeModalities)!=null&&Ze.includes("video")&&O("video"))}},[_,I]),g.useEffect(()=>()=>{console.log("🧹 Cleaning up widget component"),_?console.log("🔄 Widget cleanup: preserving passed client instance"):(console.log("🧹 Widget cleanup: disconnecting self-created client"),I.disconnect())},[I,_]);let Er="w-96",Tr="h-[25rem]",Ar={};if(f&&(f.startsWith("w-")?Er=f:(Ar.width=f,Er="")),h&&(h.startsWith("h-")?Tr=h:(Ar.height=h,Tr="")),j==="popup"&&!F)return console.log("🟡 Showing popup trigger button"),l.jsx(cx,{onClick:sn,text:y,position:z,theme:k});console.log("🟢 Rendering widget content, displayType:",j,"isPopupOpen:",F,"currentMode:",T,"sessionStarted:",te,"loading:",re);let jr=`voxket-widget-root theme-${k}`,In={scrollMargin:0,scrollPadding:0,contain:"layout style paint"};j==="widget"?(jr+=` flex items-center justify-center min-h-fit ${Er} ${Tr} ${u}`,In={...In,...Ar}):(jr=`${u||""}`,In={});const $o=l.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:l.jsxs(Ut,{mode:"wait",children:[T==="welcome"&&!re&&l.jsx(ax,{agentId:R,participantName:V||"",onAgentIdChange:X,onParticipantNameChange:H,onStartCall:Ie,onStartChat:Rn,onStartVideo:Id,disabled:te||re,prompts:i,statusMessage:a,title:c,subTitle:d,theme:k,modalities:U,initial:{opacity:0,y:0},animate:{opacity:1,y:0},exit:{opacity:0,y:40},transition:{duration:.3,ease:"easeInOut"}},"welcome"),T==="voice"&&l.jsxs(Ne.RoomContext.Provider,{value:B,children:[l.jsx(Ne.RoomAudioRenderer,{}),l.jsx(Ne.StartAudio,{label:"Start Audio"}),l.jsx(sx,{loadingText:p,participantName:V||"User",capabilities:oe,sessionStarted:te,disabled:!te,theme:k,client:I,displayType:j,onBack:j==="popup"?sn:rn,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"session-view")]}),T==="chat"&&l.jsx(ox,{client:I,theme:k,displayType:j,onBack:j==="popup"?sn:rn,onEndChat:rn,disabled:!te,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"chat-view"),T==="video"&&l.jsxs(Ne.RoomContext.Provider,{value:B,children:[l.jsx(Ne.RoomAudioRenderer,{}),l.jsx(Ne.StartAudio,{label:"Start Audio"}),l.jsx(ix,{client:I,theme:k,displayType:j,onBack:j==="popup"?sn:rn,onEndCall:rn,disabled:!te,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"video-view")]})]})});return j==="fullscreen"||j==="popup"?(console.log("📱 Rendering fullscreen/popup mode, displayType:",j),l.jsx(Wa,{theme:k,displayType:j,popupPosition:z,onClose:j==="fullscreen"?Dd:sn,children:$o})):(console.log("📦 Rendering widget mode"),l.jsx("div",{className:jr,style:In,children:l.jsx(Wa,{theme:k,displayType:j,popupPosition:z,onExpand:$d,children:$o})}))}class bd extends g.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("VoxketWidget Error:",t,n)}render(){if(this.state.hasError){if(this.props.fallback){const t=this.props.fallback;return g.createElement(t,{error:this.state.error})}return g.createElement("div",{style:{padding:"20px",border:"1px solid #ff4444",borderRadius:"8px",background:"#fff5f5",color:"#cc0000"}},"VoxketWidget encountered an error. Please check the console for details.")}return this.props.children}}function lx({logs:e,onClear:t,onExport:n}){const[r,s]=C.useState(!1),[o,i]=C.useState(""),a=e.filter(c=>!o||c.event.toLowerCase().includes(o.toLowerCase()));return r?l.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:l.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-4xl w-full max-h-[80vh] flex flex-col m-4",children:[l.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[l.jsxs("h2",{className:"text-lg font-semibold",children:["Session Logs (",e.length,")"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",placeholder:"Filter events...",value:o,onChange:c=>i(c.target.value),className:"px-3 py-1 border rounded text-sm"}),l.jsx("button",{onClick:t,className:"px-3 py-1 bg-red-600 text-white rounded text-sm hover:bg-red-700",children:"Clear"}),l.jsx("button",{onClick:n,className:"px-3 py-1 bg-green-600 text-white rounded text-sm hover:bg-green-700",children:"Export"}),l.jsx("button",{onClick:()=>s(!1),className:"px-3 py-1 bg-gray-600 text-white rounded text-sm hover:bg-gray-700",children:"Close"})]})]}),l.jsx("div",{className:"flex-1 overflow-auto p-4",children:a.length===0?l.jsx("p",{className:"text-gray-500 text-center py-8",children:"No logs found"}):l.jsx("div",{className:"space-y-2",children:a.map((c,d)=>l.jsxs("div",{className:"border rounded p-3 text-sm",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx("span",{className:"font-semibold text-blue-600",children:c.event}),l.jsx("span",{className:"text-gray-500 text-xs",children:new Date(c.timestamp).toLocaleTimeString()})]}),c.sessionId&&l.jsxs("div",{className:"text-xs text-gray-600 mb-1",children:["Session: ",c.sessionId]}),c.data&&l.jsx("div",{className:"bg-gray-50 p-2 rounded text-xs",children:l.jsx("pre",{className:"whitespace-pre-wrap overflow-auto",children:JSON.stringify(c.data,null,2)})})]},d))})})]})}):l.jsxs("button",{onClick:()=>s(!0),className:"fixed bottom-4 right-4 bg-blue-600 text-white px-4 py-2 rounded-lg shadow-lg hover:bg-blue-700 transition-colors text-sm z-50",children:["Session Logs (",e.length,")"]})}function dx({metrics:e}){return e?l.jsxs("div",{className:"bg-gray-100 p-4 rounded-lg",children:[l.jsx("h3",{className:"font-semibold mb-2",children:"Current Session"}),l.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Session ID:"}),l.jsx("div",{className:"font-mono text-xs",children:e.sessionId})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Start Time:"}),l.jsx("div",{children:new Date(e.startTime).toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Messages:"}),l.jsx("div",{children:e.totalMessages})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Participants:"}),l.jsx("div",{children:e.participantCount})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Connection Issues:"}),l.jsx("div",{children:e.connectionIssues})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-600",children:"Duration:"}),l.jsxs("div",{children:[Math.round((Date.now()-new Date(e.startTime).getTime())/1e3),"s"]})]})]})]}):null}function jt(){const{currentSession:e,sessionState:t,sessionMetrics:n,createSession:r,endSession:s}=Qe(),o=C.useCallback(async(a,c)=>await r(a,c),[r]),i=C.useCallback(async()=>await s(),[s]);return{session:e,state:t,metrics:n,isActive:e!==null&&t!=="disconnected",isConnecting:t==="connecting",isConnected:t==="connected"||t==="active",start:o,stop:i}}function vd(){const{sessionMetrics:e,currentSession:t}=Qe();return{metrics:e,sessionId:t==null?void 0:t.id,duration:e==null?void 0:e.duration,participantCount:e==null?void 0:e.participantCount,messageCount:e==null?void 0:e.messageCount,audioQuality:e==null?void 0:e.audioQuality,networkStats:e==null?void 0:e.networkStats}}function wd(){const{setMicrophoneEnabled:e,client:t}=Qe(),[n,r]=C.useState(!1),[s,o]=C.useState(!1),i=C.useCallback(async()=>{if(!s){o(!0);try{const d=!n;await e(d),r(d)}catch(d){console.error("Failed to toggle microphone:",d)}finally{o(!1)}}},[n,s,e]),a=C.useCallback(async()=>{if(!(n||s)){o(!0);try{await e(!0),r(!0)}catch(d){console.error("Failed to enable microphone:",d)}finally{o(!1)}}},[n,s,e]),c=C.useCallback(async()=>{if(!(!n||s)){o(!0);try{await e(!1),r(!1)}catch(d){console.error("Failed to disable microphone:",d)}finally{o(!1)}}},[n,s,e]);return{isEnabled:n,isLoading:s,toggle:i,enable:a,disable:c}}function Sd(){const{setCameraEnabled:e}=Qe(),[t,n]=C.useState(!1),[r,s]=C.useState(!1),o=C.useCallback(async()=>{if(!r){s(!0);try{const c=!t;await e(c),n(c)}catch(c){console.error("Failed to toggle camera:",c)}finally{s(!1)}}},[t,r,e]),i=C.useCallback(async()=>{if(!(t||r)){s(!0);try{await e(!0),n(!0)}catch(c){console.error("Failed to enable camera:",c)}finally{s(!1)}}},[t,r,e]),a=C.useCallback(async()=>{if(!(!t||r)){s(!0);try{await e(!1),n(!1)}catch(c){console.error("Failed to disable camera:",c)}finally{s(!1)}}},[t,r,e]);return{isEnabled:t,isLoading:r,toggle:o,enable:i,disable:a}}function Cd(){const{startScreenShare:e,stopScreenShare:t}=Qe(),[n,r]=C.useState(!1),[s,o]=C.useState(!1),i=C.useCallback(async()=>{if(!(n||s)){o(!0);try{await e(),r(!0)}catch(d){console.error("Failed to start screen share:",d)}finally{o(!1)}}},[n,s,e]),a=C.useCallback(async()=>{if(!(!n||s)){o(!0);try{await t(),r(!1)}catch(d){console.error("Failed to stop screen share:",d)}finally{o(!1)}}},[n,s,t]),c=C.useCallback(async()=>{n?await a():await i()},[n,i,a]);return{isSharing:n,isLoading:s,start:i,stop:a,toggle:c}}function ux(){const{client:e}=Qe(),[t,n]=C.useState({tracks:[],layout:{type:"grid",showLocalVideo:!0,aspectRatio:"16:9"},isRecording:!1}),r=C.useMemo(()=>t.tracks.find(m=>m.isLocal),[t.tracks]),s=C.useMemo(()=>t.tracks.filter(m=>!m.isLocal),[t.tracks]),o=C.useCallback(async()=>{try{r!=null&&r.isEnabled?await(e==null?void 0:e.disableCamera()):await(e==null?void 0:e.enableCamera())}catch(m){throw console.error("Failed to toggle camera:",m),m}},[e,r]),i=C.useCallback(async()=>{try{t.tracks.find(b=>b.isScreenShare)?await(e==null?void 0:e.stopScreenShare()):await(e==null?void 0:e.startScreenShare())}catch(m){throw console.error("Failed to toggle screen share:",m),m}},[e,t.tracks]),a=C.useCallback(m=>{n(b=>({...b,layout:m}))},[]),c=C.useCallback(m=>{n(b=>({...b,pinnedTrack:m}))},[]),d=C.useCallback(()=>{n(m=>({...m,pinnedTrack:void 0}))},[]),u=C.useCallback(async()=>{try{await(e==null?void 0:e.startRecording()),n(m=>({...m,isRecording:!0}))}catch(m){throw console.error("Failed to start recording:",m),m}},[e]),f=C.useCallback(async()=>{try{await(e==null?void 0:e.stopRecording()),n(m=>({...m,isRecording:!1}))}catch(m){throw console.error("Failed to stop recording:",m),m}},[e]),h=C.useCallback(m=>t.tracks.find(b=>b.id===m),[t.tracks]),p=C.useCallback(m=>t.tracks.filter(b=>b.participantId===m),[t.tracks]),x=C.useCallback(m=>m.isEnabled&&t.tracks.includes(m),[t.tracks]);return C.useEffect(()=>{if(!e)return;const m=v=>{n(E=>({...E,tracks:[...E.tracks.filter(w=>w.id!==v.id),v]}))},b=v=>{n(E=>{var w;return{...E,tracks:E.tracks.filter(S=>S.id!==v),pinnedTrack:((w=E.pinnedTrack)==null?void 0:w.id)===v?void 0:E.pinnedTrack}})},k=v=>{n(E=>({...E,tracks:E.tracks.map(w=>w.id===v.id?v:w)}))};return e.on("videoTrackAdded",m),e.on("videoTrackRemoved",b),e.on("videoTrackUpdated",k),()=>{e.off("videoTrackAdded",m),e.off("videoTrackRemoved",b),e.off("videoTrackUpdated",k)}},[e]),{tracks:t.tracks,localTrack:r,remoteTraracks:s,pinnedTrack:t.pinnedTrack,layout:t.layout,isRecording:t.isRecording,toggleCamera:o,toggleScreenShare:i,setLayout:a,pinTrack:c,unpinTrack:d,startRecording:u,stopRecording:f,getTrackById:h,getTracksByParticipant:p,isTrackActive:x}}function kr(){const{chatMessages:e,sendChatMessage:t,currentSession:n}=Qe(),[r,s]=C.useState(!1),o=C.useCallback(async d=>{if(!(!d.trim()||r||!n)){s(!0);try{await t(d.trim())}catch(u){throw console.error("Failed to send chat message:",u),u}finally{s(!1)}}},[t,r,n]),{userMessages:i,agentMessages:a,allMessages:c}=C.useMemo(()=>{const d=e.filter(f=>f.sender.type==="participant"),u=e.filter(f=>f.sender.type==="agent");return{userMessages:d,agentMessages:u,allMessages:e}},[e]);return{messages:c,userMessages:i,agentMessages:a,messageCount:c.length,isSending:r,canSend:!!n&&!r,send:o}}function fx(){const{send:e,isSending:t,canSend:n}=kr(),[r,s]=C.useState(""),o=C.useCallback(async()=>{if(!(!r.trim()||!n))try{await e(r),s("")}catch(a){throw a}},[r,e,n]),i=C.useCallback(a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),o())},[o]);return{value:r,setValue:s,send:o,handleKeyPress:i,isSending:t,canSend:n&&r.trim().length>0}}function No(){const{isConnected:e,isConnecting:t,connectionError:n,connect:r,disconnect:s}=Qe(),o=C.useCallback(async()=>{if(!(e||t))try{await r()}catch(a){throw console.error("Failed to connect:",a),a}},[r,e,t]),i=C.useCallback(async()=>{if(e)try{await s()}catch(a){throw console.error("Failed to disconnect:",a),a}},[s,e]);return{isConnected:e,isConnecting:t,isDisconnected:!e&&!t,error:n,hasError:!!n,connect:o,disconnect:i}}function kd(){const{participants:e}=Qe();return{participants:e,count:e.length,localParticipant:e.find(t=>t.isLocal),remoteParticipants:e.filter(t=>!t.isLocal)}}const Ed=C.createContext({}),Nn=()=>C.useContext(Ed);function Td({children:e,...t}){return l.jsx(Ed.Provider,{value:t,children:e})}function Jn({name:e,children:t,fallback:n,className:r}){return l.jsx("div",{className:`voxket-slot voxket-slot--${e} ${r||""}`,children:t||n})}function Ad(e,t={}){return Object.assign(e,t)}function jd({showMicrophoneControl:e=!0,showCameraControl:t=!0,showScreenShareControl:n=!0,showSessionActions:r=!0,customControls:s,className:o=""}){const i=jt(),a=wd(),c=Sd(),d=Cd(),u=Nn(),f=["voxket-session-controls",`voxket-session-controls--${u.variant||"default"}`,`voxket-session-controls--${u.size||"md"}`,i.isActive?"voxket-session-controls--active":"voxket-session-controls--inactive",o].filter(Boolean).join(" ");return!i.isActive&&!r?l.jsx("div",{className:f,children:l.jsx("div",{className:"voxket-controls-inactive",children:l.jsx("p",{children:"Controls available during active session"})})}):l.jsxs("div",{className:f,children:[r&&l.jsx("div",{className:"voxket-session-actions",children:i.isActive?l.jsx("button",{onClick:i.stop,className:"voxket-button voxket-button--danger",children:"End Session"}):l.jsx(hx,{})}),i.isActive&&l.jsxs("div",{className:"voxket-media-controls",children:[e&&l.jsxs("button",{onClick:a.toggle,disabled:a.isLoading,className:`voxket-button voxket-button--media ${a.isEnabled?"voxket-button--active":""}`,title:a.isEnabled?"Mute microphone":"Unmute microphone",children:[l.jsx("span",{className:"voxket-icon",children:"🎤"}),a.isLoading?"Loading...":a.isEnabled?"Mute":"Unmute"]}),t&&l.jsxs("button",{onClick:c.toggle,disabled:c.isLoading,className:`voxket-button voxket-button--media ${c.isEnabled?"voxket-button--active":""}`,title:c.isEnabled?"Stop camera":"Start camera",children:[l.jsx("span",{className:"voxket-icon",children:"📹"}),c.isLoading?"Loading...":c.isEnabled?"Stop Video":"Start Video"]}),n&&l.jsxs("button",{onClick:d.toggle,disabled:d.isLoading,className:`voxket-button voxket-button--media ${d.isSharing?"voxket-button--active":""}`,title:d.isSharing?"Stop screen share":"Start screen share",children:[l.jsx("span",{className:"voxket-icon",children:"🖥️"}),d.isLoading?"Loading...":d.isSharing?"Stop Share":"Share Screen"]})]}),s&&l.jsx("div",{className:"voxket-custom-controls",children:s})]})}function hx(){jt();const[e,t]=C.useState(!1),n=async()=>{t(!0);try{console.log("Start session - agentId needed")}catch(r){console.error("Failed to start session:",r)}finally{t(!1)}};return l.jsx("button",{onClick:n,disabled:e,className:"voxket-button voxket-button--primary",children:e?"Starting...":"Start Session"})}function Ro({showConnectionStatus:e=!0,showSessionInfo:t=!0,showAgentInfo:n=!0,className:r=""}){const s=jt(),o=No(),i=Nn(),a=["voxket-session-header",`voxket-session-header--${i.variant||"default"}`,`voxket-session-header--${i.size||"md"}`,r].filter(Boolean).join(" ");return l.jsxs("div",{className:a,children:[e&&l.jsxs("div",{className:"voxket-connection-status",children:[l.jsx("div",{className:`voxket-status-indicator ${o.isConnected?"connected":"disconnected"}`}),l.jsx("span",{className:"voxket-status-text",children:o.isConnecting?"Connecting...":o.isConnected?"Connected":"Disconnected"})]}),t&&s.session&&l.jsxs("div",{className:"voxket-session-info",children:[l.jsxs("div",{className:"voxket-session-id",children:["Session: ",s.session.id.slice(-8)]}),l.jsxs("div",{className:"voxket-session-state",children:["State: ",s.state]})]}),n&&s.session&&l.jsxs("div",{className:"voxket-agent-info",children:[l.jsxs("div",{className:"voxket-agent-id",children:["Agent: ",s.session.agentId]}),l.jsxs("div",{className:"voxket-modalities",children:["Modalities: ",s.session.activeModalities.join(", ")]})]}),o.error&&l.jsxs("div",{className:"voxket-error-message",children:["Error: ",o.error.message]})]})}function Io({showChat:e=!0,showTranscriptions:t=!1,customContent:n,className:r=""}){const s=jt(),o=kr(),i=Nn(),a=["voxket-session-content",`voxket-session-content--${i.variant||"default"}`,`voxket-session-content--${i.size||"md"}`,r].filter(Boolean).join(" ");return s.isActive?l.jsx("div",{className:a,children:n||l.jsxs(l.Fragment,{children:[e&&l.jsxs("div",{className:"voxket-chat-container",children:[l.jsxs("div",{className:"voxket-chat-messages",children:[o.messages.map(c=>l.jsxs("div",{className:`voxket-message voxket-message--${c.sender.type}`,children:[l.jsxs("div",{className:"voxket-message-header",children:[l.jsx("span",{className:"voxket-message-sender",children:c.sender.name}),l.jsx("span",{className:"voxket-message-time",children:c.timestamp.toLocaleTimeString()})]}),l.jsx("div",{className:"voxket-message-content",children:c.content})]},c.id)),o.messages.length===0&&l.jsx("div",{className:"voxket-empty-messages",children:l.jsx("p",{children:"No messages yet. Start the conversation!"})})]}),l.jsx(mx,{})]}),t&&l.jsx("div",{className:"voxket-transcriptions",children:l.jsx("div",{className:"voxket-transcription-placeholder",children:l.jsx("p",{children:"Voice transcriptions will appear here"})})})]})}):l.jsx("div",{className:a,children:l.jsx("div",{className:"voxket-inactive-state",children:l.jsxs("div",{className:"voxket-inactive-message",children:[l.jsx("h3",{children:"Start a conversation"}),l.jsx("p",{children:"Begin a session to start chatting with the AI agent"})]})})})}function mx(){const e=kr(),[t,n]=C.useState(""),r=async()=>{if(!(!t.trim()||!e.canSend))try{await e.send(t),n("")}catch(o){console.error("Failed to send message:",o)}},s=o=>{o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),r())};return l.jsxs("div",{className:"voxket-chat-input",children:[l.jsx("input",{type:"text",value:t,onChange:o=>n(o.target.value),onKeyPress:s,placeholder:"Type your message...",disabled:!e.canSend,className:"voxket-input"}),l.jsx("button",{onClick:r,disabled:!e.canSend||!t.trim(),className:"voxket-send-button",children:e.isSending?"Sending...":"Send"})]})}function Do({showMetrics:e=!0,showParticipants:t=!0,showStatus:n=!0,customFooter:r,className:s=""}){const o=jt(),i=vd(),a=kd(),c=Nn(),d=["voxket-session-footer",`voxket-session-footer--${c.variant||"default"}`,`voxket-session-footer--${c.size||"md"}`,s].filter(Boolean).join(" ");return o.isActive?l.jsx("div",{className:d,children:r||l.jsxs(l.Fragment,{children:[n&&l.jsxs("div",{className:"voxket-session-status",children:[l.jsx("div",{className:"voxket-status-indicator voxket-status-indicator--active"}),l.jsx("span",{className:"voxket-status-text",children:"Session Active"})]}),e&&i.metrics&&l.jsxs("div",{className:"voxket-session-metrics",children:[l.jsxs("div",{className:"voxket-metric",children:[l.jsx("span",{className:"voxket-metric-label",children:"Duration:"}),l.jsx("span",{className:"voxket-metric-value",children:gx(i.duration||0)})]}),l.jsxs("div",{className:"voxket-metric",children:[l.jsx("span",{className:"voxket-metric-label",children:"Messages:"}),l.jsx("span",{className:"voxket-metric-value",children:i.metrics.messageCount})]})]}),t&&l.jsxs("div",{className:"voxket-participants-info",children:[l.jsxs("span",{className:"voxket-participants-count",children:[a.count," participant",a.count!==1?"s":""]}),a.remoteParticipants.length>0&&l.jsx("div",{className:"voxket-participant-list",children:a.remoteParticipants.map(u=>l.jsx("span",{className:"voxket-participant-name",children:u.name},u.id))})]})]})}):l.jsx("div",{className:d,children:l.jsx("div",{className:"voxket-footer-inactive",children:l.jsx("span",{className:"voxket-status-text",children:"Ready to start session"})})})}function gx(e){const t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60);return r>0?`${r}:${(n%60).toString().padStart(2,"0")}:${(t%60).toString().padStart(2,"0")}`:`${n}:${(t%60).toString().padStart(2,"0")}`}function px({agentId:e,sessionConfig:t,autoStart:n=!1,onSessionStart:r,onSessionEnd:s,variant:o="default",size:i="md",theme:a,className:c="",children:d}){var p;const u=jt(),f=No();C.useEffect(()=>{n&&e&&f.isConnected&&!u.isActive&&u.start(e,t).catch(console.error)},[n,e,f.isConnected,u.isActive]),C.useEffect(()=>{var x;(x=u.session)!=null&&x.id&&r&&r(u.session.id)},[(p=u.session)==null?void 0:p.id,r]),C.useEffect(()=>()=>{u.isActive&&s&&u.stop().then(s).catch(console.error)},[]);const h=["voxket-session",`voxket-session--${o}`,`voxket-session--${i}`,u.isActive?"voxket-session--active":"voxket-session--inactive",c].filter(Boolean).join(" ");return l.jsx(Td,{variant:o,size:i,theme:a,className:c,children:l.jsx("div",{className:h,children:d||l.jsxs(l.Fragment,{children:[l.jsx(Jn,{name:"header",fallback:l.jsx(Ro,{})}),l.jsx(Jn,{name:"content",fallback:l.jsx(Io,{})}),l.jsx(Jn,{name:"footer",fallback:l.jsx(Do,{})})]})})})}const Md=Ad(px,{Header:Ro,Content:Io,Footer:Do,Controls:jd}),Tt={name:"default",colors:{primary:"#3B82F6",secondary:"#6B7280",accent:"#8B5CF6",background:"#FFFFFF",surface:"#F9FAFB",text:{primary:"#111827",secondary:"#6B7280",muted:"#9CA3AF",inverse:"#FFFFFF"},status:{success:"#10B981",warning:"#F59E0B",error:"#EF4444",info:"#3B82F6"},border:"#E5E7EB",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1)"},typography:{fontFamily:"system-ui, -apple-system, sans-serif",fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},fontWeight:{normal:400,medium:500,semibold:600,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem"},borderRadius:{none:"0",sm:"0.25rem",md:"0.5rem",lg:"0.75rem",full:"9999px"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1)"}},Rs={...Tt,name:"dark",colors:{primary:"#60A5FA",secondary:"#9CA3AF",accent:"#A78BFA",background:"#111827",surface:"#1F2937",text:{primary:"#F9FAFB",secondary:"#D1D5DB",muted:"#9CA3AF",inverse:"#111827"},status:{success:"#34D399",warning:"#FBBF24",error:"#F87171",info:"#60A5FA"},border:"#374151",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.3)"}},Is={...Tt,name:"enterprise",colors:{primary:"#1E40AF",secondary:"#64748B",accent:"#7C3AED",background:"#FFFFFF",surface:"#F8FAFC",text:{primary:"#0F172A",secondary:"#475569",muted:"#94A3B8",inverse:"#FFFFFF"},status:{success:"#059669",warning:"#D97706",error:"#DC2626",info:"#1E40AF"},border:"#CBD5E1",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1)"},borderRadius:{none:"0",sm:"0.125rem",md:"0.25rem",lg:"0.375rem",full:"9999px"}},Pd=C.createContext(null),Vd=()=>{const e=C.useContext(Pd);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e};function yx({theme:e="default",themes:t={},children:n,cssVariables:r=!0,className:s=""}){const[o,i]=C.useState(()=>{const h={default:Tt,dark:Rs,enterprise:Is,...t};return typeof e=="string"?h[e]||Tt:e}),[a,c]=C.useState(()=>({default:Tt,dark:Rs,enterprise:Is,...t})),d=h=>{if(typeof h=="string"){const p=a[h];p&&i(p)}else i(h)},u=h=>{c(p=>({...p,[h.name]:h}))};C.useEffect(()=>{if(r&&typeof document<"u"){const h=document.documentElement;Object.entries(Nd(o)).forEach(([p,x])=>{h.style.setProperty(`--voxket-${p}`,x)})}},[o,r]);const f={theme:o,setTheme:d,themes:a,registerTheme:u};return l.jsx(Pd.Provider,{value:f,children:l.jsx("div",{className:`voxket-theme voxket-theme--${o.name} ${s}`,children:n})})}function Nd(e){const t={},n=(r,s="")=>{for(const[o,i]of Object.entries(r)){const a=s?`${s}-${o}`:o;typeof i=="object"&&i!==null&&!Array.isArray(i)?n(i,a):t[a]=String(i)}};return n(e),t}function xx(e=Tt,t){return{...e,...t,colors:{...e.colors,...t.colors},typography:{...e.typography,...t.typography},spacing:{...e.spacing,...t.spacing},borderRadius:{...e.borderRadius,...t.borderRadius},shadows:{...e.shadows,...t.shadows}}}function bx(e){var n;const{theme:t}=Vd();return((n=t.components)==null?void 0:n[e])||{}}const vx=Vo("voice-modality","voice",{onActivate:async e=>{const t=e.config;t.enableTranscription&&wx(e),t.enableVoiceActivation&&Sx(e,t),console.log("Voice modality activated",t)},onDeactivate:async e=>{console.log("Voice modality deactivated")},onMessage:async(e,t)=>{t.type==="audio"&&Cx(e,t)}});function wx(e,t){e.on("participant.speaking.started",n=>{console.log("Transcription: Started for",n.name)}),e.on("participant.speaking.stopped",n=>{console.log("Transcription: Stopped for",n.name)})}function Sx(e,t){const n=t.silenceThreshold||-50;console.log("Voice activation setup with threshold:",n)}function Cx(e,t){console.log("Playing audio response:",t.content)}const kx=Vo("chat-modality","chat",{onActivate:async e=>{const t=e.config;t.enableRichText&&Ex(),t.enableFileUpload&&Tx(e),t.enableCustomComponents&&Ax(),console.log("Chat modality activated",t)},onDeactivate:async e=>{console.log("Chat modality deactivated")},onMessage:async(e,t)=>{const n=e.config;t.type==="ui_component"?jx(e,t):t.type==="text"&&n.enableRichText&&Mx(e,t)}});function Ex(e){console.log("Rich text support enabled")}function Tx(e){console.log("File upload enabled"),e.on("chat.file.uploaded",t=>{console.log("File uploaded:",t.name)})}function Ax(e){console.log("Custom components enabled");const t=new Map;t.set("quick-actions",Px),t.set("form",Vx),t.set("card",Nx),t.set("chart",Rx)}function jx(e,t){const{componentType:n,props:r}=t.metadata;console.log("Rendering custom component:",n,r),e.emit("chat.component.render",{type:n,props:r,timestamp:new Date})}function Mx(e,t){console.log("Processing rich text message:",t.content)}function Px(e){return{type:"quick-actions",actions:e.actions||[],layout:e.layout||"horizontal"}}function Vx(e){return{type:"form",fields:e.fields||[],submitAction:e.submitAction,validation:e.validation}}function Nx(e){return{type:"card",title:e.title,content:e.content,actions:e.actions,variant:e.variant||"default"}}function Rx(e){return{type:"chart",chartType:e.chartType||"line",data:e.data,options:e.options}}function Qn({track:e,participantName:t,showControls:n=!0,showName:r=!0,showMuteIndicator:s=!0,isPinned:o=!1,className:i="",onClick:a,onPin:c,onUnpin:d}){const u=C.useRef(null),[f,h]=C.useState(!1);C.useEffect(()=>{if(!u.current||!e.isEnabled)return;const b=u.current;return b.srcObject=null,()=>{b.srcObject&&(b.srcObject=null)}},[e]);const p=()=>{a==null||a(e)},x=b=>{b.stopPropagation(),o?d==null||d(e):c==null||c(e)},m=["voxket-video-tile",e.isLocal?"voxket-video-tile--local":"voxket-video-tile--remote",e.isScreenShare?"voxket-video-tile--screen-share":"voxket-video-tile--camera",o?"voxket-video-tile--pinned":"",e.isEnabled?"":"voxket-video-tile--disabled",f?"voxket-video-tile--hovered":"",i].filter(Boolean).join(" ");return l.jsxs("div",{className:m,onClick:p,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{aspectRatio:e.dimensions?`${e.dimensions.width} / ${e.dimensions.height}`:"16 / 9"},children:[l.jsx("video",{ref:u,className:"voxket-video-element",autoPlay:!0,playsInline:!0,muted:e.isLocal}),!e.isEnabled&&l.jsxs("div",{className:"voxket-video-placeholder",children:[l.jsx("div",{className:"voxket-video-placeholder-icon",children:e.isScreenShare?"🖥️":"📹"}),l.jsx("p",{className:"voxket-video-placeholder-text",children:e.isScreenShare?"Screen sharing paused":"Camera off"})]}),l.jsxs("div",{className:"voxket-video-overlay",children:[r&&t&&l.jsxs("div",{className:"voxket-video-name",children:[t,e.isLocal&&" (You)"]}),s&&!e.isEnabled&&l.jsx("div",{className:"voxket-video-mute-indicator",children:"🔇"}),n&&(f||o)&&l.jsxs("div",{className:"voxket-video-controls",children:[l.jsx("button",{className:`voxket-video-control-btn ${o?"voxket-video-control-btn--active":""}`,onClick:x,title:o?"Unpin video":"Pin video",children:"📌"}),e.isScreenShare&&l.jsx("div",{className:"voxket-video-indicator",children:"🖥️"}),e.source&&l.jsx("div",{className:"voxket-video-source",children:e.source})]})]}),!e.isEnabled&&l.jsx("div",{className:"voxket-video-loading",children:l.jsx("div",{className:"voxket-spinner"})})]})}function Ix({tracks:e,layout:t,className:n="",onLayoutChange:r,onTrackClick:s,maxVisibleTracks:o=9,showPagination:i=!0}){const[a,c]=C.useState(0),[d,u]=C.useState(null),f=C.useMemo(()=>{let v=[...e];t.type==="speaker"&&d&&(v=[d,...e.filter(S=>S.id!==d.id)]);const E=a*o,w=E+o;return v.slice(E,w)},[e,t,d,a,o]),h=Math.ceil(e.length/o),p=C.useMemo(()=>{const v=f.length;switch(t.type){case"grid":const E=Math.ceil(Math.sqrt(v)),w=Math.ceil(v/E);return{display:"grid",gridTemplateColumns:`repeat(${E}, 1fr)`,gridTemplateRows:`repeat(${w}, 1fr)`,gap:"8px"};case"speaker":return{display:"flex",flexDirection:"column",gap:"8px"};case"sidebar":return{display:"flex",gap:"8px"};case"gallery":return{display:"flex",flexWrap:"wrap",gap:"8px",justifyContent:"center"};default:return{}}},[t.type,f.length]),x=v=>{u(v)},m=()=>{u(null)},b=v=>{r==null||r({...t,type:v})},k=["voxket-video-grid",`voxket-video-grid--${t.type}`,`voxket-video-grid--${f.length}-tracks`,n].filter(Boolean).join(" ");return e.length===0?l.jsx("div",{className:"voxket-video-grid-empty",children:l.jsxs("div",{className:"voxket-video-grid-empty-content",children:[l.jsx("div",{className:"voxket-video-grid-empty-icon",children:"📹"}),l.jsx("p",{children:"No video tracks available"})]})}):l.jsxs("div",{className:k,children:[l.jsxs("div",{className:"voxket-video-grid-controls",children:[l.jsx("div",{className:"voxket-video-layout-controls",children:["grid","speaker","sidebar","gallery"].map(v=>l.jsx("button",{className:`voxket-layout-btn ${t.type===v?"voxket-layout-btn--active":""}`,onClick:()=>b(v),title:`Switch to ${v} layout`,children:Dx(v)},v))}),l.jsxs("div",{className:"voxket-video-count",children:[e.length," participant",e.length!==1?"s":""]})]}),l.jsx("div",{className:"voxket-video-grid-content",style:p,children:t.type==="speaker"&&d?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"voxket-video-speaker-main",children:l.jsx(Qn,{track:d,participantName:`Participant ${d.participantId}`,isPinned:!0,onClick:s,onUnpin:m})}),l.jsx("div",{className:"voxket-video-speaker-sidebar",children:f.filter(v=>v.id!==d.id).map(v=>l.jsx(Qn,{track:v,participantName:`Participant ${v.participantId}`,showControls:!1,onClick:s,onPin:x},v.id))})]}):f.map(v=>l.jsx(Qn,{track:v,participantName:`Participant ${v.participantId}`,isPinned:(d==null?void 0:d.id)===v.id,onClick:s,onPin:x,onUnpin:m},v.id))}),i&&h>1&&l.jsxs("div",{className:"voxket-video-pagination",children:[l.jsx("button",{className:"voxket-pagination-btn",onClick:()=>c(Math.max(0,a-1)),disabled:a===0,children:"←"}),l.jsxs("span",{className:"voxket-pagination-info",children:["Page ",a+1," of ",h]}),l.jsx("button",{className:"voxket-pagination-btn",onClick:()=>c(Math.min(h-1,a+1)),disabled:a===h-1,children:"→"})]})]})}function Dx(e){switch(e){case"grid":return"⊞";case"speaker":return"🎤";case"sidebar":return"⫸";case"gallery":return"⊡";case"picture-in-picture":return"⧉";default:return"⊞"}}function $x({localTrack:e,onToggleCamera:t,onToggleScreenShare:n,onLayoutChange:r,showLayoutControls:s=!0,showCameraControls:o=!0,showScreenShareControls:i=!0,className:a=""}){const c=["voxket-video-controls",a].filter(Boolean).join(" "),d=u=>{r==null||r({type:u,showLocalVideo:!0,aspectRatio:"16:9"})};return l.jsxs("div",{className:c,children:[o&&l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Camera"}),l.jsxs("button",{className:`voxket-control-btn ${e!=null&&e.isEnabled?"voxket-control-btn--active":""}`,onClick:t,title:e!=null&&e.isEnabled?"Turn off camera":"Turn on camera",children:[l.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isEnabled?"📹":"📷"}),l.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isEnabled?"Camera On":"Camera Off"})]}),(e==null?void 0:e.dimensions)&&l.jsxs("div",{className:"voxket-video-info",children:[e.dimensions.width," × ",e.dimensions.height]})]}),i&&l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Screen Share"}),l.jsxs("button",{className:`voxket-control-btn ${e!=null&&e.isScreenShare?"voxket-control-btn--active":""}`,onClick:n,title:e!=null&&e.isScreenShare?"Stop screen sharing":"Start screen sharing",children:[l.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isScreenShare?"🛑":"🖥️"}),l.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isScreenShare?"Stop Sharing":"Share Screen"})]})]}),s&&l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Layout"}),l.jsx("div",{className:"voxket-layout-buttons",children:[{type:"grid",icon:"⊞",label:"Grid"},{type:"speaker",icon:"🎤",label:"Speaker"},{type:"sidebar",icon:"⫸",label:"Sidebar"},{type:"gallery",icon:"⊡",label:"Gallery"}].map(({type:u,icon:f,label:h})=>l.jsxs("button",{className:"voxket-layout-control-btn",onClick:()=>d(u),title:`Switch to ${h} layout`,children:[l.jsx("span",{className:"voxket-control-icon",children:f}),l.jsx("span",{className:"voxket-control-label",children:h})]},u))})]}),l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Video Settings"}),l.jsxs("div",{className:"voxket-video-settings",children:[l.jsxs("div",{className:"voxket-setting-group",children:[l.jsx("label",{className:"voxket-setting-label",children:"Quality"}),l.jsxs("select",{className:"voxket-setting-select",children:[l.jsx("option",{value:"high",children:"High (720p)"}),l.jsx("option",{value:"medium",children:"Medium (480p)"}),l.jsx("option",{value:"low",children:"Low (240p)"})]})]}),l.jsxs("div",{className:"voxket-setting-group",children:[l.jsx("label",{className:"voxket-setting-label",children:"Frame Rate"}),l.jsxs("select",{className:"voxket-setting-select",children:[l.jsx("option",{value:"30",children:"30 fps"}),l.jsx("option",{value:"15",children:"15 fps"}),l.jsx("option",{value:"10",children:"10 fps"})]})]}),l.jsxs("div",{className:"voxket-setting-group",children:[l.jsx("label",{className:"voxket-setting-label",children:"Bandwidth"}),l.jsxs("select",{className:"voxket-setting-select",children:[l.jsx("option",{value:"unlimited",children:"Unlimited"}),l.jsx("option",{value:"1000",children:"1 Mbps"}),l.jsx("option",{value:"500",children:"500 Kbps"}),l.jsx("option",{value:"250",children:"250 Kbps"})]})]})]})]}),l.jsxs("div",{className:"voxket-video-controls-section",children:[l.jsx("h4",{className:"voxket-video-controls-title",children:"Statistics"}),l.jsxs("div",{className:"voxket-video-stats",children:[l.jsxs("div",{className:"voxket-stat-item",children:[l.jsx("span",{className:"voxket-stat-label",children:"Resolution:"}),l.jsx("span",{className:"voxket-stat-value",children:e!=null&&e.dimensions?`${e.dimensions.width}×${e.dimensions.height}`:"N/A"})]}),l.jsxs("div",{className:"voxket-stat-item",children:[l.jsx("span",{className:"voxket-stat-label",children:"Source:"}),l.jsx("span",{className:"voxket-stat-value",children:(e==null?void 0:e.source)||"None"})]}),l.jsxs("div",{className:"voxket-stat-item",children:[l.jsx("span",{className:"voxket-stat-label",children:"Status:"}),l.jsx("span",{className:`voxket-stat-value ${e!=null&&e.isEnabled?"voxket-stat-value--active":"voxket-stat-value--inactive"}`,children:e!=null&&e.isEnabled?"Active":"Inactive"})]})]})]})]})}const Rd=({handler:e,loadData:t,data:n,client:r,addLocalMessage:s})=>{const[o,i]=g.useState(null),[a,c]=g.useState(!0),[d,u]=g.useState(!1),[f]=g.useState(Date.now());g.useEffect(()=>{(async()=>{try{if(c(!0),console.log("📋 AssignmentView: Loading assignment data..."),console.log("📋 AssignmentView: Received data from RPC:",n),n&&typeof n=="object"){const b={title:n.title||"Untitled Assignment",description:n.description||"No description provided",estimated_time_of_completion:n.estimated_time_of_completion||"Unknown"};i(b),console.log("📋 AssignmentView: Assignment loaded from RPC data:",b)}}catch(b){console.error("📋 AssignmentView: Error loading assignment:",b),i({title:"Assignment Loading Error",description:"There was an error loading the assignment details. Please try again.",estimated_time_of_completion:"Unknown"})}finally{c(!1)}})()},[n,t]);const h=({message:m,assignment:b})=>{const k=m.toLowerCase().includes("declined"),v=k?"bg-red-50 border-red-200":"bg-green-50 border-green-200",E=k?"text-red-700":"text-green-700",w=k?"❌":"🎉";return l.jsxs("div",{className:`max-w-sm mx-auto ${v} border rounded-lg shadow p-3 flex flex-col items-center`,children:[l.jsx("div",{className:"text-2xl mb-2",children:w}),l.jsx("div",{className:`${E} font-semibold text-sm mb-1`,children:m}),l.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:b.title}),l.jsx("div",{className:"text-xs text-gray-500",children:"Thank you for your response!"})]})},p=async()=>{if(!(!o||!e)){u(!0);try{const m={message:"accepted"};console.log("📋 AssignmentView: Assignment accepted:",m),e.didSuccess(m,l.jsx(h,{message:"Assignment accepted!",assignment:o}))}catch(m){console.error("📋 AssignmentView: Error accepting assignment:",m),e.didFail({error:"Failed to accept assignment"})}finally{u(!1)}}},x=async()=>{if(!(!o||!e)){u(!0);try{const m={message:"declined"};console.log("📋 AssignmentView: Assignment declined:",m),e.didSuccess(m,l.jsx(h,{message:"Assignment declined",assignment:o}))}catch(m){console.error("📋 AssignmentView: Error declining assignment:",m),e.didFail({error:"Failed to decline assignment"})}finally{u(!1)}}};return a?l.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:l.jsxs("div",{className:"flex items-center justify-center py-4",children:[l.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),l.jsx("span",{className:"ml-2 text-xs text-gray-600",children:"Loading assignment..."})]})}):o?l.jsxs("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg overflow-hidden",children:[l.jsx("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 text-white p-3",children:l.jsx("div",{className:"flex items-center justify-between",children:l.jsx("h3",{className:"text-xs font-semibold text-white truncate",children:o.title})})}),l.jsxs("div",{className:"p-3",children:[l.jsx("div",{className:"bg-gray-50 rounded p-2 mb-3",children:l.jsx("p",{className:"text-xs text-gray-700 leading-snug",children:o.description})}),l.jsx("div",{className:"mb-3",children:l.jsxs("div",{className:"flex items-center text-xs text-gray-600",children:[l.jsx("span",{className:"text-xs mr-1",children:"📅"}),l.jsxs("span",{children:["Est: ",o.estimated_time_of_completion]})]})}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:p,disabled:d,className:"flex-1 bg-green-600 text-white py-2 px-3 rounded text-xs font-medium hover:bg-green-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:d?l.jsxs("span",{className:"flex items-center justify-center",children:[l.jsx("div",{className:"animate-spin rounded-full h-2 w-2 border-b-2 border-white mr-1"}),l.jsx("span",{className:"text-xs",children:"Processing..."})]}):"Accept"}),l.jsx("button",{onClick:x,disabled:d,className:"flex-1 bg-red-600 text-white py-2 px-3 rounded text-xs font-medium hover:bg-red-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Decline"})]})]})]}):l.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:l.jsxs("div",{className:"text-center py-4",children:[l.jsx("div",{className:"text-red-600 text-sm font-semibold mb-2",children:"⚠️ Assignment Error"}),l.jsx("p",{className:"text-xs text-gray-600 mb-3",children:"Failed to load assignment details."})]})})};function Fx(){const[e,t]=g.useState(null),[n,r]=g.useState([]);g.useEffect(()=>{const a=new Vn({appId:"your-app-id",appSecret:"your-app-secret",baseUrl:"https://your-voxket-api.com",agentId:"your-agent-id",participantName:"User",modalities:["chat"]});return t(a),a.on("rpc.method.called",c=>{console.log("RPC Method Called:",c)}),a.on("rpc.interaction.completed",c=>{console.log("RPC Interaction Completed:",c)}),()=>{a.disconnect()}},[]);const s=async()=>{if(e)try{await e.registerFrontendRPC("give_assignment",Rd,"embedded");const a=e.getRegisteredRpcMethods();r(a),console.log("✅ Assignment RPC registered successfully")}catch(a){console.error("❌ Failed to register assignment RPC:",a)}},o=async()=>{if(!e)return;const a=({handler:c,timeout:d})=>{const[u,f]=g.useState(""),h=[{id:"pro",name:"Pro Plan",price:"$29/month"},{id:"enterprise",name:"Enterprise Plan",price:"$99/month"},{id:"basic",name:"Basic Plan",price:"$9/month"}],p=m=>{f(m)},x=()=>{const m=h.find(b=>b.id===u);c==null||c.didSuccess({selectedProduct:u,productName:m==null?void 0:m.name,price:m==null?void 0:m.price,timestamp:new Date().toISOString()})};return l.jsxs("div",{className:"p-6 bg-white rounded-lg",children:[l.jsx("h3",{className:"text-xl font-bold mb-4",children:"Choose Your Plan"}),l.jsx("p",{className:"text-gray-600 mb-4",children:"Select the plan that best fits your needs:"}),l.jsx("div",{className:"space-y-3 mb-6",children:h.map(m=>l.jsx("div",{onClick:()=>p(m.id),className:`p-4 border rounded-lg cursor-pointer transition-all ${u===m.id?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-gray-300"}`,children:l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"font-medium",children:m.name}),l.jsx("p",{className:"text-gray-600 text-sm",children:m.price})]}),l.jsx("div",{className:`w-4 h-4 rounded-full ${u===m.id?"bg-blue-500":"border-2 border-gray-300"}`})]})},m.id))}),l.jsxs("div",{className:"flex justify-end space-x-3",children:[l.jsx("button",{onClick:()=>c==null?void 0:c.dismissView(),className:"px-4 py-2 border border-gray-300 text-gray-700 rounded hover:bg-gray-50",children:"Cancel"}),l.jsx("button",{onClick:x,disabled:!u,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50",children:"Select Plan"})]}),d&&l.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Time remaining: ",d," seconds"]})]})};try{await e.registerFrontendRPC("recommend_product",a,"modal");const c=e.getRegisteredRpcMethods();r(c),console.log("✅ Product Recommendation RPC registered successfully")}catch(c){console.error("❌ Failed to register product recommendation RPC:",c)}},i=async()=>{if(!e)return;const a=({handler:c})=>{const[d,u]=g.useState(0),[f,h]=g.useState(""),p=()=>{c==null||c.didSuccess({rating:d,comment:f,timestamp:new Date().toISOString()})};return l.jsxs("div",{className:"p-4 bg-white rounded-lg",children:[l.jsx("h3",{className:"text-lg font-semibold mb-3",children:"How was your experience?"}),l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Rate your experience:"}),l.jsx("div",{className:"flex space-x-1",children:[1,2,3,4,5].map(x=>l.jsx("button",{onClick:()=>u(x),className:`text-2xl ${x<=d?"text-yellow-400":"text-gray-300"}`,children:"⭐"},x))})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Additional comments:"}),l.jsx("textarea",{value:f,onChange:x=>h(x.target.value),className:"w-full p-2 border border-gray-300 rounded text-sm",rows:3,placeholder:"Tell us more about your experience..."})]}),l.jsxs("div",{className:"flex justify-end space-x-2",children:[l.jsx("button",{onClick:()=>c==null?void 0:c.dismissView(),className:"px-3 py-1 text-sm border border-gray-300 text-gray-700 rounded hover:bg-gray-50",children:"Skip"}),l.jsx("button",{onClick:p,disabled:d===0,className:"px-3 py-1 text-sm bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50",children:"Submit"})]})]})};try{await e.registerFrontendRPC("collect_feedback",a,"embedded");const c=e.getRegisteredRpcMethods();r(c),console.log("✅ Feedback RPC registered successfully")}catch(c){console.error("❌ Failed to register feedback RPC:",c)}};return l.jsxs("div",{className:"p-6",children:[l.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Frontend RPC Examples"}),l.jsxs("div",{className:"space-y-4 mb-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Register RPC Methods"}),l.jsxs("div",{className:"space-x-2",children:[l.jsx("button",{onClick:s,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Register Assignment RPC"}),l.jsx("button",{onClick:o,className:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600",children:"Register Product Recommendation RPC"}),l.jsx("button",{onClick:i,className:"px-4 py-2 bg-purple-500 text-white rounded hover:bg-purple-600",children:"Register Feedback RPC"})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Registered Methods"}),n.length>0?l.jsx("ul",{className:"list-disc list-inside space-y-1",children:n.map(a=>l.jsx("li",{className:"text-gray-700",children:l.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:a})},a))}):l.jsx("p",{className:"text-gray-500",children:"No methods registered yet"})]})]}),l.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"How it works"}),l.jsxs("ol",{className:"list-decimal list-inside space-y-2 text-sm text-gray-700",children:[l.jsxs("li",{children:["Register RPC methods with React components using ",l.jsx("code",{children:"client.registerFrontendRPC()"})]}),l.jsx("li",{children:"When the agent calls an RPC method, the corresponding component will be displayed"}),l.jsx("li",{children:"Users interact with the component, and the response is sent back to the agent"}),l.jsx("li",{children:"Components can be displayed in different modes: embedded, modal, or fullscreen"}),l.jsx("li",{children:"Each component has a timeout and can handle success/failure scenarios"})]})]}),l.jsxs("div",{className:"mt-6 bg-blue-50 p-4 rounded-lg",children:[l.jsx("h3",{className:"text-lg font-semibold mb-2 text-blue-800",children:"Agent Side"}),l.jsx("p",{className:"text-sm text-blue-700 mb-2",children:"On the agent side, you can call these RPC methods like this:"}),l.jsx("pre",{className:"bg-white p-3 rounded text-xs text-gray-800 overflow-x-auto",children:`// Agent calls RPC method
328
757
  const response = await participant.performRpc({
329
758
  method: 'give_assignment',
330
759
  data: JSON.stringify({
@@ -335,4 +764,4 @@ const response = await participant.performRpc({
335
764
  })
336
765
  });
337
766
 
338
- console.log('User response:', response);`})]})]})}const Ox={async checkAvailableRpcs(e){const t=e.getRegisteredRpcMethods();return console.log("🔍 Agent: Available RPC methods:",t),t},async triggerAssignment(e,t){const n={title:"Complete Q4 Sales Analysis Report",description:"Please analyze the Q4 sales data and create a comprehensive report with insights, trends, and recommendations for the upcoming quarter. Include visualizations and executive summary.",estimated_time_of_completion:"2-3 hours"};try{console.log("🤖 Agent: Triggering give_assignment RPC with data:",n);const s=await e.localParticipant.performRpc(t,"give_assignment",JSON.stringify(n),{responseTimeout:12e4}),r=JSON.parse(s);return console.log("✅ Agent: Received user response:",r),await this.processAssignmentResponse(r),r}catch(s){throw console.error("❌ Agent: RPC failed:",s),s}},async processAssignmentResponse(e){console.log("🧠 Agent: Processing assignment response...");const t=e.status,n=e.assignmentId,s=e.timeSpent;return t==="accepted"?(console.log("🎉 Agent: User accepted the assignment!"),console.log(`� Assignment ID: ${n}`),console.log(`⏱️ Time to respond: ${s}ms`),console.log("💬 Agent: Sending follow-up:","Great! I've recorded that you've accepted the assignment. You'll receive the detailed requirements and access to the data shortly. Let me know if you need any clarification!")):t==="declined"?(console.log("❌ Agent: User declined the assignment"),console.log("💬 Agent: Sending follow-up:","No problem! Is there anything specific about this assignment that doesn't work for you? I can suggest alternatives or modify the requirements.")):t==="completed"&&(console.log("✅ Agent: User completed the assignment"),console.log("💬 Agent: Sending follow-up:","Excellent work! Could you please share the completed report? I'm excited to review your analysis and insights.")),{status:t,assignmentId:n,timeSpent:s,processed:!0,followupAction:t==="accepted"?"send_requirements":t==="declined"?"offer_alternatives":"request_deliverables"}},getAssignmentExamples(){return{marketing:{title:"Create Social Media Campaign",description:"Design and plan a social media campaign for our new product launch. Include content calendar, post designs, and engagement strategy.",estimated_time_of_completion:"4-5 hours"},technical:{title:"API Integration Documentation",description:"Create comprehensive documentation for our new API endpoints, including examples, error codes, and best practices for developers.",estimated_time_of_completion:"6-8 hours"},research:{title:"Market Research Analysis",description:"Research and analyze competitor pricing strategies in our target market. Provide recommendations for our pricing model.",estimated_time_of_completion:"3-4 hours"},quick:{title:"Customer Feedback Summary",description:"Review this week's customer feedback and create a summary of key themes and actionable insights.",estimated_time_of_completion:"30-45 minutes"}}}};yd();const Lx=e=>typeof window>"u"?null:p.createElement(bd,{children:p.createElement(xd,e)});exports.AssignmentView=Rd;exports.CompoundProvider=Ed;exports.InteractiveComponent=Kt;exports.PluginManager=md;exports.RpcExamples=Fx;exports.SessionContainer=Md;exports.SessionContent=Io;exports.SessionControls=jd;exports.SessionFooter=Do;exports.SessionHeader=Ro;exports.SessionLogViewer=lx;exports.SessionMetricsComponent=dx;exports.Slot=Jn;exports.ThemeProvider=yx;exports.VideoControls=$x;exports.VideoGrid=Ix;exports.VideoTile=Qn;exports.VoxketClient=Vn;exports.VoxketErrorBoundary=bd;exports.VoxketEventEmitter=Po;exports.VoxketProvider=gd;exports.VoxketSDK=Vn;exports.VoxketSessionComponent=Md;exports.agentRpcExample=Ox;exports.analyticsPlugin=ex;exports.chatModalityPlugin=kx;exports.createCustomTheme=xx;exports.createModalityPlugin=Vo;exports.createPlugin=Q1;exports.darkTheme=Rr;exports.debugPlugin=tx;exports.default=Lx;exports.defaultTheme=Et;exports.enterpriseTheme=Ir;exports.flattenTheme=Nd;exports.metricsPlugin=nx;exports.useComponentTheme=bx;exports.useCompoundContext=Nn;exports.useSessionLogging=hd;exports.useTheme=Vd;exports.useVoxket=Qe;exports.useVoxketCamera=Sd;exports.useVoxketChat=ks;exports.useVoxketChatInput=fx;exports.useVoxketConnection=No;exports.useVoxketMetrics=vd;exports.useVoxketMicrophone=wd;exports.useVoxketParticipants=kd;exports.useVoxketScreenShare=Cd;exports.useVoxketSession=jt;exports.useVoxketVideo=ux;exports.voiceModalityPlugin=vx;exports.withCompoundComponent=Ad;
767
+ console.log('User response:', response);`})]})]})}const Ox={async checkAvailableRpcs(e){const t=e.getRegisteredRpcMethods();return console.log("🔍 Agent: Available RPC methods:",t),t},async triggerAssignment(e,t){const n={title:"Complete Q4 Sales Analysis Report",description:"Please analyze the Q4 sales data and create a comprehensive report with insights, trends, and recommendations for the upcoming quarter. Include visualizations and executive summary.",estimated_time_of_completion:"2-3 hours"};try{console.log("🤖 Agent: Triggering give_assignment RPC with data:",n);const r=await e.localParticipant.performRpc(t,"give_assignment",JSON.stringify(n),{responseTimeout:12e4}),s=JSON.parse(r);return console.log("✅ Agent: Received user response:",s),await this.processAssignmentResponse(s),s}catch(r){throw console.error("❌ Agent: RPC failed:",r),r}},async processAssignmentResponse(e){console.log("🧠 Agent: Processing assignment response...");const t=e.status,n=e.assignmentId,r=e.timeSpent;return t==="accepted"?(console.log("🎉 Agent: User accepted the assignment!"),console.log(`� Assignment ID: ${n}`),console.log(`⏱️ Time to respond: ${r}ms`),console.log("💬 Agent: Sending follow-up:","Great! I've recorded that you've accepted the assignment. You'll receive the detailed requirements and access to the data shortly. Let me know if you need any clarification!")):t==="declined"?(console.log("❌ Agent: User declined the assignment"),console.log("💬 Agent: Sending follow-up:","No problem! Is there anything specific about this assignment that doesn't work for you? I can suggest alternatives or modify the requirements.")):t==="completed"&&(console.log("✅ Agent: User completed the assignment"),console.log("💬 Agent: Sending follow-up:","Excellent work! Could you please share the completed report? I'm excited to review your analysis and insights.")),{status:t,assignmentId:n,timeSpent:r,processed:!0,followupAction:t==="accepted"?"send_requirements":t==="declined"?"offer_alternatives":"request_deliverables"}},getAssignmentExamples(){return{marketing:{title:"Create Social Media Campaign",description:"Design and plan a social media campaign for our new product launch. Include content calendar, post designs, and engagement strategy.",estimated_time_of_completion:"4-5 hours"},technical:{title:"API Integration Documentation",description:"Create comprehensive documentation for our new API endpoints, including examples, error codes, and best practices for developers.",estimated_time_of_completion:"6-8 hours"},research:{title:"Market Research Analysis",description:"Research and analyze competitor pricing strategies in our target market. Provide recommendations for our pricing model.",estimated_time_of_completion:"3-4 hours"},quick:{title:"Customer Feedback Summary",description:"Review this week's customer feedback and create a summary of key themes and actionable insights.",estimated_time_of_completion:"30-45 minutes"}}}};yd();const Lx=e=>typeof window>"u"?null:g.createElement(bd,{children:g.createElement(xd,e)});exports.AssignmentView=Rd;exports.CompoundProvider=Td;exports.InteractiveComponent=Kt;exports.PluginManager=md;exports.RpcExamples=Fx;exports.SessionContainer=Md;exports.SessionContent=Io;exports.SessionControls=jd;exports.SessionFooter=Do;exports.SessionHeader=Ro;exports.SessionLogViewer=lx;exports.SessionMetricsComponent=dx;exports.Slot=Jn;exports.ThemeProvider=yx;exports.VideoControls=$x;exports.VideoGrid=Ix;exports.VideoTile=Qn;exports.VoxketClient=Vn;exports.VoxketErrorBoundary=bd;exports.VoxketEventEmitter=Po;exports.VoxketProvider=pd;exports.VoxketSDK=Vn;exports.VoxketSessionComponent=Md;exports.agentRpcExample=Ox;exports.analyticsPlugin=ex;exports.chatModalityPlugin=kx;exports.createCustomTheme=xx;exports.createModalityPlugin=Vo;exports.createPlugin=Qy;exports.darkTheme=Rs;exports.debugPlugin=tx;exports.default=Lx;exports.defaultTheme=Tt;exports.enterpriseTheme=Is;exports.flattenTheme=Nd;exports.metricsPlugin=nx;exports.useComponentTheme=bx;exports.useCompoundContext=Nn;exports.useSessionLogging=hd;exports.useTheme=Vd;exports.useVoxket=Qe;exports.useVoxketCamera=Sd;exports.useVoxketChat=kr;exports.useVoxketChatInput=fx;exports.useVoxketConnection=No;exports.useVoxketMetrics=vd;exports.useVoxketMicrophone=wd;exports.useVoxketParticipants=kd;exports.useVoxketScreenShare=Cd;exports.useVoxketSession=jt;exports.useVoxketVideo=ux;exports.voiceModalityPlugin=vx;exports.withCompoundComponent=Ad;