@voxket-ai/voxket-live 1.0.123 → 1.0.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -18,7 +18,7 @@
18
18
  }
19
19
  })();
20
20
 
21
- "use strict";var _m=Object.defineProperty;var Bm=(e,t,n)=>t in e?_m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ue=(e,t,n)=>Bm(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("react"),f=require("react/jsx-runtime"),te=require("livekit-client"),ut=require("@livekit/components-react"),Ps=require("class-variance-authority"),Ns=require("clsx"),zm=require("@radix-ui/react-toggle"),Hm=require("@radix-ui/react-select"),Ze=require("lucide-react"),Um=require("@emotion/styled");require("@emotion/react");const Wm=require("react-dom/client");function Ms(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 x=Ms(j),Zm=Ms(zm),kt=Ms(Hm),Is=j.createContext({});function Rs(e){const t=j.useRef(null);return t.current===null&&(t.current=e()),t.current}const Vs=typeof window<"u",Gu=Vs?j.useLayoutEffect:j.useEffect,Ti=j.createContext(null);function Ds(e,t){e.indexOf(t)===-1&&e.push(t)}function Fs(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Bt=(e,t,n)=>n>t?t:n<e?e:n;function zo(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let qn=()=>{},zt=()=>{};process.env.NODE_ENV!=="production"&&(qn=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(zo(t,n))},zt=(e,t,n)=>{if(!e)throw new Error(zo(t,n))});const Ht={},Ku=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Yu(e){return typeof e=="object"&&e!==null}const Xu=e=>/^0[^.\s]+$/u.test(e);function Ls(e){let t;return()=>(t===void 0&&(t=e()),t)}const St=e=>e,qm=(e,t)=>n=>t(e(n)),Nr=(...e)=>e.reduce(qm),vr=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Os{constructor(){this.subscriptions=[]}add(t){return Ds(this.subscriptions,t),()=>Fs(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const At=e=>e*1e3,It=e=>e/1e3;function Qu(e,t){return t?e*(1e3/t):0}const Ya=new Set;function $s(e,t,n){e||Ya.has(t)||(console.warn(zo(t,n)),Ya.add(t))}const Ju=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Gm=1e-7,Km=12;function Ym(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=Ju(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>Gm&&++a<Km);return o}function Mr(e,t,n,r){if(e===t&&n===r)return St;const i=s=>Ym(s,0,1,e,n);return s=>s===0||s===1?s:Ju(i(s),t,r)}const ed=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,td=e=>t=>1-e(1-t),nd=Mr(.33,1.53,.69,.99),_s=td(nd),rd=ed(_s),id=e=>(e*=2)<1?.5*_s(e):.5*(2-Math.pow(2,-10*(e-1))),Bs=e=>1-Math.sin(Math.acos(e)),od=td(Bs),sd=ed(Bs),Xm=Mr(.42,0,1,1),Qm=Mr(0,0,.58,1),ad=Mr(.42,0,.58,1),Jm=e=>Array.isArray(e)&&typeof e[0]!="number",ld=e=>Array.isArray(e)&&typeof e[0]=="number",Xa={linear:St,easeIn:Xm,easeInOut:ad,easeOut:Qm,circIn:Bs,circInOut:sd,circOut:od,backIn:_s,backInOut:rd,backOut:nd,anticipate:id},ep=e=>typeof e=="string",Qa=e=>{if(ld(e)){zt(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,i]=e;return Mr(t,n,r,i)}else if(ep(e))return zt(Xa[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Xa[e];return e},Br=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function tp(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,d=!1,h=!1)=>{const g=h&&i?n:r;return d&&o.add(u),g.has(u)||g.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(l),n.clear(),i=!1,s&&(s=!1,c.process(u))}};return c}const np=40;function cd(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Br.reduce((S,A)=>(S[A]=tp(s),S),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:h,render:m,postRender:g}=o,p=()=>{const S=Ht.useManualTiming?i.timestamp:performance.now();n=!1,Ht.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(S-i.timestamp,np),1)),i.timestamp=S,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),d.process(i),h.process(i),m.process(i),g.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},b=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Br.reduce((S,A)=>{const T=o[A];return S[A]=(C,M=!1,P=!1)=>(n||b(),T.schedule(C,M,P)),S},{}),cancel:S=>{for(let A=0;A<Br.length;A++)o[Br[A]].cancel(S)},state:i,steps:o}}const{schedule:Be,cancel:Jt,state:rt,steps:qi}=cd(typeof requestAnimationFrame<"u"?requestAnimationFrame:St,!0);let ri;function rp(){ri=void 0}const dt={now:()=>(ri===void 0&&dt.set(rt.isProcessing||Ht.useManualTiming?rt.timestamp:performance.now()),ri),set:e=>{ri=e,queueMicrotask(rp)}},ud=e=>t=>typeof t=="string"&&t.startsWith(e),zs=ud("--"),ip=ud("var(--"),Hs=e=>ip(e)?op.test(e.split("/*")[0].trim()):!1,op=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Gn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},wr={...Gn,transform:e=>Bt(0,1,e)},zr={...Gn,default:1},fr=e=>Math.round(e*1e5)/1e5,Us=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function sp(e){return e==null}const ap=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ws=(e,t)=>n=>!!(typeof n=="string"&&ap.test(n)&&n.startsWith(e)||t&&!sp(n)&&Object.prototype.hasOwnProperty.call(n,t)),dd=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Us);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},lp=e=>Bt(0,255,e),Gi={...Gn,transform:e=>Math.round(lp(e))},fn={test:Ws("rgb","red"),parse:dd("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Gi.transform(e)+", "+Gi.transform(t)+", "+Gi.transform(n)+", "+fr(wr.transform(r))+")"};function cp(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Ho={test:Ws("#"),parse:cp,transform:fn.transform},Ir=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Yt=Ir("deg"),Rt=Ir("%"),ye=Ir("px"),up=Ir("vh"),dp=Ir("vw"),Ja={...Rt,parse:e=>Rt.parse(e)/100,transform:e=>Rt.transform(e*100)},Rn={test:Ws("hsl","hue"),parse:dd("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Rt.transform(fr(t))+", "+Rt.transform(fr(n))+", "+fr(wr.transform(r))+")"},Je={test:e=>fn.test(e)||Ho.test(e)||Rn.test(e),parse:e=>fn.test(e)?fn.parse(e):Rn.test(e)?Rn.parse(e):Ho.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?fn.transform(e):Rn.transform(e),getAnimatableNone:e=>{const t=Je.parse(e);return t.alpha=0,Je.transform(t)}},fp=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function hp(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Us))==null?void 0:t.length)||0)+(((n=e.match(fp))==null?void 0:n.length)||0)>0}const fd="number",hd="color",mp="var",pp="var(",el="${}",gp=/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 kr(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(gp,l=>(Je.test(l)?(r.color.push(s),i.push(hd),n.push(Je.parse(l))):l.startsWith(pp)?(r.var.push(s),i.push(mp),n.push(l)):(r.number.push(s),i.push(fd),n.push(parseFloat(l))),++s,el)).split(el);return{values:n,split:a,indexes:r,types:i}}function md(e){return kr(e).values}function pd(e){const{split:t,types:n}=kr(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===fd?s+=fr(i[o]):a===hd?s+=Je.transform(i[o]):s+=i[o]}return s}}const yp=e=>typeof e=="number"?0:Je.test(e)?Je.getAnimatableNone(e):e;function xp(e){const t=md(e);return pd(e)(t.map(yp))}const en={test:hp,parse:md,createTransformer:pd,getAnimatableNone:xp};function Ki(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 bp({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Ki(l,a,e+1/3),s=Ki(l,a,e),o=Ki(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function hi(e,t){return n=>n>0?t:e}const qe=(e,t,n)=>e+(t-e)*n,Yi=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},vp=[Ho,fn,Rn],wp=e=>vp.find(t=>t.test(e));function tl(e){const t=wp(e);if(qn(!!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===Rn&&(n=bp(n)),n}const nl=(e,t)=>{const n=tl(e),r=tl(t);if(!n||!r)return hi(e,t);const i={...n};return s=>(i.red=Yi(n.red,r.red,s),i.green=Yi(n.green,r.green,s),i.blue=Yi(n.blue,r.blue,s),i.alpha=qe(n.alpha,r.alpha,s),fn.transform(i))},Uo=new Set(["none","hidden"]);function kp(e,t){return Uo.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Sp(e,t){return n=>qe(e,t,n)}function Zs(e){return typeof e=="number"?Sp:typeof e=="string"?Hs(e)?hi:Je.test(e)?nl:Tp:Array.isArray(e)?gd:typeof e=="object"?Je.test(e)?nl:Cp:hi}function gd(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Zs(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function Cp(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Zs(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function Ep(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],o=e.indexes[s][r[s]],a=e.values[o]??0;n[i]=a,r[s]++}return n}const Tp=(e,t)=>{const n=en.createTransformer(t),r=kr(e),i=kr(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Uo.has(e)&&!i.values.length||Uo.has(t)&&!r.values.length?kp(e,t):Nr(gd(Ep(r,i),i.values),n):(qn(!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"),hi(e,t))};function yd(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?qe(e,t,n):Zs(e)(e,t)}const Ap=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Be.update(t,n),stop:()=>Jt(t),now:()=>rt.isProcessing?rt.timestamp:dt.now()}},xd=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=Math.round(e(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},mi=2e4;function qs(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<mi;)t+=n,r=e.next(t);return t>=mi?1/0:t}function jp(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(qs(r),mi);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:It(i)}}const Pp=5;function bd(e,t,n){const r=Math.max(t-Pp,0);return Qu(n-e(r),t-r)}const We={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},Xi=.001;function Np({duration:e=We.duration,bounce:t=We.bounce,velocity:n=We.velocity,mass:r=We.mass}){let i,s;qn(e<=At(We.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=Bt(We.minDamping,We.maxDamping,o),e=Bt(We.minDuration,We.maxDuration,It(e)),o<1?(i=c=>{const u=c*o,d=u*e,h=u-n,m=Wo(c,o),g=Math.exp(-d);return Xi-h/m*g},s=c=>{const d=c*o*e,h=d*n+n,m=Math.pow(o,2)*Math.pow(c,2)*e,g=Math.exp(-d),p=Wo(Math.pow(c,2),o);return(-i(c)+Xi>0?-1:1)*((h-m)*g)/p}):(i=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Xi+u*d},s=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=Ip(i,s,a);if(e=At(e),isNaN(l))return{stiffness:We.stiffness,damping:We.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const Mp=12;function Ip(e,t,n){let r=n;for(let i=1;i<Mp;i++)r=r-e(r)/t(r);return r}function Wo(e,t){return e*Math.sqrt(1-t*t)}const Rp=["duration","bounce"],Vp=["stiffness","damping","mass"];function rl(e,t){return t.some(n=>e[n]!==void 0)}function Dp(e){let t={velocity:We.velocity,stiffness:We.stiffness,damping:We.damping,mass:We.mass,isResolvedFromDuration:!1,...e};if(!rl(e,Vp)&&rl(e,Rp))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Bt(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:We.mass,stiffness:i,damping:s}}else{const n=Np(e);t={...t,...n,mass:We.mass},t.isResolvedFromDuration=!0}return t}function pi(e=We.visualDuration,t=We.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:m}=Dp({...n,velocity:-It(n.velocity||0)}),g=h||0,p=c/(2*Math.sqrt(l*u)),b=o-s,v=It(Math.sqrt(l/u)),k=Math.abs(b)<5;r||(r=k?We.restSpeed.granular:We.restSpeed.default),i||(i=k?We.restDelta.granular:We.restDelta.default);let S;if(p<1){const T=Wo(v,p);S=C=>{const M=Math.exp(-p*v*C);return o-M*((g+p*v*b)/T*Math.sin(T*C)+b*Math.cos(T*C))}}else if(p===1)S=T=>o-Math.exp(-v*T)*(b+(g+v*b)*T);else{const T=v*Math.sqrt(p*p-1);S=C=>{const M=Math.exp(-p*v*C),P=Math.min(T*C,300);return o-M*((g+p*v*b)*Math.sinh(P)+T*b*Math.cosh(P))/T}}const A={calculatedDuration:m&&d||null,next:T=>{const C=S(T);if(m)a.done=T>=d;else{let M=T===0?g:0;p<1&&(M=T===0?At(g):bd(S,T,C));const P=Math.abs(M)<=r,L=Math.abs(o-C)<=i;a.done=P&&L}return a.value=a.done?o:C,a},toString:()=>{const T=Math.min(qs(A),mi),C=xd(M=>A.next(T*M).value,T,30);return T+"ms "+C},toTransition:()=>{}};return A}pi.applyToOptions=e=>{const t=jp(e,100,pi);return e.ease=t.ease,e.duration=At(t.duration),e.type="keyframes",e};function Zo({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},m=P=>a!==void 0&&P<a||l!==void 0&&P>l,g=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let p=n*t;const b=d+p,v=o===void 0?b:o(b);v!==b&&(p=v-d);const k=P=>-p*Math.exp(-P/r),S=P=>v+k(P),A=P=>{const L=k(P),y=S(P);h.done=Math.abs(L)<=c,h.value=h.done?v:y};let T,C;const M=P=>{m(h.value)&&(T=P,C=pi({keyframes:[h.value,g(h.value)],velocity:bd(S,P,h.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return M(0),{calculatedDuration:null,next:P=>{let L=!1;return!C&&T===void 0&&(L=!0,A(P),M(P)),T!==void 0&&P>=T?C.next(P-T):(!L&&A(P),h)}}}function Fp(e,t,n){const r=[],i=n||Ht.mix||yd,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||St:t;a=Nr(l,a)}r.push(a)}return r}function Lp(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(zt(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Fp(t,r,i),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const h=vr(e[d],e[d+1],u);return a[d](h)};return n?u=>c(Bt(e[0],e[s-1],u)):c}function Op(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=vr(0,t,r);e.push(qe(n,1,i))}}function $p(e){const t=[0];return Op(t,e.length-1),t}function _p(e,t){return e.map(n=>n*t)}function Bp(e,t){return e.map(()=>t||ad).splice(0,e.length-1)}function Vn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=Jm(r)?r.map(Qa):Qa(r),s={done:!1,value:t[0]},o=_p(n&&n.length===t.length?n:$p(t),e),a=Lp(o,t,{ease:Array.isArray(i)?i:Bp(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const zp=e=>e!==null;function Gs(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(zp),a=i<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const Hp={decay:Zo,inertia:Zo,tween:Vn,keyframes:Vn,spring:pi};function vd(e){typeof e.type=="string"&&(e.type=Hp[e.type])}class Ks{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 Up=e=>e/100;class Ys extends Ks{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,i;const{motionValue:n}=this.options;n&&n.updatedAt!==dt.now()&&this.tick(dt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;vd(t);const{type:n=Vn,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:a}=t;const l=n||Vn;process.env.NODE_ENV!=="production"&&l!==Vn&&zt(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==Vn&&typeof a[0]!="number"&&(this.mixKeyframes=Nr(Up,yd(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=qs(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=c}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:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:d,repeatType:h,repeatDelay:m,type:g,onUpdate:p,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const v=this.currentTime-c*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let S=this.currentTime,A=r;if(d){const P=Math.min(this.currentTime,i)/a;let L=Math.floor(P),y=P%1;!y&&P>=1&&(y=1),y===1&&L--,L=Math.min(L,d+1),!!(L%2)&&(h==="reverse"?(y=1-y,m&&(y-=m/a)):h==="mirror"&&(A=o)),S=Bt(0,1,y)*a}const T=k?{done:!1,value:u[0]}:A.next(S);s&&(T.value=s(T.value));let{done:C}=T;!k&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return M&&g!==Zo&&(T.value=Gs(u,this.options,b,this.speed)),p&&p(T.value),M&&this.finish(),T}then(t,n){return this.finished.then(t,n)}get duration(){return It(this.calculatedDuration)}get time(){return It(this.currentTime)}set time(t){var n;t=At(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(dt.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=It(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:t=Ap,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);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(dt.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 Wp(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const hn=e=>e*180/Math.PI,qo=e=>{const t=hn(Math.atan2(e[1],e[0]));return Go(t)},Zp={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:qo,rotateZ:qo,skewX:e=>hn(Math.atan(e[1])),skewY:e=>hn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Go=e=>(e=e%360,e<0&&(e+=360),e),il=qo,ol=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),sl=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),qp={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ol,scaleY:sl,scale:e=>(ol(e)+sl(e))/2,rotateX:e=>Go(hn(Math.atan2(e[6],e[5]))),rotateY:e=>Go(hn(Math.atan2(-e[2],e[0]))),rotateZ:il,rotate:il,skewX:e=>hn(Math.atan(e[4])),skewY:e=>hn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ko(e){return e.includes("scale")?1:0}function Yo(e,t){if(!e||e==="none")return Ko(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=qp,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Zp,i=a}if(!i)return Ko(t);const s=r[t],o=i[1].split(",").map(Kp);return typeof s=="function"?s(o):o[s]}const Gp=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Yo(n,t)};function Kp(e){return parseFloat(e.trim())}const Kn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Yn=new Set(Kn),al=e=>e===Gn||e===ye,Yp=new Set(["x","y","z"]),Xp=Kn.filter(e=>!Yp.has(e));function Qp(e){const t=[];return Xp.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const pn={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})=>Yo(t,"x"),y:(e,{transform:t})=>Yo(t,"y")};pn.translateX=pn.x;pn.translateY=pn.y;const gn=new Set;let Xo=!1,Qo=!1,Jo=!1;function wd(){if(Qo){const e=Array.from(gn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=Qp(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Qo=!1,Xo=!1,gn.forEach(e=>e.complete(Jo)),gn.clear()}function kd(){gn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Qo=!0)})}function Jp(){Jo=!0,kd(),wd(),Jo=!1}class Xs{constructor(t,n,r,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(gn.add(this),Xo||(Xo=!0,Be.read(kd),Be.resolveKeyframes(wd))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const s=i==null?void 0:i.get(),o=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),i&&s===void 0&&i.set(t[0])}Wp(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),gn.delete(this)}cancel(){this.state==="scheduled"&&(gn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const eg=e=>e.startsWith("--");function tg(e,t,n){eg(t)?e.style.setProperty(t,n):e.style[t]=n}const ng=Ls(()=>window.ScrollTimeline!==void 0),rg={};function ig(e,t){const n=Ls(e);return()=>rg[t]??n()}const Sd=ig(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),cr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ll={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cr([0,.65,.55,1]),circOut:cr([.55,0,1,.45]),backIn:cr([.31,.01,.66,-.59]),backOut:cr([.33,1.53,.69,.99])};function Cd(e,t){if(e)return typeof e=="function"?Sd()?xd(e,t):"ease-out":ld(e)?cr(e):Array.isArray(e)?e.map(n=>Cd(n,t)||ll.easeOut):ll[e]}function og(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=Cd(a,i);Array.isArray(d)&&(u.easing=d);const h={delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(u,h)}function Ed(e){return typeof e=="function"&&"applyToOptions"in e}function sg({type:e,...t}){return Ed(e)&&Sd()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class ag extends Ks{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=t,zt(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=sg(t);this.animation=og(n,r,i,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=Gs(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):tg(n,r,u),this.animation.cancel()}l==null||l(),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 It(Number(t))}get time(){return It(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=At(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&&ng()?(this.animation.timeline=t,St):n(this)}}const Td={anticipate:id,backInOut:rd,circInOut:sd};function lg(e){return e in Td}function cg(e){typeof e.ease=="string"&&lg(e.ease)&&(e.ease=Td[e.ease])}const cl=10;class ug extends ag{constructor(t){cg(t),vd(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Ys({...o,autoplay:!1}),l=At(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-cl).value,a.sample(l).value,cl),a.stop()}}const ul=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(en.test(e)||e==="0")&&!e.startsWith("url("));function dg(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 fg(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=ul(i,t),a=ul(s,t);return qn(o===a,`You are trying to animate ${t} from "${i}" to "${s}". "${o?s:i}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:dg(e)||(n==="spring"||Ed(n))&&r}function es(e){e.duration=0,e.type}const hg=new Set(["opacity","clipPath","filter","transform"]),mg=Ls(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function pg(e){var u;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:s,type:o}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return mg()&&n&&hg.has(n)&&(n!=="transform"||!c)&&!l&&!r&&i!=="mirror"&&s!==0&&o!=="inertia"}const gg=40;class yg extends Ks{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...d}){var g;super(),this.stop=()=>{var p,b;this._animation&&(this._animation.stop(),(p=this.stopTimeline)==null||p.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=dt.now();const h={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,name:l,motionValue:c,element:u,...d},m=(u==null?void 0:u.KeyframeResolver)||Xs;this.keyframeResolver=new m(a,(p,b,v)=>this.onKeyframesResolved(p,b,h,!v),l,c,u),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,r,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=dt.now(),fg(t,s,o,a)||((Ht.instantAnimations||!l)&&(u==null||u(Gs(t,r,n))),t[0]=t[t.length-1],es(r),r.repeat=0);const h={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>gg?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=!c&&pg(h)?new ug({...h,element:h.motionValue.owner.current}):new Ys(h);m.finished.then(()=>this.notifyFinished()).catch(St),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}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(),Jp()),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 xg=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bg(e){const t=xg.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const vg=4;function Ad(e,t,n=1){zt(n<=vg,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=bg(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return Ku(o)?parseFloat(o):o}return Hs(i)?Ad(i,t,n+1):i}function Qs(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const jd=new Set(["width","height","top","left","right","bottom",...Kn]),wg={test:e=>e==="auto",parse:e=>e},Pd=e=>t=>t.test(e),Nd=[Gn,ye,Rt,Yt,dp,up,wg],dl=e=>Nd.find(Pd(e));function kg(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Xu(e):!0}const Sg=new Set(["brightness","contrast","saturate","opacity"]);function Cg(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Us)||[];if(!r)return e;const i=n.replace(r,"");let s=Sg.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const Eg=/\b([a-z-]*)\(.*?\)/gu,ts={...en,getAnimatableNone:e=>{const t=e.match(Eg);return t?t.map(Cg).join(" "):e}},fl={...Gn,transform:Math.round},Tg={rotate:Yt,rotateX:Yt,rotateY:Yt,rotateZ:Yt,scale:zr,scaleX:zr,scaleY:zr,scaleZ:zr,skew:Yt,skewX:Yt,skewY:Yt,distance:ye,translateX:ye,translateY:ye,translateZ:ye,x:ye,y:ye,z:ye,perspective:ye,transformPerspective:ye,opacity:wr,originX:Ja,originY:Ja,originZ:ye},Js={borderWidth:ye,borderTopWidth:ye,borderRightWidth:ye,borderBottomWidth:ye,borderLeftWidth:ye,borderRadius:ye,radius:ye,borderTopLeftRadius:ye,borderTopRightRadius:ye,borderBottomRightRadius:ye,borderBottomLeftRadius:ye,width:ye,maxWidth:ye,height:ye,maxHeight:ye,top:ye,right:ye,bottom:ye,left:ye,padding:ye,paddingTop:ye,paddingRight:ye,paddingBottom:ye,paddingLeft:ye,margin:ye,marginTop:ye,marginRight:ye,marginBottom:ye,marginLeft:ye,backgroundPositionX:ye,backgroundPositionY:ye,...Tg,zIndex:fl,fillOpacity:wr,strokeOpacity:wr,numOctaves:fl},Ag={...Js,color:Je,backgroundColor:Je,outlineColor:Je,fill:Je,stroke:Je,borderColor:Je,borderTopColor:Je,borderRightColor:Je,borderBottomColor:Je,borderLeftColor:Je,filter:ts,WebkitFilter:ts},Md=e=>Ag[e];function Id(e,t){let n=Md(e);return n!==ts&&(n=en),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const jg=new Set(["auto","none","0"]);function Pg(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!jg.has(s)&&kr(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=Id(n,i)}class Ng extends Xs{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Hs(c))){const u=Ad(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!jd.has(r)||t.length!==2)return;const[i,s]=t,o=dl(i),a=dl(s);if(o!==a)if(al(o)&&al(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else pn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||kg(t[i]))&&r.push(i);r.length&&Pg(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=pn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=pn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function Mg(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const i=(n==null?void 0:n[e])??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}const Rd=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Vd(e){return Yu(e)&&"offsetHeight"in e}const hl=30,Ig=e=>!isNaN(parseFloat(e));class Rg{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=dt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=dt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Ig(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&$s(!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 Os);const r=this.events[t].add(n);return t==="change"?()=>{r(),Be.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=dt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>hl)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,hl);return Qu(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 Hn(e,t){return new Rg(e,t)}const{schedule:ea}=cd(queueMicrotask,!1),Tt={x:!1,y:!1};function Dd(){return Tt.x||Tt.y}function Vg(e){return e==="x"||e==="y"?Tt[e]?null:(Tt[e]=!0,()=>{Tt[e]=!1}):Tt.x||Tt.y?null:(Tt.x=Tt.y=!0,()=>{Tt.x=Tt.y=!1})}function Fd(e,t){const n=Mg(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function ml(e){return!(e.pointerType==="touch"||Dd())}function Dg(e,t,n={}){const[r,i,s]=Fd(e,n),o=a=>{if(!ml(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=d=>{ml(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Ld=(e,t)=>t?e===t?!0:Ld(e,t.parentElement):!1,ta=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Fg=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Lg(e){return Fg.has(e.tagName)||e.tabIndex!==-1}const ii=new WeakSet;function pl(e){return t=>{t.key==="Enter"&&e(t)}}function Qi(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Og=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=pl(()=>{if(ii.has(n))return;Qi(n,"down");const i=pl(()=>{Qi(n,"up")}),s=()=>Qi(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function gl(e){return ta(e)&&!Dd()}function $g(e,t,n={}){const[r,i,s]=Fd(e,n),o=a=>{const l=a.currentTarget;if(!gl(a))return;ii.add(l);const c=t(l,a),u=(m,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),ii.has(l)&&ii.delete(l),gl(m)&&typeof c=="function"&&c(m,{success:g})},d=m=>{u(m,l===window||l===document||n.useGlobalTarget||Ld(l,m.target))},h=m=>{u(m,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",h,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),Vd(a)&&(a.addEventListener("focus",c=>Og(c,i)),!Lg(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Od(e){return Yu(e)&&"ownerSVGElement"in e}function _g(e){return Od(e)&&e.tagName==="svg"}const it=e=>!!(e&&e.getVelocity),Bg=[...Nd,Je,en],zg=e=>Bg.find(Pd(e)),na=j.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Hg extends x.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=Vd(r)&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Ug({children:e,isPresent:t,anchorX:n,root:r}){const i=j.useId(),s=j.useRef(null),o=j.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=j.useContext(na);return j.useInsertionEffect(()=>{const{width:l,height:c,top:u,left:d,right:h}=o.current;if(t||!s.current||!l||!c)return;const m=n==="left"?`left: ${d}`:`right: ${h}`;s.current.dataset.motionPopId=i;const g=document.createElement("style");a&&(g.nonce=a);const p=r??document.head;return p.appendChild(g),g.sheet&&g.sheet.insertRule(`
21
+ "use strict";var ep=Object.defineProperty;var tp=(e,t,n)=>t in e?ep(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ue=(e,t,n)=>tp(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("react"),f=require("react/jsx-runtime"),te=require("livekit-client"),dt=require("@livekit/components-react"),Vs=require("class-variance-authority"),Ds=require("clsx"),np=require("@radix-ui/react-toggle"),rp=require("@radix-ui/react-select"),Ze=require("lucide-react"),ip=require("@emotion/styled");require("@emotion/react");const op=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 x=Fs(j),sp=Fs(np),St=Fs(rp),Ls=j.createContext({});function Os(e){const t=j.useRef(null);return t.current===null&&(t.current=e()),t.current}const $s=typeof window<"u",rd=$s?j.useLayoutEffect:j.useEffect,Mi=j.createContext(null);function _s(e,t){e.indexOf(t)===-1&&e.push(t)}function Bs(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ht=(e,t,n)=>n>t?t:n<e?e:n;function qo(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Yn=()=>{},Ut=()=>{};process.env.NODE_ENV!=="production"&&(Yn=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(qo(t,n))},Ut=(e,t,n)=>{if(!e)throw new Error(qo(t,n))});const Wt={},id=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function od(e){return typeof e=="object"&&e!==null}const sd=e=>/^0[^.\s]+$/u.test(e);function zs(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ct=e=>e,ap=(e,t)=>n=>t(e(n)),Rr=(...e)=>e.reduce(ap),Sr=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Hs{constructor(){this.subscriptions=[]}add(t){return _s(this.subscriptions,t),()=>Bs(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const jt=e=>e*1e3,Rt=e=>e/1e3;function ad(e,t){return t?e*(1e3/t):0}const il=new Set;function Us(e,t,n){e||il.has(t)||(console.warn(qo(t,n)),il.add(t))}const ld=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,lp=1e-7,cp=12;function up(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=ld(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>lp&&++a<cp);return o}function Vr(e,t,n,r){if(e===t&&n===r)return Ct;const i=s=>up(s,0,1,e,n);return s=>s===0||s===1?s:ld(i(s),t,r)}const cd=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ud=e=>t=>1-e(1-t),dd=Vr(.33,1.53,.69,.99),Ws=ud(dd),fd=cd(Ws),hd=e=>(e*=2)<1?.5*Ws(e):.5*(2-Math.pow(2,-10*(e-1))),Zs=e=>1-Math.sin(Math.acos(e)),md=ud(Zs),pd=cd(Zs),dp=Vr(.42,0,1,1),fp=Vr(0,0,.58,1),gd=Vr(.42,0,.58,1),hp=e=>Array.isArray(e)&&typeof e[0]!="number",yd=e=>Array.isArray(e)&&typeof e[0]=="number",ol={linear:Ct,easeIn:dp,easeInOut:gd,easeOut:fp,circIn:Zs,circInOut:pd,circOut:md,backIn:Ws,backInOut:fd,backOut:dd,anticipate:hd},mp=e=>typeof e=="string",sl=e=>{if(yd(e)){Ut(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,i]=e;return Vr(t,n,r,i)}else if(mp(e))return Ut(ol[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),ol[e];return e},Ur=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function pp(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,d=!1,h=!1)=>{const g=h&&i?n:r;return d&&o.add(u),g.has(u)||g.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(l),n.clear(),i=!1,s&&(s=!1,c.process(u))}};return c}const gp=40;function xd(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Ur.reduce((S,A)=>(S[A]=pp(s),S),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:h,render:m,postRender:g}=o,p=()=>{const S=Wt.useManualTiming?i.timestamp:performance.now();n=!1,Wt.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(S-i.timestamp,gp),1)),i.timestamp=S,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),d.process(i),h.process(i),m.process(i),g.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},b=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Ur.reduce((S,A)=>{const T=o[A];return S[A]=(C,N=!1,P=!1)=>(n||b(),T.schedule(C,N,P)),S},{}),cancel:S=>{for(let A=0;A<Ur.length;A++)o[Ur[A]].cancel(S)},state:i,steps:o}}const{schedule:Be,cancel:tn,state:it,steps:Qi}=xd(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ct,!0);let si;function yp(){si=void 0}const ft={now:()=>(si===void 0&&ft.set(it.isProcessing||Wt.useManualTiming?it.timestamp:performance.now()),si),set:e=>{si=e,queueMicrotask(yp)}},bd=e=>t=>typeof t=="string"&&t.startsWith(e),qs=bd("--"),xp=bd("var(--"),Gs=e=>xp(e)?bp.test(e.split("/*")[0].trim()):!1,bp=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Xn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Cr={...Xn,transform:e=>Ht(0,1,e)},Wr={...Xn,default:1},pr=e=>Math.round(e*1e5)/1e5,Ks=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vp(e){return e==null}const wp=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ys=(e,t)=>n=>!!(typeof n=="string"&&wp.test(n)&&n.startsWith(e)||t&&!vp(n)&&Object.prototype.hasOwnProperty.call(n,t)),vd=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Ks);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},kp=e=>Ht(0,255,e),Ji={...Xn,transform:e=>Math.round(kp(e))},mn={test:Ys("rgb","red"),parse:vd("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ji.transform(e)+", "+Ji.transform(t)+", "+Ji.transform(n)+", "+pr(Cr.transform(r))+")"};function Sp(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Go={test:Ys("#"),parse:Sp,transform:mn.transform},Dr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Qt=Dr("deg"),Vt=Dr("%"),ye=Dr("px"),Cp=Dr("vh"),Ep=Dr("vw"),al={...Vt,parse:e=>Vt.parse(e)/100,transform:e=>Vt.transform(e*100)},Dn={test:Ys("hsl","hue"),parse:vd("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Vt.transform(pr(t))+", "+Vt.transform(pr(n))+", "+pr(Cr.transform(r))+")"},et={test:e=>mn.test(e)||Go.test(e)||Dn.test(e),parse:e=>mn.test(e)?mn.parse(e):Dn.test(e)?Dn.parse(e):Go.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?mn.transform(e):Dn.transform(e),getAnimatableNone:e=>{const t=et.parse(e);return t.alpha=0,et.transform(t)}},Tp=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ap(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ks))==null?void 0:t.length)||0)+(((n=e.match(Tp))==null?void 0:n.length)||0)>0}const wd="number",kd="color",jp="var",Pp="var(",ll="${}",Mp=/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 Er(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(Mp,l=>(et.test(l)?(r.color.push(s),i.push(kd),n.push(et.parse(l))):l.startsWith(Pp)?(r.var.push(s),i.push(jp),n.push(l)):(r.number.push(s),i.push(wd),n.push(parseFloat(l))),++s,ll)).split(ll);return{values:n,split:a,indexes:r,types:i}}function Sd(e){return Er(e).values}function Cd(e){const{split:t,types:n}=Er(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===wd?s+=pr(i[o]):a===kd?s+=et.transform(i[o]):s+=i[o]}return s}}const Np=e=>typeof e=="number"?0:et.test(e)?et.getAnimatableNone(e):e;function Ip(e){const t=Sd(e);return Cd(e)(t.map(Np))}const nn={test:Ap,parse:Sd,createTransformer:Cd,getAnimatableNone:Ip};function eo(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 Rp({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=eo(l,a,e+1/3),s=eo(l,a,e),o=eo(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function gi(e,t){return n=>n>0?t:e}const qe=(e,t,n)=>e+(t-e)*n,to=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Vp=[Go,mn,Dn],Dp=e=>Vp.find(t=>t.test(e));function cl(e){const t=Dp(e);if(Yn(!!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===Dn&&(n=Rp(n)),n}const ul=(e,t)=>{const n=cl(e),r=cl(t);if(!n||!r)return gi(e,t);const i={...n};return s=>(i.red=to(n.red,r.red,s),i.green=to(n.green,r.green,s),i.blue=to(n.blue,r.blue,s),i.alpha=qe(n.alpha,r.alpha,s),mn.transform(i))},Ko=new Set(["none","hidden"]);function Fp(e,t){return Ko.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Lp(e,t){return n=>qe(e,t,n)}function Xs(e){return typeof e=="number"?Lp:typeof e=="string"?Gs(e)?gi:et.test(e)?ul:_p:Array.isArray(e)?Ed:typeof e=="object"?et.test(e)?ul:Op:gi}function Ed(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Xs(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function Op(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Xs(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function $p(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],o=e.indexes[s][r[s]],a=e.values[o]??0;n[i]=a,r[s]++}return n}const _p=(e,t)=>{const n=nn.createTransformer(t),r=Er(e),i=Er(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ko.has(e)&&!i.values.length||Ko.has(t)&&!r.values.length?Fp(e,t):Rr(Ed($p(r,i),i.values),n):(Yn(!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"),gi(e,t))};function Td(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?qe(e,t,n):Xs(e)(e,t)}const Bp=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Be.update(t,n),stop:()=>tn(t),now:()=>it.isProcessing?it.timestamp:ft.now()}},Ad=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=Math.round(e(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},yi=2e4;function Qs(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<yi;)t+=n,r=e.next(t);return t>=yi?1/0:t}function zp(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(Qs(r),yi);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:Rt(i)}}const Hp=5;function jd(e,t,n){const r=Math.max(t-Hp,0);return ad(n-e(r),t-r)}const We={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},no=.001;function Up({duration:e=We.duration,bounce:t=We.bounce,velocity:n=We.velocity,mass:r=We.mass}){let i,s;Yn(e<=jt(We.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=Ht(We.minDamping,We.maxDamping,o),e=Ht(We.minDuration,We.maxDuration,Rt(e)),o<1?(i=c=>{const u=c*o,d=u*e,h=u-n,m=Yo(c,o),g=Math.exp(-d);return no-h/m*g},s=c=>{const d=c*o*e,h=d*n+n,m=Math.pow(o,2)*Math.pow(c,2)*e,g=Math.exp(-d),p=Yo(Math.pow(c,2),o);return(-i(c)+no>0?-1:1)*((h-m)*g)/p}):(i=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-no+u*d},s=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=Zp(i,s,a);if(e=jt(e),isNaN(l))return{stiffness:We.stiffness,damping:We.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const Wp=12;function Zp(e,t,n){let r=n;for(let i=1;i<Wp;i++)r=r-e(r)/t(r);return r}function Yo(e,t){return e*Math.sqrt(1-t*t)}const qp=["duration","bounce"],Gp=["stiffness","damping","mass"];function dl(e,t){return t.some(n=>e[n]!==void 0)}function Kp(e){let t={velocity:We.velocity,stiffness:We.stiffness,damping:We.damping,mass:We.mass,isResolvedFromDuration:!1,...e};if(!dl(e,Gp)&&dl(e,qp))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Ht(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:We.mass,stiffness:i,damping:s}}else{const n=Up(e);t={...t,...n,mass:We.mass},t.isResolvedFromDuration=!0}return t}function xi(e=We.visualDuration,t=We.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:m}=Kp({...n,velocity:-Rt(n.velocity||0)}),g=h||0,p=c/(2*Math.sqrt(l*u)),b=o-s,v=Rt(Math.sqrt(l/u)),k=Math.abs(b)<5;r||(r=k?We.restSpeed.granular:We.restSpeed.default),i||(i=k?We.restDelta.granular:We.restDelta.default);let S;if(p<1){const T=Yo(v,p);S=C=>{const N=Math.exp(-p*v*C);return o-N*((g+p*v*b)/T*Math.sin(T*C)+b*Math.cos(T*C))}}else if(p===1)S=T=>o-Math.exp(-v*T)*(b+(g+v*b)*T);else{const T=v*Math.sqrt(p*p-1);S=C=>{const N=Math.exp(-p*v*C),P=Math.min(T*C,300);return o-N*((g+p*v*b)*Math.sinh(P)+T*b*Math.cosh(P))/T}}const A={calculatedDuration:m&&d||null,next:T=>{const C=S(T);if(m)a.done=T>=d;else{let N=T===0?g:0;p<1&&(N=T===0?jt(g):jd(S,T,C));const P=Math.abs(N)<=r,L=Math.abs(o-C)<=i;a.done=P&&L}return a.value=a.done?o:C,a},toString:()=>{const T=Math.min(Qs(A),yi),C=Ad(N=>A.next(T*N).value,T,30);return T+"ms "+C},toTransition:()=>{}};return A}xi.applyToOptions=e=>{const t=zp(e,100,xi);return e.ease=t.ease,e.duration=jt(t.duration),e.type="keyframes",e};function Xo({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},m=P=>a!==void 0&&P<a||l!==void 0&&P>l,g=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let p=n*t;const b=d+p,v=o===void 0?b:o(b);v!==b&&(p=v-d);const k=P=>-p*Math.exp(-P/r),S=P=>v+k(P),A=P=>{const L=k(P),y=S(P);h.done=Math.abs(L)<=c,h.value=h.done?v:y};let T,C;const N=P=>{m(h.value)&&(T=P,C=xi({keyframes:[h.value,g(h.value)],velocity:jd(S,P,h.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return N(0),{calculatedDuration:null,next:P=>{let L=!1;return!C&&T===void 0&&(L=!0,A(P),N(P)),T!==void 0&&P>=T?C.next(P-T):(!L&&A(P),h)}}}function Yp(e,t,n){const r=[],i=n||Wt.mix||Td,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Ct:t;a=Rr(l,a)}r.push(a)}return r}function Xp(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(Ut(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Yp(t,r,i),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const h=Sr(e[d],e[d+1],u);return a[d](h)};return n?u=>c(Ht(e[0],e[s-1],u)):c}function Qp(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Sr(0,t,r);e.push(qe(n,1,i))}}function Jp(e){const t=[0];return Qp(t,e.length-1),t}function eg(e,t){return e.map(n=>n*t)}function tg(e,t){return e.map(()=>t||gd).splice(0,e.length-1)}function Fn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=hp(r)?r.map(sl):sl(r),s={done:!1,value:t[0]},o=eg(n&&n.length===t.length?n:Jp(t),e),a=Xp(o,t,{ease:Array.isArray(i)?i:tg(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const ng=e=>e!==null;function Js(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(ng),a=i<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const rg={decay:Xo,inertia:Xo,tween:Fn,keyframes:Fn,spring:xi};function Pd(e){typeof e.type=="string"&&(e.type=rg[e.type])}class ea{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 ig=e=>e/100;class ta extends ea{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,i;const{motionValue:n}=this.options;n&&n.updatedAt!==ft.now()&&this.tick(ft.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Pd(t);const{type:n=Fn,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:a}=t;const l=n||Fn;process.env.NODE_ENV!=="production"&&l!==Fn&&Ut(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==Fn&&typeof a[0]!="number"&&(this.mixKeyframes=Rr(ig,Td(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Qs(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=c}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:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:d,repeatType:h,repeatDelay:m,type:g,onUpdate:p,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const v=this.currentTime-c*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let S=this.currentTime,A=r;if(d){const P=Math.min(this.currentTime,i)/a;let L=Math.floor(P),y=P%1;!y&&P>=1&&(y=1),y===1&&L--,L=Math.min(L,d+1),!!(L%2)&&(h==="reverse"?(y=1-y,m&&(y-=m/a)):h==="mirror"&&(A=o)),S=Ht(0,1,y)*a}const T=k?{done:!1,value:u[0]}:A.next(S);s&&(T.value=s(T.value));let{done:C}=T;!k&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return N&&g!==Xo&&(T.value=Js(u,this.options,b,this.speed)),p&&p(T.value),N&&this.finish(),T}then(t,n){return this.finished.then(t,n)}get duration(){return Rt(this.calculatedDuration)}get time(){return Rt(this.currentTime)}set time(t){var n;t=jt(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(ft.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Rt(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:t=Bp,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);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(ft.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 og(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const pn=e=>e*180/Math.PI,Qo=e=>{const t=pn(Math.atan2(e[1],e[0]));return Jo(t)},sg={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Qo,rotateZ:Qo,skewX:e=>pn(Math.atan(e[1])),skewY:e=>pn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Jo=e=>(e=e%360,e<0&&(e+=360),e),fl=Qo,hl=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ml=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),ag={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:hl,scaleY:ml,scale:e=>(hl(e)+ml(e))/2,rotateX:e=>Jo(pn(Math.atan2(e[6],e[5]))),rotateY:e=>Jo(pn(Math.atan2(-e[2],e[0]))),rotateZ:fl,rotate:fl,skewX:e=>pn(Math.atan(e[4])),skewY:e=>pn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function es(e){return e.includes("scale")?1:0}function ts(e,t){if(!e||e==="none")return es(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=ag,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=sg,i=a}if(!i)return es(t);const s=r[t],o=i[1].split(",").map(cg);return typeof s=="function"?s(o):o[s]}const lg=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ts(n,t)};function cg(e){return parseFloat(e.trim())}const Qn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Jn=new Set(Qn),pl=e=>e===Xn||e===ye,ug=new Set(["x","y","z"]),dg=Qn.filter(e=>!ug.has(e));function fg(e){const t=[];return dg.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const yn={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})=>ts(t,"x"),y:(e,{transform:t})=>ts(t,"y")};yn.translateX=yn.x;yn.translateY=yn.y;const xn=new Set;let ns=!1,rs=!1,is=!1;function Md(){if(rs){const e=Array.from(xn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=fg(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}rs=!1,ns=!1,xn.forEach(e=>e.complete(is)),xn.clear()}function Nd(){xn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(rs=!0)})}function hg(){is=!0,Nd(),Md(),is=!1}class na{constructor(t,n,r,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(xn.add(this),ns||(ns=!0,Be.read(Nd),Be.resolveKeyframes(Md))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const s=i==null?void 0:i.get(),o=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),i&&s===void 0&&i.set(t[0])}og(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),xn.delete(this)}cancel(){this.state==="scheduled"&&(xn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const mg=e=>e.startsWith("--");function pg(e,t,n){mg(t)?e.style.setProperty(t,n):e.style[t]=n}const gg=zs(()=>window.ScrollTimeline!==void 0),yg={};function xg(e,t){const n=zs(e);return()=>yg[t]??n()}const Id=xg(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),fr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,gl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:fr([0,.65,.55,1]),circOut:fr([.55,0,1,.45]),backIn:fr([.31,.01,.66,-.59]),backOut:fr([.33,1.53,.69,.99])};function Rd(e,t){if(e)return typeof e=="function"?Id()?Ad(e,t):"ease-out":yd(e)?fr(e):Array.isArray(e)?e.map(n=>Rd(n,t)||gl.easeOut):gl[e]}function bg(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=Rd(a,i);Array.isArray(d)&&(u.easing=d);const h={delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(u,h)}function Vd(e){return typeof e=="function"&&"applyToOptions"in e}function vg({type:e,...t}){return Vd(e)&&Id()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class wg extends ea{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=t,Ut(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=vg(t);this.animation=bg(n,r,i,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=Js(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):pg(n,r,u),this.animation.cancel()}l==null||l(),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 Rt(Number(t))}get time(){return Rt(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=jt(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&&gg()?(this.animation.timeline=t,Ct):n(this)}}const Dd={anticipate:hd,backInOut:fd,circInOut:pd};function kg(e){return e in Dd}function Sg(e){typeof e.ease=="string"&&kg(e.ease)&&(e.ease=Dd[e.ease])}const yl=10;class Cg extends wg{constructor(t){Sg(t),Pd(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new ta({...o,autoplay:!1}),l=jt(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-yl).value,a.sample(l).value,yl),a.stop()}}const xl=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(nn.test(e)||e==="0")&&!e.startsWith("url("));function Eg(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 Tg(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=xl(i,t),a=xl(s,t);return Yn(o===a,`You are trying to animate ${t} from "${i}" to "${s}". "${o?s:i}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:Eg(e)||(n==="spring"||Vd(n))&&r}function os(e){e.duration=0,e.type}const Ag=new Set(["opacity","clipPath","filter","transform"]),jg=zs(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Pg(e){var u;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:s,type:o}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return jg()&&n&&Ag.has(n)&&(n!=="transform"||!c)&&!l&&!r&&i!=="mirror"&&s!==0&&o!=="inertia"}const Mg=40;class Ng extends ea{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...d}){var g;super(),this.stop=()=>{var p,b;this._animation&&(this._animation.stop(),(p=this.stopTimeline)==null||p.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=ft.now();const h={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,name:l,motionValue:c,element:u,...d},m=(u==null?void 0:u.KeyframeResolver)||na;this.keyframeResolver=new m(a,(p,b,v)=>this.onKeyframesResolved(p,b,h,!v),l,c,u),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,r,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=ft.now(),Tg(t,s,o,a)||((Wt.instantAnimations||!l)&&(u==null||u(Js(t,r,n))),t[0]=t[t.length-1],os(r),r.repeat=0);const h={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Mg?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=!c&&Pg(h)?new Cg({...h,element:h.motionValue.owner.current}):new ta(h);m.finished.then(()=>this.notifyFinished()).catch(Ct),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}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(),hg()),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 Ig=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Rg(e){const t=Ig.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const Vg=4;function Fd(e,t,n=1){Ut(n<=Vg,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=Rg(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return id(o)?parseFloat(o):o}return Gs(i)?Fd(i,t,n+1):i}function ra(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Ld=new Set(["width","height","top","left","right","bottom",...Qn]),Dg={test:e=>e==="auto",parse:e=>e},Od=e=>t=>t.test(e),$d=[Xn,ye,Vt,Qt,Ep,Cp,Dg],bl=e=>$d.find(Od(e));function Fg(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||sd(e):!0}const Lg=new Set(["brightness","contrast","saturate","opacity"]);function Og(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Ks)||[];if(!r)return e;const i=n.replace(r,"");let s=Lg.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const $g=/\b([a-z-]*)\(.*?\)/gu,ss={...nn,getAnimatableNone:e=>{const t=e.match($g);return t?t.map(Og).join(" "):e}},vl={...Xn,transform:Math.round},_g={rotate:Qt,rotateX:Qt,rotateY:Qt,rotateZ:Qt,scale:Wr,scaleX:Wr,scaleY:Wr,scaleZ:Wr,skew:Qt,skewX:Qt,skewY:Qt,distance:ye,translateX:ye,translateY:ye,translateZ:ye,x:ye,y:ye,z:ye,perspective:ye,transformPerspective:ye,opacity:Cr,originX:al,originY:al,originZ:ye},ia={borderWidth:ye,borderTopWidth:ye,borderRightWidth:ye,borderBottomWidth:ye,borderLeftWidth:ye,borderRadius:ye,radius:ye,borderTopLeftRadius:ye,borderTopRightRadius:ye,borderBottomRightRadius:ye,borderBottomLeftRadius:ye,width:ye,maxWidth:ye,height:ye,maxHeight:ye,top:ye,right:ye,bottom:ye,left:ye,padding:ye,paddingTop:ye,paddingRight:ye,paddingBottom:ye,paddingLeft:ye,margin:ye,marginTop:ye,marginRight:ye,marginBottom:ye,marginLeft:ye,backgroundPositionX:ye,backgroundPositionY:ye,..._g,zIndex:vl,fillOpacity:Cr,strokeOpacity:Cr,numOctaves:vl},Bg={...ia,color:et,backgroundColor:et,outlineColor:et,fill:et,stroke:et,borderColor:et,borderTopColor:et,borderRightColor:et,borderBottomColor:et,borderLeftColor:et,filter:ss,WebkitFilter:ss},_d=e=>Bg[e];function Bd(e,t){let n=_d(e);return n!==ss&&(n=nn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const zg=new Set(["auto","none","0"]);function Hg(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!zg.has(s)&&Er(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=Bd(n,i)}class Ug extends na{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Gs(c))){const u=Fd(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Ld.has(r)||t.length!==2)return;const[i,s]=t,o=bl(i),a=bl(s);if(o!==a)if(pl(o)&&pl(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else yn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||Fg(t[i]))&&r.push(i);r.length&&Hg(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=yn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=yn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function Wg(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const i=(n==null?void 0:n[e])??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}const zd=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Hd(e){return od(e)&&"offsetHeight"in e}const wl=30,Zg=e=>!isNaN(parseFloat(e));class qg{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=ft.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ft.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Zg(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Us(!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(),Be.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=ft.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>wl)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,wl);return ad(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 Zn(e,t){return new qg(e,t)}const{schedule:oa}=xd(queueMicrotask,!1),At={x:!1,y:!1};function Ud(){return At.x||At.y}function Gg(e){return e==="x"||e==="y"?At[e]?null:(At[e]=!0,()=>{At[e]=!1}):At.x||At.y?null:(At.x=At.y=!0,()=>{At.x=At.y=!1})}function Wd(e,t){const n=Wg(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function kl(e){return!(e.pointerType==="touch"||Ud())}function Kg(e,t,n={}){const[r,i,s]=Wd(e,n),o=a=>{if(!kl(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=d=>{kl(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Zd=(e,t)=>t?e===t?!0:Zd(e,t.parentElement):!1,sa=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Yg=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Xg(e){return Yg.has(e.tagName)||e.tabIndex!==-1}const ai=new WeakSet;function Sl(e){return t=>{t.key==="Enter"&&e(t)}}function ro(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Qg=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Sl(()=>{if(ai.has(n))return;ro(n,"down");const i=Sl(()=>{ro(n,"up")}),s=()=>ro(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Cl(e){return sa(e)&&!Ud()}function Jg(e,t,n={}){const[r,i,s]=Wd(e,n),o=a=>{const l=a.currentTarget;if(!Cl(a))return;ai.add(l);const c=t(l,a),u=(m,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),ai.has(l)&&ai.delete(l),Cl(m)&&typeof c=="function"&&c(m,{success:g})},d=m=>{u(m,l===window||l===document||n.useGlobalTarget||Zd(l,m.target))},h=m=>{u(m,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",h,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),Hd(a)&&(a.addEventListener("focus",c=>Qg(c,i)),!Xg(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function qd(e){return od(e)&&"ownerSVGElement"in e}function e0(e){return qd(e)&&e.tagName==="svg"}const ot=e=>!!(e&&e.getVelocity),t0=[...$d,et,nn],n0=e=>t0.find(Od(e)),aa=j.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class r0 extends x.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=Hd(r)&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function i0({children:e,isPresent:t,anchorX:n,root:r}){const i=j.useId(),s=j.useRef(null),o=j.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=j.useContext(aa);return j.useInsertionEffect(()=>{const{width:l,height:c,top:u,left:d,right:h}=o.current;if(t||!s.current||!l||!c)return;const m=n==="left"?`left: ${d}`:`right: ${h}`;s.current.dataset.motionPopId=i;const g=document.createElement("style");a&&(g.nonce=a);const p=r??document.head;return p.appendChild(g),g.sheet&&g.sheet.insertRule(`
22
22
  [data-motion-pop-id="${i}"] {
23
23
  position: absolute !important;
24
24
  width: ${l}px !important;
@@ -26,26 +26,26 @@
26
26
  ${m}px !important;
27
27
  top: ${u}px !important;
28
28
  }
29
- `),()=>{p.contains(g)&&p.removeChild(g)}},[t]),f.jsx(Hg,{isPresent:t,childRef:s,sizeRef:o,children:x.cloneElement(e,{ref:s})})}const Wg=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a,root:l})=>{const c=Rs(Zg),u=j.useId();let d=!0,h=j.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:m=>{c.set(m,!0);for(const g of c.values())if(!g)return;r&&r()},register:m=>(c.set(m,!1),()=>c.delete(m))}),[n,c,r]);return s&&d&&(h={...h}),j.useMemo(()=>{c.forEach((m,g)=>c.set(g,!1))},[n]),x.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),o==="popLayout"&&(e=f.jsx(Ug,{isPresent:n,anchorX:a,root:l,children:e})),f.jsx(Ti.Provider,{value:h,children:e})};function Zg(){return new Map}function $d(e=!0){const t=j.useContext(Ti);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=j.useId();j.useEffect(()=>{if(e)return i(s)},[e]);const o=j.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const Hr=e=>e.key||"";function yl(e){const t=[];return j.Children.forEach(e,n=>{j.isValidElement(n)&&t.push(n)}),t}const Qt=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left",root:l})=>{const[c,u]=$d(o),d=j.useMemo(()=>yl(e),[e]),h=o&&!c?[]:d.map(Hr),m=j.useRef(!0),g=j.useRef(d),p=Rs(()=>new Map),[b,v]=j.useState(d),[k,S]=j.useState(d);Gu(()=>{m.current=!1,g.current=d;for(let C=0;C<k.length;C++){const M=Hr(k[C]);h.includes(M)?p.delete(M):p.get(M)!==!0&&p.set(M,!1)}},[k,h.length,h.join("-")]);const A=[];if(d!==b){let C=[...d];for(let M=0;M<k.length;M++){const P=k[M],L=Hr(P);h.includes(L)||(C.splice(M,0,P),A.push(P))}return s==="wait"&&A.length&&(C=A),S(yl(C)),v(d),null}process.env.NODE_ENV!=="production"&&s==="wait"&&k.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:T}=j.useContext(Is);return f.jsx(f.Fragment,{children:k.map(C=>{const M=Hr(C),P=o&&!c?!1:d===k||h.includes(M),L=()=>{if(p.has(M))p.set(M,!0);else return;let y=!0;p.forEach(N=>{N||(y=!1)}),y&&(T==null||T(),S(g.current),o&&(u==null||u()),r&&r())};return f.jsx(Wg,{isPresent:P,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:l,onExitComplete:P?void 0:L,anchorX:a,children:C},M)})})},_d=j.createContext({strict:!1}),xl={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"]},Un={};for(const e in xl)Un[e]={isEnabled:t=>xl[e].some(n=>!!t[n])};function qg(e){for(const t in e)Un[t]={...Un[t],...e[t]}}const Gg=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 gi(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Gg.has(e)}let Bd=e=>!gi(e);function Kg(e){typeof e=="function"&&(Bd=t=>t.startsWith("on")?!gi(t):e(t))}try{Kg(require("@emotion/is-prop-valid").default)}catch{}function Yg(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Bd(i)||n===!0&&gi(i)||!t&&!gi(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const Ai=j.createContext({});function ji(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Sr(e){return typeof e=="string"||Array.isArray(e)}const ra=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ia=["initial",...ra];function Pi(e){return ji(e.animate)||ia.some(t=>Sr(e[t]))}function zd(e){return!!(Pi(e)||e.variants)}function Xg(e,t){if(Pi(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Sr(n)?n:void 0,animate:Sr(r)?r:void 0}}return e.inherit!==!1?t:{}}function Qg(e){const{initial:t,animate:n}=Xg(e,j.useContext(Ai));return j.useMemo(()=>({initial:t,animate:n}),[bl(t),bl(n)])}function bl(e){return Array.isArray(e)?e.join(" "):e}const Cr={};function Jg(e){for(const t in e)Cr[t]=e[t],zs(t)&&(Cr[t].isCSSVariable=!0)}function Hd(e,{layout:t,layoutId:n}){return Yn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Cr[e]||e==="opacity")}const e0={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},t0=Kn.length;function n0(e,t,n){let r="",i=!0;for(let s=0;s<t0;s++){const o=Kn[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Rd(a,Js[o]);if(!l){i=!1;const u=e0[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function oa(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(Yn.has(l)){o=!0;continue}else if(zs(l)){i[l]=c;continue}else{const u=Rd(c,Js[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=n0(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${c} ${u}`}}const sa=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ud(e,t,n){for(const r in t)!it(t[r])&&!Hd(r,n)&&(e[r]=t[r])}function r0({transformTemplate:e},t){return j.useMemo(()=>{const n=sa();return oa(n,t,e),Object.assign({},n.vars,n.style)},[t])}function i0(e,t){const n=e.style||{},r={};return Ud(r,n,e),Object.assign(r,r0(e,t)),r}function o0(e,t){const n={},r=i0(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 s0={offset:"stroke-dashoffset",array:"stroke-dasharray"},a0={offset:"strokeDashoffset",array:"strokeDasharray"};function l0(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?s0:a0;e[s.offset]=ye.transform(-r);const o=ye.transform(t),a=ye.transform(n);e[s.array]=`${o} ${a}`}function Wd(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a},l,c,u){if(oa(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:h}=e;d.transform&&(h.transform=d.transform,delete d.transform),(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&l0(d,i,s,o,!1)}const Zd=()=>({...sa(),attrs:{}}),qd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function c0(e,t,n,r){const i=j.useMemo(()=>{const s=Zd();return Wd(s,t,qd(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Ud(s,e.style,e),i.style={...s,...i.style}}return i}const u0=["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 aa(e){return typeof e!="string"||e.includes("-")?!1:!!(u0.indexOf(e)>-1||/[A-Z]/u.test(e))}function d0(e,t,n,{latestValues:r},i,s=!1){const a=(aa(e)?c0:o0)(t,r,i,e),l=Yg(t,typeof e=="string",s),c=e!==j.Fragment?{...l,...a,ref:n}:{},{children:u}=t,d=j.useMemo(()=>it(u)?u.get():u,[u]);return j.createElement(e,{...c,children:d})}function vl(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function la(e,t,n,r){if(typeof t=="function"){const[i,s]=vl(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=vl(r);t=t(n!==void 0?n:e.custom,i,s)}return t}function oi(e){return it(e)?e.get():e}function f0({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:h0(n,r,i,e),renderState:t()}}function h0(e,t,n,r){const i={},s=r(e,{});for(const h in s)i[h]=oi(s[h]);let{initial:o,animate:a}=e;const l=Pi(e),c=zd(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!ji(d)){const h=Array.isArray(d)?d:[d];for(let m=0;m<h.length;m++){const g=la(e,h[m]);if(g){const{transitionEnd:p,transition:b,...v}=g;for(const k in v){let S=v[k];if(Array.isArray(S)){const A=u?S.length-1:0;S=S[A]}S!==null&&(i[k]=S)}for(const k in p)i[k]=p[k]}}}return i}const Gd=e=>(t,n)=>{const r=j.useContext(Ai),i=j.useContext(Ti),s=()=>f0(e,t,r,i);return n?s():Rs(s)};function ca(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(it(r[o])||t.style&&it(t.style[o])||Hd(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const m0=Gd({scrapeMotionValuesFromProps:ca,createRenderState:sa});function Kd(e,t,n){const r=ca(e,t,n);for(const i in e)if(it(e[i])||it(t[i])){const s=Kn.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const p0=Gd({scrapeMotionValuesFromProps:Kd,createRenderState:Zd}),g0=Symbol.for("motionComponentSymbol");function Dn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function y0(e,t,n){return j.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Dn(n)&&(n.current=r))},[t])}const ua=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),x0="framerAppearId",Yd="data-"+ua(x0),Xd=j.createContext({});function b0(e,t,n,r,i){var p,b;const{visualElement:s}=j.useContext(Ai),o=j.useContext(_d),a=j.useContext(Ti),l=j.useContext(na).reducedMotion,c=j.useRef(null);r=r||o.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,d=j.useContext(Xd);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&v0(c.current,n,i,d);const h=j.useRef(!1);j.useInsertionEffect(()=>{u&&h.current&&u.update(n,a)});const m=n[Yd],g=j.useRef(!!m&&!((p=window.MotionHandoffIsComplete)!=null&&p.call(window,m))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,m)));return Gu(()=>{u&&(h.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),j.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var v;(v=window.MotionHandoffMarkAsComplete)==null||v.call(window,m)}),g.current=!1),u.enteringChildren=void 0)}),u}function v0(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Qd(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Dn(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function Qd(e){if(e)return e.options.allowProjection!==!1?e.projection:Qd(e.parent)}function Ji(e,{forwardMotionProps:t=!1}={},n,r){n&&qg(n);const i=aa(e)?p0:m0;function s(a,l){let c;const u={...j.useContext(na),...a,layoutId:w0(a)},{isStatic:d}=u,h=Qg(a),m=i(a,d);if(!d&&Vs){k0(u,n);const g=S0(u);c=g.MeasureLayout,h.visualElement=b0(e,m,u,r,g.ProjectionNode)}return f.jsxs(Ai.Provider,{value:h,children:[c&&h.visualElement?f.jsx(c,{visualElement:h.visualElement,...u}):null,d0(e,a,y0(m,h.visualElement,l),m,d,t)]})}s.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=j.forwardRef(s);return o[g0]=e,o}function w0({layoutId:e}){const t=j.useContext(Is).id;return t&&e!==void 0?t+"-"+e:e}function k0(e,t){const n=j.useContext(_d).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?qn(!1,r,"lazy-strict-mode"):zt(!1,r,"lazy-strict-mode")}}function S0(e){const{drag:t,layout:n}=Un;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 C0(e,t){if(typeof Proxy>"u")return Ji;const n=new Map,r=(s,o)=>Ji(s,o,e,t),i=(s,o)=>(process.env.NODE_ENV!=="production"&&$s(!1,"motion() is deprecated. Use motion.create() instead."),r(s,o));return new Proxy(i,{get:(s,o)=>o==="create"?r:(n.has(o)||n.set(o,Ji(o,void 0,e,t)),n.get(o))})}function Jd({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function E0({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function T0(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 eo(e){return e===void 0||e===1}function ns({scale:e,scaleX:t,scaleY:n}){return!eo(e)||!eo(t)||!eo(n)}function dn(e){return ns(e)||ef(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ef(e){return wl(e.x)||wl(e.y)}function wl(e){return e&&e!=="0%"}function yi(e,t,n){const r=e-n,i=t*r;return n+i}function kl(e,t,n,r,i){return i!==void 0&&(e=yi(e,i,r)),yi(e,n,r)+t}function rs(e,t=0,n=1,r,i){e.min=kl(e.min,t,n,r,i),e.max=kl(e.max,t,n,r,i)}function tf(e,{x:t,y:n}){rs(e.x,t.translate,t.scale,t.originPoint),rs(e.y,n.translate,n.scale,n.originPoint)}const Sl=.999999999999,Cl=1.0000000000001;function A0(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ln(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,tf(e,o)),r&&dn(s.latestValues)&&Ln(e,s.latestValues))}t.x<Cl&&t.x>Sl&&(t.x=1),t.y<Cl&&t.y>Sl&&(t.y=1)}function Fn(e,t){e.min=e.min+t,e.max=e.max+t}function El(e,t,n,r,i=.5){const s=qe(e.min,e.max,i);rs(e,t,n,s,r)}function Ln(e,t){El(e.x,t.x,t.scaleX,t.scale,t.originX),El(e.y,t.y,t.scaleY,t.scale,t.originY)}function nf(e,t){return Jd(T0(e.getBoundingClientRect(),t))}function j0(e,t,n){const r=nf(e,n),{scroll:i}=t;return i&&(Fn(r.x,i.offset.x),Fn(r.y,i.offset.y)),r}const Tl=()=>({translate:0,scale:1,origin:0,originPoint:0}),On=()=>({x:Tl(),y:Tl()}),Al=()=>({min:0,max:0}),Ye=()=>({x:Al(),y:Al()}),is={current:null},rf={current:!1};function P0(){if(rf.current=!0,!!Vs)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>is.current=e.matches;e.addEventListener("change",t),t()}else is.current=!1}const N0=new WeakMap;function M0(e,t,n){for(const r in t){const i=t[r],s=n[r];if(it(i))e.addValue(r,i);else if(it(s))e.addValue(r,Hn(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,Hn(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const jl=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class I0{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Xs,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=dt.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Be.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Pi(n),this.isVariantNode=zd(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in d){const m=d[h];l[h]!==void 0&&it(m)&&m.set(l[h])}}mount(t){var n;this.current=t,N0.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,i)=>this.bindToMotionValue(i,r)),rf.current||P0(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:is.current,process.env.NODE_ENV!=="production"&&$s(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(),Jt(this.notifyUpdate),Jt(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=Yn.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Be.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),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 Un){const n=Un[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ye()}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<jl.length;r++){const i=jl[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=M0(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=Hn(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"&&(Ku(r)||Xu(r))?r=parseFloat(r):!zg(r)&&en.test(n)&&(r=Id(t,n)),this.setBaseTarget(t,it(r)?r.get():r)),it(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=la(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!it(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Os),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){ea.render(this.render)}}class of extends I0{constructor(){super(...arguments),this.KeyframeResolver=Ng}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;it(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function sf(e,{style:t,vars:n},r,i){const s=e.style;let o;for(o in t)s[o]=t[o];i==null||i.applyProjectionStyles(s,r);for(o in n)s.setProperty(o,n[o])}function R0(e){return window.getComputedStyle(e)}class V0 extends of{constructor(){super(...arguments),this.type="html",this.renderInstance=sf}readValueFromInstance(t,n){var r;if(Yn.has(n))return(r=this.projection)!=null&&r.isProjecting?Ko(n):Gp(t,n);{const i=R0(t),s=(zs(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return nf(t,n)}build(t,n,r){oa(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return ca(t,n,r)}}const af=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 D0(e,t,n,r){sf(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(af.has(i)?i:ua(i),t.attrs[i])}class F0 extends of{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ye}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Yn.has(n)){const r=Md(n);return r&&r.default||0}return n=af.has(n)?n:ua(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Kd(t,n,r)}build(t,n,r){Wd(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){D0(t,n,r,i)}mount(t){this.isSVGTag=qd(t.tagName),super.mount(t)}}const L0=(e,t)=>aa(e)?new F0(t):new V0(t,{allowProjection:e!==j.Fragment});function $n(e,t,n){const r=e.getProps();return la(r,t,n!==void 0?n:r.custom,e)}const os=e=>Array.isArray(e);function O0(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Hn(n))}function $0(e){return os(e)?e[e.length-1]||0:e}function _0(e,t){const n=$n(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=$0(s[o]);O0(e,o,a)}}function B0(e){return!!(it(e)&&e.add)}function ss(e,t){const n=e.getValue("willChange");if(B0(n))return n.add(t);if(!n&&Ht.WillChange){const r=new Ht.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function lf(e){return e.props[Yd]}const z0=e=>e!==null;function H0(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(z0),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[s]}const U0={type:"spring",stiffness:500,damping:25,restSpeed:10},W0=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Z0={type:"keyframes",duration:.8},q0={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},G0=(e,{keyframes:t})=>t.length>2?Z0:Yn.has(e)?e.startsWith("scale")?W0(t[1]):U0:q0;function K0({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const da=(e,t,n,r={},i,s)=>o=>{const a=Qs(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-At(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};K0(a)||Object.assign(u,G0(e,u)),u.duration&&(u.duration=At(u.duration)),u.repeatDelay&&(u.repeatDelay=At(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(es(u),u.delay===0&&(d=!0)),(Ht.instantAnimations||Ht.skipAnimations)&&(d=!0,es(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!s&&t.get()!==void 0){const h=H0(u.keyframes,a);if(h!==void 0){Be.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new Ys(u):new yg(u)};function Y0({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function cf(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:o,...a}=t;r&&(s=r);const l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),h=a[u];if(h===void 0||c&&Y0(c,u))continue;const m={delay:n,...Qs(s||{},u)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(h)&&h===g&&!m.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const v=lf(e);if(v){const k=window.MotionHandoffAnimation(v,u,Be);k!==null&&(m.startTime=k,p=!0)}}ss(e,u),d.start(da(u,d,h,e.shouldReduceMotion&&jd.has(u)?{type:!1}:m,e,p));const b=d.animation;b&&l.push(b)}return o&&Promise.all(l).then(()=>{Be.update(()=>{o&&_0(e,o)})}),l}function uf(e,t,n,r=0,i=1){const s=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),o=e.size,a=(o-1)*r;return typeof n=="function"?n(s,o):i===1?s*r:a-s*r}function as(e,t,n={}){var l;const r=$n(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(cf(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=i;return X0(e,t,c,u,d,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[s,o]:[o,s];return c().then(()=>u())}else return Promise.all([s(),o(n.delay)])}function X0(e,t,n=0,r=0,i=0,s=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(as(l,t,{...o,delay:n+(typeof r=="function"?0:r)+uf(e.variantChildren,l,r,i,s)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function Q0(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>as(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=as(e,t,n);else{const i=typeof t=="function"?$n(e,t,n.custom):t;r=Promise.all(cf(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function df(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 J0=ia.length;function ff(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?ff(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<J0;n++){const r=ia[n],i=e.props[r];(Sr(i)||i===!1)&&(t[r]=i)}return t}const ey=[...ra].reverse(),ty=ra.length;function ny(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Q0(e,n,r)))}function ry(e){let t=ny(e),n=Pl(),r=!0;const i=l=>(c,u)=>{var h;const d=$n(e,u,l==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(d){const{transition:m,transitionEnd:g,...p}=d;c={...c,...p,...g}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,u=ff(e.parent)||{},d=[],h=new Set;let m={},g=1/0;for(let b=0;b<ty;b++){const v=ey[b],k=n[v],S=c[v]!==void 0?c[v]:u[v],A=Sr(S),T=v===l?k.isActive:null;T===!1&&(g=b);let C=S===u[v]&&S!==c[v]&&A;if(C&&r&&e.manuallyAnimateOnMount&&(C=!1),k.protectedKeys={...m},!k.isActive&&T===null||!S&&!k.prevProp||ji(S)||typeof S=="boolean")continue;const M=iy(k.prevProp,S);let P=M||v===l&&k.isActive&&!C&&A||b>g&&A,L=!1;const y=Array.isArray(S)?S:[S];let N=y.reduce(i(v),{});T===!1&&(N={});const{prevResolvedValues:D={}}=k,B={...D,...N},H=ie=>{P=!0,h.has(ie)&&(L=!0,h.delete(ie)),k.needsAnimating[ie]=!0;const F=e.getValue(ie);F&&(F.liveStyle=!1)};for(const ie in B){const F=N[ie],W=D[ie];if(m.hasOwnProperty(ie))continue;let w=!1;os(F)&&os(W)?w=!df(F,W):w=F!==W,w?F!=null?H(ie):h.add(ie):F!==void 0&&h.has(ie)?H(ie):k.protectedKeys[ie]=!0}k.prevProp=S,k.prevResolvedValues=N,k.isActive&&(m={...m,...N}),r&&e.blockInitialAnimation&&(P=!1);const K=C&&M;P&&(!K||L)&&d.push(...y.map(ie=>{const F={type:v};if(typeof ie=="string"&&r&&!K&&e.manuallyAnimateOnMount&&e.parent){const{parent:W}=e,w=$n(W,ie);if(W.enteringChildren&&w){const{delayChildren:z}=w.transition||{};F.delay=uf(W.enteringChildren,e,z)}}return{animation:ie,options:F}}))}if(h.size){const b={};if(typeof c.initial!="boolean"){const v=$n(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(b.transition=v.transition)}h.forEach(v=>{const k=e.getBaseTarget(v),S=e.getValue(v);S&&(S.liveStyle=!0),b[v]=k??null}),d.push({animation:b})}let p=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(d):Promise.resolve()}function a(l,c){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(h=>{var m;return(m=h.animationState)==null?void 0:m.setActive(l,c)}),n[l].isActive=c;const u=o(l);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Pl(),r=!0}}}function iy(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!df(t,e):!1}function ln(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Pl(){return{animate:ln(!0),whileInView:ln(),whileHover:ln(),whileTap:ln(),whileDrag:ln(),whileFocus:ln(),exit:ln()}}class rn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class oy extends rn{constructor(t){super(t),t.animationState||(t.animationState=ry(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ji(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 sy=0;class ay extends rn{constructor(){super(...arguments),this.id=sy++}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 i=this.node.animationState.setActive("exit",!t);n&&!t&&i.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 ly={animation:{Feature:oy},exit:{Feature:ay}};function Er(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Rr(e){return{point:{x:e.pageX,y:e.pageY}}}const cy=e=>t=>ta(t)&&e(t,Rr(t));function hr(e,t,n,r){return Er(e,t,cy(n),r)}const hf=1e-4,uy=1-hf,dy=1+hf,mf=.01,fy=0-mf,hy=0+mf;function lt(e){return e.max-e.min}function my(e,t,n){return Math.abs(e-t)<=n}function Nl(e,t,n,r=.5){e.origin=r,e.originPoint=qe(t.min,t.max,e.origin),e.scale=lt(n)/lt(t),e.translate=qe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=uy&&e.scale<=dy||isNaN(e.scale))&&(e.scale=1),(e.translate>=fy&&e.translate<=hy||isNaN(e.translate))&&(e.translate=0)}function mr(e,t,n,r){Nl(e.x,t.x,n.x,r?r.originX:void 0),Nl(e.y,t.y,n.y,r?r.originY:void 0)}function Ml(e,t,n){e.min=n.min+t.min,e.max=e.min+lt(t)}function py(e,t,n){Ml(e.x,t.x,n.x),Ml(e.y,t.y,n.y)}function Il(e,t,n){e.min=t.min-n.min,e.max=e.min+lt(t)}function pr(e,t,n){Il(e.x,t.x,n.x),Il(e.y,t.y,n.y)}function bt(e){return[e("x"),e("y")]}const pf=({current:e})=>e?e.ownerDocument.defaultView:null,Rl=(e,t)=>Math.abs(e-t);function gy(e,t){const n=Rl(e.x,t.x),r=Rl(e.y,t.y);return Math.sqrt(n**2+r**2)}class gf{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=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=no(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=gy(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:p}=h,{timestamp:b}=rt;this.history.push({...p,timestamp:b});const{onStart:v,onMove:k}=this.handlers;m||(v&&v(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,h)},this.handlePointerMove=(h,m)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=to(m,this.transformPagePoint),Be.update(this.updatePoint,!0)},this.handlePointerUp=(h,m)=>{this.end();const{onEnd:g,onSessionEnd:p,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=no(h.type==="pointercancel"?this.lastMoveEventInfo:to(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(h,v),p&&p(h,v)},!ta(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=i||window;const a=Rr(t),l=to(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=rt;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,no(l,this.history)),this.removeListeners=Nr(hr(this.contextWindow,"pointermove",this.handlePointerMove),hr(this.contextWindow,"pointerup",this.handlePointerUp),hr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Jt(this.updatePoint)}}function to(e,t){return t?{point:t(e.point)}:e}function Vl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function no({point:e},t){return{point:e,delta:Vl(e,yf(t)),offset:Vl(e,yy(t)),velocity:xy(t,.1)}}function yy(e){return e[0]}function yf(e){return e[e.length-1]}function xy(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=yf(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>At(t)));)n--;if(!r)return{x:0,y:0};const s=It(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function by(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?qe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?qe(n,e,r.max):Math.min(e,n)),e}function Dl(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 vy(e,{top:t,left:n,bottom:r,right:i}){return{x:Dl(e.x,n,i),y:Dl(e.y,t,r)}}function Fl(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 wy(e,t){return{x:Fl(e.x,t.x),y:Fl(e.y,t.y)}}function ky(e,t){let n=.5;const r=lt(e),i=lt(t);return i>r?n=vr(t.min,t.max-r,e.min):r>i&&(n=vr(e.min,e.max-i,t.min)),Bt(0,1,n)}function Sy(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 ls=.35;function Cy(e=ls){return e===!1?e=0:e===!0&&(e=ls),{x:Ll(e,"left","right"),y:Ll(e,"top","bottom")}}function Ll(e,t,n){return{min:Ol(e,t),max:Ol(e,n)}}function Ol(e,t){return typeof e=="number"?e:e[t]||0}const Ey=new WeakMap;class Ty{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=Ye(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=d=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Rr(d).point)},o=(d,h)=>{const{drag:m,dragPropagation:g,onDragStart:p}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Vg(m),!this.openDragLock))return;this.latestPointerEvent=d,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),bt(v=>{let k=this.getAxisMotionValue(v).get()||0;if(Rt.test(k)){const{projection:S}=this.visualElement;if(S&&S.layout){const A=S.layout.layoutBox[v];A&&(k=lt(A)*(parseFloat(k)/100))}}this.originPoint[v]=k}),p&&Be.postRender(()=>p(d,h)),ss(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h;const{dragPropagation:m,dragDirectionLock:g,onDirectionLock:p,onDrag:b}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:v}=h;if(g&&this.currentDirection===null){this.currentDirection=Ay(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",h.point,v),this.updateAxis("y",h.point,v),this.visualElement.render(),b&&b(d,h)},l=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h,this.stop(d,h),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>bt(d=>{var h;return this.getAnimationState(d)==="paused"&&((h=this.getAxisMotionValue(d).animation)==null?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new gf(t,{onSessionStart:s,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:pf(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&Be.postRender(()=>a(r,i))}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:i}=this.getProps();if(!r||!Ur(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=by(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&Dn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=vy(r.layoutBox,t):this.constraints=!1,this.elastic=Cy(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&bt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Sy(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Dn(t))return!1;const r=t.current;zt(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:i}=this.visualElement;if(!i||!i.layout)return!1;const s=j0(r,i.root,this.visualElement.getTransformPagePoint());let o=wy(i.layout.layoutBox,s);if(n){const a=n(E0(o));this.hasMutatedConstraints=!!a,a&&(o=Jd(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=bt(u=>{if(!Ur(u,n,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const h=i?200:1e6,m=i?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ss(this.visualElement,t),r.start(da(t,r,0,n,this.visualElement,!1))}stopAnimation(){bt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){bt(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(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){bt(n=>{const{drag:r}=this.getProps();if(!Ur(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-qe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Dn(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};bt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=ky({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),bt(o=>{if(!Ur(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(qe(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;Ey.set(this.visualElement,this);const t=this.visualElement.current,n=hr(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Dn(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Be.read(r);const o=Er(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(bt(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=ls,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Ur(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Ay(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class jy extends rn{constructor(t){super(t),this.removeGroupControls=St,this.removeListeners=St,this.controls=new Ty(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||St}unmount(){this.removeGroupControls(),this.removeListeners()}}const $l=e=>(t,n)=>{e&&Be.postRender(()=>e(t,n))};class Py extends rn{constructor(){super(...arguments),this.removePointerDownListener=St}onPointerDown(t){this.session=new gf(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:pf(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:$l(t),onStart:$l(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Be.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=hr(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 si={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function _l(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const nr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ye.test(e))e=parseFloat(e);else return e;const n=_l(e,t.target.x),r=_l(e,t.target.y);return`${n}% ${r}%`}},Ny={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=en.parse(e);if(i.length>5)return r;const s=en.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const c=qe(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};let ro=!1;class My extends j.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;Jg(Iy),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),ro&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),si.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:o}=r;return o&&(o.isPresent=s,ro=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Be.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ea.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;ro=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function xf(e){const[t,n]=$d(),r=j.useContext(Is);return f.jsx(My,{...e,layoutGroup:r,switchLayoutGroup:j.useContext(Xd),isPresent:t,safeToRemove:n})}const Iy={borderRadius:{...nr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:nr,borderTopRightRadius:nr,borderBottomLeftRadius:nr,borderBottomRightRadius:nr,boxShadow:Ny};function Ry(e,t,n){const r=it(e)?e:Hn(e);return r.start(da("",r,t,n)),r.animation}const Vy=(e,t)=>e.depth-t.depth;class Dy{constructor(){this.children=[],this.isDirty=!1}add(t){Ds(this.children,t),this.isDirty=!0}remove(t){Fs(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Vy),this.isDirty=!1,this.children.forEach(t)}}function Fy(e,t){const n=dt.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(Jt(r),e(s-t))};return Be.setup(r,!0),()=>Jt(r)}const bf=["TopLeft","TopRight","BottomLeft","BottomRight"],Ly=bf.length,Bl=e=>typeof e=="string"?parseFloat(e):e,zl=e=>typeof e=="number"||ye.test(e);function Oy(e,t,n,r,i,s){i?(e.opacity=qe(0,n.opacity??1,$y(r)),e.opacityExit=qe(t.opacity??1,0,_y(r))):s&&(e.opacity=qe(t.opacity??1,n.opacity??1,r));for(let o=0;o<Ly;o++){const a=`border${bf[o]}Radius`;let l=Hl(t,a),c=Hl(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||zl(l)===zl(c)?(e[a]=Math.max(qe(Bl(l),Bl(c),r),0),(Rt.test(c)||Rt.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=qe(t.rotate||0,n.rotate||0,r))}function Hl(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const $y=vf(0,.5,od),_y=vf(.5,.95,St);function vf(e,t,n){return r=>r<e?0:r>t?1:n(vr(e,t,r))}function Ul(e,t){e.min=t.min,e.max=t.max}function xt(e,t){Ul(e.x,t.x),Ul(e.y,t.y)}function Wl(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Zl(e,t,n,r,i){return e-=t,e=yi(e,1/n,r),i!==void 0&&(e=yi(e,1/i,r)),e}function By(e,t=0,n=1,r=.5,i,s=e,o=e){if(Rt.test(t)&&(t=parseFloat(t),t=qe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=qe(s.min,s.max,r);e===s&&(a-=t),e.min=Zl(e.min,t,n,a,i),e.max=Zl(e.max,t,n,a,i)}function ql(e,t,[n,r,i],s,o){By(e,t[n],t[r],t[i],t.scale,s,o)}const zy=["x","scaleX","originX"],Hy=["y","scaleY","originY"];function Gl(e,t,n,r){ql(e.x,t,zy,n?n.x:void 0,r?r.x:void 0),ql(e.y,t,Hy,n?n.y:void 0,r?r.y:void 0)}function Kl(e){return e.translate===0&&e.scale===1}function wf(e){return Kl(e.x)&&Kl(e.y)}function Yl(e,t){return e.min===t.min&&e.max===t.max}function Uy(e,t){return Yl(e.x,t.x)&&Yl(e.y,t.y)}function Xl(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function kf(e,t){return Xl(e.x,t.x)&&Xl(e.y,t.y)}function Ql(e){return lt(e.x)/lt(e.y)}function Jl(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Wy{constructor(){this.members=[]}add(t){Ds(this.members,t),t.scheduleRender()}remove(t){if(Fs(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(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;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:i}=t.options;i===!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 Zy(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:h,skewX:m,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const io=["","X","Y","Z"],qy=1e3;let Gy=0;function oo(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Sf(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=lf(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Be,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Sf(r)}function Cf({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Gy++,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(Xy),this.nodes.forEach(tx),this.nodes.forEach(nx),this.nodes.forEach(Qy)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,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 l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Dy)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Os),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Od(o)&&!_g(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,d=0;const h=()=>this.root.updateBlockedByResize=!1;Be.read(()=>{d=window.innerWidth}),e(o,()=>{const m=window.innerWidth;m!==d&&(d=m,this.root.updateBlockedByResize=!0,u&&u(),u=Fy(h,250),si.hasAnimatedSinceResize&&(si.hasAnimatedSinceResize=!1,this.nodes.forEach(nc)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||ax,{onLayoutAnimationStart:p,onLayoutAnimationComplete:b}=c.getProps(),v=!this.targetLayout||!kf(this.targetLayout,m),k=!d&&h;if(this.options.layoutRoot||this.resumeFrom||k||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S={...Qs(g,"layout"),onPlay:p,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(u,k)}else d||nc(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Jt(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(rx),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Sf(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ec);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(tc);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ex),this.nodes.forEach(Ky),this.nodes.forEach(Yy)):this.nodes.forEach(tc),this.clearAllSnapshots();const a=dt.now();rt.delta=Bt(0,1e3/60,a-rt.timestamp),rt.timestamp=a,rt.isProcessing=!0,qi.update.process(rt),qi.preRender.process(rt),qi.render.process(rt),rt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ea.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Jy),this.sharedNodes.forEach(ix)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Be.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Be.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!lt(this.snapshot.measuredBox.x)&&!lt(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ye(),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,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!wf(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||dn(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),lx(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return Ye();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(cx))){const{scroll:u}=this.root;u&&(Fn(a.x,u.offset.x),Fn(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=Ye();if(xt(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&xt(a,o),Fn(a.x,d.offset.x),Fn(a.y,d.offset.y))}return a}applyTransform(o,a=!1){const l=Ye();xt(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Ln(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),dn(u.latestValues)&&Ln(l,u.latestValues)}return dn(this.latestValues)&&Ln(l,this.latestValues),l}removeTransform(o){const a=Ye();xt(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!dn(c.latestValues))continue;ns(c.latestValues)&&c.updateSnapshot();const u=Ye(),d=c.measurePageBox();xt(u,d),Gl(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return dn(this.latestValues)&&Gl(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==rt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!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 l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=rt.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ye(),this.relativeTargetOrigin=Ye(),pr(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),xt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ye(),this.targetWithTransforms=Ye()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),py(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):xt(this.target,this.layout.layoutBox),tf(this.target,this.targetDelta)):xt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ye(),this.relativeTargetOrigin=Ye(),pr(this.relativeTargetOrigin,this.target,m.target),xt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ns(this.parent.latestValues)||ef(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 g;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===rt.timestamp&&(l=!1),l)return;const{layout:c,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||!(c||u))return;xt(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;A0(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Ye());const{target:m}=o;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Wl(this.prevProjectionDelta.x,this.projectionDelta.x),Wl(this.prevProjectionDelta.y,this.projectionDelta.y)),mr(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!Jl(this.projectionDelta.x,this.prevProjectionDelta.x)||!Jl(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=On(),this.projectionDelta=On(),this.projectionDeltaWithTransform=On()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=On();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Ye(),m=l?l.source:void 0,g=this.layout?this.layout.source:void 0,p=m!==g,b=this.getStack(),v=!b||b.members.length<=1,k=!!(p&&!v&&this.options.crossfade===!0&&!this.path.some(sx));this.animationProgress=0;let S;this.mixTargetDelta=A=>{const T=A/1e3;rc(d.x,o.x,T),rc(d.y,o.y,T),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(pr(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ox(this.relativeTarget,this.relativeTargetOrigin,h,T),S&&Uy(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=Ye()),xt(S,this.relativeTarget)),p&&(this.animationValues=u,Oy(u,c,this.latestValues,T,k,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Jt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Be.update(()=>{si.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Hn(0)),this.currentAnimation=Ry(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(qy),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Ef(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Ye();const d=lt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=lt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}xt(a,l),Ln(a,u),mr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Wy),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&oo("z",o,c,this.animationValues);for(let u=0;u<io.length;u++)oo(`rotate${io[u]}`,o,c,this.animationValues),oo(`skew${io[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=oi(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=oi(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!dn(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=Zy(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),o.transform=d;const{x:h,y:m}=this.projectionDelta;o.transformOrigin=`${h.origin*100}% ${m.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in Cr){if(u[g]===void 0)continue;const{correct:p,applyTo:b,isCSSVariable:v}=Cr[g],k=d==="none"?u[g]:p(u[g],c);if(b){const S=b.length;for(let A=0;A<S;A++)o[b[A]]=k}else v?this.options.visualElement.renderState.vars[g]=k:o[g]=k}this.options.layoutId&&(o.pointerEvents=c===this?oi(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(ec),this.root.sharedNodes.clear()}}}function Ky(e){e.updateLayout()}function Yy(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:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?bt(d=>{const h=o?t.measuredBox[d]:t.layoutBox[d],m=lt(h);h.min=r[d].min,h.max=h.min+m}):Ef(s,t.layoutBox,r)&&bt(d=>{const h=o?t.measuredBox[d]:t.layoutBox[d],m=lt(r[d]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+m)});const a=On();mr(a,r,t.layoutBox);const l=On();o?mr(l,e.applyTransform(i,!0),t.measuredBox):mr(l,r,t.layoutBox);const c=!wf(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:m}=d;if(h&&m){const g=Ye();pr(g,t.layoutBox,h.layoutBox);const p=Ye();pr(p,r,m.layoutBox),kf(g,p)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=g,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Xy(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 Qy(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Jy(e){e.clearSnapshot()}function ec(e){e.clearMeasurements()}function tc(e){e.isLayoutDirty=!1}function ex(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function nc(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function tx(e){e.resolveTargetDelta()}function nx(e){e.calcProjection()}function rx(e){e.resetSkewAndRotation()}function ix(e){e.removeLeadSnapshot()}function rc(e,t,n){e.translate=qe(t.translate,0,n),e.scale=qe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ic(e,t,n,r){e.min=qe(t.min,n.min,r),e.max=qe(t.max,n.max,r)}function ox(e,t,n,r){ic(e.x,t.x,n.x,r),ic(e.y,t.y,n.y,r)}function sx(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ax={duration:.45,ease:[.4,0,.1,1]},oc=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),sc=oc("applewebkit/")&&!oc("chrome/")?Math.round:St;function ac(e){e.min=sc(e.min),e.max=sc(e.max)}function lx(e){ac(e.x),ac(e.y)}function Ef(e,t,n){return e==="position"||e==="preserve-aspect"&&!my(Ql(t),Ql(n),.2)}function cx(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const ux=Cf({attachResizeListener:(e,t)=>Er(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),so={current:void 0},Tf=Cf({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!so.current){const e=new ux({});e.mount(window),e.setOptions({layoutScroll:!0}),so.current=e}return so.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),dx={pan:{Feature:Py},drag:{Feature:jy,ProjectionNode:Tf,MeasureLayout:xf}};function lc(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Be.postRender(()=>s(t,Rr(t)))}class fx extends rn{mount(){const{current:t}=this.node;t&&(this.unmount=Dg(t,(n,r)=>(lc(this.node,r,"Start"),i=>lc(this.node,i,"End"))))}unmount(){}}class hx extends rn{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=Nr(Er(this.node.current,"focus",()=>this.onFocus()),Er(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function cc(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 i="onTap"+(n==="End"?"":n),s=r[i];s&&Be.postRender(()=>s(t,Rr(t)))}class mx extends rn{mount(){const{current:t}=this.node;t&&(this.unmount=$g(t,(n,r)=>(cc(this.node,r,"Start"),(i,{success:s})=>cc(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const cs=new WeakMap,ao=new WeakMap,px=e=>{const t=cs.get(e.target);t&&t(e)},gx=e=>{e.forEach(px)};function yx({root:e,...t}){const n=e||document;ao.has(n)||ao.set(n,{});const r=ao.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(gx,{root:e,...t})),r[i]}function xx(e,t,n){const r=yx(t);return cs.set(e,n),r.observe(e),()=>{cs.delete(e),r.unobserve(e)}}const bx={some:0,all:1};class vx extends rn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:bx[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return xx(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(wx(t,n))&&this.startObserver()}unmount(){}}function wx({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const kx={inView:{Feature:vx},tap:{Feature:mx},focus:{Feature:hx},hover:{Feature:fx}},Sx={layout:{ProjectionNode:Tf,MeasureLayout:xf}},Cx={...ly,...kx,...dx,...Sx},ge=C0(Cx,L0),Pt=x.forwardRef((e,t)=>{const{alt:n,color:r="currentColor",size:i="1em",weight:s="regular",mirrored:o=!1,children:a,weights:l,...c}=e;return x.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,fill:r,viewBox:"0 0 256 256",transform:o?"scale(-1, 1)":void 0,...c},!!n&&x.createElement("title",null,n),a,l.get(s))});Pt.displayName="SSRBase";const Ex=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),fa=x.forwardRef((e,t)=>x.createElement(Pt,{ref:t,...e,weights:Ex}));fa.displayName="CaretDownIcon";const Tx=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,160H48l80-80Z",opacity:"0.2"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),Af=x.forwardRef((e,t)=>x.createElement(Pt,{ref:t,...e,weights:Tx}));Af.displayName="CaretUpIcon";const Ax=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),jf=x.forwardRef((e,t)=>x.createElement(Pt,{ref:t,...e,weights:Ax}));jf.displayName="ChatTextIcon";const jx=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),Pf=x.forwardRef((e,t)=>x.createElement(Pt,{ref:t,...e,weights:jx}));Pf.displayName="CheckIcon";const Px=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),Nf=x.forwardRef((e,t)=>x.createElement(Pt,{ref:t,...e,weights:Px}));Nf.displayName="MicrophoneIcon";const Nx=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),Mf=x.forwardRef((e,t)=>x.createElement(Pt,{ref:t,...e,weights:Nx}));Mf.displayName="MicrophoneSlashIcon";const Mx=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),If=x.forwardRef((e,t)=>x.createElement(Pt,{ref:t,...e,weights:Mx}));If.displayName="MonitorArrowUpIcon";const Ix=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),ha=x.forwardRef((e,t)=>x.createElement(Pt,{ref:t,...e,weights:Ix}));ha.displayName="SpinnerIcon";const Rx=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),Rf=x.forwardRef((e,t)=>x.createElement(Pt,{ref:t,...e,weights:Rx}));Rf.displayName="VideoCameraIcon";const Vx=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),Vf=x.forwardRef((e,t)=>x.createElement(Pt,{ref:t,...e,weights:Vx}));Vf.displayName="VideoCameraSlashIcon";function uc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Dx(...e){return t=>{let n=!1;const r=e.map(i=>{const s=uc(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():uc(e[i],null)}}}}function Fx(e){const t=Ox(e),n=x.forwardRef((r,i)=>{const{children:s,...o}=r,a=x.Children.toArray(s),l=a.find(_x);if(l){const c=l.props.children,u=a.map(d=>d===l?x.Children.count(c)>1?x.Children.only(null):x.isValidElement(c)?c.props.children:null:d);return f.jsx(t,{...o,ref:i,children:x.isValidElement(c)?x.cloneElement(c,void 0,u):null})}return f.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var Lx=Fx("Slot");function Ox(e){const t=x.forwardRef((n,r)=>{const{children:i,...s}=n;if(x.isValidElement(i)){const o=zx(i),a=Bx(s,i.props);return i.type!==x.Fragment&&(a.ref=r?Dx(r,o):o),x.cloneElement(i,a)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $x=Symbol("radix.slottable");function _x(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$x}function Bx(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function zx(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const ma="-",Hx=e=>{const t=Wx(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(ma);return a[0]===""&&a.length!==1&&a.shift(),Df(a,t)||Ux(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},Df=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Df(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(ma);return(o=t.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},dc=/^\[(.+)\]$/,Ux=e=>{if(dc.test(e)){const t=dc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Wx=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)us(n[i],r,i,t);return r},us=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:fc(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(Zx(i)){us(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{us(o,fc(t,s),n,r)})})},fc=(e,t)=>{let n=e;return t.split(ma).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Zx=e=>e.isThemeGetter,qx=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},ds="!",fs=":",Gx=fs.length,Kx=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let o=0,a=0,l=0,c;for(let g=0;g<i.length;g++){let p=i[g];if(o===0&&a===0){if(p===fs){s.push(i.slice(l,g)),l=g+Gx;continue}if(p==="/"){c=g;continue}}p==="["?o++:p==="]"?o--:p==="("?a++:p===")"&&a--}const u=s.length===0?i:i.substring(l),d=Yx(u),h=d!==u,m=c&&c>l?c-l:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:d,maybePostfixModifierPosition:m}};if(t){const i=t+fs,s=r;r=o=>o.startsWith(i)?s(o.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},Yx=e=>e.endsWith(ds)?e.substring(0,e.length-1):e.startsWith(ds)?e.substring(1):e,Xx=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let s=[];return r.forEach(o=>{o[0]==="["||t[o]?(i.push(...s.sort(),o),s=[]):s.push(o)}),i.push(...s.sort()),i}},Qx=e=>({cache:qx(e.cacheSize),parseClassName:Kx(e),sortModifiers:Xx(e),...Hx(e)}),Jx=/\s+/,e1=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,o=[],a=e.trim().split(Jx);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:h,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:p}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let b=!!p,v=r(b?g.substring(0,p):g);if(!v){if(!b){l=u+(l.length>0?" "+l:l);continue}if(v=r(g),!v){l=u+(l.length>0?" "+l:l);continue}b=!1}const k=s(h).join(":"),S=m?k+ds:k,A=S+v;if(o.includes(A))continue;o.push(A);const T=i(v,b);for(let C=0;C<T.length;++C){const M=T[C];o.push(S+M)}l=u+(l.length>0?" "+l:l)}return l};function t1(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ff(t))&&(r&&(r+=" "),r+=n);return r}const Ff=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ff(e[r]))&&(n&&(n+=" "),n+=t);return n};function n1(e,...t){let n,r,i,s=o;function o(l){const c=t.reduce((u,d)=>d(u),e());return n=Qx(c),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=e1(l,n);return i(l,u),u}return function(){return s(t1.apply(null,arguments))}}const tt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Lf=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Of=/^\((?:(\w[\w-]*):)?(.+)\)$/i,r1=/^\d+\/\d+$/,i1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,o1=/\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$/,s1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,a1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,l1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Sn=e=>r1.test(e),we=e=>!!e&&!Number.isNaN(Number(e)),qt=e=>!!e&&Number.isInteger(Number(e)),lo=e=>e.endsWith("%")&&we(e.slice(0,-1)),Lt=e=>i1.test(e),c1=()=>!0,u1=e=>o1.test(e)&&!s1.test(e),$f=()=>!1,d1=e=>a1.test(e),f1=e=>l1.test(e),h1=e=>!ae(e)&&!le(e),m1=e=>Xn(e,zf,$f),ae=e=>Lf.test(e),cn=e=>Xn(e,Hf,u1),co=e=>Xn(e,b1,we),hc=e=>Xn(e,_f,$f),p1=e=>Xn(e,Bf,f1),Wr=e=>Xn(e,Uf,d1),le=e=>Of.test(e),rr=e=>Qn(e,Hf),g1=e=>Qn(e,v1),mc=e=>Qn(e,_f),y1=e=>Qn(e,zf),x1=e=>Qn(e,Bf),Zr=e=>Qn(e,Uf,!0),Xn=(e,t,n)=>{const r=Lf.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Qn=(e,t,n=!1)=>{const r=Of.exec(e);return r?r[1]?t(r[1]):n:!1},_f=e=>e==="position"||e==="percentage",Bf=e=>e==="image"||e==="url",zf=e=>e==="length"||e==="size"||e==="bg-size",Hf=e=>e==="length",b1=e=>e==="number",v1=e=>e==="family-name",Uf=e=>e==="shadow",w1=()=>{const e=tt("color"),t=tt("font"),n=tt("text"),r=tt("font-weight"),i=tt("tracking"),s=tt("leading"),o=tt("breakpoint"),a=tt("container"),l=tt("spacing"),c=tt("radius"),u=tt("shadow"),d=tt("inset-shadow"),h=tt("text-shadow"),m=tt("drop-shadow"),g=tt("blur"),p=tt("perspective"),b=tt("aspect"),v=tt("ease"),k=tt("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...A(),le,ae],C=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],P=()=>[le,ae,l],L=()=>[Sn,"full","auto",...P()],y=()=>[qt,"none","subgrid",le,ae],N=()=>["auto",{span:["full",qt,le,ae]},qt,le,ae],D=()=>[qt,"auto",le,ae],B=()=>["auto","min","max","fr",le,ae],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],de=()=>["auto",...P()],ie=()=>[Sn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],F=()=>[e,le,ae],W=()=>[...A(),mc,hc,{position:[le,ae]}],w=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",y1,m1,{size:[le,ae]}],oe=()=>[lo,rr,cn],E=()=>["","none","full",c,le,ae],U=()=>["",we,rr,cn],se=()=>["solid","dashed","dotted","double"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[we,lo,mc,hc],Q=()=>["","none",g,le,ae],V=()=>["none",we,le,ae],X=()=>["none",we,le,ae],fe=()=>[we,le,ae],R=()=>[Sn,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Lt],breakpoint:[Lt],color:[c1],container:[Lt],"drop-shadow":[Lt],ease:["in","out","in-out"],font:[h1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Lt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Lt],shadow:[Lt],spacing:["px",we],text:[Lt],"text-shadow":[Lt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Sn,ae,le,b]}],container:["container"],columns:[{columns:[we,ae,le,a]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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:T()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[qt,"auto",le,ae]}],basis:[{basis:[Sn,"full","auto",a,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[we,Sn,"auto","initial","none",ae]}],grow:[{grow:["",we,le,ae]}],shrink:[{shrink:["",we,le,ae]}],order:[{order:[qt,"first","last","none",le,ae]}],"grid-cols":[{"grid-cols":y()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":y()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:de()}],mx:[{mx:de()}],my:[{my:de()}],ms:[{ms:de()}],me:[{me:de()}],mt:[{mt:de()}],mr:[{mr:de()}],mb:[{mb:de()}],ml:[{ml:de()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:ie()}],w:[{w:[a,"screen",...ie()]}],"min-w":[{"min-w":[a,"screen","none",...ie()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...ie()]}],h:[{h:["screen","lh",...ie()]}],"min-h":[{"min-h":["screen","lh","none",...ie()]}],"max-h":[{"max-h":["screen","lh",...ie()]}],"font-size":[{text:["base",n,rr,cn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,le,co]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lo,ae]}],"font-family":[{font:[g1,ae,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:[i,le,ae]}],"line-clamp":[{"line-clamp":[we,"none",le,co]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",le,ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",le,ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[we,"from-font","auto",le,cn]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[we,"auto",le,ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le,ae]}],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",le,ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:w()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qt,le,ae],radial:["",le,ae],conic:[qt,le,ae]},x1,p1]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:E()}],"rounded-s":[{"rounded-s":E()}],"rounded-e":[{"rounded-e":E()}],"rounded-t":[{"rounded-t":E()}],"rounded-r":[{"rounded-r":E()}],"rounded-b":[{"rounded-b":E()}],"rounded-l":[{"rounded-l":E()}],"rounded-ss":[{"rounded-ss":E()}],"rounded-se":[{"rounded-se":E()}],"rounded-ee":[{"rounded-ee":E()}],"rounded-es":[{"rounded-es":E()}],"rounded-tl":[{"rounded-tl":E()}],"rounded-tr":[{"rounded-tr":E()}],"rounded-br":[{"rounded-br":E()}],"rounded-bl":[{"rounded-bl":E()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[we,le,ae]}],"outline-w":[{outline:["",we,rr,cn]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",u,Zr,Wr]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",d,Zr,Wr]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[we,cn]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",h,Zr,Wr]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[we,le,ae]}],"mix-blend":[{"mix-blend":[...$(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$()}],"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":[we]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[le,ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[we]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:w()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",le,ae]}],filter:[{filter:["","none",le,ae]}],blur:[{blur:Q()}],brightness:[{brightness:[we,le,ae]}],contrast:[{contrast:[we,le,ae]}],"drop-shadow":[{"drop-shadow":["","none",m,Zr,Wr]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",we,le,ae]}],"hue-rotate":[{"hue-rotate":[we,le,ae]}],invert:[{invert:["",we,le,ae]}],saturate:[{saturate:[we,le,ae]}],sepia:[{sepia:["",we,le,ae]}],"backdrop-filter":[{"backdrop-filter":["","none",le,ae]}],"backdrop-blur":[{"backdrop-blur":Q()}],"backdrop-brightness":[{"backdrop-brightness":[we,le,ae]}],"backdrop-contrast":[{"backdrop-contrast":[we,le,ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",we,le,ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[we,le,ae]}],"backdrop-invert":[{"backdrop-invert":["",we,le,ae]}],"backdrop-opacity":[{"backdrop-opacity":[we,le,ae]}],"backdrop-saturate":[{"backdrop-saturate":[we,le,ae]}],"backdrop-sepia":[{"backdrop-sepia":["",we,le,ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",le,ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[we,"initial",le,ae]}],ease:[{ease:["linear","initial",v,le,ae]}],delay:[{delay:[we,le,ae]}],animate:[{animate:["none",k,le,ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,le,ae]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[le,ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:R()}],"translate-x":[{"translate-x":R()}],"translate-y":[{"translate-y":R()}],"translate-z":[{"translate-z":R()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"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",le,ae]}],"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":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",le,ae]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[we,rr,cn,co]}],stroke:[{stroke:["none",...F()]}],"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"]}},k1=n1(w1);function ce(...e){return k1(Ns.clsx(e))}const S1=Ps.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 C1({className:e,variant:t,size:n,asChild:r=!1,...i}){const s=r?Lx:"button";return f.jsx(s,{"data-slot":"button",className:ce(S1({variant:t,size:n,className:e})),...i})}const E1=Ps.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 Wf({className:e,variant:t,size:n,...r}){return f.jsx(Zm.Root,{"data-slot":"toggle",className:ce(E1({variant:t,size:n,className:e})),...r})}function T1(e){const[t,n]=j.useState(()=>e.getPublishPermissions());return j.useEffect(()=>{const r=()=>{n(e.getPublishPermissions())},i=()=>{r()};return e.on("connection.connected",i),e.on("connection.disconnected",i),()=>{e.off("connection.connected",i),e.off("connection.disconnected",i)}},[e]),t}function Zf(e){const[t,n]=j.useState(()=>e.getLocalParticipant()),[r,i]=j.useState(()=>e.getMicrophoneTrack());return j.useEffect(()=>{const s=()=>{const a=e.getLocalParticipant(),l=e.getMicrophoneTrack();console.log("🎤 useVoxketLocalParticipant: Updating state:",{hasParticipant:!!a,hasMicTrack:!!l,isMicEnabled:e.isMicrophoneEnabled,trackPublications:a?a.trackPublications.size:0}),n(a),i(l)};s(),e.on("connection.connected",s),e.on("connection.disconnected",s),e.on("track.muted",s),e.on("track.unmuted",s);const o=e.getRoom();if(o){const a=()=>{console.log("🎤 Track published, updating participant state"),s()},l=()=>{console.log("🎤 Track unpublished, updating participant state"),s()};return o.on("localTrackPublished",a),o.on("localTrackUnpublished",l),()=>{e.off("connection.connected",s),e.off("connection.disconnected",s),e.off("track.muted",s),e.off("track.unmuted",s),o.off("localTrackPublished",a),o.off("localTrackUnpublished",l)}}else return()=>{e.off("connection.connected",s),e.off("connection.disconnected",s),e.off("track.muted",s),e.off("track.unmuted",s)}},[e]),{localParticipant:t,microphoneTrack:r}}function _n(e,t,n){const[r,i]=j.useState(!1),[s,o]=j.useState(!1);return j.useEffect(()=>{const l=()=>{let c=!1;switch(t){case"microphone":c=e.isMicrophoneEnabled;break;case"camera":c=e.isCameraEnabled;break;case"screenShare":c=e.isScreenShareEnabled;break}console.log(`🎬 useVoxketTrackToggle: ${t} enabled state updated:`,{oldEnabled:r,newEnabled:c,changed:r!==c}),i(c)};return l(),e.on("track.muted",l),e.on("track.unmuted",l),e.on("connection.connected",l),()=>{e.off("track.muted",l),e.off("track.unmuted",l),e.off("connection.connected",l)}},[e,t]),{enabled:r,pending:s,toggle:async l=>{var c;try{o(!0);const u=l!==void 0?l:!r;switch(console.log(`🎬 useVoxketTrackToggle: ${t} toggle called`,{currentEnabled:r,targetEnabled:u,forceEnabled:l}),t){case"microphone":await e.toggleMicrophone(u);break;case"camera":await e.toggleCamera(u);break;case"screenShare":u?(console.log("🎬 useVoxketTrackToggle: Starting screen share"),await e.startScreenShare()):(console.log("🎬 useVoxketTrackToggle: Stopping screen share"),await e.stopScreenShare());break}console.log(`🎬 useVoxketTrackToggle: ${t} toggle completed`)}catch(u){console.error(`🎬 useVoxketTrackToggle: ${t} toggle failed:`,u),(c=n==null?void 0:n.onDeviceError)==null||c.call(n,u)}finally{o(!1)}}}}function qf(e){const[t,n]=j.useState(()=>e.getRoom()),[r,i]=j.useState(()=>e.getConnectionState());return j.useEffect(()=>{const s=()=>{n(e.getRoom()),i(e.getConnectionState())};return e.on("connection.connected",s),e.on("connection.disconnected",s),e.on("connection.connecting",s),()=>{e.off("connection.connected",s),e.off("connection.disconnected",s),e.off("connection.connecting",s)}},[e]),t}function A1(e,t){const[n,r]=j.useState([]),[i,s]=j.useState("");return j.useEffect(()=>{var c;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 l=()=>{a()};return(c=navigator.mediaDevices)==null||c.addEventListener("devicechange",l),()=>{var u;(u=navigator.mediaDevices)==null||u.removeEventListener("devicechange",l)}},[e,t]),{devices:n,activeDeviceId:i,setActiveMediaDevice:async a=>{try{t==="audioinput"?await e.setAudioInputDevice(a):await e.setVideoInputDevice(a),s(a)}catch(l){console.error("Failed to set device:",l)}}}}function j1(e){const{preventSave:t=!1}=e||{};return{saveAudioInputEnabled:o=>{t||localStorage.setItem("voxket-audio-input-enabled",o.toString())},saveAudioInputDeviceId:o=>{t||localStorage.setItem("voxket-audio-input-device-id",o)},saveVideoInputEnabled:o=>{t||localStorage.setItem("voxket-video-input-enabled",o.toString())},saveVideoInputDeviceId:o=>{t||localStorage.setItem("voxket-video-input-device-id",o)}}}function Gf(e){const[t,n]=j.useState(()=>e.getIsAgentConnected()),[r,i]=j.useState(()=>e.getCurrentSession()),[s,o]=j.useState(()=>e.getCurrentAgentInfo()),[a,l]=j.useState(()=>e.getAgentState()),[c,u]=j.useState(()=>e.getAgentAudioTrack()),[d,h]=j.useState(()=>e.getAgentVideoTrack());return j.useEffect(()=>{const m=()=>{const S=e.getIsAgentConnected(),A=e.getCurrentSession(),T=e.getCurrentAgentInfo(),C=e.getAgentState(),M=e.getAgentAudioTrack(),P=e.getAgentVideoTrack();console.log("🤖 useVoxketVoiceAssistant: Updating state:",{isAgentConnected:S,hasSession:!!A,sessionId:A==null?void 0:A.id,hasAgentInfo:!!T,agentState:C,hasAudioTrack:!!M,hasVideoTrack:!!P}),n(S),i(A),o(T),l(C),u(M),h(P)};m();const g=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent connected event"),m()},p=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent disconnected event"),m()},b=()=>{console.log("🤖 useVoxketVoiceAssistant: Session changed event"),m()},v=()=>{console.log("🤖 useVoxketVoiceAssistant: Connection changed event"),m()},k=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent state changed event"),m()};return e.on("agent.connected",g),e.on("agent.speaking",g),e.on("agent.thinking",g),e.on("agent.state.changed",k),e.on("connection.disconnected",p),e.on("session.created",b),e.on("session.ended",b),e.on("session.state.changed",b),e.on("connection.connected",v),()=>{e.off("agent.connected",g),e.off("agent.speaking",g),e.off("agent.thinking",g),e.off("agent.state.changed",k),e.off("connection.disconnected",p),e.off("session.created",b),e.off("session.ended",b),e.off("session.state.changed",b),e.off("connection.connected",v)}},[e]),{agent:{isActive:t,info:s},session:r,state:a,audioTrack:c,videoTrack:d}}function P1(e){const[t,n]=j.useState(()=>e.getVideoTrackRefs()),[r,i]=j.useState(()=>e.getCameraTrackRefs()),[s,o]=j.useState(()=>e.getScreenShareTrackRefs());return j.useEffect(()=>{const a=()=>{const c=e.getVideoTrackRefs(),u=e.getCameraTrackRefs(),d=e.getScreenShareTrackRefs();console.log("📹 useVoxketVideoTracks: Updating tracks:",{videoCount:c.length,cameraCount:u.length,screenShareCount:d.length}),n(c),i(u),o(d)};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 l=e.getRoom();if(l){const c=()=>{console.log("📹 Track event, updating video tracks"),a()};return l.on("localTrackPublished",c),l.on("localTrackUnpublished",c),l.on("trackPublished",c),l.on("trackUnpublished",c),l.on("trackSubscribed",c),l.on("trackUnsubscribed",c),()=>{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),l.off("localTrackPublished",c),l.off("localTrackUnpublished",c),l.off("trackPublished",c),l.off("trackUnpublished",c),l.off("trackSubscribed",c),l.off("trackUnsubscribed",c)}}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:s}}function pc({...e}){return f.jsx(kt.Root,{"data-slot":"select",...e})}function gc({...e}){return f.jsx(kt.Value,{"data-slot":"select-value",...e})}function yc({className:e,size:t="default",children:n,...r}){return f.jsxs(kt.Trigger,{"data-slot":"select-trigger","data-size":t,className:ce(["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,f.jsx(kt.Icon,{asChild:!0,children:f.jsx(fa,{weight:"bold",className:"size-4 transition-colors"})})]})}function xc({className:e,children:t,position:n="popper",...r}){return f.jsx(kt.Portal,{children:f.jsxs(kt.Content,{"data-slot":"select-content",className:ce(["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:[f.jsx(N1,{}),f.jsx(kt.Viewport,{className:ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),f.jsx(M1,{})]})})}function bc({className:e,children:t,...n}){return f.jsxs(kt.Item,{"data-slot":"select-item",className:ce(["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:[f.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(kt.ItemIndicator,{children:f.jsx(Pf,{className:"size-4",weight:"bold"})})}),f.jsx(kt.ItemText,{children:t})]})}function N1({className:e,...t}){return f.jsx(kt.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Af,{className:"size-4",weight:"bold"})})}function M1({className:e,...t}){return f.jsx(kt.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(fa,{className:"size-4",weight:"bold"})})}const vc=Ps.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 wc({kind:e,track:t,requestPermissions:n,onError:r,client:i,...s}){const o=s.size||"default";if(!i)return f.jsxs(pc,{disabled:!0,children:[f.jsx(yc,{className:ce(vc({size:o}),s.className),children:f.jsx(gc,{placeholder:`Select a ${e}`})}),f.jsx(xc,{children:f.jsx(bc,{value:"none",children:"No devices available"})})]});const{devices:a,activeDeviceId:l,setActiveMediaDevice:c}=A1(i,e==="audioinput"?"audioinput":"videoinput");return f.jsxs(pc,{value:l,onValueChange:c,children:[f.jsx(yc,{className:ce(vc({size:o}),s.className,"hover:bg"),children:o!=="sm"&&f.jsx(gc,{className:"font-mono text-sm",placeholder:`Select a ${e}`})}),f.jsx(xc,{children:a.map(u=>f.jsx(bc,{value:u.deviceId,className:"font-mono text-xs",children:u.label},u.deviceId))})]})}function I1(e,t,n=!1){if(n)return ha;switch(e){case te.Track.Source.Microphone:return t?Nf:Mf;case te.Track.Source.Camera:return t?Rf:Vf;case te.Track.Source.ScreenShare:return If;default:return x.Fragment}}function uo({source:e,pressed:t,pending:n,className:r,...i}){const s=I1(e,t??!1,n),o=e===te.Track.Source.Microphone&&!(t??!1)&&!n,a=e===te.Track.Source.Camera&&!(t??!1)&&!n;return x.useEffect(()=>{console.log(`TrackToggle for ${e} changed: pressed=${t}, pending=${n}, actualState=${t?"enabled":"disabled"}`)},[e,t,n]),f.jsxs(Wf,{pressed:t,"aria-label":`Toggle ${e}`,className:ce(r),...i,children:[f.jsx(s,{weight:"bold",className:ce(n&&"animate-spin",o||a?"text-red-500":void 0)}),i.children]})}function R1(e){return e?T1(e):{camera:!0,microphone:!0,screenShare:!0,data:!0}}function V1(e={}){const{controls:t,saveUserChoices:n=!0,client:r}=e,i={leave:!0,...t};if(!r)return{micTrackRef:{participant:void 0,source:te.Track.Source.Microphone,publication:void 0},visibleControls:i,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:s,localParticipant:o}=Zf(r),a=R1(r);qf(r);const l=_n(r,"microphone",{onDeviceError:C=>{var M;return(M=e.onDeviceError)==null?void 0:M.call(e,{source:te.Track.Source.Microphone,error:C})}}),c=_n(r,"camera",{onDeviceError:C=>{var M;return(M=e.onDeviceError)==null?void 0:M.call(e,{source:te.Track.Source.Camera,error:C})}}),u=_n(r,"screenShare",{onDeviceError:C=>{var M;return(M=e.onDeviceError)==null?void 0:M.call(e,{source:te.Track.Source.ScreenShare,error:C})}}),d=x.useMemo(()=>{let C;if(o){for(const[,M]of o.trackPublications)if(M.source===te.Track.Source.Microphone){C=M;break}}return console.log("🎤 Creating micTrackRef:",{hasParticipant:!!o,hasPublication:!!C,isTrackSubscribed:C==null?void 0:C.isSubscribed,isMuted:C==null?void 0:C.isMuted,trackSid:C==null?void 0:C.trackSid}),{participant:o??void 0,source:te.Track.Source.Microphone,publication:C}},[o,s]);i.microphone??(i.microphone=a.microphone),i.screenShare??(i.screenShare=a.screenShare),i.camera??(i.camera=a.camera),i.chat??(i.chat=a.data);const{saveAudioInputEnabled:h,saveAudioInputDeviceId:m,saveVideoInputEnabled:g,saveVideoInputDeviceId:p}=j1({preventSave:!n}),b=x.useCallback(()=>{r&&r.disconnect()},[r]),v=x.useCallback(C=>{m(C??"default"),r&&r.setAudioInputDevice(C)},[m,r]),k=x.useCallback(C=>{p(C??"default"),r&&r.setVideoInputDevice(C)},[p,r]),S=x.useCallback(async C=>{u.enabled&&await u.toggle(!1),await c.toggle(C),g(!c.enabled)},[c,g,u]),A=x.useCallback(async C=>{await l.toggle(C),h(!l.enabled)},[l,h]),T=x.useCallback(async C=>{c.enabled&&await c.toggle(!1),await u.toggle(C)},[c,u]);return{micTrackRef:d,visibleControls:i,cameraToggle:{...c,toggle:S},microphoneToggle:{...l,toggle:A},screenShareToggle:{...u,toggle:T},handleDisconnect:b,handleAudioDeviceChange:v,handleVideoDeviceChange:k}}const D1={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 relative 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"}},F1={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 relative 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"}},L1={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 relative",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"}},kc={dark:D1,light:F1,vox:L1};function et(e){return kc[e]||kc.vox}function O1({onSend:e,disabled:t=!1,className:n,placeholder:r="Type a message..."}){const[i,s]=x.useState(""),[o,a]=x.useState(!1),l=async u=>{if(u.preventDefault(),i.trim()&&!t&&!o){a(!0);try{await e(i.trim()),s("")}catch(d){console.error("Failed to send message:",d)}finally{a(!1)}}},c=u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),l(u))};return f.jsxs("form",{onSubmit:l,className:ce("flex w-full",n),children:[f.jsx("input",{type:"text",value:i,onChange:u=>s(u.target.value),onKeyDown:c,disabled:t||o,placeholder:r,className:"flex-1 px-2 py-1 text-sm bg-transparent border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 disabled:opacity-50"}),f.jsx(C1,{type:"submit",size:"sm",disabled:!i.trim()||t||o,className:"ml-2 px-2 py-1 text-xs",children:o?"...":"Send"})]})}function $1({controls:e,saveUserChoices:t=!0,capabilities:n,className:r,onSendMessage:i,onChatOpenChange:s,onDisconnect:o,onDeviceError:a,theme:l="vox",client:c,...u}){const[d,h]=x.useState(!1),[m,g]=x.useState(!1),p=et(l),{micTrackRef:b,visibleControls:v,cameraToggle:k,microphoneToggle:S,screenShareToggle:A,handleAudioDeviceChange:T,handleVideoDeviceChange:C,handleDisconnect:M}=V1({controls:e,saveUserChoices:t,client:c}),P=async L=>{g(!0);try{await(i==null?void 0:i(L))}finally{g(!1)}};return x.useEffect(()=>{s==null||s(d)},[d,s]),x.useEffect(()=>{var L,y,N,D;console.log("🎤 AgentControlBar: micTrackRef changed:",{hasParticipant:!!b.participant,hasPublication:!!b.publication,source:b.source,isSubscribed:(L=b.publication)==null?void 0:L.isSubscribed,isMuted:(y=b.publication)==null?void 0:y.isMuted,trackSid:(N=b.publication)==null?void 0:N.trackSid,hasTrack:!!((D=b.publication)!=null&&D.track)})},[b]),f.jsxs("div",{"aria-label":"Voice assistant controls",className:ce(p.controlBar,r),...u,children:[n.suportsChatInput&&f.jsxs("div",{"data-inert":d?void 0:"true",className:ce("overflow-hidden transition-[height] relative duration-300 ease-in-out",d?"h-[56px] mb-2":"h-0"),children:[f.jsx("div",{className:"flex h-8 px-3 w-full",children:f.jsx(O1,{onSend:P,disabled:m,className:ce("w-full",p.chatInput),placeholder:"Type a message..."})}),f.jsx("hr",{className:"border-border my-1 mx-3"})]}),f.jsxs("div",{className:ce("flex flex-row items-center gap-2 rounded-2xl mx-auto border-none backdrop-blur-lg px-2 py-1",l==="light"?"bg-white/80":"bg-[#18182a]/80"),children:[f.jsxs("div",{className:"flex gap-y-2 justify-start",children:[v.microphone&&f.jsxs("div",{className:"flex gap-y-2 items-center rounded-full overflow-hidden border-none ",children:[f.jsx(uo,{variant:"primary",source:te.Track.Source.Microphone,pressed:S.enabled,disabled:S.pending,onPressedChange:S.toggle,className:"w-auto py-1 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"}),f.jsx(ut.BarVisualizer,{barCount:3,trackRef:b,options:{minHeight:5},className:"flex h-full w-auto items-center justify-center gap-x-0.5",children:f.jsx("span",{className:ce(["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"])})}),f.jsx(wc,{size:"sm",kind:"audioinput",client:c,onError:a?L=>L instanceof Error?a({source:te.Track.Source.Microphone,error:L}):void 0:void 0,onActiveDeviceChange:T,className:ce(["h-full py-1 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/30 transition-colors","min-w-[2.5rem]"])})]}),n.suportsVideoInput&&v.camera&&f.jsxs("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:[f.jsx(uo,{variant:"primary",source:te.Track.Source.Camera,pressed:k.enabled,pending:k.pending,disabled:k.pending,onPressedChange:k.toggle,className:"w-auto py-1 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"}),f.jsx(wc,{size:"sm",kind:"videoinput",client:c,onError:a?L=>L instanceof Error?a({source:te.Track.Source.Camera,error:L}):void 0:void 0,onActiveDeviceChange:C,className:ce(["h-full py-1 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors","min-w-[2.5rem]"])})]}),n.suportsScreenShare&&v.screenShare&&f.jsx("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:f.jsx(uo,{variant:"secondary",source:te.Track.Source.ScreenShare,pressed:A.enabled,disabled:A.pending,onPressedChange:A.toggle,className:"w-auto py-1 disabled:opacity-70 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"})})]}),v.chat&&f.jsx("div",{className:"flex items-center rounded-full overflow-hidden bg-secondary text-secondary-foreground border-none ",children:f.jsx(Wf,{variant:"secondary","aria-label":"Toggle chat",pressed:d,onPressedChange:L=>{h(L)},className:"aspect-square h-full py-1 rounded-none border-none bg-transparent text-inherit focus:bg-secondary/80 hover:bg-secondary/80 transition-colors flex items-center",children:f.jsx(jf,{weight:"bold",className:"h-4 w-4"})})})]})]})}const Kf=j.forwardRef(({state:e,audioTrack:t,className:n},r)=>f.jsx("div",{ref:r,className:ce("",n),children:t?f.jsx(ut.BarVisualizer,{barCount:5,state:e,options:{minHeight:5},trackRef:t,className:ce("flex aspect-video w-40 items-center justify-center gap-1"),children:f.jsx("span",{className:ce(["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]"])})}):f.jsx("div",{className:ce("flex aspect-video w-40 items-center justify-center"),children:f.jsx("div",{className:"flex flex-col items-center justify-center",children:f.jsx("div",{className:"flex gap-1",children:Array.from({length:5}).map((i,s)=>f.jsx("span",{className:ce(["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"])},s))})})})}));Kf.displayName="AgentTile";const _1=({videoTrack:e,className:t,ref:n})=>{var r,i;return!e||!e.publication||!e.participant?f.jsx("div",{ref:n,className:ce(t),children:f.jsx("div",{className:"w-full h-full bg-gray-200 rounded-md flex items-center justify-center",children:f.jsx("span",{className:"text-gray-500",children:"No video available"})})}):f.jsx("div",{ref:n,className:ce(t),children:f.jsx(ut.VideoTrack,{trackRef:e,width:((r=e.publication.dimensions)==null?void 0:r.width)??0,height:((i=e.publication.dimensions)==null?void 0:i.height)??0,className:"rounded-md"})})},B1=ge.create(ut.VideoTrack),z1=({trackRef:e,className:t,ref:n})=>{var r,i;return f.jsx("div",{className:ce("bg-muted overflow-hidden rounded-md",t),children:f.jsx(B1,{ref:n,trackRef:e,width:((r=e==null?void 0:e.publication.dimensions)==null?void 0:r.width)??0,height:((i=e==null?void 0:e.publication.dimensions)==null?void 0:i.height)??0,className:ce("h-full w-auto")})})},Sc=ge.create(z1),H1=ge.create(Kf),U1=ge.create(_1),Ot={initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{type:"spring",stiffness:675,damping:75,mass:1}},Cn={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 W1(e,t){const{localParticipant:n}=Zf(t),r=n==null?void 0:n.getTrackPublication(e);return j.useMemo(()=>r&&n?{source:e,participant:n,publication:r}:void 0,[e,r,n])}function Z1({chatOpen:e,client:t}){const{agent:{isActive:n=!1}={},session:r,state:i="idle",audioTrack:s,videoTrack:o}=t?Gf(t):{agent:{isActive:!1},session:null,state:"idle",audioTrack:null,videoTrack:null},[a]=ut.useTracks([te.Track.Source.ScreenShare]),l=W1(te.Track.Source.Camera,t),c=l&&!l.publication.isMuted,u=a&&!a.publication.isMuted,d=c||u,h=n||r&&r.state==="active",m={...Ot.transition,delay:e?0:.15},g={...Ot.animate,scale:e?1:3,transition:m},p={...Ot.animate,transition:m},b=m,v=m,k=o&&o.publication&&o.participant;return f.jsx("div",{className:"relative w-full h-full z-10 flex items-center justify-center",children:f.jsx("div",{className:"relative w-full h-full max-w-2xl px-4 md:px-0",children:f.jsxs("div",{className:ce(Cn.grid),children:[h&&f.jsx("div",{className:ce(["grid",!e&&Cn.agentChatClosed,e&&d&&Cn.agentChatOpenWithSecondTile,e&&!d&&Cn.agentChatOpenWithoutSecondTile]),children:f.jsxs("div",{className:"h-full flex items-center justify-center",children:[!k&&f.jsx(H1,{layoutId:"agent",...Ot,animate:g,transition:b,state:i,audioTrack:s||void 0,className:ce(e?"h-[90px]":"h-auto w-full")},"agent"),k&&o&&f.jsx(U1,{layoutId:"avatar",...Ot,animate:p,transition:v,videoTrack:o,className:ce(e?"h-[90px] [&>video]:h-[90px] [&>video]:w-auto":"h-auto w-full")},"avatar")]})}),f.jsx("div",{className:ce(["grid",e&&Cn.secondTileChatOpen,!e&&Cn.secondTileChatClosed]),children:f.jsxs("div",{className:"w-full px-10 flex items-center shadow-2xl justify-between",children:[l&&c&&f.jsx(Sc,{layout:"position",layoutId:"camera",...Ot,trackRef:l,transition:{...Ot.transition,delay:e?0:.15},className:"h-[60px] order-1"},"camera"),u&&f.jsx(Sc,{layout:"position",layoutId:"screen",...Ot,trackRef:a,transition:{...Ot.transition,delay:e?0:.15},className:"h-[70px] order-2"},"screen")]})})]})})})}function Cc({timeout:e}){const[t,n]=j.useState(100),r=j.useRef(null),i=j.useRef(null);return j.useEffect(()=>{if(!e||e<=0)return;n(100),i.current=Date.now();const s=()=>{if(!e||i.current===null)return;const o=Date.now()-i.current,a=Math.max(0,100-o/e*100);n(a),a>0&&(r.current=requestAnimationFrame(s))};return r.current=requestAnimationFrame(s),()=>{r.current&&cancelAnimationFrame(r.current)}},[e]),!e||e<=0?null:f.jsx("div",{className:"w-full h-1 relative top-1 rounded-t-4xl bg-gray-700 overflow-hidden",children:f.jsx(ge.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 Tr({interaction:e,theme:t,onDismiss:n,client:r,addLocalMessage:i}){var a;if(!e||!e.isVisible||!e.component)return null;const[s]=x.useState(()=>Date.now()),o=()=>e.component?x.createElement(e.component,{handler:e.handler||void 0,timeout:e.timeout,loadData:async c=>{console.log("InteractiveComponent: Loading data:",c)},presentationMode:e.presentationMode,data:e.data,client:r,addLocalMessage:i}):f.jsx("div",{className:"p-4 text-red-500",children:"Component not found"});switch(e.presentationMode){case"fullscreen":return f.jsx(Qt,{children:f.jsxs(ge.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black",children:[f.jsxs("div",{className:"flex flex-col",children:[f.jsx(Cc,{timeout:e.timeout}),f.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/80 text-white border-b border-gray-700",children:[f.jsx("h3",{className:"text-lg font-semibold",children:e.methodName.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase())}),f.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:f.jsx(Ze.X,{className:"w-5 h-5"})})]})]}),f.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:o()})]})});case"embedded":default:return f.jsx(Qt,{children:f.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-fit rounded-lg ",children:f.jsxs("div",{children:[f.jsx(Cc,{timeout:e.timeout}),o()]})})})}}const q1=({logLevel:e}={})=>{const t=ut.useRoomContext();x.useEffect(()=>(te.setLogLevel(e??"debug"),window.__lk_room=t,()=>{window.__lk_room=void 0}),[t,e])},Ec=e=>e,G1=()=>{let e=Ec;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Ec}}},K1=G1();function tn(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 bn(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":tn(7));return e.charAt(0).toUpperCase()+e.slice(1)}function pa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qr={exports:{}},Gr={exports:{}},Pe={};/** @license React v16.13.1
29
+ `),()=>{p.contains(g)&&p.removeChild(g)}},[t]),f.jsx(r0,{isPresent:t,childRef:s,sizeRef:o,children:x.cloneElement(e,{ref:s})})}const o0=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a,root:l})=>{const c=Os(s0),u=j.useId();let d=!0,h=j.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:m=>{c.set(m,!0);for(const g of c.values())if(!g)return;r&&r()},register:m=>(c.set(m,!1),()=>c.delete(m))}),[n,c,r]);return s&&d&&(h={...h}),j.useMemo(()=>{c.forEach((m,g)=>c.set(g,!1))},[n]),x.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),o==="popLayout"&&(e=f.jsx(i0,{isPresent:n,anchorX:a,root:l,children:e})),f.jsx(Mi.Provider,{value:h,children:e})};function s0(){return new Map}function Gd(e=!0){const t=j.useContext(Mi);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=j.useId();j.useEffect(()=>{if(e)return i(s)},[e]);const o=j.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const Zr=e=>e.key||"";function El(e){const t=[];return j.Children.forEach(e,n=>{j.isValidElement(n)&&t.push(n)}),t}const en=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left",root:l})=>{const[c,u]=Gd(o),d=j.useMemo(()=>El(e),[e]),h=o&&!c?[]:d.map(Zr),m=j.useRef(!0),g=j.useRef(d),p=Os(()=>new Map),[b,v]=j.useState(d),[k,S]=j.useState(d);rd(()=>{m.current=!1,g.current=d;for(let C=0;C<k.length;C++){const N=Zr(k[C]);h.includes(N)?p.delete(N):p.get(N)!==!0&&p.set(N,!1)}},[k,h.length,h.join("-")]);const A=[];if(d!==b){let C=[...d];for(let N=0;N<k.length;N++){const P=k[N],L=Zr(P);h.includes(L)||(C.splice(N,0,P),A.push(P))}return s==="wait"&&A.length&&(C=A),S(El(C)),v(d),null}process.env.NODE_ENV!=="production"&&s==="wait"&&k.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:T}=j.useContext(Ls);return f.jsx(f.Fragment,{children:k.map(C=>{const N=Zr(C),P=o&&!c?!1:d===k||h.includes(N),L=()=>{if(p.has(N))p.set(N,!0);else return;let y=!0;p.forEach(M=>{M||(y=!1)}),y&&(T==null||T(),S(g.current),o&&(u==null||u()),r&&r())};return f.jsx(o0,{isPresent:P,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:l,onExitComplete:P?void 0:L,anchorX:a,children:C},N)})})},Kd=j.createContext({strict:!1}),Tl={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"]},qn={};for(const e in Tl)qn[e]={isEnabled:t=>Tl[e].some(n=>!!t[n])};function a0(e){for(const t in e)qn[t]={...qn[t],...e[t]}}const l0=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 bi(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||l0.has(e)}let Yd=e=>!bi(e);function c0(e){typeof e=="function"&&(Yd=t=>t.startsWith("on")?!bi(t):e(t))}try{c0(require("@emotion/is-prop-valid").default)}catch{}function u0(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Yd(i)||n===!0&&bi(i)||!t&&!bi(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const Ni=j.createContext({});function Ii(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Tr(e){return typeof e=="string"||Array.isArray(e)}const la=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ca=["initial",...la];function Ri(e){return Ii(e.animate)||ca.some(t=>Tr(e[t]))}function Xd(e){return!!(Ri(e)||e.variants)}function d0(e,t){if(Ri(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Tr(n)?n:void 0,animate:Tr(r)?r:void 0}}return e.inherit!==!1?t:{}}function f0(e){const{initial:t,animate:n}=d0(e,j.useContext(Ni));return j.useMemo(()=>({initial:t,animate:n}),[Al(t),Al(n)])}function Al(e){return Array.isArray(e)?e.join(" "):e}const Ar={};function h0(e){for(const t in e)Ar[t]=e[t],qs(t)&&(Ar[t].isCSSVariable=!0)}function Qd(e,{layout:t,layoutId:n}){return Jn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ar[e]||e==="opacity")}const m0={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},p0=Qn.length;function g0(e,t,n){let r="",i=!0;for(let s=0;s<p0;s++){const o=Qn[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=zd(a,ia[o]);if(!l){i=!1;const u=m0[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function ua(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(Jn.has(l)){o=!0;continue}else if(qs(l)){i[l]=c;continue}else{const u=zd(c,ia[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=g0(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${c} ${u}`}}const da=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Jd(e,t,n){for(const r in t)!ot(t[r])&&!Qd(r,n)&&(e[r]=t[r])}function y0({transformTemplate:e},t){return j.useMemo(()=>{const n=da();return ua(n,t,e),Object.assign({},n.vars,n.style)},[t])}function x0(e,t){const n=e.style||{},r={};return Jd(r,n,e),Object.assign(r,y0(e,t)),r}function b0(e,t){const n={},r=x0(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 v0={offset:"stroke-dashoffset",array:"stroke-dasharray"},w0={offset:"strokeDashoffset",array:"strokeDasharray"};function k0(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?v0:w0;e[s.offset]=ye.transform(-r);const o=ye.transform(t),a=ye.transform(n);e[s.array]=`${o} ${a}`}function ef(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a},l,c,u){if(ua(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:h}=e;d.transform&&(h.transform=d.transform,delete d.transform),(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&k0(d,i,s,o,!1)}const tf=()=>({...da(),attrs:{}}),nf=e=>typeof e=="string"&&e.toLowerCase()==="svg";function S0(e,t,n,r){const i=j.useMemo(()=>{const s=tf();return ef(s,t,nf(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Jd(s,e.style,e),i.style={...s,...i.style}}return i}const C0=["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 fa(e){return typeof e!="string"||e.includes("-")?!1:!!(C0.indexOf(e)>-1||/[A-Z]/u.test(e))}function E0(e,t,n,{latestValues:r},i,s=!1){const a=(fa(e)?S0:b0)(t,r,i,e),l=u0(t,typeof e=="string",s),c=e!==j.Fragment?{...l,...a,ref:n}:{},{children:u}=t,d=j.useMemo(()=>ot(u)?u.get():u,[u]);return j.createElement(e,{...c,children:d})}function jl(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ha(e,t,n,r){if(typeof t=="function"){const[i,s]=jl(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=jl(r);t=t(n!==void 0?n:e.custom,i,s)}return t}function li(e){return ot(e)?e.get():e}function T0({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:A0(n,r,i,e),renderState:t()}}function A0(e,t,n,r){const i={},s=r(e,{});for(const h in s)i[h]=li(s[h]);let{initial:o,animate:a}=e;const l=Ri(e),c=Xd(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!Ii(d)){const h=Array.isArray(d)?d:[d];for(let m=0;m<h.length;m++){const g=ha(e,h[m]);if(g){const{transitionEnd:p,transition:b,...v}=g;for(const k in v){let S=v[k];if(Array.isArray(S)){const A=u?S.length-1:0;S=S[A]}S!==null&&(i[k]=S)}for(const k in p)i[k]=p[k]}}}return i}const rf=e=>(t,n)=>{const r=j.useContext(Ni),i=j.useContext(Mi),s=()=>T0(e,t,r,i);return n?s():Os(s)};function ma(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(ot(r[o])||t.style&&ot(t.style[o])||Qd(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const j0=rf({scrapeMotionValuesFromProps:ma,createRenderState:da});function of(e,t,n){const r=ma(e,t,n);for(const i in e)if(ot(e[i])||ot(t[i])){const s=Qn.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const P0=rf({scrapeMotionValuesFromProps:of,createRenderState:tf}),M0=Symbol.for("motionComponentSymbol");function Ln(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function N0(e,t,n){return j.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ln(n)&&(n.current=r))},[t])}const pa=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),I0="framerAppearId",sf="data-"+pa(I0),af=j.createContext({});function R0(e,t,n,r,i){var p,b;const{visualElement:s}=j.useContext(Ni),o=j.useContext(Kd),a=j.useContext(Mi),l=j.useContext(aa).reducedMotion,c=j.useRef(null);r=r||o.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,d=j.useContext(af);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&V0(c.current,n,i,d);const h=j.useRef(!1);j.useInsertionEffect(()=>{u&&h.current&&u.update(n,a)});const m=n[sf],g=j.useRef(!!m&&!((p=window.MotionHandoffIsComplete)!=null&&p.call(window,m))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,m)));return rd(()=>{u&&(h.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),j.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var v;(v=window.MotionHandoffMarkAsComplete)==null||v.call(window,m)}),g.current=!1),u.enteringChildren=void 0)}),u}function V0(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:lf(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Ln(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function lf(e){if(e)return e.options.allowProjection!==!1?e.projection:lf(e.parent)}function io(e,{forwardMotionProps:t=!1}={},n,r){n&&a0(n);const i=fa(e)?P0:j0;function s(a,l){let c;const u={...j.useContext(aa),...a,layoutId:D0(a)},{isStatic:d}=u,h=f0(a),m=i(a,d);if(!d&&$s){F0(u,n);const g=L0(u);c=g.MeasureLayout,h.visualElement=R0(e,m,u,r,g.ProjectionNode)}return f.jsxs(Ni.Provider,{value:h,children:[c&&h.visualElement?f.jsx(c,{visualElement:h.visualElement,...u}):null,E0(e,a,N0(m,h.visualElement,l),m,d,t)]})}s.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=j.forwardRef(s);return o[M0]=e,o}function D0({layoutId:e}){const t=j.useContext(Ls).id;return t&&e!==void 0?t+"-"+e:e}function F0(e,t){const n=j.useContext(Kd).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?Yn(!1,r,"lazy-strict-mode"):Ut(!1,r,"lazy-strict-mode")}}function L0(e){const{drag:t,layout:n}=qn;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 O0(e,t){if(typeof Proxy>"u")return io;const n=new Map,r=(s,o)=>io(s,o,e,t),i=(s,o)=>(process.env.NODE_ENV!=="production"&&Us(!1,"motion() is deprecated. Use motion.create() instead."),r(s,o));return new Proxy(i,{get:(s,o)=>o==="create"?r:(n.has(o)||n.set(o,io(o,void 0,e,t)),n.get(o))})}function cf({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function $0({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function _0(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 oo(e){return e===void 0||e===1}function as({scale:e,scaleX:t,scaleY:n}){return!oo(e)||!oo(t)||!oo(n)}function hn(e){return as(e)||uf(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function uf(e){return Pl(e.x)||Pl(e.y)}function Pl(e){return e&&e!=="0%"}function vi(e,t,n){const r=e-n,i=t*r;return n+i}function Ml(e,t,n,r,i){return i!==void 0&&(e=vi(e,i,r)),vi(e,n,r)+t}function ls(e,t=0,n=1,r,i){e.min=Ml(e.min,t,n,r,i),e.max=Ml(e.max,t,n,r,i)}function df(e,{x:t,y:n}){ls(e.x,t.translate,t.scale,t.originPoint),ls(e.y,n.translate,n.scale,n.originPoint)}const Nl=.999999999999,Il=1.0000000000001;function B0(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&$n(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,df(e,o)),r&&hn(s.latestValues)&&$n(e,s.latestValues))}t.x<Il&&t.x>Nl&&(t.x=1),t.y<Il&&t.y>Nl&&(t.y=1)}function On(e,t){e.min=e.min+t,e.max=e.max+t}function Rl(e,t,n,r,i=.5){const s=qe(e.min,e.max,i);ls(e,t,n,s,r)}function $n(e,t){Rl(e.x,t.x,t.scaleX,t.scale,t.originX),Rl(e.y,t.y,t.scaleY,t.scale,t.originY)}function ff(e,t){return cf(_0(e.getBoundingClientRect(),t))}function z0(e,t,n){const r=ff(e,n),{scroll:i}=t;return i&&(On(r.x,i.offset.x),On(r.y,i.offset.y)),r}const Vl=()=>({translate:0,scale:1,origin:0,originPoint:0}),_n=()=>({x:Vl(),y:Vl()}),Dl=()=>({min:0,max:0}),Ye=()=>({x:Dl(),y:Dl()}),cs={current:null},hf={current:!1};function H0(){if(hf.current=!0,!!$s)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>cs.current=e.matches;e.addEventListener("change",t),t()}else cs.current=!1}const U0=new WeakMap;function W0(e,t,n){for(const r in t){const i=t[r],s=n[r];if(ot(i))e.addValue(r,i);else if(ot(s))e.addValue(r,Zn(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,Zn(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Fl=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Z0{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=na,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=ft.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Be.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Ri(n),this.isVariantNode=Xd(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in d){const m=d[h];l[h]!==void 0&&ot(m)&&m.set(l[h])}}mount(t){var n;this.current=t,U0.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,i)=>this.bindToMotionValue(i,r)),hf.current||H0(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:cs.current,process.env.NODE_ENV!=="production"&&Us(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(),tn(this.notifyUpdate),tn(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=Jn.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Be.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),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 qn){const n=qn[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ye()}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<Fl.length;r++){const i=Fl[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=W0(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=Zn(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"&&(id(r)||sd(r))?r=parseFloat(r):!n0(r)&&nn.test(n)&&(r=Bd(t,n)),this.setBaseTarget(t,ot(r)?r.get():r)),ot(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=ha(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ot(i)?i: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(){oa.render(this.render)}}class mf extends Z0{constructor(){super(...arguments),this.KeyframeResolver=Ug}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;ot(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function pf(e,{style:t,vars:n},r,i){const s=e.style;let o;for(o in t)s[o]=t[o];i==null||i.applyProjectionStyles(s,r);for(o in n)s.setProperty(o,n[o])}function q0(e){return window.getComputedStyle(e)}class G0 extends mf{constructor(){super(...arguments),this.type="html",this.renderInstance=pf}readValueFromInstance(t,n){var r;if(Jn.has(n))return(r=this.projection)!=null&&r.isProjecting?es(n):lg(t,n);{const i=q0(t),s=(qs(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ff(t,n)}build(t,n,r){ua(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return ma(t,n,r)}}const gf=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 K0(e,t,n,r){pf(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(gf.has(i)?i:pa(i),t.attrs[i])}class Y0 extends mf{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ye}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Jn.has(n)){const r=_d(n);return r&&r.default||0}return n=gf.has(n)?n:pa(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return of(t,n,r)}build(t,n,r){ef(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){K0(t,n,r,i)}mount(t){this.isSVGTag=nf(t.tagName),super.mount(t)}}const X0=(e,t)=>fa(e)?new Y0(t):new G0(t,{allowProjection:e!==j.Fragment});function Bn(e,t,n){const r=e.getProps();return ha(r,t,n!==void 0?n:r.custom,e)}const us=e=>Array.isArray(e);function Q0(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Zn(n))}function J0(e){return us(e)?e[e.length-1]||0:e}function ey(e,t){const n=Bn(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=J0(s[o]);Q0(e,o,a)}}function ty(e){return!!(ot(e)&&e.add)}function ds(e,t){const n=e.getValue("willChange");if(ty(n))return n.add(t);if(!n&&Wt.WillChange){const r=new Wt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function yf(e){return e.props[sf]}const ny=e=>e!==null;function ry(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(ny),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[s]}const iy={type:"spring",stiffness:500,damping:25,restSpeed:10},oy=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),sy={type:"keyframes",duration:.8},ay={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ly=(e,{keyframes:t})=>t.length>2?sy:Jn.has(e)?e.startsWith("scale")?oy(t[1]):iy:ay;function cy({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const ga=(e,t,n,r={},i,s)=>o=>{const a=ra(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-jt(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};cy(a)||Object.assign(u,ly(e,u)),u.duration&&(u.duration=jt(u.duration)),u.repeatDelay&&(u.repeatDelay=jt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(os(u),u.delay===0&&(d=!0)),(Wt.instantAnimations||Wt.skipAnimations)&&(d=!0,os(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!s&&t.get()!==void 0){const h=ry(u.keyframes,a);if(h!==void 0){Be.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new ta(u):new Ng(u)};function uy({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function xf(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:o,...a}=t;r&&(s=r);const l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),h=a[u];if(h===void 0||c&&uy(c,u))continue;const m={delay:n,...ra(s||{},u)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(h)&&h===g&&!m.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const v=yf(e);if(v){const k=window.MotionHandoffAnimation(v,u,Be);k!==null&&(m.startTime=k,p=!0)}}ds(e,u),d.start(ga(u,d,h,e.shouldReduceMotion&&Ld.has(u)?{type:!1}:m,e,p));const b=d.animation;b&&l.push(b)}return o&&Promise.all(l).then(()=>{Be.update(()=>{o&&ey(e,o)})}),l}function bf(e,t,n,r=0,i=1){const s=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),o=e.size,a=(o-1)*r;return typeof n=="function"?n(s,o):i===1?s*r:a-s*r}function fs(e,t,n={}){var l;const r=Bn(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(xf(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=i;return dy(e,t,c,u,d,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[s,o]:[o,s];return c().then(()=>u())}else return Promise.all([s(),o(n.delay)])}function dy(e,t,n=0,r=0,i=0,s=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(fs(l,t,{...o,delay:n+(typeof r=="function"?0:r)+bf(e.variantChildren,l,r,i,s)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function fy(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>fs(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=fs(e,t,n);else{const i=typeof t=="function"?Bn(e,t,n.custom):t;r=Promise.all(xf(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function vf(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 hy=ca.length;function wf(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?wf(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<hy;n++){const r=ca[n],i=e.props[r];(Tr(i)||i===!1)&&(t[r]=i)}return t}const my=[...la].reverse(),py=la.length;function gy(e){return t=>Promise.all(t.map(({animation:n,options:r})=>fy(e,n,r)))}function yy(e){let t=gy(e),n=Ll(),r=!0;const i=l=>(c,u)=>{var h;const d=Bn(e,u,l==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(d){const{transition:m,transitionEnd:g,...p}=d;c={...c,...p,...g}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,u=wf(e.parent)||{},d=[],h=new Set;let m={},g=1/0;for(let b=0;b<py;b++){const v=my[b],k=n[v],S=c[v]!==void 0?c[v]:u[v],A=Tr(S),T=v===l?k.isActive:null;T===!1&&(g=b);let C=S===u[v]&&S!==c[v]&&A;if(C&&r&&e.manuallyAnimateOnMount&&(C=!1),k.protectedKeys={...m},!k.isActive&&T===null||!S&&!k.prevProp||Ii(S)||typeof S=="boolean")continue;const N=xy(k.prevProp,S);let P=N||v===l&&k.isActive&&!C&&A||b>g&&A,L=!1;const y=Array.isArray(S)?S:[S];let M=y.reduce(i(v),{});T===!1&&(M={});const{prevResolvedValues:D={}}=k,B={...D,...M},H=ie=>{P=!0,h.has(ie)&&(L=!0,h.delete(ie)),k.needsAnimating[ie]=!0;const F=e.getValue(ie);F&&(F.liveStyle=!1)};for(const ie in B){const F=M[ie],W=D[ie];if(m.hasOwnProperty(ie))continue;let w=!1;us(F)&&us(W)?w=!vf(F,W):w=F!==W,w?F!=null?H(ie):h.add(ie):F!==void 0&&h.has(ie)?H(ie):k.protectedKeys[ie]=!0}k.prevProp=S,k.prevResolvedValues=M,k.isActive&&(m={...m,...M}),r&&e.blockInitialAnimation&&(P=!1);const Y=C&&N;P&&(!Y||L)&&d.push(...y.map(ie=>{const F={type:v};if(typeof ie=="string"&&r&&!Y&&e.manuallyAnimateOnMount&&e.parent){const{parent:W}=e,w=Bn(W,ie);if(W.enteringChildren&&w){const{delayChildren:z}=w.transition||{};F.delay=bf(W.enteringChildren,e,z)}}return{animation:ie,options:F}}))}if(h.size){const b={};if(typeof c.initial!="boolean"){const v=Bn(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(b.transition=v.transition)}h.forEach(v=>{const k=e.getBaseTarget(v),S=e.getValue(v);S&&(S.liveStyle=!0),b[v]=k??null}),d.push({animation:b})}let p=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(d):Promise.resolve()}function a(l,c){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(h=>{var m;return(m=h.animationState)==null?void 0:m.setActive(l,c)}),n[l].isActive=c;const u=o(l);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Ll(),r=!0}}}function xy(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!vf(t,e):!1}function un(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ll(){return{animate:un(!0),whileInView:un(),whileHover:un(),whileTap:un(),whileDrag:un(),whileFocus:un(),exit:un()}}class sn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class by extends sn{constructor(t){super(t),t.animationState||(t.animationState=yy(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ii(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 vy=0;class wy extends sn{constructor(){super(...arguments),this.id=vy++}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 i=this.node.animationState.setActive("exit",!t);n&&!t&&i.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 ky={animation:{Feature:by},exit:{Feature:wy}};function jr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Fr(e){return{point:{x:e.pageX,y:e.pageY}}}const Sy=e=>t=>sa(t)&&e(t,Fr(t));function gr(e,t,n,r){return jr(e,t,Sy(n),r)}const kf=1e-4,Cy=1-kf,Ey=1+kf,Sf=.01,Ty=0-Sf,Ay=0+Sf;function ct(e){return e.max-e.min}function jy(e,t,n){return Math.abs(e-t)<=n}function Ol(e,t,n,r=.5){e.origin=r,e.originPoint=qe(t.min,t.max,e.origin),e.scale=ct(n)/ct(t),e.translate=qe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Cy&&e.scale<=Ey||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ty&&e.translate<=Ay||isNaN(e.translate))&&(e.translate=0)}function yr(e,t,n,r){Ol(e.x,t.x,n.x,r?r.originX:void 0),Ol(e.y,t.y,n.y,r?r.originY:void 0)}function $l(e,t,n){e.min=n.min+t.min,e.max=e.min+ct(t)}function Py(e,t,n){$l(e.x,t.x,n.x),$l(e.y,t.y,n.y)}function _l(e,t,n){e.min=t.min-n.min,e.max=e.min+ct(t)}function xr(e,t,n){_l(e.x,t.x,n.x),_l(e.y,t.y,n.y)}function vt(e){return[e("x"),e("y")]}const Cf=({current:e})=>e?e.ownerDocument.defaultView:null,Bl=(e,t)=>Math.abs(e-t);function My(e,t){const n=Bl(e.x,t.x),r=Bl(e.y,t.y);return Math.sqrt(n**2+r**2)}class Ef{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=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=ao(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=My(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:p}=h,{timestamp:b}=it;this.history.push({...p,timestamp:b});const{onStart:v,onMove:k}=this.handlers;m||(v&&v(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,h)},this.handlePointerMove=(h,m)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=so(m,this.transformPagePoint),Be.update(this.updatePoint,!0)},this.handlePointerUp=(h,m)=>{this.end();const{onEnd:g,onSessionEnd:p,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=ao(h.type==="pointercancel"?this.lastMoveEventInfo:so(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(h,v),p&&p(h,v)},!sa(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=i||window;const a=Fr(t),l=so(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=it;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,ao(l,this.history)),this.removeListeners=Rr(gr(this.contextWindow,"pointermove",this.handlePointerMove),gr(this.contextWindow,"pointerup",this.handlePointerUp),gr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),tn(this.updatePoint)}}function so(e,t){return t?{point:t(e.point)}:e}function zl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ao({point:e},t){return{point:e,delta:zl(e,Tf(t)),offset:zl(e,Ny(t)),velocity:Iy(t,.1)}}function Ny(e){return e[0]}function Tf(e){return e[e.length-1]}function Iy(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=Tf(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>jt(t)));)n--;if(!r)return{x:0,y:0};const s=Rt(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Ry(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?qe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?qe(n,e,r.max):Math.min(e,n)),e}function Hl(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 Vy(e,{top:t,left:n,bottom:r,right:i}){return{x:Hl(e.x,n,i),y:Hl(e.y,t,r)}}function Ul(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 Dy(e,t){return{x:Ul(e.x,t.x),y:Ul(e.y,t.y)}}function Fy(e,t){let n=.5;const r=ct(e),i=ct(t);return i>r?n=Sr(t.min,t.max-r,e.min):r>i&&(n=Sr(e.min,e.max-i,t.min)),Ht(0,1,n)}function Ly(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 hs=.35;function Oy(e=hs){return e===!1?e=0:e===!0&&(e=hs),{x:Wl(e,"left","right"),y:Wl(e,"top","bottom")}}function Wl(e,t,n){return{min:Zl(e,t),max:Zl(e,n)}}function Zl(e,t){return typeof e=="number"?e:e[t]||0}const $y=new WeakMap;class _y{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=Ye(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=d=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Fr(d).point)},o=(d,h)=>{const{drag:m,dragPropagation:g,onDragStart:p}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Gg(m),!this.openDragLock))return;this.latestPointerEvent=d,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),vt(v=>{let k=this.getAxisMotionValue(v).get()||0;if(Vt.test(k)){const{projection:S}=this.visualElement;if(S&&S.layout){const A=S.layout.layoutBox[v];A&&(k=ct(A)*(parseFloat(k)/100))}}this.originPoint[v]=k}),p&&Be.postRender(()=>p(d,h)),ds(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h;const{dragPropagation:m,dragDirectionLock:g,onDirectionLock:p,onDrag:b}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:v}=h;if(g&&this.currentDirection===null){this.currentDirection=By(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",h.point,v),this.updateAxis("y",h.point,v),this.visualElement.render(),b&&b(d,h)},l=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h,this.stop(d,h),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>vt(d=>{var h;return this.getAnimationState(d)==="paused"&&((h=this.getAxisMotionValue(d).animation)==null?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Ef(t,{onSessionStart:s,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:Cf(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&Be.postRender(()=>a(r,i))}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:i}=this.getProps();if(!r||!qr(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Ry(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&Ln(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Vy(r.layoutBox,t):this.constraints=!1,this.elastic=Oy(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&vt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Ly(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ln(t))return!1;const r=t.current;Ut(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:i}=this.visualElement;if(!i||!i.layout)return!1;const s=z0(r,i.root,this.visualElement.getTransformPagePoint());let o=Dy(i.layout.layoutBox,s);if(n){const a=n($0(o));this.hasMutatedConstraints=!!a,a&&(o=cf(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=vt(u=>{if(!qr(u,n,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const h=i?200:1e6,m=i?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ds(this.visualElement,t),r.start(ga(t,r,0,n,this.visualElement,!1))}stopAnimation(){vt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){vt(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(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){vt(n=>{const{drag:r}=this.getProps();if(!qr(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-qe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ln(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};vt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=Fy({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),vt(o=>{if(!qr(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(qe(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;$y.set(this.visualElement,this);const t=this.visualElement.current,n=gr(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ln(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Be.read(r);const o=jr(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(vt(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=hs,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function qr(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function By(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class zy extends sn{constructor(t){super(t),this.removeGroupControls=Ct,this.removeListeners=Ct,this.controls=new _y(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ct}unmount(){this.removeGroupControls(),this.removeListeners()}}const ql=e=>(t,n)=>{e&&Be.postRender(()=>e(t,n))};class Hy extends sn{constructor(){super(...arguments),this.removePointerDownListener=Ct}onPointerDown(t){this.session=new Ef(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Cf(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:ql(t),onStart:ql(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Be.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=gr(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 ci={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Gl(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const or={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ye.test(e))e=parseFloat(e);else return e;const n=Gl(e,t.target.x),r=Gl(e,t.target.y);return`${n}% ${r}%`}},Uy={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=nn.parse(e);if(i.length>5)return r;const s=nn.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const c=qe(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};let lo=!1;class Wy extends j.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;h0(Zy),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),lo&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),ci.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:o}=r;return o&&(o.isPresent=s,lo=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Be.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),oa.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;lo=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Af(e){const[t,n]=Gd(),r=j.useContext(Ls);return f.jsx(Wy,{...e,layoutGroup:r,switchLayoutGroup:j.useContext(af),isPresent:t,safeToRemove:n})}const Zy={borderRadius:{...or,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:or,borderTopRightRadius:or,borderBottomLeftRadius:or,borderBottomRightRadius:or,boxShadow:Uy};function qy(e,t,n){const r=ot(e)?e:Zn(e);return r.start(ga("",r,t,n)),r.animation}const Gy=(e,t)=>e.depth-t.depth;class Ky{constructor(){this.children=[],this.isDirty=!1}add(t){_s(this.children,t),this.isDirty=!0}remove(t){Bs(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Gy),this.isDirty=!1,this.children.forEach(t)}}function Yy(e,t){const n=ft.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(tn(r),e(s-t))};return Be.setup(r,!0),()=>tn(r)}const jf=["TopLeft","TopRight","BottomLeft","BottomRight"],Xy=jf.length,Kl=e=>typeof e=="string"?parseFloat(e):e,Yl=e=>typeof e=="number"||ye.test(e);function Qy(e,t,n,r,i,s){i?(e.opacity=qe(0,n.opacity??1,Jy(r)),e.opacityExit=qe(t.opacity??1,0,ex(r))):s&&(e.opacity=qe(t.opacity??1,n.opacity??1,r));for(let o=0;o<Xy;o++){const a=`border${jf[o]}Radius`;let l=Xl(t,a),c=Xl(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Yl(l)===Yl(c)?(e[a]=Math.max(qe(Kl(l),Kl(c),r),0),(Vt.test(c)||Vt.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=qe(t.rotate||0,n.rotate||0,r))}function Xl(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Jy=Pf(0,.5,md),ex=Pf(.5,.95,Ct);function Pf(e,t,n){return r=>r<e?0:r>t?1:n(Sr(e,t,r))}function Ql(e,t){e.min=t.min,e.max=t.max}function bt(e,t){Ql(e.x,t.x),Ql(e.y,t.y)}function Jl(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function ec(e,t,n,r,i){return e-=t,e=vi(e,1/n,r),i!==void 0&&(e=vi(e,1/i,r)),e}function tx(e,t=0,n=1,r=.5,i,s=e,o=e){if(Vt.test(t)&&(t=parseFloat(t),t=qe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=qe(s.min,s.max,r);e===s&&(a-=t),e.min=ec(e.min,t,n,a,i),e.max=ec(e.max,t,n,a,i)}function tc(e,t,[n,r,i],s,o){tx(e,t[n],t[r],t[i],t.scale,s,o)}const nx=["x","scaleX","originX"],rx=["y","scaleY","originY"];function nc(e,t,n,r){tc(e.x,t,nx,n?n.x:void 0,r?r.x:void 0),tc(e.y,t,rx,n?n.y:void 0,r?r.y:void 0)}function rc(e){return e.translate===0&&e.scale===1}function Mf(e){return rc(e.x)&&rc(e.y)}function ic(e,t){return e.min===t.min&&e.max===t.max}function ix(e,t){return ic(e.x,t.x)&&ic(e.y,t.y)}function oc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Nf(e,t){return oc(e.x,t.x)&&oc(e.y,t.y)}function sc(e){return ct(e.x)/ct(e.y)}function ac(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class ox{constructor(){this.members=[]}add(t){_s(this.members,t),t.scheduleRender()}remove(t){if(Bs(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(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;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:i}=t.options;i===!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 sx(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:h,skewX:m,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const co=["","X","Y","Z"],ax=1e3;let lx=0;function uo(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function If(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=yf(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Be,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&If(r)}function Rf({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=lx++,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(dx),this.nodes.forEach(px),this.nodes.forEach(gx),this.nodes.forEach(fx)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,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 l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ky)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Hs),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=qd(o)&&!e0(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,d=0;const h=()=>this.root.updateBlockedByResize=!1;Be.read(()=>{d=window.innerWidth}),e(o,()=>{const m=window.innerWidth;m!==d&&(d=m,this.root.updateBlockedByResize=!0,u&&u(),u=Yy(h,250),ci.hasAnimatedSinceResize&&(ci.hasAnimatedSinceResize=!1,this.nodes.forEach(uc)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||wx,{onLayoutAnimationStart:p,onLayoutAnimationComplete:b}=c.getProps(),v=!this.targetLayout||!Nf(this.targetLayout,m),k=!d&&h;if(this.options.layoutRoot||this.resumeFrom||k||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S={...ra(g,"layout"),onPlay:p,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(u,k)}else d||uc(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),tn(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(yx),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&If(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(lc);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(cc);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(mx),this.nodes.forEach(cx),this.nodes.forEach(ux)):this.nodes.forEach(cc),this.clearAllSnapshots();const a=ft.now();it.delta=Ht(0,1e3/60,a-it.timestamp),it.timestamp=a,it.isProcessing=!0,Qi.update.process(it),Qi.preRender.process(it),Qi.render.process(it),it.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,oa.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(hx),this.sharedNodes.forEach(xx)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Be.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Be.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ct(this.snapshot.measuredBox.x)&&!ct(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ye(),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,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Mf(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||hn(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),kx(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return Ye();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(Sx))){const{scroll:u}=this.root;u&&(On(a.x,u.offset.x),On(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=Ye();if(bt(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&bt(a,o),On(a.x,d.offset.x),On(a.y,d.offset.y))}return a}applyTransform(o,a=!1){const l=Ye();bt(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&$n(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),hn(u.latestValues)&&$n(l,u.latestValues)}return hn(this.latestValues)&&$n(l,this.latestValues),l}removeTransform(o){const a=Ye();bt(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!hn(c.latestValues))continue;as(c.latestValues)&&c.updateSnapshot();const u=Ye(),d=c.measurePageBox();bt(u,d),nc(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return hn(this.latestValues)&&nc(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==it.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!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 l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=it.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ye(),this.relativeTargetOrigin=Ye(),xr(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),bt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ye(),this.targetWithTransforms=Ye()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Py(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):bt(this.target,this.layout.layoutBox),df(this.target,this.targetDelta)):bt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ye(),this.relativeTargetOrigin=Ye(),xr(this.relativeTargetOrigin,this.target,m.target),bt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||as(this.parent.latestValues)||uf(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 g;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===it.timestamp&&(l=!1),l)return;const{layout:c,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||!(c||u))return;bt(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;B0(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Ye());const{target:m}=o;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Jl(this.prevProjectionDelta.x,this.projectionDelta.x),Jl(this.prevProjectionDelta.y,this.projectionDelta.y)),yr(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!ac(this.projectionDelta.x,this.prevProjectionDelta.x)||!ac(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=_n(),this.projectionDelta=_n(),this.projectionDeltaWithTransform=_n()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=_n();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Ye(),m=l?l.source:void 0,g=this.layout?this.layout.source:void 0,p=m!==g,b=this.getStack(),v=!b||b.members.length<=1,k=!!(p&&!v&&this.options.crossfade===!0&&!this.path.some(vx));this.animationProgress=0;let S;this.mixTargetDelta=A=>{const T=A/1e3;dc(d.x,o.x,T),dc(d.y,o.y,T),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xr(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),bx(this.relativeTarget,this.relativeTargetOrigin,h,T),S&&ix(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=Ye()),bt(S,this.relativeTarget)),p&&(this.animationValues=u,Qy(u,c,this.latestValues,T,k,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(tn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Be.update(()=>{ci.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Zn(0)),this.currentAnimation=qy(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ax),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Vf(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Ye();const d=ct(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=ct(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}bt(a,l),$n(a,u),yr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new ox),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&uo("z",o,c,this.animationValues);for(let u=0;u<co.length;u++)uo(`rotate${co[u]}`,o,c,this.animationValues),uo(`skew${co[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=li(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=li(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!hn(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=sx(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),o.transform=d;const{x:h,y:m}=this.projectionDelta;o.transformOrigin=`${h.origin*100}% ${m.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in Ar){if(u[g]===void 0)continue;const{correct:p,applyTo:b,isCSSVariable:v}=Ar[g],k=d==="none"?u[g]:p(u[g],c);if(b){const S=b.length;for(let A=0;A<S;A++)o[b[A]]=k}else v?this.options.visualElement.renderState.vars[g]=k:o[g]=k}this.options.layoutId&&(o.pointerEvents=c===this?li(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(lc),this.root.sharedNodes.clear()}}}function cx(e){e.updateLayout()}function ux(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:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?vt(d=>{const h=o?t.measuredBox[d]:t.layoutBox[d],m=ct(h);h.min=r[d].min,h.max=h.min+m}):Vf(s,t.layoutBox,r)&&vt(d=>{const h=o?t.measuredBox[d]:t.layoutBox[d],m=ct(r[d]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+m)});const a=_n();yr(a,r,t.layoutBox);const l=_n();o?yr(l,e.applyTransform(i,!0),t.measuredBox):yr(l,r,t.layoutBox);const c=!Mf(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:m}=d;if(h&&m){const g=Ye();xr(g,t.layoutBox,h.layoutBox);const p=Ye();xr(p,r,m.layoutBox),Nf(g,p)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=g,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function dx(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 fx(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hx(e){e.clearSnapshot()}function lc(e){e.clearMeasurements()}function cc(e){e.isLayoutDirty=!1}function mx(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function uc(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function px(e){e.resolveTargetDelta()}function gx(e){e.calcProjection()}function yx(e){e.resetSkewAndRotation()}function xx(e){e.removeLeadSnapshot()}function dc(e,t,n){e.translate=qe(t.translate,0,n),e.scale=qe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function fc(e,t,n,r){e.min=qe(t.min,n.min,r),e.max=qe(t.max,n.max,r)}function bx(e,t,n,r){fc(e.x,t.x,n.x,r),fc(e.y,t.y,n.y,r)}function vx(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const wx={duration:.45,ease:[.4,0,.1,1]},hc=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),mc=hc("applewebkit/")&&!hc("chrome/")?Math.round:Ct;function pc(e){e.min=mc(e.min),e.max=mc(e.max)}function kx(e){pc(e.x),pc(e.y)}function Vf(e,t,n){return e==="position"||e==="preserve-aspect"&&!jy(sc(t),sc(n),.2)}function Sx(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Cx=Rf({attachResizeListener:(e,t)=>jr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),fo={current:void 0},Df=Rf({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fo.current){const e=new Cx({});e.mount(window),e.setOptions({layoutScroll:!0}),fo.current=e}return fo.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ex={pan:{Feature:Hy},drag:{Feature:zy,ProjectionNode:Df,MeasureLayout:Af}};function gc(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Be.postRender(()=>s(t,Fr(t)))}class Tx extends sn{mount(){const{current:t}=this.node;t&&(this.unmount=Kg(t,(n,r)=>(gc(this.node,r,"Start"),i=>gc(this.node,i,"End"))))}unmount(){}}class Ax extends sn{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=Rr(jr(this.node.current,"focus",()=>this.onFocus()),jr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function yc(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 i="onTap"+(n==="End"?"":n),s=r[i];s&&Be.postRender(()=>s(t,Fr(t)))}class jx extends sn{mount(){const{current:t}=this.node;t&&(this.unmount=Jg(t,(n,r)=>(yc(this.node,r,"Start"),(i,{success:s})=>yc(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ms=new WeakMap,ho=new WeakMap,Px=e=>{const t=ms.get(e.target);t&&t(e)},Mx=e=>{e.forEach(Px)};function Nx({root:e,...t}){const n=e||document;ho.has(n)||ho.set(n,{});const r=ho.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Mx,{root:e,...t})),r[i]}function Ix(e,t,n){const r=Nx(t);return ms.set(e,n),r.observe(e),()=>{ms.delete(e),r.unobserve(e)}}const Rx={some:0,all:1};class Vx extends sn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Rx[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return Ix(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Dx(t,n))&&this.startObserver()}unmount(){}}function Dx({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Fx={inView:{Feature:Vx},tap:{Feature:jx},focus:{Feature:Ax},hover:{Feature:Tx}},Lx={layout:{ProjectionNode:Df,MeasureLayout:Af}},Ox={...ky,...Fx,...Ex,...Lx},ge=O0(Ox,X0),Mt=x.forwardRef((e,t)=>{const{alt:n,color:r="currentColor",size:i="1em",weight:s="regular",mirrored:o=!1,children:a,weights:l,...c}=e;return x.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,fill:r,viewBox:"0 0 256 256",transform:o?"scale(-1, 1)":void 0,...c},!!n&&x.createElement("title",null,n),a,l.get(s))});Mt.displayName="SSRBase";const $x=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),ya=x.forwardRef((e,t)=>x.createElement(Mt,{ref:t,...e,weights:$x}));ya.displayName="CaretDownIcon";const _x=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.createElement("path",{d:"M208,160H48l80-80Z",opacity:"0.2"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),Ff=x.forwardRef((e,t)=>x.createElement(Mt,{ref:t,...e,weights:_x}));Ff.displayName="CaretUpIcon";const Bx=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),Lf=x.forwardRef((e,t)=>x.createElement(Mt,{ref:t,...e,weights:Bx}));Lf.displayName="ChatTextIcon";const zx=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),Of=x.forwardRef((e,t)=>x.createElement(Mt,{ref:t,...e,weights:zx}));Of.displayName="CheckIcon";const Hx=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),$f=x.forwardRef((e,t)=>x.createElement(Mt,{ref:t,...e,weights:Hx}));$f.displayName="MicrophoneIcon";const Ux=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),_f=x.forwardRef((e,t)=>x.createElement(Mt,{ref:t,...e,weights:Ux}));_f.displayName="MicrophoneSlashIcon";const Wx=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),Bf=x.forwardRef((e,t)=>x.createElement(Mt,{ref:t,...e,weights:Wx}));Bf.displayName="MonitorArrowUpIcon";const Zx=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),xa=x.forwardRef((e,t)=>x.createElement(Mt,{ref:t,...e,weights:Zx}));xa.displayName="SpinnerIcon";const qx=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),zf=x.forwardRef((e,t)=>x.createElement(Mt,{ref:t,...e,weights:qx}));zf.displayName="VideoCameraIcon";const Gx=new Map([["bold",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}),x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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",x.createElement(x.Fragment,null,x.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"}))]]),Hf=x.forwardRef((e,t)=>x.createElement(Mt,{ref:t,...e,weights:Gx}));Hf.displayName="VideoCameraSlashIcon";function xc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Kx(...e){return t=>{let n=!1;const r=e.map(i=>{const s=xc(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():xc(e[i],null)}}}}function Yx(e){const t=Qx(e),n=x.forwardRef((r,i)=>{const{children:s,...o}=r,a=x.Children.toArray(s),l=a.find(e1);if(l){const c=l.props.children,u=a.map(d=>d===l?x.Children.count(c)>1?x.Children.only(null):x.isValidElement(c)?c.props.children:null:d);return f.jsx(t,{...o,ref:i,children:x.isValidElement(c)?x.cloneElement(c,void 0,u):null})}return f.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var Xx=Yx("Slot");function Qx(e){const t=x.forwardRef((n,r)=>{const{children:i,...s}=n;if(x.isValidElement(i)){const o=n1(i),a=t1(s,i.props);return i.type!==x.Fragment&&(a.ref=r?Kx(r,o):o),x.cloneElement(i,a)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jx=Symbol("radix.slottable");function e1(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Jx}function t1(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function n1(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const ba="-",r1=e=>{const t=o1(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(ba);return a[0]===""&&a.length!==1&&a.shift(),Uf(a,t)||i1(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},Uf=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Uf(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(ba);return(o=t.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},bc=/^\[(.+)\]$/,i1=e=>{if(bc.test(e)){const t=bc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},o1=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)ps(n[i],r,i,t);return r},ps=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:vc(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(s1(i)){ps(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{ps(o,vc(t,s),n,r)})})},vc=(e,t)=>{let n=e;return t.split(ba).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},s1=e=>e.isThemeGetter,a1=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},gs="!",ys=":",l1=ys.length,c1=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let o=0,a=0,l=0,c;for(let g=0;g<i.length;g++){let p=i[g];if(o===0&&a===0){if(p===ys){s.push(i.slice(l,g)),l=g+l1;continue}if(p==="/"){c=g;continue}}p==="["?o++:p==="]"?o--:p==="("?a++:p===")"&&a--}const u=s.length===0?i:i.substring(l),d=u1(u),h=d!==u,m=c&&c>l?c-l:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:d,maybePostfixModifierPosition:m}};if(t){const i=t+ys,s=r;r=o=>o.startsWith(i)?s(o.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},u1=e=>e.endsWith(gs)?e.substring(0,e.length-1):e.startsWith(gs)?e.substring(1):e,d1=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let s=[];return r.forEach(o=>{o[0]==="["||t[o]?(i.push(...s.sort(),o),s=[]):s.push(o)}),i.push(...s.sort()),i}},f1=e=>({cache:a1(e.cacheSize),parseClassName:c1(e),sortModifiers:d1(e),...r1(e)}),h1=/\s+/,m1=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,o=[],a=e.trim().split(h1);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:h,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:p}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let b=!!p,v=r(b?g.substring(0,p):g);if(!v){if(!b){l=u+(l.length>0?" "+l:l);continue}if(v=r(g),!v){l=u+(l.length>0?" "+l:l);continue}b=!1}const k=s(h).join(":"),S=m?k+gs:k,A=S+v;if(o.includes(A))continue;o.push(A);const T=i(v,b);for(let C=0;C<T.length;++C){const N=T[C];o.push(S+N)}l=u+(l.length>0?" "+l:l)}return l};function p1(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Wf(t))&&(r&&(r+=" "),r+=n);return r}const Wf=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Wf(e[r]))&&(n&&(n+=" "),n+=t);return n};function g1(e,...t){let n,r,i,s=o;function o(l){const c=t.reduce((u,d)=>d(u),e());return n=f1(c),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=m1(l,n);return i(l,u),u}return function(){return s(p1.apply(null,arguments))}}const nt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Zf=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qf=/^\((?:(\w[\w-]*):)?(.+)\)$/i,y1=/^\d+\/\d+$/,x1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,b1=/\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$/,v1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,w1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,k1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,En=e=>y1.test(e),we=e=>!!e&&!Number.isNaN(Number(e)),Kt=e=>!!e&&Number.isInteger(Number(e)),mo=e=>e.endsWith("%")&&we(e.slice(0,-1)),Ot=e=>x1.test(e),S1=()=>!0,C1=e=>b1.test(e)&&!v1.test(e),Gf=()=>!1,E1=e=>w1.test(e),T1=e=>k1.test(e),A1=e=>!ae(e)&&!le(e),j1=e=>er(e,Xf,Gf),ae=e=>Zf.test(e),dn=e=>er(e,Qf,C1),po=e=>er(e,R1,we),wc=e=>er(e,Kf,Gf),P1=e=>er(e,Yf,T1),Gr=e=>er(e,Jf,E1),le=e=>qf.test(e),sr=e=>tr(e,Qf),M1=e=>tr(e,V1),kc=e=>tr(e,Kf),N1=e=>tr(e,Xf),I1=e=>tr(e,Yf),Kr=e=>tr(e,Jf,!0),er=(e,t,n)=>{const r=Zf.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},tr=(e,t,n=!1)=>{const r=qf.exec(e);return r?r[1]?t(r[1]):n:!1},Kf=e=>e==="position"||e==="percentage",Yf=e=>e==="image"||e==="url",Xf=e=>e==="length"||e==="size"||e==="bg-size",Qf=e=>e==="length",R1=e=>e==="number",V1=e=>e==="family-name",Jf=e=>e==="shadow",D1=()=>{const e=nt("color"),t=nt("font"),n=nt("text"),r=nt("font-weight"),i=nt("tracking"),s=nt("leading"),o=nt("breakpoint"),a=nt("container"),l=nt("spacing"),c=nt("radius"),u=nt("shadow"),d=nt("inset-shadow"),h=nt("text-shadow"),m=nt("drop-shadow"),g=nt("blur"),p=nt("perspective"),b=nt("aspect"),v=nt("ease"),k=nt("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...A(),le,ae],C=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],P=()=>[le,ae,l],L=()=>[En,"full","auto",...P()],y=()=>[Kt,"none","subgrid",le,ae],M=()=>["auto",{span:["full",Kt,le,ae]},Kt,le,ae],D=()=>[Kt,"auto",le,ae],B=()=>["auto","min","max","fr",le,ae],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],de=()=>["auto",...P()],ie=()=>[En,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],F=()=>[e,le,ae],W=()=>[...A(),kc,wc,{position:[le,ae]}],w=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",N1,j1,{size:[le,ae]}],oe=()=>[mo,sr,dn],E=()=>["","none","full",c,le,ae],U=()=>["",we,sr,dn],se=()=>["solid","dashed","dotted","double"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[we,mo,kc,wc],Q=()=>["","none",g,le,ae],V=()=>["none",we,le,ae],G=()=>["none",we,le,ae],fe=()=>[we,le,ae],R=()=>[En,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ot],breakpoint:[Ot],color:[S1],container:[Ot],"drop-shadow":[Ot],ease:["in","out","in-out"],font:[A1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ot],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ot],shadow:[Ot],spacing:["px",we],text:[Ot],"text-shadow":[Ot],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",En,ae,le,b]}],container:["container"],columns:[{columns:[we,ae,le,a]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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:T()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Kt,"auto",le,ae]}],basis:[{basis:[En,"full","auto",a,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[we,En,"auto","initial","none",ae]}],grow:[{grow:["",we,le,ae]}],shrink:[{shrink:["",we,le,ae]}],order:[{order:[Kt,"first","last","none",le,ae]}],"grid-cols":[{"grid-cols":y()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":y()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:de()}],mx:[{mx:de()}],my:[{my:de()}],ms:[{ms:de()}],me:[{me:de()}],mt:[{mt:de()}],mr:[{mr:de()}],mb:[{mb:de()}],ml:[{ml:de()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:ie()}],w:[{w:[a,"screen",...ie()]}],"min-w":[{"min-w":[a,"screen","none",...ie()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...ie()]}],h:[{h:["screen","lh",...ie()]}],"min-h":[{"min-h":["screen","lh","none",...ie()]}],"max-h":[{"max-h":["screen","lh",...ie()]}],"font-size":[{text:["base",n,sr,dn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,le,po]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",mo,ae]}],"font-family":[{font:[M1,ae,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:[i,le,ae]}],"line-clamp":[{"line-clamp":[we,"none",le,po]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",le,ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",le,ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[we,"from-font","auto",le,dn]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[we,"auto",le,ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le,ae]}],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",le,ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:w()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Kt,le,ae],radial:["",le,ae],conic:[Kt,le,ae]},I1,P1]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:E()}],"rounded-s":[{"rounded-s":E()}],"rounded-e":[{"rounded-e":E()}],"rounded-t":[{"rounded-t":E()}],"rounded-r":[{"rounded-r":E()}],"rounded-b":[{"rounded-b":E()}],"rounded-l":[{"rounded-l":E()}],"rounded-ss":[{"rounded-ss":E()}],"rounded-se":[{"rounded-se":E()}],"rounded-ee":[{"rounded-ee":E()}],"rounded-es":[{"rounded-es":E()}],"rounded-tl":[{"rounded-tl":E()}],"rounded-tr":[{"rounded-tr":E()}],"rounded-br":[{"rounded-br":E()}],"rounded-bl":[{"rounded-bl":E()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[we,le,ae]}],"outline-w":[{outline:["",we,sr,dn]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",u,Kr,Gr]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",d,Kr,Gr]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[we,dn]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",h,Kr,Gr]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[we,le,ae]}],"mix-blend":[{"mix-blend":[...$(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$()}],"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":[we]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[le,ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[we]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:w()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",le,ae]}],filter:[{filter:["","none",le,ae]}],blur:[{blur:Q()}],brightness:[{brightness:[we,le,ae]}],contrast:[{contrast:[we,le,ae]}],"drop-shadow":[{"drop-shadow":["","none",m,Kr,Gr]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",we,le,ae]}],"hue-rotate":[{"hue-rotate":[we,le,ae]}],invert:[{invert:["",we,le,ae]}],saturate:[{saturate:[we,le,ae]}],sepia:[{sepia:["",we,le,ae]}],"backdrop-filter":[{"backdrop-filter":["","none",le,ae]}],"backdrop-blur":[{"backdrop-blur":Q()}],"backdrop-brightness":[{"backdrop-brightness":[we,le,ae]}],"backdrop-contrast":[{"backdrop-contrast":[we,le,ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",we,le,ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[we,le,ae]}],"backdrop-invert":[{"backdrop-invert":["",we,le,ae]}],"backdrop-opacity":[{"backdrop-opacity":[we,le,ae]}],"backdrop-saturate":[{"backdrop-saturate":[we,le,ae]}],"backdrop-sepia":[{"backdrop-sepia":["",we,le,ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",le,ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[we,"initial",le,ae]}],ease:[{ease:["linear","initial",v,le,ae]}],delay:[{delay:[we,le,ae]}],animate:[{animate:["none",k,le,ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,le,ae]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:G()}],"scale-x":[{"scale-x":G()}],"scale-y":[{"scale-y":G()}],"scale-z":[{"scale-z":G()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[le,ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:R()}],"translate-x":[{"translate-x":R()}],"translate-y":[{"translate-y":R()}],"translate-z":[{"translate-z":R()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"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",le,ae]}],"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":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",le,ae]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[we,sr,dn,po]}],stroke:[{stroke:["none",...F()]}],"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"]}},F1=g1(D1);function ce(...e){return F1(Ds.clsx(e))}const L1=Vs.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 O1({className:e,variant:t,size:n,asChild:r=!1,...i}){const s=r?Xx:"button";return f.jsx(s,{"data-slot":"button",className:ce(L1({variant:t,size:n,className:e})),...i})}const $1=Vs.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 eh({className:e,variant:t,size:n,...r}){return f.jsx(sp.Root,{"data-slot":"toggle",className:ce($1({variant:t,size:n,className:e})),...r})}const va=typeof window<"u",wi=typeof document<"u",_1=typeof navigator<"u",Xe=wi?document:null,zt=va?window:null,zn=_1?navigator:null,Vi=(e,t)=>va?e():t,B1=e=>(Xe==null?void 0:Xe.getElementById(e))||null,th=e=>(Xe==null?void 0:Xe.querySelector(e))||null,nh=e=>(Xe==null?void 0:Xe.createElement(e))||null,wa=(e,t,n,r)=>{e&&"addEventListener"in e&&e.addEventListener(t,n,r)},ka=(e,t,n,r)=>{e&&"removeEventListener"in e&&e.removeEventListener(t,n,r)},rh=()=>(zn==null?void 0:zn.userAgent)||"",ih=()=>Vi(()=>"ontouchstart"in window||((navigator==null?void 0:navigator.maxTouchPoints)||0)>0,!1)||!1,oh=()=>Vi(()=>({width:window.innerWidth,height:window.innerHeight}),{width:0,height:0})||{width:0,height:0},z1=e=>{const t=Xe==null?void 0:Xe.documentElement;return t&&"requestFullscreen"in t?t.requestFullscreen():null},H1=()=>Xe&&"exitFullscreen"in Xe?Xe.exitFullscreen():null,U1=()=>Vi(()=>!!document.fullscreenElement,!1)||!1,Sc=e=>{Vi(()=>{document.body&&Object.assign(document.body.style,e)})},W1=()=>(zn==null?void 0:zn.mediaDevices)||null;function Z1(e){const[t,n]=j.useState(()=>e.getPublishPermissions());return j.useEffect(()=>{const r=()=>{n(e.getPublishPermissions())},i=()=>{r()};return e.on("connection.connected",i),e.on("connection.disconnected",i),()=>{e.off("connection.connected",i),e.off("connection.disconnected",i)}},[e]),t}function sh(e){const[t,n]=j.useState(()=>e.getLocalParticipant()),[r,i]=j.useState(()=>e.getMicrophoneTrack());return j.useEffect(()=>{const s=()=>{const a=e.getLocalParticipant(),l=e.getMicrophoneTrack();console.log("🎤 useVoxketLocalParticipant: Updating state:",{hasParticipant:!!a,hasMicTrack:!!l,isMicEnabled:e.isMicrophoneEnabled,trackPublications:a?a.trackPublications.size:0}),n(a),i(l)};s(),e.on("connection.connected",s),e.on("connection.disconnected",s),e.on("track.muted",s),e.on("track.unmuted",s);const o=e.getRoom();if(o){const a=()=>{console.log("🎤 Track published, updating participant state"),s()},l=()=>{console.log("🎤 Track unpublished, updating participant state"),s()};return o.on("localTrackPublished",a),o.on("localTrackUnpublished",l),()=>{e.off("connection.connected",s),e.off("connection.disconnected",s),e.off("track.muted",s),e.off("track.unmuted",s),o.off("localTrackPublished",a),o.off("localTrackUnpublished",l)}}else return()=>{e.off("connection.connected",s),e.off("connection.disconnected",s),e.off("track.muted",s),e.off("track.unmuted",s)}},[e]),{localParticipant:t,microphoneTrack:r}}function Hn(e,t,n){const[r,i]=j.useState(!1),[s,o]=j.useState(!1);return j.useEffect(()=>{const l=()=>{let c=!1;switch(t){case"microphone":c=e.isMicrophoneEnabled;break;case"camera":c=e.isCameraEnabled;break;case"screenShare":c=e.isScreenShareEnabled;break}console.log(`🎬 useVoxketTrackToggle: ${t} enabled state updated:`,{oldEnabled:r,newEnabled:c,changed:r!==c}),i(c)};return l(),e.on("track.muted",l),e.on("track.unmuted",l),e.on("connection.connected",l),()=>{e.off("track.muted",l),e.off("track.unmuted",l),e.off("connection.connected",l)}},[e,t]),{enabled:r,pending:s,toggle:async l=>{var c;try{o(!0);const u=l!==void 0?l:!r;switch(console.log(`🎬 useVoxketTrackToggle: ${t} toggle called`,{currentEnabled:r,targetEnabled:u,forceEnabled:l}),t){case"microphone":await e.toggleMicrophone(u);break;case"camera":await e.toggleCamera(u);break;case"screenShare":u?(console.log("🎬 useVoxketTrackToggle: Starting screen share"),await e.startScreenShare()):(console.log("🎬 useVoxketTrackToggle: Stopping screen share"),await e.stopScreenShare());break}console.log(`🎬 useVoxketTrackToggle: ${t} toggle completed`)}catch(u){console.error(`🎬 useVoxketTrackToggle: ${t} toggle failed:`,u),(c=n==null?void 0:n.onDeviceError)==null||c.call(n,u)}finally{o(!1)}}}}function ah(e){const[t,n]=j.useState(()=>e.getRoom()),[r,i]=j.useState(()=>e.getConnectionState());return j.useEffect(()=>{const s=()=>{n(e.getRoom()),i(e.getConnectionState())};return e.on("connection.connected",s),e.on("connection.disconnected",s),e.on("connection.connecting",s),()=>{e.off("connection.connected",s),e.off("connection.disconnected",s),e.off("connection.connecting",s)}},[e]),t}function q1(e,t){const[n,r]=j.useState([]),[i,s]=j.useState("");return j.useEffect(()=>{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 l=()=>{a()},c=W1();return c&&c.addEventListener("devicechange",l),()=>{c&&c.removeEventListener("devicechange",l)}},[e,t]),{devices:n,activeDeviceId:i,setActiveMediaDevice:async a=>{try{t==="audioinput"?await e.setAudioInputDevice(a):await e.setVideoInputDevice(a),s(a)}catch(l){console.error("Failed to set device:",l)}}}}function G1(e){const{preventSave:t=!1}=e||{};return{saveAudioInputEnabled:o=>{t||localStorage.setItem("voxket-audio-input-enabled",o.toString())},saveAudioInputDeviceId:o=>{t||localStorage.setItem("voxket-audio-input-device-id",o)},saveVideoInputEnabled:o=>{t||localStorage.setItem("voxket-video-input-enabled",o.toString())},saveVideoInputDeviceId:o=>{t||localStorage.setItem("voxket-video-input-device-id",o)}}}function lh(e){const[t,n]=j.useState(()=>e.getIsAgentConnected()),[r,i]=j.useState(()=>e.getCurrentSession()),[s,o]=j.useState(()=>e.getCurrentAgentInfo()),[a,l]=j.useState(()=>e.getAgentState()),[c,u]=j.useState(()=>e.getAgentAudioTrack()),[d,h]=j.useState(()=>e.getAgentVideoTrack());return j.useEffect(()=>{const m=()=>{const S=e.getIsAgentConnected(),A=e.getCurrentSession(),T=e.getCurrentAgentInfo(),C=e.getAgentState(),N=e.getAgentAudioTrack(),P=e.getAgentVideoTrack();console.log("🤖 useVoxketVoiceAssistant: Updating state:",{isAgentConnected:S,hasSession:!!A,sessionId:A==null?void 0:A.id,hasAgentInfo:!!T,agentState:C,hasAudioTrack:!!N,hasVideoTrack:!!P}),n(S),i(A),o(T),l(C),u(N),h(P)};m();const g=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent connected event"),m()},p=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent disconnected event"),m()},b=()=>{console.log("🤖 useVoxketVoiceAssistant: Session changed event"),m()},v=()=>{console.log("🤖 useVoxketVoiceAssistant: Connection changed event"),m()},k=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent state changed event"),m()};return e.on("agent.connected",g),e.on("agent.speaking",g),e.on("agent.thinking",g),e.on("agent.state.changed",k),e.on("connection.disconnected",p),e.on("session.created",b),e.on("session.ended",b),e.on("session.state.changed",b),e.on("connection.connected",v),()=>{e.off("agent.connected",g),e.off("agent.speaking",g),e.off("agent.thinking",g),e.off("agent.state.changed",k),e.off("connection.disconnected",p),e.off("session.created",b),e.off("session.ended",b),e.off("session.state.changed",b),e.off("connection.connected",v)}},[e]),{agent:{isActive:t,info:s},session:r,state:a,audioTrack:c,videoTrack:d}}function K1(e){const[t,n]=j.useState(()=>e.getVideoTrackRefs()),[r,i]=j.useState(()=>e.getCameraTrackRefs()),[s,o]=j.useState(()=>e.getScreenShareTrackRefs());return j.useEffect(()=>{const a=()=>{const c=e.getVideoTrackRefs(),u=e.getCameraTrackRefs(),d=e.getScreenShareTrackRefs();console.log("📹 useVoxketVideoTracks: Updating tracks:",{videoCount:c.length,cameraCount:u.length,screenShareCount:d.length}),n(c),i(u),o(d)};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 l=e.getRoom();if(l){const c=()=>{console.log("📹 Track event, updating video tracks"),a()};return l.on("localTrackPublished",c),l.on("localTrackUnpublished",c),l.on("trackPublished",c),l.on("trackUnpublished",c),l.on("trackSubscribed",c),l.on("trackUnsubscribed",c),()=>{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),l.off("localTrackPublished",c),l.off("localTrackUnpublished",c),l.off("trackPublished",c),l.off("trackUnpublished",c),l.off("trackSubscribed",c),l.off("trackUnsubscribed",c)}}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:s}}function Cc({...e}){return f.jsx(St.Root,{"data-slot":"select",...e})}function Ec({...e}){return f.jsx(St.Value,{"data-slot":"select-value",...e})}function Tc({className:e,size:t="default",children:n,...r}){return f.jsxs(St.Trigger,{"data-slot":"select-trigger","data-size":t,className:ce(["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,f.jsx(St.Icon,{asChild:!0,children:f.jsx(ya,{weight:"bold",className:"size-4 transition-colors"})})]})}function Ac({className:e,children:t,position:n="popper",...r}){return f.jsx(St.Portal,{children:f.jsxs(St.Content,{"data-slot":"select-content",className:ce(["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:[f.jsx(Y1,{}),f.jsx(St.Viewport,{className:ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),f.jsx(X1,{})]})})}function jc({className:e,children:t,...n}){return f.jsxs(St.Item,{"data-slot":"select-item",className:ce(["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:[f.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(St.ItemIndicator,{children:f.jsx(Of,{className:"size-4",weight:"bold"})})}),f.jsx(St.ItemText,{children:t})]})}function Y1({className:e,...t}){return f.jsx(St.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Ff,{className:"size-4",weight:"bold"})})}function X1({className:e,...t}){return f.jsx(St.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(ya,{className:"size-4",weight:"bold"})})}const Pc=Vs.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 Mc({kind:e,track:t,requestPermissions:n,onError:r,client:i,...s}){const o=s.size||"default";if(!i)return f.jsxs(Cc,{disabled:!0,children:[f.jsx(Tc,{className:ce(Pc({size:o}),s.className),children:f.jsx(Ec,{placeholder:`Select a ${e}`})}),f.jsx(Ac,{children:f.jsx(jc,{value:"none",children:"No devices available"})})]});const{devices:a,activeDeviceId:l,setActiveMediaDevice:c}=q1(i,e==="audioinput"?"audioinput":"videoinput");return f.jsxs(Cc,{value:l,onValueChange:c,children:[f.jsx(Tc,{className:ce(Pc({size:o}),s.className,"hover:bg"),children:o!=="sm"&&f.jsx(Ec,{className:"font-mono text-sm",placeholder:`Select a ${e}`})}),f.jsx(Ac,{children:a.map(u=>f.jsx(jc,{value:u.deviceId,className:"font-mono text-xs",children:u.label},u.deviceId))})]})}function Q1(e,t,n=!1){if(n)return xa;switch(e){case te.Track.Source.Microphone:return t?$f:_f;case te.Track.Source.Camera:return t?zf:Hf;case te.Track.Source.ScreenShare:return Bf;default:return x.Fragment}}function go({source:e,pressed:t,pending:n,className:r,...i}){const s=Q1(e,t??!1,n),o=e===te.Track.Source.Microphone&&!(t??!1)&&!n,a=e===te.Track.Source.Camera&&!(t??!1)&&!n;return x.useEffect(()=>{console.log(`TrackToggle for ${e} changed: pressed=${t}, pending=${n}, actualState=${t?"enabled":"disabled"}`)},[e,t,n]),f.jsxs(eh,{pressed:t,"aria-label":`Toggle ${e}`,className:ce(r),...i,children:[f.jsx(s,{weight:"bold",className:ce(n&&"animate-spin",o||a?"text-red-500":void 0)}),i.children]})}function J1(e){return e?Z1(e):{camera:!0,microphone:!0,screenShare:!0,data:!0}}function eb(e={}){const{controls:t,saveUserChoices:n=!0,client:r}=e,i={leave:!0,...t};if(!r)return{micTrackRef:{participant:void 0,source:te.Track.Source.Microphone,publication:void 0},visibleControls:i,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:s,localParticipant:o}=sh(r),a=J1(r);ah(r);const l=Hn(r,"microphone",{onDeviceError:C=>{var N;return(N=e.onDeviceError)==null?void 0:N.call(e,{source:te.Track.Source.Microphone,error:C})}}),c=Hn(r,"camera",{onDeviceError:C=>{var N;return(N=e.onDeviceError)==null?void 0:N.call(e,{source:te.Track.Source.Camera,error:C})}}),u=Hn(r,"screenShare",{onDeviceError:C=>{var N;return(N=e.onDeviceError)==null?void 0:N.call(e,{source:te.Track.Source.ScreenShare,error:C})}}),d=x.useMemo(()=>{let C;if(o){for(const[,N]of o.trackPublications)if(N.source===te.Track.Source.Microphone){C=N;break}}return console.log("🎤 Creating micTrackRef:",{hasParticipant:!!o,hasPublication:!!C,isTrackSubscribed:C==null?void 0:C.isSubscribed,isMuted:C==null?void 0:C.isMuted,trackSid:C==null?void 0:C.trackSid}),{participant:o??void 0,source:te.Track.Source.Microphone,publication:C}},[o,s]);i.microphone??(i.microphone=a.microphone),i.screenShare??(i.screenShare=a.screenShare),i.camera??(i.camera=a.camera),i.chat??(i.chat=a.data);const{saveAudioInputEnabled:h,saveAudioInputDeviceId:m,saveVideoInputEnabled:g,saveVideoInputDeviceId:p}=G1({preventSave:!n}),b=x.useCallback(()=>{r&&r.disconnect()},[r]),v=x.useCallback(C=>{m(C??"default"),r&&r.setAudioInputDevice(C)},[m,r]),k=x.useCallback(C=>{p(C??"default"),r&&r.setVideoInputDevice(C)},[p,r]),S=x.useCallback(async C=>{u.enabled&&await u.toggle(!1),await c.toggle(C),g(!c.enabled)},[c,g,u]),A=x.useCallback(async C=>{await l.toggle(C),h(!l.enabled)},[l,h]),T=x.useCallback(async C=>{c.enabled&&await c.toggle(!1),await u.toggle(C)},[c,u]);return{micTrackRef:d,visibleControls:i,cameraToggle:{...c,toggle:S},microphoneToggle:{...l,toggle:A},screenShareToggle:{...u,toggle:T},handleDisconnect:b,handleAudioDeviceChange:v,handleVideoDeviceChange:k}}const tb={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 relative 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"}},nb={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 relative 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"}},rb={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 relative",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"}},Nc={dark:tb,light:nb,vox:rb};function tt(e){return Nc[e]||Nc.vox}function ib({onSend:e,disabled:t=!1,className:n,placeholder:r="Type a message..."}){const[i,s]=x.useState(""),[o,a]=x.useState(!1),l=async u=>{if(u.preventDefault(),i.trim()&&!t&&!o){a(!0);try{await e(i.trim()),s("")}catch(d){console.error("Failed to send message:",d)}finally{a(!1)}}},c=u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),l(u))};return f.jsxs("form",{onSubmit:l,className:ce("flex w-full",n),children:[f.jsx("input",{type:"text",value:i,onChange:u=>s(u.target.value),onKeyDown:c,disabled:t||o,placeholder:r,className:"flex-1 px-2 py-1 text-sm bg-transparent border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 disabled:opacity-50"}),f.jsx(O1,{type:"submit",size:"sm",disabled:!i.trim()||t||o,className:"ml-2 px-2 py-1 text-xs",children:o?"...":"Send"})]})}function ob({controls:e,saveUserChoices:t=!0,capabilities:n,className:r,onSendMessage:i,onChatOpenChange:s,onDisconnect:o,onDeviceError:a,theme:l="vox",client:c,...u}){const[d,h]=x.useState(!1),[m,g]=x.useState(!1),p=tt(l),{micTrackRef:b,visibleControls:v,cameraToggle:k,microphoneToggle:S,screenShareToggle:A,handleAudioDeviceChange:T,handleVideoDeviceChange:C,handleDisconnect:N}=eb({controls:e,saveUserChoices:t,client:c}),P=async L=>{g(!0);try{await(i==null?void 0:i(L))}finally{g(!1)}};return x.useEffect(()=>{s==null||s(d)},[d,s]),x.useEffect(()=>{var L,y,M,D;console.log("🎤 AgentControlBar: micTrackRef changed:",{hasParticipant:!!b.participant,hasPublication:!!b.publication,source:b.source,isSubscribed:(L=b.publication)==null?void 0:L.isSubscribed,isMuted:(y=b.publication)==null?void 0:y.isMuted,trackSid:(M=b.publication)==null?void 0:M.trackSid,hasTrack:!!((D=b.publication)!=null&&D.track)})},[b]),f.jsxs("div",{"aria-label":"Voice assistant controls",className:ce(p.controlBar,r),...u,children:[n.suportsChatInput&&f.jsxs("div",{"data-inert":d?void 0:"true",className:ce("overflow-hidden transition-[height] relative duration-300 ease-in-out",d?"h-[56px] mb-2":"h-0"),children:[f.jsx("div",{className:"flex h-8 px-3 w-full",children:f.jsx(ib,{onSend:P,disabled:m,className:ce("w-full",p.chatInput),placeholder:"Type a message..."})}),f.jsx("hr",{className:"border-border my-1 mx-3"})]}),f.jsxs("div",{className:ce("flex flex-row items-center gap-2 rounded-2xl mx-auto border-none backdrop-blur-lg px-2 py-1",l==="light"?"bg-white/80":"bg-[#18182a]/80"),children:[f.jsxs("div",{className:"flex gap-y-2 justify-start",children:[v.microphone&&f.jsxs("div",{className:"flex gap-y-2 items-center rounded-full overflow-hidden border-none ",children:[f.jsx(go,{variant:"primary",source:te.Track.Source.Microphone,pressed:S.enabled,disabled:S.pending,onPressedChange:S.toggle,className:"w-auto py-1 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"}),f.jsx(dt.BarVisualizer,{barCount:3,trackRef:b,options:{minHeight:5},className:"flex h-full w-auto items-center justify-center gap-x-0.5",children:f.jsx("span",{className:ce(["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"])})}),f.jsx(Mc,{size:"sm",kind:"audioinput",client:c,onError:a?L=>L instanceof Error?a({source:te.Track.Source.Microphone,error:L}):void 0:void 0,onActiveDeviceChange:T,className:ce(["h-full py-1 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/30 transition-colors","min-w-[2.5rem]"])})]}),n.suportsVideoInput&&v.camera&&f.jsxs("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:[f.jsx(go,{variant:"primary",source:te.Track.Source.Camera,pressed:k.enabled,pending:k.pending,disabled:k.pending,onPressedChange:k.toggle,className:"w-auto py-1 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"}),f.jsx(Mc,{size:"sm",kind:"videoinput",client:c,onError:a?L=>L instanceof Error?a({source:te.Track.Source.Camera,error:L}):void 0:void 0,onActiveDeviceChange:C,className:ce(["h-full py-1 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors","min-w-[2.5rem]"])})]}),n.suportsScreenShare&&v.screenShare&&f.jsx("div",{className:"flex items-center rounded-full overflow-hidden border-none ",children:f.jsx(go,{variant:"secondary",source:te.Track.Source.ScreenShare,pressed:A.enabled,disabled:A.pending,onPressedChange:A.toggle,className:"w-auto py-1 disabled:opacity-70 rounded-none border-none bg-transparent text-inherit focus:bg-primary/80 hover:bg-primary/80 transition-colors"})})]}),v.chat&&f.jsx("div",{className:"flex items-center rounded-full overflow-hidden bg-secondary text-secondary-foreground border-none ",children:f.jsx(eh,{variant:"secondary","aria-label":"Toggle chat",pressed:d,onPressedChange:L=>{h(L)},className:"aspect-square h-full py-1 rounded-none border-none bg-transparent text-inherit focus:bg-secondary/80 hover:bg-secondary/80 transition-colors flex items-center",children:f.jsx(Lf,{weight:"bold",className:"h-4 w-4"})})})]})]})}const ch=j.forwardRef(({state:e,audioTrack:t,className:n},r)=>f.jsx("div",{ref:r,className:ce("",n),children:t?f.jsx(dt.BarVisualizer,{barCount:5,state:e,options:{minHeight:5},trackRef:t,className:ce("flex aspect-video w-40 items-center justify-center gap-1"),children:f.jsx("span",{className:ce(["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]"])})}):f.jsx("div",{className:ce("flex aspect-video w-40 items-center justify-center"),children:f.jsx("div",{className:"flex flex-col items-center justify-center",children:f.jsx("div",{className:"flex gap-1",children:Array.from({length:5}).map((i,s)=>f.jsx("span",{className:ce(["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"])},s))})})})}));ch.displayName="AgentTile";const sb=({videoTrack:e,className:t,ref:n})=>{var r,i;return!e||!e.publication||!e.participant?f.jsx("div",{ref:n,className:ce(t),children:f.jsx("div",{className:"w-full h-full bg-gray-200 rounded-md flex items-center justify-center",children:f.jsx("span",{className:"text-gray-500",children:"No video available"})})}):f.jsx("div",{ref:n,className:ce(t),children:f.jsx(dt.VideoTrack,{trackRef:e,width:((r=e.publication.dimensions)==null?void 0:r.width)??0,height:((i=e.publication.dimensions)==null?void 0:i.height)??0,className:"rounded-md"})})},ab=ge.create(dt.VideoTrack),lb=({trackRef:e,className:t,ref:n})=>{var r,i;return f.jsx("div",{className:ce("bg-muted overflow-hidden rounded-md",t),children:f.jsx(ab,{ref:n,trackRef:e,width:((r=e==null?void 0:e.publication.dimensions)==null?void 0:r.width)??0,height:((i=e==null?void 0:e.publication.dimensions)==null?void 0:i.height)??0,className:ce("h-full w-auto")})})},Ic=ge.create(lb),cb=ge.create(ch),ub=ge.create(sb),$t={initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{type:"spring",stiffness:675,damping:75,mass:1}},Tn={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 db(e,t){const{localParticipant:n}=sh(t),r=n==null?void 0:n.getTrackPublication(e);return j.useMemo(()=>r&&n?{source:e,participant:n,publication:r}:void 0,[e,r,n])}function fb({chatOpen:e,client:t}){const{agent:{isActive:n=!1}={},session:r,state:i="idle",audioTrack:s,videoTrack:o}=t?lh(t):{agent:{isActive:!1},session:null,state:"idle",audioTrack:null,videoTrack:null},[a]=dt.useTracks([te.Track.Source.ScreenShare]),l=db(te.Track.Source.Camera,t),c=l&&!l.publication.isMuted,u=a&&!a.publication.isMuted,d=c||u,h=n||r&&r.state==="active",m={...$t.transition,delay:e?0:.15},g={...$t.animate,scale:e?1:3,transition:m},p={...$t.animate,transition:m},b=m,v=m,k=o&&o.publication&&o.participant;return f.jsx("div",{className:"relative w-full h-full z-10 flex items-center justify-center",children:f.jsx("div",{className:"relative w-full h-full max-w-2xl px-4 md:px-0",children:f.jsxs("div",{className:ce(Tn.grid),children:[h&&f.jsx("div",{className:ce(["grid",!e&&Tn.agentChatClosed,e&&d&&Tn.agentChatOpenWithSecondTile,e&&!d&&Tn.agentChatOpenWithoutSecondTile]),children:f.jsxs("div",{className:"h-full flex items-center justify-center",children:[!k&&f.jsx(cb,{layoutId:"agent",...$t,animate:g,transition:b,state:i,audioTrack:s||void 0,className:ce(e?"h-[90px]":"h-auto w-full")},"agent"),k&&o&&f.jsx(ub,{layoutId:"avatar",...$t,animate:p,transition:v,videoTrack:o,className:ce(e?"h-[90px] [&>video]:h-[90px] [&>video]:w-auto":"h-auto w-full")},"avatar")]})}),f.jsx("div",{className:ce(["grid",e&&Tn.secondTileChatOpen,!e&&Tn.secondTileChatClosed]),children:f.jsxs("div",{className:"w-full px-10 flex items-center shadow-2xl justify-between",children:[l&&c&&f.jsx(Ic,{layout:"position",layoutId:"camera",...$t,trackRef:l,transition:{...$t.transition,delay:e?0:.15},className:"h-[60px] order-1"},"camera"),u&&f.jsx(Ic,{layout:"position",layoutId:"screen",...$t,trackRef:a,transition:{...$t.transition,delay:e?0:.15},className:"h-[70px] order-2"},"screen")]})})]})})})}function Rc({timeout:e}){const[t,n]=j.useState(100),r=j.useRef(null),i=j.useRef(null);return j.useEffect(()=>{if(!e||e<=0)return;n(100),i.current=Date.now();const s=()=>{if(!e||i.current===null)return;const o=Date.now()-i.current,a=Math.max(0,100-o/e*100);n(a),a>0&&(r.current=requestAnimationFrame(s))};return r.current=requestAnimationFrame(s),()=>{r.current&&cancelAnimationFrame(r.current)}},[e]),!e||e<=0?null:f.jsx("div",{className:"w-full h-1 relative top-1 rounded-t-4xl bg-gray-700 overflow-hidden",children:f.jsx(ge.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 Pr({interaction:e,theme:t,onDismiss:n,client:r,addLocalMessage:i}){var a;if(!e||!e.isVisible||!e.component)return null;const[s]=x.useState(()=>Date.now()),o=()=>e.component?x.createElement(e.component,{handler:e.handler||void 0,timeout:e.timeout,loadData:async c=>{console.log("InteractiveComponent: Loading data:",c)},presentationMode:e.presentationMode,data:e.data,client:r,addLocalMessage:i}):f.jsx("div",{className:"p-4 text-red-500",children:"Component not found"});switch(e.presentationMode){case"fullscreen":return f.jsx(en,{children:f.jsxs(ge.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black",children:[f.jsxs("div",{className:"flex flex-col",children:[f.jsx(Rc,{timeout:e.timeout}),f.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/80 text-white border-b border-gray-700",children:[f.jsx("h3",{className:"text-lg font-semibold",children:e.methodName.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase())}),f.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:f.jsx(Ze.X,{className:"w-5 h-5"})})]})]}),f.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:o()})]})});case"embedded":default:return f.jsx(en,{children:f.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-fit rounded-lg ",children:f.jsxs("div",{children:[f.jsx(Rc,{timeout:e.timeout}),o()]})})})}}const hb=({logLevel:e}={})=>{const t=dt.useRoomContext();x.useEffect(()=>(te.setLogLevel(e??"debug"),window.__lk_room=t,()=>{window.__lk_room=void 0}),[t,e])},Vc=e=>e,mb=()=>{let e=Vc;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Vc}}},pb=mb();function rn(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 wn(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":rn(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Sa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yr={exports:{}},Xr={exports:{}},Pe={};/** @license React v16.13.1
30
30
  * react-is.production.min.js
31
31
  *
32
32
  * Copyright (c) Facebook, Inc. and its affiliates.
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 Tc;function Y1(){if(Tc)return Pe;Tc=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,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function S(T){if(typeof T=="object"&&T!==null){var C=T.$$typeof;switch(C){case t:switch(T=T.type,T){case l:case c:case r:case s:case i:case d:return T;default:switch(T=T&&T.$$typeof,T){case a:case u:case g:case m:case o:return T;default:return C}}case n:return C}}}function A(T){return S(T)===c}return Pe.AsyncMode=l,Pe.ConcurrentMode=c,Pe.ContextConsumer=a,Pe.ContextProvider=o,Pe.Element=t,Pe.ForwardRef=u,Pe.Fragment=r,Pe.Lazy=g,Pe.Memo=m,Pe.Portal=n,Pe.Profiler=s,Pe.StrictMode=i,Pe.Suspense=d,Pe.isAsyncMode=function(T){return A(T)||S(T)===l},Pe.isConcurrentMode=A,Pe.isContextConsumer=function(T){return S(T)===a},Pe.isContextProvider=function(T){return S(T)===o},Pe.isElement=function(T){return typeof T=="object"&&T!==null&&T.$$typeof===t},Pe.isForwardRef=function(T){return S(T)===u},Pe.isFragment=function(T){return S(T)===r},Pe.isLazy=function(T){return S(T)===g},Pe.isMemo=function(T){return S(T)===m},Pe.isPortal=function(T){return S(T)===n},Pe.isProfiler=function(T){return S(T)===s},Pe.isStrictMode=function(T){return S(T)===i},Pe.isSuspense=function(T){return S(T)===d},Pe.isValidElementType=function(T){return typeof T=="string"||typeof T=="function"||T===r||T===c||T===s||T===i||T===d||T===h||typeof T=="object"&&T!==null&&(T.$$typeof===g||T.$$typeof===m||T.$$typeof===o||T.$$typeof===a||T.$$typeof===u||T.$$typeof===b||T.$$typeof===v||T.$$typeof===k||T.$$typeof===p)},Pe.typeOf=S,Pe}var Ne={};/** @license React v16.13.1
36
+ */var Dc;function gb(){if(Dc)return Pe;Dc=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,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function S(T){if(typeof T=="object"&&T!==null){var C=T.$$typeof;switch(C){case t:switch(T=T.type,T){case l:case c:case r:case s:case i:case d:return T;default:switch(T=T&&T.$$typeof,T){case a:case u:case g:case m:case o:return T;default:return C}}case n:return C}}}function A(T){return S(T)===c}return Pe.AsyncMode=l,Pe.ConcurrentMode=c,Pe.ContextConsumer=a,Pe.ContextProvider=o,Pe.Element=t,Pe.ForwardRef=u,Pe.Fragment=r,Pe.Lazy=g,Pe.Memo=m,Pe.Portal=n,Pe.Profiler=s,Pe.StrictMode=i,Pe.Suspense=d,Pe.isAsyncMode=function(T){return A(T)||S(T)===l},Pe.isConcurrentMode=A,Pe.isContextConsumer=function(T){return S(T)===a},Pe.isContextProvider=function(T){return S(T)===o},Pe.isElement=function(T){return typeof T=="object"&&T!==null&&T.$$typeof===t},Pe.isForwardRef=function(T){return S(T)===u},Pe.isFragment=function(T){return S(T)===r},Pe.isLazy=function(T){return S(T)===g},Pe.isMemo=function(T){return S(T)===m},Pe.isPortal=function(T){return S(T)===n},Pe.isProfiler=function(T){return S(T)===s},Pe.isStrictMode=function(T){return S(T)===i},Pe.isSuspense=function(T){return S(T)===d},Pe.isValidElementType=function(T){return typeof T=="string"||typeof T=="function"||T===r||T===c||T===s||T===i||T===d||T===h||typeof T=="object"&&T!==null&&(T.$$typeof===g||T.$$typeof===m||T.$$typeof===o||T.$$typeof===a||T.$$typeof===u||T.$$typeof===b||T.$$typeof===v||T.$$typeof===k||T.$$typeof===p)},Pe.typeOf=S,Pe}var Me={};/** @license React v16.13.1
37
37
  * react-is.development.js
38
38
  *
39
39
  * Copyright (c) Facebook, Inc. and its affiliates.
40
40
  *
41
41
  * This source code is licensed under the MIT license found in the
42
42
  * LICENSE file in the root directory of this source tree.
43
- */var Ac;function X1(){return Ac||(Ac=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,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function S(R){return typeof R=="string"||typeof R=="function"||R===r||R===c||R===s||R===i||R===d||R===h||typeof R=="object"&&R!==null&&(R.$$typeof===g||R.$$typeof===m||R.$$typeof===o||R.$$typeof===a||R.$$typeof===u||R.$$typeof===b||R.$$typeof===v||R.$$typeof===k||R.$$typeof===p)}function A(R){if(typeof R=="object"&&R!==null){var re=R.$$typeof;switch(re){case t:var ne=R.type;switch(ne){case l:case c:case r:case s:case i:case d:return ne;default:var me=ne&&ne.$$typeof;switch(me){case a:case u:case g:case m:case o:return me;default:return re}}case n:return re}}}var T=l,C=c,M=a,P=o,L=t,y=u,N=r,D=g,B=m,H=n,K=s,de=i,ie=d,F=!1;function W(R){return F||(F=!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.")),w(R)||A(R)===l}function w(R){return A(R)===c}function z(R){return A(R)===a}function oe(R){return A(R)===o}function E(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function U(R){return A(R)===u}function se(R){return A(R)===r}function $(R){return A(R)===g}function ee(R){return A(R)===m}function Q(R){return A(R)===n}function V(R){return A(R)===s}function X(R){return A(R)===i}function fe(R){return A(R)===d}Ne.AsyncMode=T,Ne.ConcurrentMode=C,Ne.ContextConsumer=M,Ne.ContextProvider=P,Ne.Element=L,Ne.ForwardRef=y,Ne.Fragment=N,Ne.Lazy=D,Ne.Memo=B,Ne.Portal=H,Ne.Profiler=K,Ne.StrictMode=de,Ne.Suspense=ie,Ne.isAsyncMode=W,Ne.isConcurrentMode=w,Ne.isContextConsumer=z,Ne.isContextProvider=oe,Ne.isElement=E,Ne.isForwardRef=U,Ne.isFragment=se,Ne.isLazy=$,Ne.isMemo=ee,Ne.isPortal=Q,Ne.isProfiler=V,Ne.isStrictMode=X,Ne.isSuspense=fe,Ne.isValidElementType=S,Ne.typeOf=A}()),Ne}var jc;function Yf(){return jc||(jc=1,process.env.NODE_ENV==="production"?Gr.exports=Y1():Gr.exports=X1()),Gr.exports}/*
43
+ */var Fc;function yb(){return Fc||(Fc=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,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function S(R){return typeof R=="string"||typeof R=="function"||R===r||R===c||R===s||R===i||R===d||R===h||typeof R=="object"&&R!==null&&(R.$$typeof===g||R.$$typeof===m||R.$$typeof===o||R.$$typeof===a||R.$$typeof===u||R.$$typeof===b||R.$$typeof===v||R.$$typeof===k||R.$$typeof===p)}function A(R){if(typeof R=="object"&&R!==null){var re=R.$$typeof;switch(re){case t:var ne=R.type;switch(ne){case l:case c:case r:case s:case i:case d:return ne;default:var me=ne&&ne.$$typeof;switch(me){case a:case u:case g:case m:case o:return me;default:return re}}case n:return re}}}var T=l,C=c,N=a,P=o,L=t,y=u,M=r,D=g,B=m,H=n,Y=s,de=i,ie=d,F=!1;function W(R){return F||(F=!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.")),w(R)||A(R)===l}function w(R){return A(R)===c}function z(R){return A(R)===a}function oe(R){return A(R)===o}function E(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function U(R){return A(R)===u}function se(R){return A(R)===r}function $(R){return A(R)===g}function ee(R){return A(R)===m}function Q(R){return A(R)===n}function V(R){return A(R)===s}function G(R){return A(R)===i}function fe(R){return A(R)===d}Me.AsyncMode=T,Me.ConcurrentMode=C,Me.ContextConsumer=N,Me.ContextProvider=P,Me.Element=L,Me.ForwardRef=y,Me.Fragment=M,Me.Lazy=D,Me.Memo=B,Me.Portal=H,Me.Profiler=Y,Me.StrictMode=de,Me.Suspense=ie,Me.isAsyncMode=W,Me.isConcurrentMode=w,Me.isContextConsumer=z,Me.isContextProvider=oe,Me.isElement=E,Me.isForwardRef=U,Me.isFragment=se,Me.isLazy=$,Me.isMemo=ee,Me.isPortal=Q,Me.isProfiler=V,Me.isStrictMode=G,Me.isSuspense=fe,Me.isValidElementType=S,Me.typeOf=A}()),Me}var Lc;function uh(){return Lc||(Lc=1,process.env.NODE_ENV==="production"?Xr.exports=gb():Xr.exports=yb()),Xr.exports}/*
44
44
  object-assign
45
45
  (c) Sindre Sorhus
46
46
  @license MIT
47
- */var fo,Pc;function Q1(){if(Pc)return fo;Pc=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(u){return o[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return fo=i()?Object.assign:function(s,o){for(var a,l=r(s),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){c=e(a);for(var h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},fo}var ho,Nc;function ga(){if(Nc)return ho;Nc=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ho=e,ho}var mo,Mc;function Xf(){return Mc||(Mc=1,mo=Function.call.bind(Object.prototype.hasOwnProperty)),mo}var po,Ic;function J1(){if(Ic)return po;Ic=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=ga(),n={},r=Xf();e=function(s){var o="Warning: "+s;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function i(s,o,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in s)if(r(s,u)){var d;try{if(typeof s[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}d=s[u](o,u,l,a,null,t)}catch(g){d=g}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var m=c?c():"";e("Failed "+a+" type: "+d.message+(m??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},po=i,po}var go,Rc;function eb(){if(Rc)return go;Rc=1;var e=Yf(),t=Q1(),n=ga(),r=Xf(),i=J1(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return go=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(w){var z=w&&(c&&w[c]||w[u]);if(typeof z=="function")return z}var h="<<anonymous>>",m={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:k(),arrayOf:S,element:A(),elementType:T(),instanceOf:C,node:y(),objectOf:P,oneOf:M,oneOfType:L,shape:D,exact:B};function g(w,z){return w===z?w!==0||1/w===1/z:w!==w&&z!==z}function p(w,z){this.message=w,this.data=z&&typeof z=="object"?z:{},this.stack=""}p.prototype=Error.prototype;function b(w){if(process.env.NODE_ENV!=="production")var z={},oe=0;function E(se,$,ee,Q,V,X,fe){if(Q=Q||h,X=X||ee,fe!==n){if(l){var R=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 R.name="Invariant Violation",R}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var re=Q+":"+ee;!z[re]&&oe<3&&(s("You are manually calling a React.PropTypes validation function for the `"+X+"` prop on `"+Q+"`. 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."),z[re]=!0,oe++)}}return $[ee]==null?se?$[ee]===null?new p("The "+V+" `"+X+"` is marked as required "+("in `"+Q+"`, but its value is `null`.")):new p("The "+V+" `"+X+"` is marked as required in "+("`"+Q+"`, but its value is `undefined`.")):null:w($,ee,Q,V,X)}var U=E.bind(null,!1);return U.isRequired=E.bind(null,!0),U}function v(w){function z(oe,E,U,se,$,ee){var Q=oe[E],V=de(Q);if(V!==w){var X=ie(Q);return new p("Invalid "+se+" `"+$+"` of type "+("`"+X+"` supplied to `"+U+"`, expected ")+("`"+w+"`."),{expectedType:w})}return null}return b(z)}function k(){return b(o)}function S(w){function z(oe,E,U,se,$){if(typeof w!="function")return new p("Property `"+$+"` of component `"+U+"` has invalid PropType notation inside arrayOf.");var ee=oe[E];if(!Array.isArray(ee)){var Q=de(ee);return new p("Invalid "+se+" `"+$+"` of type "+("`"+Q+"` supplied to `"+U+"`, expected an array."))}for(var V=0;V<ee.length;V++){var X=w(ee,V,U,se,$+"["+V+"]",n);if(X instanceof Error)return X}return null}return b(z)}function A(){function w(z,oe,E,U,se){var $=z[oe];if(!a($)){var ee=de($);return new p("Invalid "+U+" `"+se+"` of type "+("`"+ee+"` supplied to `"+E+"`, expected a single ReactElement."))}return null}return b(w)}function T(){function w(z,oe,E,U,se){var $=z[oe];if(!e.isValidElementType($)){var ee=de($);return new p("Invalid "+U+" `"+se+"` of type "+("`"+ee+"` supplied to `"+E+"`, expected a single ReactElement type."))}return null}return b(w)}function C(w){function z(oe,E,U,se,$){if(!(oe[E]instanceof w)){var ee=w.name||h,Q=W(oe[E]);return new p("Invalid "+se+" `"+$+"` of type "+("`"+Q+"` supplied to `"+U+"`, expected ")+("instance of `"+ee+"`."))}return null}return b(z)}function M(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("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])."):s("Invalid argument supplied to oneOf, expected an array.")),o;function z(oe,E,U,se,$){for(var ee=oe[E],Q=0;Q<w.length;Q++)if(g(ee,w[Q]))return null;var V=JSON.stringify(w,function(fe,R){var re=ie(R);return re==="symbol"?String(R):R});return new p("Invalid "+se+" `"+$+"` of value `"+String(ee)+"` "+("supplied to `"+U+"`, expected one of "+V+"."))}return b(z)}function P(w){function z(oe,E,U,se,$){if(typeof w!="function")return new p("Property `"+$+"` of component `"+U+"` has invalid PropType notation inside objectOf.");var ee=oe[E],Q=de(ee);if(Q!=="object")return new p("Invalid "+se+" `"+$+"` of type "+("`"+Q+"` supplied to `"+U+"`, expected an object."));for(var V in ee)if(r(ee,V)){var X=w(ee,V,U,se,$+"."+V,n);if(X instanceof Error)return X}return null}return b(z)}function L(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var z=0;z<w.length;z++){var oe=w[z];if(typeof oe!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+F(oe)+" at index "+z+"."),o}function E(U,se,$,ee,Q){for(var V=[],X=0;X<w.length;X++){var fe=w[X],R=fe(U,se,$,ee,Q,n);if(R==null)return null;R.data&&r(R.data,"expectedType")&&V.push(R.data.expectedType)}var re=V.length>0?", expected one of type ["+V.join(", ")+"]":"";return new p("Invalid "+ee+" `"+Q+"` supplied to "+("`"+$+"`"+re+"."))}return b(E)}function y(){function w(z,oe,E,U,se){return H(z[oe])?null:new p("Invalid "+U+" `"+se+"` supplied to "+("`"+E+"`, expected a ReactNode."))}return b(w)}function N(w,z,oe,E,U){return new p((w||"React class")+": "+z+" type `"+oe+"."+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+U+"`.")}function D(w){function z(oe,E,U,se,$){var ee=oe[E],Q=de(ee);if(Q!=="object")return new p("Invalid "+se+" `"+$+"` of type `"+Q+"` "+("supplied to `"+U+"`, expected `object`."));for(var V in w){var X=w[V];if(typeof X!="function")return N(U,se,$,V,ie(X));var fe=X(ee,V,U,se,$+"."+V,n);if(fe)return fe}return null}return b(z)}function B(w){function z(oe,E,U,se,$){var ee=oe[E],Q=de(ee);if(Q!=="object")return new p("Invalid "+se+" `"+$+"` of type `"+Q+"` "+("supplied to `"+U+"`, expected `object`."));var V=t({},oe[E],w);for(var X in V){var fe=w[X];if(r(w,X)&&typeof fe!="function")return N(U,se,$,X,ie(fe));if(!fe)return new p("Invalid "+se+" `"+$+"` key `"+X+"` supplied to `"+U+"`.\nBad object: "+JSON.stringify(oe[E],null," ")+`
48
- Valid keys: `+JSON.stringify(Object.keys(w),null," "));var R=fe(ee,X,U,se,$+"."+X,n);if(R)return R}return null}return b(z)}function H(w){switch(typeof w){case"number":case"string":case"undefined":return!0;case"boolean":return!w;case"object":if(Array.isArray(w))return w.every(H);if(w===null||a(w))return!0;var z=d(w);if(z){var oe=z.call(w),E;if(z!==w.entries){for(;!(E=oe.next()).done;)if(!H(E.value))return!1}else for(;!(E=oe.next()).done;){var U=E.value;if(U&&!H(U[1]))return!1}}else return!1;return!0;default:return!1}}function K(w,z){return w==="symbol"?!0:z?z["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&z instanceof Symbol:!1}function de(w){var z=typeof w;return Array.isArray(w)?"array":w instanceof RegExp?"object":K(z,w)?"symbol":z}function ie(w){if(typeof w>"u"||w===null)return""+w;var z=de(w);if(z==="object"){if(w instanceof Date)return"date";if(w instanceof RegExp)return"regexp"}return z}function F(w){var z=ie(w);switch(z){case"array":case"object":return"an "+z;case"boolean":case"date":case"regexp":return"a "+z;default:return z}}function W(w){return!w.constructor||!w.constructor.name?h:w.constructor.name}return m.checkPropTypes=i,m.resetWarningCache=i.resetWarningCache,m.PropTypes=m,m},go}var yo,Vc;function tb(){if(Vc)return yo;Vc=1;var e=ga();function t(){}function n(){}return n.resetWarningCache=t,yo=function(){function r(o,a,l,c,u,d){if(d!==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 i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},yo}var Dc;function nb(){if(Dc)return qr.exports;if(Dc=1,process.env.NODE_ENV!=="production"){var e=Yf(),t=!0;qr.exports=eb()(e.isElement,t)}else qr.exports=tb()();return qr.exports}var rb=nb();const Te=pa(rb);function ib(e,t,n=void 0){const r={};for(const i in e){const s=e[i];let o="",a=!0;for(let l=0;l<s.length;l+=1){const c=s[l];c&&(o+=(a===!0?"":" ")+t(c),a=!1,n&&n[c]&&(o+=" "+n[c]))}r[i]=o}return r}var Kr={exports:{}},Ie={};/**
47
+ */var yo,Oc;function xb(){if(Oc)return yo;Oc=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(u){return o[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return yo=i()?Object.assign:function(s,o){for(var a,l=r(s),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){c=e(a);for(var h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},yo}var xo,$c;function Ca(){if($c)return xo;$c=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xo=e,xo}var bo,_c;function dh(){return _c||(_c=1,bo=Function.call.bind(Object.prototype.hasOwnProperty)),bo}var vo,Bc;function bb(){if(Bc)return vo;Bc=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ca(),n={},r=dh();e=function(s){var o="Warning: "+s;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function i(s,o,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in s)if(r(s,u)){var d;try{if(typeof s[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}d=s[u](o,u,l,a,null,t)}catch(g){d=g}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var m=c?c():"";e("Failed "+a+" type: "+d.message+(m??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},vo=i,vo}var wo,zc;function vb(){if(zc)return wo;zc=1;var e=uh(),t=xb(),n=Ca(),r=dh(),i=bb(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return wo=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(w){var z=w&&(c&&w[c]||w[u]);if(typeof z=="function")return z}var h="<<anonymous>>",m={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:k(),arrayOf:S,element:A(),elementType:T(),instanceOf:C,node:y(),objectOf:P,oneOf:N,oneOfType:L,shape:D,exact:B};function g(w,z){return w===z?w!==0||1/w===1/z:w!==w&&z!==z}function p(w,z){this.message=w,this.data=z&&typeof z=="object"?z:{},this.stack=""}p.prototype=Error.prototype;function b(w){if(process.env.NODE_ENV!=="production")var z={},oe=0;function E(se,$,ee,Q,V,G,fe){if(Q=Q||h,G=G||ee,fe!==n){if(l){var R=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 R.name="Invariant Violation",R}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var re=Q+":"+ee;!z[re]&&oe<3&&(s("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+Q+"`. 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."),z[re]=!0,oe++)}}return $[ee]==null?se?$[ee]===null?new p("The "+V+" `"+G+"` is marked as required "+("in `"+Q+"`, but its value is `null`.")):new p("The "+V+" `"+G+"` is marked as required in "+("`"+Q+"`, but its value is `undefined`.")):null:w($,ee,Q,V,G)}var U=E.bind(null,!1);return U.isRequired=E.bind(null,!0),U}function v(w){function z(oe,E,U,se,$,ee){var Q=oe[E],V=de(Q);if(V!==w){var G=ie(Q);return new p("Invalid "+se+" `"+$+"` of type "+("`"+G+"` supplied to `"+U+"`, expected ")+("`"+w+"`."),{expectedType:w})}return null}return b(z)}function k(){return b(o)}function S(w){function z(oe,E,U,se,$){if(typeof w!="function")return new p("Property `"+$+"` of component `"+U+"` has invalid PropType notation inside arrayOf.");var ee=oe[E];if(!Array.isArray(ee)){var Q=de(ee);return new p("Invalid "+se+" `"+$+"` of type "+("`"+Q+"` supplied to `"+U+"`, expected an array."))}for(var V=0;V<ee.length;V++){var G=w(ee,V,U,se,$+"["+V+"]",n);if(G instanceof Error)return G}return null}return b(z)}function A(){function w(z,oe,E,U,se){var $=z[oe];if(!a($)){var ee=de($);return new p("Invalid "+U+" `"+se+"` of type "+("`"+ee+"` supplied to `"+E+"`, expected a single ReactElement."))}return null}return b(w)}function T(){function w(z,oe,E,U,se){var $=z[oe];if(!e.isValidElementType($)){var ee=de($);return new p("Invalid "+U+" `"+se+"` of type "+("`"+ee+"` supplied to `"+E+"`, expected a single ReactElement type."))}return null}return b(w)}function C(w){function z(oe,E,U,se,$){if(!(oe[E]instanceof w)){var ee=w.name||h,Q=W(oe[E]);return new p("Invalid "+se+" `"+$+"` of type "+("`"+Q+"` supplied to `"+U+"`, expected ")+("instance of `"+ee+"`."))}return null}return b(z)}function N(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("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])."):s("Invalid argument supplied to oneOf, expected an array.")),o;function z(oe,E,U,se,$){for(var ee=oe[E],Q=0;Q<w.length;Q++)if(g(ee,w[Q]))return null;var V=JSON.stringify(w,function(fe,R){var re=ie(R);return re==="symbol"?String(R):R});return new p("Invalid "+se+" `"+$+"` of value `"+String(ee)+"` "+("supplied to `"+U+"`, expected one of "+V+"."))}return b(z)}function P(w){function z(oe,E,U,se,$){if(typeof w!="function")return new p("Property `"+$+"` of component `"+U+"` has invalid PropType notation inside objectOf.");var ee=oe[E],Q=de(ee);if(Q!=="object")return new p("Invalid "+se+" `"+$+"` of type "+("`"+Q+"` supplied to `"+U+"`, expected an object."));for(var V in ee)if(r(ee,V)){var G=w(ee,V,U,se,$+"."+V,n);if(G instanceof Error)return G}return null}return b(z)}function L(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var z=0;z<w.length;z++){var oe=w[z];if(typeof oe!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+F(oe)+" at index "+z+"."),o}function E(U,se,$,ee,Q){for(var V=[],G=0;G<w.length;G++){var fe=w[G],R=fe(U,se,$,ee,Q,n);if(R==null)return null;R.data&&r(R.data,"expectedType")&&V.push(R.data.expectedType)}var re=V.length>0?", expected one of type ["+V.join(", ")+"]":"";return new p("Invalid "+ee+" `"+Q+"` supplied to "+("`"+$+"`"+re+"."))}return b(E)}function y(){function w(z,oe,E,U,se){return H(z[oe])?null:new p("Invalid "+U+" `"+se+"` supplied to "+("`"+E+"`, expected a ReactNode."))}return b(w)}function M(w,z,oe,E,U){return new p((w||"React class")+": "+z+" type `"+oe+"."+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+U+"`.")}function D(w){function z(oe,E,U,se,$){var ee=oe[E],Q=de(ee);if(Q!=="object")return new p("Invalid "+se+" `"+$+"` of type `"+Q+"` "+("supplied to `"+U+"`, expected `object`."));for(var V in w){var G=w[V];if(typeof G!="function")return M(U,se,$,V,ie(G));var fe=G(ee,V,U,se,$+"."+V,n);if(fe)return fe}return null}return b(z)}function B(w){function z(oe,E,U,se,$){var ee=oe[E],Q=de(ee);if(Q!=="object")return new p("Invalid "+se+" `"+$+"` of type `"+Q+"` "+("supplied to `"+U+"`, expected `object`."));var V=t({},oe[E],w);for(var G in V){var fe=w[G];if(r(w,G)&&typeof fe!="function")return M(U,se,$,G,ie(fe));if(!fe)return new p("Invalid "+se+" `"+$+"` key `"+G+"` supplied to `"+U+"`.\nBad object: "+JSON.stringify(oe[E],null," ")+`
48
+ Valid keys: `+JSON.stringify(Object.keys(w),null," "));var R=fe(ee,G,U,se,$+"."+G,n);if(R)return R}return null}return b(z)}function H(w){switch(typeof w){case"number":case"string":case"undefined":return!0;case"boolean":return!w;case"object":if(Array.isArray(w))return w.every(H);if(w===null||a(w))return!0;var z=d(w);if(z){var oe=z.call(w),E;if(z!==w.entries){for(;!(E=oe.next()).done;)if(!H(E.value))return!1}else for(;!(E=oe.next()).done;){var U=E.value;if(U&&!H(U[1]))return!1}}else return!1;return!0;default:return!1}}function Y(w,z){return w==="symbol"?!0:z?z["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&z instanceof Symbol:!1}function de(w){var z=typeof w;return Array.isArray(w)?"array":w instanceof RegExp?"object":Y(z,w)?"symbol":z}function ie(w){if(typeof w>"u"||w===null)return""+w;var z=de(w);if(z==="object"){if(w instanceof Date)return"date";if(w instanceof RegExp)return"regexp"}return z}function F(w){var z=ie(w);switch(z){case"array":case"object":return"an "+z;case"boolean":case"date":case"regexp":return"a "+z;default:return z}}function W(w){return!w.constructor||!w.constructor.name?h:w.constructor.name}return m.checkPropTypes=i,m.resetWarningCache=i.resetWarningCache,m.PropTypes=m,m},wo}var ko,Hc;function wb(){if(Hc)return ko;Hc=1;var e=Ca();function t(){}function n(){}return n.resetWarningCache=t,ko=function(){function r(o,a,l,c,u,d){if(d!==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 i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},ko}var Uc;function kb(){if(Uc)return Yr.exports;if(Uc=1,process.env.NODE_ENV!=="production"){var e=uh(),t=!0;Yr.exports=vb()(e.isElement,t)}else Yr.exports=wb()();return Yr.exports}var Sb=kb();const Te=Sa(Sb);function Cb(e,t,n=void 0){const r={};for(const i in e){const s=e[i];let o="",a=!0;for(let l=0;l<s.length;l+=1){const c=s[l];c&&(o+=(a===!0?"":" ")+t(c),a=!1,n&&n[c]&&(o+=" "+n[c]))}r[i]=o}return r}var Qr={exports:{}},Ie={};/**
49
49
  * @license React
50
50
  * react-is.production.js
51
51
  *
@@ -53,7 +53,7 @@ Valid keys: `+JSON.stringify(Object.keys(w),null," "));var R=fe(ee,X,U,se,$+"."
53
53
  *
54
54
  * This source code is licensed under the MIT license found in the
55
55
  * LICENSE file in the root directory of this source tree.
56
- */var Fc;function ob(){if(Fc)return Ie;Fc=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),m=Symbol.for("react.client.reference");function g(p){if(typeof p=="object"&&p!==null){var b=p.$$typeof;switch(b){case e:switch(p=p.type,p){case n:case i:case r:case l:case c:case h:return p;default:switch(p=p&&p.$$typeof,p){case o:case a:case d:case u:return p;case s:return p;default:return b}}case t:return b}}}return Ie.ContextConsumer=s,Ie.ContextProvider=o,Ie.Element=e,Ie.ForwardRef=a,Ie.Fragment=n,Ie.Lazy=d,Ie.Memo=u,Ie.Portal=t,Ie.Profiler=i,Ie.StrictMode=r,Ie.Suspense=l,Ie.SuspenseList=c,Ie.isContextConsumer=function(p){return g(p)===s},Ie.isContextProvider=function(p){return g(p)===o},Ie.isElement=function(p){return typeof p=="object"&&p!==null&&p.$$typeof===e},Ie.isForwardRef=function(p){return g(p)===a},Ie.isFragment=function(p){return g(p)===n},Ie.isLazy=function(p){return g(p)===d},Ie.isMemo=function(p){return g(p)===u},Ie.isPortal=function(p){return g(p)===t},Ie.isProfiler=function(p){return g(p)===i},Ie.isStrictMode=function(p){return g(p)===r},Ie.isSuspense=function(p){return g(p)===l},Ie.isSuspenseList=function(p){return g(p)===c},Ie.isValidElementType=function(p){return typeof p=="string"||typeof p=="function"||p===n||p===i||p===r||p===l||p===c||typeof p=="object"&&p!==null&&(p.$$typeof===d||p.$$typeof===u||p.$$typeof===o||p.$$typeof===s||p.$$typeof===a||p.$$typeof===m||p.getModuleId!==void 0)},Ie.typeOf=g,Ie}var Re={};/**
56
+ */var Wc;function Eb(){if(Wc)return Ie;Wc=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),m=Symbol.for("react.client.reference");function g(p){if(typeof p=="object"&&p!==null){var b=p.$$typeof;switch(b){case e:switch(p=p.type,p){case n:case i:case r:case l:case c:case h:return p;default:switch(p=p&&p.$$typeof,p){case o:case a:case d:case u:return p;case s:return p;default:return b}}case t:return b}}}return Ie.ContextConsumer=s,Ie.ContextProvider=o,Ie.Element=e,Ie.ForwardRef=a,Ie.Fragment=n,Ie.Lazy=d,Ie.Memo=u,Ie.Portal=t,Ie.Profiler=i,Ie.StrictMode=r,Ie.Suspense=l,Ie.SuspenseList=c,Ie.isContextConsumer=function(p){return g(p)===s},Ie.isContextProvider=function(p){return g(p)===o},Ie.isElement=function(p){return typeof p=="object"&&p!==null&&p.$$typeof===e},Ie.isForwardRef=function(p){return g(p)===a},Ie.isFragment=function(p){return g(p)===n},Ie.isLazy=function(p){return g(p)===d},Ie.isMemo=function(p){return g(p)===u},Ie.isPortal=function(p){return g(p)===t},Ie.isProfiler=function(p){return g(p)===i},Ie.isStrictMode=function(p){return g(p)===r},Ie.isSuspense=function(p){return g(p)===l},Ie.isSuspenseList=function(p){return g(p)===c},Ie.isValidElementType=function(p){return typeof p=="string"||typeof p=="function"||p===n||p===i||p===r||p===l||p===c||typeof p=="object"&&p!==null&&(p.$$typeof===d||p.$$typeof===u||p.$$typeof===o||p.$$typeof===s||p.$$typeof===a||p.$$typeof===m||p.getModuleId!==void 0)},Ie.typeOf=g,Ie}var Re={};/**
57
57
  * @license React
58
58
  * react-is.development.js
59
59
  *
@@ -61,22 +61,22 @@ Valid keys: `+JSON.stringify(Object.keys(w),null," "));var R=fe(ee,X,U,se,$+"."
61
61
  *
62
62
  * This source code is licensed under the MIT license found in the
63
63
  * LICENSE file in the root directory of this source tree.
64
- */var Lc;function sb(){return Lc||(Lc=1,process.env.NODE_ENV!=="production"&&function(){function e(p){if(typeof p=="object"&&p!==null){var b=p.$$typeof;switch(b){case t:switch(p=p.type,p){case r:case s:case i:case c:case u:case m:return p;default:switch(p=p&&p.$$typeof,p){case a:case l:case h:case d:return p;case o:return p;default:return b}}case n:return b}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.view_transition"),g=Symbol.for("react.client.reference");Re.ContextConsumer=o,Re.ContextProvider=a,Re.Element=t,Re.ForwardRef=l,Re.Fragment=r,Re.Lazy=h,Re.Memo=d,Re.Portal=n,Re.Profiler=s,Re.StrictMode=i,Re.Suspense=c,Re.SuspenseList=u,Re.isContextConsumer=function(p){return e(p)===o},Re.isContextProvider=function(p){return e(p)===a},Re.isElement=function(p){return typeof p=="object"&&p!==null&&p.$$typeof===t},Re.isForwardRef=function(p){return e(p)===l},Re.isFragment=function(p){return e(p)===r},Re.isLazy=function(p){return e(p)===h},Re.isMemo=function(p){return e(p)===d},Re.isPortal=function(p){return e(p)===n},Re.isProfiler=function(p){return e(p)===s},Re.isStrictMode=function(p){return e(p)===i},Re.isSuspense=function(p){return e(p)===c},Re.isSuspenseList=function(p){return e(p)===u},Re.isValidElementType=function(p){return typeof p=="string"||typeof p=="function"||p===r||p===s||p===i||p===c||p===u||typeof p=="object"&&p!==null&&(p.$$typeof===h||p.$$typeof===d||p.$$typeof===a||p.$$typeof===o||p.$$typeof===l||p.$$typeof===g||p.getModuleId!==void 0)},Re.typeOf=e}()),Re}var Oc;function ab(){return Oc||(Oc=1,process.env.NODE_ENV==="production"?Kr.exports=ob():Kr.exports=sb()),Kr.exports}var xi=ab();function _t(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 Qf(e){if(x.isValidElement(e)||xi.isValidElementType(e)||!_t(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Qf(e[n])}),t}function gt(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return _t(e)&&_t(t)&&Object.keys(t).forEach(i=>{x.isValidElement(t[i])||xi.isValidElementType(t[i])?r[i]=t[i]:_t(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&_t(e[i])?r[i]=gt(e[i],t[i],n):n.clone?r[i]=_t(t[i])?Qf(t[i]):t[i]:r[i]=t[i]}),r}function gr(e,t){return t?gt(e,t,{clone:!1}):e}const on=process.env.NODE_ENV!=="production"?Te.oneOfType([Te.number,Te.string,Te.object,Te.array]):{};function $c(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,i)=>{var o,a;const s=/min-width:\s*([0-9.]+)/;return+(((o=r.match(s))==null?void 0:o[1])||0)-+(((a=i.match(s))==null?void 0:a[1])||0)});return n.length?n.reduce((r,i)=>{const s=t[i];return delete r[i],r[i]=s,r},{...t}):t}function lb(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function cb(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>\`.
65
- For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:tn(18,`(${t})`));return null}const[,r,i]=n,s=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(s)}function ub(e){const t=(s,o)=>s.replace("@media",o?`@container ${o}`:"@container");function n(s,o){s.up=(...a)=>t(e.breakpoints.up(...a),o),s.down=(...a)=>t(e.breakpoints.down(...a),o),s.between=(...a)=>t(e.breakpoints.between(...a),o),s.only=(...a)=>t(e.breakpoints.only(...a),o),s.not=(...a)=>{const l=t(e.breakpoints.not(...a),o);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=s=>(n(r,s),r);return n(i),{...e,containerQueries:i}}const Ni={xs:0,sm:600,md:900,lg:1200,xl:1536},_c={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Ni[e]}px)`},db={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Ni[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Ut(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const s=r.breakpoints||_c;return t.reduce((o,a,l)=>(o[s.up(s.keys[l])]=n(t[l]),o),{})}if(typeof t=="object"){const s=r.breakpoints||_c;return Object.keys(t).reduce((o,a)=>{if(lb(s.keys,a)){const l=cb(r.containerQueries?r:db,a);l&&(o[l]=n(t[a],a))}else if(Object.keys(s.values||Ni).includes(a)){const l=s.up(a);o[l]=n(t[a],a)}else{const l=a;o[l]=t[l]}return o},{})}return n(t)}function fb(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,i)=>{const s=e.up(i);return r[s]={},r},{}))||{}}function Bc(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function Mi(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,s)=>i&&i[s]?i[s]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function bi(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=Mi(e,n)||r,t&&(i=t(i,r,e)),i}function Xe(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,s=o=>{if(o[t]==null)return null;const a=o[t],l=o.theme,c=Mi(l,r)||{};return Ut(o,a,d=>{let h=bi(c,i,d);return d===h&&typeof d=="string"&&(h=bi(c,i,`${t}${d==="default"?"":bn(d)}`,d)),n===!1?h:{[n]:h}})};return s.propTypes=process.env.NODE_ENV!=="production"?{[t]:on}:{},s.filterProps=[t],s}function hb(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const mb={m:"margin",p:"padding"},pb={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},zc={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},gb=hb(e=>{if(e.length>2)if(zc[e])e=zc[e];else return[e];const[t,n]=e.split(""),r=mb[t],i=pb[n]||"";return Array.isArray(i)?i.map(s=>r+s):[r+i]}),Ii=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ri=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],yb=[...Ii,...Ri];function Vr(e,t,n,r){const i=Mi(e,t,!0)??n;return typeof i=="number"||typeof i=="string"?s=>typeof s=="string"?s:(process.env.NODE_ENV!=="production"&&typeof s!="number"&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${s}.`),typeof i=="string"?i.startsWith("var(")&&s===0?0:i.startsWith("var(")&&s===1?i:`calc(${s} * ${i})`:i*s):Array.isArray(i)?s=>{if(typeof s=="string")return s;const o=Math.abs(s);process.env.NODE_ENV!=="production"&&(Number.isInteger(o)?o>i.length-1&&console.error([`MUI: The value provided (${o}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${o} > ${i.length-1}, you need to add the missing values.`].join(`
64
+ */var Zc;function Tb(){return Zc||(Zc=1,process.env.NODE_ENV!=="production"&&function(){function e(p){if(typeof p=="object"&&p!==null){var b=p.$$typeof;switch(b){case t:switch(p=p.type,p){case r:case s:case i:case c:case u:case m:return p;default:switch(p=p&&p.$$typeof,p){case a:case l:case h:case d:return p;case o:return p;default:return b}}case n:return b}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.view_transition"),g=Symbol.for("react.client.reference");Re.ContextConsumer=o,Re.ContextProvider=a,Re.Element=t,Re.ForwardRef=l,Re.Fragment=r,Re.Lazy=h,Re.Memo=d,Re.Portal=n,Re.Profiler=s,Re.StrictMode=i,Re.Suspense=c,Re.SuspenseList=u,Re.isContextConsumer=function(p){return e(p)===o},Re.isContextProvider=function(p){return e(p)===a},Re.isElement=function(p){return typeof p=="object"&&p!==null&&p.$$typeof===t},Re.isForwardRef=function(p){return e(p)===l},Re.isFragment=function(p){return e(p)===r},Re.isLazy=function(p){return e(p)===h},Re.isMemo=function(p){return e(p)===d},Re.isPortal=function(p){return e(p)===n},Re.isProfiler=function(p){return e(p)===s},Re.isStrictMode=function(p){return e(p)===i},Re.isSuspense=function(p){return e(p)===c},Re.isSuspenseList=function(p){return e(p)===u},Re.isValidElementType=function(p){return typeof p=="string"||typeof p=="function"||p===r||p===s||p===i||p===c||p===u||typeof p=="object"&&p!==null&&(p.$$typeof===h||p.$$typeof===d||p.$$typeof===a||p.$$typeof===o||p.$$typeof===l||p.$$typeof===g||p.getModuleId!==void 0)},Re.typeOf=e}()),Re}var qc;function Ab(){return qc||(qc=1,process.env.NODE_ENV==="production"?Qr.exports=Eb():Qr.exports=Tb()),Qr.exports}var ki=Ab();function Bt(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 fh(e){if(x.isValidElement(e)||ki.isValidElementType(e)||!Bt(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=fh(e[n])}),t}function yt(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return Bt(e)&&Bt(t)&&Object.keys(t).forEach(i=>{x.isValidElement(t[i])||ki.isValidElementType(t[i])?r[i]=t[i]:Bt(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&Bt(e[i])?r[i]=yt(e[i],t[i],n):n.clone?r[i]=Bt(t[i])?fh(t[i]):t[i]:r[i]=t[i]}),r}function br(e,t){return t?yt(e,t,{clone:!1}):e}const an=process.env.NODE_ENV!=="production"?Te.oneOfType([Te.number,Te.string,Te.object,Te.array]):{};function Gc(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,i)=>{var o,a;const s=/min-width:\s*([0-9.]+)/;return+(((o=r.match(s))==null?void 0:o[1])||0)-+(((a=i.match(s))==null?void 0:a[1])||0)});return n.length?n.reduce((r,i)=>{const s=t[i];return delete r[i],r[i]=s,r},{...t}):t}function jb(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function Pb(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>\`.
65
+ For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:rn(18,`(${t})`));return null}const[,r,i]=n,s=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(s)}function Mb(e){const t=(s,o)=>s.replace("@media",o?`@container ${o}`:"@container");function n(s,o){s.up=(...a)=>t(e.breakpoints.up(...a),o),s.down=(...a)=>t(e.breakpoints.down(...a),o),s.between=(...a)=>t(e.breakpoints.between(...a),o),s.only=(...a)=>t(e.breakpoints.only(...a),o),s.not=(...a)=>{const l=t(e.breakpoints.not(...a),o);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=s=>(n(r,s),r);return n(i),{...e,containerQueries:i}}const Di={xs:0,sm:600,md:900,lg:1200,xl:1536},Kc={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Di[e]}px)`},Nb={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Di[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Zt(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const s=r.breakpoints||Kc;return t.reduce((o,a,l)=>(o[s.up(s.keys[l])]=n(t[l]),o),{})}if(typeof t=="object"){const s=r.breakpoints||Kc;return Object.keys(t).reduce((o,a)=>{if(jb(s.keys,a)){const l=Pb(r.containerQueries?r:Nb,a);l&&(o[l]=n(t[a],a))}else if(Object.keys(s.values||Di).includes(a)){const l=s.up(a);o[l]=n(t[a],a)}else{const l=a;o[l]=t[l]}return o},{})}return n(t)}function Ib(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,i)=>{const s=e.up(i);return r[s]={},r},{}))||{}}function Yc(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function Fi(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,s)=>i&&i[s]?i[s]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function Si(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=Fi(e,n)||r,t&&(i=t(i,r,e)),i}function Qe(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,s=o=>{if(o[t]==null)return null;const a=o[t],l=o.theme,c=Fi(l,r)||{};return Zt(o,a,d=>{let h=Si(c,i,d);return d===h&&typeof d=="string"&&(h=Si(c,i,`${t}${d==="default"?"":wn(d)}`,d)),n===!1?h:{[n]:h}})};return s.propTypes=process.env.NODE_ENV!=="production"?{[t]:an}:{},s.filterProps=[t],s}function Rb(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const Vb={m:"margin",p:"padding"},Db={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Xc={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Fb=Rb(e=>{if(e.length>2)if(Xc[e])e=Xc[e];else return[e];const[t,n]=e.split(""),r=Vb[t],i=Db[n]||"";return Array.isArray(i)?i.map(s=>r+s):[r+i]}),Li=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Oi=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Lb=[...Li,...Oi];function Lr(e,t,n,r){const i=Fi(e,t,!0)??n;return typeof i=="number"||typeof i=="string"?s=>typeof s=="string"?s:(process.env.NODE_ENV!=="production"&&typeof s!="number"&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${s}.`),typeof i=="string"?i.startsWith("var(")&&s===0?0:i.startsWith("var(")&&s===1?i:`calc(${s} * ${i})`:i*s):Array.isArray(i)?s=>{if(typeof s=="string")return s;const o=Math.abs(s);process.env.NODE_ENV!=="production"&&(Number.isInteger(o)?o>i.length-1&&console.error([`MUI: The value provided (${o}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${o} > ${i.length-1}, you need to add the missing values.`].join(`
66
66
  `)):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(`
67
67
  `)));const a=i[o];return s>=0?a:typeof a=="number"?-a:typeof a=="string"&&a.startsWith("var(")?`calc(-1 * ${a})`:`-${a}`}:typeof i=="function"?i:(process.env.NODE_ENV!=="production"&&console.error([`MUI: The \`theme.${t}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join(`
68
- `)),()=>{})}function ya(e){return Vr(e,"spacing",8,"spacing")}function Dr(e,t){return typeof t=="string"||t==null?t:e(t)}function xb(e,t){return n=>e.reduce((r,i)=>(r[i]=Dr(t,n),r),{})}function bb(e,t,n,r){if(!t.includes(n))return null;const i=gb(n),s=xb(i,r),o=e[n];return Ut(e,o,s)}function Jf(e,t){const n=ya(e.theme);return Object.keys(e).map(r=>bb(e,t,r,n)).reduce(gr,{})}function Ge(e){return Jf(e,Ii)}Ge.propTypes=process.env.NODE_ENV!=="production"?Ii.reduce((e,t)=>(e[t]=on,e),{}):{};Ge.filterProps=Ii;function Ke(e){return Jf(e,Ri)}Ke.propTypes=process.env.NODE_ENV!=="production"?Ri.reduce((e,t)=>(e[t]=on,e),{}):{};Ke.filterProps=Ri;process.env.NODE_ENV!=="production"&&yb.reduce((e,t)=>(e[t]=on,e),{});function Vi(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(s=>{r[s]=i}),r),{}),n=r=>Object.keys(r).reduce((i,s)=>t[s]?gr(i,t[s](r)):i,{});return n.propTypes=process.env.NODE_ENV!=="production"?e.reduce((r,i)=>Object.assign(r,i.propTypes),{}):{},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function vt(e){return typeof e!="number"?e:`${e}px solid`}function Ct(e,t){return Xe({prop:e,themeKey:"borders",transform:t})}const vb=Ct("border",vt),wb=Ct("borderTop",vt),kb=Ct("borderRight",vt),Sb=Ct("borderBottom",vt),Cb=Ct("borderLeft",vt),Eb=Ct("borderColor"),Tb=Ct("borderTopColor"),Ab=Ct("borderRightColor"),jb=Ct("borderBottomColor"),Pb=Ct("borderLeftColor"),Nb=Ct("outline",vt),Mb=Ct("outlineColor"),Di=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Vr(e.theme,"shape.borderRadius",4,"borderRadius"),n=r=>({borderRadius:Dr(t,r)});return Ut(e,e.borderRadius,n)}return null};Di.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:on}:{};Di.filterProps=["borderRadius"];Vi(vb,wb,kb,Sb,Cb,Eb,Tb,Ab,jb,Pb,Di,Nb,Mb);const Fi=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Vr(e.theme,"spacing",8,"gap"),n=r=>({gap:Dr(t,r)});return Ut(e,e.gap,n)}return null};Fi.propTypes=process.env.NODE_ENV!=="production"?{gap:on}:{};Fi.filterProps=["gap"];const Li=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Vr(e.theme,"spacing",8,"columnGap"),n=r=>({columnGap:Dr(t,r)});return Ut(e,e.columnGap,n)}return null};Li.propTypes=process.env.NODE_ENV!=="production"?{columnGap:on}:{};Li.filterProps=["columnGap"];const Oi=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Vr(e.theme,"spacing",8,"rowGap"),n=r=>({rowGap:Dr(t,r)});return Ut(e,e.rowGap,n)}return null};Oi.propTypes=process.env.NODE_ENV!=="production"?{rowGap:on}:{};Oi.filterProps=["rowGap"];const Ib=Xe({prop:"gridColumn"}),Rb=Xe({prop:"gridRow"}),Vb=Xe({prop:"gridAutoFlow"}),Db=Xe({prop:"gridAutoColumns"}),Fb=Xe({prop:"gridAutoRows"}),Lb=Xe({prop:"gridTemplateColumns"}),Ob=Xe({prop:"gridTemplateRows"}),$b=Xe({prop:"gridTemplateAreas"}),_b=Xe({prop:"gridArea"});Vi(Fi,Li,Oi,Ib,Rb,Vb,Db,Fb,Lb,Ob,$b,_b);function Bn(e,t){return t==="grey"?t:e}const Bb=Xe({prop:"color",themeKey:"palette",transform:Bn}),zb=Xe({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Bn}),Hb=Xe({prop:"backgroundColor",themeKey:"palette",transform:Bn});Vi(Bb,zb,Hb);function pt(e){return e<=1&&e!==0?`${e*100}%`:e}const Ub=Xe({prop:"width",transform:pt}),xa=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var i,s,o,a,l;const r=((o=(s=(i=e.theme)==null?void 0:i.breakpoints)==null?void 0:s.values)==null?void 0:o[n])||Ni[n];return r?((l=(a=e.theme)==null?void 0:a.breakpoints)==null?void 0:l.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:pt(n)}};return Ut(e,e.maxWidth,t)}return null};xa.filterProps=["maxWidth"];const Wb=Xe({prop:"minWidth",transform:pt}),Zb=Xe({prop:"height",transform:pt}),qb=Xe({prop:"maxHeight",transform:pt}),Gb=Xe({prop:"minHeight",transform:pt});Xe({prop:"size",cssProperty:"width",transform:pt});Xe({prop:"size",cssProperty:"height",transform:pt});const Kb=Xe({prop:"boxSizing"});Vi(Ub,xa,Wb,Zb,qb,Gb,Kb);const $i={border:{themeKey:"borders",transform:vt},borderTop:{themeKey:"borders",transform:vt},borderRight:{themeKey:"borders",transform:vt},borderBottom:{themeKey:"borders",transform:vt},borderLeft:{themeKey:"borders",transform:vt},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:vt},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Di},color:{themeKey:"palette",transform:Bn},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Bn},backgroundColor:{themeKey:"palette",transform:Bn},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:Ge},mt:{style:Ge},mr:{style:Ge},mb:{style:Ge},ml:{style:Ge},mx:{style:Ge},my:{style:Ge},margin:{style:Ge},marginTop:{style:Ge},marginRight:{style:Ge},marginBottom:{style:Ge},marginLeft:{style:Ge},marginX:{style:Ge},marginY:{style:Ge},marginInline:{style:Ge},marginInlineStart:{style:Ge},marginInlineEnd:{style:Ge},marginBlock:{style:Ge},marginBlockStart:{style:Ge},marginBlockEnd:{style:Ge},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:Fi},rowGap:{style:Oi},columnGap:{style:Li},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:pt},maxWidth:{style:xa},minWidth:{transform:pt},height:{transform:pt},maxHeight:{transform:pt},minHeight:{transform:pt},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 Yb(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function Xb(e,t){return typeof e=="function"?e(t):e}function Qb(){function e(n,r,i,s){const o={[n]:r,theme:i},a=s[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:d}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const h=Mi(i,c)||{};return d?d(o):Ut(o,r,g=>{let p=bi(h,u,g);return g===p&&typeof g=="string"&&(p=bi(h,u,`${n}${g==="default"?"":bn(g)}`,g)),l===!1?p:{[l]:p}})}function t(n){const{sx:r,theme:i={},nested:s}=n||{};if(!r)return null;const o=i.unstable_sxConfig??$i;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=fb(i.breakpoints),d=Object.keys(u);let h=u;return Object.keys(c).forEach(m=>{const g=Xb(c[m],i);if(g!=null)if(typeof g=="object")if(o[m])h=gr(h,e(m,g,i,o));else{const p=Ut({theme:i},g,b=>({[m]:b}));Yb(p,g)?h[m]=t({sx:g,theme:i,nested:!0}):h=gr(h,p)}else h=gr(h,e(m,g,i,o))}),!s&&i.modularCssLayers?{"@layer sx":$c(i,Bc(d,h))}:$c(i,Bc(d,h))}return Array.isArray(r)?r.map(a):a(r)}return t}const Wn=Qb();Wn.filterProps=["sx"];function Jb(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=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(i){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 ev={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 tv(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var nv=/[A-Z]|^ms/g,rv=/_EMO_([^_]+?)_([^]*?)_EMO_/g,eh=function(t){return t.charCodeAt(1)===45},Hc=function(t){return t!=null&&typeof t!="boolean"},xo=tv(function(e){return eh(e)?e:e.replace(nv,"-$&").toLowerCase()}),Uc=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(rv,function(r,i,s){return Xt={name:i,styles:s,next:Xt},i})}return ev[t]!==1&&!eh(t)&&typeof n=="number"&&n!==0?n+"px":n};function vi(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 i=n;if(i.anim===1)return Xt={name:i.name,styles:i.styles,next:Xt},i.name;var s=n;if(s.styles!==void 0){var o=s.next;if(o!==void 0)for(;o!==void 0;)Xt={name:o.name,styles:o.styles,next:Xt},o=o.next;var a=s.styles+";";return a}return iv(e,t,n)}}var l=n;return l}function iv(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=vi(e,t,n[i])+";";else for(var s in n){var o=n[s];if(typeof o!="object"){var a=o;Hc(a)&&(r+=xo(s)+":"+Uc(s,a)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&t==null)for(var l=0;l<o.length;l++)Hc(o[l])&&(r+=xo(s)+":"+Uc(s,o[l])+";");else{var c=vi(e,t,o);switch(s){case"animation":case"animationName":{r+=xo(s)+":"+c+";";break}default:r+=s+"{"+c+"}"}}}return r}var Wc=/label:\s*([^\s;{]+)\s*(;|$)/g,Xt;function ov(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,i="";Xt=void 0;var s=e[0];if(s==null||s.raw===void 0)r=!1,i+=vi(n,t,s);else{var o=s;i+=o[0]}for(var a=1;a<e.length;a++)if(i+=vi(n,t,e[a]),r){var l=s;i+=l[a]}Wc.lastIndex=0;for(var c="",u;(u=Wc.exec(i))!==null;)c+="-"+u[1];var d=Jb(i)+c;return{name:d,styles:i,next:Xt}}/**
68
+ `)),()=>{})}function Ea(e){return Lr(e,"spacing",8,"spacing")}function Or(e,t){return typeof t=="string"||t==null?t:e(t)}function Ob(e,t){return n=>e.reduce((r,i)=>(r[i]=Or(t,n),r),{})}function $b(e,t,n,r){if(!t.includes(n))return null;const i=Fb(n),s=Ob(i,r),o=e[n];return Zt(e,o,s)}function hh(e,t){const n=Ea(e.theme);return Object.keys(e).map(r=>$b(e,t,r,n)).reduce(br,{})}function Ge(e){return hh(e,Li)}Ge.propTypes=process.env.NODE_ENV!=="production"?Li.reduce((e,t)=>(e[t]=an,e),{}):{};Ge.filterProps=Li;function Ke(e){return hh(e,Oi)}Ke.propTypes=process.env.NODE_ENV!=="production"?Oi.reduce((e,t)=>(e[t]=an,e),{}):{};Ke.filterProps=Oi;process.env.NODE_ENV!=="production"&&Lb.reduce((e,t)=>(e[t]=an,e),{});function $i(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(s=>{r[s]=i}),r),{}),n=r=>Object.keys(r).reduce((i,s)=>t[s]?br(i,t[s](r)):i,{});return n.propTypes=process.env.NODE_ENV!=="production"?e.reduce((r,i)=>Object.assign(r,i.propTypes),{}):{},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function wt(e){return typeof e!="number"?e:`${e}px solid`}function Et(e,t){return Qe({prop:e,themeKey:"borders",transform:t})}const _b=Et("border",wt),Bb=Et("borderTop",wt),zb=Et("borderRight",wt),Hb=Et("borderBottom",wt),Ub=Et("borderLeft",wt),Wb=Et("borderColor"),Zb=Et("borderTopColor"),qb=Et("borderRightColor"),Gb=Et("borderBottomColor"),Kb=Et("borderLeftColor"),Yb=Et("outline",wt),Xb=Et("outlineColor"),_i=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Lr(e.theme,"shape.borderRadius",4,"borderRadius"),n=r=>({borderRadius:Or(t,r)});return Zt(e,e.borderRadius,n)}return null};_i.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:an}:{};_i.filterProps=["borderRadius"];$i(_b,Bb,zb,Hb,Ub,Wb,Zb,qb,Gb,Kb,_i,Yb,Xb);const Bi=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Lr(e.theme,"spacing",8,"gap"),n=r=>({gap:Or(t,r)});return Zt(e,e.gap,n)}return null};Bi.propTypes=process.env.NODE_ENV!=="production"?{gap:an}:{};Bi.filterProps=["gap"];const zi=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Lr(e.theme,"spacing",8,"columnGap"),n=r=>({columnGap:Or(t,r)});return Zt(e,e.columnGap,n)}return null};zi.propTypes=process.env.NODE_ENV!=="production"?{columnGap:an}:{};zi.filterProps=["columnGap"];const Hi=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Lr(e.theme,"spacing",8,"rowGap"),n=r=>({rowGap:Or(t,r)});return Zt(e,e.rowGap,n)}return null};Hi.propTypes=process.env.NODE_ENV!=="production"?{rowGap:an}:{};Hi.filterProps=["rowGap"];const Qb=Qe({prop:"gridColumn"}),Jb=Qe({prop:"gridRow"}),ev=Qe({prop:"gridAutoFlow"}),tv=Qe({prop:"gridAutoColumns"}),nv=Qe({prop:"gridAutoRows"}),rv=Qe({prop:"gridTemplateColumns"}),iv=Qe({prop:"gridTemplateRows"}),ov=Qe({prop:"gridTemplateAreas"}),sv=Qe({prop:"gridArea"});$i(Bi,zi,Hi,Qb,Jb,ev,tv,nv,rv,iv,ov,sv);function Un(e,t){return t==="grey"?t:e}const av=Qe({prop:"color",themeKey:"palette",transform:Un}),lv=Qe({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Un}),cv=Qe({prop:"backgroundColor",themeKey:"palette",transform:Un});$i(av,lv,cv);function gt(e){return e<=1&&e!==0?`${e*100}%`:e}const uv=Qe({prop:"width",transform:gt}),Ta=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var i,s,o,a,l;const r=((o=(s=(i=e.theme)==null?void 0:i.breakpoints)==null?void 0:s.values)==null?void 0:o[n])||Di[n];return r?((l=(a=e.theme)==null?void 0:a.breakpoints)==null?void 0:l.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:gt(n)}};return Zt(e,e.maxWidth,t)}return null};Ta.filterProps=["maxWidth"];const dv=Qe({prop:"minWidth",transform:gt}),fv=Qe({prop:"height",transform:gt}),hv=Qe({prop:"maxHeight",transform:gt}),mv=Qe({prop:"minHeight",transform:gt});Qe({prop:"size",cssProperty:"width",transform:gt});Qe({prop:"size",cssProperty:"height",transform:gt});const pv=Qe({prop:"boxSizing"});$i(uv,Ta,dv,fv,hv,mv,pv);const Ui={border:{themeKey:"borders",transform:wt},borderTop:{themeKey:"borders",transform:wt},borderRight:{themeKey:"borders",transform:wt},borderBottom:{themeKey:"borders",transform:wt},borderLeft:{themeKey:"borders",transform:wt},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:wt},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:_i},color:{themeKey:"palette",transform:Un},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Un},backgroundColor:{themeKey:"palette",transform:Un},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:Ge},mt:{style:Ge},mr:{style:Ge},mb:{style:Ge},ml:{style:Ge},mx:{style:Ge},my:{style:Ge},margin:{style:Ge},marginTop:{style:Ge},marginRight:{style:Ge},marginBottom:{style:Ge},marginLeft:{style:Ge},marginX:{style:Ge},marginY:{style:Ge},marginInline:{style:Ge},marginInlineStart:{style:Ge},marginInlineEnd:{style:Ge},marginBlock:{style:Ge},marginBlockStart:{style:Ge},marginBlockEnd:{style:Ge},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:Bi},rowGap:{style:Hi},columnGap:{style:zi},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:gt},maxWidth:{style:Ta},minWidth:{transform:gt},height:{transform:gt},maxHeight:{transform:gt},minHeight:{transform:gt},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 gv(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function yv(e,t){return typeof e=="function"?e(t):e}function xv(){function e(n,r,i,s){const o={[n]:r,theme:i},a=s[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:d}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const h=Fi(i,c)||{};return d?d(o):Zt(o,r,g=>{let p=Si(h,u,g);return g===p&&typeof g=="string"&&(p=Si(h,u,`${n}${g==="default"?"":wn(g)}`,g)),l===!1?p:{[l]:p}})}function t(n){const{sx:r,theme:i={},nested:s}=n||{};if(!r)return null;const o=i.unstable_sxConfig??Ui;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=Ib(i.breakpoints),d=Object.keys(u);let h=u;return Object.keys(c).forEach(m=>{const g=yv(c[m],i);if(g!=null)if(typeof g=="object")if(o[m])h=br(h,e(m,g,i,o));else{const p=Zt({theme:i},g,b=>({[m]:b}));gv(p,g)?h[m]=t({sx:g,theme:i,nested:!0}):h=br(h,p)}else h=br(h,e(m,g,i,o))}),!s&&i.modularCssLayers?{"@layer sx":Gc(i,Yc(d,h))}:Gc(i,Yc(d,h))}return Array.isArray(r)?r.map(a):a(r)}return t}const Gn=xv();Gn.filterProps=["sx"];function bv(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=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(i){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 vv={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 wv(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var kv=/[A-Z]|^ms/g,Sv=/_EMO_([^_]+?)_([^]*?)_EMO_/g,mh=function(t){return t.charCodeAt(1)===45},Qc=function(t){return t!=null&&typeof t!="boolean"},So=wv(function(e){return mh(e)?e:e.replace(kv,"-$&").toLowerCase()}),Jc=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Sv,function(r,i,s){return Jt={name:i,styles:s,next:Jt},i})}return vv[t]!==1&&!mh(t)&&typeof n=="number"&&n!==0?n+"px":n};function Ci(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 i=n;if(i.anim===1)return Jt={name:i.name,styles:i.styles,next:Jt},i.name;var s=n;if(s.styles!==void 0){var o=s.next;if(o!==void 0)for(;o!==void 0;)Jt={name:o.name,styles:o.styles,next:Jt},o=o.next;var a=s.styles+";";return a}return Cv(e,t,n)}}var l=n;return l}function Cv(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Ci(e,t,n[i])+";";else for(var s in n){var o=n[s];if(typeof o!="object"){var a=o;Qc(a)&&(r+=So(s)+":"+Jc(s,a)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&t==null)for(var l=0;l<o.length;l++)Qc(o[l])&&(r+=So(s)+":"+Jc(s,o[l])+";");else{var c=Ci(e,t,o);switch(s){case"animation":case"animationName":{r+=So(s)+":"+c+";";break}default:r+=s+"{"+c+"}"}}}return r}var eu=/label:\s*([^\s;{]+)\s*(;|$)/g,Jt;function Ev(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,i="";Jt=void 0;var s=e[0];if(s==null||s.raw===void 0)r=!1,i+=Ci(n,t,s);else{var o=s;i+=o[0]}for(var a=1;a<e.length;a++)if(i+=Ci(n,t,e[a]),r){var l=s;i+=l[a]}eu.lastIndex=0;for(var c="",u;(u=eu.exec(i))!==null;)c+="-"+u[1];var d=bv(i)+c;return{name:d,styles:i,next:Jt}}/**
69
69
  * @mui/styled-engine v7.2.0
70
70
  *
71
71
  * @license MIT
72
72
  * This source code is licensed under the MIT license found in the
73
73
  * LICENSE file in the root directory of this source tree.
74
- */function sv(e,t){const n=Um(e,t);return process.env.NODE_ENV!=="production"?(...r)=>{const i=typeof e=="string"?`"${e}"`:"component";return r.length===0?console.error([`MUI: Seems like you called \`styled(${i})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
75
- `)):r.some(s=>s===void 0)&&console.error(`MUI: the styled(${i})(...args) API requires all its args to be defined.`),n(...r)}:n}function av(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Zc=[];function yn(e){return Zc[0]=e,ov(Zc)}const lv=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 cv(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=e,s=lv(t),o=Object.keys(s);function a(h){return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n})`}function l(h){return`@media (max-width:${(typeof t[h]=="number"?t[h]:h)-r/100}${n})`}function c(h,m){const g=o.indexOf(m);return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n}) and (max-width:${(g!==-1&&typeof t[o[g]]=="number"?t[o[g]]:m)-r/100}${n})`}function u(h){return o.indexOf(h)+1<o.length?c(h,o[o.indexOf(h)+1]):a(h)}function d(h){const m=o.indexOf(h);return m===0?a(o[1]):m===o.length-1?l(o[m]):c(h,o[o.indexOf(h)+1]).replace("@media","@media not all and")}return{keys:o,values:s,up:a,down:l,between:c,only:u,not:d,unit:n,...i}}const uv={borderRadius:4};function th(e=8,t=ya({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(s=>{const o=t(s);return typeof o=="number"?`${o}px`:o}).join(" "));return n.mui=!0,n}function dv(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let i=n.getColorSchemeSelector(e);return i==="&"?t:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:t})}return n.palette.mode===e?t:{}}function nh(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:s={},...o}=e,a=cv(n),l=th(i);let c=gt({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...uv,...s}},o);return c=ub(c),c.applyStyles=dv,c=t.reduce((u,d)=>gt(u,d),c),c.unstable_sxConfig={...$i,...o==null?void 0:o.unstable_sxConfig},c.unstable_sx=function(d){return Wn({sx:d,theme:this})},c}const fv={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 ba(e,t,n="Mui"){const r=fv[t];return r?`${n}-${r}`:`${K1.generate(e)}-${t}`}function hv(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=ba(e,i,n)}),r}function rh(e,t=""){return e.displayName||e.name||t}function qc(e,t,n){const r=rh(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function mv(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return rh(e,"Component");if(typeof e=="object")switch(e.$$typeof){case xi.ForwardRef:return qc(e,e.render,"ForwardRef");case xi.Memo:return qc(e,e.type,"memo");default:return}}}function ih(e){const{variants:t,...n}=e,r={variants:t,style:yn(n),isProcessed:!0};return r.style===n||t&&t.forEach(i=>{typeof i.style!="function"&&(i.style=yn(i.style))}),r}const pv=nh();function bo(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function mn(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function gv(e){return e?(t,n)=>n[e]:null}function yv(e,t,n){e.theme=wv(e.theme)?n:e.theme[t]||e.theme}function ai(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(i=>ai(e,i,n));if(Array.isArray(r==null?void 0:r.variants)){let i;if(r.isProcessed)i=n?mn(r.style,n):r.style;else{const{variants:s,...o}=r;i=n?mn(yn(o),n):o}return oh(e,r.variants,[i],n)}return r!=null&&r.isProcessed?n?mn(yn(r.style),n):r.style:n?mn(yn(r),n):r}function oh(e,t,n=[],r=void 0){var s;let i;e:for(let o=0;o<t.length;o+=1){const a=t[o];if(typeof a.props=="function"){if(i??(i={...e,...e.ownerState,ownerState:e.ownerState}),!a.props(i))continue}else for(const l in a.props)if(e[l]!==a.props[l]&&((s=e.ownerState)==null?void 0:s[l])!==a.props[l])continue e;typeof a.style=="function"?(i??(i={...e,...e.ownerState,ownerState:e.ownerState}),n.push(r?mn(yn(a.style(i)),r):a.style(i))):n.push(r?mn(yn(a.style),r):a.style)}return n}function xv(e={}){const{themeId:t,defaultTheme:n=pv,rootShouldForwardProp:r=bo,slotShouldForwardProp:i=bo}=e;function s(a){yv(a,t,n)}return(a,l={})=>{av(a,C=>C.filter(M=>M!==Wn));const{name:c,slot:u,skipVariantsResolver:d,skipSx:h,overridesResolver:m=gv(sh(u)),...g}=l,p=c&&c.startsWith("Mui")||u?"components":"custom",b=d!==void 0?d:u&&u!=="Root"&&u!=="root"||!1,v=h||!1;let k=bo;u==="Root"||u==="root"?k=r:u?k=i:kv(a)&&(k=void 0);const S=sv(a,{shouldForwardProp:k,label:vv(c,u),...g}),A=C=>{if(C.__emotion_real===C)return C;if(typeof C=="function")return function(P){return ai(P,C,P.theme.modularCssLayers?p:void 0)};if(_t(C)){const M=ih(C);return function(L){return M.variants?ai(L,M,L.theme.modularCssLayers?p:void 0):L.theme.modularCssLayers?mn(M.style,p):M.style}}return C},T=(...C)=>{const M=[],P=C.map(A),L=[];if(M.push(s),c&&m&&L.push(function(B){var ie,F;const K=(F=(ie=B.theme.components)==null?void 0:ie[c])==null?void 0:F.styleOverrides;if(!K)return null;const de={};for(const W in K)de[W]=ai(B,K[W],B.theme.modularCssLayers?"theme":void 0);return m(B,de)}),c&&!b&&L.push(function(B){var de,ie;const H=B.theme,K=(ie=(de=H==null?void 0:H.components)==null?void 0:de[c])==null?void 0:ie.variants;return K?oh(B,K,[],B.theme.modularCssLayers?"theme":void 0):null}),v||L.push(Wn),Array.isArray(P[0])){const D=P.shift(),B=new Array(M.length).fill(""),H=new Array(L.length).fill("");let K;K=[...B,...D,...H],K.raw=[...B,...D.raw,...H],M.unshift(K)}const y=[...M,...P,...L],N=S(...y);return a.muiName&&(N.muiName=a.muiName),process.env.NODE_ENV!=="production"&&(N.displayName=bv(c,u,a)),N};return S.withConfig&&(T.withConfig=S.withConfig),T}}function bv(e,t,n){return e?`${e}${bn(t||"")}`:`Styled(${mv(n)})`}function vv(e,t){let n;return process.env.NODE_ENV!=="production"&&e&&(n=`${e}-${sh(t||"Root")}`),n}function wv(e){for(const t in e)return!1;return!0}function kv(e){return typeof e=="string"&&e.charCodeAt(0)>96}function sh(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function hs(e,t,n=!1){const r={...t};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const s=i;if(s==="components"||s==="slots")r[s]={...e[s],...r[s]};else if(s==="componentsProps"||s==="slotProps"){const o=e[s],a=t[s];if(!a)r[s]=o||{};else if(!o)r[s]=a;else{r[s]={...a};for(const l in o)if(Object.prototype.hasOwnProperty.call(o,l)){const c=l;r[s][c]=hs(o[c],a[c],n)}}}else s==="className"&&n&&t.className?r.className=Ns(e==null?void 0:e.className,t==null?void 0:t.className):s==="style"&&n&&t.style?r.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:r[s]===void 0&&(r[s]=e[s])}return r}function Sv(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function va(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}].`),Sv(e,t,n)}function Cv(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,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function nn(e){if(e.type)return e;if(e.charAt(0)==="#")return nn(Cv(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.
76
- The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:tn(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=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(i))throw new Error(process.env.NODE_ENV!=="production"?`MUI: unsupported \`${i}\` color space.
77
- The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:tn(10,i))}else r=r.split(",");return r=r.map(s=>parseFloat(s)),{type:n,values:r,colorSpace:i}}const Ev=e=>{const t=nn(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},ur=(e,t)=>{try{return Ev(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function _i(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,s)=>s<3?parseInt(i,10):i):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function ah(e){e=nn(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,s=r*Math.min(i,1-i),o=(c,u=(c+n/30)%12)=>i-s*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),_i({type:a,values:l})}function ms(e){e=nn(e);let t=e.type==="hsl"||e.type==="hsla"?nn(ah(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 Gc(e,t){const n=ms(e),r=ms(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Tv(e,t){return e=nn(e),t=va(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,_i(e)}function Yr(e,t,n){try{return Tv(e,t)}catch{return e}}function wa(e,t){if(e=nn(e),t=va(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 _i(e)}function De(e,t,n){try{return wa(e,t)}catch{return e}}function ka(e,t){if(e=nn(e),t=va(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 _i(e)}function Fe(e,t,n){try{return ka(e,t)}catch{return e}}function Av(e,t=.15){return ms(e)>.5?wa(e,t):ka(e,t)}function Xr(e,t,n){try{return Av(e,t)}catch{return e}}const jv=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(Te.node,Te.object);function Pv(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?hs(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?hs(i,r,t.components.mergeClassNameAndStyle):r}function Nv({props:e,name:t}){const n=x.useContext(jv);return Pv({props:e,name:t,theme:{components:n}})}const Kc={theme:void 0};function Mv(e){let t,n;return function(i){let s=t;return(s===void 0||i.theme!==n)&&(Kc.theme=i.theme,s=ih(e(Kc)),t=s,n=i.theme),s}}function Iv(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.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}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const Yc=(e,t,n,r=[])=>{let i=e;t.forEach((s,o)=>{o===t.length-1?Array.isArray(i)?i[Number(s)]=n:i&&typeof i=="object"&&(i[s]=n):i&&typeof i=="object"&&(i[s]||(i[s]=r.includes(s)?[]:{}),i=i[s])})},Rv=(e,t,n)=>{function r(i,s=[],o=[]){Object.entries(i).forEach(([a,l])=>{(!n||n&&!n([...s,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...s,a],Array.isArray(l)?[...o,a]:o):t([...s,a],l,o))})}r(e)},Vv=(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 vo(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},s={},o={};return Rv(e,(a,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const u=`--${n?`${n}-`:""}${a.join("-")}`,d=Vv(a,l);Object.assign(i,{[u]:d}),Yc(s,a,`var(${u})`,c),Yc(o,a,`var(${u}, ${d})`,c)}},a=>a[0]==="vars"),{css:i,vars:s,varsWithDefaults:o}}function Dv(e,t={}){const{getSelector:n=b,disableCssColorScheme:r,colorSchemeSelector:i}=t,{colorSchemes:s={},components:o,defaultColorScheme:a="light",...l}=e,{vars:c,css:u,varsWithDefaults:d}=vo(l,t);let h=d;const m={},{[a]:g,...p}=s;if(Object.entries(p||{}).forEach(([S,A])=>{const{vars:T,css:C,varsWithDefaults:M}=vo(A,t);h=gt(h,M),m[S]={css:C,vars:T}}),g){const{css:S,vars:A,varsWithDefaults:T}=vo(g,t);h=gt(h,T),m[a]={css:S,vars:A}}function b(S,A){var C,M;let T=i;if(i==="class"&&(T=".%s"),i==="data"&&(T="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(T=`[${i}="%s"]`),S){if(T==="media")return e.defaultColorScheme===S?":root":{[`@media (prefers-color-scheme: ${((M=(C=s[S])==null?void 0:C.palette)==null?void 0:M.mode)||S})`]:{":root":A}};if(T)return e.defaultColorScheme===S?`:root, ${T.replace("%s",String(S))}`:T.replace("%s",String(S))}return":root"}return{vars:h,generateThemeVars:()=>{let S={...c};return Object.entries(m).forEach(([,{vars:A}])=>{S=gt(S,A)}),S},generateStyleSheets:()=>{var P,L;const S=[],A=e.defaultColorScheme||"light";function T(y,N){Object.keys(N).length&&S.push(typeof y=="string"?{[y]:{...N}}:y)}T(n(void 0,{...u}),u);const{[A]:C,...M}=m;if(C){const{css:y}=C,N=(L=(P=s[A])==null?void 0:P.palette)==null?void 0:L.mode,D=!r&&N?{colorScheme:N,...y}:{...y};T(n(A,{...D}),D)}return Object.entries(M).forEach(([y,{css:N}])=>{var H,K;const D=(K=(H=s[y])==null?void 0:H.palette)==null?void 0:K.mode,B=!r&&D?{colorScheme:D,...N}:{...N};T(n(y,{...B}),B)}),S}}}function Fv(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 Ar={black:"#000",white:"#fff"},Lv={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"},En={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Tn={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},ir={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},An={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},jn={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Pn={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function lh(){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:Ar.white,default:Ar.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 Ov=lh();function ch(){return{text:{primary:Ar.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:Ar.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 Xc=ch();function Qc(e,t,n,r){const i=r.light||r,s=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=ka(e.main,i):t==="dark"&&(e.dark=wa(e.main,s)))}function $v(e="light"){return e==="dark"?{main:An[200],light:An[50],dark:An[400]}:{main:An[700],light:An[400],dark:An[800]}}function _v(e="light"){return e==="dark"?{main:En[200],light:En[50],dark:En[400]}:{main:En[500],light:En[300],dark:En[700]}}function Bv(e="light"){return e==="dark"?{main:Tn[500],light:Tn[300],dark:Tn[700]}:{main:Tn[700],light:Tn[400],dark:Tn[800]}}function zv(e="light"){return e==="dark"?{main:jn[400],light:jn[300],dark:jn[700]}:{main:jn[700],light:jn[500],dark:jn[900]}}function Hv(e="light"){return e==="dark"?{main:Pn[400],light:Pn[300],dark:Pn[700]}:{main:Pn[800],light:Pn[500],dark:Pn[900]}}function Uv(e="light"){return e==="dark"?{main:ir[400],light:ir[300],dark:ir[700]}:{main:"#ed6c02",light:ir[500],dark:ir[900]}}function Sa(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,...i}=e,s=e.primary||$v(t),o=e.secondary||_v(t),a=e.error||Bv(t),l=e.info||zv(t),c=e.success||Hv(t),u=e.warning||Uv(t);function d(p){const b=Gc(p,Xc.text.primary)>=n?Xc.text.primary:Ov.text.primary;if(process.env.NODE_ENV!=="production"){const v=Gc(p,b);v<3&&console.error([`MUI: The contrast ratio of ${v}:1 for ${b} on ${p}`,"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(`
74
+ */function Tv(e,t){const n=ip(e,t);return process.env.NODE_ENV!=="production"?(...r)=>{const i=typeof e=="string"?`"${e}"`:"component";return r.length===0?console.error([`MUI: Seems like you called \`styled(${i})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
75
+ `)):r.some(s=>s===void 0)&&console.error(`MUI: the styled(${i})(...args) API requires all its args to be defined.`),n(...r)}:n}function Av(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const tu=[];function bn(e){return tu[0]=e,Ev(tu)}const jv=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 Pv(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=e,s=jv(t),o=Object.keys(s);function a(h){return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n})`}function l(h){return`@media (max-width:${(typeof t[h]=="number"?t[h]:h)-r/100}${n})`}function c(h,m){const g=o.indexOf(m);return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n}) and (max-width:${(g!==-1&&typeof t[o[g]]=="number"?t[o[g]]:m)-r/100}${n})`}function u(h){return o.indexOf(h)+1<o.length?c(h,o[o.indexOf(h)+1]):a(h)}function d(h){const m=o.indexOf(h);return m===0?a(o[1]):m===o.length-1?l(o[m]):c(h,o[o.indexOf(h)+1]).replace("@media","@media not all and")}return{keys:o,values:s,up:a,down:l,between:c,only:u,not:d,unit:n,...i}}const Mv={borderRadius:4};function ph(e=8,t=Ea({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(s=>{const o=t(s);return typeof o=="number"?`${o}px`:o}).join(" "));return n.mui=!0,n}function Nv(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let i=n.getColorSchemeSelector(e);return i==="&"?t:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:t})}return n.palette.mode===e?t:{}}function gh(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:s={},...o}=e,a=Pv(n),l=ph(i);let c=yt({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...Mv,...s}},o);return c=Mb(c),c.applyStyles=Nv,c=t.reduce((u,d)=>yt(u,d),c),c.unstable_sxConfig={...Ui,...o==null?void 0:o.unstable_sxConfig},c.unstable_sx=function(d){return Gn({sx:d,theme:this})},c}const Iv={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 Aa(e,t,n="Mui"){const r=Iv[t];return r?`${n}-${r}`:`${pb.generate(e)}-${t}`}function Rv(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=Aa(e,i,n)}),r}function yh(e,t=""){return e.displayName||e.name||t}function nu(e,t,n){const r=yh(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function Vv(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return yh(e,"Component");if(typeof e=="object")switch(e.$$typeof){case ki.ForwardRef:return nu(e,e.render,"ForwardRef");case ki.Memo:return nu(e,e.type,"memo");default:return}}}function xh(e){const{variants:t,...n}=e,r={variants:t,style:bn(n),isProcessed:!0};return r.style===n||t&&t.forEach(i=>{typeof i.style!="function"&&(i.style=bn(i.style))}),r}const Dv=gh();function Co(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function gn(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function Fv(e){return e?(t,n)=>n[e]:null}function Lv(e,t,n){e.theme=Bv(e.theme)?n:e.theme[t]||e.theme}function ui(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(i=>ui(e,i,n));if(Array.isArray(r==null?void 0:r.variants)){let i;if(r.isProcessed)i=n?gn(r.style,n):r.style;else{const{variants:s,...o}=r;i=n?gn(bn(o),n):o}return bh(e,r.variants,[i],n)}return r!=null&&r.isProcessed?n?gn(bn(r.style),n):r.style:n?gn(bn(r),n):r}function bh(e,t,n=[],r=void 0){var s;let i;e:for(let o=0;o<t.length;o+=1){const a=t[o];if(typeof a.props=="function"){if(i??(i={...e,...e.ownerState,ownerState:e.ownerState}),!a.props(i))continue}else for(const l in a.props)if(e[l]!==a.props[l]&&((s=e.ownerState)==null?void 0:s[l])!==a.props[l])continue e;typeof a.style=="function"?(i??(i={...e,...e.ownerState,ownerState:e.ownerState}),n.push(r?gn(bn(a.style(i)),r):a.style(i))):n.push(r?gn(bn(a.style),r):a.style)}return n}function Ov(e={}){const{themeId:t,defaultTheme:n=Dv,rootShouldForwardProp:r=Co,slotShouldForwardProp:i=Co}=e;function s(a){Lv(a,t,n)}return(a,l={})=>{Av(a,C=>C.filter(N=>N!==Gn));const{name:c,slot:u,skipVariantsResolver:d,skipSx:h,overridesResolver:m=Fv(vh(u)),...g}=l,p=c&&c.startsWith("Mui")||u?"components":"custom",b=d!==void 0?d:u&&u!=="Root"&&u!=="root"||!1,v=h||!1;let k=Co;u==="Root"||u==="root"?k=r:u?k=i:zv(a)&&(k=void 0);const S=Tv(a,{shouldForwardProp:k,label:_v(c,u),...g}),A=C=>{if(C.__emotion_real===C)return C;if(typeof C=="function")return function(P){return ui(P,C,P.theme.modularCssLayers?p:void 0)};if(Bt(C)){const N=xh(C);return function(L){return N.variants?ui(L,N,L.theme.modularCssLayers?p:void 0):L.theme.modularCssLayers?gn(N.style,p):N.style}}return C},T=(...C)=>{const N=[],P=C.map(A),L=[];if(N.push(s),c&&m&&L.push(function(B){var ie,F;const Y=(F=(ie=B.theme.components)==null?void 0:ie[c])==null?void 0:F.styleOverrides;if(!Y)return null;const de={};for(const W in Y)de[W]=ui(B,Y[W],B.theme.modularCssLayers?"theme":void 0);return m(B,de)}),c&&!b&&L.push(function(B){var de,ie;const H=B.theme,Y=(ie=(de=H==null?void 0:H.components)==null?void 0:de[c])==null?void 0:ie.variants;return Y?bh(B,Y,[],B.theme.modularCssLayers?"theme":void 0):null}),v||L.push(Gn),Array.isArray(P[0])){const D=P.shift(),B=new Array(N.length).fill(""),H=new Array(L.length).fill("");let Y;Y=[...B,...D,...H],Y.raw=[...B,...D.raw,...H],N.unshift(Y)}const y=[...N,...P,...L],M=S(...y);return a.muiName&&(M.muiName=a.muiName),process.env.NODE_ENV!=="production"&&(M.displayName=$v(c,u,a)),M};return S.withConfig&&(T.withConfig=S.withConfig),T}}function $v(e,t,n){return e?`${e}${wn(t||"")}`:`Styled(${Vv(n)})`}function _v(e,t){let n;return process.env.NODE_ENV!=="production"&&e&&(n=`${e}-${vh(t||"Root")}`),n}function Bv(e){for(const t in e)return!1;return!0}function zv(e){return typeof e=="string"&&e.charCodeAt(0)>96}function vh(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function xs(e,t,n=!1){const r={...t};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const s=i;if(s==="components"||s==="slots")r[s]={...e[s],...r[s]};else if(s==="componentsProps"||s==="slotProps"){const o=e[s],a=t[s];if(!a)r[s]=o||{};else if(!o)r[s]=a;else{r[s]={...a};for(const l in o)if(Object.prototype.hasOwnProperty.call(o,l)){const c=l;r[s][c]=xs(o[c],a[c],n)}}}else s==="className"&&n&&t.className?r.className=Ds(e==null?void 0:e.className,t==null?void 0:t.className):s==="style"&&n&&t.style?r.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:r[s]===void 0&&(r[s]=e[s])}return r}function Hv(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function ja(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}].`),Hv(e,t,n)}function Uv(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,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function on(e){if(e.type)return e;if(e.charAt(0)==="#")return on(Uv(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.
76
+ The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:rn(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=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(i))throw new Error(process.env.NODE_ENV!=="production"?`MUI: unsupported \`${i}\` color space.
77
+ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:rn(10,i))}else r=r.split(",");return r=r.map(s=>parseFloat(s)),{type:n,values:r,colorSpace:i}}const Wv=e=>{const t=on(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},hr=(e,t)=>{try{return Wv(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Wi(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,s)=>s<3?parseInt(i,10):i):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function wh(e){e=on(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,s=r*Math.min(i,1-i),o=(c,u=(c+n/30)%12)=>i-s*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),Wi({type:a,values:l})}function bs(e){e=on(e);let t=e.type==="hsl"||e.type==="hsla"?on(wh(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 ru(e,t){const n=bs(e),r=bs(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Zv(e,t){return e=on(e),t=ja(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Wi(e)}function Jr(e,t,n){try{return Zv(e,t)}catch{return e}}function Pa(e,t){if(e=on(e),t=ja(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 Wi(e)}function De(e,t,n){try{return Pa(e,t)}catch{return e}}function Ma(e,t){if(e=on(e),t=ja(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 Wi(e)}function Fe(e,t,n){try{return Ma(e,t)}catch{return e}}function qv(e,t=.15){return bs(e)>.5?Pa(e,t):Ma(e,t)}function ei(e,t,n){try{return qv(e,t)}catch{return e}}const Gv=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(Te.node,Te.object);function Kv(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?xs(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?xs(i,r,t.components.mergeClassNameAndStyle):r}function Yv({props:e,name:t}){const n=x.useContext(Gv);return Kv({props:e,name:t,theme:{components:n}})}const iu={theme:void 0};function Xv(e){let t,n;return function(i){let s=t;return(s===void 0||i.theme!==n)&&(iu.theme=i.theme,s=xh(e(iu)),t=s,n=i.theme),s}}function Qv(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.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}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const ou=(e,t,n,r=[])=>{let i=e;t.forEach((s,o)=>{o===t.length-1?Array.isArray(i)?i[Number(s)]=n:i&&typeof i=="object"&&(i[s]=n):i&&typeof i=="object"&&(i[s]||(i[s]=r.includes(s)?[]:{}),i=i[s])})},Jv=(e,t,n)=>{function r(i,s=[],o=[]){Object.entries(i).forEach(([a,l])=>{(!n||n&&!n([...s,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...s,a],Array.isArray(l)?[...o,a]:o):t([...s,a],l,o))})}r(e)},ew=(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 Eo(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},s={},o={};return Jv(e,(a,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const u=`--${n?`${n}-`:""}${a.join("-")}`,d=ew(a,l);Object.assign(i,{[u]:d}),ou(s,a,`var(${u})`,c),ou(o,a,`var(${u}, ${d})`,c)}},a=>a[0]==="vars"),{css:i,vars:s,varsWithDefaults:o}}function tw(e,t={}){const{getSelector:n=b,disableCssColorScheme:r,colorSchemeSelector:i}=t,{colorSchemes:s={},components:o,defaultColorScheme:a="light",...l}=e,{vars:c,css:u,varsWithDefaults:d}=Eo(l,t);let h=d;const m={},{[a]:g,...p}=s;if(Object.entries(p||{}).forEach(([S,A])=>{const{vars:T,css:C,varsWithDefaults:N}=Eo(A,t);h=yt(h,N),m[S]={css:C,vars:T}}),g){const{css:S,vars:A,varsWithDefaults:T}=Eo(g,t);h=yt(h,T),m[a]={css:S,vars:A}}function b(S,A){var C,N;let T=i;if(i==="class"&&(T=".%s"),i==="data"&&(T="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(T=`[${i}="%s"]`),S){if(T==="media")return e.defaultColorScheme===S?":root":{[`@media (prefers-color-scheme: ${((N=(C=s[S])==null?void 0:C.palette)==null?void 0:N.mode)||S})`]:{":root":A}};if(T)return e.defaultColorScheme===S?`:root, ${T.replace("%s",String(S))}`:T.replace("%s",String(S))}return":root"}return{vars:h,generateThemeVars:()=>{let S={...c};return Object.entries(m).forEach(([,{vars:A}])=>{S=yt(S,A)}),S},generateStyleSheets:()=>{var P,L;const S=[],A=e.defaultColorScheme||"light";function T(y,M){Object.keys(M).length&&S.push(typeof y=="string"?{[y]:{...M}}:y)}T(n(void 0,{...u}),u);const{[A]:C,...N}=m;if(C){const{css:y}=C,M=(L=(P=s[A])==null?void 0:P.palette)==null?void 0:L.mode,D=!r&&M?{colorScheme:M,...y}:{...y};T(n(A,{...D}),D)}return Object.entries(N).forEach(([y,{css:M}])=>{var H,Y;const D=(Y=(H=s[y])==null?void 0:H.palette)==null?void 0:Y.mode,B=!r&&D?{colorScheme:D,...M}:{...M};T(n(y,{...B}),B)}),S}}}function nw(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 Mr={black:"#000",white:"#fff"},rw={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"},An={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},jn={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},ar={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Pn={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Mn={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Nn={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function kh(){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:Mr.white,default:Mr.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 iw=kh();function Sh(){return{text:{primary:Mr.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:Mr.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 su=Sh();function au(e,t,n,r){const i=r.light||r,s=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=Ma(e.main,i):t==="dark"&&(e.dark=Pa(e.main,s)))}function ow(e="light"){return e==="dark"?{main:Pn[200],light:Pn[50],dark:Pn[400]}:{main:Pn[700],light:Pn[400],dark:Pn[800]}}function sw(e="light"){return e==="dark"?{main:An[200],light:An[50],dark:An[400]}:{main:An[500],light:An[300],dark:An[700]}}function aw(e="light"){return e==="dark"?{main:jn[500],light:jn[300],dark:jn[700]}:{main:jn[700],light:jn[400],dark:jn[800]}}function lw(e="light"){return e==="dark"?{main:Mn[400],light:Mn[300],dark:Mn[700]}:{main:Mn[700],light:Mn[500],dark:Mn[900]}}function cw(e="light"){return e==="dark"?{main:Nn[400],light:Nn[300],dark:Nn[700]}:{main:Nn[800],light:Nn[500],dark:Nn[900]}}function uw(e="light"){return e==="dark"?{main:ar[400],light:ar[300],dark:ar[700]}:{main:"#ed6c02",light:ar[500],dark:ar[900]}}function Na(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,...i}=e,s=e.primary||ow(t),o=e.secondary||sw(t),a=e.error||aw(t),l=e.info||lw(t),c=e.success||cw(t),u=e.warning||uw(t);function d(p){const b=ru(p,su.text.primary)>=n?su.text.primary:iw.text.primary;if(process.env.NODE_ENV!=="production"){const v=ru(p,b);v<3&&console.error([`MUI: The contrast ratio of ${v}:1 for ${b} on ${p}`,"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(`
78
78
  `))}return b}const h=({color:p,name:b,mainShade:v=500,lightShade:k=300,darkShade:S=700})=>{if(p={...p},!p.main&&p[v]&&(p.main=p[v]),!p.hasOwnProperty("main"))throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${b?` (${b})`:""} provided to augmentColor(color) is invalid.
79
- The color object needs to have a \`main\` property or a \`${v}\` property.`:tn(11,b?` (${b})`:"",v));if(typeof p.main!="string")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${b?` (${b})`:""} provided to augmentColor(color) is invalid.
79
+ The color object needs to have a \`main\` property or a \`${v}\` property.`:rn(11,b?` (${b})`:"",v));if(typeof p.main!="string")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${b?` (${b})`:""} provided to augmentColor(color) is invalid.
80
80
  \`color.main\` should be a string, but \`${JSON.stringify(p.main)}\` was provided instead.
81
81
 
82
82
  Did you intend to use one of the following approaches?
@@ -89,78 +89,78 @@ const theme1 = createTheme({ palette: {
89
89
 
90
90
  const theme2 = createTheme({ palette: {
91
91
  primary: { main: green[500] },
92
- } });`:tn(12,b?` (${b})`:"",JSON.stringify(p.main)));return Qc(p,"light",k,r),Qc(p,"dark",S,r),p.contrastText||(p.contrastText=d(p.main)),p};let m;return t==="light"?m=lh():t==="dark"&&(m=ch()),process.env.NODE_ENV!=="production"&&(m||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),gt({common:{...Ar},mode:t,primary:h({color:s,name:"primary"}),secondary:h({color:o,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:a,name:"error"}),warning:h({color:u,name:"warning"}),info:h({color:l,name:"info"}),success:h({color:c,name:"success"}),grey:Lv,contrastThreshold:n,getContrastText:d,augmentColor:h,tonalOffset:r,...m},i)}function Wv(e){const t={};return Object.entries(e).forEach(r=>{const[i,s]=r;typeof s=="object"&&(t[i]=`${s.fontStyle?`${s.fontStyle} `:""}${s.fontVariant?`${s.fontVariant} `:""}${s.fontWeight?`${s.fontWeight} `:""}${s.fontStretch?`${s.fontStretch} `:""}${s.fontSize||""}${s.lineHeight?`/${s.lineHeight} `:""}${s.fontFamily||""}`)}),t}function Zv(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function qv(e){return Math.round(e*1e5)/1e5}const Jc={textTransform:"uppercase"},eu='"Roboto", "Helvetica", "Arial", sans-serif';function Gv(e,t){const{fontFamily:n=eu,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:s=400,fontWeightMedium:o=500,fontWeightBold:a=700,htmlFontSize:l=16,allVariants:c,pxToRem:u,...d}=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 l!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const h=r/14,m=u||(b=>`${b/l*h}rem`),g=(b,v,k,S,A)=>({fontFamily:n,fontWeight:b,fontSize:m(v),lineHeight:k,...n===eu?{letterSpacing:`${qv(S/v)}em`}:{},...A,...c}),p={h1:g(i,96,1.167,-1.5),h2:g(i,60,1.2,-.5),h3:g(s,48,1.167,0),h4:g(s,34,1.235,.25),h5:g(s,24,1.334,0),h6:g(o,20,1.6,.15),subtitle1:g(s,16,1.75,.15),subtitle2:g(o,14,1.57,.1),body1:g(s,16,1.5,.15),body2:g(s,14,1.43,.15),button:g(o,14,1.75,.4,Jc),caption:g(s,12,1.66,.4),overline:g(s,12,2.66,1,Jc),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return gt({htmlFontSize:l,pxToRem:m,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:s,fontWeightMedium:o,fontWeightBold:a,...p},d,{clone:!1})}const Kv=.2,Yv=.14,Xv=.12;function _e(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Kv})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Yv})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Xv})`].join(",")}const Qv=["none",_e(0,2,1,-1,0,1,1,0,0,1,3,0),_e(0,3,1,-2,0,2,2,0,0,1,5,0),_e(0,3,3,-2,0,3,4,0,0,1,8,0),_e(0,2,4,-1,0,4,5,0,0,1,10,0),_e(0,3,5,-1,0,5,8,0,0,1,14,0),_e(0,3,5,-1,0,6,10,0,0,1,18,0),_e(0,4,5,-2,0,7,10,1,0,2,16,1),_e(0,5,5,-3,0,8,10,1,0,3,14,2),_e(0,5,6,-3,0,9,12,1,0,3,16,2),_e(0,6,6,-3,0,10,14,1,0,4,18,3),_e(0,6,7,-4,0,11,15,1,0,4,20,3),_e(0,7,8,-4,0,12,17,2,0,5,22,4),_e(0,7,8,-4,0,13,19,2,0,5,24,4),_e(0,7,9,-4,0,14,21,2,0,5,26,4),_e(0,8,9,-5,0,15,22,2,0,6,28,5),_e(0,8,10,-5,0,16,24,2,0,6,30,5),_e(0,8,11,-5,0,17,26,2,0,6,32,5),_e(0,9,11,-5,0,18,28,2,0,7,34,6),_e(0,9,12,-6,0,19,29,2,0,7,36,6),_e(0,10,13,-6,0,20,31,3,0,8,38,7),_e(0,10,13,-6,0,21,33,3,0,8,40,7),_e(0,10,14,-6,0,22,35,3,0,8,42,7),_e(0,11,14,-7,0,23,36,3,0,9,44,8),_e(0,11,15,-7,0,24,38,3,0,9,46,8)],Jv={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)"},ew={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function tu(e){return`${Math.round(e)}ms`}function tw(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function nw(e){const t={...Jv,...e.easing},n={...ew,...e.duration};return{getAutoHeightDuration:tw,create:(i=["all"],s={})=>{const{duration:o=n.standard,easing:a=t.easeInOut,delay:l=0,...c}=s;if(process.env.NODE_ENV!=="production"){const u=h=>typeof h=="string",d=h=>!Number.isNaN(parseFloat(h));!u(i)&&!Array.isArray(i)&&console.error('MUI: Argument "props" must be a string or Array.'),!d(o)&&!u(o)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${o}.`),u(a)||console.error('MUI: Argument "easing" must be a string.'),!d(l)&&!u(l)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof s!="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(`
93
- `)),Object.keys(c).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(c).join(",")}].`)}return(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof o=="string"?o:tu(o)} ${a} ${typeof l=="string"?l:tu(l)}`).join(",")},...e,easing:t,duration:n}}const rw={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function iw(e){return _t(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function uh(e={}){const t={...e};function n(r){const i=Object.entries(r);for(let s=0;s<i.length;s++){const[o,a]=i[s];!iw(a)||o.startsWith("unstable_")?delete r[o]:_t(a)&&(r[o]={...a},n(r[o]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
92
+ } });`:rn(12,b?` (${b})`:"",JSON.stringify(p.main)));return au(p,"light",k,r),au(p,"dark",S,r),p.contrastText||(p.contrastText=d(p.main)),p};let m;return t==="light"?m=kh():t==="dark"&&(m=Sh()),process.env.NODE_ENV!=="production"&&(m||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),yt({common:{...Mr},mode:t,primary:h({color:s,name:"primary"}),secondary:h({color:o,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:a,name:"error"}),warning:h({color:u,name:"warning"}),info:h({color:l,name:"info"}),success:h({color:c,name:"success"}),grey:rw,contrastThreshold:n,getContrastText:d,augmentColor:h,tonalOffset:r,...m},i)}function dw(e){const t={};return Object.entries(e).forEach(r=>{const[i,s]=r;typeof s=="object"&&(t[i]=`${s.fontStyle?`${s.fontStyle} `:""}${s.fontVariant?`${s.fontVariant} `:""}${s.fontWeight?`${s.fontWeight} `:""}${s.fontStretch?`${s.fontStretch} `:""}${s.fontSize||""}${s.lineHeight?`/${s.lineHeight} `:""}${s.fontFamily||""}`)}),t}function fw(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function hw(e){return Math.round(e*1e5)/1e5}const lu={textTransform:"uppercase"},cu='"Roboto", "Helvetica", "Arial", sans-serif';function mw(e,t){const{fontFamily:n=cu,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:s=400,fontWeightMedium:o=500,fontWeightBold:a=700,htmlFontSize:l=16,allVariants:c,pxToRem:u,...d}=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 l!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const h=r/14,m=u||(b=>`${b/l*h}rem`),g=(b,v,k,S,A)=>({fontFamily:n,fontWeight:b,fontSize:m(v),lineHeight:k,...n===cu?{letterSpacing:`${hw(S/v)}em`}:{},...A,...c}),p={h1:g(i,96,1.167,-1.5),h2:g(i,60,1.2,-.5),h3:g(s,48,1.167,0),h4:g(s,34,1.235,.25),h5:g(s,24,1.334,0),h6:g(o,20,1.6,.15),subtitle1:g(s,16,1.75,.15),subtitle2:g(o,14,1.57,.1),body1:g(s,16,1.5,.15),body2:g(s,14,1.43,.15),button:g(o,14,1.75,.4,lu),caption:g(s,12,1.66,.4),overline:g(s,12,2.66,1,lu),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return yt({htmlFontSize:l,pxToRem:m,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:s,fontWeightMedium:o,fontWeightBold:a,...p},d,{clone:!1})}const pw=.2,gw=.14,yw=.12;function _e(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${pw})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${gw})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${yw})`].join(",")}const xw=["none",_e(0,2,1,-1,0,1,1,0,0,1,3,0),_e(0,3,1,-2,0,2,2,0,0,1,5,0),_e(0,3,3,-2,0,3,4,0,0,1,8,0),_e(0,2,4,-1,0,4,5,0,0,1,10,0),_e(0,3,5,-1,0,5,8,0,0,1,14,0),_e(0,3,5,-1,0,6,10,0,0,1,18,0),_e(0,4,5,-2,0,7,10,1,0,2,16,1),_e(0,5,5,-3,0,8,10,1,0,3,14,2),_e(0,5,6,-3,0,9,12,1,0,3,16,2),_e(0,6,6,-3,0,10,14,1,0,4,18,3),_e(0,6,7,-4,0,11,15,1,0,4,20,3),_e(0,7,8,-4,0,12,17,2,0,5,22,4),_e(0,7,8,-4,0,13,19,2,0,5,24,4),_e(0,7,9,-4,0,14,21,2,0,5,26,4),_e(0,8,9,-5,0,15,22,2,0,6,28,5),_e(0,8,10,-5,0,16,24,2,0,6,30,5),_e(0,8,11,-5,0,17,26,2,0,6,32,5),_e(0,9,11,-5,0,18,28,2,0,7,34,6),_e(0,9,12,-6,0,19,29,2,0,7,36,6),_e(0,10,13,-6,0,20,31,3,0,8,38,7),_e(0,10,13,-6,0,21,33,3,0,8,40,7),_e(0,10,14,-6,0,22,35,3,0,8,42,7),_e(0,11,14,-7,0,23,36,3,0,9,44,8),_e(0,11,15,-7,0,24,38,3,0,9,46,8)],bw={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)"},vw={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function uu(e){return`${Math.round(e)}ms`}function ww(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function kw(e){const t={...bw,...e.easing},n={...vw,...e.duration};return{getAutoHeightDuration:ww,create:(i=["all"],s={})=>{const{duration:o=n.standard,easing:a=t.easeInOut,delay:l=0,...c}=s;if(process.env.NODE_ENV!=="production"){const u=h=>typeof h=="string",d=h=>!Number.isNaN(parseFloat(h));!u(i)&&!Array.isArray(i)&&console.error('MUI: Argument "props" must be a string or Array.'),!d(o)&&!u(o)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${o}.`),u(a)||console.error('MUI: Argument "easing" must be a string.'),!d(l)&&!u(l)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof s!="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(`
93
+ `)),Object.keys(c).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(c).join(",")}].`)}return(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof o=="string"?o:uu(o)} ${a} ${typeof l=="string"?l:uu(l)}`).join(",")},...e,easing:t,duration:n}}const Sw={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Cw(e){return Bt(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Ch(e={}){const t={...e};function n(r){const i=Object.entries(r);for(let s=0;s<i.length;s++){const[o,a]=i[s];!Cw(a)||o.startsWith("unstable_")?delete r[o]:Bt(a)&&(r[o]={...a},n(r[o]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
94
94
 
95
95
  const theme = ${JSON.stringify(t,null,2)};
96
96
 
97
97
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
98
98
  theme.transitions = createTransitions(theme.transitions || {});
99
99
 
100
- export default theme;`}function ps(e={},...t){const{breakpoints:n,mixins:r={},spacing:i,palette:s={},transitions:o={},typography:a={},shape:l,...c}=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.":tn(20));const u=Sa(s),d=nh(e);let h=gt(d,{mixins:Zv(d.breakpoints,r),palette:u,shadows:Qv.slice(),typography:Gv(u,a),transitions:nw(o),zIndex:{...rw}});if(h=gt(h,c),h=t.reduce((m,g)=>gt(m,g),h),process.env.NODE_ENV!=="production"){const m=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],g=(p,b)=>{let v;for(v in p){const k=p[v];if(m.includes(v)&&Object.keys(k).length>0){if(process.env.NODE_ENV!=="production"){const S=ba("",v);console.error([`MUI: The \`${b}\` component increases the CSS specificity of the \`${v}\` internal state.`,"You can not override it like this: ",JSON.stringify(p,null,2),"",`Instead, you need to use the '&.${S}' syntax:`,JSON.stringify({root:{[`&.${S}`]:k}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
101
- `))}p[v]={}}}};Object.keys(h.components).forEach(p=>{const b=h.components[p].styleOverrides;b&&p.startsWith("Mui")&&g(b,p)})}return h.unstable_sxConfig={...$i,...c==null?void 0:c.unstable_sxConfig},h.unstable_sx=function(g){return Wn({sx:g,theme:this})},h.toRuntimeSource=uh,h}function ow(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 sw=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=ow(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function dh(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function fh(e){return e==="dark"?sw:[]}function aw(e){const{palette:t={mode:"light"},opacity:n,overlays:r,...i}=e,s=Sa(t);return{palette:s,opacity:{...dh(s.mode),...n},overlays:r||fh(s.mode),...i}}function lw(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 cw=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],uw=e=>(t,n)=>{const r=e.rootSelector||":root",i=e.colorSchemeSelector;let s=i;if(i==="class"&&(s=".%s"),i==="data"&&(s="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(s=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const o={};return cw(e.cssVarPrefix).forEach(a=>{o[a]=n[a],delete n[a]}),s==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:o}}:s?{[s.replace("%s",t)]:o,[`${r}, ${s.replace("%s",t)}`]:n}:{[r]:{...n,...o}}}if(s&&s!=="media")return`${r}, ${s.replace("%s",String(t))}`}else if(t){if(s==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(s)return s.replace("%s",String(t))}return r};function dw(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function O(e,t,n){!e[t]&&n&&(e[t]=n)}function dr(e){return typeof e!="string"||!e.startsWith("hsl")?e:ah(e)}function $t(e,t){`${t}Channel`in e||(e[`${t}Channel`]=ur(dr(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().
102
- 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 fw(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Nt=e=>{try{return e()}catch{}},hw=(e="mui")=>Iv(e);function wo(e,t,n,r){if(!t)return;t=t===!0?{}:t;const i=r==="dark"?"dark":"light";if(!n){e[r]=aw({...t,palette:{mode:i,...t==null?void 0:t.palette}});return}const{palette:s,...o}=ps({...n,palette:{mode:i,...t==null?void 0:t.palette}});return e[r]={...t,palette:s,opacity:{...dh(i),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||fh(i)},o}function mw(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:s="mui",shouldSkipGeneratingVar:o=lw,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...c}=e,u=Object.keys(n)[0],d=r||(n.light&&u!=="light"?"light":u),h=hw(s),{[d]:m,light:g,dark:p,...b}=n,v={...b};let k=m;if((d==="dark"&&!("dark"in n)||d==="light"&&!("light"in n))&&(k=!0),!k)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${d}\` option is either missing or invalid.`:tn(21,d));const S=wo(v,k,c,d);g&&!v.light&&wo(v,g,void 0,"light"),p&&!v.dark&&wo(v,p,void 0,"dark");let A={defaultColorScheme:d,...S,cssVarPrefix:s,colorSchemeSelector:a,rootSelector:l,getCssVar:h,colorSchemes:v,font:{...Wv(S.typography),...S.font},spacing:fw(c.spacing)};Object.keys(A.colorSchemes).forEach(L=>{const y=A.colorSchemes[L].palette,N=D=>{const B=D.split("-"),H=B[1],K=B[2];return h(D,y[H][K])};if(y.mode==="light"&&(O(y.common,"background","#fff"),O(y.common,"onBackground","#000")),y.mode==="dark"&&(O(y.common,"background","#000"),O(y.common,"onBackground","#fff")),dw(y,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),y.mode==="light"){O(y.Alert,"errorColor",De(y.error.light,.6)),O(y.Alert,"infoColor",De(y.info.light,.6)),O(y.Alert,"successColor",De(y.success.light,.6)),O(y.Alert,"warningColor",De(y.warning.light,.6)),O(y.Alert,"errorFilledBg",N("palette-error-main")),O(y.Alert,"infoFilledBg",N("palette-info-main")),O(y.Alert,"successFilledBg",N("palette-success-main")),O(y.Alert,"warningFilledBg",N("palette-warning-main")),O(y.Alert,"errorFilledColor",Nt(()=>y.getContrastText(y.error.main))),O(y.Alert,"infoFilledColor",Nt(()=>y.getContrastText(y.info.main))),O(y.Alert,"successFilledColor",Nt(()=>y.getContrastText(y.success.main))),O(y.Alert,"warningFilledColor",Nt(()=>y.getContrastText(y.warning.main))),O(y.Alert,"errorStandardBg",Fe(y.error.light,.9)),O(y.Alert,"infoStandardBg",Fe(y.info.light,.9)),O(y.Alert,"successStandardBg",Fe(y.success.light,.9)),O(y.Alert,"warningStandardBg",Fe(y.warning.light,.9)),O(y.Alert,"errorIconColor",N("palette-error-main")),O(y.Alert,"infoIconColor",N("palette-info-main")),O(y.Alert,"successIconColor",N("palette-success-main")),O(y.Alert,"warningIconColor",N("palette-warning-main")),O(y.AppBar,"defaultBg",N("palette-grey-100")),O(y.Avatar,"defaultBg",N("palette-grey-400")),O(y.Button,"inheritContainedBg",N("palette-grey-300")),O(y.Button,"inheritContainedHoverBg",N("palette-grey-A100")),O(y.Chip,"defaultBorder",N("palette-grey-400")),O(y.Chip,"defaultAvatarColor",N("palette-grey-700")),O(y.Chip,"defaultIconColor",N("palette-grey-700")),O(y.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),O(y.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),O(y.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),O(y.LinearProgress,"primaryBg",Fe(y.primary.main,.62)),O(y.LinearProgress,"secondaryBg",Fe(y.secondary.main,.62)),O(y.LinearProgress,"errorBg",Fe(y.error.main,.62)),O(y.LinearProgress,"infoBg",Fe(y.info.main,.62)),O(y.LinearProgress,"successBg",Fe(y.success.main,.62)),O(y.LinearProgress,"warningBg",Fe(y.warning.main,.62)),O(y.Skeleton,"bg",`rgba(${N("palette-text-primaryChannel")} / 0.11)`),O(y.Slider,"primaryTrack",Fe(y.primary.main,.62)),O(y.Slider,"secondaryTrack",Fe(y.secondary.main,.62)),O(y.Slider,"errorTrack",Fe(y.error.main,.62)),O(y.Slider,"infoTrack",Fe(y.info.main,.62)),O(y.Slider,"successTrack",Fe(y.success.main,.62)),O(y.Slider,"warningTrack",Fe(y.warning.main,.62));const D=Xr(y.background.default,.8);O(y.SnackbarContent,"bg",D),O(y.SnackbarContent,"color",Nt(()=>y.getContrastText(D))),O(y.SpeedDialAction,"fabHoverBg",Xr(y.background.paper,.15)),O(y.StepConnector,"border",N("palette-grey-400")),O(y.StepContent,"border",N("palette-grey-400")),O(y.Switch,"defaultColor",N("palette-common-white")),O(y.Switch,"defaultDisabledColor",N("palette-grey-100")),O(y.Switch,"primaryDisabledColor",Fe(y.primary.main,.62)),O(y.Switch,"secondaryDisabledColor",Fe(y.secondary.main,.62)),O(y.Switch,"errorDisabledColor",Fe(y.error.main,.62)),O(y.Switch,"infoDisabledColor",Fe(y.info.main,.62)),O(y.Switch,"successDisabledColor",Fe(y.success.main,.62)),O(y.Switch,"warningDisabledColor",Fe(y.warning.main,.62)),O(y.TableCell,"border",Fe(Yr(y.divider,1),.88)),O(y.Tooltip,"bg",Yr(y.grey[700],.92))}if(y.mode==="dark"){O(y.Alert,"errorColor",Fe(y.error.light,.6)),O(y.Alert,"infoColor",Fe(y.info.light,.6)),O(y.Alert,"successColor",Fe(y.success.light,.6)),O(y.Alert,"warningColor",Fe(y.warning.light,.6)),O(y.Alert,"errorFilledBg",N("palette-error-dark")),O(y.Alert,"infoFilledBg",N("palette-info-dark")),O(y.Alert,"successFilledBg",N("palette-success-dark")),O(y.Alert,"warningFilledBg",N("palette-warning-dark")),O(y.Alert,"errorFilledColor",Nt(()=>y.getContrastText(y.error.dark))),O(y.Alert,"infoFilledColor",Nt(()=>y.getContrastText(y.info.dark))),O(y.Alert,"successFilledColor",Nt(()=>y.getContrastText(y.success.dark))),O(y.Alert,"warningFilledColor",Nt(()=>y.getContrastText(y.warning.dark))),O(y.Alert,"errorStandardBg",De(y.error.light,.9)),O(y.Alert,"infoStandardBg",De(y.info.light,.9)),O(y.Alert,"successStandardBg",De(y.success.light,.9)),O(y.Alert,"warningStandardBg",De(y.warning.light,.9)),O(y.Alert,"errorIconColor",N("palette-error-main")),O(y.Alert,"infoIconColor",N("palette-info-main")),O(y.Alert,"successIconColor",N("palette-success-main")),O(y.Alert,"warningIconColor",N("palette-warning-main")),O(y.AppBar,"defaultBg",N("palette-grey-900")),O(y.AppBar,"darkBg",N("palette-background-paper")),O(y.AppBar,"darkColor",N("palette-text-primary")),O(y.Avatar,"defaultBg",N("palette-grey-600")),O(y.Button,"inheritContainedBg",N("palette-grey-800")),O(y.Button,"inheritContainedHoverBg",N("palette-grey-700")),O(y.Chip,"defaultBorder",N("palette-grey-700")),O(y.Chip,"defaultAvatarColor",N("palette-grey-300")),O(y.Chip,"defaultIconColor",N("palette-grey-300")),O(y.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),O(y.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),O(y.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),O(y.LinearProgress,"primaryBg",De(y.primary.main,.5)),O(y.LinearProgress,"secondaryBg",De(y.secondary.main,.5)),O(y.LinearProgress,"errorBg",De(y.error.main,.5)),O(y.LinearProgress,"infoBg",De(y.info.main,.5)),O(y.LinearProgress,"successBg",De(y.success.main,.5)),O(y.LinearProgress,"warningBg",De(y.warning.main,.5)),O(y.Skeleton,"bg",`rgba(${N("palette-text-primaryChannel")} / 0.13)`),O(y.Slider,"primaryTrack",De(y.primary.main,.5)),O(y.Slider,"secondaryTrack",De(y.secondary.main,.5)),O(y.Slider,"errorTrack",De(y.error.main,.5)),O(y.Slider,"infoTrack",De(y.info.main,.5)),O(y.Slider,"successTrack",De(y.success.main,.5)),O(y.Slider,"warningTrack",De(y.warning.main,.5));const D=Xr(y.background.default,.98);O(y.SnackbarContent,"bg",D),O(y.SnackbarContent,"color",Nt(()=>y.getContrastText(D))),O(y.SpeedDialAction,"fabHoverBg",Xr(y.background.paper,.15)),O(y.StepConnector,"border",N("palette-grey-600")),O(y.StepContent,"border",N("palette-grey-600")),O(y.Switch,"defaultColor",N("palette-grey-300")),O(y.Switch,"defaultDisabledColor",N("palette-grey-600")),O(y.Switch,"primaryDisabledColor",De(y.primary.main,.55)),O(y.Switch,"secondaryDisabledColor",De(y.secondary.main,.55)),O(y.Switch,"errorDisabledColor",De(y.error.main,.55)),O(y.Switch,"infoDisabledColor",De(y.info.main,.55)),O(y.Switch,"successDisabledColor",De(y.success.main,.55)),O(y.Switch,"warningDisabledColor",De(y.warning.main,.55)),O(y.TableCell,"border",De(Yr(y.divider,1),.68)),O(y.Tooltip,"bg",Yr(y.grey[700],.92))}$t(y.background,"default"),$t(y.background,"paper"),$t(y.common,"background"),$t(y.common,"onBackground"),$t(y,"divider"),Object.keys(y).forEach(D=>{const B=y[D];D!=="tonalOffset"&&B&&typeof B=="object"&&(B.main&&O(y[D],"mainChannel",ur(dr(B.main))),B.light&&O(y[D],"lightChannel",ur(dr(B.light))),B.dark&&O(y[D],"darkChannel",ur(dr(B.dark))),B.contrastText&&O(y[D],"contrastTextChannel",ur(dr(B.contrastText))),D==="text"&&($t(y[D],"primary"),$t(y[D],"secondary")),D==="action"&&(B.active&&$t(y[D],"active"),B.selected&&$t(y[D],"selected")))})}),A=t.reduce((L,y)=>gt(L,y),A);const T={prefix:s,disableCssColorScheme:i,shouldSkipGeneratingVar:o,getSelector:uw(A)},{vars:C,generateThemeVars:M,generateStyleSheets:P}=Dv(A,T);return A.vars=C,Object.entries(A.colorSchemes[A.defaultColorScheme]).forEach(([L,y])=>{A[L]=y}),A.generateThemeVars=M,A.generateStyleSheets=P,A.generateSpacing=function(){return th(c.spacing,ya(this))},A.getColorSchemeSelector=Fv(a),A.spacing=A.generateSpacing(),A.shouldSkipGeneratingVar=o,A.unstable_sxConfig={...$i,...c==null?void 0:c.unstable_sxConfig},A.unstable_sx=function(y){return Wn({sx:y,theme:this})},A.toRuntimeSource=uh,A}function nu(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Sa({...n===!0?{}:n.palette,mode:t})})}function pw(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:s=n==null?void 0:n.mode,...o}=e,a=s||"light",l=i==null?void 0:i[a],c={...i,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return ps(e,...t);let u=n;"palette"in e||c[a]&&(c[a]!==!0?u=c[a].palette:a==="dark"&&(u={mode:"dark"}));const d=ps({...e,palette:u},...t);return d.defaultColorScheme=a,d.colorSchemes=c,d.palette.mode==="light"&&(d.colorSchemes.light={...c.light!==!0&&c.light,palette:d.palette},nu(d,"dark",c.dark)),d.palette.mode==="dark"&&(d.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:d.palette},nu(d,"light",c.light)),d}return!n&&!("light"in c)&&a==="light"&&(c.light=!0),mw({...o,colorSchemes:c,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}const gw=pw(),yw="$$material";function xw(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const bw=e=>xw(e)&&e!=="classes",vw=xv({themeId:yw,defaultTheme:gw,rootShouldForwardProp:bw}),ww=Mv;process.env.NODE_ENV!=="production"&&(Te.node,Te.object.isRequired);function kw(e){return Nv(e)}function Sw(e){return ba("MuiSvgIcon",e)}hv("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Cw=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${bn(t)}`,`fontSize${bn(n)}`]};return ib(i,Sw,r)},Ew=vw("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${bn(n.color)}`],t[`fontSize${bn(n.fontSize)}`]]}})(ww(({theme:e})=>{var t,n,r,i,s,o,a,l,c,u,d,h,m,g;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(i=(t=e.transitions)==null?void 0:t.create)==null?void 0:i.call(t,"fill",{duration:(r=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:p=>!p.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((o=(s=e.typography)==null?void 0:s.pxToRem)==null?void 0:o.call(s,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((u=(c=e.typography)==null?void 0:c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,p])=>p&&p.main).map(([p])=>{var b,v;return{props:{color:p},style:{color:(v=(b=(e.vars??e).palette)==null?void 0:b[p])==null?void 0:v.main}}}),{props:{color:"action"},style:{color:(h=(d=(e.vars??e).palette)==null?void 0:d.action)==null?void 0:h.active}},{props:{color:"disabled"},style:{color:(g=(m=(e.vars??e).palette)==null?void 0:m.action)==null?void 0:g.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),wi=x.forwardRef(function(t,n){const r=kw({props:t,name:"MuiSvgIcon"}),{children:i,className:s,color:o="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:d,viewBox:h="0 0 24 24",...m}=r,g=x.isValidElement(i)&&i.type==="svg",p={...r,color:o,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:h,hasSvgAsChild:g},b={};u||(b.viewBox=h);const v=Cw(p);return f.jsxs(Ew,{as:a,className:Ns(v.root,s),focusable:"false",color:c,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n,...b,...m,...g&&i.props,ownerState:p,children:[g?i.props.children:i,d?f.jsx("title",{children:d}):null]})});process.env.NODE_ENV!=="production"&&(wi.propTypes={children:Te.node,classes:Te.object,className:Te.string,color:Te.oneOfType([Te.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),Te.string]),component:Te.elementType,fontSize:Te.oneOfType([Te.oneOf(["inherit","large","medium","small"]),Te.string]),htmlColor:Te.string,inheritViewBox:Te.bool,shapeRendering:Te.string,sx:Te.oneOfType([Te.arrayOf(Te.oneOfType([Te.func,Te.object,Te.bool])),Te.func,Te.object]),titleAccess:Te.string,viewBox:Te.string});wi.muiName="SvgIcon";function Jn(e,t){function n(r,i){return f.jsx(wi,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:i,...r,children:e})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=wi.muiName,x.memo(x.forwardRef(n))}const Tw=Jn(f.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"),Aw=Jn(f.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"),jw=Jn([f.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),f.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"),hh=Jn(f.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"),mh=Jn(f.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"),ph=Jn(f.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");function Pw({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[i,s]=j.useState(""),[o,a]=j.useState(0);return j.useEffect(()=>{if(n){s(e);return}if(t){s(e);return}if(o<e.length){const l=setTimeout(()=>{s(e.slice(0,o+1)),a(o+1)},r);return()=>clearTimeout(l)}},[e,o,t,r,n]),j.useEffect(()=>{n||(a(0),s(""))},[e,n]),f.jsxs("span",{className:"relative",children:[f.jsx("span",{className:"inline-block",children:i}),!t&&f.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(l=>f.jsx(ge.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:l*.2,ease:"easeInOut"}},l))})]})}function Nw({message:e,theme:t,isOwn:n,isStreaming:r=!1}){var o,a,l;const i=et(t),s=e.sender.name?e.sender.name.split(" ").map(c=>c[0]).join("").toUpperCase().slice(0,2):"U";return f.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-1`,children:f.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 max-w-[85%]`,children:[f.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:s}),f.jsxs("div",{className:`
100
+ export default theme;`}function vs(e={},...t){const{breakpoints:n,mixins:r={},spacing:i,palette:s={},transitions:o={},typography:a={},shape:l,...c}=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.":rn(20));const u=Na(s),d=gh(e);let h=yt(d,{mixins:fw(d.breakpoints,r),palette:u,shadows:xw.slice(),typography:mw(u,a),transitions:kw(o),zIndex:{...Sw}});if(h=yt(h,c),h=t.reduce((m,g)=>yt(m,g),h),process.env.NODE_ENV!=="production"){const m=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],g=(p,b)=>{let v;for(v in p){const k=p[v];if(m.includes(v)&&Object.keys(k).length>0){if(process.env.NODE_ENV!=="production"){const S=Aa("",v);console.error([`MUI: The \`${b}\` component increases the CSS specificity of the \`${v}\` internal state.`,"You can not override it like this: ",JSON.stringify(p,null,2),"",`Instead, you need to use the '&.${S}' syntax:`,JSON.stringify({root:{[`&.${S}`]:k}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
101
+ `))}p[v]={}}}};Object.keys(h.components).forEach(p=>{const b=h.components[p].styleOverrides;b&&p.startsWith("Mui")&&g(b,p)})}return h.unstable_sxConfig={...Ui,...c==null?void 0:c.unstable_sxConfig},h.unstable_sx=function(g){return Gn({sx:g,theme:this})},h.toRuntimeSource=Ch,h}function Ew(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 Tw=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=Ew(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Eh(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function Th(e){return e==="dark"?Tw:[]}function Aw(e){const{palette:t={mode:"light"},opacity:n,overlays:r,...i}=e,s=Na(t);return{palette:s,opacity:{...Eh(s.mode),...n},overlays:r||Th(s.mode),...i}}function jw(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 Pw=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],Mw=e=>(t,n)=>{const r=e.rootSelector||":root",i=e.colorSchemeSelector;let s=i;if(i==="class"&&(s=".%s"),i==="data"&&(s="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(s=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const o={};return Pw(e.cssVarPrefix).forEach(a=>{o[a]=n[a],delete n[a]}),s==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:o}}:s?{[s.replace("%s",t)]:o,[`${r}, ${s.replace("%s",t)}`]:n}:{[r]:{...n,...o}}}if(s&&s!=="media")return`${r}, ${s.replace("%s",String(t))}`}else if(t){if(s==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(s)return s.replace("%s",String(t))}return r};function Nw(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function O(e,t,n){!e[t]&&n&&(e[t]=n)}function mr(e){return typeof e!="string"||!e.startsWith("hsl")?e:wh(e)}function _t(e,t){`${t}Channel`in e||(e[`${t}Channel`]=hr(mr(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().
102
+ 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 Iw(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Nt=e=>{try{return e()}catch{}},Rw=(e="mui")=>Qv(e);function To(e,t,n,r){if(!t)return;t=t===!0?{}:t;const i=r==="dark"?"dark":"light";if(!n){e[r]=Aw({...t,palette:{mode:i,...t==null?void 0:t.palette}});return}const{palette:s,...o}=vs({...n,palette:{mode:i,...t==null?void 0:t.palette}});return e[r]={...t,palette:s,opacity:{...Eh(i),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||Th(i)},o}function Vw(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:s="mui",shouldSkipGeneratingVar:o=jw,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...c}=e,u=Object.keys(n)[0],d=r||(n.light&&u!=="light"?"light":u),h=Rw(s),{[d]:m,light:g,dark:p,...b}=n,v={...b};let k=m;if((d==="dark"&&!("dark"in n)||d==="light"&&!("light"in n))&&(k=!0),!k)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${d}\` option is either missing or invalid.`:rn(21,d));const S=To(v,k,c,d);g&&!v.light&&To(v,g,void 0,"light"),p&&!v.dark&&To(v,p,void 0,"dark");let A={defaultColorScheme:d,...S,cssVarPrefix:s,colorSchemeSelector:a,rootSelector:l,getCssVar:h,colorSchemes:v,font:{...dw(S.typography),...S.font},spacing:Iw(c.spacing)};Object.keys(A.colorSchemes).forEach(L=>{const y=A.colorSchemes[L].palette,M=D=>{const B=D.split("-"),H=B[1],Y=B[2];return h(D,y[H][Y])};if(y.mode==="light"&&(O(y.common,"background","#fff"),O(y.common,"onBackground","#000")),y.mode==="dark"&&(O(y.common,"background","#000"),O(y.common,"onBackground","#fff")),Nw(y,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),y.mode==="light"){O(y.Alert,"errorColor",De(y.error.light,.6)),O(y.Alert,"infoColor",De(y.info.light,.6)),O(y.Alert,"successColor",De(y.success.light,.6)),O(y.Alert,"warningColor",De(y.warning.light,.6)),O(y.Alert,"errorFilledBg",M("palette-error-main")),O(y.Alert,"infoFilledBg",M("palette-info-main")),O(y.Alert,"successFilledBg",M("palette-success-main")),O(y.Alert,"warningFilledBg",M("palette-warning-main")),O(y.Alert,"errorFilledColor",Nt(()=>y.getContrastText(y.error.main))),O(y.Alert,"infoFilledColor",Nt(()=>y.getContrastText(y.info.main))),O(y.Alert,"successFilledColor",Nt(()=>y.getContrastText(y.success.main))),O(y.Alert,"warningFilledColor",Nt(()=>y.getContrastText(y.warning.main))),O(y.Alert,"errorStandardBg",Fe(y.error.light,.9)),O(y.Alert,"infoStandardBg",Fe(y.info.light,.9)),O(y.Alert,"successStandardBg",Fe(y.success.light,.9)),O(y.Alert,"warningStandardBg",Fe(y.warning.light,.9)),O(y.Alert,"errorIconColor",M("palette-error-main")),O(y.Alert,"infoIconColor",M("palette-info-main")),O(y.Alert,"successIconColor",M("palette-success-main")),O(y.Alert,"warningIconColor",M("palette-warning-main")),O(y.AppBar,"defaultBg",M("palette-grey-100")),O(y.Avatar,"defaultBg",M("palette-grey-400")),O(y.Button,"inheritContainedBg",M("palette-grey-300")),O(y.Button,"inheritContainedHoverBg",M("palette-grey-A100")),O(y.Chip,"defaultBorder",M("palette-grey-400")),O(y.Chip,"defaultAvatarColor",M("palette-grey-700")),O(y.Chip,"defaultIconColor",M("palette-grey-700")),O(y.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),O(y.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),O(y.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),O(y.LinearProgress,"primaryBg",Fe(y.primary.main,.62)),O(y.LinearProgress,"secondaryBg",Fe(y.secondary.main,.62)),O(y.LinearProgress,"errorBg",Fe(y.error.main,.62)),O(y.LinearProgress,"infoBg",Fe(y.info.main,.62)),O(y.LinearProgress,"successBg",Fe(y.success.main,.62)),O(y.LinearProgress,"warningBg",Fe(y.warning.main,.62)),O(y.Skeleton,"bg",`rgba(${M("palette-text-primaryChannel")} / 0.11)`),O(y.Slider,"primaryTrack",Fe(y.primary.main,.62)),O(y.Slider,"secondaryTrack",Fe(y.secondary.main,.62)),O(y.Slider,"errorTrack",Fe(y.error.main,.62)),O(y.Slider,"infoTrack",Fe(y.info.main,.62)),O(y.Slider,"successTrack",Fe(y.success.main,.62)),O(y.Slider,"warningTrack",Fe(y.warning.main,.62));const D=ei(y.background.default,.8);O(y.SnackbarContent,"bg",D),O(y.SnackbarContent,"color",Nt(()=>y.getContrastText(D))),O(y.SpeedDialAction,"fabHoverBg",ei(y.background.paper,.15)),O(y.StepConnector,"border",M("palette-grey-400")),O(y.StepContent,"border",M("palette-grey-400")),O(y.Switch,"defaultColor",M("palette-common-white")),O(y.Switch,"defaultDisabledColor",M("palette-grey-100")),O(y.Switch,"primaryDisabledColor",Fe(y.primary.main,.62)),O(y.Switch,"secondaryDisabledColor",Fe(y.secondary.main,.62)),O(y.Switch,"errorDisabledColor",Fe(y.error.main,.62)),O(y.Switch,"infoDisabledColor",Fe(y.info.main,.62)),O(y.Switch,"successDisabledColor",Fe(y.success.main,.62)),O(y.Switch,"warningDisabledColor",Fe(y.warning.main,.62)),O(y.TableCell,"border",Fe(Jr(y.divider,1),.88)),O(y.Tooltip,"bg",Jr(y.grey[700],.92))}if(y.mode==="dark"){O(y.Alert,"errorColor",Fe(y.error.light,.6)),O(y.Alert,"infoColor",Fe(y.info.light,.6)),O(y.Alert,"successColor",Fe(y.success.light,.6)),O(y.Alert,"warningColor",Fe(y.warning.light,.6)),O(y.Alert,"errorFilledBg",M("palette-error-dark")),O(y.Alert,"infoFilledBg",M("palette-info-dark")),O(y.Alert,"successFilledBg",M("palette-success-dark")),O(y.Alert,"warningFilledBg",M("palette-warning-dark")),O(y.Alert,"errorFilledColor",Nt(()=>y.getContrastText(y.error.dark))),O(y.Alert,"infoFilledColor",Nt(()=>y.getContrastText(y.info.dark))),O(y.Alert,"successFilledColor",Nt(()=>y.getContrastText(y.success.dark))),O(y.Alert,"warningFilledColor",Nt(()=>y.getContrastText(y.warning.dark))),O(y.Alert,"errorStandardBg",De(y.error.light,.9)),O(y.Alert,"infoStandardBg",De(y.info.light,.9)),O(y.Alert,"successStandardBg",De(y.success.light,.9)),O(y.Alert,"warningStandardBg",De(y.warning.light,.9)),O(y.Alert,"errorIconColor",M("palette-error-main")),O(y.Alert,"infoIconColor",M("palette-info-main")),O(y.Alert,"successIconColor",M("palette-success-main")),O(y.Alert,"warningIconColor",M("palette-warning-main")),O(y.AppBar,"defaultBg",M("palette-grey-900")),O(y.AppBar,"darkBg",M("palette-background-paper")),O(y.AppBar,"darkColor",M("palette-text-primary")),O(y.Avatar,"defaultBg",M("palette-grey-600")),O(y.Button,"inheritContainedBg",M("palette-grey-800")),O(y.Button,"inheritContainedHoverBg",M("palette-grey-700")),O(y.Chip,"defaultBorder",M("palette-grey-700")),O(y.Chip,"defaultAvatarColor",M("palette-grey-300")),O(y.Chip,"defaultIconColor",M("palette-grey-300")),O(y.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),O(y.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),O(y.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),O(y.LinearProgress,"primaryBg",De(y.primary.main,.5)),O(y.LinearProgress,"secondaryBg",De(y.secondary.main,.5)),O(y.LinearProgress,"errorBg",De(y.error.main,.5)),O(y.LinearProgress,"infoBg",De(y.info.main,.5)),O(y.LinearProgress,"successBg",De(y.success.main,.5)),O(y.LinearProgress,"warningBg",De(y.warning.main,.5)),O(y.Skeleton,"bg",`rgba(${M("palette-text-primaryChannel")} / 0.13)`),O(y.Slider,"primaryTrack",De(y.primary.main,.5)),O(y.Slider,"secondaryTrack",De(y.secondary.main,.5)),O(y.Slider,"errorTrack",De(y.error.main,.5)),O(y.Slider,"infoTrack",De(y.info.main,.5)),O(y.Slider,"successTrack",De(y.success.main,.5)),O(y.Slider,"warningTrack",De(y.warning.main,.5));const D=ei(y.background.default,.98);O(y.SnackbarContent,"bg",D),O(y.SnackbarContent,"color",Nt(()=>y.getContrastText(D))),O(y.SpeedDialAction,"fabHoverBg",ei(y.background.paper,.15)),O(y.StepConnector,"border",M("palette-grey-600")),O(y.StepContent,"border",M("palette-grey-600")),O(y.Switch,"defaultColor",M("palette-grey-300")),O(y.Switch,"defaultDisabledColor",M("palette-grey-600")),O(y.Switch,"primaryDisabledColor",De(y.primary.main,.55)),O(y.Switch,"secondaryDisabledColor",De(y.secondary.main,.55)),O(y.Switch,"errorDisabledColor",De(y.error.main,.55)),O(y.Switch,"infoDisabledColor",De(y.info.main,.55)),O(y.Switch,"successDisabledColor",De(y.success.main,.55)),O(y.Switch,"warningDisabledColor",De(y.warning.main,.55)),O(y.TableCell,"border",De(Jr(y.divider,1),.68)),O(y.Tooltip,"bg",Jr(y.grey[700],.92))}_t(y.background,"default"),_t(y.background,"paper"),_t(y.common,"background"),_t(y.common,"onBackground"),_t(y,"divider"),Object.keys(y).forEach(D=>{const B=y[D];D!=="tonalOffset"&&B&&typeof B=="object"&&(B.main&&O(y[D],"mainChannel",hr(mr(B.main))),B.light&&O(y[D],"lightChannel",hr(mr(B.light))),B.dark&&O(y[D],"darkChannel",hr(mr(B.dark))),B.contrastText&&O(y[D],"contrastTextChannel",hr(mr(B.contrastText))),D==="text"&&(_t(y[D],"primary"),_t(y[D],"secondary")),D==="action"&&(B.active&&_t(y[D],"active"),B.selected&&_t(y[D],"selected")))})}),A=t.reduce((L,y)=>yt(L,y),A);const T={prefix:s,disableCssColorScheme:i,shouldSkipGeneratingVar:o,getSelector:Mw(A)},{vars:C,generateThemeVars:N,generateStyleSheets:P}=tw(A,T);return A.vars=C,Object.entries(A.colorSchemes[A.defaultColorScheme]).forEach(([L,y])=>{A[L]=y}),A.generateThemeVars=N,A.generateStyleSheets=P,A.generateSpacing=function(){return ph(c.spacing,Ea(this))},A.getColorSchemeSelector=nw(a),A.spacing=A.generateSpacing(),A.shouldSkipGeneratingVar=o,A.unstable_sxConfig={...Ui,...c==null?void 0:c.unstable_sxConfig},A.unstable_sx=function(y){return Gn({sx:y,theme:this})},A.toRuntimeSource=Ch,A}function du(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Na({...n===!0?{}:n.palette,mode:t})})}function Dw(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:s=n==null?void 0:n.mode,...o}=e,a=s||"light",l=i==null?void 0:i[a],c={...i,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return vs(e,...t);let u=n;"palette"in e||c[a]&&(c[a]!==!0?u=c[a].palette:a==="dark"&&(u={mode:"dark"}));const d=vs({...e,palette:u},...t);return d.defaultColorScheme=a,d.colorSchemes=c,d.palette.mode==="light"&&(d.colorSchemes.light={...c.light!==!0&&c.light,palette:d.palette},du(d,"dark",c.dark)),d.palette.mode==="dark"&&(d.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:d.palette},du(d,"light",c.light)),d}return!n&&!("light"in c)&&a==="light"&&(c.light=!0),Vw({...o,colorSchemes:c,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}const Fw=Dw(),Lw="$$material";function Ow(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const $w=e=>Ow(e)&&e!=="classes",_w=Ov({themeId:Lw,defaultTheme:Fw,rootShouldForwardProp:$w}),Bw=Xv;process.env.NODE_ENV!=="production"&&(Te.node,Te.object.isRequired);function zw(e){return Yv(e)}function Hw(e){return Aa("MuiSvgIcon",e)}Rv("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Uw=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${wn(t)}`,`fontSize${wn(n)}`]};return Cb(i,Hw,r)},Ww=_w("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${wn(n.color)}`],t[`fontSize${wn(n.fontSize)}`]]}})(Bw(({theme:e})=>{var t,n,r,i,s,o,a,l,c,u,d,h,m,g;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(i=(t=e.transitions)==null?void 0:t.create)==null?void 0:i.call(t,"fill",{duration:(r=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:p=>!p.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((o=(s=e.typography)==null?void 0:s.pxToRem)==null?void 0:o.call(s,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((u=(c=e.typography)==null?void 0:c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,p])=>p&&p.main).map(([p])=>{var b,v;return{props:{color:p},style:{color:(v=(b=(e.vars??e).palette)==null?void 0:b[p])==null?void 0:v.main}}}),{props:{color:"action"},style:{color:(h=(d=(e.vars??e).palette)==null?void 0:d.action)==null?void 0:h.active}},{props:{color:"disabled"},style:{color:(g=(m=(e.vars??e).palette)==null?void 0:m.action)==null?void 0:g.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Ei=x.forwardRef(function(t,n){const r=zw({props:t,name:"MuiSvgIcon"}),{children:i,className:s,color:o="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:d,viewBox:h="0 0 24 24",...m}=r,g=x.isValidElement(i)&&i.type==="svg",p={...r,color:o,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:h,hasSvgAsChild:g},b={};u||(b.viewBox=h);const v=Uw(p);return f.jsxs(Ww,{as:a,className:Ds(v.root,s),focusable:"false",color:c,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n,...b,...m,...g&&i.props,ownerState:p,children:[g?i.props.children:i,d?f.jsx("title",{children:d}):null]})});process.env.NODE_ENV!=="production"&&(Ei.propTypes={children:Te.node,classes:Te.object,className:Te.string,color:Te.oneOfType([Te.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),Te.string]),component:Te.elementType,fontSize:Te.oneOfType([Te.oneOf(["inherit","large","medium","small"]),Te.string]),htmlColor:Te.string,inheritViewBox:Te.bool,shapeRendering:Te.string,sx:Te.oneOfType([Te.arrayOf(Te.oneOfType([Te.func,Te.object,Te.bool])),Te.func,Te.object]),titleAccess:Te.string,viewBox:Te.string});Ei.muiName="SvgIcon";function nr(e,t){function n(r,i){return f.jsx(Ei,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:i,...r,children:e})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=Ei.muiName,x.memo(x.forwardRef(n))}const Zw=nr(f.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"),qw=nr(f.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"),Gw=nr([f.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),f.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"),Ah=nr(f.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"),jh=nr(f.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"),Ph=nr(f.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");function Kw({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[i,s]=j.useState(""),[o,a]=j.useState(0);return j.useEffect(()=>{if(n){s(e);return}if(t){s(e);return}if(o<e.length){const l=setTimeout(()=>{s(e.slice(0,o+1)),a(o+1)},r);return()=>clearTimeout(l)}},[e,o,t,r,n]),j.useEffect(()=>{n||(a(0),s(""))},[e,n]),f.jsxs("span",{className:"relative",children:[f.jsx("span",{className:"inline-block",children:i}),!t&&f.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(l=>f.jsx(ge.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:l*.2,ease:"easeInOut"}},l))})]})}function Yw({message:e,theme:t,isOwn:n,isStreaming:r=!1}){var o,a,l;const i=tt(t),s=e.sender.name?e.sender.name.split(" ").map(c=>c[0]).join("").toUpperCase().slice(0,2):"U";return f.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-1`,children:f.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 max-w-[85%]`,children:[f.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:s}),f.jsxs("div",{className:`
103
103
  relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover
104
104
  ${n?`${((o=i.chatMessage)==null?void 0:o.own)||"bg-blue-500 text-white"} rounded-br-md`:`${((a=i.chatMessage)==null?void 0:a.other)||"bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-white"} rounded-bl-md`}
105
105
  ${r?"shimmer":""}
106
106
  transition-all duration-200 group-hover:scale-[1.02]
107
- `,style:{wordWrap:"break-word",overflowWrap:"break-word"},children:[f.jsx("div",{className:"whitespace-pre-wrap break-words leading-relaxed text-sm",children:r&&!n?f.jsx(Pw,{text:e.content,isComplete:!r,isRealTimeStream:((l=e.metadata)==null?void 0:l.streaming)===!0,speed:35}):e.content}),f.jsx("div",{className:"text-xs mt-1",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}const gh=j.forwardRef(({disabled:e,capabilities:t,sessionStarted:n,participantName:r="User",loadingText:i="Waiting for agent to connect...",theme:s="vox",client:o,displayType:a="widget",onBack:l},c)=>{var Z,pe,Ae,xe,Me,ze,He,nt,Zt,Ft,_;const[u,d]=j.useState(!1),[h,m]=j.useState(!1),[g,p]=j.useState(!1),[b,v]=j.useState(()=>{var q;return((q=o==null?void 0:o.getCurrentInteraction)==null?void 0:q.call(o))||null}),[k,S]=j.useState(()=>o&&typeof o.getChatMessages=="function"?o.getChatMessages():[]),[A,T]=j.useState(()=>{const I=n;return console.log("🚀 SessionView: Initial loading state calculation:",{sessionStarted:n,shouldShowLoading:I}),I}),[C,M]=j.useState(!0),[P,L]=j.useState(new Set),[y,N]=j.useState([]),D=j.useRef(null),B=j.useRef(null),[H,K]=j.useState(!0),de=j.useRef(null),ie=j.useRef(null),F=j.useMemo(()=>Math.random().toString(36).substr(2,9),[]);console.log(`🚀 SessionView-${F}: Component initialized with:`,{initialMessagesCount:k.length,clientExists:!!o,sessionStarted:n,agentConnected:g,isLoading:A,displayType:a,disabled:e});const W=(Z=o==null?void 0:o.getCurrentAgentInfo)==null?void 0:Z.call(o),z=((W==null?void 0:W.name)||"AI Assistant").split(" ").map(I=>I[0]).join("").toUpperCase().slice(0,2),oe=j.useCallback(()=>{if(B.current){const{scrollTop:I,scrollHeight:q,clientHeight:ue}=B.current;return q-I-ue<100}return!0},[]),E=j.useCallback(()=>{const I=oe();K(I)},[oe]),U=j.useCallback((I=!1)=>{if(H&&B.current){const q=B.current;I?q.scrollTop=q.scrollHeight:q.scrollTo({top:q.scrollHeight,behavior:"smooth"})}},[H]);j.useEffect(()=>{if(!o)return;const I=J=>{var ke,G,be,Ce,je;if(console.log(`SessionView-${F}: Received message:`,J),console.log(`SessionView-${F}: Message sender details:`,{senderId:(ke=J.sender)==null?void 0:ke.id,senderName:(G=J.sender)==null?void 0:G.name,senderType:(be=J.sender)==null?void 0:be.type,content:J.content,messageId:J.id,topic:(Ce=J.metadata)==null?void 0:Ce.topic,isTranscription:((je=J.metadata)==null?void 0:je.topic)==="lk.transcription"}),T(!1),b&&J.sender.type==="agent"){console.log("SessionView: Queuing agent message due to active interaction:",b.methodName),N($e=>[...$e,J]);return}J.sender.type==="agent"&&M(!1),S($e=>{var ht;if($e.some(an=>an.id===J.id))return console.log("SessionView: Message already exists, skipping:",J.id),$e;if(console.log(`SessionView-${F}: Adding new message:`,J.id),J.sender.type==="agent"&&(L(an=>new Set(an).add(J.id)),!((ht=J.metadata)!=null&&ht.streaming))){const an=J.content.length*35+1e3;setTimeout(()=>{L($m=>{const Ka=new Set($m);return Ka.delete(J.id),Ka})},an)}return[...$e,J]}),setTimeout(()=>{H&&U(!0)},0)},q=J=>{var ke;if(console.log("SessionView: Updated message:",J),b&&J.sender.type==="agent"){console.log("SessionView: Queuing agent message update due to active interaction:",b.methodName),N(G=>{const be=G.findIndex(Ce=>Ce.id===J.id);if(be>=0){const Ce=[...G];return Ce[be]=J,Ce}else return[...G,J]});return}S(G=>G.map(be=>be.id===J.id?{...J}:be)),setTimeout(()=>{H&&U(!0)},0),(ke=J.metadata)!=null&&ke.streaming||L(G=>{const be=new Set(G);return be.delete(J.id),be})},ue=J=>{var ke,G,be,Ce,je,$e;if(console.log(`SessionView-${F}: Sent message:`,J),console.log(`SessionView-${F}: Sent message details:`,{senderId:(ke=J.sender)==null?void 0:ke.id,senderName:(G=J.sender)==null?void 0:G.name,senderType:(be=J.sender)==null?void 0:be.type,content:J.content,messageId:J.id,topic:(Ce=J.metadata)==null?void 0:Ce.topic,isTranscription:((je=J.metadata)==null?void 0:je.topic)==="lk.transcription"}),T(!1),(($e=J.metadata)==null?void 0:$e.topic)==="lk.transcription"){console.log(`SessionView-${F}: Skipping sent transcription message (will come through received):`,J.id);return}S(Et=>Et.some(an=>an.id===J.id)?(console.log("SessionView: Sent message already exists, skipping:",J.id),Et):(console.log("SessionView: Adding sent message:",J.id),[...Et,J])),setTimeout(()=>{H&&U(!0)},0)};return o.on("chat.message.received",I),o.on("chat.message.updated",q),o.on("chat.message.sent",ue),()=>{o.off("chat.message.received",I),o.off("chat.message.updated",q),o.off("chat.message.sent",ue)}},[o,b,H,U]),j.useEffect(()=>{if(!o)return;const I=()=>{if(console.log("SessionView: Agent is thinking"),b){console.log("SessionView: Suppressing thinking indicator due to active interaction:",b.methodName);return}M(!0)},q=()=>{console.log("SessionView: Agent is speaking"),M(!1)};return o.on("agent.thinking",I),o.on("agent.speaking",q),()=>{o.off("agent.thinking",I),o.off("agent.speaking",q)}},[o,b]),j.useEffect(()=>{console.log("🎬 SessionView: Messages state updated:",{messageCount:k.length,messages:k.map(I=>{var q,ue;return{id:I.id,text:((q=I.content)==null?void 0:q.substring(0,50))+"...",from:(ue=I.sender)==null?void 0:ue.id}})})},[k]),j.useEffect(()=>{const I=k.filter(q=>q.content&&q.content.trim()!==""&&q.content.trim()!=="...");k.length===0?console.log("📝 SessionView: Showing empty state - no messages available"):I.length===0?console.log("📝 SessionView: Showing empty state - no messages with content available",{totalMessages:k.length,messagesWithContent:I.length}):console.log("📝 SessionView: Showing messages",{totalMessages:k.length,messagesWithContent:I.length})},[k]);const{agent:{isActive:se=!1}={}}=o?Gf(o):{agent:{isActive:!1}},$=et(s),ee=j.useMemo(()=>o&&typeof o.getCurrentSession=="function"?!!o.getCurrentSession():!1,[o]),Q=j.useMemo(()=>o&&typeof o.getIsAgentConnected=="function"&&o.getIsAgentConnected()||g,[o,g]),V=se||Q;j.useEffect(()=>{var I,q;console.log("🤖 SessionView agent state:",{isAgentActive:se,hasActiveSession:ee,isAgentActuallyConnected:Q,effectiveAgentActive:V,sessionStarted:n,clientSession:(q=(I=o==null?void 0:o.getCurrentSession)==null?void 0:I.call(o))==null?void 0:q.id,isLoading:A}),V&&A&&(console.log("✅ SessionView: Agent became active, stopping loading state"),T(!1))},[se,ee,Q,V,n,o,A]),j.useEffect(()=>{se&&console.log("🤖 Agent became active")},[se]),j.useEffect(()=>{console.log("📋 Session state changed:",{sessionStarted:n,disabled:e,participantName:r,effectiveAgentActive:V,chatOpen:u,currentInteraction:(b==null?void 0:b.methodName)||"none"})},[n,e,r,V,u,b]),j.useEffect(()=>{if(n&&!V){console.log("⏰ Starting agent timeout detection...");const I=setTimeout(()=>{ee&&!V&&(console.log("⚡ Fallback: Assuming agent is connected after 5 seconds with active session"),p(!0),m(!1))},5e3),q=setTimeout(()=>{V||(console.log("⚠️ Agent timeout: Agent did not become active within 30 seconds"),m(!0))},3e4);return()=>{clearTimeout(I),clearTimeout(q)}}else V&&(console.log("✅ Agent is active, clearing timeout"),m(!1))},[n,V,ee]),j.useEffect(()=>{if(!o)return;const I=()=>{console.log("🔄 Client connection state changed:",o.connected)},q=ue=>{console.log("🔴 Client disconnected:",ue),v(null),d(!1),m(!1)};return o.on("connection.connected",I),o.on("connection.disconnected",q),()=>{o.off("connection.connected",I),o.off("connection.disconnected",q)}},[o]),j.useEffect(()=>{if(!o)return;const I=ke=>{console.log("🤖 SessionView: Agent connected!",ke),p(!0),m(!1),T(!1)},q=ke=>{console.log("🗣️ SessionView: Agent speaking detected!",ke),g||(p(!0),m(!1),T(!1))},ue=ke=>{console.log("🤔 SessionView: Agent thinking detected!",ke),g||(p(!0),m(!1),T(!1))},J=()=>{console.log("🤖 SessionView: Agent disconnected"),p(!1),T(!0)};return o.on("agent.connected",I),o.on("agent.speaking",q),o.on("agent.thinking",ue),o.on("connection.disconnected",J),()=>{o.off("agent.connected",I),o.off("agent.speaking",q),o.off("agent.thinking",ue),o.off("connection.disconnected",J)}},[o,g]),j.useEffect(()=>{if(!o)return;const I=ke=>{console.log("🎯 SessionView: RPC Interaction started:",ke);const G=o.getCurrentInteraction();G&&(console.log("📱 SessionView: Setting current interaction:",G.methodName,"mode:",G.presentationMode),v(G))},q=ke=>{console.log("✅ SessionView: RPC Interaction completed:",ke),v(null)},ue=async ke=>{console.log("⏰ SessionView: RPC Interaction timeout:",ke),v(null)},J=async ke=>{console.log("❌ SessionView: RPC Interaction dismissed:",ke),v(null)};return o.on("rpc.interaction.started",I),o.on("rpc.interaction.completed",q),o.on("rpc.interaction.timeout",ue),o.on("rpc.interaction.dismissed",J),()=>{o.off("rpc.interaction.started",I),o.off("rpc.interaction.completed",q),o.off("rpc.interaction.timeout",ue),o.off("rpc.interaction.dismissed",J)}},[o]),j.useEffect(()=>{if(!o)return;const I=o.getCurrentInteraction();I?(console.log("🔄 SessionView: Syncing with existing interaction:",I.methodName),v(I)):v(null)},[o]),j.useEffect(()=>{b!=null&&b.methodName&&console.log("🎭 SessionView: Interactive UI started:",b.methodName)},[b==null?void 0:b.methodName]),j.useEffect(()=>{a==="fullscreen"&&console.log("📱 SessionView: Switched to fullscreen mode")},[a]),j.useEffect(()=>{b&&u&&(console.log("🎭 SessionView: Interactive UI appeared, closing chat"),d(!1))},[b,u]),q1(),j.useEffect(()=>{de.current&&u&&k.length>0&&(console.log("📜 SessionView: Auto-scrolling to latest message, count:",k.length),setTimeout(()=>{H&&U(!0)},100))},[k.length,u,H,U]),j.useEffect(()=>{k.length>0&&k.length%5===0&&console.log("📝 SessionView: Messages count:",k.length)},[k.length]);async function X(I){var q,ue;try{b&&(console.log("SessionView: Dismissing active interaction due to user message send"),(q=o==null?void 0:o.dismissCurrentInteraction)==null||q.call(o),v(null)),await((ue=o==null?void 0:o.sendChatMessage)==null?void 0:ue.call(o,I))}catch(J){console.error("Failed to send message:",J)}}const fe=j.useCallback(I=>{console.log("📝 SessionView: Adding local message for voice session context:",I)},[]),R=j.useCallback(async I=>{try{o&&typeof o.sendAttachments=="function"&&(await o.sendAttachments(I),console.log("📎 SessionView: Attachments sent successfully:",I.map(q=>q.name)))}catch(q){console.error("❌ SessionView: Failed to send attachments:",q)}},[o]),re=j.useCallback(()=>{try{console.log("📞 SessionView: Ending call..."),console.log("📞 SessionView: Current state before ending:",{sessionStarted:n,effectiveAgentActive:V,chatOpen:u,currentInteraction:b==null?void 0:b.methodName,hasOnBack:!!l}),b&&(console.log("🎭 SessionView: Dismissing current interaction:",b.methodName),v(null),o&&typeof o.dismissCurrentInteraction=="function"&&o.dismissCurrentInteraction()),d(!1),m(!1),console.log("✅ SessionView: Local state reset"),o&&typeof o.endSession=="function"&&(o.endSession(),console.log("✅ SessionView: Session ended via client.endSession()")),o&&typeof o.disconnect=="function"&&(o.disconnect(),console.log("✅ SessionView: Client disconnected")),l?(console.log("🔄 SessionView: Calling onBack to return to welcome..."),l(),console.log("✅ SessionView: onBack called")):console.warn("⚠️ SessionView: No onBack function provided - cannot return to welcome"),console.log("🏁 SessionView: Call ended and cleanup completed")}catch(I){console.error("❌ SessionView: Failed to end call:",I),v(null),d(!1),m(!1),l&&(console.log("🔄 SessionView: Error occurred, still calling onBack..."),l())}},[o,l,b,n,V,u]);j.useEffect(()=>(n||console.log("🔄 SessionView: Session ended, component will unmount"),()=>{n||console.log("🧹 SessionView: Component unmounted")}),[n]),j.useEffect(()=>{var q,ue;const I=((ue=(q=o==null?void 0:o.getCurrentSession)==null?void 0:q.call(o))==null?void 0:ue.id)||null;ie.current&&!I&&console.warn("⚠️ SessionView: Session was lost unexpectedly!",{previousSession:ie.current,currentSession:I,displayType:a,sessionStarted:n,effectiveAgentActive:V}),ie.current=I},[o,a,n,V]);const ne=ce("w-full flex flex-col items-center justify-center",a==="fullscreen"?"w-full max-w-none mx-0 h-full":"w-full mx-auto",$.main,a==="fullscreen"?"max-w-none":"","overflow-hidden","h-full"),me=l&&(a==="popup"||a==="fullscreen");return A?f.jsx("main",{ref:c,className:ce(ne,"relative",e&&"pointer-events-none opacity-50"),children:me&&f.jsx("div",{className:`flex items-center justify-between w-full p-4 border-b ${((pe=$.chatHeader)==null?void 0:pe.container)||"border-gray-200"}`,children:f.jsx("div",{className:"flex items-center",children:f.jsxs("div",{children:[f.jsx("h3",{className:`font-semibold ${$.text.primary}`,children:"Voice Session"}),f.jsx("p",{className:`text-sm ${$.text.muted}`,children:r})]})})})}):f.jsxs("main",{ref:c,className:ce(ne,"relative",e&&"pointer-events-none opacity-50"),style:{minHeight:0},children:[me&&f.jsx("div",{className:`flex items-center justify-between w-full p-4 border-b ${((Ae=$.chatHeader)==null?void 0:Ae.container)||"border-gray-200"}`,children:f.jsx("div",{className:"flex items-center",children:f.jsxs("div",{children:[f.jsx("h3",{className:`font-semibold ${$.text.primary}`,children:"Voice Session"}),f.jsx("p",{className:`text-sm ${$.text.muted}`,children:r})]})})}),f.jsxs("div",{className:"w-full flex-1 flex flex-col items-center px-0 min-h-0 overflow-hidden",children:[!V&&f.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full min-h-[180px]",children:[f.jsx(ge.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:f.jsx(ha,{className:$.spinner,weight:"bold"})}),f.jsx(ge.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-sm opacity-80 ${$.text.muted} text-center max-w-xs`,children:h?"Agent is taking longer than expected...":i}),f.jsx(ge.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${$.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&&l&&f.jsx(ge.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:l,className:`mt-4 px-4 py-2 rounded-lg ${((xe=$.chatHeader)==null?void 0:xe.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]}),V&&f.jsxs(f.Fragment,{children:[u&&f.jsxs("div",{className:ce("absolute inset-0 w-full h-full flex flex-col transition-[opacity,translate] duration-300 ease-out z-10",s==="light"?"bg-white":"bg-gray-900/95 backdrop-blur-sm",u?"translate-y-0 opacity-100 delay-200":"translate-y-10 opacity-0"),children:[f.jsxs("div",{className:ce("flex-shrink-0 px-4 py-3 border-b",a==="fullscreen"?"px-8":"px-5",((Me=$.chatHeader)==null?void 0:Me.container)||"border-gray-200 dark:border-gray-700"),children:[f.jsx("h3",{className:ce("font-semibold text-lg",((ze=$.text)==null?void 0:ze.primary)||"text-gray-900 dark:text-white"),children:"Transcription & Chat"}),f.jsxs("p",{className:ce("text-sm",((He=$.text)==null?void 0:He.muted)||"text-gray-600 dark:text-gray-400"),children:[k.length," messages"]})]}),f.jsx("div",{className:ce("flex-1 flex flex-col min-h-0",a==="fullscreen"?"px-8":"px-5"),children:f.jsxs("div",{ref:B,className:`flex-1 flex flex-col h-full ${ce("overflow-y-auto scrollbar-hide py-4")}`,style:{scrollbarWidth:"none",scrollBehavior:"smooth",paddingBottom:"120px"},onScroll:E,children:[k.filter(I=>I.content&&I.content.trim()!==""&&I.content.trim()!=="...").length===0&&f.jsx("div",{className:"flex-1 flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx(ge.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 mx-auto",children:z}),f.jsx("p",{className:ce("text-lg font-medium mb-2",((nt=$.text)==null?void 0:nt.primary)||"text-gray-900 dark:text-white"),children:"Start Speaking"}),f.jsx("p",{className:ce("text-sm",((Zt=$.text)==null?void 0:Zt.muted)||"text-gray-600 dark:text-gray-400"),children:"Your conversation will appear here"})]})}),k.length>0&&f.jsx("div",{className:"w-full max-w-5xl mx-auto space-y-3 py-4 flex-1 flex flex-col justify-end",children:f.jsxs("div",{className:"space-y-3",children:[f.jsx(Qt,{mode:"popLayout",children:k.filter(I=>I.content&&I.content.trim()!==""&&I.content.trim()!=="...").map((I,q)=>f.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3,ease:"easeOut",delay:q*.02},layout:!0,children:f.jsx(Nw,{message:I,theme:s,isOwn:I.sender.type==="participant",isStreaming:P.has(I.id)})},I.id||`message-${q}`))}),C&&!b&&f.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:k.length*.1},className:"flex w-full justify-start mb-4 px-1",children:f.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[f.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 ${s==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:z}),f.jsx("div",{className:"relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-white rounded-bl-md transition-all duration-200 group-hover:scale-[1.02]",style:{wordWrap:"break-word",overflowWrap:"break-word",minWidth:48},children:f.jsx("span",{className:"inline-flex items-center",children:[0,1,2].map(I=>f.jsx(ge.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:I*.2,ease:"easeInOut"}},I))})})]})}),f.jsx("div",{ref:D})]})})]})}),!H&&f.jsx(ge.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onClick:()=>{K(!0),U(!1)},className:`absolute right-6 bottom-20 z-10 p-3 rounded-full shadow-lg backdrop-blur-sm border transition-all duration-200 hover:scale-105 ${s==="light"?"bg-white/90 text-gray-600 border-gray-200 hover:bg-white hover:text-gray-800":"bg-gray-800/90 text-gray-300 border-gray-700 hover:bg-gray-700 hover:text-white"}`,"aria-label":"Scroll to bottom",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})})]}),!u&&f.jsxs("div",{className:ce("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:[f.jsx(ge.div,{className:"w-full flex justify-center",animate:{y:(b==null?void 0:b.presentationMode)==="embedded"?-8:0},transition:{duration:.3,ease:"easeOut"},children:f.jsx(Z1,{chatOpen:u,client:o},`media-tiles-${((_=(Ft=o==null?void 0:o.getCurrentSession)==null?void 0:Ft.call(o))==null?void 0:_.id)||"no-session"}`)}),f.jsx(Qt,{mode:"wait",children:b&&b.presentationMode==="embedded"&&f.jsx(ge.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:ce("w-full relative mt-4 flex justify-center",a==="fullscreen"?"max-w-4xl":"max-w-md"),children:f.jsx("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl border border-white/20 shadow-lg overflow-hidden",children:f.jsx(Tr,{interaction:b,theme:s,onDismiss:()=>{var I;return(I=o==null?void 0:o.dismissCurrentInteraction)==null?void 0:I.call(o)},client:o,addLocalMessage:fe})})},`embedded-${b.methodName}`)})]})]})]}),f.jsx(Qt,{mode:"wait",children:b&&b.presentationMode!=="embedded"&&!u&&f.jsx("div",{className:ce("absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm",a==="fullscreen"?"bg-black/70":"bg-black/50"),children:f.jsx(ge.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},className:ce("relative w-full overflow-hidden",a==="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:f.jsx(Tr,{interaction:b,theme:s,onDismiss:()=>{var I;return(I=o==null?void 0:o.dismissCurrentInteraction)==null?void 0:I.call(o)},client:o,addLocalMessage:fe})},`modal-${b.methodName}`)})}),f.jsx(ge.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:f.jsx(Mw,{capabilities:t,onSendMessage:X,onSendAttachments:R,onEndCall:re,onChatOpenChange:d,disabled:e,theme:s,client:o,sessionStarted:n})})]})});gh.displayName="SessionView";function Mw({capabilities:e,onSendMessage:t,onSendAttachments:n,onEndCall:r,onChatOpenChange:i,disabled:s=!1,theme:o,client:a,sessionStarted:l=!1}){const[c,u]=j.useState(!1),d=j.useRef(null),h=j.useRef(null);j.useEffect(()=>{const k=()=>{const S=navigator.userAgent.toLowerCase(),T=["android","iphone","ipad","mobile","tablet"].some(P=>S.includes(P)),C="ontouchstart"in window||navigator.maxTouchPoints>0,M=window.innerWidth<=768;u(T||C&&M)};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]);const m=k=>{const S=k.target.files;if(S&&S.length>0){const T=Array.from(S).filter(C=>C.type.startsWith("image/"));if(T.length===0){console.warn("No valid image files selected");return}n&&n(T),d.current&&(d.current.value="")}},g=k=>{const S=k.target.files;if(S&&S.length>0){const A=S[0];A.type.startsWith("image/")&&n&&n([A]),h.current&&(h.current.value="")}},p=()=>{!s&&d.current&&d.current.click()},b=()=>{!s&&c&&h.current&&h.current.click()},v=()=>{console.log("🔴 VoiceControlPanel: End call button clicked"),console.log("🔴 VoiceControlPanel: Current state:",{disabled:s,sessionStarted:l,hasOnEndCall:!!r}),r?r():console.warn("⚠️ VoiceControlPanel: No onEndCall function provided")};return f.jsx("div",{className:ce("px-3 py-2 !w-full backdrop-blur-xl border-0 shadow-lg",o==="light"?"bg-white/95 border-t border-gray-200":"bg-gray-900/95 border-t border-gray-700"),children:f.jsxs("div",{className:"flex items-center justify-between !w-full mx-auto max-w-4xl",children:[f.jsx("input",{ref:d,type:"file",multiple:!0,onChange:m,className:"hidden",accept:"image/*"}),f.jsx("input",{ref:h,type:"file",onChange:g,className:"hidden",accept:"image/*",capture:"environment"}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{onClick:p,disabled:s,className:ce("p-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",s?"opacity-50 cursor-not-allowed":"hover:shadow-md",o==="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:f.jsx(Tw,{className:"w-4 h-4"})}),c&&f.jsx("button",{onClick:b,disabled:s,className:ce("p-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",s?"opacity-50 cursor-not-allowed":"hover:shadow-md",o==="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:f.jsx(jw,{className:"w-4 h-4"})})]}),f.jsx("div",{className:"flex-1 flex justify-center px-2",children:f.jsx($1,{capabilities:e,onChatOpenChange:i,onSendMessage:t,theme:o,client:a,className:"border-none py-0 rounded-xl max-w-md w-full"})}),f.jsx("div",{className:"flex items-center",children:f.jsx("button",{onClick:v,disabled:s||!l,className:ce("p-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",s||!l?"opacity-50 cursor-not-allowed":"hover:shadow-md","bg-red-500 hover:bg-red-600 text-white"),title:"End call",children:f.jsx(Aw,{className:"w-4 h-4"})})})]})})}function Iw(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Rw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dw={};function ru(e,t){return(Dw.jsx?Vw:Rw).test(e)}const Fw=/[ \t\n\f\r]/g;function Lw(e){return typeof e=="object"?e.type==="text"?iu(e.value):!1:iu(e)}function iu(e){return e.replace(Fw,"")===""}class Fr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Fr.prototype.normal={};Fr.prototype.property={};Fr.prototype.space=void 0;function yh(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Fr(n,r,t)}function gs(e){return e.toLowerCase()}class ft{constructor(t,n){this.attribute=n,this.property=t}}ft.prototype.attribute="";ft.prototype.booleanish=!1;ft.prototype.boolean=!1;ft.prototype.commaOrSpaceSeparated=!1;ft.prototype.commaSeparated=!1;ft.prototype.defined=!1;ft.prototype.mustUseProperty=!1;ft.prototype.number=!1;ft.prototype.overloadedBoolean=!1;ft.prototype.property="";ft.prototype.spaceSeparated=!1;ft.prototype.space=void 0;let Ow=0;const ve=wn(),Qe=wn(),ys=wn(),Y=wn(),Oe=wn(),zn=wn(),mt=wn();function wn(){return 2**++Ow}const xs=Object.freeze(Object.defineProperty({__proto__:null,boolean:ve,booleanish:Qe,commaOrSpaceSeparated:mt,commaSeparated:zn,number:Y,overloadedBoolean:ys,spaceSeparated:Oe},Symbol.toStringTag,{value:"Module"})),ko=Object.keys(xs);class Ca extends ft{constructor(t,n,r,i){let s=-1;if(super(t,n),ou(this,"space",i),typeof r=="number")for(;++s<ko.length;){const o=ko[s];ou(this,ko[s],(r&xs[o])===xs[o])}}}Ca.prototype.defined=!0;function ou(e,t,n){n&&(e[t]=n)}function er(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Ca(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[gs(r)]=r,n[gs(s.attribute)]=r}return new Fr(t,n,e.space)}const xh=er({properties:{ariaActiveDescendant:null,ariaAtomic:Qe,ariaAutoComplete:null,ariaBusy:Qe,ariaChecked:Qe,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:Oe,ariaCurrent:null,ariaDescribedBy:Oe,ariaDetails:null,ariaDisabled:Qe,ariaDropEffect:Oe,ariaErrorMessage:null,ariaExpanded:Qe,ariaFlowTo:Oe,ariaGrabbed:Qe,ariaHasPopup:null,ariaHidden:Qe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Oe,ariaLevel:Y,ariaLive:null,ariaModal:Qe,ariaMultiLine:Qe,ariaMultiSelectable:Qe,ariaOrientation:null,ariaOwns:Oe,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:Qe,ariaReadOnly:Qe,ariaRelevant:null,ariaRequired:Qe,ariaRoleDescription:Oe,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:Qe,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function bh(e,t){return t in e?e[t]:t}function vh(e,t){return bh(e,t.toLowerCase())}const $w=er({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:zn,acceptCharset:Oe,accessKey:Oe,action:null,allow:null,allowFullScreen:ve,allowPaymentRequest:ve,allowUserMedia:ve,alt:null,as:null,async:ve,autoCapitalize:null,autoComplete:Oe,autoFocus:ve,autoPlay:ve,blocking:Oe,capture:null,charSet:null,checked:ve,cite:null,className:Oe,cols:Y,colSpan:null,content:null,contentEditable:Qe,controls:ve,controlsList:Oe,coords:Y|zn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ve,defer:ve,dir:null,dirName:null,disabled:ve,download:ys,draggable:Qe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ve,formTarget:null,headers:Oe,height:Y,hidden:ys,high:Y,href:null,hrefLang:null,htmlFor:Oe,httpEquiv:Oe,id:null,imageSizes:null,imageSrcSet:null,inert:ve,inputMode:null,integrity:null,is:null,isMap:ve,itemId:null,itemProp:Oe,itemRef:Oe,itemScope:ve,itemType:Oe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ve,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:ve,muted:ve,name:null,nonce:null,noModule:ve,noValidate:ve,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ve,optimum:Y,pattern:null,ping:Oe,placeholder:null,playsInline:ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ve,referrerPolicy:null,rel:Oe,required:ve,reversed:ve,rows:Y,rowSpan:Y,sandbox:Oe,scope:null,scoped:ve,seamless:ve,selected:ve,shadowRootClonable:ve,shadowRootDelegatesFocus:ve,shadowRootMode:null,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:Qe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:ve,useMap:null,value:Qe,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Oe,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ve,declare:ve,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:ve,noHref:ve,noShade:ve,noWrap:ve,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:Qe,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ve,disableRemotePlayback:ve,prefix:null,property:null,results:Y,security:null,unselectable:null},space:"html",transform:vh}),_w=er({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:mt,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:Oe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:zn,g2:zn,glyphName:zn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:mt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Oe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:mt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:mt,rev:mt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:mt,requiredFeatures:mt,requiredFonts:mt,requiredFormats:mt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:mt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:mt,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:mt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:bh}),wh=er({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),kh=er({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:vh}),Sh=er({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Bw={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},zw=/[A-Z]/g,su=/-[a-z]/g,Hw=/^data[-\w.:]+$/i;function Uw(e,t){const n=gs(t);let r=t,i=ft;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Hw.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(su,Zw);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!su.test(s)){let o=s.replace(zw,Ww);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Ca}return new i(r,t)}function Ww(e){return"-"+e.toLowerCase()}function Zw(e){return e.charAt(1).toUpperCase()}const qw=yh([xh,$w,wh,kh,Sh],"html"),Ea=yh([xh,_w,wh,kh,Sh],"svg");function Gw(e){return e.join(" ").trim()}var Nn={},So,au;function Kw(){if(au)return So;au=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
108
- `,c="/",u="*",d="",h="comment",m="declaration";So=function(p,b){if(typeof p!="string")throw new TypeError("First argument must be a string");if(!p)return[];b=b||{};var v=1,k=1;function S(B){var H=B.match(t);H&&(v+=H.length);var K=B.lastIndexOf(l);k=~K?B.length-K:k+B.length}function A(){var B={line:v,column:k};return function(H){return H.position=new T(B),P(),H}}function T(B){this.start=B,this.end={line:v,column:k},this.source=b.source}T.prototype.content=p;function C(B){var H=new Error(b.source+":"+v+":"+k+": "+B);if(H.reason=B,H.filename=b.source,H.line=v,H.column=k,H.source=p,!b.silent)throw H}function M(B){var H=B.exec(p);if(H){var K=H[0];return S(K),p=p.slice(K.length),H}}function P(){M(n)}function L(B){var H;for(B=B||[];H=y();)H!==!1&&B.push(H);return B}function y(){var B=A();if(!(c!=p.charAt(0)||u!=p.charAt(1))){for(var H=2;d!=p.charAt(H)&&(u!=p.charAt(H)||c!=p.charAt(H+1));)++H;if(H+=2,d===p.charAt(H-1))return C("End of comment missing");var K=p.slice(2,H-2);return k+=2,S(K),p=p.slice(H),k+=2,B({type:h,comment:K})}}function N(){var B=A(),H=M(r);if(H){if(y(),!M(i))return C("property missing ':'");var K=M(s),de=B({type:m,property:g(H[0].replace(e,d)),value:K?g(K[0].replace(e,d)):d});return M(o),de}}function D(){var B=[];L(B);for(var H;H=N();)H!==!1&&(B.push(H),L(B));return B}return P(),D()};function g(p){return p?p.replace(a,d):d}return So}var lu;function Yw(){if(lu)return Nn;lu=1;var e=Nn&&Nn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.default=n;var t=e(Kw());function n(r,i){var s=null;if(!r||typeof r!="string")return s;var o=(0,t.default)(r),a=typeof i=="function";return o.forEach(function(l){if(l.type==="declaration"){var c=l.property,u=l.value;a?i(c,u,l):u&&(s=s||{},s[c]=u)}}),s}return Nn}var or={},cu;function Xw(){if(cu)return or;cu=1,Object.defineProperty(or,"__esModule",{value:!0}),or.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},o=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),s(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(i,a):c=c.replace(r,a),c.replace(t,o))};return or.camelCase=l,or}var sr,uu;function Qw(){if(uu)return sr;uu=1;var e=sr&&sr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Yw()),n=Xw();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(a,l){a&&l&&(o[(0,n.camelCase)(a,s)]=l)}),o}return r.default=r,sr=r,sr}var Jw=Qw();const e2=pa(Jw),Ch=Eh("end"),Ta=Eh("start");function Eh(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function t2(e){const t=Ta(e),n=Ch(e);if(t&&n)return{start:t,end:n}}function yr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?du(e.position):"start"in e||"end"in e?du(e):"line"in e||"column"in e?bs(e):""}function bs(e){return fu(e&&e.line)+":"+fu(e&&e.column)}function du(e){return bs(e&&e.start)+"-"+bs(e&&e.end)}function fu(e){return e&&typeof e=="number"?e:1}class st extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=yr(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}st.prototype.file="";st.prototype.name="";st.prototype.reason="";st.prototype.message="";st.prototype.stack="";st.prototype.column=void 0;st.prototype.line=void 0;st.prototype.ancestors=void 0;st.prototype.cause=void 0;st.prototype.fatal=void 0;st.prototype.place=void 0;st.prototype.ruleId=void 0;st.prototype.source=void 0;const Aa={}.hasOwnProperty,n2=new Map,r2=/[A-Z]/g,i2=new Set(["table","tbody","thead","tfoot","tr"]),o2=new Set(["td","th"]),Th="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function s2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=m2(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=h2(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ea:qw,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Ah(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Ah(e,t,n){if(t.type==="element")return a2(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return l2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return u2(e,t,n);if(t.type==="mdxjsEsm")return c2(e,t);if(t.type==="root")return d2(e,t,n);if(t.type==="text")return f2(e,t)}function a2(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ea,e.schema=i),e.ancestors.push(t);const s=Ph(e,t.tagName,!1),o=p2(e,t);let a=Pa(e,t);return i2.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Lw(l):!0})),jh(e,o,s,t),ja(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function l2(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}jr(e,t.position)}function c2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);jr(e,t.position)}function u2(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ea,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Ph(e,t.name,!0),o=g2(e,t),a=Pa(e,t);return jh(e,o,s,t),ja(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function d2(e,t,n){const r={};return ja(r,Pa(e,t)),e.create(t,e.Fragment,r,n)}function f2(e,t){return t.value}function jh(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ja(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function h2(e,t,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:t;return a?c(s,o,a):c(s,o)}}function m2(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=Ta(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function p2(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Aa.call(t.properties,i)){const s=y2(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&o2.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function g2(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else jr(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else jr(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Pa(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:n2;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const a=Ah(e,s,o);a!==void 0&&n.push(a)}return n}function y2(e,t,n){const r=Uw(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Iw(n):Gw(n)),r.property==="style"){let i=typeof n=="object"?n:x2(e,String(n));return e.stylePropertyNameCase==="css"&&(i=b2(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Bw[r.property]||r.property:r.attribute,n]}}function x2(e,t){try{return e2(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new st("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Th+"#cannot-parse-style-attribute",i}}function Ph(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=ru(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=ru(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Aa.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);jr(e)}function jr(e,t){const n=new st("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Th+"#cannot-handle-mdx-estrees-without-createevaluater",n}function b2(e){const t={};let n;for(n in e)Aa.call(e,n)&&(t[v2(n)]=e[n]);return t}function v2(e){let t=e.replace(r2,w2);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function w2(e){return"-"+e.toLowerCase()}const Co={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},k2={};function Na(e,t){const n=k2,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Nh(e,r,i)}function Nh(e,t,n){if(S2(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return hu(e.children,t,n)}return Array.isArray(e)?hu(e,t,n):""}function hu(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Nh(e[i],t,n);return r.join("")}function S2(e){return!!(e&&typeof e=="object")}const mu=document.createElement("i");function Ma(e){const t="&"+e+";";mu.innerHTML=t;const n=mu.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function yt(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function wt(e,t){return e.length>0?(yt(e,e.length,0,t),e):t}const pu={}.hasOwnProperty;function Mh(e){const t={};let n=-1;for(;++n<e.length;)C2(t,e[n]);return t}function C2(e,t){let n;for(n in t){const i=(pu.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){pu.call(i,o)||(i[o]=[]);const a=s[o];E2(i[o],Array.isArray(a)?a:a?[a]:[])}}}function E2(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);yt(e,0,0,r)}function Ih(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function jt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const at=sn(/[A-Za-z]/),ot=sn(/[\dA-Za-z]/),T2=sn(/[#-'*+\--9=?A-Z^-~]/);function ki(e){return e!==null&&(e<32||e===127)}const vs=sn(/\d/),A2=sn(/[\dA-Fa-f]/),j2=sn(/[!-/:-@[-`{-~]/);function he(e){return e!==null&&e<-2}function Le(e){return e!==null&&(e<0||e===32)}function Se(e){return e===-2||e===-1||e===32}const Bi=sn(new RegExp("\\p{P}|\\p{S}","u")),vn=sn(/\s/);function sn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function tr(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&ot(e.charCodeAt(n+1))&&ot(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ee(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return Se(l)?(e.enter(n),a(l)):t(l)}function a(l){return Se(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const P2={tokenize:N2};function N2(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ee(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return he(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const M2={tokenize:I2},gu={tokenize:R2};function I2(e){const t=this,n=[];let r=0,i,s,o;return a;function a(S){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,l,c)(S)}return c(S)}function l(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&k();const A=t.events.length;let T=A,C;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){C=t.events[T][1].end;break}v(r);let M=A;for(;M<t.events.length;)t.events[M][1].end={...C},M++;return yt(t.events,T+1,0,t.events.slice(A)),t.events.length=M,c(S)}return a(S)}function c(S){if(r===n.length){if(!i)return h(S);if(i.currentConstruct&&i.currentConstruct.concrete)return g(S);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gu,u,d)(S)}function u(S){return i&&k(),v(r),h(S)}function d(S){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(S)}function h(S){return t.containerState={},e.attempt(gu,m,g)(S)}function m(S){return r++,n.push([t.currentConstruct,t.containerState]),h(S)}function g(S){if(S===null){i&&k(),v(0),e.consume(S);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),p(S)}function p(S){if(S===null){b(e.exit("chunkFlow"),!0),v(0),e.consume(S);return}return he(S)?(e.consume(S),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(S),p)}function b(S,A){const T=t.sliceStream(S);if(A&&T.push(null),S.previous=s,s&&(s.next=S),s=S,i.defineSkip(S.start),i.write(T),t.parser.lazy[S.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<o&&(!i.events[C][1].end||i.events[C][1].end.offset>o))return;const M=t.events.length;let P=M,L,y;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(L){y=t.events[P][1].end;break}L=!0}for(v(r),C=M;C<t.events.length;)t.events[C][1].end={...y},C++;yt(t.events,P+1,0,t.events.slice(M)),t.events.length=C}}function v(S){let A=n.length;for(;A-- >S;){const T=n[A];t.containerState=T[1],T[0].exit.call(t,e)}n.length=S}function k(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function R2(e,t,n){return Ee(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Zn(e){if(e===null||Le(e)||vn(e))return 1;if(Bi(e))return 2}function zi(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const ws={name:"attention",resolveAll:V2,tokenize:D2};function V2(e,t){let n=-1,r,i,s,o,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};yu(d,-l),yu(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=wt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=wt(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=wt(c,zi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=wt(c,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=wt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,yt(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function D2(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Zn(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const c=e.exit("attentionSequence"),u=Zn(l),d=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?d:d&&(i||!h)),c._close=!!(s===42?h:h&&(u||!d)),t(l)}}function yu(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const F2={name:"autolink",tokenize:L2};function L2(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(m){return at(m)?(e.consume(m),o):m===64?n(m):c(m)}function o(m){return m===43||m===45||m===46||ot(m)?(r=1,a(m)):c(m)}function a(m){return m===58?(e.consume(m),r=0,l):(m===43||m===45||m===46||ot(m))&&r++<32?(e.consume(m),a):(r=0,c(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||ki(m)?n(m):(e.consume(m),l)}function c(m){return m===64?(e.consume(m),u):T2(m)?(e.consume(m),c):n(m)}function u(m){return ot(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,u):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):h(m)}function h(m){if((m===45||ot(m))&&r++<63){const g=m===45?h:d;return e.consume(m),g}return n(m)}}const Lr={partial:!0,tokenize:O2};function O2(e,t,n){return r;function r(s){return Se(s)?Ee(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||he(s)?t(s):n(s)}}const Rh={continuation:{tokenize:_2},exit:B2,name:"blockQuote",tokenize:$2};function $2(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return Se(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function _2(e,t,n){const r=this;return i;function i(o){return Se(o)?Ee(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(Rh,t,n)(o)}}function B2(e){e.exit("blockQuote")}const Vh={name:"characterEscape",tokenize:z2};function z2(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return j2(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Dh={name:"characterReference",tokenize:H2};function H2(e,t,n){const r=this;let i=0,s,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=ot,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=A2,u):(e.enter("characterReferenceValue"),s=7,o=vs,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return o===ot&&!Ma(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<s?(e.consume(d),u):n(d)}}const xu={partial:!0,tokenize:W2},bu={concrete:!0,name:"codeFenced",tokenize:U2};function U2(e,t,n){const r=this,i={partial:!0,tokenize:T};let s=0,o=0,a;return l;function l(C){return c(C)}function c(C){const M=r.events[r.events.length-1];return s=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,a=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(C)}function u(C){return C===a?(o++,e.consume(C),u):o<3?n(C):(e.exit("codeFencedFenceSequence"),Se(C)?Ee(e,d,"whitespace")(C):d(C))}function d(C){return C===null||he(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(xu,p,A)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||he(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):Se(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ee(e,m,"whitespace")(C)):C===96&&C===a?n(C):(e.consume(C),h)}function m(C){return C===null||he(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===null||he(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===a?n(C):(e.consume(C),g)}function p(C){return e.attempt(i,A,b)(C)}function b(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),v}function v(C){return s>0&&Se(C)?Ee(e,k,"linePrefix",s+1)(C):k(C)}function k(C){return C===null||he(C)?e.check(xu,p,A)(C):(e.enter("codeFlowValue"),S(C))}function S(C){return C===null||he(C)?(e.exit("codeFlowValue"),k(C)):(e.consume(C),S)}function A(C){return e.exit("codeFenced"),t(C)}function T(C,M,P){let L=0;return y;function y(K){return C.enter("lineEnding"),C.consume(K),C.exit("lineEnding"),N}function N(K){return C.enter("codeFencedFence"),Se(K)?Ee(C,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):D(K)}function D(K){return K===a?(C.enter("codeFencedFenceSequence"),B(K)):P(K)}function B(K){return K===a?(L++,C.consume(K),B):L>=o?(C.exit("codeFencedFenceSequence"),Se(K)?Ee(C,H,"whitespace")(K):H(K)):P(K)}function H(K){return K===null||he(K)?(C.exit("codeFencedFence"),M(K)):P(K)}}}function W2(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Eo={name:"codeIndented",tokenize:q2},Z2={partial:!0,tokenize:G2};function q2(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ee(e,s,"linePrefix",5)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):he(c)?e.attempt(Z2,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||he(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function G2(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):he(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Ee(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):he(o)?i(o):n(o)}}const K2={name:"codeText",previous:X2,resolve:Y2,tokenize:Q2};function Y2(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function X2(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Q2(e,t,n){let r=0,i,s;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(s=e.enter("codeTextSequence"),i=0,u(d)):he(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||he(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",c(d))}}class J2{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&ar(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ar(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ar(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ar(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ar(this.left,n.reverse())}}}function ar(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Fh(e){const t={};let n=-1,r,i,s,o,a,l,c;const u=new J2(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,ek(u,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=u.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return yt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function ek(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let u,d,h=-1,m=n,g=0,p=0;const b=[p];for(;m;){for(;e.get(++i)[1]!==m;);s.push(i),m._tokenizer||(u=r.sliceStream(m),m.next||u.push(null),d&&o.defineSkip(m.start),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(p=h+1,b.push(p),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(o.events=[],m?(m._tokenizer=void 0,m.previous=void 0):b.pop(),h=b.length;h--;){const v=a.slice(b[h],b[h+1]),k=s.pop();l.push([k,k+v.length-1]),e.splice(k,2,v)}for(l.reverse(),h=-1;++h<l.length;)c[g+l[h][0]]=g+l[h][1],g+=l[h][1]-l[h][0]-1;return c}const tk={resolve:rk,tokenize:ik},nk={partial:!0,tokenize:ok};function rk(e){return Fh(e),e}function ik(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):he(a)?e.check(nk,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function ok(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ee(e,s,"linePrefix")}function s(o){if(o===null||he(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Lh(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(v){return v===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(v),e.exit(s),h):v===null||v===32||v===41||ki(v)?n(v):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),p(v))}function h(v){return v===62?(e.enter(s),e.consume(v),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===62?(e.exit("chunkString"),e.exit(a),h(v)):v===null||v===60||he(v)?n(v):(e.consume(v),v===92?g:m)}function g(v){return v===60||v===62||v===92?(e.consume(v),m):m(v)}function p(v){return!u&&(v===null||v===41||Le(v))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(v)):u<c&&v===40?(e.consume(v),u++,p):v===41?(e.consume(v),u--,p):v===null||v===32||v===40||ki(v)?n(v):(e.consume(v),v===92?b:p)}function b(v){return v===40||v===41||v===92?(e.consume(v),p):p(v)}}function Oh(e,t,n,r,i,s){const o=this;let a=0,l;return c;function c(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(s),u}function u(m){return a>999||m===null||m===91||m===93&&!l||m===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(e.exit(s),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):he(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||he(m)||a++>999?(e.exit("chunkString"),u(m)):(e.consume(m),l||(l=!Se(m)),m===92?h:d)}function h(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}}function $h(e,t,n,r,i,s){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),c(h))}function c(h){return h===o?(e.exit(s),l(o)):h===null?n(h):he(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ee(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||he(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===o||h===92?(e.consume(h),u):u(h)}}function xr(e,t){let n;return r;function r(i){return he(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Se(i)?Ee(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const sk={name:"definition",tokenize:lk},ak={partial:!0,tokenize:ck};function lk(e,t,n){const r=this;let i;return s;function s(m){return e.enter("definition"),o(m)}function o(m){return Oh.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function a(m){return i=jt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):n(m)}function l(m){return Le(m)?xr(e,c)(m):c(m)}function c(m){return Lh(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function u(m){return e.attempt(ak,d,d)(m)}function d(m){return Se(m)?Ee(e,h,"whitespace")(m):h(m)}function h(m){return m===null||he(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function ck(e,t,n){return r;function r(a){return Le(a)?xr(e,i)(a):n(a)}function i(a){return $h(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return Se(a)?Ee(e,o,"whitespace")(a):o(a)}function o(a){return a===null||he(a)?t(a):n(a)}}const uk={name:"hardBreakEscape",tokenize:dk};function dk(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return he(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const fk={name:"headingAtx",resolve:hk,tokenize:mk};function hk(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},yt(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function mk(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||Le(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||he(u)?(e.exit("atxHeading"),t(u)):Se(u)?Ee(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Le(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const pk=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vu=["pre","script","style","textarea"],gk={concrete:!0,name:"htmlFlow",resolveTo:bk,tokenize:vk},yk={partial:!0,tokenize:kk},xk={partial:!0,tokenize:wk};function bk(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function vk(e,t,n){const r=this;let i,s,o,a,l;return c;function c(E){return u(E)}function u(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),d}function d(E){return E===33?(e.consume(E),h):E===47?(e.consume(E),s=!0,p):E===63?(e.consume(E),i=3,r.interrupt?t:w):at(E)?(e.consume(E),o=String.fromCharCode(E),b):n(E)}function h(E){return E===45?(e.consume(E),i=2,m):E===91?(e.consume(E),i=5,a=0,g):at(E)?(e.consume(E),i=4,r.interrupt?t:w):n(E)}function m(E){return E===45?(e.consume(E),r.interrupt?t:w):n(E)}function g(E){const U="CDATA[";return E===U.charCodeAt(a++)?(e.consume(E),a===U.length?r.interrupt?t:D:g):n(E)}function p(E){return at(E)?(e.consume(E),o=String.fromCharCode(E),b):n(E)}function b(E){if(E===null||E===47||E===62||Le(E)){const U=E===47,se=o.toLowerCase();return!U&&!s&&vu.includes(se)?(i=1,r.interrupt?t(E):D(E)):pk.includes(o.toLowerCase())?(i=6,U?(e.consume(E),v):r.interrupt?t(E):D(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):s?k(E):S(E))}return E===45||ot(E)?(e.consume(E),o+=String.fromCharCode(E),b):n(E)}function v(E){return E===62?(e.consume(E),r.interrupt?t:D):n(E)}function k(E){return Se(E)?(e.consume(E),k):y(E)}function S(E){return E===47?(e.consume(E),y):E===58||E===95||at(E)?(e.consume(E),A):Se(E)?(e.consume(E),S):y(E)}function A(E){return E===45||E===46||E===58||E===95||ot(E)?(e.consume(E),A):T(E)}function T(E){return E===61?(e.consume(E),C):Se(E)?(e.consume(E),T):S(E)}function C(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),l=E,M):Se(E)?(e.consume(E),C):P(E)}function M(E){return E===l?(e.consume(E),l=null,L):E===null||he(E)?n(E):(e.consume(E),M)}function P(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||Le(E)?T(E):(e.consume(E),P)}function L(E){return E===47||E===62||Se(E)?S(E):n(E)}function y(E){return E===62?(e.consume(E),N):n(E)}function N(E){return E===null||he(E)?D(E):Se(E)?(e.consume(E),N):n(E)}function D(E){return E===45&&i===2?(e.consume(E),de):E===60&&i===1?(e.consume(E),ie):E===62&&i===4?(e.consume(E),z):E===63&&i===3?(e.consume(E),w):E===93&&i===5?(e.consume(E),W):he(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(yk,oe,B)(E)):E===null||he(E)?(e.exit("htmlFlowData"),B(E)):(e.consume(E),D)}function B(E){return e.check(xk,H,oe)(E)}function H(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),K}function K(E){return E===null||he(E)?B(E):(e.enter("htmlFlowData"),D(E))}function de(E){return E===45?(e.consume(E),w):D(E)}function ie(E){return E===47?(e.consume(E),o="",F):D(E)}function F(E){if(E===62){const U=o.toLowerCase();return vu.includes(U)?(e.consume(E),z):D(E)}return at(E)&&o.length<8?(e.consume(E),o+=String.fromCharCode(E),F):D(E)}function W(E){return E===93?(e.consume(E),w):D(E)}function w(E){return E===62?(e.consume(E),z):E===45&&i===2?(e.consume(E),w):D(E)}function z(E){return E===null||he(E)?(e.exit("htmlFlowData"),oe(E)):(e.consume(E),z)}function oe(E){return e.exit("htmlFlow"),t(E)}}function wk(e,t,n){const r=this;return i;function i(o){return he(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function kk(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Lr,t,n)}}const Sk={name:"htmlText",tokenize:Ck};function Ck(e,t,n){const r=this;let i,s,o;return a;function a(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),l}function l(w){return w===33?(e.consume(w),c):w===47?(e.consume(w),T):w===63?(e.consume(w),S):at(w)?(e.consume(w),P):n(w)}function c(w){return w===45?(e.consume(w),u):w===91?(e.consume(w),s=0,g):at(w)?(e.consume(w),k):n(w)}function u(w){return w===45?(e.consume(w),m):n(w)}function d(w){return w===null?n(w):w===45?(e.consume(w),h):he(w)?(o=d,ie(w)):(e.consume(w),d)}function h(w){return w===45?(e.consume(w),m):d(w)}function m(w){return w===62?de(w):w===45?h(w):d(w)}function g(w){const z="CDATA[";return w===z.charCodeAt(s++)?(e.consume(w),s===z.length?p:g):n(w)}function p(w){return w===null?n(w):w===93?(e.consume(w),b):he(w)?(o=p,ie(w)):(e.consume(w),p)}function b(w){return w===93?(e.consume(w),v):p(w)}function v(w){return w===62?de(w):w===93?(e.consume(w),v):p(w)}function k(w){return w===null||w===62?de(w):he(w)?(o=k,ie(w)):(e.consume(w),k)}function S(w){return w===null?n(w):w===63?(e.consume(w),A):he(w)?(o=S,ie(w)):(e.consume(w),S)}function A(w){return w===62?de(w):S(w)}function T(w){return at(w)?(e.consume(w),C):n(w)}function C(w){return w===45||ot(w)?(e.consume(w),C):M(w)}function M(w){return he(w)?(o=M,ie(w)):Se(w)?(e.consume(w),M):de(w)}function P(w){return w===45||ot(w)?(e.consume(w),P):w===47||w===62||Le(w)?L(w):n(w)}function L(w){return w===47?(e.consume(w),de):w===58||w===95||at(w)?(e.consume(w),y):he(w)?(o=L,ie(w)):Se(w)?(e.consume(w),L):de(w)}function y(w){return w===45||w===46||w===58||w===95||ot(w)?(e.consume(w),y):N(w)}function N(w){return w===61?(e.consume(w),D):he(w)?(o=N,ie(w)):Se(w)?(e.consume(w),N):L(w)}function D(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),i=w,B):he(w)?(o=D,ie(w)):Se(w)?(e.consume(w),D):(e.consume(w),H)}function B(w){return w===i?(e.consume(w),i=void 0,K):w===null?n(w):he(w)?(o=B,ie(w)):(e.consume(w),B)}function H(w){return w===null||w===34||w===39||w===60||w===61||w===96?n(w):w===47||w===62||Le(w)?L(w):(e.consume(w),H)}function K(w){return w===47||w===62||Le(w)?L(w):n(w)}function de(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):n(w)}function ie(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),F}function F(w){return Se(w)?Ee(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):W(w)}function W(w){return e.enter("htmlTextData"),o(w)}}const Ia={name:"labelEnd",resolveAll:jk,resolveTo:Pk,tokenize:Nk},Ek={tokenize:Mk},Tk={tokenize:Ik},Ak={tokenize:Rk};function jk(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&yt(e,0,e.length,n),e}function Pk(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=wt(a,e.slice(s+1,s+r+3)),a=wt(a,[["enter",u,t]]),a=wt(a,zi(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=wt(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=wt(a,e.slice(o+1)),a=wt(a,[["exit",l,t]]),yt(e,s,e.length,a),e}function Nk(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(h){return s?s._inactive?d(h):(o=r.parser.defined.includes(jt(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(Ek,u,o?u:d)(h):h===91?e.attempt(Tk,u,o?c:d)(h):o?u(h):d(h)}function c(h){return e.attempt(Ak,u,d)(h)}function u(h){return t(h)}function d(h){return s._balanced=!0,n(h)}}function Mk(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Le(d)?xr(e,s)(d):s(d)}function s(d){return d===41?u(d):Lh(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return Le(d)?xr(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?$h(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Le(d)?xr(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function Ik(e,t,n){const r=this;return i;function i(a){return Oh.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(jt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function Rk(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const Vk={name:"labelStartImage",resolveAll:Ia.resolveAll,tokenize:Dk};function Dk(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Fk={name:"labelStartLink",resolveAll:Ia.resolveAll,tokenize:Lk};function Lk(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const To={name:"lineEnding",tokenize:Ok};function Ok(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ee(e,t,"linePrefix")}}const li={name:"thematicBreak",tokenize:$k};function $k(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||he(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Se(c)?Ee(e,a,"whitespace")(c):a(c))}}const ct={continuation:{tokenize:Hk},exit:Wk,name:"list",tokenize:zk},_k={partial:!0,tokenize:Zk},Bk={partial:!0,tokenize:Uk};function zk(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:vs(m)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(li,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return n(m)}function l(m){return vs(m)&&++o<10?(e.consume(m),l):(!r.interrupt||o<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Lr,r.interrupt?n:u,e.attempt(_k,h,d))}function u(m){return r.containerState.initialBlankLine=!0,s++,h(m)}function d(m){return Se(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function Hk(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Lr,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ee(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!Se(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Bk,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ee(e,e.attempt(ct,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Uk(e,t,n){const r=this;return Ee(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function Wk(e){e.exit(this.containerState.type)}function Zk(e,t,n){const r=this;return Ee(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!Se(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const wu={name:"setextUnderline",resolveTo:qk,tokenize:Gk};function qk(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Gk(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Se(c)?Ee(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||he(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Kk={tokenize:Yk};function Yk(e){const t=this,n=e.attempt(Lr,r,e.attempt(this.parser.constructs.flowInitial,i,Ee(e,e.attempt(this.parser.constructs.flow,i,e.attempt(tk,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Xk={resolveAll:Bh()},Qk=_h("string"),Jk=_h("text");function _h(e){return{resolveAll:Bh(e==="text"?eS:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(u){return c(u)?s(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const m=d[h];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function Bh(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function eS(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const tS={42:ct,43:ct,45:ct,48:ct,49:ct,50:ct,51:ct,52:ct,53:ct,54:ct,55:ct,56:ct,57:ct,62:Rh},nS={91:sk},rS={[-2]:Eo,[-1]:Eo,32:Eo},iS={35:fk,42:li,45:[wu,li],60:gk,61:wu,95:li,96:bu,126:bu},oS={38:Dh,92:Vh},sS={[-5]:To,[-4]:To,[-3]:To,33:Vk,38:Dh,42:ws,60:[F2,Sk],91:Fk,92:[uk,Vh],93:Ia,95:ws,96:K2},aS={null:[ws,Xk]},lS={null:[42,95]},cS={null:[]},uS=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:lS,contentInitial:nS,disable:cS,document:tS,flow:iS,flowInitial:rS,insideSpan:aS,string:oS,text:sS},Symbol.toStringTag,{value:"Module"}));function dS(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const l={attempt:M(T),check:M(C),consume:k,enter:S,exit:A,interrupt:M(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:p,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:m,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function d(N){return o=wt(o,N),b(),o[o.length-1]!==null?[]:(P(t,0),c.events=zi(s,c.events,c),c.events)}function h(N,D){return hS(m(N),D)}function m(N){return fS(o,N)}function g(){const{_bufferIndex:N,_index:D,line:B,column:H,offset:K}=r;return{_bufferIndex:N,_index:D,line:B,column:H,offset:K}}function p(N){i[N.line]=N.column,y()}function b(){let N;for(;r._index<o.length;){const D=o[r._index];if(typeof D=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<D.length;)v(D.charCodeAt(r._bufferIndex));else v(D)}}function v(N){u=u(N)}function k(N){he(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,y()):N!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=N}function S(N,D){const B=D||{};return B.type=N,B.start=g(),c.events.push(["enter",B,c]),a.push(B),B}function A(N){const D=a.pop();return D.end=g(),c.events.push(["exit",D,c]),D}function T(N,D){P(N,D.from)}function C(N,D){D.restore()}function M(N,D){return B;function B(H,K,de){let ie,F,W,w;return Array.isArray(H)?oe(H):"tokenize"in H?oe([H]):z(H);function z($){return ee;function ee(Q){const V=Q!==null&&$[Q],X=Q!==null&&$.null,fe=[...Array.isArray(V)?V:V?[V]:[],...Array.isArray(X)?X:X?[X]:[]];return oe(fe)(Q)}}function oe($){return ie=$,F=0,$.length===0?de:E($[F])}function E($){return ee;function ee(Q){return w=L(),W=$,$.partial||(c.currentConstruct=$),$.name&&c.parser.constructs.disable.null.includes($.name)?se():$.tokenize.call(D?Object.assign(Object.create(c),D):c,l,U,se)(Q)}}function U($){return N(W,w),K}function se($){return w.restore(),++F<ie.length?E(ie[F]):de}}}function P(N,D){N.resolveAll&&!s.includes(N)&&s.push(N),N.resolve&&yt(c.events,D,c.events.length-D,N.resolve(c.events.slice(D),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function L(){const N=g(),D=c.previous,B=c.currentConstruct,H=c.events.length,K=Array.from(a);return{from:H,restore:de};function de(){r=N,c.previous=D,c.currentConstruct=B,c.events.length=H,a=K,y()}}function y(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function fS(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function hS(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
107
+ `,style:{wordWrap:"break-word",overflowWrap:"break-word"},children:[f.jsx("div",{className:"whitespace-pre-wrap break-words leading-relaxed text-sm",children:r&&!n?f.jsx(Kw,{text:e.content,isComplete:!r,isRealTimeStream:((l=e.metadata)==null?void 0:l.streaming)===!0,speed:35}):e.content}),f.jsx("div",{className:"text-xs mt-1",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}const Mh=j.forwardRef(({disabled:e,capabilities:t,sessionStarted:n,participantName:r="User",loadingText:i="Waiting for agent to connect...",theme:s="vox",client:o,displayType:a="widget",onBack:l},c)=>{var Z,pe,Ae,xe,Ne,ze,He,rt,Gt,Lt,_;const[u,d]=j.useState(!1),[h,m]=j.useState(!1),[g,p]=j.useState(!1),[b,v]=j.useState(()=>{var q;return((q=o==null?void 0:o.getCurrentInteraction)==null?void 0:q.call(o))||null}),[k,S]=j.useState(()=>o&&typeof o.getChatMessages=="function"?o.getChatMessages():[]),[A,T]=j.useState(()=>{const I=n;return console.log("🚀 SessionView: Initial loading state calculation:",{sessionStarted:n,shouldShowLoading:I}),I}),[C,N]=j.useState(!0),[P,L]=j.useState(new Set),[y,M]=j.useState([]),D=j.useRef(null),B=j.useRef(null),[H,Y]=j.useState(!0),de=j.useRef(null),ie=j.useRef(null),F=j.useMemo(()=>Math.random().toString(36).substr(2,9),[]);console.log(`🚀 SessionView-${F}: Component initialized with:`,{initialMessagesCount:k.length,clientExists:!!o,sessionStarted:n,agentConnected:g,isLoading:A,displayType:a,disabled:e});const W=(Z=o==null?void 0:o.getCurrentAgentInfo)==null?void 0:Z.call(o),z=((W==null?void 0:W.name)||"AI Assistant").split(" ").map(I=>I[0]).join("").toUpperCase().slice(0,2),oe=j.useCallback(()=>{if(B.current){const{scrollTop:I,scrollHeight:q,clientHeight:ue}=B.current;return q-I-ue<100}return!0},[]),E=j.useCallback(()=>{const I=oe();Y(I)},[oe]),U=j.useCallback((I=!1)=>{if(H&&B.current){const q=B.current;I?q.scrollTop=q.scrollHeight:q.scrollTo({top:q.scrollHeight,behavior:"smooth"})}},[H]);j.useEffect(()=>{if(!o)return;const I=J=>{var ke,K,be,Ce,je;if(console.log(`SessionView-${F}: Received message:`,J),console.log(`SessionView-${F}: Message sender details:`,{senderId:(ke=J.sender)==null?void 0:ke.id,senderName:(K=J.sender)==null?void 0:K.name,senderType:(be=J.sender)==null?void 0:be.type,content:J.content,messageId:J.id,topic:(Ce=J.metadata)==null?void 0:Ce.topic,isTranscription:((je=J.metadata)==null?void 0:je.topic)==="lk.transcription"}),T(!1),b&&J.sender.type==="agent"){console.log("SessionView: Queuing agent message due to active interaction:",b.methodName),M($e=>[...$e,J]);return}J.sender.type==="agent"&&N(!1),S($e=>{var mt;if($e.some(cn=>cn.id===J.id))return console.log("SessionView: Message already exists, skipping:",J.id),$e;if(console.log(`SessionView-${F}: Adding new message:`,J.id),J.sender.type==="agent"&&(L(cn=>new Set(cn).add(J.id)),!((mt=J.metadata)!=null&&mt.streaming))){const cn=J.content.length*35+1e3;setTimeout(()=>{L(Jm=>{const rl=new Set(Jm);return rl.delete(J.id),rl})},cn)}return[...$e,J]}),setTimeout(()=>{H&&U(!0)},0)},q=J=>{var ke;if(console.log("SessionView: Updated message:",J),b&&J.sender.type==="agent"){console.log("SessionView: Queuing agent message update due to active interaction:",b.methodName),M(K=>{const be=K.findIndex(Ce=>Ce.id===J.id);if(be>=0){const Ce=[...K];return Ce[be]=J,Ce}else return[...K,J]});return}S(K=>K.map(be=>be.id===J.id?{...J}:be)),setTimeout(()=>{H&&U(!0)},0),(ke=J.metadata)!=null&&ke.streaming||L(K=>{const be=new Set(K);return be.delete(J.id),be})},ue=J=>{var ke,K,be,Ce,je,$e;if(console.log(`SessionView-${F}: Sent message:`,J),console.log(`SessionView-${F}: Sent message details:`,{senderId:(ke=J.sender)==null?void 0:ke.id,senderName:(K=J.sender)==null?void 0:K.name,senderType:(be=J.sender)==null?void 0:be.type,content:J.content,messageId:J.id,topic:(Ce=J.metadata)==null?void 0:Ce.topic,isTranscription:((je=J.metadata)==null?void 0:je.topic)==="lk.transcription"}),T(!1),(($e=J.metadata)==null?void 0:$e.topic)==="lk.transcription"){console.log(`SessionView-${F}: Skipping sent transcription message (will come through received):`,J.id);return}S(Tt=>Tt.some(cn=>cn.id===J.id)?(console.log("SessionView: Sent message already exists, skipping:",J.id),Tt):(console.log("SessionView: Adding sent message:",J.id),[...Tt,J])),setTimeout(()=>{H&&U(!0)},0)};return o.on("chat.message.received",I),o.on("chat.message.updated",q),o.on("chat.message.sent",ue),()=>{o.off("chat.message.received",I),o.off("chat.message.updated",q),o.off("chat.message.sent",ue)}},[o,b,H,U]),j.useEffect(()=>{if(!o)return;const I=()=>{if(console.log("SessionView: Agent is thinking"),b){console.log("SessionView: Suppressing thinking indicator due to active interaction:",b.methodName);return}N(!0)},q=()=>{console.log("SessionView: Agent is speaking"),N(!1)};return o.on("agent.thinking",I),o.on("agent.speaking",q),()=>{o.off("agent.thinking",I),o.off("agent.speaking",q)}},[o,b]),j.useEffect(()=>{console.log("🎬 SessionView: Messages state updated:",{messageCount:k.length,messages:k.map(I=>{var q,ue;return{id:I.id,text:((q=I.content)==null?void 0:q.substring(0,50))+"...",from:(ue=I.sender)==null?void 0:ue.id}})})},[k]),j.useEffect(()=>{const I=k.filter(q=>q.content&&q.content.trim()!==""&&q.content.trim()!=="...");k.length===0?console.log("📝 SessionView: Showing empty state - no messages available"):I.length===0?console.log("📝 SessionView: Showing empty state - no messages with content available",{totalMessages:k.length,messagesWithContent:I.length}):console.log("📝 SessionView: Showing messages",{totalMessages:k.length,messagesWithContent:I.length})},[k]);const{agent:{isActive:se=!1}={}}=o?lh(o):{agent:{isActive:!1}},$=tt(s),ee=j.useMemo(()=>o&&typeof o.getCurrentSession=="function"?!!o.getCurrentSession():!1,[o]),Q=j.useMemo(()=>o&&typeof o.getIsAgentConnected=="function"&&o.getIsAgentConnected()||g,[o,g]),V=se||Q;j.useEffect(()=>{var I,q;console.log("🤖 SessionView agent state:",{isAgentActive:se,hasActiveSession:ee,isAgentActuallyConnected:Q,effectiveAgentActive:V,sessionStarted:n,clientSession:(q=(I=o==null?void 0:o.getCurrentSession)==null?void 0:I.call(o))==null?void 0:q.id,isLoading:A}),V&&A&&(console.log("✅ SessionView: Agent became active, stopping loading state"),T(!1))},[se,ee,Q,V,n,o,A]),j.useEffect(()=>{se&&console.log("🤖 Agent became active")},[se]),j.useEffect(()=>{console.log("📋 Session state changed:",{sessionStarted:n,disabled:e,participantName:r,effectiveAgentActive:V,chatOpen:u,currentInteraction:(b==null?void 0:b.methodName)||"none"})},[n,e,r,V,u,b]),j.useEffect(()=>{if(n&&!V){console.log("⏰ Starting agent timeout detection...");const I=setTimeout(()=>{ee&&!V&&(console.log("⚡ Fallback: Assuming agent is connected after 5 seconds with active session"),p(!0),m(!1))},5e3),q=setTimeout(()=>{V||(console.log("⚠️ Agent timeout: Agent did not become active within 30 seconds"),m(!0))},3e4);return()=>{clearTimeout(I),clearTimeout(q)}}else V&&(console.log("✅ Agent is active, clearing timeout"),m(!1))},[n,V,ee]),j.useEffect(()=>{if(!o)return;const I=()=>{console.log("🔄 Client connection state changed:",o.connected)},q=ue=>{console.log("🔴 Client disconnected:",ue),v(null),d(!1),m(!1)};return o.on("connection.connected",I),o.on("connection.disconnected",q),()=>{o.off("connection.connected",I),o.off("connection.disconnected",q)}},[o]),j.useEffect(()=>{if(!o)return;const I=ke=>{console.log("🤖 SessionView: Agent connected!",ke),p(!0),m(!1),T(!1)},q=ke=>{console.log("🗣️ SessionView: Agent speaking detected!",ke),g||(p(!0),m(!1),T(!1))},ue=ke=>{console.log("🤔 SessionView: Agent thinking detected!",ke),g||(p(!0),m(!1),T(!1))},J=()=>{console.log("🤖 SessionView: Agent disconnected"),p(!1),T(!0)};return o.on("agent.connected",I),o.on("agent.speaking",q),o.on("agent.thinking",ue),o.on("connection.disconnected",J),()=>{o.off("agent.connected",I),o.off("agent.speaking",q),o.off("agent.thinking",ue),o.off("connection.disconnected",J)}},[o,g]),j.useEffect(()=>{if(!o)return;const I=ke=>{console.log("🎯 SessionView: RPC Interaction started:",ke);const K=o.getCurrentInteraction();K&&(console.log("📱 SessionView: Setting current interaction:",K.methodName,"mode:",K.presentationMode),v(K))},q=ke=>{console.log("✅ SessionView: RPC Interaction completed:",ke),v(null)},ue=async ke=>{console.log("⏰ SessionView: RPC Interaction timeout:",ke),v(null)},J=async ke=>{console.log("❌ SessionView: RPC Interaction dismissed:",ke),v(null)};return o.on("rpc.interaction.started",I),o.on("rpc.interaction.completed",q),o.on("rpc.interaction.timeout",ue),o.on("rpc.interaction.dismissed",J),()=>{o.off("rpc.interaction.started",I),o.off("rpc.interaction.completed",q),o.off("rpc.interaction.timeout",ue),o.off("rpc.interaction.dismissed",J)}},[o]),j.useEffect(()=>{if(!o)return;const I=o.getCurrentInteraction();I?(console.log("🔄 SessionView: Syncing with existing interaction:",I.methodName),v(I)):v(null)},[o]),j.useEffect(()=>{b!=null&&b.methodName&&console.log("🎭 SessionView: Interactive UI started:",b.methodName)},[b==null?void 0:b.methodName]),j.useEffect(()=>{a==="fullscreen"&&console.log("📱 SessionView: Switched to fullscreen mode")},[a]),j.useEffect(()=>{b&&u&&(console.log("🎭 SessionView: Interactive UI appeared, closing chat"),d(!1))},[b,u]),hb(),j.useEffect(()=>{de.current&&u&&k.length>0&&(console.log("📜 SessionView: Auto-scrolling to latest message, count:",k.length),setTimeout(()=>{H&&U(!0)},100))},[k.length,u,H,U]),j.useEffect(()=>{k.length>0&&k.length%5===0&&console.log("📝 SessionView: Messages count:",k.length)},[k.length]);async function G(I){var q,ue;try{b&&(console.log("SessionView: Dismissing active interaction due to user message send"),(q=o==null?void 0:o.dismissCurrentInteraction)==null||q.call(o),v(null)),await((ue=o==null?void 0:o.sendChatMessage)==null?void 0:ue.call(o,I))}catch(J){console.error("Failed to send message:",J)}}const fe=j.useCallback(I=>{console.log("📝 SessionView: Adding local message for voice session context:",I)},[]),R=j.useCallback(async I=>{try{o&&typeof o.sendAttachments=="function"&&(await o.sendAttachments(I),console.log("📎 SessionView: Attachments sent successfully:",I.map(q=>q.name)))}catch(q){console.error("❌ SessionView: Failed to send attachments:",q)}},[o]),re=j.useCallback(()=>{try{console.log("📞 SessionView: Ending call..."),console.log("📞 SessionView: Current state before ending:",{sessionStarted:n,effectiveAgentActive:V,chatOpen:u,currentInteraction:b==null?void 0:b.methodName,hasOnBack:!!l}),b&&(console.log("🎭 SessionView: Dismissing current interaction:",b.methodName),v(null),o&&typeof o.dismissCurrentInteraction=="function"&&o.dismissCurrentInteraction()),d(!1),m(!1),console.log("✅ SessionView: Local state reset"),o&&typeof o.endSession=="function"&&(o.endSession(),console.log("✅ SessionView: Session ended via client.endSession()")),o&&typeof o.disconnect=="function"&&(o.disconnect(),console.log("✅ SessionView: Client disconnected")),l?(console.log("🔄 SessionView: Calling onBack to return to welcome..."),l(),console.log("✅ SessionView: onBack called")):console.warn("⚠️ SessionView: No onBack function provided - cannot return to welcome"),console.log("🏁 SessionView: Call ended and cleanup completed")}catch(I){console.error("❌ SessionView: Failed to end call:",I),v(null),d(!1),m(!1),l&&(console.log("🔄 SessionView: Error occurred, still calling onBack..."),l())}},[o,l,b,n,V,u]);j.useEffect(()=>(n||console.log("🔄 SessionView: Session ended, component will unmount"),()=>{n||console.log("🧹 SessionView: Component unmounted")}),[n]),j.useEffect(()=>{var q,ue;const I=((ue=(q=o==null?void 0:o.getCurrentSession)==null?void 0:q.call(o))==null?void 0:ue.id)||null;ie.current&&!I&&console.warn("⚠️ SessionView: Session was lost unexpectedly!",{previousSession:ie.current,currentSession:I,displayType:a,sessionStarted:n,effectiveAgentActive:V}),ie.current=I},[o,a,n,V]);const ne=ce("w-full flex flex-col items-center justify-center",a==="fullscreen"?"w-full max-w-none mx-0 h-full":"w-full mx-auto",$.main,a==="fullscreen"?"max-w-none":"","overflow-hidden","h-full"),me=l&&(a==="popup"||a==="fullscreen");return A?f.jsx("main",{ref:c,className:ce(ne,"relative",e&&"pointer-events-none opacity-50"),children:me&&f.jsx("div",{className:`flex items-center justify-between w-full p-4 border-b ${((pe=$.chatHeader)==null?void 0:pe.container)||"border-gray-200"}`,children:f.jsx("div",{className:"flex items-center",children:f.jsxs("div",{children:[f.jsx("h3",{className:`font-semibold ${$.text.primary}`,children:"Voice Session"}),f.jsx("p",{className:`text-sm ${$.text.muted}`,children:r})]})})})}):f.jsxs("main",{ref:c,className:ce(ne,"relative",e&&"pointer-events-none opacity-50"),style:{minHeight:0},children:[me&&f.jsx("div",{className:`flex items-center justify-between w-full p-4 border-b ${((Ae=$.chatHeader)==null?void 0:Ae.container)||"border-gray-200"}`,children:f.jsx("div",{className:"flex items-center",children:f.jsxs("div",{children:[f.jsx("h3",{className:`font-semibold ${$.text.primary}`,children:"Voice Session"}),f.jsx("p",{className:`text-sm ${$.text.muted}`,children:r})]})})}),f.jsxs("div",{className:"w-full flex-1 flex flex-col items-center px-0 min-h-0 overflow-hidden",children:[!V&&f.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full min-h-[180px]",children:[f.jsx(ge.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:f.jsx(xa,{className:$.spinner,weight:"bold"})}),f.jsx(ge.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-sm opacity-80 ${$.text.muted} text-center max-w-xs`,children:h?"Agent is taking longer than expected...":i}),f.jsx(ge.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${$.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&&l&&f.jsx(ge.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:l,className:`mt-4 px-4 py-2 rounded-lg ${((xe=$.chatHeader)==null?void 0:xe.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]}),V&&f.jsxs(f.Fragment,{children:[u&&f.jsxs("div",{className:ce("absolute inset-0 w-full h-full flex flex-col transition-[opacity,translate] duration-300 ease-out z-10",s==="light"?"bg-white":"bg-gray-900/95 backdrop-blur-sm",u?"translate-y-0 opacity-100 delay-200":"translate-y-10 opacity-0"),children:[f.jsxs("div",{className:ce("flex-shrink-0 px-4 py-3 border-b",a==="fullscreen"?"px-8":"px-5",((Ne=$.chatHeader)==null?void 0:Ne.container)||"border-gray-200 dark:border-gray-700"),children:[f.jsx("h3",{className:ce("font-semibold text-lg",((ze=$.text)==null?void 0:ze.primary)||"text-gray-900 dark:text-white"),children:"Transcription & Chat"}),f.jsxs("p",{className:ce("text-sm",((He=$.text)==null?void 0:He.muted)||"text-gray-600 dark:text-gray-400"),children:[k.length," messages"]})]}),f.jsx("div",{className:ce("flex-1 flex flex-col min-h-0",a==="fullscreen"?"px-8":"px-5"),children:f.jsxs("div",{ref:B,className:`flex-1 flex flex-col h-full ${ce("overflow-y-auto scrollbar-hide py-4")}`,style:{scrollbarWidth:"none",scrollBehavior:"smooth",paddingBottom:"120px"},onScroll:E,children:[k.filter(I=>I.content&&I.content.trim()!==""&&I.content.trim()!=="...").length===0&&f.jsx("div",{className:"flex-1 flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx(ge.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 mx-auto",children:z}),f.jsx("p",{className:ce("text-lg font-medium mb-2",((rt=$.text)==null?void 0:rt.primary)||"text-gray-900 dark:text-white"),children:"Start Speaking"}),f.jsx("p",{className:ce("text-sm",((Gt=$.text)==null?void 0:Gt.muted)||"text-gray-600 dark:text-gray-400"),children:"Your conversation will appear here"})]})}),k.length>0&&f.jsx("div",{className:"w-full max-w-5xl mx-auto space-y-3 py-4 flex-1 flex flex-col justify-end",children:f.jsxs("div",{className:"space-y-3",children:[f.jsx(en,{mode:"popLayout",children:k.filter(I=>I.content&&I.content.trim()!==""&&I.content.trim()!=="...").map((I,q)=>f.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3,ease:"easeOut",delay:q*.02},layout:!0,children:f.jsx(Yw,{message:I,theme:s,isOwn:I.sender.type==="participant",isStreaming:P.has(I.id)})},I.id||`message-${q}`))}),C&&!b&&f.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:k.length*.1},className:"flex w-full justify-start mb-4 px-1",children:f.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[f.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 ${s==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:z}),f.jsx("div",{className:"relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-white rounded-bl-md transition-all duration-200 group-hover:scale-[1.02]",style:{wordWrap:"break-word",overflowWrap:"break-word",minWidth:48},children:f.jsx("span",{className:"inline-flex items-center",children:[0,1,2].map(I=>f.jsx(ge.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:I*.2,ease:"easeInOut"}},I))})})]})}),f.jsx("div",{ref:D})]})})]})}),!H&&f.jsx(ge.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onClick:()=>{Y(!0),U(!1)},className:`absolute right-6 bottom-20 z-10 p-3 rounded-full shadow-lg backdrop-blur-sm border transition-all duration-200 hover:scale-105 ${s==="light"?"bg-white/90 text-gray-600 border-gray-200 hover:bg-white hover:text-gray-800":"bg-gray-800/90 text-gray-300 border-gray-700 hover:bg-gray-700 hover:text-white"}`,"aria-label":"Scroll to bottom",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})})]}),!u&&f.jsxs("div",{className:ce("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:[f.jsx(ge.div,{className:"w-full flex justify-center",animate:{y:(b==null?void 0:b.presentationMode)==="embedded"?-8:0},transition:{duration:.3,ease:"easeOut"},children:f.jsx(fb,{chatOpen:u,client:o},`media-tiles-${((_=(Lt=o==null?void 0:o.getCurrentSession)==null?void 0:Lt.call(o))==null?void 0:_.id)||"no-session"}`)}),f.jsx(en,{mode:"wait",children:b&&b.presentationMode==="embedded"&&f.jsx(ge.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:ce("w-full relative mt-4 flex justify-center",a==="fullscreen"?"max-w-4xl":"max-w-md"),children:f.jsx("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl border border-white/20 shadow-lg overflow-hidden",children:f.jsx(Pr,{interaction:b,theme:s,onDismiss:()=>{var I;return(I=o==null?void 0:o.dismissCurrentInteraction)==null?void 0:I.call(o)},client:o,addLocalMessage:fe})})},`embedded-${b.methodName}`)})]})]})]}),f.jsx(en,{mode:"wait",children:b&&b.presentationMode!=="embedded"&&!u&&f.jsx("div",{className:ce("absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm",a==="fullscreen"?"bg-black/70":"bg-black/50"),children:f.jsx(ge.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},className:ce("relative w-full overflow-hidden",a==="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:f.jsx(Pr,{interaction:b,theme:s,onDismiss:()=>{var I;return(I=o==null?void 0:o.dismissCurrentInteraction)==null?void 0:I.call(o)},client:o,addLocalMessage:fe})},`modal-${b.methodName}`)})}),f.jsx(ge.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:f.jsx(Xw,{capabilities:t,onSendMessage:G,onSendAttachments:R,onEndCall:re,onChatOpenChange:d,disabled:e,theme:s,client:o,sessionStarted:n})})]})});Mh.displayName="SessionView";function Xw({capabilities:e,onSendMessage:t,onSendAttachments:n,onEndCall:r,onChatOpenChange:i,disabled:s=!1,theme:o,client:a,sessionStarted:l=!1}){const[c,u]=j.useState(!1),d=j.useRef(null),h=j.useRef(null);j.useEffect(()=>{const k=()=>{const S=rh().toLowerCase(),T=["android","iphone","ipad","mobile","tablet"].some(L=>S.includes(L)),C=ih(),{width:N}=oh(),P=N<=768;u(T||C&&P)};return k(),wa(zt,"resize",k),()=>ka(zt,"resize",k)},[]);const m=k=>{const S=k.target.files;if(S&&S.length>0){const T=Array.from(S).filter(C=>C.type.startsWith("image/"));if(T.length===0){console.warn("No valid image files selected");return}n&&n(T),d.current&&(d.current.value="")}},g=k=>{const S=k.target.files;if(S&&S.length>0){const A=S[0];A.type.startsWith("image/")&&n&&n([A]),h.current&&(h.current.value="")}},p=()=>{!s&&d.current&&d.current.click()},b=()=>{!s&&c&&h.current&&h.current.click()},v=()=>{console.log("🔴 VoiceControlPanel: End call button clicked"),console.log("🔴 VoiceControlPanel: Current state:",{disabled:s,sessionStarted:l,hasOnEndCall:!!r}),r?r():console.warn("⚠️ VoiceControlPanel: No onEndCall function provided")};return f.jsx("div",{className:ce("px-3 py-2 !w-full backdrop-blur-xl border-0 shadow-lg",o==="light"?"bg-white/95 border-t border-gray-200":"bg-gray-900/95 border-t border-gray-700"),children:f.jsxs("div",{className:"flex items-center justify-between !w-full mx-auto max-w-4xl",children:[f.jsx("input",{ref:d,type:"file",multiple:!0,onChange:m,className:"hidden",accept:"image/*"}),f.jsx("input",{ref:h,type:"file",onChange:g,className:"hidden",accept:"image/*",capture:"environment"}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{onClick:p,disabled:s,className:ce("p-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",s?"opacity-50 cursor-not-allowed":"hover:shadow-md",o==="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:f.jsx(Zw,{className:"w-4 h-4"})}),c&&f.jsx("button",{onClick:b,disabled:s,className:ce("p-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",s?"opacity-50 cursor-not-allowed":"hover:shadow-md",o==="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:f.jsx(Gw,{className:"w-4 h-4"})})]}),f.jsx("div",{className:"flex-1 flex justify-center px-2",children:f.jsx(ob,{capabilities:e,onChatOpenChange:i,onSendMessage:t,theme:o,client:a,className:"border-none py-0 rounded-xl max-w-md w-full"})}),f.jsx("div",{className:"flex items-center",children:f.jsx("button",{onClick:v,disabled:s||!l,className:ce("p-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95",s||!l?"opacity-50 cursor-not-allowed":"hover:shadow-md","bg-red-500 hover:bg-red-600 text-white"),title:"End call",children:f.jsx(qw,{className:"w-4 h-4"})})})]})})}function Qw(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Jw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,e2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,t2={};function fu(e,t){return(t2.jsx?e2:Jw).test(e)}const n2=/[ \t\n\f\r]/g;function r2(e){return typeof e=="object"?e.type==="text"?hu(e.value):!1:hu(e)}function hu(e){return e.replace(n2,"")===""}class $r{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}$r.prototype.normal={};$r.prototype.property={};$r.prototype.space=void 0;function Nh(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new $r(n,r,t)}function ws(e){return e.toLowerCase()}class ht{constructor(t,n){this.attribute=n,this.property=t}}ht.prototype.attribute="";ht.prototype.booleanish=!1;ht.prototype.boolean=!1;ht.prototype.commaOrSpaceSeparated=!1;ht.prototype.commaSeparated=!1;ht.prototype.defined=!1;ht.prototype.mustUseProperty=!1;ht.prototype.number=!1;ht.prototype.overloadedBoolean=!1;ht.prototype.property="";ht.prototype.spaceSeparated=!1;ht.prototype.space=void 0;let i2=0;const ve=Sn(),Je=Sn(),ks=Sn(),X=Sn(),Oe=Sn(),Wn=Sn(),pt=Sn();function Sn(){return 2**++i2}const Ss=Object.freeze(Object.defineProperty({__proto__:null,boolean:ve,booleanish:Je,commaOrSpaceSeparated:pt,commaSeparated:Wn,number:X,overloadedBoolean:ks,spaceSeparated:Oe},Symbol.toStringTag,{value:"Module"})),Ao=Object.keys(Ss);class Ia extends ht{constructor(t,n,r,i){let s=-1;if(super(t,n),mu(this,"space",i),typeof r=="number")for(;++s<Ao.length;){const o=Ao[s];mu(this,Ao[s],(r&Ss[o])===Ss[o])}}}Ia.prototype.defined=!0;function mu(e,t,n){n&&(e[t]=n)}function rr(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Ia(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[ws(r)]=r,n[ws(s.attribute)]=r}return new $r(t,n,e.space)}const Ih=rr({properties:{ariaActiveDescendant:null,ariaAtomic:Je,ariaAutoComplete:null,ariaBusy:Je,ariaChecked:Je,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:Oe,ariaCurrent:null,ariaDescribedBy:Oe,ariaDetails:null,ariaDisabled:Je,ariaDropEffect:Oe,ariaErrorMessage:null,ariaExpanded:Je,ariaFlowTo:Oe,ariaGrabbed:Je,ariaHasPopup:null,ariaHidden:Je,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Oe,ariaLevel:X,ariaLive:null,ariaModal:Je,ariaMultiLine:Je,ariaMultiSelectable:Je,ariaOrientation:null,ariaOwns:Oe,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:Je,ariaReadOnly:Je,ariaRelevant:null,ariaRequired:Je,ariaRoleDescription:Oe,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:Je,ariaSetSize:X,ariaSort:null,ariaValueMax:X,ariaValueMin:X,ariaValueNow:X,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Rh(e,t){return t in e?e[t]:t}function Vh(e,t){return Rh(e,t.toLowerCase())}const o2=rr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wn,acceptCharset:Oe,accessKey:Oe,action:null,allow:null,allowFullScreen:ve,allowPaymentRequest:ve,allowUserMedia:ve,alt:null,as:null,async:ve,autoCapitalize:null,autoComplete:Oe,autoFocus:ve,autoPlay:ve,blocking:Oe,capture:null,charSet:null,checked:ve,cite:null,className:Oe,cols:X,colSpan:null,content:null,contentEditable:Je,controls:ve,controlsList:Oe,coords:X|Wn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ve,defer:ve,dir:null,dirName:null,disabled:ve,download:ks,draggable:Je,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ve,formTarget:null,headers:Oe,height:X,hidden:ks,high:X,href:null,hrefLang:null,htmlFor:Oe,httpEquiv:Oe,id:null,imageSizes:null,imageSrcSet:null,inert:ve,inputMode:null,integrity:null,is:null,isMap:ve,itemId:null,itemProp:Oe,itemRef:Oe,itemScope:ve,itemType:Oe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ve,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:ve,muted:ve,name:null,nonce:null,noModule:ve,noValidate:ve,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ve,optimum:X,pattern:null,ping:Oe,placeholder:null,playsInline:ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ve,referrerPolicy:null,rel:Oe,required:ve,reversed:ve,rows:X,rowSpan:X,sandbox:Oe,scope:null,scoped:ve,seamless:ve,selected:ve,shadowRootClonable:ve,shadowRootDelegatesFocus:ve,shadowRootMode:null,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:Je,src:null,srcDoc:null,srcLang:null,srcSet:null,start:X,step:null,style:null,tabIndex:X,target:null,title:null,translate:null,type:null,typeMustMatch:ve,useMap:null,value:Je,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Oe,axis:null,background:null,bgColor:null,border:X,borderColor:null,bottomMargin:X,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ve,declare:ve,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:ve,noHref:ve,noShade:ve,noWrap:ve,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:Je,standby:null,summary:null,text:null,topMargin:X,valueType:null,version:null,vAlign:null,vLink:null,vSpace:X,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ve,disableRemotePlayback:ve,prefix:null,property:null,results:X,security:null,unselectable:null},space:"html",transform:Vh}),s2=rr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:pt,accentHeight:X,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:X,amplitude:X,arabicForm:null,ascent:X,attributeName:null,attributeType:null,azimuth:X,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:X,by:null,calcMode:null,capHeight:X,className:Oe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:X,diffuseConstant:X,direction:null,display:null,dur:null,divisor:X,dominantBaseline:null,download:ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:X,enableBackground:null,end:null,event:null,exponent:X,externalResourcesRequired:null,fill:null,fillOpacity:X,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Wn,g2:Wn,glyphName:Wn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:X,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:X,horizOriginX:X,horizOriginY:X,id:null,ideographic:X,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:X,k:X,k1:X,k2:X,k3:X,k4:X,kernelMatrix:pt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:X,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:X,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:X,overlineThickness:X,paintOrder:null,panose1:null,path:null,pathLength:X,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Oe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pt,rev:pt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pt,requiredFeatures:pt,requiredFonts:pt,requiredFormats:pt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:X,specularExponent:X,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:X,strikethroughThickness:X,string:null,stroke:null,strokeDashArray:pt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:X,strokeOpacity:X,strokeWidth:null,style:null,surfaceScale:X,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pt,tabIndex:X,tableValues:null,target:null,targetX:X,targetY:X,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:X,underlineThickness:X,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:X,values:null,vAlphabetic:X,vMathematical:X,vectorEffect:null,vHanging:X,vIdeographic:X,version:null,vertAdvY:X,vertOriginX:X,vertOriginY:X,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:X,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Rh}),Dh=rr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Fh=rr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Vh}),Lh=rr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),a2={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},l2=/[A-Z]/g,pu=/-[a-z]/g,c2=/^data[-\w.:]+$/i;function u2(e,t){const n=ws(t);let r=t,i=ht;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&c2.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(pu,f2);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!pu.test(s)){let o=s.replace(l2,d2);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Ia}return new i(r,t)}function d2(e){return"-"+e.toLowerCase()}function f2(e){return e.charAt(1).toUpperCase()}const h2=Nh([Ih,o2,Dh,Fh,Lh],"html"),Ra=Nh([Ih,s2,Dh,Fh,Lh],"svg");function m2(e){return e.join(" ").trim()}var In={},jo,gu;function p2(){if(gu)return jo;gu=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
108
+ `,c="/",u="*",d="",h="comment",m="declaration";jo=function(p,b){if(typeof p!="string")throw new TypeError("First argument must be a string");if(!p)return[];b=b||{};var v=1,k=1;function S(B){var H=B.match(t);H&&(v+=H.length);var Y=B.lastIndexOf(l);k=~Y?B.length-Y:k+B.length}function A(){var B={line:v,column:k};return function(H){return H.position=new T(B),P(),H}}function T(B){this.start=B,this.end={line:v,column:k},this.source=b.source}T.prototype.content=p;function C(B){var H=new Error(b.source+":"+v+":"+k+": "+B);if(H.reason=B,H.filename=b.source,H.line=v,H.column=k,H.source=p,!b.silent)throw H}function N(B){var H=B.exec(p);if(H){var Y=H[0];return S(Y),p=p.slice(Y.length),H}}function P(){N(n)}function L(B){var H;for(B=B||[];H=y();)H!==!1&&B.push(H);return B}function y(){var B=A();if(!(c!=p.charAt(0)||u!=p.charAt(1))){for(var H=2;d!=p.charAt(H)&&(u!=p.charAt(H)||c!=p.charAt(H+1));)++H;if(H+=2,d===p.charAt(H-1))return C("End of comment missing");var Y=p.slice(2,H-2);return k+=2,S(Y),p=p.slice(H),k+=2,B({type:h,comment:Y})}}function M(){var B=A(),H=N(r);if(H){if(y(),!N(i))return C("property missing ':'");var Y=N(s),de=B({type:m,property:g(H[0].replace(e,d)),value:Y?g(Y[0].replace(e,d)):d});return N(o),de}}function D(){var B=[];L(B);for(var H;H=M();)H!==!1&&(B.push(H),L(B));return B}return P(),D()};function g(p){return p?p.replace(a,d):d}return jo}var yu;function g2(){if(yu)return In;yu=1;var e=In&&In.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(In,"__esModule",{value:!0}),In.default=n;var t=e(p2());function n(r,i){var s=null;if(!r||typeof r!="string")return s;var o=(0,t.default)(r),a=typeof i=="function";return o.forEach(function(l){if(l.type==="declaration"){var c=l.property,u=l.value;a?i(c,u,l):u&&(s=s||{},s[c]=u)}}),s}return In}var lr={},xu;function y2(){if(xu)return lr;xu=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},o=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),s(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(i,a):c=c.replace(r,a),c.replace(t,o))};return lr.camelCase=l,lr}var cr,bu;function x2(){if(bu)return cr;bu=1;var e=cr&&cr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(g2()),n=y2();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(a,l){a&&l&&(o[(0,n.camelCase)(a,s)]=l)}),o}return r.default=r,cr=r,cr}var b2=x2();const v2=Sa(b2),Oh=$h("end"),Va=$h("start");function $h(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function w2(e){const t=Va(e),n=Oh(e);if(t&&n)return{start:t,end:n}}function vr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?vu(e.position):"start"in e||"end"in e?vu(e):"line"in e||"column"in e?Cs(e):""}function Cs(e){return wu(e&&e.line)+":"+wu(e&&e.column)}function vu(e){return Cs(e&&e.start)+"-"+Cs(e&&e.end)}function wu(e){return e&&typeof e=="number"?e:1}class at extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=vr(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}at.prototype.file="";at.prototype.name="";at.prototype.reason="";at.prototype.message="";at.prototype.stack="";at.prototype.column=void 0;at.prototype.line=void 0;at.prototype.ancestors=void 0;at.prototype.cause=void 0;at.prototype.fatal=void 0;at.prototype.place=void 0;at.prototype.ruleId=void 0;at.prototype.source=void 0;const Da={}.hasOwnProperty,k2=new Map,S2=/[A-Z]/g,C2=new Set(["table","tbody","thead","tfoot","tr"]),E2=new Set(["td","th"]),_h="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function T2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=V2(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=R2(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ra:h2,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Bh(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Bh(e,t,n){if(t.type==="element")return A2(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return j2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return M2(e,t,n);if(t.type==="mdxjsEsm")return P2(e,t);if(t.type==="root")return N2(e,t,n);if(t.type==="text")return I2(e,t)}function A2(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ra,e.schema=i),e.ancestors.push(t);const s=Hh(e,t.tagName,!1),o=D2(e,t);let a=La(e,t);return C2.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!r2(l):!0})),zh(e,o,s,t),Fa(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function j2(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Nr(e,t.position)}function P2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Nr(e,t.position)}function M2(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ra,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Hh(e,t.name,!0),o=F2(e,t),a=La(e,t);return zh(e,o,s,t),Fa(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function N2(e,t,n){const r={};return Fa(r,La(e,t)),e.create(t,e.Fragment,r,n)}function I2(e,t){return t.value}function zh(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Fa(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function R2(e,t,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:t;return a?c(s,o,a):c(s,o)}}function V2(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=Va(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function D2(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Da.call(t.properties,i)){const s=L2(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&E2.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function F2(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Nr(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else Nr(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function La(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:k2;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const a=Bh(e,s,o);a!==void 0&&n.push(a)}return n}function L2(e,t,n){const r=u2(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Qw(n):m2(n)),r.property==="style"){let i=typeof n=="object"?n:O2(e,String(n));return e.stylePropertyNameCase==="css"&&(i=$2(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?a2[r.property]||r.property:r.attribute,n]}}function O2(e,t){try{return v2(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new at("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=_h+"#cannot-parse-style-attribute",i}}function Hh(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=fu(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=fu(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Da.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Nr(e)}function Nr(e,t){const n=new at("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=_h+"#cannot-handle-mdx-estrees-without-createevaluater",n}function $2(e){const t={};let n;for(n in e)Da.call(e,n)&&(t[_2(n)]=e[n]);return t}function _2(e){let t=e.replace(S2,B2);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function B2(e){return"-"+e.toLowerCase()}const Po={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},z2={};function Oa(e,t){const n=z2,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Uh(e,r,i)}function Uh(e,t,n){if(H2(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ku(e.children,t,n)}return Array.isArray(e)?ku(e,t,n):""}function ku(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Uh(e[i],t,n);return r.join("")}function H2(e){return!!(e&&typeof e=="object")}const Su=document.createElement("i");function $a(e){const t="&"+e+";";Su.innerHTML=t;const n=Su.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function xt(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function kt(e,t){return e.length>0?(xt(e,e.length,0,t),e):t}const Cu={}.hasOwnProperty;function Wh(e){const t={};let n=-1;for(;++n<e.length;)U2(t,e[n]);return t}function U2(e,t){let n;for(n in t){const i=(Cu.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){Cu.call(i,o)||(i[o]=[]);const a=s[o];W2(i[o],Array.isArray(a)?a:a?[a]:[])}}}function W2(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);xt(e,0,0,r)}function Zh(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Pt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lt=ln(/[A-Za-z]/),st=ln(/[\dA-Za-z]/),Z2=ln(/[#-'*+\--9=?A-Z^-~]/);function Ti(e){return e!==null&&(e<32||e===127)}const Es=ln(/\d/),q2=ln(/[\dA-Fa-f]/),G2=ln(/[!-/:-@[-`{-~]/);function he(e){return e!==null&&e<-2}function Le(e){return e!==null&&(e<0||e===32)}function Se(e){return e===-2||e===-1||e===32}const Zi=ln(new RegExp("\\p{P}|\\p{S}","u")),kn=ln(/\s/);function ln(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ir(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&st(e.charCodeAt(n+1))&&st(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ee(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return Se(l)?(e.enter(n),a(l)):t(l)}function a(l){return Se(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const K2={tokenize:Y2};function Y2(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ee(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return he(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const X2={tokenize:Q2},Eu={tokenize:J2};function Q2(e){const t=this,n=[];let r=0,i,s,o;return a;function a(S){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,l,c)(S)}return c(S)}function l(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&k();const A=t.events.length;let T=A,C;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){C=t.events[T][1].end;break}v(r);let N=A;for(;N<t.events.length;)t.events[N][1].end={...C},N++;return xt(t.events,T+1,0,t.events.slice(A)),t.events.length=N,c(S)}return a(S)}function c(S){if(r===n.length){if(!i)return h(S);if(i.currentConstruct&&i.currentConstruct.concrete)return g(S);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Eu,u,d)(S)}function u(S){return i&&k(),v(r),h(S)}function d(S){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(S)}function h(S){return t.containerState={},e.attempt(Eu,m,g)(S)}function m(S){return r++,n.push([t.currentConstruct,t.containerState]),h(S)}function g(S){if(S===null){i&&k(),v(0),e.consume(S);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),p(S)}function p(S){if(S===null){b(e.exit("chunkFlow"),!0),v(0),e.consume(S);return}return he(S)?(e.consume(S),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(S),p)}function b(S,A){const T=t.sliceStream(S);if(A&&T.push(null),S.previous=s,s&&(s.next=S),s=S,i.defineSkip(S.start),i.write(T),t.parser.lazy[S.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<o&&(!i.events[C][1].end||i.events[C][1].end.offset>o))return;const N=t.events.length;let P=N,L,y;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(L){y=t.events[P][1].end;break}L=!0}for(v(r),C=N;C<t.events.length;)t.events[C][1].end={...y},C++;xt(t.events,P+1,0,t.events.slice(N)),t.events.length=C}}function v(S){let A=n.length;for(;A-- >S;){const T=n[A];t.containerState=T[1],T[0].exit.call(t,e)}n.length=S}function k(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function J2(e,t,n){return Ee(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kn(e){if(e===null||Le(e)||kn(e))return 1;if(Zi(e))return 2}function qi(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Ts={name:"attention",resolveAll:ek,tokenize:tk};function ek(e,t){let n=-1,r,i,s,o,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};Tu(d,-l),Tu(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=kt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=kt(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=kt(c,qi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=kt(c,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=kt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,xt(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function tk(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Kn(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const c=e.exit("attentionSequence"),u=Kn(l),d=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?d:d&&(i||!h)),c._close=!!(s===42?h:h&&(u||!d)),t(l)}}function Tu(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const nk={name:"autolink",tokenize:rk};function rk(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(m){return lt(m)?(e.consume(m),o):m===64?n(m):c(m)}function o(m){return m===43||m===45||m===46||st(m)?(r=1,a(m)):c(m)}function a(m){return m===58?(e.consume(m),r=0,l):(m===43||m===45||m===46||st(m))&&r++<32?(e.consume(m),a):(r=0,c(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||Ti(m)?n(m):(e.consume(m),l)}function c(m){return m===64?(e.consume(m),u):Z2(m)?(e.consume(m),c):n(m)}function u(m){return st(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,u):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):h(m)}function h(m){if((m===45||st(m))&&r++<63){const g=m===45?h:d;return e.consume(m),g}return n(m)}}const _r={partial:!0,tokenize:ik};function ik(e,t,n){return r;function r(s){return Se(s)?Ee(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||he(s)?t(s):n(s)}}const qh={continuation:{tokenize:sk},exit:ak,name:"blockQuote",tokenize:ok};function ok(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return Se(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function sk(e,t,n){const r=this;return i;function i(o){return Se(o)?Ee(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(qh,t,n)(o)}}function ak(e){e.exit("blockQuote")}const Gh={name:"characterEscape",tokenize:lk};function lk(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return G2(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Kh={name:"characterReference",tokenize:ck};function ck(e,t,n){const r=this;let i=0,s,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=st,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=q2,u):(e.enter("characterReferenceValue"),s=7,o=Es,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return o===st&&!$a(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<s?(e.consume(d),u):n(d)}}const Au={partial:!0,tokenize:dk},ju={concrete:!0,name:"codeFenced",tokenize:uk};function uk(e,t,n){const r=this,i={partial:!0,tokenize:T};let s=0,o=0,a;return l;function l(C){return c(C)}function c(C){const N=r.events[r.events.length-1];return s=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,a=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(C)}function u(C){return C===a?(o++,e.consume(C),u):o<3?n(C):(e.exit("codeFencedFenceSequence"),Se(C)?Ee(e,d,"whitespace")(C):d(C))}function d(C){return C===null||he(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Au,p,A)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||he(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):Se(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ee(e,m,"whitespace")(C)):C===96&&C===a?n(C):(e.consume(C),h)}function m(C){return C===null||he(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===null||he(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===a?n(C):(e.consume(C),g)}function p(C){return e.attempt(i,A,b)(C)}function b(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),v}function v(C){return s>0&&Se(C)?Ee(e,k,"linePrefix",s+1)(C):k(C)}function k(C){return C===null||he(C)?e.check(Au,p,A)(C):(e.enter("codeFlowValue"),S(C))}function S(C){return C===null||he(C)?(e.exit("codeFlowValue"),k(C)):(e.consume(C),S)}function A(C){return e.exit("codeFenced"),t(C)}function T(C,N,P){let L=0;return y;function y(Y){return C.enter("lineEnding"),C.consume(Y),C.exit("lineEnding"),M}function M(Y){return C.enter("codeFencedFence"),Se(Y)?Ee(C,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):D(Y)}function D(Y){return Y===a?(C.enter("codeFencedFenceSequence"),B(Y)):P(Y)}function B(Y){return Y===a?(L++,C.consume(Y),B):L>=o?(C.exit("codeFencedFenceSequence"),Se(Y)?Ee(C,H,"whitespace")(Y):H(Y)):P(Y)}function H(Y){return Y===null||he(Y)?(C.exit("codeFencedFence"),N(Y)):P(Y)}}}function dk(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Mo={name:"codeIndented",tokenize:hk},fk={partial:!0,tokenize:mk};function hk(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ee(e,s,"linePrefix",5)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):he(c)?e.attempt(fk,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||he(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function mk(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):he(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Ee(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):he(o)?i(o):n(o)}}const pk={name:"codeText",previous:yk,resolve:gk,tokenize:xk};function gk(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function yk(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function xk(e,t,n){let r=0,i,s;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(s=e.enter("codeTextSequence"),i=0,u(d)):he(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||he(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",c(d))}}class bk{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&ur(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ur(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ur(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ur(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ur(this.left,n.reverse())}}}function ur(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Yh(e){const t={};let n=-1,r,i,s,o,a,l,c;const u=new bk(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,vk(u,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=u.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return xt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function vk(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let u,d,h=-1,m=n,g=0,p=0;const b=[p];for(;m;){for(;e.get(++i)[1]!==m;);s.push(i),m._tokenizer||(u=r.sliceStream(m),m.next||u.push(null),d&&o.defineSkip(m.start),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(p=h+1,b.push(p),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(o.events=[],m?(m._tokenizer=void 0,m.previous=void 0):b.pop(),h=b.length;h--;){const v=a.slice(b[h],b[h+1]),k=s.pop();l.push([k,k+v.length-1]),e.splice(k,2,v)}for(l.reverse(),h=-1;++h<l.length;)c[g+l[h][0]]=g+l[h][1],g+=l[h][1]-l[h][0]-1;return c}const wk={resolve:Sk,tokenize:Ck},kk={partial:!0,tokenize:Ek};function Sk(e){return Yh(e),e}function Ck(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):he(a)?e.check(kk,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Ek(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ee(e,s,"linePrefix")}function s(o){if(o===null||he(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Xh(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(v){return v===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(v),e.exit(s),h):v===null||v===32||v===41||Ti(v)?n(v):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),p(v))}function h(v){return v===62?(e.enter(s),e.consume(v),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===62?(e.exit("chunkString"),e.exit(a),h(v)):v===null||v===60||he(v)?n(v):(e.consume(v),v===92?g:m)}function g(v){return v===60||v===62||v===92?(e.consume(v),m):m(v)}function p(v){return!u&&(v===null||v===41||Le(v))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(v)):u<c&&v===40?(e.consume(v),u++,p):v===41?(e.consume(v),u--,p):v===null||v===32||v===40||Ti(v)?n(v):(e.consume(v),v===92?b:p)}function b(v){return v===40||v===41||v===92?(e.consume(v),p):p(v)}}function Qh(e,t,n,r,i,s){const o=this;let a=0,l;return c;function c(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(s),u}function u(m){return a>999||m===null||m===91||m===93&&!l||m===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(e.exit(s),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):he(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||he(m)||a++>999?(e.exit("chunkString"),u(m)):(e.consume(m),l||(l=!Se(m)),m===92?h:d)}function h(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}}function Jh(e,t,n,r,i,s){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),c(h))}function c(h){return h===o?(e.exit(s),l(o)):h===null?n(h):he(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ee(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||he(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===o||h===92?(e.consume(h),u):u(h)}}function wr(e,t){let n;return r;function r(i){return he(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Se(i)?Ee(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Tk={name:"definition",tokenize:jk},Ak={partial:!0,tokenize:Pk};function jk(e,t,n){const r=this;let i;return s;function s(m){return e.enter("definition"),o(m)}function o(m){return Qh.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function a(m){return i=Pt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):n(m)}function l(m){return Le(m)?wr(e,c)(m):c(m)}function c(m){return Xh(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function u(m){return e.attempt(Ak,d,d)(m)}function d(m){return Se(m)?Ee(e,h,"whitespace")(m):h(m)}function h(m){return m===null||he(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function Pk(e,t,n){return r;function r(a){return Le(a)?wr(e,i)(a):n(a)}function i(a){return Jh(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return Se(a)?Ee(e,o,"whitespace")(a):o(a)}function o(a){return a===null||he(a)?t(a):n(a)}}const Mk={name:"hardBreakEscape",tokenize:Nk};function Nk(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return he(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Ik={name:"headingAtx",resolve:Rk,tokenize:Vk};function Rk(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},xt(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Vk(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||Le(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||he(u)?(e.exit("atxHeading"),t(u)):Se(u)?Ee(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Le(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const Dk=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Pu=["pre","script","style","textarea"],Fk={concrete:!0,name:"htmlFlow",resolveTo:$k,tokenize:_k},Lk={partial:!0,tokenize:zk},Ok={partial:!0,tokenize:Bk};function $k(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function _k(e,t,n){const r=this;let i,s,o,a,l;return c;function c(E){return u(E)}function u(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),d}function d(E){return E===33?(e.consume(E),h):E===47?(e.consume(E),s=!0,p):E===63?(e.consume(E),i=3,r.interrupt?t:w):lt(E)?(e.consume(E),o=String.fromCharCode(E),b):n(E)}function h(E){return E===45?(e.consume(E),i=2,m):E===91?(e.consume(E),i=5,a=0,g):lt(E)?(e.consume(E),i=4,r.interrupt?t:w):n(E)}function m(E){return E===45?(e.consume(E),r.interrupt?t:w):n(E)}function g(E){const U="CDATA[";return E===U.charCodeAt(a++)?(e.consume(E),a===U.length?r.interrupt?t:D:g):n(E)}function p(E){return lt(E)?(e.consume(E),o=String.fromCharCode(E),b):n(E)}function b(E){if(E===null||E===47||E===62||Le(E)){const U=E===47,se=o.toLowerCase();return!U&&!s&&Pu.includes(se)?(i=1,r.interrupt?t(E):D(E)):Dk.includes(o.toLowerCase())?(i=6,U?(e.consume(E),v):r.interrupt?t(E):D(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):s?k(E):S(E))}return E===45||st(E)?(e.consume(E),o+=String.fromCharCode(E),b):n(E)}function v(E){return E===62?(e.consume(E),r.interrupt?t:D):n(E)}function k(E){return Se(E)?(e.consume(E),k):y(E)}function S(E){return E===47?(e.consume(E),y):E===58||E===95||lt(E)?(e.consume(E),A):Se(E)?(e.consume(E),S):y(E)}function A(E){return E===45||E===46||E===58||E===95||st(E)?(e.consume(E),A):T(E)}function T(E){return E===61?(e.consume(E),C):Se(E)?(e.consume(E),T):S(E)}function C(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),l=E,N):Se(E)?(e.consume(E),C):P(E)}function N(E){return E===l?(e.consume(E),l=null,L):E===null||he(E)?n(E):(e.consume(E),N)}function P(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||Le(E)?T(E):(e.consume(E),P)}function L(E){return E===47||E===62||Se(E)?S(E):n(E)}function y(E){return E===62?(e.consume(E),M):n(E)}function M(E){return E===null||he(E)?D(E):Se(E)?(e.consume(E),M):n(E)}function D(E){return E===45&&i===2?(e.consume(E),de):E===60&&i===1?(e.consume(E),ie):E===62&&i===4?(e.consume(E),z):E===63&&i===3?(e.consume(E),w):E===93&&i===5?(e.consume(E),W):he(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Lk,oe,B)(E)):E===null||he(E)?(e.exit("htmlFlowData"),B(E)):(e.consume(E),D)}function B(E){return e.check(Ok,H,oe)(E)}function H(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),Y}function Y(E){return E===null||he(E)?B(E):(e.enter("htmlFlowData"),D(E))}function de(E){return E===45?(e.consume(E),w):D(E)}function ie(E){return E===47?(e.consume(E),o="",F):D(E)}function F(E){if(E===62){const U=o.toLowerCase();return Pu.includes(U)?(e.consume(E),z):D(E)}return lt(E)&&o.length<8?(e.consume(E),o+=String.fromCharCode(E),F):D(E)}function W(E){return E===93?(e.consume(E),w):D(E)}function w(E){return E===62?(e.consume(E),z):E===45&&i===2?(e.consume(E),w):D(E)}function z(E){return E===null||he(E)?(e.exit("htmlFlowData"),oe(E)):(e.consume(E),z)}function oe(E){return e.exit("htmlFlow"),t(E)}}function Bk(e,t,n){const r=this;return i;function i(o){return he(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function zk(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(_r,t,n)}}const Hk={name:"htmlText",tokenize:Uk};function Uk(e,t,n){const r=this;let i,s,o;return a;function a(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),l}function l(w){return w===33?(e.consume(w),c):w===47?(e.consume(w),T):w===63?(e.consume(w),S):lt(w)?(e.consume(w),P):n(w)}function c(w){return w===45?(e.consume(w),u):w===91?(e.consume(w),s=0,g):lt(w)?(e.consume(w),k):n(w)}function u(w){return w===45?(e.consume(w),m):n(w)}function d(w){return w===null?n(w):w===45?(e.consume(w),h):he(w)?(o=d,ie(w)):(e.consume(w),d)}function h(w){return w===45?(e.consume(w),m):d(w)}function m(w){return w===62?de(w):w===45?h(w):d(w)}function g(w){const z="CDATA[";return w===z.charCodeAt(s++)?(e.consume(w),s===z.length?p:g):n(w)}function p(w){return w===null?n(w):w===93?(e.consume(w),b):he(w)?(o=p,ie(w)):(e.consume(w),p)}function b(w){return w===93?(e.consume(w),v):p(w)}function v(w){return w===62?de(w):w===93?(e.consume(w),v):p(w)}function k(w){return w===null||w===62?de(w):he(w)?(o=k,ie(w)):(e.consume(w),k)}function S(w){return w===null?n(w):w===63?(e.consume(w),A):he(w)?(o=S,ie(w)):(e.consume(w),S)}function A(w){return w===62?de(w):S(w)}function T(w){return lt(w)?(e.consume(w),C):n(w)}function C(w){return w===45||st(w)?(e.consume(w),C):N(w)}function N(w){return he(w)?(o=N,ie(w)):Se(w)?(e.consume(w),N):de(w)}function P(w){return w===45||st(w)?(e.consume(w),P):w===47||w===62||Le(w)?L(w):n(w)}function L(w){return w===47?(e.consume(w),de):w===58||w===95||lt(w)?(e.consume(w),y):he(w)?(o=L,ie(w)):Se(w)?(e.consume(w),L):de(w)}function y(w){return w===45||w===46||w===58||w===95||st(w)?(e.consume(w),y):M(w)}function M(w){return w===61?(e.consume(w),D):he(w)?(o=M,ie(w)):Se(w)?(e.consume(w),M):L(w)}function D(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),i=w,B):he(w)?(o=D,ie(w)):Se(w)?(e.consume(w),D):(e.consume(w),H)}function B(w){return w===i?(e.consume(w),i=void 0,Y):w===null?n(w):he(w)?(o=B,ie(w)):(e.consume(w),B)}function H(w){return w===null||w===34||w===39||w===60||w===61||w===96?n(w):w===47||w===62||Le(w)?L(w):(e.consume(w),H)}function Y(w){return w===47||w===62||Le(w)?L(w):n(w)}function de(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):n(w)}function ie(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),F}function F(w){return Se(w)?Ee(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):W(w)}function W(w){return e.enter("htmlTextData"),o(w)}}const _a={name:"labelEnd",resolveAll:Gk,resolveTo:Kk,tokenize:Yk},Wk={tokenize:Xk},Zk={tokenize:Qk},qk={tokenize:Jk};function Gk(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&xt(e,0,e.length,n),e}function Kk(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=kt(a,e.slice(s+1,s+r+3)),a=kt(a,[["enter",u,t]]),a=kt(a,qi(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=kt(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=kt(a,e.slice(o+1)),a=kt(a,[["exit",l,t]]),xt(e,s,e.length,a),e}function Yk(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(h){return s?s._inactive?d(h):(o=r.parser.defined.includes(Pt(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(Wk,u,o?u:d)(h):h===91?e.attempt(Zk,u,o?c:d)(h):o?u(h):d(h)}function c(h){return e.attempt(qk,u,d)(h)}function u(h){return t(h)}function d(h){return s._balanced=!0,n(h)}}function Xk(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Le(d)?wr(e,s)(d):s(d)}function s(d){return d===41?u(d):Xh(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return Le(d)?wr(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?Jh(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Le(d)?wr(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function Qk(e,t,n){const r=this;return i;function i(a){return Qh.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Pt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function Jk(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const eS={name:"labelStartImage",resolveAll:_a.resolveAll,tokenize:tS};function tS(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const nS={name:"labelStartLink",resolveAll:_a.resolveAll,tokenize:rS};function rS(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const No={name:"lineEnding",tokenize:iS};function iS(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ee(e,t,"linePrefix")}}const di={name:"thematicBreak",tokenize:oS};function oS(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||he(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Se(c)?Ee(e,a,"whitespace")(c):a(c))}}const ut={continuation:{tokenize:cS},exit:dS,name:"list",tokenize:lS},sS={partial:!0,tokenize:fS},aS={partial:!0,tokenize:uS};function lS(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Es(m)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(di,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return n(m)}function l(m){return Es(m)&&++o<10?(e.consume(m),l):(!r.interrupt||o<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(_r,r.interrupt?n:u,e.attempt(sS,h,d))}function u(m){return r.containerState.initialBlankLine=!0,s++,h(m)}function d(m){return Se(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function cS(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(_r,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ee(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!Se(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(aS,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ee(e,e.attempt(ut,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function uS(e,t,n){const r=this;return Ee(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function dS(e){e.exit(this.containerState.type)}function fS(e,t,n){const r=this;return Ee(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!Se(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Mu={name:"setextUnderline",resolveTo:hS,tokenize:mS};function hS(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function mS(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Se(c)?Ee(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||he(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const pS={tokenize:gS};function gS(e){const t=this,n=e.attempt(_r,r,e.attempt(this.parser.constructs.flowInitial,i,Ee(e,e.attempt(this.parser.constructs.flow,i,e.attempt(wk,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const yS={resolveAll:tm()},xS=em("string"),bS=em("text");function em(e){return{resolveAll:tm(e==="text"?vS:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(u){return c(u)?s(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const m=d[h];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function tm(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function vS(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const wS={42:ut,43:ut,45:ut,48:ut,49:ut,50:ut,51:ut,52:ut,53:ut,54:ut,55:ut,56:ut,57:ut,62:qh},kS={91:Tk},SS={[-2]:Mo,[-1]:Mo,32:Mo},CS={35:Ik,42:di,45:[Mu,di],60:Fk,61:Mu,95:di,96:ju,126:ju},ES={38:Kh,92:Gh},TS={[-5]:No,[-4]:No,[-3]:No,33:eS,38:Kh,42:Ts,60:[nk,Hk],91:nS,92:[Mk,Gh],93:_a,95:Ts,96:pk},AS={null:[Ts,yS]},jS={null:[42,95]},PS={null:[]},MS=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:jS,contentInitial:kS,disable:PS,document:wS,flow:CS,flowInitial:SS,insideSpan:AS,string:ES,text:TS},Symbol.toStringTag,{value:"Module"}));function NS(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const l={attempt:N(T),check:N(C),consume:k,enter:S,exit:A,interrupt:N(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:p,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:m,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function d(M){return o=kt(o,M),b(),o[o.length-1]!==null?[]:(P(t,0),c.events=qi(s,c.events,c),c.events)}function h(M,D){return RS(m(M),D)}function m(M){return IS(o,M)}function g(){const{_bufferIndex:M,_index:D,line:B,column:H,offset:Y}=r;return{_bufferIndex:M,_index:D,line:B,column:H,offset:Y}}function p(M){i[M.line]=M.column,y()}function b(){let M;for(;r._index<o.length;){const D=o[r._index];if(typeof D=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<D.length;)v(D.charCodeAt(r._bufferIndex));else v(D)}}function v(M){u=u(M)}function k(M){he(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,y()):M!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=M}function S(M,D){const B=D||{};return B.type=M,B.start=g(),c.events.push(["enter",B,c]),a.push(B),B}function A(M){const D=a.pop();return D.end=g(),c.events.push(["exit",D,c]),D}function T(M,D){P(M,D.from)}function C(M,D){D.restore()}function N(M,D){return B;function B(H,Y,de){let ie,F,W,w;return Array.isArray(H)?oe(H):"tokenize"in H?oe([H]):z(H);function z($){return ee;function ee(Q){const V=Q!==null&&$[Q],G=Q!==null&&$.null,fe=[...Array.isArray(V)?V:V?[V]:[],...Array.isArray(G)?G:G?[G]:[]];return oe(fe)(Q)}}function oe($){return ie=$,F=0,$.length===0?de:E($[F])}function E($){return ee;function ee(Q){return w=L(),W=$,$.partial||(c.currentConstruct=$),$.name&&c.parser.constructs.disable.null.includes($.name)?se():$.tokenize.call(D?Object.assign(Object.create(c),D):c,l,U,se)(Q)}}function U($){return M(W,w),Y}function se($){return w.restore(),++F<ie.length?E(ie[F]):de}}}function P(M,D){M.resolveAll&&!s.includes(M)&&s.push(M),M.resolve&&xt(c.events,D,c.events.length-D,M.resolve(c.events.slice(D),c)),M.resolveTo&&(c.events=M.resolveTo(c.events,c))}function L(){const M=g(),D=c.previous,B=c.currentConstruct,H=c.events.length,Y=Array.from(a);return{from:H,restore:de};function de(){r=M,c.previous=D,c.currentConstruct=B,c.events.length=H,a=Y,y()}}function y(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function IS(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function RS(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
109
109
  `;break}case-3:{o=`\r
110
- `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function mS(e){const r={constructs:Mh([uS,...(e||{}).extensions||[]]),content:i(P2),defined:[],document:i(M2),flow:i(Kk),lazy:{},string:i(Qk),text:i(Jk)};return r;function i(s){return o;function o(a){return dS(r,s,a)}}}function pS(e){for(;!Fh(e););return e}const ku=/[\0\t\n\r]/g;function gS(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let c,u,d,h,m;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(ku.lastIndex=d,c=ku.exec(s),h=c&&c.index!==void 0?c.index:s.length,m=s.charCodeAt(h),!c){t=s.slice(d);break}if(m===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(s.slice(d,h)),e+=h-d),m){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const yS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xS(e){return e.replace(yS,bS)}function bS(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Ih(n.slice(s?2:1),s?16:10)}return Ma(n)||e}const zh={}.hasOwnProperty;function vS(e,t,n){return typeof t!="string"&&(n=t,t=void 0),wS(n)(pS(mS(n).document().write(gS()(e,t,!0))))}function wS(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(xe),autolinkProtocol:L,autolinkEmail:L,atxHeading:s(me),blockQuote:s(X),characterEscape:L,characterReference:L,codeFenced:s(fe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(fe,o),codeText:s(R,o),codeTextData:L,data:L,codeFlowValue:L,definition:s(re),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(ne),hardBreakEscape:s(Z),hardBreakTrailing:s(Z),htmlFlow:s(pe,o),htmlFlowData:L,htmlText:s(pe,o),htmlTextData:L,image:s(Ae),label:o,link:s(xe),listItem:s(ze),listItemValue:h,listOrdered:s(Me,d),listUnordered:s(Me),paragraph:s(He),reference:E,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(me),strong:s(nt),thematicBreak:s(Ft)},exit:{atxHeading:l(),atxHeadingSequence:T,autolink:l(),autolinkEmail:V,autolinkProtocol:Q,blockQuote:l(),characterEscapeValue:y,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:$,characterReference:ee,codeFenced:l(b),codeFencedFence:p,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:y,codeIndented:l(v),codeText:l(K),codeTextData:y,data:y,definition:l(),definitionDestinationString:A,definitionLabelString:k,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(D),hardBreakTrailing:l(D),htmlFlow:l(B),htmlFlowData:y,htmlText:l(H),htmlTextData:y,image:l(ie),label:W,labelText:F,lineEnding:N,link:l(de),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:U,resourceDestinationString:w,resourceTitleString:z,resource:oe,setextHeading:l(P),setextHeadingLineSequence:M,setextHeadingText:C,strong:l(),thematicBreak:l()}};Hh(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(_){let I={type:"root",children:[]};const q={stack:[I],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},ue=[];let J=-1;for(;++J<_.length;)if(_[J][1].type==="listOrdered"||_[J][1].type==="listUnordered")if(_[J][0]==="enter")ue.push(J);else{const ke=ue.pop();J=i(_,ke,J)}for(J=-1;++J<_.length;){const ke=t[_[J][0]];zh.call(ke,_[J][1].type)&&ke[_[J][1].type].call(Object.assign({sliceSerialize:_[J][2].sliceSerialize},q),_[J][1])}if(q.tokenStack.length>0){const ke=q.tokenStack[q.tokenStack.length-1];(ke[1]||Su).call(q,void 0,ke[0])}for(I.position={start:Gt(_.length>0?_[0][1].start:{line:1,column:1,offset:0}),end:Gt(_.length>0?_[_.length-2][1].end:{line:1,column:1,offset:0})},J=-1;++J<t.transforms.length;)I=t.transforms[J](I)||I;return I}function i(_,I,q){let ue=I-1,J=-1,ke=!1,G,be,Ce,je;for(;++ue<=q;){const $e=_[ue];switch($e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$e[0]==="enter"?J++:J--,je=void 0;break}case"lineEndingBlank":{$e[0]==="enter"&&(G&&!je&&!J&&!Ce&&(Ce=ue),je=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:je=void 0}if(!J&&$e[0]==="enter"&&$e[1].type==="listItemPrefix"||J===-1&&$e[0]==="exit"&&($e[1].type==="listUnordered"||$e[1].type==="listOrdered")){if(G){let Et=ue;for(be=void 0;Et--;){const ht=_[Et];if(ht[1].type==="lineEnding"||ht[1].type==="lineEndingBlank"){if(ht[0]==="exit")continue;be&&(_[be][1].type="lineEndingBlank",ke=!0),ht[1].type="lineEnding",be=Et}else if(!(ht[1].type==="linePrefix"||ht[1].type==="blockQuotePrefix"||ht[1].type==="blockQuotePrefixWhitespace"||ht[1].type==="blockQuoteMarker"||ht[1].type==="listItemIndent"))break}Ce&&(!be||Ce<be)&&(G._spread=!0),G.end=Object.assign({},be?_[be][1].start:$e[1].end),_.splice(be||ue,0,["exit",G,$e[2]]),ue++,q++}if($e[1].type==="listItemPrefix"){const Et={type:"listItem",_spread:!1,start:Object.assign({},$e[1].start),end:void 0};G=Et,_.splice(ue,0,["enter",Et,$e[2]]),ue++,q++,Ce=void 0,je=!0}}}return _[I][1]._spread=ke,q}function s(_,I){return q;function q(ue){a.call(this,_(ue),ue),I&&I.call(this,ue)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(_,I,q){this.stack[this.stack.length-1].children.push(_),this.stack.push(_),this.tokenStack.push([I,q||void 0]),_.position={start:Gt(I.start),end:void 0}}function l(_){return I;function I(q){_&&_.call(this,q),c.call(this,q)}}function c(_,I){const q=this.stack.pop(),ue=this.tokenStack.pop();if(ue)ue[0].type!==_.type&&(I?I.call(this,_,ue[0]):(ue[1]||Su).call(this,_,ue[0]));else throw new Error("Cannot close `"+_.type+"` ("+yr({start:_.start,end:_.end})+"): it’s not open");q.position.end=Gt(_.end)}function u(){return Na(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(_){if(this.data.expectingFirstListItemValue){const I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(_),10),this.data.expectingFirstListItemValue=void 0}}function m(){const _=this.resume(),I=this.stack[this.stack.length-1];I.lang=_}function g(){const _=this.resume(),I=this.stack[this.stack.length-1];I.meta=_}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const _=this.resume(),I=this.stack[this.stack.length-1];I.value=_.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const _=this.resume(),I=this.stack[this.stack.length-1];I.value=_.replace(/(\r?\n|\r)$/g,"")}function k(_){const I=this.resume(),q=this.stack[this.stack.length-1];q.label=I,q.identifier=jt(this.sliceSerialize(_)).toLowerCase()}function S(){const _=this.resume(),I=this.stack[this.stack.length-1];I.title=_}function A(){const _=this.resume(),I=this.stack[this.stack.length-1];I.url=_}function T(_){const I=this.stack[this.stack.length-1];if(!I.depth){const q=this.sliceSerialize(_).length;I.depth=q}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function M(_){const I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(_).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function L(_){const q=this.stack[this.stack.length-1].children;let ue=q[q.length-1];(!ue||ue.type!=="text")&&(ue=Zt(),ue.position={start:Gt(_.start),end:void 0},q.push(ue)),this.stack.push(ue)}function y(_){const I=this.stack.pop();I.value+=this.sliceSerialize(_),I.position.end=Gt(_.end)}function N(_){const I=this.stack[this.stack.length-1];if(this.data.atHardBreak){const q=I.children[I.children.length-1];q.position.end=Gt(_.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(I.type)&&(L.call(this,_),y.call(this,_))}function D(){this.data.atHardBreak=!0}function B(){const _=this.resume(),I=this.stack[this.stack.length-1];I.value=_}function H(){const _=this.resume(),I=this.stack[this.stack.length-1];I.value=_}function K(){const _=this.resume(),I=this.stack[this.stack.length-1];I.value=_}function de(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=I,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function ie(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=I,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function F(_){const I=this.sliceSerialize(_),q=this.stack[this.stack.length-2];q.label=xS(I),q.identifier=jt(I).toLowerCase()}function W(){const _=this.stack[this.stack.length-1],I=this.resume(),q=this.stack[this.stack.length-1];if(this.data.inReference=!0,q.type==="link"){const ue=_.children;q.children=ue}else q.alt=I}function w(){const _=this.resume(),I=this.stack[this.stack.length-1];I.url=_}function z(){const _=this.resume(),I=this.stack[this.stack.length-1];I.title=_}function oe(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function U(_){const I=this.resume(),q=this.stack[this.stack.length-1];q.label=I,q.identifier=jt(this.sliceSerialize(_)).toLowerCase(),this.data.referenceType="full"}function se(_){this.data.characterReferenceType=_.type}function $(_){const I=this.sliceSerialize(_),q=this.data.characterReferenceType;let ue;q?(ue=Ih(I,q==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ue=Ma(I);const J=this.stack[this.stack.length-1];J.value+=ue}function ee(_){const I=this.stack.pop();I.position.end=Gt(_.end)}function Q(_){y.call(this,_);const I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(_)}function V(_){y.call(this,_);const I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(_)}function X(){return{type:"blockquote",children:[]}}function fe(){return{type:"code",lang:null,meta:null,value:""}}function R(){return{type:"inlineCode",value:""}}function re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ne(){return{type:"emphasis",children:[]}}function me(){return{type:"heading",depth:0,children:[]}}function Z(){return{type:"break"}}function pe(){return{type:"html",value:""}}function Ae(){return{type:"image",title:null,url:"",alt:null}}function xe(){return{type:"link",title:null,url:"",children:[]}}function Me(_){return{type:"list",ordered:_.type==="listOrdered",start:null,spread:_._spread,children:[]}}function ze(_){return{type:"listItem",spread:_._spread,checked:null,children:[]}}function He(){return{type:"paragraph",children:[]}}function nt(){return{type:"strong",children:[]}}function Zt(){return{type:"text",value:""}}function Ft(){return{type:"thematicBreak"}}}function Gt(e){return{line:e.line,column:e.column,offset:e.offset}}function Hh(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Hh(e,r):kS(e,r)}}function kS(e,t){let n;for(n in t)if(zh.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Su(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+yr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+yr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+yr({start:t.start,end:t.end})+") is still open")}function SS(e){const t=this;t.parser=n;function n(r){return vS(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function CS(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function ES(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
111
- `}]}function TS(e,t){const n=t.value?t.value+`
112
- `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function AS(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jS(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PS(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=tr(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function NS(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function MS(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Uh(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function IS(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Uh(e,t);const i={src:tr(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function RS(e,t){const n={src:tr(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function VS(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function DS(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Uh(e,t);const i={href:tr(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function FS(e,t){const n={href:tr(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function LS(e,t,n){const r=e.all(t),i=n?OS(n):Wh(t),s={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
110
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function VS(e){const r={constructs:Wh([MS,...(e||{}).extensions||[]]),content:i(K2),defined:[],document:i(X2),flow:i(pS),lazy:{},string:i(xS),text:i(bS)};return r;function i(s){return o;function o(a){return NS(r,s,a)}}}function DS(e){for(;!Yh(e););return e}const Nu=/[\0\t\n\r]/g;function FS(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let c,u,d,h,m;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(Nu.lastIndex=d,c=Nu.exec(s),h=c&&c.index!==void 0?c.index:s.length,m=s.charCodeAt(h),!c){t=s.slice(d);break}if(m===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(s.slice(d,h)),e+=h-d),m){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const LS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function OS(e){return e.replace(LS,$S)}function $S(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Zh(n.slice(s?2:1),s?16:10)}return $a(n)||e}const nm={}.hasOwnProperty;function _S(e,t,n){return typeof t!="string"&&(n=t,t=void 0),BS(n)(DS(VS(n).document().write(FS()(e,t,!0))))}function BS(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(xe),autolinkProtocol:L,autolinkEmail:L,atxHeading:s(me),blockQuote:s(G),characterEscape:L,characterReference:L,codeFenced:s(fe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(fe,o),codeText:s(R,o),codeTextData:L,data:L,codeFlowValue:L,definition:s(re),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(ne),hardBreakEscape:s(Z),hardBreakTrailing:s(Z),htmlFlow:s(pe,o),htmlFlowData:L,htmlText:s(pe,o),htmlTextData:L,image:s(Ae),label:o,link:s(xe),listItem:s(ze),listItemValue:h,listOrdered:s(Ne,d),listUnordered:s(Ne),paragraph:s(He),reference:E,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(me),strong:s(rt),thematicBreak:s(Lt)},exit:{atxHeading:l(),atxHeadingSequence:T,autolink:l(),autolinkEmail:V,autolinkProtocol:Q,blockQuote:l(),characterEscapeValue:y,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:$,characterReference:ee,codeFenced:l(b),codeFencedFence:p,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:y,codeIndented:l(v),codeText:l(Y),codeTextData:y,data:y,definition:l(),definitionDestinationString:A,definitionLabelString:k,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(D),hardBreakTrailing:l(D),htmlFlow:l(B),htmlFlowData:y,htmlText:l(H),htmlTextData:y,image:l(ie),label:W,labelText:F,lineEnding:M,link:l(de),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:U,resourceDestinationString:w,resourceTitleString:z,resource:oe,setextHeading:l(P),setextHeadingLineSequence:N,setextHeadingText:C,strong:l(),thematicBreak:l()}};rm(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(_){let I={type:"root",children:[]};const q={stack:[I],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},ue=[];let J=-1;for(;++J<_.length;)if(_[J][1].type==="listOrdered"||_[J][1].type==="listUnordered")if(_[J][0]==="enter")ue.push(J);else{const ke=ue.pop();J=i(_,ke,J)}for(J=-1;++J<_.length;){const ke=t[_[J][0]];nm.call(ke,_[J][1].type)&&ke[_[J][1].type].call(Object.assign({sliceSerialize:_[J][2].sliceSerialize},q),_[J][1])}if(q.tokenStack.length>0){const ke=q.tokenStack[q.tokenStack.length-1];(ke[1]||Iu).call(q,void 0,ke[0])}for(I.position={start:Yt(_.length>0?_[0][1].start:{line:1,column:1,offset:0}),end:Yt(_.length>0?_[_.length-2][1].end:{line:1,column:1,offset:0})},J=-1;++J<t.transforms.length;)I=t.transforms[J](I)||I;return I}function i(_,I,q){let ue=I-1,J=-1,ke=!1,K,be,Ce,je;for(;++ue<=q;){const $e=_[ue];switch($e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$e[0]==="enter"?J++:J--,je=void 0;break}case"lineEndingBlank":{$e[0]==="enter"&&(K&&!je&&!J&&!Ce&&(Ce=ue),je=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:je=void 0}if(!J&&$e[0]==="enter"&&$e[1].type==="listItemPrefix"||J===-1&&$e[0]==="exit"&&($e[1].type==="listUnordered"||$e[1].type==="listOrdered")){if(K){let Tt=ue;for(be=void 0;Tt--;){const mt=_[Tt];if(mt[1].type==="lineEnding"||mt[1].type==="lineEndingBlank"){if(mt[0]==="exit")continue;be&&(_[be][1].type="lineEndingBlank",ke=!0),mt[1].type="lineEnding",be=Tt}else if(!(mt[1].type==="linePrefix"||mt[1].type==="blockQuotePrefix"||mt[1].type==="blockQuotePrefixWhitespace"||mt[1].type==="blockQuoteMarker"||mt[1].type==="listItemIndent"))break}Ce&&(!be||Ce<be)&&(K._spread=!0),K.end=Object.assign({},be?_[be][1].start:$e[1].end),_.splice(be||ue,0,["exit",K,$e[2]]),ue++,q++}if($e[1].type==="listItemPrefix"){const Tt={type:"listItem",_spread:!1,start:Object.assign({},$e[1].start),end:void 0};K=Tt,_.splice(ue,0,["enter",Tt,$e[2]]),ue++,q++,Ce=void 0,je=!0}}}return _[I][1]._spread=ke,q}function s(_,I){return q;function q(ue){a.call(this,_(ue),ue),I&&I.call(this,ue)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(_,I,q){this.stack[this.stack.length-1].children.push(_),this.stack.push(_),this.tokenStack.push([I,q||void 0]),_.position={start:Yt(I.start),end:void 0}}function l(_){return I;function I(q){_&&_.call(this,q),c.call(this,q)}}function c(_,I){const q=this.stack.pop(),ue=this.tokenStack.pop();if(ue)ue[0].type!==_.type&&(I?I.call(this,_,ue[0]):(ue[1]||Iu).call(this,_,ue[0]));else throw new Error("Cannot close `"+_.type+"` ("+vr({start:_.start,end:_.end})+"): it’s not open");q.position.end=Yt(_.end)}function u(){return Oa(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(_){if(this.data.expectingFirstListItemValue){const I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(_),10),this.data.expectingFirstListItemValue=void 0}}function m(){const _=this.resume(),I=this.stack[this.stack.length-1];I.lang=_}function g(){const _=this.resume(),I=this.stack[this.stack.length-1];I.meta=_}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const _=this.resume(),I=this.stack[this.stack.length-1];I.value=_.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const _=this.resume(),I=this.stack[this.stack.length-1];I.value=_.replace(/(\r?\n|\r)$/g,"")}function k(_){const I=this.resume(),q=this.stack[this.stack.length-1];q.label=I,q.identifier=Pt(this.sliceSerialize(_)).toLowerCase()}function S(){const _=this.resume(),I=this.stack[this.stack.length-1];I.title=_}function A(){const _=this.resume(),I=this.stack[this.stack.length-1];I.url=_}function T(_){const I=this.stack[this.stack.length-1];if(!I.depth){const q=this.sliceSerialize(_).length;I.depth=q}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function N(_){const I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(_).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function L(_){const q=this.stack[this.stack.length-1].children;let ue=q[q.length-1];(!ue||ue.type!=="text")&&(ue=Gt(),ue.position={start:Yt(_.start),end:void 0},q.push(ue)),this.stack.push(ue)}function y(_){const I=this.stack.pop();I.value+=this.sliceSerialize(_),I.position.end=Yt(_.end)}function M(_){const I=this.stack[this.stack.length-1];if(this.data.atHardBreak){const q=I.children[I.children.length-1];q.position.end=Yt(_.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(I.type)&&(L.call(this,_),y.call(this,_))}function D(){this.data.atHardBreak=!0}function B(){const _=this.resume(),I=this.stack[this.stack.length-1];I.value=_}function H(){const _=this.resume(),I=this.stack[this.stack.length-1];I.value=_}function Y(){const _=this.resume(),I=this.stack[this.stack.length-1];I.value=_}function de(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=I,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function ie(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=I,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function F(_){const I=this.sliceSerialize(_),q=this.stack[this.stack.length-2];q.label=OS(I),q.identifier=Pt(I).toLowerCase()}function W(){const _=this.stack[this.stack.length-1],I=this.resume(),q=this.stack[this.stack.length-1];if(this.data.inReference=!0,q.type==="link"){const ue=_.children;q.children=ue}else q.alt=I}function w(){const _=this.resume(),I=this.stack[this.stack.length-1];I.url=_}function z(){const _=this.resume(),I=this.stack[this.stack.length-1];I.title=_}function oe(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function U(_){const I=this.resume(),q=this.stack[this.stack.length-1];q.label=I,q.identifier=Pt(this.sliceSerialize(_)).toLowerCase(),this.data.referenceType="full"}function se(_){this.data.characterReferenceType=_.type}function $(_){const I=this.sliceSerialize(_),q=this.data.characterReferenceType;let ue;q?(ue=Zh(I,q==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ue=$a(I);const J=this.stack[this.stack.length-1];J.value+=ue}function ee(_){const I=this.stack.pop();I.position.end=Yt(_.end)}function Q(_){y.call(this,_);const I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(_)}function V(_){y.call(this,_);const I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(_)}function G(){return{type:"blockquote",children:[]}}function fe(){return{type:"code",lang:null,meta:null,value:""}}function R(){return{type:"inlineCode",value:""}}function re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ne(){return{type:"emphasis",children:[]}}function me(){return{type:"heading",depth:0,children:[]}}function Z(){return{type:"break"}}function pe(){return{type:"html",value:""}}function Ae(){return{type:"image",title:null,url:"",alt:null}}function xe(){return{type:"link",title:null,url:"",children:[]}}function Ne(_){return{type:"list",ordered:_.type==="listOrdered",start:null,spread:_._spread,children:[]}}function ze(_){return{type:"listItem",spread:_._spread,checked:null,children:[]}}function He(){return{type:"paragraph",children:[]}}function rt(){return{type:"strong",children:[]}}function Gt(){return{type:"text",value:""}}function Lt(){return{type:"thematicBreak"}}}function Yt(e){return{line:e.line,column:e.column,offset:e.offset}}function rm(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?rm(e,r):zS(e,r)}}function zS(e,t){let n;for(n in t)if(nm.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Iu(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+vr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+vr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+vr({start:t.start,end:t.end})+") is still open")}function HS(e){const t=this;t.parser=n;function n(r){return _S(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function US(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function WS(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
111
+ `}]}function ZS(e,t){const n=t.value?t.value+`
112
+ `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function qS(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GS(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function KS(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=ir(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function YS(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function XS(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function im(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function QS(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return im(e,t);const i={src:ir(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function JS(e,t){const n={src:ir(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function eC(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function tC(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return im(e,t);const i={href:ir(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function nC(e,t){const n={href:ir(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function rC(e,t,n){const r=e.all(t),i=n?iC(n):om(t),s={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
113
113
  `}),u.type==="element"&&u.tagName==="p"&&!i?o.push(...u.children):o.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
114
- `});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)}function OS(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Wh(n[r])}return t}function Wh(e){const t=e.spread;return t??e.children.length>1}function $S(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function _S(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function BS(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function zS(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function HS(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Ta(t.children[1]),l=Ch(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function US(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const d=t.children[l],h={},m=o?o[l]:void 0;m&&(h.align=m);let g={type:"element",tagName:s,properties:h,children:[]};d&&(g.children=e.all(d),e.patch(d,g),g=e.applyData(d,g)),c.push(g)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function WS(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Cu=9,Eu=32;function ZS(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(Tu(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Tu(t.slice(i),i>0,!1)),s.join("")}function Tu(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Cu||s===Eu;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Cu||s===Eu;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function qS(e,t){const n={type:"text",value:ZS(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function GS(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const KS={blockquote:CS,break:ES,code:TS,delete:AS,emphasis:jS,footnoteReference:PS,heading:NS,html:MS,imageReference:IS,image:RS,inlineCode:VS,linkReference:DS,link:FS,listItem:LS,list:$S,paragraph:_S,root:BS,strong:zS,table:HS,tableCell:WS,tableRow:US,text:qS,thematicBreak:GS,toml:Qr,yaml:Qr,definition:Qr,footnoteDefinition:Qr};function Qr(){}const Zh=-1,Hi=0,br=1,Si=2,Ra=3,Va=4,Da=5,Fa=6,qh=7,Gh=8,Au=typeof self=="object"?self:globalThis,YS=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Hi:case Zh:return n(o,i);case br:{const a=n([],i);for(const l of o)a.push(r(l));return a}case Si:{const a=n({},i);for(const[l,c]of o)a[r(l)]=r(c);return a}case Ra:return n(new Date(o),i);case Va:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case Da:{const a=n(new Map,i);for(const[l,c]of o)a.set(r(l),r(c));return a}case Fa:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case qh:{const{name:a,message:l}=o;return n(new Au[a](l),i)}case Gh:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new Au[s](o),i)};return r},ju=e=>YS(new Map,e)(0),Mn="",{toString:XS}={},{keys:QS}=Object,lr=e=>{const t=typeof e;if(t!=="object"||!e)return[Hi,t];const n=XS.call(e).slice(8,-1);switch(n){case"Array":return[br,Mn];case"Object":return[Si,Mn];case"Date":return[Ra,Mn];case"RegExp":return[Va,Mn];case"Map":return[Da,Mn];case"Set":return[Fa,Mn];case"DataView":return[br,n]}return n.includes("Array")?[br,n]:n.includes("Error")?[qh,n]:[Si,n]},Jr=([e,t])=>e===Hi&&(t==="function"||t==="symbol"),JS=(e,t,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=lr(o);switch(a){case Hi:{let u=o;switch(l){case"bigint":a=Gh,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([Zh],o)}return i([a,u],o)}case br:{if(l){let h=o;return l==="DataView"?h=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(o)),i([l,[...h]],o)}const u=[],d=i([a,u],o);for(const h of o)u.push(s(h));return d}case Si:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const u=[],d=i([a,u],o);for(const h of QS(o))(e||!Jr(lr(o[h])))&&u.push([s(h),s(o[h])]);return d}case Ra:return i([a,o.toISOString()],o);case Va:{const{source:u,flags:d}=o;return i([a,{source:u,flags:d}],o)}case Da:{const u=[],d=i([a,u],o);for(const[h,m]of o)(e||!(Jr(lr(h))||Jr(lr(m))))&&u.push([s(h),s(m)]);return d}case Fa:{const u=[],d=i([a,u],o);for(const h of o)(e||!Jr(lr(h)))&&u.push(s(h));return d}}const{message:c}=o;return i([a,{name:l,message:c}],o)};return s},Pu=(e,{json:t,lossy:n}={})=>{const r=[];return JS(!(t||n),!!t,new Map,r)(e),r},Ci=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ju(Pu(e,t)):structuredClone(e):(e,t)=>ju(Pu(e,t));function eC(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function tC(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function nC(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||eC,r=e.options.footnoteBackLabel||tC,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),h=tr(d.toLowerCase());let m=0;const g=[],p=e.footnoteCounts.get(d);for(;p!==void 0&&++m<=p;){g.length>0&&g.push({type:"text",value:" "});let k=typeof n=="string"?n:n(l,m);typeof k=="string"&&(k={type:"text",value:k}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const b=u[u.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const k=b.children[b.children.length-1];k&&k.type==="text"?k.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...g)}else u.push(...g);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,v),a.push(v)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Ci(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
114
+ `});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)}function iC(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=om(n[r])}return t}function om(e){const t=e.spread;return t??e.children.length>1}function oC(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function sC(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aC(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function lC(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cC(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Va(t.children[1]),l=Oh(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function uC(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const d=t.children[l],h={},m=o?o[l]:void 0;m&&(h.align=m);let g={type:"element",tagName:s,properties:h,children:[]};d&&(g.children=e.all(d),e.patch(d,g),g=e.applyData(d,g)),c.push(g)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function dC(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ru=9,Vu=32;function fC(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(Du(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Du(t.slice(i),i>0,!1)),s.join("")}function Du(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Ru||s===Vu;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Ru||s===Vu;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function hC(e,t){const n={type:"text",value:fC(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function mC(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const pC={blockquote:US,break:WS,code:ZS,delete:qS,emphasis:GS,footnoteReference:KS,heading:YS,html:XS,imageReference:QS,image:JS,inlineCode:eC,linkReference:tC,link:nC,listItem:rC,list:oC,paragraph:sC,root:aC,strong:lC,table:cC,tableCell:dC,tableRow:uC,text:hC,thematicBreak:mC,toml:ti,yaml:ti,definition:ti,footnoteDefinition:ti};function ti(){}const sm=-1,Gi=0,kr=1,Ai=2,Ba=3,za=4,Ha=5,Ua=6,am=7,lm=8,Fu=typeof self=="object"?self:globalThis,gC=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Gi:case sm:return n(o,i);case kr:{const a=n([],i);for(const l of o)a.push(r(l));return a}case Ai:{const a=n({},i);for(const[l,c]of o)a[r(l)]=r(c);return a}case Ba:return n(new Date(o),i);case za:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case Ha:{const a=n(new Map,i);for(const[l,c]of o)a.set(r(l),r(c));return a}case Ua:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case am:{const{name:a,message:l}=o;return n(new Fu[a](l),i)}case lm:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new Fu[s](o),i)};return r},Lu=e=>gC(new Map,e)(0),Rn="",{toString:yC}={},{keys:xC}=Object,dr=e=>{const t=typeof e;if(t!=="object"||!e)return[Gi,t];const n=yC.call(e).slice(8,-1);switch(n){case"Array":return[kr,Rn];case"Object":return[Ai,Rn];case"Date":return[Ba,Rn];case"RegExp":return[za,Rn];case"Map":return[Ha,Rn];case"Set":return[Ua,Rn];case"DataView":return[kr,n]}return n.includes("Array")?[kr,n]:n.includes("Error")?[am,n]:[Ai,n]},ni=([e,t])=>e===Gi&&(t==="function"||t==="symbol"),bC=(e,t,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=dr(o);switch(a){case Gi:{let u=o;switch(l){case"bigint":a=lm,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([sm],o)}return i([a,u],o)}case kr:{if(l){let h=o;return l==="DataView"?h=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(o)),i([l,[...h]],o)}const u=[],d=i([a,u],o);for(const h of o)u.push(s(h));return d}case Ai:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const u=[],d=i([a,u],o);for(const h of xC(o))(e||!ni(dr(o[h])))&&u.push([s(h),s(o[h])]);return d}case Ba:return i([a,o.toISOString()],o);case za:{const{source:u,flags:d}=o;return i([a,{source:u,flags:d}],o)}case Ha:{const u=[],d=i([a,u],o);for(const[h,m]of o)(e||!(ni(dr(h))||ni(dr(m))))&&u.push([s(h),s(m)]);return d}case Ua:{const u=[],d=i([a,u],o);for(const h of o)(e||!ni(dr(h)))&&u.push(s(h));return d}}const{message:c}=o;return i([a,{name:l,message:c}],o)};return s},Ou=(e,{json:t,lossy:n}={})=>{const r=[];return bC(!(t||n),!!t,new Map,r)(e),r},ji=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Lu(Ou(e,t)):structuredClone(e):(e,t)=>Lu(Ou(e,t));function vC(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function wC(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function kC(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||vC,r=e.options.footnoteBackLabel||wC,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),h=ir(d.toLowerCase());let m=0;const g=[],p=e.footnoteCounts.get(d);for(;p!==void 0&&++m<=p;){g.length>0&&g.push({type:"text",value:" "});let k=typeof n=="string"?n:n(l,m);typeof k=="string"&&(k={type:"text",value:k}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const b=u[u.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const k=b.children[b.children.length-1];k&&k.type==="text"?k.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...g)}else u.push(...g);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,v),a.push(v)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...ji(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
115
115
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
116
- `}]}}const Ui=function(e){if(e==null)return sC;if(typeof e=="function")return Wi(e);if(typeof e=="object")return Array.isArray(e)?rC(e):iC(e);if(typeof e=="string")return oC(e);throw new Error("Expected function, string, or object as test")};function rC(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ui(e[n]);return Wi(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function iC(e){const t=e;return Wi(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function oC(e){return Wi(t);function t(n){return n&&n.type===e}}function Wi(e){return t;function t(n,r,i){return!!(aC(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function sC(){return!0}function aC(e){return e!==null&&typeof e=="object"&&"type"in e}const Kh=[],lC=!0,ks=!1,cC="skip";function Yh(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Ui(i),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=Kh,g,p,b;if((!t||s(l,c,u[u.length-1]||void 0))&&(m=uC(n(l,u)),m[0]===ks))return m;if("children"in l&&l.children){const v=l;if(v.children&&m[0]!==cC)for(p=(r?v.children.length:-1)+o,b=u.concat(v);p>-1&&p<v.children.length;){const k=v.children[p];if(g=a(k,p,b)(),g[0]===ks)return g;p=typeof g[1]=="number"?g[1]:p+o}}return m}}}function uC(e){return Array.isArray(e)?e:typeof e=="number"?[lC,e]:e==null?Kh:[e]}function La(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),Yh(e,s,a,i);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return o(l,d,u)}}const Ss={}.hasOwnProperty,dC={};function fC(e,t){const n=t||dC,r=new Map,i=new Map,s=new Map,o={...KS,...n.handlers},a={all:c,applyData:mC,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:hC,wrap:gC};return La(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),a;function l(u,d){const h=u.type,m=a.handlers[h];if(Ss.call(a.handlers,h)&&m)return m(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:p,...b}=u,v=Ci(b);return v.children=a.all(u),v}return Ci(u)}return(a.options.unknownHandler||pC)(a,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let m=-1;for(;++m<h.length;){const g=a.one(h[m],u);if(g){if(m&&h[m-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Nu(g.value)),!Array.isArray(g)&&g.type==="element")){const p=g.children[0];p&&p.type==="text"&&(p.value=Nu(p.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function hC(e,t){e.position&&(t.position=t2(e))}function mC(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,Ci(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function pC(e,t){const n=t.data||{},r="value"in t&&!(Ss.call(n,"hProperties")||Ss.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function gC(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
116
+ `}]}}const Ki=function(e){if(e==null)return TC;if(typeof e=="function")return Yi(e);if(typeof e=="object")return Array.isArray(e)?SC(e):CC(e);if(typeof e=="string")return EC(e);throw new Error("Expected function, string, or object as test")};function SC(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ki(e[n]);return Yi(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function CC(e){const t=e;return Yi(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function EC(e){return Yi(t);function t(n){return n&&n.type===e}}function Yi(e){return t;function t(n,r,i){return!!(AC(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function TC(){return!0}function AC(e){return e!==null&&typeof e=="object"&&"type"in e}const cm=[],jC=!0,As=!1,PC="skip";function um(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Ki(i),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=cm,g,p,b;if((!t||s(l,c,u[u.length-1]||void 0))&&(m=MC(n(l,u)),m[0]===As))return m;if("children"in l&&l.children){const v=l;if(v.children&&m[0]!==PC)for(p=(r?v.children.length:-1)+o,b=u.concat(v);p>-1&&p<v.children.length;){const k=v.children[p];if(g=a(k,p,b)(),g[0]===As)return g;p=typeof g[1]=="number"?g[1]:p+o}}return m}}}function MC(e){return Array.isArray(e)?e:typeof e=="number"?[jC,e]:e==null?cm:[e]}function Wa(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),um(e,s,a,i);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return o(l,d,u)}}const js={}.hasOwnProperty,NC={};function IC(e,t){const n=t||NC,r=new Map,i=new Map,s=new Map,o={...pC,...n.handlers},a={all:c,applyData:VC,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:RC,wrap:FC};return Wa(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),a;function l(u,d){const h=u.type,m=a.handlers[h];if(js.call(a.handlers,h)&&m)return m(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:p,...b}=u,v=ji(b);return v.children=a.all(u),v}return ji(u)}return(a.options.unknownHandler||DC)(a,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let m=-1;for(;++m<h.length;){const g=a.one(h[m],u);if(g){if(m&&h[m-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=$u(g.value)),!Array.isArray(g)&&g.type==="element")){const p=g.children[0];p&&p.type==="text"&&(p.value=$u(p.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function RC(e,t){e.position&&(t.position=w2(e))}function VC(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,ji(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function DC(e,t){const n=t.data||{},r="value"in t&&!(js.call(n,"hProperties")||js.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function FC(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
117
117
  `});++r<e.length;)r&&n.push({type:"text",value:`
118
118
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
119
- `}),n}function Nu(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Mu(e,t){const n=fC(e,t),r=n.one(e,void 0),i=nC(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
120
- `},i),s}function yC(e,t){return e&&"run"in e?async function(n,r){const i=Mu(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Mu(n,{file:r,...e||t})}}function Iu(e){if(e)throw e}var Ao,Ru;function xC(){if(Ru)return Ao;Ru=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},s=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),d=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!d)return!1;var h;for(h in c);return typeof h>"u"||e.call(c,h)},o=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return Ao=function l(){var c,u,d,h,m,g,p=arguments[0],b=1,v=arguments.length,k=!1;for(typeof p=="boolean"&&(k=p,p=arguments[1]||{},b=2),(p==null||typeof p!="object"&&typeof p!="function")&&(p={});b<v;++b)if(c=arguments[b],c!=null)for(u in c)d=a(p,u),h=a(c,u),p!==h&&(k&&h&&(s(h)||(m=i(h)))?(m?(m=!1,g=d&&i(d)?d:[]):g=d&&s(d)?d:{},o(p,{name:u,newValue:l(k,g,h)})):typeof h<"u"&&o(p,{name:u,newValue:h}));return p},Ao}var bC=xC();const jo=pa(bC);function Cs(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 vC(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...c){const u=e[++s];let d=-1;if(l){o(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?wC(u,a)(...c):o(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function wC(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const Mt={basename:kC,dirname:SC,extname:CC,join:EC,sep:"/"};function kC(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Or(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function SC(e){if(Or(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function CC(e){Or(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function EC(...e){let t=-1,n;for(;++t<e.length;)Or(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":TC(n)}function TC(e){Or(e);const t=e.codePointAt(0)===47;let n=AC(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function AC(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function Or(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const jC={cwd:PC};function PC(){return"/"}function Es(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function NC(e){if(typeof e=="string")e=new URL(e);else if(!Es(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return MC(e)}function MC(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Po=["history","path","basename","stem","extname","dirname"];class Xh{constructor(t){let n;t?Es(t)?n={path:t}:typeof t=="string"||IC(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":jC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Po.length;){const s=Po[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Po.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Mt.basename(this.path):void 0}set basename(t){Mo(t,"basename"),No(t,"basename"),this.path=Mt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Mt.dirname(this.path):void 0}set dirname(t){Vu(this.basename,"dirname"),this.path=Mt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Mt.extname(this.path):void 0}set extname(t){if(No(t,"extname"),Vu(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Mt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Es(t)&&(t=NC(t)),Mo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Mt.basename(this.path,this.extname):void 0}set stem(t){Mo(t,"stem"),No(t,"stem"),this.path=Mt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new st(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function No(e,t){if(e&&e.includes(Mt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Mt.sep+"`")}function Mo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Vu(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function IC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const RC=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},VC={}.hasOwnProperty;class Oa extends RC{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=vC()}copy(){const t=new Oa;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(jo(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Vo("data",this.frozen),this.namespace[t]=n,this):VC.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Vo("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ei(t),r=this.parser||this.Parser;return Io("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Io("process",this.parser||this.Parser),Ro("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=ei(t),l=r.parse(a);r.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const m=d,g=r.stringify(m,h);LC(g)?h.value=g:h.result=g,c(u,h)});function c(u,d){u||!d?o(u):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Io("processSync",this.parser||this.Parser),Ro("processSync",this.compiler||this.Compiler),this.process(t,i),Fu("processSync","process",n),r;function i(s,o){n=!0,Iu(s),r=o}}run(t,n,r){Du(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=ei(n);i.run(t,l,c);function c(u,d,h){const m=d||t;u?a(u):o?o(m):r(void 0,m,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),Fu("runSync","run",r),i;function s(o,a){Iu(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=ei(n),i=this.compiler||this.Compiler;return Ro("stringify",i),Du(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Vo("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=jo(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];s(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[m,...g]=u;const p=r[h][1];Cs(p)&&Cs(m)&&(m=jo(!0,p,m)),r[h]=[c,m,...g]}}}}const DC=new Oa().freeze();function Io(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ro(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Vo(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Du(e){if(!Cs(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Fu(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ei(e){return FC(e)?e:new Xh(e)}function FC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function LC(e){return typeof e=="string"||OC(e)}function OC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $C="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Lu=[],Ou={allowDangerousHtml:!0},_C=/^(https?|ircs?|mailto|xmpp)$/i,BC=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function zC(e){const t=HC(e),n=UC(e);return WC(t.runSync(t.parse(n),n),e)}function HC(e){const t=e.rehypePlugins||Lu,n=e.remarkPlugins||Lu,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ou}:Ou;return DC().use(SS).use(n).use(yC,r).use(t)}function UC(e){const t=e.children||"",n=new Xh;return typeof t=="string"&&(n.value=t),n}function WC(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||ZC;for(const u of BC)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+$C+u.id,void 0);return La(e,c),s2(e,{Fragment:f.Fragment,components:i,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function c(u,d,h){if(u.type==="raw"&&h&&typeof d=="number")return o?h.children.splice(d,1):h.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let m;for(m in Co)if(Object.hasOwn(Co,m)&&Object.hasOwn(u.properties,m)){const g=u.properties[m],p=Co[m];(p===null||p.includes(u.tagName))&&(u.properties[m]=l(String(g||""),m,u))}}if(u.type==="element"){let m=n?!n.includes(u.tagName):s?s.includes(u.tagName):!1;if(!m&&r&&typeof d=="number"&&(m=!r(u,d,h)),m&&h&&typeof d=="number")return a&&u.children?h.children.splice(d,1,...u.children):h.children.splice(d,1),d}}}function ZC(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||_C.test(e.slice(0,t))?e:""}function $u(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function qC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function GC(e,t,n){const i=Ui((n||{}).ignore||[]),s=KC(t);let o=-1;for(;++o<s.length;)Yh(e,"text",a);function a(c,u){let d=-1,h;for(;++d<u.length;){const m=u[d],g=h?h.children:void 0;if(i(m,g?g.indexOf(m):void 0,h))return;h=m}if(h)return l(c,u)}function l(c,u){const d=u[u.length-1],h=s[o][0],m=s[o][1];let g=0;const b=d.children.indexOf(c);let v=!1,k=[];h.lastIndex=0;let S=h.exec(c.value);for(;S;){const A=S.index,T={index:S.index,input:S.input,stack:[...u,c]};let C=m(...S,T);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?h.lastIndex=A+1:(g!==A&&k.push({type:"text",value:c.value.slice(g,A)}),Array.isArray(C)?k.push(...C):C&&k.push(C),g=A+S[0].length,v=!0),!h.global)break;S=h.exec(c.value)}return v?(g<c.value.length&&k.push({type:"text",value:c.value.slice(g)}),d.children.splice(b,1,...k)):k=[c],b+k.length}}function KC(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([YC(i[0]),XC(i[1])])}return t}function YC(e){return typeof e=="string"?new RegExp(qC(e),"g"):e}function XC(e){return typeof e=="function"?e:function(){return e}}const Do="phrasing",Fo=["autolink","link","image","label"];function QC(){return{transforms:[o4],enter:{literalAutolink:e4,literalAutolinkEmail:Lo,literalAutolinkHttp:Lo,literalAutolinkWww:Lo},exit:{literalAutolink:i4,literalAutolinkEmail:r4,literalAutolinkHttp:t4,literalAutolinkWww:n4}}}function JC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Do,notInConstruct:Fo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Do,notInConstruct:Fo},{character:":",before:"[ps]",after:"\\/",inConstruct:Do,notInConstruct:Fo}]}}function e4(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Lo(e){this.config.enter.autolinkProtocol.call(this,e)}function t4(e){this.config.exit.autolinkProtocol.call(this,e)}function n4(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function r4(e){this.config.exit.autolinkEmail.call(this,e)}function i4(e){this.exit(e)}function o4(e){GC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,s4],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),a4]],{ignore:["link","linkReference"]})}function s4(e,t,n,r,i){let s="";if(!Qh(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!l4(n)))return!1;const o=c4(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function a4(e,t,n,r){return!Qh(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function l4(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function c4(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=$u(e,"(");let s=$u(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Qh(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||vn(n)||Bi(n))&&(!t||n!==47)}Jh.peek=x4;function u4(){this.buffer()}function d4(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function f4(){this.buffer()}function h4(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function m4(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=jt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function p4(e){this.exit(e)}function g4(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=jt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function y4(e){this.exit(e)}function x4(){return"["}function Jh(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function b4(){return{enter:{gfmFootnoteCallString:u4,gfmFootnoteCall:d4,gfmFootnoteDefinitionLabelString:f4,gfmFootnoteDefinition:h4},exit:{gfmFootnoteCallString:m4,gfmFootnoteCall:p4,gfmFootnoteDefinitionLabelString:g4,gfmFootnoteDefinition:y4}}}function v4(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Jh},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let l=a.move("[^");const c=s.enter("footnoteDefinition"),u=s.enter("label");return l+=a.move(s.safe(s.associationId(r),{before:l,after:"]"})),u(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
121
- `:" ")+s.indentLines(s.containerFlow(r,a.current()),t?em:w4))),c(),l}}function w4(e,t,n){return t===0?e:em(e,t,n)}function em(e,t,n){return(n?"":" ")+e}const k4=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];tm.peek=A4;function S4(){return{canContainEols:["delete"],enter:{strikethrough:E4},exit:{strikethrough:T4}}}function C4(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:k4}],handlers:{delete:tm}}}function E4(e){this.enter({type:"delete",children:[]},e)}function T4(e){this.exit(e)}function tm(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function A4(){return"~"}function j4(e){return e.length}function P4(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||j4,s=[],o=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const p=[],b=[];let v=-1;for(e[u].length>c&&(c=e[u].length);++v<e[u].length;){const k=N4(e[u][v]);if(n.alignDelimiters!==!1){const S=i(k);b[v]=S,(l[v]===void 0||S>l[v])&&(l[v]=S)}p.push(k)}o[u]=p,a[u]=b}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)s[d]=_u(r[d]);else{const p=_u(r);for(;++d<c;)s[d]=p}d=-1;const h=[],m=[];for(;++d<c;){const p=s[d];let b="",v="";p===99?(b=":",v=":"):p===108?b=":":p===114&&(v=":");let k=n.alignDelimiters===!1?1:Math.max(1,l[d]-b.length-v.length);const S=b+"-".repeat(k)+v;n.alignDelimiters!==!1&&(k=b.length+k+v.length,k>l[d]&&(l[d]=k),m[d]=k),h[d]=S}o.splice(1,0,h),a.splice(1,0,m),u=-1;const g=[];for(;++u<o.length;){const p=o[u],b=a[u];d=-1;const v=[];for(;++d<c;){const k=p[d]||"";let S="",A="";if(n.alignDelimiters!==!1){const T=l[d]-(b[d]||0),C=s[d];C===114?S=" ".repeat(T):C===99?T%2?(S=" ".repeat(T/2+.5),A=" ".repeat(T/2-.5)):(S=" ".repeat(T/2),A=S):A=" ".repeat(T)}n.delimiterStart!==!1&&!d&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&k==="")&&(n.delimiterStart!==!1||d)&&v.push(" "),n.alignDelimiters!==!1&&v.push(S),v.push(k),n.alignDelimiters!==!1&&v.push(A),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&v.push("|")}g.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return g.join(`
122
- `)}function N4(e){return e==null?"":String(e)}function _u(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function M4(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),I4);return i(),o}function I4(e,t,n){return">"+(n?"":" ")+e}function R4(e,t){return Bu(e,t.inConstruct,!0)&&!Bu(e,t.notInConstruct,!1)}function Bu(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function zu(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
123
- `&&R4(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
124
- `}function V4(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function D4(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function F4(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function L4(e,t,n,r){const i=F4(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(D4(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(s,O4);return d(),h}const a=n.createTracker(r),l=i.repeat(Math.max(V4(s,i)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const d=n.enter(`codeFencedLang${o}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
119
+ `}),n}function $u(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _u(e,t){const n=IC(e,t),r=n.one(e,void 0),i=kC(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
120
+ `},i),s}function LC(e,t){return e&&"run"in e?async function(n,r){const i=_u(n,{file:r,...t});await e.run(i,r)}:function(n,r){return _u(n,{file:r,...e||t})}}function Bu(e){if(e)throw e}var Io,zu;function OC(){if(zu)return Io;zu=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},s=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),d=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!d)return!1;var h;for(h in c);return typeof h>"u"||e.call(c,h)},o=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return Io=function l(){var c,u,d,h,m,g,p=arguments[0],b=1,v=arguments.length,k=!1;for(typeof p=="boolean"&&(k=p,p=arguments[1]||{},b=2),(p==null||typeof p!="object"&&typeof p!="function")&&(p={});b<v;++b)if(c=arguments[b],c!=null)for(u in c)d=a(p,u),h=a(c,u),p!==h&&(k&&h&&(s(h)||(m=i(h)))?(m?(m=!1,g=d&&i(d)?d:[]):g=d&&s(d)?d:{},o(p,{name:u,newValue:l(k,g,h)})):typeof h<"u"&&o(p,{name:u,newValue:h}));return p},Io}var $C=OC();const Ro=Sa($C);function Ps(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 _C(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...c){const u=e[++s];let d=-1;if(l){o(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?BC(u,a)(...c):o(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function BC(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const It={basename:zC,dirname:HC,extname:UC,join:WC,sep:"/"};function zC(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Br(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function HC(e){if(Br(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function UC(e){Br(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function WC(...e){let t=-1,n;for(;++t<e.length;)Br(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":ZC(n)}function ZC(e){Br(e);const t=e.codePointAt(0)===47;let n=qC(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function qC(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function Br(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const GC={cwd:KC};function KC(){return"/"}function Ms(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function YC(e){if(typeof e=="string")e=new URL(e);else if(!Ms(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return XC(e)}function XC(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Vo=["history","path","basename","stem","extname","dirname"];class dm{constructor(t){let n;t?Ms(t)?n={path:t}:typeof t=="string"||QC(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":GC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Vo.length;){const s=Vo[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Vo.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?It.basename(this.path):void 0}set basename(t){Fo(t,"basename"),Do(t,"basename"),this.path=It.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?It.dirname(this.path):void 0}set dirname(t){Hu(this.basename,"dirname"),this.path=It.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?It.extname(this.path):void 0}set extname(t){if(Do(t,"extname"),Hu(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=It.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ms(t)&&(t=YC(t)),Fo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?It.basename(this.path,this.extname):void 0}set stem(t){Fo(t,"stem"),Do(t,"stem"),this.path=It.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new at(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Do(e,t){if(e&&e.includes(It.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+It.sep+"`")}function Fo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Hu(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function QC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JC=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},e4={}.hasOwnProperty;class Za extends JC{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=_C()}copy(){const t=new Za;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ro(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?($o("data",this.frozen),this.namespace[t]=n,this):e4.call(this.namespace,t)&&this.namespace[t]||void 0:t?($o("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ri(t),r=this.parser||this.Parser;return Lo("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Lo("process",this.parser||this.Parser),Oo("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=ri(t),l=r.parse(a);r.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const m=d,g=r.stringify(m,h);r4(g)?h.value=g:h.result=g,c(u,h)});function c(u,d){u||!d?o(u):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Lo("processSync",this.parser||this.Parser),Oo("processSync",this.compiler||this.Compiler),this.process(t,i),Wu("processSync","process",n),r;function i(s,o){n=!0,Bu(s),r=o}}run(t,n,r){Uu(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=ri(n);i.run(t,l,c);function c(u,d,h){const m=d||t;u?a(u):o?o(m):r(void 0,m,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),Wu("runSync","run",r),i;function s(o,a){Bu(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=ri(n),i=this.compiler||this.Compiler;return Oo("stringify",i),Uu(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if($o("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=Ro(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];s(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[m,...g]=u;const p=r[h][1];Ps(p)&&Ps(m)&&(m=Ro(!0,p,m)),r[h]=[c,m,...g]}}}}const t4=new Za().freeze();function Lo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Oo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $o(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Uu(e){if(!Ps(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Wu(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ri(e){return n4(e)?e:new dm(e)}function n4(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function r4(e){return typeof e=="string"||i4(e)}function i4(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const o4="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Zu=[],qu={allowDangerousHtml:!0},s4=/^(https?|ircs?|mailto|xmpp)$/i,a4=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function l4(e){const t=c4(e),n=u4(e);return d4(t.runSync(t.parse(n),n),e)}function c4(e){const t=e.rehypePlugins||Zu,n=e.remarkPlugins||Zu,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...qu}:qu;return t4().use(HS).use(n).use(LC,r).use(t)}function u4(e){const t=e.children||"",n=new dm;return typeof t=="string"&&(n.value=t),n}function d4(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||f4;for(const u of a4)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+o4+u.id,void 0);return Wa(e,c),T2(e,{Fragment:f.Fragment,components:i,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function c(u,d,h){if(u.type==="raw"&&h&&typeof d=="number")return o?h.children.splice(d,1):h.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let m;for(m in Po)if(Object.hasOwn(Po,m)&&Object.hasOwn(u.properties,m)){const g=u.properties[m],p=Po[m];(p===null||p.includes(u.tagName))&&(u.properties[m]=l(String(g||""),m,u))}}if(u.type==="element"){let m=n?!n.includes(u.tagName):s?s.includes(u.tagName):!1;if(!m&&r&&typeof d=="number"&&(m=!r(u,d,h)),m&&h&&typeof d=="number")return a&&u.children?h.children.splice(d,1,...u.children):h.children.splice(d,1),d}}}function f4(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||s4.test(e.slice(0,t))?e:""}function Gu(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function h4(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function m4(e,t,n){const i=Ki((n||{}).ignore||[]),s=p4(t);let o=-1;for(;++o<s.length;)um(e,"text",a);function a(c,u){let d=-1,h;for(;++d<u.length;){const m=u[d],g=h?h.children:void 0;if(i(m,g?g.indexOf(m):void 0,h))return;h=m}if(h)return l(c,u)}function l(c,u){const d=u[u.length-1],h=s[o][0],m=s[o][1];let g=0;const b=d.children.indexOf(c);let v=!1,k=[];h.lastIndex=0;let S=h.exec(c.value);for(;S;){const A=S.index,T={index:S.index,input:S.input,stack:[...u,c]};let C=m(...S,T);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?h.lastIndex=A+1:(g!==A&&k.push({type:"text",value:c.value.slice(g,A)}),Array.isArray(C)?k.push(...C):C&&k.push(C),g=A+S[0].length,v=!0),!h.global)break;S=h.exec(c.value)}return v?(g<c.value.length&&k.push({type:"text",value:c.value.slice(g)}),d.children.splice(b,1,...k)):k=[c],b+k.length}}function p4(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([g4(i[0]),y4(i[1])])}return t}function g4(e){return typeof e=="string"?new RegExp(h4(e),"g"):e}function y4(e){return typeof e=="function"?e:function(){return e}}const _o="phrasing",Bo=["autolink","link","image","label"];function x4(){return{transforms:[E4],enter:{literalAutolink:v4,literalAutolinkEmail:zo,literalAutolinkHttp:zo,literalAutolinkWww:zo},exit:{literalAutolink:C4,literalAutolinkEmail:S4,literalAutolinkHttp:w4,literalAutolinkWww:k4}}}function b4(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:_o,notInConstruct:Bo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:_o,notInConstruct:Bo},{character:":",before:"[ps]",after:"\\/",inConstruct:_o,notInConstruct:Bo}]}}function v4(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function zo(e){this.config.enter.autolinkProtocol.call(this,e)}function w4(e){this.config.exit.autolinkProtocol.call(this,e)}function k4(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function S4(e){this.config.exit.autolinkEmail.call(this,e)}function C4(e){this.exit(e)}function E4(e){m4(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,T4],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),A4]],{ignore:["link","linkReference"]})}function T4(e,t,n,r,i){let s="";if(!fm(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!j4(n)))return!1;const o=P4(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function A4(e,t,n,r){return!fm(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function j4(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function P4(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Gu(e,"(");let s=Gu(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function fm(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||kn(n)||Zi(n))&&(!t||n!==47)}hm.peek=O4;function M4(){this.buffer()}function N4(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function I4(){this.buffer()}function R4(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function V4(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Pt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function D4(e){this.exit(e)}function F4(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Pt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function L4(e){this.exit(e)}function O4(){return"["}function hm(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function $4(){return{enter:{gfmFootnoteCallString:M4,gfmFootnoteCall:N4,gfmFootnoteDefinitionLabelString:I4,gfmFootnoteDefinition:R4},exit:{gfmFootnoteCallString:V4,gfmFootnoteCall:D4,gfmFootnoteDefinitionLabelString:F4,gfmFootnoteDefinition:L4}}}function _4(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:hm},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let l=a.move("[^");const c=s.enter("footnoteDefinition"),u=s.enter("label");return l+=a.move(s.safe(s.associationId(r),{before:l,after:"]"})),u(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
121
+ `:" ")+s.indentLines(s.containerFlow(r,a.current()),t?mm:B4))),c(),l}}function B4(e,t,n){return t===0?e:mm(e,t,n)}function mm(e,t,n){return(n?"":" ")+e}const z4=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];pm.peek=q4;function H4(){return{canContainEols:["delete"],enter:{strikethrough:W4},exit:{strikethrough:Z4}}}function U4(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:z4}],handlers:{delete:pm}}}function W4(e){this.enter({type:"delete",children:[]},e)}function Z4(e){this.exit(e)}function pm(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function q4(){return"~"}function G4(e){return e.length}function K4(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||G4,s=[],o=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const p=[],b=[];let v=-1;for(e[u].length>c&&(c=e[u].length);++v<e[u].length;){const k=Y4(e[u][v]);if(n.alignDelimiters!==!1){const S=i(k);b[v]=S,(l[v]===void 0||S>l[v])&&(l[v]=S)}p.push(k)}o[u]=p,a[u]=b}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)s[d]=Ku(r[d]);else{const p=Ku(r);for(;++d<c;)s[d]=p}d=-1;const h=[],m=[];for(;++d<c;){const p=s[d];let b="",v="";p===99?(b=":",v=":"):p===108?b=":":p===114&&(v=":");let k=n.alignDelimiters===!1?1:Math.max(1,l[d]-b.length-v.length);const S=b+"-".repeat(k)+v;n.alignDelimiters!==!1&&(k=b.length+k+v.length,k>l[d]&&(l[d]=k),m[d]=k),h[d]=S}o.splice(1,0,h),a.splice(1,0,m),u=-1;const g=[];for(;++u<o.length;){const p=o[u],b=a[u];d=-1;const v=[];for(;++d<c;){const k=p[d]||"";let S="",A="";if(n.alignDelimiters!==!1){const T=l[d]-(b[d]||0),C=s[d];C===114?S=" ".repeat(T):C===99?T%2?(S=" ".repeat(T/2+.5),A=" ".repeat(T/2-.5)):(S=" ".repeat(T/2),A=S):A=" ".repeat(T)}n.delimiterStart!==!1&&!d&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&k==="")&&(n.delimiterStart!==!1||d)&&v.push(" "),n.alignDelimiters!==!1&&v.push(S),v.push(k),n.alignDelimiters!==!1&&v.push(A),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&v.push("|")}g.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return g.join(`
122
+ `)}function Y4(e){return e==null?"":String(e)}function Ku(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function X4(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),Q4);return i(),o}function Q4(e,t,n){return">"+(n?"":" ")+e}function J4(e,t){return Yu(e,t.inConstruct,!0)&&!Yu(e,t.notInConstruct,!1)}function Yu(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Xu(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
123
+ `&&J4(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
124
+ `}function e6(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function t6(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function n6(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function r6(e,t,n,r){const i=n6(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(t6(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(s,i6);return d(),h}const a=n.createTracker(r),l=i.repeat(Math.max(e6(s,i)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const d=n.enter(`codeFencedLang${o}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
125
125
  `,encode:["`"],...a.current()})),d()}return u+=a.move(`
126
126
  `),s&&(u+=a.move(s+`
127
- `)),u+=a.move(l),c(),u}function O4(e,t,n){return(n?"":" ")+e}function $a(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function $4(e,t,n,r){const i=$a(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
128
- `,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),o(),c}function _4(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Pr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ei(e,t,n){const r=Zn(e),i=Zn(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}nm.peek=B4;function nm(e,t,n,r){const i=_4(n),s=n.enter("emphasis"),o=n.createTracker(r),a=o.move(i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),u=Ei(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=Pr(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Ei(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+Pr(d));const m=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+m}function B4(e,t,n){return n.options.emphasis||"*"}function z4(e,t){let n=!1;return La(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ks}),!!((!e.depth||e.depth<3)&&Na(e)&&(t.options.setext||n))}function H4(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(z4(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
127
+ `)),u+=a.move(l),c(),u}function i6(e,t,n){return(n?"":" ")+e}function qa(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function o6(e,t,n,r){const i=qa(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
128
+ `,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),o(),c}function s6(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ir(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Pi(e,t,n){const r=Kn(e),i=Kn(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}gm.peek=a6;function gm(e,t,n,r){const i=s6(n),s=n.enter("emphasis"),o=n.createTracker(r),a=o.move(i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),u=Pi(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=Ir(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Pi(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+Ir(d));const m=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+m}function a6(e,t,n){return n.options.emphasis||"*"}function l6(e,t){let n=!1;return Wa(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,As}),!!((!e.depth||e.depth<3)&&Oa(e)&&(t.options.setext||n))}function c6(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(l6(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
129
129
  `,after:`
130
130
  `});return d(),u(),h+`
131
131
  `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
132
132
  `))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
133
- `,...s.current()});return/^[\t ]/.test(c)&&(c=Pr(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}rm.peek=U4;function rm(e){return e.value||""}function U4(){return"<"}im.peek=W4;function im(e,t,n,r){const i=$a(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),o(),c}function W4(){return"!"}om.peek=Z4;function om(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Z4(){return"!"}sm.peek=q4;function sm(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function q4(){return"`"}function am(e,t){const n=Na(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}lm.peek=G4;function lm(e,t,n,r){const i=$a(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(am(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),a(),n.stack=u,d}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),a(),c}function G4(e,t,n){return am(e,n)?"<":"["}cm.peek=K4;function cm(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function K4(){return"["}function _a(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Y4(e){const t=_a(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function X4(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function um(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Q4(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?X4(n):_a(n);const a=e.ordered?o==="."?")":".":Y4(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),um(n)===o&&u){let d=-1;for(;++d<e.children.length;){const h=e.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const c=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),c}function J4(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function e6(e,t,n,r){const i=J4(n);let s=n.bulletCurrent||_a(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(d,h,m){return h?(m?"":" ".repeat(o))+d:(m?s:s+" ".repeat(o-s.length))+d}}function t6(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const n6=Ui(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function r6(e,t,n,r){return(e.children.some(function(o){return n6(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function i6(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}dm.peek=o6;function dm(e,t,n,r){const i=i6(n),s=n.enter("strong"),o=n.createTracker(r),a=o.move(i+i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),u=Ei(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=Pr(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Ei(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+Pr(d));const m=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+m}function o6(e,t,n){return n.options.strong||"*"}function s6(e,t,n,r){return n.safe(e.value,r)}function a6(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function l6(e,t,n){const r=(um(n)+(n.options.ruleSpaces?" ":"")).repeat(a6(n));return n.options.ruleSpaces?r.slice(0,-1):r}const fm={blockquote:M4,break:zu,code:L4,definition:$4,emphasis:nm,hardBreak:zu,heading:H4,html:rm,image:im,imageReference:om,inlineCode:sm,link:lm,linkReference:cm,list:Q4,listItem:e6,paragraph:t6,root:r6,strong:dm,text:s6,thematicBreak:l6};function c6(){return{enter:{table:u6,tableData:Hu,tableHeader:Hu,tableRow:f6},exit:{codeText:h6,table:d6,tableData:Oo,tableHeader:Oo,tableRow:Oo}}}function u6(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function d6(e){this.exit(e),this.data.inTable=void 0}function f6(e){this.enter({type:"tableRow",children:[]},e)}function Oo(e){this.exit(e)}function Hu(e){this.enter({type:"tableCell",children:[]},e)}function h6(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,m6));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function m6(e,t){return t==="|"?t:e}function p6(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
133
+ `,...s.current()});return/^[\t ]/.test(c)&&(c=Ir(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}ym.peek=u6;function ym(e){return e.value||""}function u6(){return"<"}xm.peek=d6;function xm(e,t,n,r){const i=qa(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),o(),c}function d6(){return"!"}bm.peek=f6;function bm(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function f6(){return"!"}vm.peek=h6;function vm(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function h6(){return"`"}function wm(e,t){const n=Oa(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}km.peek=m6;function km(e,t,n,r){const i=qa(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(wm(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),a(),n.stack=u,d}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),a(),c}function m6(e,t,n){return wm(e,n)?"<":"["}Sm.peek=p6;function Sm(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function p6(){return"["}function Ga(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function g6(e){const t=Ga(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function y6(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Cm(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function x6(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?y6(n):Ga(n);const a=e.ordered?o==="."?")":".":g6(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Cm(n)===o&&u){let d=-1;for(;++d<e.children.length;){const h=e.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const c=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),c}function b6(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function v6(e,t,n,r){const i=b6(n);let s=n.bulletCurrent||Ga(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(d,h,m){return h?(m?"":" ".repeat(o))+d:(m?s:s+" ".repeat(o-s.length))+d}}function w6(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const k6=Ki(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function S6(e,t,n,r){return(e.children.some(function(o){return k6(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function C6(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Em.peek=E6;function Em(e,t,n,r){const i=C6(n),s=n.enter("strong"),o=n.createTracker(r),a=o.move(i+i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),u=Pi(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=Ir(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Pi(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+Ir(d));const m=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+m}function E6(e,t,n){return n.options.strong||"*"}function T6(e,t,n,r){return n.safe(e.value,r)}function A6(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function j6(e,t,n){const r=(Cm(n)+(n.options.ruleSpaces?" ":"")).repeat(A6(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Tm={blockquote:X4,break:Xu,code:r6,definition:o6,emphasis:gm,hardBreak:Xu,heading:c6,html:ym,image:xm,imageReference:bm,inlineCode:vm,link:km,linkReference:Sm,list:x6,listItem:v6,paragraph:w6,root:S6,strong:Em,text:T6,thematicBreak:j6};function P6(){return{enter:{table:M6,tableData:Qu,tableHeader:Qu,tableRow:I6},exit:{codeText:R6,table:N6,tableData:Ho,tableHeader:Ho,tableRow:Ho}}}function M6(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function N6(e){this.exit(e),this.data.inTable=void 0}function I6(e){this.enter({type:"tableRow",children:[]},e)}function Ho(e){this.exit(e)}function Qu(e){this.enter({type:"tableCell",children:[]},e)}function R6(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,V6));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function V6(e,t){return t==="|"?t:e}function D6(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
134
134
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:l,tableRow:a}};function o(m,g,p,b){return c(u(m,p,b),m.align)}function a(m,g,p,b){const v=d(m,p,b),k=c([v]);return k.slice(0,k.indexOf(`
135
- `))}function l(m,g,p,b){const v=p.enter("tableCell"),k=p.enter("phrasing"),S=p.containerPhrasing(m,{...b,before:s,after:s});return k(),v(),S}function c(m,g){return P4(m,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function u(m,g,p){const b=m.children;let v=-1;const k=[],S=g.enter("table");for(;++v<b.length;)k[v]=d(b[v],g,p);return S(),k}function d(m,g,p){const b=m.children;let v=-1;const k=[],S=g.enter("tableRow");for(;++v<b.length;)k[v]=l(b[v],m,g,p);return S(),k}function h(m,g,p){let b=fm.inlineCode(m,g,p);return p.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function g6(){return{exit:{taskListCheckValueChecked:Uu,taskListCheckValueUnchecked:Uu,paragraph:x6}}}function y6(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:b6}}}function Uu(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function x6(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function b6(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=fm.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+o}}function v6(){return[QC(),b4(),S4(),c6(),g6()]}function w6(e){return{extensions:[JC(),v4(e),C4(),p6(e),y6()]}}const k6={tokenize:j6,partial:!0},hm={tokenize:P6,partial:!0},mm={tokenize:N6,partial:!0},pm={tokenize:M6,partial:!0},S6={tokenize:I6,partial:!0},gm={name:"wwwAutolink",tokenize:T6,previous:xm},ym={name:"protocolAutolink",tokenize:A6,previous:bm},Wt={name:"emailAutolink",tokenize:E6,previous:vm},Vt={};function C6(){return{text:Vt}}let un=48;for(;un<123;)Vt[un]=Wt,un++,un===58?un=65:un===91&&(un=97);Vt[43]=Wt;Vt[45]=Wt;Vt[46]=Wt;Vt[95]=Wt;Vt[72]=[Wt,ym];Vt[104]=[Wt,ym];Vt[87]=[Wt,gm];Vt[119]=[Wt,gm];function E6(e,t,n){const r=this;let i,s;return o;function o(d){return!Ts(d)||!vm.call(r,r.previous)||Ba(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return Ts(d)?(e.consume(d),a):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(S6,u,c)(d):d===45||d===95||ot(d)?(s=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return s&&i&&at(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function T6(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!xm.call(r,r.previous)||Ba(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(k6,e.attempt(hm,e.attempt(mm,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function A6(e,t,n){const r=this;let i="",s=!1;return o;function o(d){return(d===72||d===104)&&bm.call(r,r.previous)&&!Ba(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(at(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),s?c:(s=!0,l)):n(d)}function c(d){return d===null||ki(d)||Le(d)||vn(d)||Bi(d)?n(d):e.attempt(hm,e.attempt(mm,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function j6(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function P6(e,t,n){let r,i,s;return o;function o(c){return c===46||c===95?e.check(pm,l,a)(c):c===null||Le(c)||vn(c)||c!==45&&Bi(c)?l(c):(s=!0,e.consume(c),o)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),o}function l(c){return i||r||!s?n(c):t(c)}}function N6(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(pm,t,s)(o):o===null||Le(o)||vn(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function M6(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||Le(a)||vn(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Le(a)||vn(a)?t(a):r(a)}function s(a){return at(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):at(a)?(e.consume(a),o):n(a)}}function I6(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return ot(s)?n(s):t(s)}}function xm(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Le(e)}function bm(e){return!at(e)}function vm(e){return!(e===47||Ts(e))}function Ts(e){return e===43||e===45||e===46||e===95||ot(e)}function Ba(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const R6={tokenize:B6,partial:!0};function V6(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:O6,continuation:{tokenize:$6},exit:_6}},text:{91:{name:"gfmFootnoteCall",tokenize:L6},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:D6,resolveTo:F6}}}}function D6(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const c=jt(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function F6(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function L6(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(s>999||d===93&&!o||d===null||d===91||Le(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(jt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Le(d)||(o=!0),s++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),s++,c):c(d)}}function O6(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(g)}function u(g){if(o>999||g===93&&!a||g===null||g===91||Le(g))return n(g);if(g===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return s=jt(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Le(g)||(a=!0),o++,e.consume(g),g===92?d:u}function d(g){return g===91||g===92||g===93?(e.consume(g),o++,u):u(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(s)||i.push(s),Ee(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function $6(e,t,n){return e.check(Lr,t,e.attempt(R6,t,n))}function _6(e){e.exit("gfmFootnoteDefinition")}function B6(e,t,n){const r=this;return Ee(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function z6(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},d={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},h=[["enter",u,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",d,a]],m=a.parser.constructs.insideSpan.null;m&&yt(h,h.length,0,zi(m,o.slice(c+1,l),a)),yt(h,h.length,0,[["exit",d,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",u,a]]),yt(o,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const c=this.previous,u=this.events;let d=0;return h;function h(g){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(g):(o.enter("strikethroughSequenceTemporary"),m(g))}function m(g){const p=Zn(c);if(g===126)return d>1?l(g):(o.consume(g),d++,m);if(d<2&&!n)return l(g);const b=o.exit("strikethroughSequenceTemporary"),v=Zn(g);return b._open=!v||v===2&&!!p,b._close=!p||p===2&&!!v,a(g)}}}class H6{constructor(){this.map=[]}add(t,n,r){U6(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function U6(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function W6(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Z6(){return{flow:{null:{name:"table",tokenize:q6,resolveAll:G6}}}}function q6(e,t,n){const r=this;let i=0,s=0,o;return a;function a(y){let N=r.events.length-1;for(;N>-1;){const H=r.events[N][1].type;if(H==="lineEnding"||H==="linePrefix")N--;else break}const D=N>-1?r.events[N][1].type:null,B=D==="tableHead"||D==="tableRow"?C:l;return B===C&&r.parser.lazy[r.now().line]?n(y):B(y)}function l(y){return e.enter("tableHead"),e.enter("tableRow"),c(y)}function c(y){return y===124||(o=!0,s+=1),u(y)}function u(y){return y===null?n(y):he(y)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),m):n(y):Se(y)?Ee(e,u,"whitespace")(y):(s+=1,o&&(o=!1,i+=1),y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),o=!0,u):(e.enter("data"),d(y)))}function d(y){return y===null||y===124||Le(y)?(e.exit("data"),u(y)):(e.consume(y),y===92?h:d)}function h(y){return y===92||y===124?(e.consume(y),d):d(y)}function m(y){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(y):(e.enter("tableDelimiterRow"),o=!1,Se(y)?Ee(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):g(y))}function g(y){return y===45||y===58?b(y):y===124?(o=!0,e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),p):T(y)}function p(y){return Se(y)?Ee(e,b,"whitespace")(y):b(y)}function b(y){return y===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),v):y===45?(s+=1,v(y)):y===null||he(y)?A(y):T(y)}function v(y){return y===45?(e.enter("tableDelimiterFiller"),k(y)):T(y)}function k(y){return y===45?(e.consume(y),k):y===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(y))}function S(y){return Se(y)?Ee(e,A,"whitespace")(y):A(y)}function A(y){return y===124?g(y):y===null||he(y)?!o||i!==s?T(y):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(y)):T(y)}function T(y){return n(y)}function C(y){return e.enter("tableRow"),M(y)}function M(y){return y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),M):y===null||he(y)?(e.exit("tableRow"),t(y)):Se(y)?Ee(e,M,"whitespace")(y):(e.enter("data"),P(y))}function P(y){return y===null||y===124||Le(y)?(e.exit("data"),M(y)):(e.consume(y),y===92?L:P)}function L(y){return y===92||y===124?(e.consume(y),P):P(y)}}function G6(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,u,d;const h=new H6;for(;++n<e.length;){const m=e[n],g=m[1];m[0]==="enter"?g.type==="tableHead"?(a=!1,l!==0&&(Wu(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",c,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])),i=g.type==="tableDelimiterRow"?2:u?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],d=ti(h,t,s,i,void 0,d),s=[0,0,0,0]),o[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],d=ti(h,t,s,i,void 0,d)),s=o,o=[s[1],n,0,0])):g.type==="tableHead"?(a=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],d=ti(h,t,s,i,n,d)):o[1]!==0&&(d=ti(h,t,o,i,n,d)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&Wu(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=W6(t.events,n))}return e}function ti(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},In(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=In(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=In(t.events,n[2]),u=In(t.events,n[3]),d={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],m=t.events[n[3]];if(h[1].end=Object.assign({},m[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,p=n[3]-n[2]-1;e.add(g,p,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(s.end=Object.assign({},In(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function Wu(e,t,n,r,i){const s=[],o=In(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function In(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const K6={name:"tasklistCheck",tokenize:X6};function Y6(){return{text:{91:K6}}}function X6(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return Le(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return he(l)?t(l):Se(l)?e.check({tokenize:Q6},t,n)(l):n(l)}}function Q6(e,t,n){return Ee(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function J6(e){return Mh([C6(),V6(),z6(e),Z6(),Y6()])}const eE={};function tE(e){const t=this,n=e||eE,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(J6(n)),s.push(v6()),o.push(w6(n))}function nE({onSendMessage:e,onSendAttachments:t,disabled:n,theme:r,onEndChat:i}){const[s,o]=x.useState(""),[a,l]=x.useState(!1),c=x.useRef(null),u=x.useRef(null),[d,h]=x.useState(!1),m=et(r);x.useEffect(()=>{const A=()=>{const T=navigator.userAgent.toLowerCase(),M=["android","iphone","ipad","mobile","tablet"].some(y=>T.includes(y)),P="ontouchstart"in window||navigator.maxTouchPoints>0,L=window.innerWidth<=768;h(M||P&&L)};return A(),window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[]);const g=A=>{A.preventDefault(),s.trim()&&!n&&(e(s.trim()),o(""))},p=A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),g(A))},b=A=>{const T=A.target.files;if(T&&T.length>0){const C=Array.from(T),M=C.filter(P=>P.type.startsWith("image/"));if(M.length===0){console.warn("No valid image files selected");return}M.length!==C.length&&console.warn("Some non-image files were filtered out"),t(M),c.current&&(c.current.value="")}},v=()=>{!n&&c.current&&c.current.click()},k=()=>{!n&&d&&u.current&&u.current.click()},S=A=>{const T=A.target.files;if(T&&T.length>0){const C=T[0];C.type.startsWith("image/")?t([C]):console.warn("Selected file is not an image"),u.current&&(u.current.value="")}};return f.jsx("div",{className:"px-4 py-3 !w-full backdrop-blur-xl border-0 shadow-lg ",children:f.jsx("form",{onSubmit:g,className:"flex items-center !w-full mx-auto max-w-4xl",children:f.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":m.chatInput.container}`,children:[f.jsx(ge.button,{type:"button",onClick:v,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${m.chatInput.attachButton}`,disabled:n,"aria-label":"Attach file",children:f.jsx(Ze.Paperclip,{className:"w-4 h-4"})}),d&&f.jsx(ge.button,{type:"button",onClick:k,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${m.chatInput.attachButton}`,disabled:n,"aria-label":"Take photo",children:f.jsx(Ze.Camera,{className:"w-4 h-4"})}),f.jsx("input",{ref:c,type:"file",multiple:!0,onChange:b,className:"hidden",accept:"image/*"}),f.jsx("input",{ref:u,type:"file",onChange:S,className:"hidden",accept:"image/*",capture:"environment"}),f.jsx("textarea",{value:s,onChange:A=>o(A.target.value),onKeyDown:p,onFocus:()=>l(!0),onBlur:()=>l(!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 ${m.chatInput.textarea}`,rows:1,style:{height:"auto",minHeight:"32px"},onInput:A=>{const T=A.target;T.style.height="auto",T.style.height=`${Math.min(T.scrollHeight,80)}px`}}),f.jsx(ge.button,{type:"submit",disabled:n||!s.trim(),whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 flex-shrink-0 ${s.trim()&&!n?m.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:f.jsx(Ze.SendHorizontal,{className:"w-4 h-4"})}),i&&f.jsx(ge.button,{type:"button",onClick:i,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 flex-shrink-0 ${m.chatInput.endButton}`,"aria-label":"End chat",children:f.jsx(Ze.PhoneOff,{className:"w-4 h-4"})})]})})})}function rE({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[i,s]=x.useState(""),[o,a]=x.useState(0);return x.useEffect(()=>{if(n){s(e);return}if(t){s(e);return}if(o<e.length){const l=setTimeout(()=>{s(e.slice(0,o+1)),a(o+1)},r);return()=>clearTimeout(l)}},[e,o,t,r,n]),x.useEffect(()=>{n||(a(0),s(""))},[e,n]),f.jsxs("span",{className:"relative",children:[f.jsx("span",{className:"inline-block",children:i}),!t&&f.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(l=>f.jsx(ge.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:l*.2,ease:"easeInOut"}},l))})]})}function iE({message:e,theme:t,isOwn:n,isStreaming:r=!1}){var l,c,u,d;const i=et(t),s=e.sender.name?e.sender.name.split(" ").map(h=>h[0]).join("").toUpperCase().slice(0,2):"U",o=((l=e==null?void 0:e.metadata)==null?void 0:l.format)==="markdown"||((c=e==null?void 0:e.metadata)==null?void 0:c.markdown)===!0||/(\n|^)#\s|\n##\s|```|\*\s|\-\s|\d+\.\s|>\s|!\[|\]\(https?:\/\//.test(e.content),a={h1:h=>f.jsx("h1",{className:"text-lg font-semibold mt-2 mb-1",...h}),h2:h=>f.jsx("h2",{className:"text-base font-semibold mt-2 mb-1",...h}),h3:h=>f.jsx("h3",{className:"text-sm font-semibold mt-2 mb-1",...h}),p:h=>f.jsx("p",{className:"my-1 leading-relaxed",...h}),a:({href:h,children:m,...g})=>f.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"underline text-blue-600 dark:text-blue-400 hover:opacity-80",...g,children:m}),code:({inline:h,children:m,...g})=>h?f.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded text-[0.85em]",...g,children:m}):f.jsx("pre",{className:"bg-gray-100 dark:bg-gray-800 rounded-md p-3 overflow-x-auto text-[0.85em]",children:f.jsx("code",{...g,children:m})}),ul:h=>f.jsx("ul",{className:"list-disc pl-5 my-1 space-y-1",...h}),ol:h=>f.jsx("ol",{className:"list-decimal pl-5 my-1 space-y-1",...h}),li:h=>f.jsx("li",{className:"leading-relaxed",...h}),blockquote:h=>f.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-3 italic my-2",...h}),img:h=>f.jsx("img",{className:"max-w-full h-auto rounded-md my-2",...h}),table:h=>f.jsx("div",{className:"overflow-x-auto my-2",children:f.jsx("table",{className:"min-w-full text-left text-sm",...h})}),th:h=>f.jsx("th",{className:"border-b border-gray-300 dark:border-gray-600 px-2 py-1 font-semibold",...h}),td:h=>f.jsx("td",{className:"border-b border-gray-200 dark:border-gray-700 px-2 py-1 align-top",...h})};return f.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-1`,children:f.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 max-w-[85%] min-w-0`,children:[f.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:s}),f.jsxs("div",{className:`
135
+ `))}function l(m,g,p,b){const v=p.enter("tableCell"),k=p.enter("phrasing"),S=p.containerPhrasing(m,{...b,before:s,after:s});return k(),v(),S}function c(m,g){return K4(m,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function u(m,g,p){const b=m.children;let v=-1;const k=[],S=g.enter("table");for(;++v<b.length;)k[v]=d(b[v],g,p);return S(),k}function d(m,g,p){const b=m.children;let v=-1;const k=[],S=g.enter("tableRow");for(;++v<b.length;)k[v]=l(b[v],m,g,p);return S(),k}function h(m,g,p){let b=Tm.inlineCode(m,g,p);return p.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function F6(){return{exit:{taskListCheckValueChecked:Ju,taskListCheckValueUnchecked:Ju,paragraph:O6}}}function L6(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:$6}}}function Ju(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function O6(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function $6(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=Tm.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+o}}function _6(){return[x4(),$4(),H4(),P6(),F6()]}function B6(e){return{extensions:[b4(),_4(e),U4(),D6(e),L6()]}}const z6={tokenize:G6,partial:!0},Am={tokenize:K6,partial:!0},jm={tokenize:Y6,partial:!0},Pm={tokenize:X6,partial:!0},H6={tokenize:Q6,partial:!0},Mm={name:"wwwAutolink",tokenize:Z6,previous:Im},Nm={name:"protocolAutolink",tokenize:q6,previous:Rm},qt={name:"emailAutolink",tokenize:W6,previous:Vm},Dt={};function U6(){return{text:Dt}}let fn=48;for(;fn<123;)Dt[fn]=qt,fn++,fn===58?fn=65:fn===91&&(fn=97);Dt[43]=qt;Dt[45]=qt;Dt[46]=qt;Dt[95]=qt;Dt[72]=[qt,Nm];Dt[104]=[qt,Nm];Dt[87]=[qt,Mm];Dt[119]=[qt,Mm];function W6(e,t,n){const r=this;let i,s;return o;function o(d){return!Ns(d)||!Vm.call(r,r.previous)||Ka(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return Ns(d)?(e.consume(d),a):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(H6,u,c)(d):d===45||d===95||st(d)?(s=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return s&&i&&lt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function Z6(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!Im.call(r,r.previous)||Ka(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(z6,e.attempt(Am,e.attempt(jm,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function q6(e,t,n){const r=this;let i="",s=!1;return o;function o(d){return(d===72||d===104)&&Rm.call(r,r.previous)&&!Ka(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(lt(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),s?c:(s=!0,l)):n(d)}function c(d){return d===null||Ti(d)||Le(d)||kn(d)||Zi(d)?n(d):e.attempt(Am,e.attempt(jm,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function G6(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function K6(e,t,n){let r,i,s;return o;function o(c){return c===46||c===95?e.check(Pm,l,a)(c):c===null||Le(c)||kn(c)||c!==45&&Zi(c)?l(c):(s=!0,e.consume(c),o)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),o}function l(c){return i||r||!s?n(c):t(c)}}function Y6(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Pm,t,s)(o):o===null||Le(o)||kn(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function X6(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||Le(a)||kn(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Le(a)||kn(a)?t(a):r(a)}function s(a){return lt(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):lt(a)?(e.consume(a),o):n(a)}}function Q6(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return st(s)?n(s):t(s)}}function Im(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Le(e)}function Rm(e){return!lt(e)}function Vm(e){return!(e===47||Ns(e))}function Ns(e){return e===43||e===45||e===46||e===95||st(e)}function Ka(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const J6={tokenize:aE,partial:!0};function eE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:iE,continuation:{tokenize:oE},exit:sE}},text:{91:{name:"gfmFootnoteCall",tokenize:rE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:tE,resolveTo:nE}}}}function tE(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const c=Pt(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function nE(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function rE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(s>999||d===93&&!o||d===null||d===91||Le(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Pt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Le(d)||(o=!0),s++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),s++,c):c(d)}}function iE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(g)}function u(g){if(o>999||g===93&&!a||g===null||g===91||Le(g))return n(g);if(g===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return s=Pt(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Le(g)||(a=!0),o++,e.consume(g),g===92?d:u}function d(g){return g===91||g===92||g===93?(e.consume(g),o++,u):u(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(s)||i.push(s),Ee(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function oE(e,t,n){return e.check(_r,t,e.attempt(J6,t,n))}function sE(e){e.exit("gfmFootnoteDefinition")}function aE(e,t,n){const r=this;return Ee(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function lE(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},d={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},h=[["enter",u,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",d,a]],m=a.parser.constructs.insideSpan.null;m&&xt(h,h.length,0,qi(m,o.slice(c+1,l),a)),xt(h,h.length,0,[["exit",d,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",u,a]]),xt(o,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const c=this.previous,u=this.events;let d=0;return h;function h(g){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(g):(o.enter("strikethroughSequenceTemporary"),m(g))}function m(g){const p=Kn(c);if(g===126)return d>1?l(g):(o.consume(g),d++,m);if(d<2&&!n)return l(g);const b=o.exit("strikethroughSequenceTemporary"),v=Kn(g);return b._open=!v||v===2&&!!p,b._close=!p||p===2&&!!v,a(g)}}}class cE{constructor(){this.map=[]}add(t,n,r){uE(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function uE(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function dE(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function fE(){return{flow:{null:{name:"table",tokenize:hE,resolveAll:mE}}}}function hE(e,t,n){const r=this;let i=0,s=0,o;return a;function a(y){let M=r.events.length-1;for(;M>-1;){const H=r.events[M][1].type;if(H==="lineEnding"||H==="linePrefix")M--;else break}const D=M>-1?r.events[M][1].type:null,B=D==="tableHead"||D==="tableRow"?C:l;return B===C&&r.parser.lazy[r.now().line]?n(y):B(y)}function l(y){return e.enter("tableHead"),e.enter("tableRow"),c(y)}function c(y){return y===124||(o=!0,s+=1),u(y)}function u(y){return y===null?n(y):he(y)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),m):n(y):Se(y)?Ee(e,u,"whitespace")(y):(s+=1,o&&(o=!1,i+=1),y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),o=!0,u):(e.enter("data"),d(y)))}function d(y){return y===null||y===124||Le(y)?(e.exit("data"),u(y)):(e.consume(y),y===92?h:d)}function h(y){return y===92||y===124?(e.consume(y),d):d(y)}function m(y){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(y):(e.enter("tableDelimiterRow"),o=!1,Se(y)?Ee(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):g(y))}function g(y){return y===45||y===58?b(y):y===124?(o=!0,e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),p):T(y)}function p(y){return Se(y)?Ee(e,b,"whitespace")(y):b(y)}function b(y){return y===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),v):y===45?(s+=1,v(y)):y===null||he(y)?A(y):T(y)}function v(y){return y===45?(e.enter("tableDelimiterFiller"),k(y)):T(y)}function k(y){return y===45?(e.consume(y),k):y===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(y))}function S(y){return Se(y)?Ee(e,A,"whitespace")(y):A(y)}function A(y){return y===124?g(y):y===null||he(y)?!o||i!==s?T(y):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(y)):T(y)}function T(y){return n(y)}function C(y){return e.enter("tableRow"),N(y)}function N(y){return y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),N):y===null||he(y)?(e.exit("tableRow"),t(y)):Se(y)?Ee(e,N,"whitespace")(y):(e.enter("data"),P(y))}function P(y){return y===null||y===124||Le(y)?(e.exit("data"),N(y)):(e.consume(y),y===92?L:P)}function L(y){return y===92||y===124?(e.consume(y),P):P(y)}}function mE(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,u,d;const h=new cE;for(;++n<e.length;){const m=e[n],g=m[1];m[0]==="enter"?g.type==="tableHead"?(a=!1,l!==0&&(ed(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",c,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])),i=g.type==="tableDelimiterRow"?2:u?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],d=ii(h,t,s,i,void 0,d),s=[0,0,0,0]),o[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],d=ii(h,t,s,i,void 0,d)),s=o,o=[s[1],n,0,0])):g.type==="tableHead"?(a=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],d=ii(h,t,s,i,n,d)):o[1]!==0&&(d=ii(h,t,o,i,n,d)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&ed(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=dE(t.events,n))}return e}function ii(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Vn(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Vn(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=Vn(t.events,n[2]),u=Vn(t.events,n[3]),d={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],m=t.events[n[3]];if(h[1].end=Object.assign({},m[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,p=n[3]-n[2]-1;e.add(g,p,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(s.end=Object.assign({},Vn(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function ed(e,t,n,r,i){const s=[],o=Vn(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Vn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const pE={name:"tasklistCheck",tokenize:yE};function gE(){return{text:{91:pE}}}function yE(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return Le(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return he(l)?t(l):Se(l)?e.check({tokenize:xE},t,n)(l):n(l)}}function xE(e,t,n){return Ee(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function bE(e){return Wh([U6(),eE(),lE(e),fE(),gE()])}const vE={};function wE(e){const t=this,n=e||vE,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(bE(n)),s.push(_6()),o.push(B6(n))}function kE({onSendMessage:e,onSendAttachments:t,disabled:n,theme:r,onEndChat:i}){const[s,o]=x.useState(""),[a,l]=x.useState(!1),c=x.useRef(null),u=x.useRef(null),[d,h]=x.useState(!1),m=tt(r);x.useEffect(()=>{const A=()=>{const T=rh().toLowerCase(),N=["android","iphone","ipad","mobile","tablet"].some(M=>T.includes(M)),P=ih(),{width:L}=oh(),y=L<=768;h(N||P&&y)};return A(),wa(zt,"resize",A),()=>ka(zt,"resize",A)},[]);const g=A=>{A.preventDefault(),s.trim()&&!n&&(e(s.trim()),o(""))},p=A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),g(A))},b=A=>{const T=A.target.files;if(T&&T.length>0){const C=Array.from(T),N=C.filter(P=>P.type.startsWith("image/"));if(N.length===0){console.warn("No valid image files selected");return}N.length!==C.length&&console.warn("Some non-image files were filtered out"),t(N),c.current&&(c.current.value="")}},v=()=>{!n&&c.current&&c.current.click()},k=()=>{!n&&d&&u.current&&u.current.click()},S=A=>{const T=A.target.files;if(T&&T.length>0){const C=T[0];C.type.startsWith("image/")?t([C]):console.warn("Selected file is not an image"),u.current&&(u.current.value="")}};return f.jsx("div",{className:"px-4 py-3 !w-full backdrop-blur-xl border-0 shadow-lg ",children:f.jsx("form",{onSubmit:g,className:"flex items-center !w-full mx-auto max-w-4xl",children:f.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":m.chatInput.container}`,children:[f.jsx(ge.button,{type:"button",onClick:v,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${m.chatInput.attachButton}`,disabled:n,"aria-label":"Attach file",children:f.jsx(Ze.Paperclip,{className:"w-4 h-4"})}),d&&f.jsx(ge.button,{type:"button",onClick:k,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${m.chatInput.attachButton}`,disabled:n,"aria-label":"Take photo",children:f.jsx(Ze.Camera,{className:"w-4 h-4"})}),f.jsx("input",{ref:c,type:"file",multiple:!0,onChange:b,className:"hidden",accept:"image/*"}),f.jsx("input",{ref:u,type:"file",onChange:S,className:"hidden",accept:"image/*",capture:"environment"}),f.jsx("textarea",{value:s,onChange:A=>o(A.target.value),onKeyDown:p,onFocus:()=>l(!0),onBlur:()=>l(!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 ${m.chatInput.textarea}`,rows:1,style:{height:"auto",minHeight:"32px"},onInput:A=>{const T=A.target;T.style.height="auto",T.style.height=`${Math.min(T.scrollHeight,80)}px`}}),f.jsx(ge.button,{type:"submit",disabled:n||!s.trim(),whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 flex-shrink-0 ${s.trim()&&!n?m.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:f.jsx(Ze.SendHorizontal,{className:"w-4 h-4"})}),i&&f.jsx(ge.button,{type:"button",onClick:i,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 flex-shrink-0 ${m.chatInput.endButton}`,"aria-label":"End chat",children:f.jsx(Ze.PhoneOff,{className:"w-4 h-4"})})]})})})}function SE({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[i,s]=x.useState(""),[o,a]=x.useState(0);return x.useEffect(()=>{if(n){s(e);return}if(t){s(e);return}if(o<e.length){const l=setTimeout(()=>{s(e.slice(0,o+1)),a(o+1)},r);return()=>clearTimeout(l)}},[e,o,t,r,n]),x.useEffect(()=>{n||(a(0),s(""))},[e,n]),f.jsxs("span",{className:"relative",children:[f.jsx("span",{className:"inline-block",children:i}),!t&&f.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(l=>f.jsx(ge.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:l*.2,ease:"easeInOut"}},l))})]})}function CE({message:e,theme:t,isOwn:n,isStreaming:r=!1}){var l,c,u,d;const i=tt(t),s=e.sender.name?e.sender.name.split(" ").map(h=>h[0]).join("").toUpperCase().slice(0,2):"U",o=((l=e==null?void 0:e.metadata)==null?void 0:l.format)==="markdown"||((c=e==null?void 0:e.metadata)==null?void 0:c.markdown)===!0||/(\n|^)#\s|\n##\s|```|\*\s|\-\s|\d+\.\s|>\s|!\[|\]\(https?:\/\//.test(e.content),a={h1:h=>f.jsx("h1",{className:"text-lg font-semibold mt-2 mb-1",...h}),h2:h=>f.jsx("h2",{className:"text-base font-semibold mt-2 mb-1",...h}),h3:h=>f.jsx("h3",{className:"text-sm font-semibold mt-2 mb-1",...h}),p:h=>f.jsx("p",{className:"my-1 leading-relaxed",...h}),a:({href:h,children:m,...g})=>f.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"underline text-blue-600 dark:text-blue-400 hover:opacity-80",...g,children:m}),code:({inline:h,children:m,...g})=>h?f.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded text-[0.85em]",...g,children:m}):f.jsx("pre",{className:"bg-gray-100 dark:bg-gray-800 rounded-md p-3 overflow-x-auto text-[0.85em]",children:f.jsx("code",{...g,children:m})}),ul:h=>f.jsx("ul",{className:"list-disc pl-5 my-1 space-y-1",...h}),ol:h=>f.jsx("ol",{className:"list-decimal pl-5 my-1 space-y-1",...h}),li:h=>f.jsx("li",{className:"leading-relaxed",...h}),blockquote:h=>f.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-3 italic my-2",...h}),img:h=>f.jsx("img",{className:"max-w-full h-auto rounded-md my-2",...h}),table:h=>f.jsx("div",{className:"overflow-x-auto my-2",children:f.jsx("table",{className:"min-w-full text-left text-sm",...h})}),th:h=>f.jsx("th",{className:"border-b border-gray-300 dark:border-gray-600 px-2 py-1 font-semibold",...h}),td:h=>f.jsx("td",{className:"border-b border-gray-200 dark:border-gray-700 px-2 py-1 align-top",...h})};return f.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-1`,children:f.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 max-w-[85%] min-w-0`,children:[f.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:s}),f.jsxs("div",{className:`
136
136
  relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover min-w-0 max-w-full overflow-hidden
137
137
  ${n?`${i.chatMessage.own} rounded-br-md`:`${i.chatMessage.other} rounded-bl-md`}
138
138
  ${r?"shimmer":""}
139
139
  transition-all duration-200 group-hover:scale-[1.02]
140
- `,style:{wordWrap:"break-word",overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[f.jsx("div",{className:"leading-relaxed text-sm overflow-hidden",children:((u=e.metadata)==null?void 0:u.type)==="attachment"?f.jsx(aE,{message:e,theme:t,isOwn:n}):r&&!n?f.jsx(rE,{text:e.content,isComplete:!r,isRealTimeStream:((d=e.metadata)==null?void 0:d.streaming)===!0,speed:35}):o?f.jsx(zC,{remarkPlugins:[tE],components:a,children:e.content}):f.jsx("span",{className:"whitespace-pre-wrap break-words",children:e.content})}),f.jsx("div",{className:"text-xs",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}function oE(e,t){return e.startsWith("image/")?Ze.Image:e.startsWith("video/")?Ze.Video:e.startsWith("audio/")?Ze.Music:e.includes("zip")||e.includes("rar")||e.includes("archive")?Ze.Archive:Ze.FileText}function sE(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 aE({message:e,theme:t,isOwn:n}){const r=et(t),i=e.metadata,s=(i==null?void 0:i.fileName)||"Unknown file",o=(i==null?void 0:i.fileSize)||0,a=(i==null?void 0:i.mimeType)||"application/octet-stream",l=i==null?void 0:i.downloading,c=i==null?void 0:i.uploading,u=(i==null?void 0:i.downloadProgress)||0,d=(i==null?void 0:i.uploadProgress)||0,h=i==null?void 0:i.downloadUrl,m=i==null?void 0:i.file,g=oE(a),p=l||c,b=l?u:d,v=l?"Downloading...":c?"Uploading...":"Complete",[k,S]=x.useState(null);x.useEffect(()=>{if(h)S(h);else if(m&&a.startsWith("image/")){const M=URL.createObjectURL(m);return S(M),()=>URL.revokeObjectURL(M)}else S(null)},[h,m,a]);const A=()=>{if(h){const M=document.createElement("a");M.href=h,M.download=s,M.click()}},C=a.startsWith("image/")&&k;return f.jsxs("div",{className:"flex flex-col gap-2 max-w-full sm:max-w-sm",children:[C&&f.jsxs("div",{className:"relative rounded-lg overflow-hidden",children:[f.jsx("img",{src:k,alt:s,className:"max-w-full h-auto max-h-48 object-cover rounded-lg cursor-pointer",onClick:A}),f.jsx("div",{className:"absolute inset-0 bg-black/0 hover:bg-black/10 transition-colors duration-200 cursor-pointer"})]}),f.jsxs("div",{className:`
140
+ `,style:{wordWrap:"break-word",overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[f.jsx("div",{className:"leading-relaxed text-sm overflow-hidden",children:((u=e.metadata)==null?void 0:u.type)==="attachment"?f.jsx(AE,{message:e,theme:t,isOwn:n}):r&&!n?f.jsx(SE,{text:e.content,isComplete:!r,isRealTimeStream:((d=e.metadata)==null?void 0:d.streaming)===!0,speed:35}):o?f.jsx(l4,{remarkPlugins:[wE],components:a,children:e.content}):f.jsx("span",{className:"whitespace-pre-wrap break-words",children:e.content})}),f.jsx("div",{className:"text-xs",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}function EE(e,t){return e.startsWith("image/")?Ze.Image:e.startsWith("video/")?Ze.Video:e.startsWith("audio/")?Ze.Music:e.includes("zip")||e.includes("rar")||e.includes("archive")?Ze.Archive:Ze.FileText}function TE(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 AE({message:e,theme:t,isOwn:n}){const r=tt(t),i=e.metadata,s=(i==null?void 0:i.fileName)||"Unknown file",o=(i==null?void 0:i.fileSize)||0,a=(i==null?void 0:i.mimeType)||"application/octet-stream",l=i==null?void 0:i.downloading,c=i==null?void 0:i.uploading,u=(i==null?void 0:i.downloadProgress)||0,d=(i==null?void 0:i.uploadProgress)||0,h=i==null?void 0:i.downloadUrl,m=i==null?void 0:i.file,g=EE(a),p=l||c,b=l?u:d,v=l?"Downloading...":c?"Uploading...":"Complete",[k,S]=x.useState(null);x.useEffect(()=>{if(h)S(h);else if(m&&a.startsWith("image/")){const N=URL.createObjectURL(m);return S(N),()=>URL.revokeObjectURL(N)}else S(null)},[h,m,a]);const A=()=>{if(h){const N=nh("a");N&&(N.href=h,N.download=s,N.click())}},C=a.startsWith("image/")&&k;return f.jsxs("div",{className:"flex flex-col gap-2 max-w-full sm:max-w-sm",children:[C&&f.jsxs("div",{className:"relative rounded-lg overflow-hidden",children:[f.jsx("img",{src:k,alt:s,className:"max-w-full h-auto max-h-48 object-cover rounded-lg cursor-pointer",onClick:A}),f.jsx("div",{className:"absolute inset-0 bg-black/0 hover:bg-black/10 transition-colors duration-200 cursor-pointer"})]}),f.jsxs("div",{className:`
141
141
  flex items-center gap-3 p-3 rounded-lg border transition-all duration-200
142
142
  ${t==="light"?"bg-gray-50 border-gray-200 hover:bg-gray-100":"bg-gray-800/50 border-gray-700 hover:bg-gray-700/50"}
143
143
  `,children:[f.jsx("div",{className:`
144
144
  p-2 rounded-lg flex-shrink-0
145
145
  ${t==="light"?"bg-blue-100 text-blue-600":"bg-blue-900/50 text-blue-400"}
146
- `,children:f.jsx(g,{className:"w-5 h-5"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:`font-medium text-sm truncate ${r.text.primary}`,children:s}),f.jsxs("div",{className:`text-xs ${r.text.muted}`,children:[o>0&&sE(o),p&&f.jsxs(f.Fragment,{children:[o>0&&" • ",v," ",Math.round(b*100),"%"]})]}),p&&f.jsx("div",{className:`
146
+ `,children:f.jsx(g,{className:"w-5 h-5"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:`font-medium text-sm truncate ${r.text.primary}`,children:s}),f.jsxs("div",{className:`text-xs ${r.text.muted}`,children:[o>0&&TE(o),p&&f.jsxs(f.Fragment,{children:[o>0&&" • ",v," ",Math.round(b*100),"%"]})]}),p&&f.jsx("div",{className:`
147
147
  w-full h-1 rounded-full mt-1 overflow-hidden
148
148
  ${t==="light"?"bg-gray-200":"bg-gray-700"}
149
149
  `,children:f.jsx(ge.div,{className:`h-full ${t==="light"?"bg-blue-500":"bg-blue-400"}`,initial:{width:0},animate:{width:`${b*100}%`},transition:{duration:.3}})})]}),h&&!p&&f.jsx(ge.button,{onClick:A,whileHover:{scale:1.05},whileTap:{scale:.95},className:`
150
150
  p-2 rounded-lg transition-colors duration-200
151
151
  ${t==="light"?"hover:bg-gray-200 text-gray-600 hover:text-gray-800":"hover:bg-gray-600 text-gray-400 hover:text-gray-200"}
152
- `,"aria-label":"Download file",children:f.jsx(Ze.Download,{className:"w-4 h-4"})})]})]})}function lE(){return f.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:[f.jsx("div",{className:"text-2xl mb-2",children:"✅"}),f.jsx("div",{className:"text-green-700 font-semibold text-sm mb-1",children:"Success!"}),f.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"Your action was completed successfully."})]})}function cE(){return f.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:[f.jsx("div",{className:"text-2xl mb-2",children:"⏰"}),f.jsx("div",{className:"text-yellow-700 font-semibold text-sm mb-1",children:"Interaction timed out"}),f.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"No response was provided in time."})]})}function uE({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:i="widget",onEndChat:s}){const[o,a]=x.useState(()=>e&&typeof e.getChatMessages=="function"?e.getChatMessages():[]),[l,c]=x.useState(!0),[u,d]=x.useState(()=>{const V=e&&typeof e.getCurrentSession=="function"&&!!e.getCurrentSession(),X=e&&typeof e.getChatMessages=="function"&&e.getChatMessages().length>0;return!V&&!X}),[h,m]=x.useState(new Set),[g,p]=x.useState([]),[b,v]=x.useState(!1),[k,S]=x.useState(!1),[A,T]=x.useState(()=>e.getCurrentInteraction()),C=x.useRef(null),M=x.useRef(null),[P,L]=x.useState(!0),y=et(t);x.useEffect(()=>{const V=()=>{const X=navigator.userAgent.toLowerCase(),R=["android","iphone","ipad","mobile","tablet"].some(Z=>X.includes(Z)),re="ontouchstart"in window||navigator.maxTouchPoints>0,ne=window.innerWidth<=768,me=R||re&&ne;v(me),me&&i==="widget"&&S(!0)};return V(),window.addEventListener("resize",V),()=>window.removeEventListener("resize",V)},[i]),x.useEffect(()=>(k&&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)),()=>{k&&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))}),[k,b]);const N=e.getCurrentAgentInfo(),D=(N==null?void 0:N.name)||"AI Assistant",B=D.split(" ").map(V=>V[0]).join("").toUpperCase().slice(0,2),H=x.useCallback(V=>{const X={id:`local_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:V,timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{isLocal:!0}};a(fe=>[...fe,X])},[]),K=x.useCallback((V=!1)=>{if(M.current){const X=M.current;V?X.scrollTop=X.scrollHeight:X.scrollTo({top:X.scrollHeight,behavior:"smooth"})}},[]),de=x.useCallback(()=>{if(M.current){const{scrollTop:V,scrollHeight:X,clientHeight:fe}=M.current;return X-V-fe<100}return!0},[]),ie=x.useCallback(()=>{const V=de();L(V)},[de]),F=x.useCallback((V=!1)=>{P&&K(V)},[P,K]);x.useEffect(()=>{if(P&&o.length>0){F(!0);const V=setTimeout(()=>{P&&F(!1)},10);return()=>clearTimeout(V)}},[o.length,F,P]),x.useEffect(()=>{if(A&&P){F(!0);const V=setTimeout(()=>{P&&F(!1)},50);return()=>clearTimeout(V)}},[A,F,P]),x.useEffect(()=>{const V=R=>{if(console.log("ChatView: Received message:",R),d(!1),A&&R.sender.type==="agent"){console.log("ChatView: Queuing agent message due to active interaction:",A.methodName),p(re=>[...re,R]);return}R.sender.type==="agent"&&c(!1),a(re=>{var me;if(re.some(Z=>Z.id===R.id))return console.log("ChatView: Message already exists, skipping:",R.id),re;if(console.log("ChatView: Adding new message:",R.id),R.sender.type==="agent"&&(m(Z=>new Set(Z).add(R.id)),!((me=R.metadata)!=null&&me.streaming))){const Z=R.content.length*35+1e3;setTimeout(()=>{m(pe=>{const Ae=new Set(pe);return Ae.delete(R.id),Ae})},Z)}return[...re,R]}),setTimeout(()=>{P&&F(!0)},0)},X=R=>{var re;if(console.log("ChatView: Updated message:",R),A&&R.sender.type==="agent"){console.log("ChatView: Queuing agent message update due to active interaction:",A.methodName),p(ne=>{const me=ne.findIndex(Z=>Z.id===R.id);if(me>=0){const Z=[...ne];return Z[me]=R,Z}else return[...ne,R]});return}a(ne=>ne.map(me=>me.id===R.id?{...R}:me)),setTimeout(()=>{P&&F(!0)},0),(re=R.metadata)!=null&&re.streaming||m(ne=>{const me=new Set(ne);return me.delete(R.id),me})},fe=R=>{console.log("ChatView: Sent message:",R),d(!1),a(re=>re.some(me=>me.id===R.id)?(console.log("ChatView: Sent message already exists, skipping:",R.id),re):(console.log("ChatView: Adding sent message:",R.id),[...re,R])),setTimeout(()=>{P&&F(!0)},0)};return e.on("chat.message.received",V),e.on("chat.message.updated",X),e.on("chat.message.sent",fe),()=>{e.off("chat.message.received",V),e.off("chat.message.updated",X),e.off("chat.message.sent",fe)}},[e,A,P,F]),x.useEffect(()=>{const V=re=>{console.log("ChatView: RPC interaction started:",re);const ne=e.getCurrentInteraction();console.log("ChatView: Got interaction from client:",ne==null?void 0:ne.methodName),T(ne),c(!1),P&&(F(!0),setTimeout(()=>{P&&F(!1)},100))},X=re=>{if(console.log("ChatView: RPC interaction completed:",re),T(null),g.length>0&&(console.log("ChatView: Processing",g.length,"queued messages"),a(ne=>{const me=[...ne];return g.forEach(Z=>{var Ae;if(!me.some(xe=>xe.id===Z.id)&&(console.log("ChatView: Adding queued message:",Z.id),me.push(Z),Z.sender.type==="agent"&&(m(xe=>new Set(xe).add(Z.id)),!((Ae=Z.metadata)!=null&&Ae.streaming)))){const xe=Z.content.length*35+1e3;setTimeout(()=>{m(Me=>{const ze=new Set(Me);return ze.delete(Z.id),ze})},xe)}}),me}),p([]),setTimeout(()=>{P&&F(!0)},0)),re&&re.response&&re.response.success){let ne=null;re.response.successView?ne=re.response.successView:re.successView&&(ne=re.successView),a(me=>{const Z=[...me].reverse().findIndex(Me=>Me.sender.type==="participant");let pe=me.length;Z!==-1&&(pe=me.length-Z);const Ae={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:ne||f.jsx(lE,{})}};e&&typeof e.addChatMessage=="function"&&e.addChatMessage(Ae);const xe=[...me];return xe.splice(pe,0,Ae),xe})}},fe=async re=>{A&&(console.log("ChatView: Dismissing active interaction due to timeout"),e.dismissCurrentInteraction()),T(null),g.length>0&&(console.log("ChatView: Processing",g.length,"queued messages after timeout"),a(me=>{const Z=[...me];return g.forEach(pe=>{var xe;if(!Z.some(Me=>Me.id===pe.id)&&(Z.push(pe),pe.sender.type==="agent"&&(m(Me=>new Set(Me).add(pe.id)),!((xe=pe.metadata)!=null&&xe.streaming)))){const Me=pe.content.length*35+1e3;setTimeout(()=>{m(ze=>{const He=new Set(ze);return He.delete(pe.id),He})},Me)}}),Z}),p([]),setTimeout(()=>{P&&F(!0)},0));let ne=null;re&&re.response&&re.response.timeoutView?ne=re.response.timeoutView:re&&re.timeoutView&&(ne=re.timeoutView),a(me=>{const Z={id:`timeout_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"agent",name:D,type:"agent"},metadata:{type:"timeoutView",view:ne||f.jsx(cE,{})}};return e&&typeof e.addChatMessage=="function"&&e.addChatMessage(Z),[...me,Z]}),setTimeout(()=>{e.getCurrentInteraction()||T(null)},100)},R=async re=>{console.log("ChatView: RPC interaction dismissed:",re),console.log("ChatView: Current interaction before dismiss:",A==null?void 0:A.methodName),T(null),g.length>0&&(console.log("ChatView: Processing",g.length,"queued messages after dismissal"),a(ne=>{const me=[...ne];return g.forEach(Z=>{var Ae;if(!me.some(xe=>xe.id===Z.id)&&(me.push(Z),Z.sender.type==="agent"&&(m(xe=>new Set(xe).add(Z.id)),!((Ae=Z.metadata)!=null&&Ae.streaming)))){const xe=Z.content.length*35+1e3;setTimeout(()=>{m(Me=>{const ze=new Set(Me);return ze.delete(Z.id),ze})},xe)}}),me}),p([]),setTimeout(()=>{P&&F(!0)},0)),setTimeout(()=>{const ne=e.getCurrentInteraction();console.log("ChatView: Latest interaction from client after dismiss:",(ne==null?void 0:ne.methodName)||"null"),ne===null&&T(null)},50),console.log("ChatView: Set currentInteraction to null after dismiss")};return e.on("rpc.interaction.started",V),e.on("rpc.interaction.completed",X),e.on("rpc.interaction.timeout",fe),e.on("rpc.interaction.dismissed",R),()=>{e.off("rpc.interaction.started",V),e.off("rpc.interaction.completed",X),e.off("rpc.interaction.timeout",fe),e.off("rpc.interaction.dismissed",R)}},[e,P,F,D,g]),x.useEffect(()=>{const V=()=>{if(console.log("ChatView: Agent is thinking"),A){console.log("ChatView: Suppressing thinking indicator due to active interaction:",A.methodName);return}c(!0)},X=()=>{console.log("ChatView: Agent is speaking"),c(!1)};return e.on("agent.thinking",V),e.on("agent.speaking",X),()=>{e.off("agent.thinking",V),e.off("agent.speaking",X)}},[e,A]),x.useEffect(()=>{const V=e.getCurrentInteraction();V?(console.log("ChatView: Restoring interaction state on mount/client change:",V.methodName),T(V)):T(null)},[e]),x.useEffect(()=>{console.log("ChatView: Display type changed to:",i,"Current interaction:",(A==null?void 0:A.methodName)||"none")},[i,A]);const W=async V=>{try{A&&(console.log("ChatView: Dismissing active interaction due to user message send"),e.dismissCurrentInteraction(),T(null)),await e.sendChatMessage(V)}catch(X){console.error("Failed to send message:",X)}},w=async V=>{try{A&&(console.log("ChatView: Dismissing active interaction due to user attachment send"),e.dismissCurrentInteraction(),T(null)),await e.sendAttachments(V),console.log("Attachments sent successfully:",V.map(X=>X.name))}catch(X){console.error("Failed to send attachments:",X)}},[z,oe]=x.useState([]);x.useEffect(()=>{const V=X=>{oe(Array.isArray(X)?X:["tes","hello how are you","algebra make me learn that ","what is the meaning of life"])};return e.on("suggested.response",V),()=>{e.off("suggested.response",V)}},[e]);const E=k&&b?"fullscreen":i,U=E==="fullscreen"?k&&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 contain-layout",se=E==="fullscreen"?k&&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 ${y.chatHeader.container}`:`flex items-center w-full justify-between px-4 pt-5 pb-4 border-b ${y.chatHeader.container}`,$=E==="fullscreen"?k&&b?"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide p-4 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide p-6 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide w-full p-4 chat-scrollable min-h-0",ee="flex-shrink-0 !w-full",Q=()=>{S(!1),n&&n()};return f.jsxs("div",{className:`${U} relative`,children:[f.jsx("div",{className:se,children:f.jsxs("div",{className:"flex items-center gap-2",children:[k&&b&&f.jsx(ge.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:"✕"}),f.jsxs("div",{children:[f.jsx("h3",{className:`font-semibold text-base leading-tight ${k&&b?"text-white":y.text.primary}`,children:D}),f.jsxs("p",{className:`text-xs flex items-center gap-1.5 mt-0.5 ${k&&b?"text-gray-300":y.text.muted}`,children:[f.jsx("span",{className:"w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse"}),"Online"]})]})]})}),f.jsxs("div",{ref:M,className:`${$} flex flex-col`,style:{scrollBehavior:"smooth",scrollbarWidth:"none",contain:"layout style paint",overscrollBehavior:"contain"},onScroll:ie,children:[" ",o.length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-center py-12",children:[f.jsx(ge.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:B}),f.jsxs("p",{className:`text-base mb-2 ${k&&b?"text-white":y.text.secondary}`,children:[D," is joining..."]}),f.jsx("p",{className:`text-xs ${k&&b?"text-gray-300":y.text.muted}`,children:"Your conversation will begin shortly"})]}):f.jsx("div",{className:"w-full max-w-5xl mx-auto space-y-3 py-4 flex-1 flex flex-col justify-end",children:f.jsxs("div",{className:"space-y-3",children:[o.map((V,X)=>{var fe,R;return f.jsx("div",{children:((fe=V.metadata)==null?void 0:fe.type)==="successView"?f.jsx("div",{className:"flex w-full justify-end mb-4 px-1",children:f.jsxs("div",{className:"relative group flex-row-reverse flex items-end gap-3 max-w-[85%] min-w-0",children:[f.jsx(ge.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"}),f.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 ${y.chatMessage.own} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[V.metadata.view,f.jsx("div",{className:`text-xs ${y.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:V.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((R=V.metadata)==null?void 0:R.type)==="timeoutView"?f.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:f.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[f.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:B}),f.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 ${y.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[V.metadata.view,f.jsx("div",{className:`text-xs ${y.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:V.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):f.jsx(iE,{message:V,theme:t,isOwn:V.sender.type==="participant",isStreaming:h.has(V.id)})},V.id)}),l&&!A&&f.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:o.length*.1},className:"flex w-full justify-start mb-4 px-1",children:f.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[f.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:B}),f.jsx("div",{className:`relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover ${y.chatMessage.other} rounded-bl-md transition-all duration-200 group-hover:scale-[1.02] min-w-0 max-w-full overflow-hidden`,style:{wordWrap:"break-word",overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto",minWidth:48},children:f.jsx("span",{className:"inline-flex items-center",children:[0,1,2].map(V=>f.jsx(ge.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:V*.2,ease:"easeInOut"}},V))})})]})}),A&&A.presentationMode==="embedded"&&f.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[f.jsx(ge.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:B}),f.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 ${y.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[f.jsx(Tr,{interaction:A,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:H},A.methodName),f.jsx(ge.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:`text-xs ${y.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]}),f.jsx("div",{ref:C})]})})]}),!P&&f.jsx(ge.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onClick:()=>{L(!0),K(!1)},className:`absolute right-6 bottom-20 z-10 p-3 rounded-full shadow-lg backdrop-blur-sm border transition-all duration-200 hover:scale-105 ${t==="light"?"bg-white/90 text-gray-600 border-gray-200 hover:bg-white hover:text-gray-800":"bg-gray-800/90 text-gray-300 border-gray-700 hover:bg-gray-700 hover:text-white"}`,"aria-label":"Scroll to bottom",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})}),z.length>0&&f.jsx("div",{className:"w-full flex overflow-x-auto gap-2 px-4 py-2 mb-1 scrollbar-hide",children:z.map((V,X)=>{var fe;return f.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
152
+ `,"aria-label":"Download file",children:f.jsx(Ze.Download,{className:"w-4 h-4"})})]})]})}function jE(){return f.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:[f.jsx("div",{className:"text-2xl mb-2",children:"✅"}),f.jsx("div",{className:"text-green-700 font-semibold text-sm mb-1",children:"Success!"}),f.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"Your action was completed successfully."})]})}function PE(){return f.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:[f.jsx("div",{className:"text-2xl mb-2",children:"⏰"}),f.jsx("div",{className:"text-yellow-700 font-semibold text-sm mb-1",children:"Interaction timed out"}),f.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"No response was provided in time."})]})}function ME({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:i="widget",onEndChat:s}){const[o,a]=x.useState(()=>e&&typeof e.getChatMessages=="function"?e.getChatMessages():[]),[l,c]=x.useState(!0),[u,d]=x.useState(()=>{const V=e&&typeof e.getCurrentSession=="function"&&!!e.getCurrentSession(),G=e&&typeof e.getChatMessages=="function"&&e.getChatMessages().length>0;return!V&&!G}),[h,m]=x.useState(new Set),[g,p]=x.useState([]),[b,v]=x.useState(!1),[k,S]=x.useState(!1),[A,T]=x.useState(()=>e.getCurrentInteraction()),C=x.useRef(null),N=x.useRef(null),[P,L]=x.useState(!0),y=tt(t);x.useEffect(()=>{const V=()=>{const G=navigator.userAgent.toLowerCase(),R=["android","iphone","ipad","mobile","tablet"].some(Z=>G.includes(Z)),re="ontouchstart"in window||navigator.maxTouchPoints>0,ne=window.innerWidth<=768,me=R||re&&ne;v(me),me&&i==="widget"&&S(!0)};return V(),window.addEventListener("resize",V),()=>window.removeEventListener("resize",V)},[i]),x.useEffect(()=>{var V;return k&&b&&(Sc({overflow:"hidden",position:"fixed",width:"100%",height:"100%"}),(V=z1())==null||V.catch(console.log)),()=>{var G;k&&b&&(Sc({overflow:"unset",position:"unset",width:"unset",height:"unset"}),U1()&&((G=H1())==null||G.catch(console.log)))}},[k,b]);const M=e.getCurrentAgentInfo(),D=(M==null?void 0:M.name)||"AI Assistant",B=D.split(" ").map(V=>V[0]).join("").toUpperCase().slice(0,2),H=x.useCallback(V=>{const G={id:`local_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:V,timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{isLocal:!0}};a(fe=>[...fe,G])},[]),Y=x.useCallback((V=!1)=>{if(N.current){const G=N.current;V?G.scrollTop=G.scrollHeight:G.scrollTo({top:G.scrollHeight,behavior:"smooth"})}},[]),de=x.useCallback(()=>{if(N.current){const{scrollTop:V,scrollHeight:G,clientHeight:fe}=N.current;return G-V-fe<100}return!0},[]),ie=x.useCallback(()=>{const V=de();L(V)},[de]),F=x.useCallback((V=!1)=>{P&&Y(V)},[P,Y]);x.useEffect(()=>{if(P&&o.length>0){F(!0);const V=setTimeout(()=>{P&&F(!1)},10);return()=>clearTimeout(V)}},[o.length,F,P]),x.useEffect(()=>{if(A&&P){F(!0);const V=setTimeout(()=>{P&&F(!1)},50);return()=>clearTimeout(V)}},[A,F,P]),x.useEffect(()=>{const V=R=>{if(console.log("ChatView: Received message:",R),d(!1),A&&R.sender.type==="agent"){console.log("ChatView: Queuing agent message due to active interaction:",A.methodName),p(re=>[...re,R]);return}R.sender.type==="agent"&&c(!1),a(re=>{var me;if(re.some(Z=>Z.id===R.id))return console.log("ChatView: Message already exists, skipping:",R.id),re;if(console.log("ChatView: Adding new message:",R.id),R.sender.type==="agent"&&(m(Z=>new Set(Z).add(R.id)),!((me=R.metadata)!=null&&me.streaming))){const Z=R.content.length*35+1e3;setTimeout(()=>{m(pe=>{const Ae=new Set(pe);return Ae.delete(R.id),Ae})},Z)}return[...re,R]}),setTimeout(()=>{P&&F(!0)},0)},G=R=>{var re;if(console.log("ChatView: Updated message:",R),A&&R.sender.type==="agent"){console.log("ChatView: Queuing agent message update due to active interaction:",A.methodName),p(ne=>{const me=ne.findIndex(Z=>Z.id===R.id);if(me>=0){const Z=[...ne];return Z[me]=R,Z}else return[...ne,R]});return}a(ne=>ne.map(me=>me.id===R.id?{...R}:me)),setTimeout(()=>{P&&F(!0)},0),(re=R.metadata)!=null&&re.streaming||m(ne=>{const me=new Set(ne);return me.delete(R.id),me})},fe=R=>{console.log("ChatView: Sent message:",R),d(!1),a(re=>re.some(me=>me.id===R.id)?(console.log("ChatView: Sent message already exists, skipping:",R.id),re):(console.log("ChatView: Adding sent message:",R.id),[...re,R])),setTimeout(()=>{P&&F(!0)},0)};return e.on("chat.message.received",V),e.on("chat.message.updated",G),e.on("chat.message.sent",fe),()=>{e.off("chat.message.received",V),e.off("chat.message.updated",G),e.off("chat.message.sent",fe)}},[e,A,P,F]),x.useEffect(()=>{const V=re=>{console.log("ChatView: RPC interaction started:",re);const ne=e.getCurrentInteraction();console.log("ChatView: Got interaction from client:",ne==null?void 0:ne.methodName),T(ne),c(!1),P&&(F(!0),setTimeout(()=>{P&&F(!1)},100))},G=re=>{if(console.log("ChatView: RPC interaction completed:",re),T(null),g.length>0&&(console.log("ChatView: Processing",g.length,"queued messages"),a(ne=>{const me=[...ne];return g.forEach(Z=>{var Ae;if(!me.some(xe=>xe.id===Z.id)&&(console.log("ChatView: Adding queued message:",Z.id),me.push(Z),Z.sender.type==="agent"&&(m(xe=>new Set(xe).add(Z.id)),!((Ae=Z.metadata)!=null&&Ae.streaming)))){const xe=Z.content.length*35+1e3;setTimeout(()=>{m(Ne=>{const ze=new Set(Ne);return ze.delete(Z.id),ze})},xe)}}),me}),p([]),setTimeout(()=>{P&&F(!0)},0)),re&&re.response&&re.response.success){let ne=null;re.response.successView?ne=re.response.successView:re.successView&&(ne=re.successView),a(me=>{const Z=[...me].reverse().findIndex(Ne=>Ne.sender.type==="participant");let pe=me.length;Z!==-1&&(pe=me.length-Z);const Ae={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:ne||f.jsx(jE,{})}};e&&typeof e.addChatMessage=="function"&&e.addChatMessage(Ae);const xe=[...me];return xe.splice(pe,0,Ae),xe})}},fe=async re=>{A&&(console.log("ChatView: Dismissing active interaction due to timeout"),e.dismissCurrentInteraction()),T(null),g.length>0&&(console.log("ChatView: Processing",g.length,"queued messages after timeout"),a(me=>{const Z=[...me];return g.forEach(pe=>{var xe;if(!Z.some(Ne=>Ne.id===pe.id)&&(Z.push(pe),pe.sender.type==="agent"&&(m(Ne=>new Set(Ne).add(pe.id)),!((xe=pe.metadata)!=null&&xe.streaming)))){const Ne=pe.content.length*35+1e3;setTimeout(()=>{m(ze=>{const He=new Set(ze);return He.delete(pe.id),He})},Ne)}}),Z}),p([]),setTimeout(()=>{P&&F(!0)},0));let ne=null;re&&re.response&&re.response.timeoutView?ne=re.response.timeoutView:re&&re.timeoutView&&(ne=re.timeoutView),a(me=>{const Z={id:`timeout_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"agent",name:D,type:"agent"},metadata:{type:"timeoutView",view:ne||f.jsx(PE,{})}};return e&&typeof e.addChatMessage=="function"&&e.addChatMessage(Z),[...me,Z]}),setTimeout(()=>{e.getCurrentInteraction()||T(null)},100)},R=async re=>{console.log("ChatView: RPC interaction dismissed:",re),console.log("ChatView: Current interaction before dismiss:",A==null?void 0:A.methodName),T(null),g.length>0&&(console.log("ChatView: Processing",g.length,"queued messages after dismissal"),a(ne=>{const me=[...ne];return g.forEach(Z=>{var Ae;if(!me.some(xe=>xe.id===Z.id)&&(me.push(Z),Z.sender.type==="agent"&&(m(xe=>new Set(xe).add(Z.id)),!((Ae=Z.metadata)!=null&&Ae.streaming)))){const xe=Z.content.length*35+1e3;setTimeout(()=>{m(Ne=>{const ze=new Set(Ne);return ze.delete(Z.id),ze})},xe)}}),me}),p([]),setTimeout(()=>{P&&F(!0)},0)),setTimeout(()=>{const ne=e.getCurrentInteraction();console.log("ChatView: Latest interaction from client after dismiss:",(ne==null?void 0:ne.methodName)||"null"),ne===null&&T(null)},50),console.log("ChatView: Set currentInteraction to null after dismiss")};return e.on("rpc.interaction.started",V),e.on("rpc.interaction.completed",G),e.on("rpc.interaction.timeout",fe),e.on("rpc.interaction.dismissed",R),()=>{e.off("rpc.interaction.started",V),e.off("rpc.interaction.completed",G),e.off("rpc.interaction.timeout",fe),e.off("rpc.interaction.dismissed",R)}},[e,P,F,D,g]),x.useEffect(()=>{const V=()=>{if(console.log("ChatView: Agent is thinking"),A){console.log("ChatView: Suppressing thinking indicator due to active interaction:",A.methodName);return}c(!0)},G=()=>{console.log("ChatView: Agent is speaking"),c(!1)};return e.on("agent.thinking",V),e.on("agent.speaking",G),()=>{e.off("agent.thinking",V),e.off("agent.speaking",G)}},[e,A]),x.useEffect(()=>{const V=e.getCurrentInteraction();V?(console.log("ChatView: Restoring interaction state on mount/client change:",V.methodName),T(V)):T(null)},[e]),x.useEffect(()=>{console.log("ChatView: Display type changed to:",i,"Current interaction:",(A==null?void 0:A.methodName)||"none")},[i,A]);const W=async V=>{try{A&&(console.log("ChatView: Dismissing active interaction due to user message send"),e.dismissCurrentInteraction(),T(null)),await e.sendChatMessage(V)}catch(G){console.error("Failed to send message:",G)}},w=async V=>{try{A&&(console.log("ChatView: Dismissing active interaction due to user attachment send"),e.dismissCurrentInteraction(),T(null)),await e.sendAttachments(V),console.log("Attachments sent successfully:",V.map(G=>G.name))}catch(G){console.error("Failed to send attachments:",G)}},[z,oe]=x.useState([]);x.useEffect(()=>{const V=G=>{oe(Array.isArray(G)?G:["tes","hello how are you","algebra make me learn that ","what is the meaning of life"])};return e.on("suggested.response",V),()=>{e.off("suggested.response",V)}},[e]);const E=k&&b?"fullscreen":i,U=E==="fullscreen"?k&&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 contain-layout",se=E==="fullscreen"?k&&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 ${y.chatHeader.container}`:`flex items-center w-full justify-between px-4 pt-5 pb-4 border-b ${y.chatHeader.container}`,$=E==="fullscreen"?k&&b?"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide p-4 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide p-6 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide w-full p-4 chat-scrollable min-h-0",ee="flex-shrink-0 !w-full",Q=()=>{S(!1),n&&n()};return f.jsxs("div",{className:`${U} relative`,children:[f.jsx("div",{className:se,children:f.jsxs("div",{className:"flex items-center gap-2",children:[k&&b&&f.jsx(ge.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:"✕"}),f.jsxs("div",{children:[f.jsx("h3",{className:`font-semibold text-base leading-tight ${k&&b?"text-white":y.text.primary}`,children:D}),f.jsxs("p",{className:`text-xs flex items-center gap-1.5 mt-0.5 ${k&&b?"text-gray-300":y.text.muted}`,children:[f.jsx("span",{className:"w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse"}),"Online"]})]})]})}),f.jsxs("div",{ref:N,className:`${$} flex flex-col`,style:{scrollBehavior:"smooth",scrollbarWidth:"none",contain:"layout style paint",overscrollBehavior:"contain"},onScroll:ie,children:[" ",o.length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-center py-12",children:[f.jsx(ge.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:B}),f.jsxs("p",{className:`text-base mb-2 ${k&&b?"text-white":y.text.secondary}`,children:[D," is joining..."]}),f.jsx("p",{className:`text-xs ${k&&b?"text-gray-300":y.text.muted}`,children:"Your conversation will begin shortly"})]}):f.jsx("div",{className:"w-full max-w-5xl mx-auto space-y-3 py-4 flex-1 flex flex-col justify-end",children:f.jsxs("div",{className:"space-y-3",children:[o.map((V,G)=>{var fe,R;return f.jsx("div",{children:((fe=V.metadata)==null?void 0:fe.type)==="successView"?f.jsx("div",{className:"flex w-full justify-end mb-4 px-1",children:f.jsxs("div",{className:"relative group flex-row-reverse flex items-end gap-3 max-w-[85%] min-w-0",children:[f.jsx(ge.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"}),f.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 ${y.chatMessage.own} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[V.metadata.view,f.jsx("div",{className:`text-xs ${y.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:V.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((R=V.metadata)==null?void 0:R.type)==="timeoutView"?f.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:f.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[f.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:B}),f.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 ${y.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[V.metadata.view,f.jsx("div",{className:`text-xs ${y.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:V.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):f.jsx(CE,{message:V,theme:t,isOwn:V.sender.type==="participant",isStreaming:h.has(V.id)})},V.id)}),l&&!A&&f.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:o.length*.1},className:"flex w-full justify-start mb-4 px-1",children:f.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[f.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:B}),f.jsx("div",{className:`relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover ${y.chatMessage.other} rounded-bl-md transition-all duration-200 group-hover:scale-[1.02] min-w-0 max-w-full overflow-hidden`,style:{wordWrap:"break-word",overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto",minWidth:48},children:f.jsx("span",{className:"inline-flex items-center",children:[0,1,2].map(V=>f.jsx(ge.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:V*.2,ease:"easeInOut"}},V))})})]})}),A&&A.presentationMode==="embedded"&&f.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[f.jsx(ge.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:B}),f.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 ${y.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[f.jsx(Pr,{interaction:A,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:H},A.methodName),f.jsx(ge.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:`text-xs ${y.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]}),f.jsx("div",{ref:C})]})})]}),!P&&f.jsx(ge.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onClick:()=>{L(!0),Y(!1)},className:`absolute right-6 bottom-20 z-10 p-3 rounded-full shadow-lg backdrop-blur-sm border transition-all duration-200 hover:scale-105 ${t==="light"?"bg-white/90 text-gray-600 border-gray-200 hover:bg-white hover:text-gray-800":"bg-gray-800/90 text-gray-300 border-gray-700 hover:bg-gray-700 hover:text-white"}`,"aria-label":"Scroll to bottom",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})}),z.length>0&&f.jsx("div",{className:"w-full flex overflow-x-auto gap-2 px-4 py-2 mb-1 scrollbar-hide",children:z.map((V,G)=>{var fe;return f.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
153
153
  ${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":((fe=y.suggestedResponse)==null?void 0:fe.container)||"bg-gradient-to-br from-blue-500 to-purple-600 text-white border-blue-400 hover:from-blue-600 hover:to-purple-700"}
154
- `,style:{boxShadow:t==="vox"?"0 2px 8px 0 rgba(80,60,200,0.10)":void 0,borderWidth:1},onClick:()=>{W(V),oe([])},children:V},V+X)})}),A&&A.presentationMode!=="embedded"&&f.jsx(Tr,{interaction:A,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:H},A.methodName),f.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:ee,children:f.jsx(nE,{onSendMessage:W,onSendAttachments:w,disabled:r,theme:t,onEndChat:s})})]})}function dE({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[i,s]=x.useState(""),[o,a]=x.useState(0);return x.useEffect(()=>{if(n){s(e);return}if(t){s(e);return}if(o<e.length){const l=setTimeout(()=>{s(e.slice(0,o+1)),a(o+1)},r);return()=>clearTimeout(l)}},[e,o,t,r,n]),x.useEffect(()=>{n||(a(0),s(""))},[e,n]),f.jsxs("span",{className:"relative",children:[f.jsx("span",{className:"inline-block",children:i}),!t&&f.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(l=>f.jsx(ge.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:l*.2,ease:"easeInOut"}},l))})]})}function fE({message:e,theme:t,isOwn:n,isStreaming:r=!1}){var o,a,l;const i=et(t),s=e.sender.name?e.sender.name.split(" ").map(c=>c[0]).join("").toUpperCase().slice(0,2):"U";return f.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-1`,children:f.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 max-w-[85%]`,children:[f.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:s}),f.jsxs("div",{className:`
154
+ `,style:{boxShadow:t==="vox"?"0 2px 8px 0 rgba(80,60,200,0.10)":void 0,borderWidth:1},onClick:()=>{W(V),oe([])},children:V},V+G)})}),A&&A.presentationMode!=="embedded"&&f.jsx(Pr,{interaction:A,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:H},A.methodName),f.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:ee,children:f.jsx(kE,{onSendMessage:W,onSendAttachments:w,disabled:r,theme:t,onEndChat:s})})]})}function NE({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[i,s]=x.useState(""),[o,a]=x.useState(0);return x.useEffect(()=>{if(n){s(e);return}if(t){s(e);return}if(o<e.length){const l=setTimeout(()=>{s(e.slice(0,o+1)),a(o+1)},r);return()=>clearTimeout(l)}},[e,o,t,r,n]),x.useEffect(()=>{n||(a(0),s(""))},[e,n]),f.jsxs("span",{className:"relative",children:[f.jsx("span",{className:"inline-block",children:i}),!t&&f.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(l=>f.jsx(ge.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:l*.2,ease:"easeInOut"}},l))})]})}function IE({message:e,theme:t,isOwn:n,isStreaming:r=!1}){var o,a,l;const i=tt(t),s=e.sender.name?e.sender.name.split(" ").map(c=>c[0]).join("").toUpperCase().slice(0,2):"U";return f.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-1`,children:f.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 max-w-[85%]`,children:[f.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:s}),f.jsxs("div",{className:`
155
155
  relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover
156
156
  ${n?`${((o=i.chatMessage)==null?void 0:o.own)||"bg-blue-500 text-white"} rounded-br-md`:`${((a=i.chatMessage)==null?void 0:a.other)||"bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-white"} rounded-bl-md`}
157
157
  ${r?"shimmer":""}
158
158
  transition-all duration-200 group-hover:scale-[1.02]
159
- `,style:{wordWrap:"break-word",overflowWrap:"break-word"},children:[f.jsx("div",{className:"whitespace-pre-wrap break-words leading-relaxed text-sm",children:r&&!n?f.jsx(dE,{text:e.content,isComplete:!r,isRealTimeStream:((l=e.metadata)==null?void 0:l.streaming)===!0,speed:35}):e.content}),f.jsx("div",{className:"text-xs mt-1",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}function hE({onToggleMicrophone:e,onToggleCamera:t,onToggleScreenShare:n,onToggleChat:r,onEndCall:i,theme:s,microphoneEnabled:o,cameraEnabled:a,screenShareEnabled:l,chatOpen:c,isMicrophoneLoading:u,isCameraLoading:d,isScreenShareLoading:h,disabled:m}){const g=et(s);return f.jsxs("div",{className:ce("flex items-center justify-center gap-3 px-3 py-2 w-full backdrop-blur-xl border-t",s==="light"?"bg-white/95 border-gray-200":"bg-gray-900/90 border-gray-700"),children:[f.jsx("button",{onClick:e,disabled:m||u,className:`p-3 rounded-full transition-all duration-200 ${o?g.video.controlEnabled:g.video.controlDisabled} ${m?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:o?"Mute microphone":"Unmute microphone",children:u?f.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):o?f.jsx(Ze.Mic,{className:"w-5 h-5"}):f.jsx(Ze.MicOff,{className:"w-5 h-5"})}),f.jsx("button",{onClick:t,disabled:m||d,className:`p-3 rounded-full transition-all duration-200 ${a?g.video.controlEnabled:g.video.controlDisabled} ${m?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:a?"Turn off camera":"Turn on camera",children:d?f.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):a?f.jsx(Ze.Camera,{className:"w-5 h-5"}):f.jsx(Ze.CameraOff,{className:"w-5 h-5"})}),f.jsx("button",{onClick:n,disabled:m||h,className:`p-3 rounded-full transition-all duration-200 ${l?g.video.controlEnabled:g.video.controlDisabled} ${m?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:l?"Stop screen share":"Share screen",children:h?f.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):f.jsx(Ze.Monitor,{className:"w-5 h-5"})}),f.jsx("button",{onClick:r,disabled:m,className:`relative p-3 rounded-full transition-all duration-200 ${c?g.video.controlEnabled:g.video.controlDisabled} ${m?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:c?"Hide chat":"Show chat & transcription",children:f.jsx(Ze.MessageCircle,{className:"w-5 h-5"})}),i&&f.jsx("button",{onClick:i,disabled:m,className:`p-3 rounded-full transition-all duration-200 ${g.video.endCall} ${m?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"End call",children:f.jsx(Ze.PhoneOff,{className:"w-5 h-5"})})]})}function Zu({trackRef:e,participant:t,isLocal:n=!1,className:r="",theme:i}){var l;const s=et(i),o=(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 f.jsxs("div",{className:`relative rounded-lg overflow-hidden ${s.video.tile} ${r}`,children:[a?f.jsx(ut.VideoTrack,{trackRef:e,className:"w-full h-full object-cover"}):f.jsx("div",{className:`w-full h-full flex items-center justify-center ${s.video.placeholder}`,children:f.jsx("div",{className:"text-center",children:f.jsx("div",{className:`w-16 h-16 mx-auto mb-2 rounded-full flex items-center justify-center ${s.video.avatar}`,children:f.jsx(Ze.User,{className:"w-8 h-8"})})})}),f.jsx("div",{className:`absolute bottom-2 left-2 px-2 py-1 rounded text-xs ${s.video.nameOverlay}`,children:o}),((l=e==null?void 0:e.publication)==null?void 0:l.isMuted)&&f.jsx("div",{className:`absolute top-2 right-2 p-1 rounded ${s.video.mutedIndicator}`,children:f.jsx(Ze.CameraOff,{className:"w-4 h-4"})})]})}function mE({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:i,onEndCall:s}){var X,fe,R,re,ne,me;const o=et(t),[a,l]=x.useState(!1),[c,u]=x.useState(()=>e&&typeof e.getChatMessages=="function"?e.getChatMessages():[]),[d,h]=x.useState(!1),[m,g]=x.useState(new Set),p=x.useRef(null),b=x.useRef(null),[v,k]=x.useState(!0),S=x.useRef(null),[A,T]=x.useState(64);x.useLayoutEffect(()=>{const Z=S.current;if(!Z)return;const pe=()=>T(Z.offsetHeight||64);pe();const Ae=new ResizeObserver(()=>pe());return Ae.observe(Z),window.addEventListener("resize",pe),()=>{Ae.disconnect(),window.removeEventListener("resize",pe)}},[]);const C=qf(e),{screenShareTrackRefs:M}=P1(e),P=x.useMemo(()=>e.getRemoteParticipants(),[e,C]),L=_n(e,"microphone"),y=_n(e,"camera"),N=_n(e,"screenShare"),[D,B]=x.useState(null),H=(X=e==null?void 0:e.getCurrentAgentInfo)==null?void 0:X.call(e),de=((H==null?void 0:H.name)||"AI Assistant").split(" ").map(Z=>Z[0]).join("").toUpperCase().slice(0,2),ie=x.useCallback(()=>{if(b.current){const{scrollTop:Z,scrollHeight:pe,clientHeight:Ae}=b.current;return pe-Z-Ae<100}return!0},[]),F=x.useCallback(()=>{const Z=ie();k(Z)},[ie]),W=x.useCallback((Z=!1)=>{if(v&&b.current){const pe=b.current;Z?pe.scrollTop=pe.scrollHeight:pe.scrollTo({top:pe.scrollHeight,behavior:"smooth"})}},[v]);x.useEffect(()=>{if(!e)return;const Z=xe=>{console.log("VideoView: Received message:",xe),xe.sender.type==="agent"&&h(!1),u(Me=>{var He;if(Me.some(nt=>nt.id===xe.id))return Me;if(xe.sender.type==="agent"&&(g(nt=>new Set(nt).add(xe.id)),!((He=xe.metadata)!=null&&He.streaming))){const nt=xe.content.length*35+1e3;setTimeout(()=>{g(Zt=>{const Ft=new Set(Zt);return Ft.delete(xe.id),Ft})},nt)}return[...Me,xe]}),setTimeout(()=>{v&&W(!0)},0)},pe=xe=>{var Me;console.log("VideoView: Updated message:",xe),u(ze=>ze.map(He=>He.id===xe.id?{...xe}:He)),setTimeout(()=>{v&&W(!0)},0),(Me=xe.metadata)!=null&&Me.streaming||g(ze=>{const He=new Set(ze);return He.delete(xe.id),He})},Ae=xe=>{var Me;console.log("VideoView: Sent message:",xe),((Me=xe.metadata)==null?void 0:Me.topic)!=="lk.transcription"&&(u(ze=>ze.some(nt=>nt.id===xe.id)?ze:[...ze,xe]),setTimeout(()=>{v&&W(!0)},0))};return e.on("chat.message.received",Z),e.on("chat.message.updated",pe),e.on("chat.message.sent",Ae),()=>{e.off("chat.message.received",Z),e.off("chat.message.updated",pe),e.off("chat.message.sent",Ae)}},[e,v,W]),x.useEffect(()=>{if(!e)return;const Z=()=>{console.log("VideoView: Agent is thinking"),h(!0)},pe=()=>{console.log("VideoView: Agent is speaking"),h(!1)};return e.on("agent.thinking",Z),e.on("agent.speaking",pe),()=>{e.off("agent.thinking",Z),e.off("agent.speaking",pe)}},[e]);const w=x.useCallback(async()=>{y.pending||await y.toggle()},[y]),z=x.useCallback(async()=>{N.pending||await N.toggle()},[N]),oe=x.useCallback(()=>{l(Z=>!Z)},[]),E=x.useCallback(()=>{s?s():n&&n()},[s,n]);x.useCallback(async Z=>{var pe;try{await((pe=e==null?void 0:e.sendChatMessage)==null?void 0:pe.call(e,Z))}catch(Ae){console.error("Failed to send message:",Ae)}},[e]),x.useEffect(()=>{a&&c.length>0&&setTimeout(()=>{v&&W(!0)},100)},[c.length,a,v,W]);const U=x.useMemo(()=>c.filter(Z=>Z.content&&Z.content.trim()!==""&&Z.content.trim()!=="..."),[c]);x.useEffect(()=>{if(!e)return;const Z=pe=>{console.log("📺 Video: Interactive UI state updated:",pe),B(pe)};return e.on("interactive.ui.update",Z),e.on("interactive.ui.show",Z),()=>{e.off("interactive.ui.update",Z),e.off("interactive.ui.show",Z)}},[e]);const se=C==null?void 0:C.localParticipant,$=x.useMemo(()=>(e?e.getCameraTrackRefs():[]).find(Z=>Z.participant===se),[e,se]),Q=x.useMemo(()=>(e?e.getCameraTrackRefs():[]).filter(Z=>Z.participant!==se),[e,se])[0],V=x.useMemo(()=>(M||[]).find(Z=>Z.participant===se),[M,se]);return f.jsxs("div",{className:`flex flex-col h-full ${o.video.container} relative`,children:[f.jsxs("div",{className:`flex items-center justify-between p-4 border-b ${o.video.header}`,children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:`w-3 h-3 rounded-full ${o.video.statusDot}`}),f.jsx("span",{className:"font-medium",children:"Video Call"}),f.jsxs("span",{className:"text-sm opacity-70",children:[P.length+1," participant",P.length!==0?"s":""]})]}),f.jsx("div",{className:"flex items-center gap-2",children:f.jsx("button",{className:`p-2 rounded-lg transition-colors ${o.video.headerButton}`,title:"Layout options",children:f.jsx(Ze.LayoutGrid,{className:"w-4 h-4"})})})]}),f.jsx("div",{className:"relative flex-1 min-h-0",children:!a&&f.jsx("div",{className:"p-4 min-h-0 h-full",children:f.jsxs("div",{className:"relative w-full h-full rounded-lg overflow-hidden",children:[Q?f.jsx(Zu,{trackRef:Q,participant:Q.participant,isLocal:!1,theme:t,className:"w-full h-full"}):f.jsx("div",{className:"w-full h-full flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx(Ze.Users,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),f.jsx("p",{className:"text-lg opacity-70",children:"Waiting for agent video..."})]})}),V&&f.jsx("div",{className:"absolute bottom-4 left-0 sm:left-0 z-10 w-32 sm:w-36 h-20 sm:h-24 rounded-lg overflow-hidden shadow-xl border border-white/20",children:f.jsxs("div",{className:"relative w-full h-full bg-black/40",children:[f.jsx(ut.VideoTrack,{trackRef:V,className:"w-full h-full object-contain"}),f.jsx("div",{className:`absolute top-1 left-1 px-1.5 py-0.5 rounded text-xs ${o.video.nameOverlay}`,children:f.jsxs("span",{className:"inline-flex items-center gap-1",children:[f.jsx(Ze.Monitor,{className:"w-3 h-3"}),f.jsx("span",{className:"text-xs",children:"Sharing"})]})})]})}),$&&f.jsx("div",{className:"absolute bottom-4 right-0 w-32 sm:w-36 h-20 sm:h-24 rounded-lg overflow-hidden shadow-xl border border-white/20",children:f.jsx(Zu,{trackRef:$,participant:se||void 0,isLocal:!0,theme:t,className:"w-full h-full"})})]})})}),f.jsx(Qt,{mode:"wait",children:a&&f.jsxs(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeOut"},className:ce("absolute left-0 right-0 top-0 flex flex-col z-20",t==="light"?"bg-white":"bg-gray-900/95 backdrop-blur-sm"),style:{bottom:`${A}px`},children:[f.jsx("div",{className:ce("flex-shrink-0 px-4 py-3 border-b",i==="fullscreen"?"px-8":"px-5",((fe=o.chatHeader)==null?void 0:fe.container)||"border-gray-200 dark:border-gray-700"),children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("h3",{className:ce("font-semibold text-lg",((R=o.text)==null?void 0:R.primary)||"text-gray-900 dark:text-white"),children:"Chat & Transcription"}),f.jsxs("p",{className:ce("text-sm",((re=o.text)==null?void 0:re.muted)||"text-gray-600 dark:text-gray-400"),children:[U.length," messages"]})]}),f.jsx("button",{onClick:()=>l(!1),className:ce("p-2 rounded-lg transition-colors",o.video.headerButton||"hover:bg-gray-100 dark:hover:bg-gray-800"),title:"Close chat",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}),f.jsxs("div",{className:ce("flex-1 flex flex-col min-h-0",i==="fullscreen"?"px-8":"px-5"),children:[f.jsxs("div",{ref:b,className:ce("flex-1 flex flex-col h-full overflow-y-auto scrollbar-hide py-4"),style:{scrollbarWidth:"none",scrollBehavior:"smooth",paddingBottom:"16px"},onScroll:F,children:[U.length===0&&f.jsx("div",{className:"flex-1 flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx(ge.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 mx-auto",children:de}),f.jsx("p",{className:ce("text-lg font-medium mb-2",((ne=o.text)==null?void 0:ne.primary)||"text-gray-900 dark:text-white"),children:"Start Speaking"}),f.jsx("p",{className:ce("text-sm",((me=o.text)==null?void 0:me.muted)||"text-gray-600 dark:text-gray-400"),children:"Your conversation will appear here"})]})}),U.length>0&&f.jsx("div",{className:"w-full max-w-5xl mx-auto space-y-3 py-4 flex-1 flex flex-col justify-end",children:f.jsxs("div",{className:"space-y-3",children:[f.jsx(Qt,{mode:"popLayout",children:U.map((Z,pe)=>f.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3,ease:"easeOut",delay:pe*.02},layout:!0,children:f.jsx(fE,{message:Z,theme:t,isOwn:Z.sender.type==="participant",isStreaming:m.has(Z.id)})},Z.id||`message-${pe}`))}),d&&f.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:U.length*.1},className:"flex w-full justify-start mb-4 px-1",children:f.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[f.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:de}),f.jsx("div",{className:"relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-white rounded-bl-md transition-all duration-200 group-hover:scale-[1.02]",style:{wordWrap:"break-word",overflowWrap:"break-word",minWidth:48},children:f.jsx("span",{className:"inline-flex items-center",children:[0,1,2].map(Z=>f.jsx(ge.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:Z*.2,ease:"easeInOut"}},Z))})})]})}),f.jsx("div",{ref:p})]})})]}),!v&&U.length>0&&f.jsx(ge.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onClick:()=>{k(!0),W(!1)},className:ce("absolute right-6 z-30 p-3 rounded-full shadow-lg backdrop-blur-sm border transition-all duration-200 hover:scale-105",t==="light"?"bg-white/90 text-gray-600 border-gray-200 hover:bg-white hover:text-gray-800":"bg-gray-800/90 text-gray-300 border-gray-700 hover:bg-gray-700 hover:text-white"),style:{bottom:16},"aria-label":"Scroll to bottom",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})})]})]})}),f.jsx("div",{ref:S,className:"relative z-30 mt-auto",children:f.jsx(hE,{onToggleMicrophone:()=>L.toggle(),onToggleCamera:w,onToggleScreenShare:z,onToggleChat:oe,onEndCall:E,theme:t,microphoneEnabled:L.enabled,cameraEnabled:y.enabled,screenShareEnabled:N.enabled,chatOpen:a,isMicrophoneLoading:L.pending,isCameraLoading:y.pending,isScreenShareLoading:N.pending,disabled:r})})]})}function ni({onClick:e,disabled:t,theme:n}){const r=et(n);return f.jsx("button",{className:r.micButton,onClick:e,disabled:t,"aria-label":"Start Voice Session",type:"button",children:f.jsx(mh,{})})}function $o({onClick:e,disabled:t,theme:n}){const r=et(n);return f.jsx("button",{className:r.chatButton,onClick:e,disabled:t,"aria-label":"Start Chat Session",type:"button",children:f.jsx(hh,{})})}function _o({onClick:e,disabled:t,theme:n}){const r=et(n);return f.jsx("button",{className:r.videoButton,onClick:e,disabled:t,"aria-label":"Start Video Session",type:"button",children:f.jsx(ph,{})})}function pE({prompts:e,theme:t}){const n=et(t),[r,i]=j.useState(0);return j.useEffect(()=>{const s=setInterval(()=>{i(o=>(o+1)%e.length)},3e3);return()=>clearInterval(s)},[e.length]),f.jsx("div",{className:"w-96 min-h-[3rem] h-12 relative overflow-hidden flex items-center justify-center",children:e.map((s,o)=>f.jsx("div",{className:`
159
+ `,style:{wordWrap:"break-word",overflowWrap:"break-word"},children:[f.jsx("div",{className:"whitespace-pre-wrap break-words leading-relaxed text-sm",children:r&&!n?f.jsx(NE,{text:e.content,isComplete:!r,isRealTimeStream:((l=e.metadata)==null?void 0:l.streaming)===!0,speed:35}):e.content}),f.jsx("div",{className:"text-xs mt-1",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}function RE({onToggleMicrophone:e,onToggleCamera:t,onToggleScreenShare:n,onToggleChat:r,onEndCall:i,theme:s,microphoneEnabled:o,cameraEnabled:a,screenShareEnabled:l,chatOpen:c,isMicrophoneLoading:u,isCameraLoading:d,isScreenShareLoading:h,disabled:m}){const g=tt(s);return f.jsxs("div",{className:ce("flex items-center justify-center gap-3 px-3 py-2 w-full backdrop-blur-xl border-t",s==="light"?"bg-white/95 border-gray-200":"bg-gray-900/90 border-gray-700"),children:[f.jsx("button",{onClick:e,disabled:m||u,className:`p-3 rounded-full transition-all duration-200 ${o?g.video.controlEnabled:g.video.controlDisabled} ${m?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:o?"Mute microphone":"Unmute microphone",children:u?f.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):o?f.jsx(Ze.Mic,{className:"w-5 h-5"}):f.jsx(Ze.MicOff,{className:"w-5 h-5"})}),f.jsx("button",{onClick:t,disabled:m||d,className:`p-3 rounded-full transition-all duration-200 ${a?g.video.controlEnabled:g.video.controlDisabled} ${m?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:a?"Turn off camera":"Turn on camera",children:d?f.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):a?f.jsx(Ze.Camera,{className:"w-5 h-5"}):f.jsx(Ze.CameraOff,{className:"w-5 h-5"})}),f.jsx("button",{onClick:n,disabled:m||h,className:`p-3 rounded-full transition-all duration-200 ${l?g.video.controlEnabled:g.video.controlDisabled} ${m?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:l?"Stop screen share":"Share screen",children:h?f.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):f.jsx(Ze.Monitor,{className:"w-5 h-5"})}),f.jsx("button",{onClick:r,disabled:m,className:`relative p-3 rounded-full transition-all duration-200 ${c?g.video.controlEnabled:g.video.controlDisabled} ${m?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:c?"Hide chat":"Show chat & transcription",children:f.jsx(Ze.MessageCircle,{className:"w-5 h-5"})}),i&&f.jsx("button",{onClick:i,disabled:m,className:`p-3 rounded-full transition-all duration-200 ${g.video.endCall} ${m?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"End call",children:f.jsx(Ze.PhoneOff,{className:"w-5 h-5"})})]})}function td({trackRef:e,participant:t,isLocal:n=!1,className:r="",theme:i}){var l;const s=tt(i),o=(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 f.jsxs("div",{className:`relative rounded-lg overflow-hidden ${s.video.tile} ${r}`,children:[a?f.jsx(dt.VideoTrack,{trackRef:e,className:"w-full h-full object-cover"}):f.jsx("div",{className:`w-full h-full flex items-center justify-center ${s.video.placeholder}`,children:f.jsx("div",{className:"text-center",children:f.jsx("div",{className:`w-16 h-16 mx-auto mb-2 rounded-full flex items-center justify-center ${s.video.avatar}`,children:f.jsx(Ze.User,{className:"w-8 h-8"})})})}),f.jsx("div",{className:`absolute bottom-2 left-2 px-2 py-1 rounded text-xs ${s.video.nameOverlay}`,children:o}),((l=e==null?void 0:e.publication)==null?void 0:l.isMuted)&&f.jsx("div",{className:`absolute top-2 right-2 p-1 rounded ${s.video.mutedIndicator}`,children:f.jsx(Ze.CameraOff,{className:"w-4 h-4"})})]})}function VE({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:i,onEndCall:s}){var G,fe,R,re,ne,me;const o=tt(t),[a,l]=x.useState(!1),[c,u]=x.useState(()=>e&&typeof e.getChatMessages=="function"?e.getChatMessages():[]),[d,h]=x.useState(!1),[m,g]=x.useState(new Set),p=x.useRef(null),b=x.useRef(null),[v,k]=x.useState(!0),S=x.useRef(null),[A,T]=x.useState(64);x.useLayoutEffect(()=>{const Z=S.current;if(!Z)return;const pe=()=>T(Z.offsetHeight||64);pe();const Ae=new ResizeObserver(()=>pe());return Ae.observe(Z),wa(zt,"resize",pe),()=>{Ae.disconnect(),ka(zt,"resize",pe)}},[]);const C=ah(e),{screenShareTrackRefs:N}=K1(e),P=x.useMemo(()=>e.getRemoteParticipants(),[e,C]),L=Hn(e,"microphone"),y=Hn(e,"camera"),M=Hn(e,"screenShare"),[D,B]=x.useState(null),H=(G=e==null?void 0:e.getCurrentAgentInfo)==null?void 0:G.call(e),de=((H==null?void 0:H.name)||"AI Assistant").split(" ").map(Z=>Z[0]).join("").toUpperCase().slice(0,2),ie=x.useCallback(()=>{if(b.current){const{scrollTop:Z,scrollHeight:pe,clientHeight:Ae}=b.current;return pe-Z-Ae<100}return!0},[]),F=x.useCallback(()=>{const Z=ie();k(Z)},[ie]),W=x.useCallback((Z=!1)=>{if(v&&b.current){const pe=b.current;Z?pe.scrollTop=pe.scrollHeight:pe.scrollTo({top:pe.scrollHeight,behavior:"smooth"})}},[v]);x.useEffect(()=>{if(!e)return;const Z=xe=>{console.log("VideoView: Received message:",xe),xe.sender.type==="agent"&&h(!1),u(Ne=>{var He;if(Ne.some(rt=>rt.id===xe.id))return Ne;if(xe.sender.type==="agent"&&(g(rt=>new Set(rt).add(xe.id)),!((He=xe.metadata)!=null&&He.streaming))){const rt=xe.content.length*35+1e3;setTimeout(()=>{g(Gt=>{const Lt=new Set(Gt);return Lt.delete(xe.id),Lt})},rt)}return[...Ne,xe]}),setTimeout(()=>{v&&W(!0)},0)},pe=xe=>{var Ne;console.log("VideoView: Updated message:",xe),u(ze=>ze.map(He=>He.id===xe.id?{...xe}:He)),setTimeout(()=>{v&&W(!0)},0),(Ne=xe.metadata)!=null&&Ne.streaming||g(ze=>{const He=new Set(ze);return He.delete(xe.id),He})},Ae=xe=>{var Ne;console.log("VideoView: Sent message:",xe),((Ne=xe.metadata)==null?void 0:Ne.topic)!=="lk.transcription"&&(u(ze=>ze.some(rt=>rt.id===xe.id)?ze:[...ze,xe]),setTimeout(()=>{v&&W(!0)},0))};return e.on("chat.message.received",Z),e.on("chat.message.updated",pe),e.on("chat.message.sent",Ae),()=>{e.off("chat.message.received",Z),e.off("chat.message.updated",pe),e.off("chat.message.sent",Ae)}},[e,v,W]),x.useEffect(()=>{if(!e)return;const Z=()=>{console.log("VideoView: Agent is thinking"),h(!0)},pe=()=>{console.log("VideoView: Agent is speaking"),h(!1)};return e.on("agent.thinking",Z),e.on("agent.speaking",pe),()=>{e.off("agent.thinking",Z),e.off("agent.speaking",pe)}},[e]);const w=x.useCallback(async()=>{y.pending||await y.toggle()},[y]),z=x.useCallback(async()=>{M.pending||await M.toggle()},[M]),oe=x.useCallback(()=>{l(Z=>!Z)},[]),E=x.useCallback(()=>{s?s():n&&n()},[s,n]);x.useCallback(async Z=>{var pe;try{await((pe=e==null?void 0:e.sendChatMessage)==null?void 0:pe.call(e,Z))}catch(Ae){console.error("Failed to send message:",Ae)}},[e]),x.useEffect(()=>{a&&c.length>0&&setTimeout(()=>{v&&W(!0)},100)},[c.length,a,v,W]);const U=x.useMemo(()=>c.filter(Z=>Z.content&&Z.content.trim()!==""&&Z.content.trim()!=="..."),[c]);x.useEffect(()=>{if(!e)return;const Z=pe=>{console.log("📺 Video: Interactive UI state updated:",pe),B(pe)};return e.on("interactive.ui.update",Z),e.on("interactive.ui.show",Z),()=>{e.off("interactive.ui.update",Z),e.off("interactive.ui.show",Z)}},[e]);const se=C==null?void 0:C.localParticipant,$=x.useMemo(()=>(e?e.getCameraTrackRefs():[]).find(Z=>Z.participant===se),[e,se]),Q=x.useMemo(()=>(e?e.getCameraTrackRefs():[]).filter(Z=>Z.participant!==se),[e,se])[0],V=x.useMemo(()=>(N||[]).find(Z=>Z.participant===se),[N,se]);return f.jsxs("div",{className:`flex flex-col h-full ${o.video.container} relative`,children:[f.jsxs("div",{className:`flex items-center justify-between p-4 border-b ${o.video.header}`,children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:`w-3 h-3 rounded-full ${o.video.statusDot}`}),f.jsx("span",{className:"font-medium",children:"Video Call"}),f.jsxs("span",{className:"text-sm opacity-70",children:[P.length+1," participant",P.length!==0?"s":""]})]}),f.jsx("div",{className:"flex items-center gap-2",children:f.jsx("button",{className:`p-2 rounded-lg transition-colors ${o.video.headerButton}`,title:"Layout options",children:f.jsx(Ze.LayoutGrid,{className:"w-4 h-4"})})})]}),f.jsx("div",{className:"relative flex-1 min-h-0",children:!a&&f.jsx("div",{className:"p-4 min-h-0 h-full",children:f.jsxs("div",{className:"relative w-full h-full rounded-lg overflow-hidden",children:[Q?f.jsx(td,{trackRef:Q,participant:Q.participant,isLocal:!1,theme:t,className:"w-full h-full"}):f.jsx("div",{className:"w-full h-full flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx(Ze.Users,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),f.jsx("p",{className:"text-lg opacity-70",children:"Waiting for agent video..."})]})}),V&&f.jsx("div",{className:"absolute bottom-4 left-0 sm:left-0 z-10 w-32 sm:w-36 h-20 sm:h-24 rounded-lg overflow-hidden shadow-xl border border-white/20",children:f.jsxs("div",{className:"relative w-full h-full bg-black/40",children:[f.jsx(dt.VideoTrack,{trackRef:V,className:"w-full h-full object-contain"}),f.jsx("div",{className:`absolute top-1 left-1 px-1.5 py-0.5 rounded text-xs ${o.video.nameOverlay}`,children:f.jsxs("span",{className:"inline-flex items-center gap-1",children:[f.jsx(Ze.Monitor,{className:"w-3 h-3"}),f.jsx("span",{className:"text-xs",children:"Sharing"})]})})]})}),$&&f.jsx("div",{className:"absolute bottom-4 right-0 w-32 sm:w-36 h-20 sm:h-24 rounded-lg overflow-hidden shadow-xl border border-white/20",children:f.jsx(td,{trackRef:$,participant:se||void 0,isLocal:!0,theme:t,className:"w-full h-full"})})]})})}),f.jsx(en,{mode:"wait",children:a&&f.jsxs(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeOut"},className:ce("absolute left-0 right-0 top-0 flex flex-col z-20",t==="light"?"bg-white":"bg-gray-900/95 backdrop-blur-sm"),style:{bottom:`${A}px`},children:[f.jsx("div",{className:ce("flex-shrink-0 px-4 py-3 border-b",i==="fullscreen"?"px-8":"px-5",((fe=o.chatHeader)==null?void 0:fe.container)||"border-gray-200 dark:border-gray-700"),children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("h3",{className:ce("font-semibold text-lg",((R=o.text)==null?void 0:R.primary)||"text-gray-900 dark:text-white"),children:"Chat & Transcription"}),f.jsxs("p",{className:ce("text-sm",((re=o.text)==null?void 0:re.muted)||"text-gray-600 dark:text-gray-400"),children:[U.length," messages"]})]}),f.jsx("button",{onClick:()=>l(!1),className:ce("p-2 rounded-lg transition-colors",o.video.headerButton||"hover:bg-gray-100 dark:hover:bg-gray-800"),title:"Close chat",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}),f.jsxs("div",{className:ce("flex-1 flex flex-col min-h-0",i==="fullscreen"?"px-8":"px-5"),children:[f.jsxs("div",{ref:b,className:ce("flex-1 flex flex-col h-full overflow-y-auto scrollbar-hide py-4"),style:{scrollbarWidth:"none",scrollBehavior:"smooth",paddingBottom:"16px"},onScroll:F,children:[U.length===0&&f.jsx("div",{className:"flex-1 flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx(ge.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 mx-auto",children:de}),f.jsx("p",{className:ce("text-lg font-medium mb-2",((ne=o.text)==null?void 0:ne.primary)||"text-gray-900 dark:text-white"),children:"Start Speaking"}),f.jsx("p",{className:ce("text-sm",((me=o.text)==null?void 0:me.muted)||"text-gray-600 dark:text-gray-400"),children:"Your conversation will appear here"})]})}),U.length>0&&f.jsx("div",{className:"w-full max-w-5xl mx-auto space-y-3 py-4 flex-1 flex flex-col justify-end",children:f.jsxs("div",{className:"space-y-3",children:[f.jsx(en,{mode:"popLayout",children:U.map((Z,pe)=>f.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3,ease:"easeOut",delay:pe*.02},layout:!0,children:f.jsx(IE,{message:Z,theme:t,isOwn:Z.sender.type==="participant",isStreaming:m.has(Z.id)})},Z.id||`message-${pe}`))}),d&&f.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:U.length*.1},className:"flex w-full justify-start mb-4 px-1",children:f.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%]",children:[f.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:de}),f.jsx("div",{className:"relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-white rounded-bl-md transition-all duration-200 group-hover:scale-[1.02]",style:{wordWrap:"break-word",overflowWrap:"break-word",minWidth:48},children:f.jsx("span",{className:"inline-flex items-center",children:[0,1,2].map(Z=>f.jsx(ge.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:Z*.2,ease:"easeInOut"}},Z))})})]})}),f.jsx("div",{ref:p})]})})]}),!v&&U.length>0&&f.jsx(ge.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onClick:()=>{k(!0),W(!1)},className:ce("absolute right-6 z-30 p-3 rounded-full shadow-lg backdrop-blur-sm border transition-all duration-200 hover:scale-105",t==="light"?"bg-white/90 text-gray-600 border-gray-200 hover:bg-white hover:text-gray-800":"bg-gray-800/90 text-gray-300 border-gray-700 hover:bg-gray-700 hover:text-white"),style:{bottom:16},"aria-label":"Scroll to bottom",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})})]})]})}),f.jsx("div",{ref:S,className:"relative z-30 mt-auto",children:f.jsx(RE,{onToggleMicrophone:()=>L.toggle(),onToggleCamera:w,onToggleScreenShare:z,onToggleChat:oe,onEndCall:E,theme:t,microphoneEnabled:L.enabled,cameraEnabled:y.enabled,screenShareEnabled:M.enabled,chatOpen:a,isMicrophoneLoading:L.pending,isCameraLoading:y.pending,isScreenShareLoading:M.pending,disabled:r})})]})}function oi({onClick:e,disabled:t,theme:n}){const r=tt(n);return f.jsx("button",{className:r.micButton,onClick:e,disabled:t,"aria-label":"Start Voice Session",type:"button",children:f.jsx(jh,{})})}function Uo({onClick:e,disabled:t,theme:n}){const r=tt(n);return f.jsx("button",{className:r.chatButton,onClick:e,disabled:t,"aria-label":"Start Chat Session",type:"button",children:f.jsx(Ah,{})})}function Wo({onClick:e,disabled:t,theme:n}){const r=tt(n);return f.jsx("button",{className:r.videoButton,onClick:e,disabled:t,"aria-label":"Start Video Session",type:"button",children:f.jsx(Ph,{})})}function DE({prompts:e,theme:t}){const n=tt(t),[r,i]=j.useState(0);return j.useEffect(()=>{const s=setInterval(()=>{i(o=>(o+1)%e.length)},3e3);return()=>clearInterval(s)},[e.length]),f.jsx("div",{className:"w-96 min-h-[3rem] h-12 relative overflow-hidden flex items-center justify-center",children:e.map((s,o)=>f.jsx("div",{className:`
160
160
  ${n.promptSlider}
161
161
  ${o===r?"opacity-100":"opacity-0"}
162
162
  whitespace-pre-line break-words
163
- `,style:{minHeight:"2.5rem",display:o===r?"block":"none"},children:s},o))})}function gE({statusMessage:e,theme:t}){const n=et(t);return f.jsxs("div",{className:"z-10 flex items-center space-x-2 mt-2 pb-2",children:[f.jsx("div",{className:n.statusIndicator}),f.jsx("span",{className:`text-xs ${n.text.muted}`,children:e})]})}const wm=j.forwardRef(({disabled:e,onStartCall:t,onStartChat:n,onStartVideo:r,prompts:i=['"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:s="Agent is ready",title:o="Choose how to interact",subTitle:a="Ask me anything or give me a task to complete",theme:l="vox",modalities:c=["voice","chat","video"]},u)=>{const d=et(l),h=c.includes("voice"),m=c.includes("chat"),g=c.includes("video"),p=[h,m,g].filter(Boolean).length;return f.jsxs("div",{className:"flex p-8 flex-col items-center h-full justify-center w-full relative","aria-disabled":e,style:{background:"transparent"},children:[f.jsxs("div",{className:"mt-1 relative flex items-center justify-center mb-8 w-full",style:{minHeight:"120px"},children:[f.jsxs("div",{className:"absolute inset-0 flex items-center justify-center",children:[f.jsx("div",{className:d.pulseRings.ring1}),f.jsx("div",{className:d.pulseRings.ring2,style:{animationDelay:"0.5s"}}),f.jsx("div",{className:d.pulseRings.ring3,style:{animationDelay:"1s"}})]}),f.jsx("div",{className:"relative z-10 flex items-center justify-center",children:h&&m&&g?f.jsxs("div",{className:"flex gap-4 items-center justify-center",children:[f.jsx(ni,{onClick:t,disabled:e,theme:l}),f.jsx($o,{onClick:n,disabled:e,theme:l}),f.jsx(_o,{onClick:r||t,disabled:e,theme:l})]}):p>1?f.jsxs("div",{className:"flex gap-6 items-center justify-center",children:[h&&f.jsx(ni,{onClick:t,disabled:e,theme:l}),m&&f.jsx($o,{onClick:n,disabled:e,theme:l}),g&&r&&f.jsx(_o,{onClick:r,disabled:e,theme:l})]}):f.jsx("div",{className:"flex items-center justify-center",children:h?f.jsx(ni,{onClick:t,disabled:e,theme:l}):m?f.jsx($o,{onClick:n,disabled:e,theme:l}):g&&r?f.jsx(_o,{onClick:r,disabled:e,theme:l}):f.jsx(ni,{onClick:t,disabled:e,theme:l})})})]}),f.jsxs("div",{className:"text-center flex flex-col items-center gap-y-2 mb-6 w-full",children:[f.jsx("h3",{className:`text-xl font-semibold mb-2 ${d.text.accent}`,children:o}),f.jsx("p",{className:`text-sm leading-relaxed px-4 ${d.text.secondary}`,children:a}),p>1&&f.jsxs("div",{className:"flex gap-6 mt-4 text-xs justify-center",children:[h&&f.jsxs("div",{className:"flex flex-col items-center gap-1",children:[f.jsx(mh,{className:"w-4 h-4"}),f.jsx("span",{className:d.text.muted,children:"Voice"})]}),m&&f.jsxs("div",{className:"flex flex-col items-center gap-1",children:[f.jsx(hh,{className:"w-4 h-4"}),f.jsx("span",{className:d.text.muted,children:"Chat"})]}),g&&f.jsxs("div",{className:"flex flex-col items-center gap-1",children:[f.jsx(ph,{className:"w-4 h-4"}),f.jsx("span",{className:d.text.muted,children:"Video"})]})]})]}),f.jsx(pE,{prompts:i,theme:l}),f.jsx(gE,{statusMessage:s,theme:l})]})});wm.displayName="Welcome";class za extends x.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 x.createElement(t,{error:this.state.error})}return x.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 km({room:e,onSessionEnd:t,onSessionStart:n,enableConsoleLogging:r=!0,enableLocalStorage:i=!0,voxketSessionId:s}={}){const[o,a]=x.useState(null),[l,c]=x.useState([]),[u,d]=x.useState(null),[h,m]=x.useState([]),g=x.useCallback((k,S)=>{const A={timestamp:new Date,event:k,data:S,sessionId:o==null?void 0:o.sessionId,participantId:u==null?void 0:u.identity};if(c(T=>[...T,A]),i){const T=JSON.parse(localStorage.getItem("voxket-session-logs")||"[]");T.push(A),localStorage.setItem("voxket-session-logs",JSON.stringify(T))}return A},[o==null?void 0:o.sessionId,u==null?void 0:u.identity,r,i]);x.useEffect(()=>{if(!e)return;const k=()=>{const y=s||`session-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,N=new Date,D={sessionId:y,startTime:N,totalMessages:0,connectionIssues:0,participantCount:h.length,events:[]};a(D),g("SESSION_STARTED",{sessionId:y,startTime:N}),n==null||n(y)},S=()=>{if(o){const y=new Date,N=y.getTime()-o.startTime.getTime(),D={...o,endTime:y,duration:N,events:l};g("SESSION_ENDED",{sessionId:o.sessionId,duration:`${Math.round(N/1e3)}s`,totalMessages:o.totalMessages,connectionIssues:o.connectionIssues}),t==null||t(D),a(null),c([])}},A=y=>{g("CONNECTION_STATE_CHANGED",{state:y}),y===te.ConnectionState.Reconnecting&&o&&(a(N=>N?{...N,connectionIssues:N.connectionIssues+1}:null),g("CONNECTION_ISSUE",{type:"reconnecting"}))},T=y=>{g("TRACK_PUBLISHED",{trackKind:y.kind,trackSource:y.source})},C=y=>{g("TRACK_UNPUBLISHED",{trackKind:y.kind,trackSource:y.source})},M=(y,N)=>{o&&a(D=>D?{...D,totalMessages:D.totalMessages+1}:null),g("DATA_RECEIVED",{participantId:N==null?void 0:N.identity,dataSize:y.length})},P=y=>{g("PARTICIPANT_CONNECTED",{participantId:y.identity,participantName:y.name}),m(N=>[...N,y]),o&&a(N=>N?{...N,participantCount:N.participantCount+1}:null)},L=y=>{g("PARTICIPANT_DISCONNECTED",{participantId:y.identity,participantName:y.name}),m(N=>N.filter(D=>D.identity!==y.identity))};return e.localParticipant&&d(e.localParticipant),e.on(te.RoomEvent.Connected,k),e.on(te.RoomEvent.Disconnected,S),e.on(te.RoomEvent.ConnectionStateChanged,A),e.on(te.RoomEvent.TrackPublished,T),e.on(te.RoomEvent.TrackUnpublished,C),e.on(te.RoomEvent.DataReceived,M),e.on(te.RoomEvent.ParticipantConnected,P),e.on(te.RoomEvent.ParticipantDisconnected,L),()=>{e.off(te.RoomEvent.Connected,k),e.off(te.RoomEvent.Disconnected,S),e.off(te.RoomEvent.ConnectionStateChanged,A),e.off(te.RoomEvent.TrackPublished,T),e.off(te.RoomEvent.TrackUnpublished,C),e.off(te.RoomEvent.DataReceived,M),e.off(te.RoomEvent.ParticipantConnected,P),e.off(te.RoomEvent.ParticipantDisconnected,L)}},[e,o,l,h.length,g,t,n]);const p=x.useCallback(()=>i?JSON.parse(localStorage.getItem("voxket-session-logs")||"[]"):l,[l,i]),b=x.useCallback(()=>{i&&localStorage.removeItem("voxket-session-logs"),c([])},[i]),v=x.useCallback(()=>{const k=p(),S=JSON.stringify(k,null,2),A="data:application/json;charset=utf-8,"+encodeURIComponent(S),T=`voxket-session-logs-${new Date().toISOString().split("T")[0]}.json`,C=document.createElement("a");C.setAttribute("href",A),C.setAttribute("download",T),C.click()},[p]);return{sessionMetrics:o,sessionLogs:l,logEvent:g,getSessionLogs:p,clearSessionLogs:b,exportSessionLogs:v}}class Ha{constructor(){Ue(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=(...i)=>{this.off(t,r),n(...i)};return this.on(t,r)}off(t,n){const r=this.listeners[t];if(!r)return;const i=r.indexOf(n);i>-1&&r.splice(i,1)}removeAllListeners(t){t?delete this.listeners[t]:this.listeners={}}emit(t,...n){const r=this.listeners[t];if(!r)return;const i=[...r];for(const s of i)try{s(...n)}catch(o){console.error(`Error in event listener for ${String(t)}:`,o)}}listenerCount(t){var n;return((n=this.listeners[t])==null?void 0:n.length)??0}eventNames(){return Object.keys(this.listeners)}}class Sm{constructor(t){Ue(this,"plugins",new Map);Ue(this,"installedPlugins",new Set);Ue(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 s of r.dependencies)this.installedPlugins.has(s)||await this.install(s);const i={...this.context,config:{...r.config,...n}};r.install&&await r.install(i),this.installedPlugins.add(t),this.setupPluginEvents(r,i)}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[i,s]of this.plugins)if(this.installedPlugins.has(i)&&((r=s.dependencies)!=null&&r.includes(t)))throw new Error(`Cannot uninstall '${t}' because '${i}' 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 yE(e){return e}function Ua(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 xE={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)})}},bE={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))}},vE={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})})}},Cm=j.createContext(null);function ci({config:e,children:t,autoConnect:n=!1,client:r}){const[i,s]=j.useState(null),[o,a]=j.useState(!1),[l,c]=j.useState(!1),[u,d]=j.useState(null),[h,m]=j.useState(null),[g,p]=j.useState("idle"),[b,v]=j.useState(null),[k,S]=j.useState([]),[A,T]=j.useState([]),[C,M]=j.useState([]);j.useEffect(()=>{const W=r||new $r(e);s(W);const w=P(W);return n&&!r&&L(W),()=>{w(),r||W.disconnect().catch(console.error)}},[e,n,r]);const P=W=>{const w=()=>{c(!0),d(null)},z=()=>{a(!0),c(!1),d(null)},oe=()=>{a(!1),c(!1),m(null),p("idle"),S([]),T([]),M([])},E=re=>{d(re),c(!1)},U=re=>{m(re),p(re.state)},se=re=>{p(re),h&&m({...h,state:re})},$=(re,ne)=>{m(null),p("idle"),v(ne),S([]),T([]),M([])},ee=re=>{S(ne=>[...ne,re])},Q=re=>{S(ne=>ne.filter(me=>me.id!==re.id))},V=re=>{T(ne=>[...ne,re])},X=re=>{T(ne=>[...ne,re])},fe=re=>{console.log("📝 VoxketProvider: Received transcription:",re),M(ne=>ne.find(Z=>Z.id===re.id)?(console.log("📝 VoxketProvider: Duplicate transcription detected, skipping:",re.id),ne):(console.log("📝 VoxketProvider: Adding new transcription:",re.id),[...ne,re]))},R=()=>{console.log("🧹 VoxketProvider: Clearing chat messages and transcriptions"),T([]),M([])};return W.on("connection.connecting",w),W.on("connection.connected",z),W.on("connection.disconnected",oe),W.on("connection.error",E),W.on("session.created",U),W.on("session.state.changed",se),W.on("session.ended",$),W.on("participant.joined",ee),W.on("participant.left",Q),W.on("chat.message.received",V),W.on("chat.message.sent",X),W.on("transcription.received",fe),W.on("chat.history.cleared",R),()=>{console.log("📝 VoxketProvider: Cleaning up event listeners"),W.off("connection.connecting",w),W.off("connection.connected",z),W.off("connection.disconnected",oe),W.off("connection.error",E),W.off("session.created",U),W.off("session.state.changed",se),W.off("session.ended",$),W.off("participant.joined",ee),W.off("participant.left",Q),W.off("chat.message.received",V),W.off("chat.message.sent",X),W.off("chat.history.cleared",R),W.off("transcription.received",fe)}},L=async W=>{const w=W||i;if(w)try{await w.connect()}catch(z){console.error("Failed to connect:",z)}},F={client:i,isConnected:o,isConnecting:l,connectionError:u,currentSession:h,sessionState:g,sessionMetrics:b,participants:k,chatMessages:A,transcriptions:C,connect:()=>L(),disconnect:async()=>{if(i)try{await i.disconnect()}catch(W){console.error("Failed to disconnect:",W)}},createSession:async(W,w={})=>{if(!i)throw new Error("Client not initialized");const z={agentId:W,participantName:w.participantName||"User",metadata:w.metadata,modalities:w.modalities||["voice"]};return await i.createSession(z)},endSession:async()=>i?await i.endSession():null,sendChatMessage:async W=>{if(!i)throw new Error("Client not initialized");await i.sendChatMessage(W)},setMicrophoneEnabled:async W=>{if(!i)throw new Error("Client not initialized");await i.setMicrophoneEnabled(W)},setCameraEnabled:async W=>{if(!i)throw new Error("Client not initialized");await i.setCameraEnabled(W)},startScreenShare:async()=>{if(!i)throw new Error("Client not initialized");await i.startScreenShare()},stopScreenShare:async()=>{if(!i)throw new Error("Client not initialized");await i.stopScreenShare()}};return f.jsx(Cm.Provider,{value:F,children:t})}function Dt(){const e=j.useContext(Cm);if(!e)throw new Error("useVoxket must be used within a VoxketProvider");return e}class wE extends Ha{constructor(n){super();Ue(this,"room",null);Ue(this,"registeredMethods",new Map);Ue(this,"activeInteractions",new Map);Ue(this,"currentInteraction",null);n&&this.setRoom(n)}setRoom(n){this.room=n}async registerFrontendRPC(n,r,i="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 s={methodName:n,component:r,presentationMode:i};this.registeredMethods.set(n,s);try{this.room.registerRpcMethod(n,async o=>{console.log(`RpcManager: RPC method '${n}' called by ${o.callerIdentity}`),console.log("RpcManager: Payload:",o.payload),this.emit("rpc.method.called",{methodName:n,data:o});let a;console.log(`RpcManager: Current registration for '${n}':`,s);let l=o.responseTimeout||30;try{a=JSON.parse(o.payload)}catch{a=o.payload}try{const c=await this.awaitUserInteraction(n,r,i,a,l);return JSON.stringify(c)}catch(c){throw console.error(`RpcManager: Error in RPC method '${n}':`,c),c}}),this.emit("rpc.method.registered",{methodName:n}),console.log(`RpcManager: Successfully registered RPC method: ${n}`)}catch(o){throw console.error(`RpcManager: Failed to register RPC method '${n}':`,o),o}}async awaitUserInteraction(n,r,i,s,o){return new Promise((a,l)=>{const c=`${n}_${Date.now()}`;console.log(`RpcManager: Starting user interaction for method: ${n}, timeout: ${o} seconds`);const u={didSuccess:(h,m)=>{console.log(`RpcManager: User interaction successful for method: ${n}`,h),this.clearInteraction(c),this.currentInteraction=null;const g={success:!0,message:"User interaction completed successfully",data:h,timestamp:new Date,...m?{successView:m}:{}};this.emit("rpc.interaction.completed",{methodName:n,response:g}),a(g)},didFail:h=>{console.log(`RpcManager: User interaction failed for method: ${n}`,h),this.clearInteraction(c);const m={success:!1,message:"User interaction failed",error:h,timestamp:new Date};this.emit("rpc.interaction.completed",{methodName:n,response:m}),a(m)},dismissView:()=>{var m;console.log(`RpcManager: User dismissed interaction for method: ${n}`),console.log("RpcManager: Current interaction before dismiss:",(m=this.currentInteraction)==null?void 0:m.methodName),this.clearInteraction(c),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 g;((g=this.currentInteraction)==null?void 0:g.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(c),this.currentInteraction=null;const m={success:!0,message:`User interaction timed out after ${o} 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:m}),setTimeout(()=>{var g;((g=this.currentInteraction)==null?void 0:g.methodName)===n&&(console.log(`RpcManager: Force clearing interaction for ${n}`),this.currentInteraction=null)},0),a(m)}},d=setTimeout(()=>{u.didTimeout&&u.didTimeout()},o);this.activeInteractions.set(c,{resolve:h=>a(JSON.parse(h)),reject:l,timeoutId:d}),this.currentInteraction={isVisible:!0,methodName:n,component:r,presentationMode:i,timeout:o,data:s,handler:u},this.emit("rpc.interaction.started",{methodName:n,presentationMode:i}),setTimeout(async()=>{var h;if((h=this.currentInteraction)!=null&&h.handler)try{console.log(`RpcManager: Component created for method: ${n} with data:`,s)}catch(m){console.error("RpcManager: Error loading data into component:",m),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")}}class Ve extends Error{constructor(t,n,r){super(t),this.code=n,this.details=r,this.name="VoxketError"}}const Kt=new WeakSet,Bo=new WeakSet;class $r extends Ha{constructor(n){super();Ue(this,"config");Ue(this,"room",null);Ue(this,"pluginManager");Ue(this,"rpcManager");Ue(this,"isConnected",!1);Ue(this,"currentSession",null);Ue(this,"connectionState",te.ConnectionState.Disconnected);Ue(this,"renderedComponents",new Map);Ue(this,"textStreamHandlersRegistered",!1);Ue(this,"currentAgentInfo",null);Ue(this,"chatMessages",[]);Ue(this,"activeTranscriptions",new Map);Ue(this,"isAgentConnected",!1);Ue(this,"agentState","idle");this.config=n,this.pluginManager=new Sm(this),this.rpcManager=new wE,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,i;this.isConnected=!1,(i=(r=this.config).onDisconnected)==null||i.call(r,n)}),this.on("connection.error",n=>{var r,i;(i=(r=this.config).onError)==null||i.call(r,n)}),this.on("chat.message.received",n=>{var r,i;this.addChatMessage(n),(i=(r=this.config).onMessageReceived)==null||i.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,i;(i=(r=this.config).onTranscriptionReceived)==null||i.call(r,n)}),this.on("session.state.changed",n=>{var r,i;(i=(r=this.config).onSessionStateChanged)==null||i.call(r,n)}),this.on("session.created",n=>{var r,i;(i=(r=this.config).onSessionStart)==null||i.call(r,n.id)}),this.on("session.ended",(n,r)=>{var i,s;(s=(i=this.config).onSessionEnd)==null||s.call(i,r)}),this.on("participant.joined",n=>{var r,i;(i=(r=this.config).onUserJoined)==null||i.call(r,n.id)}),this.on("participant.left",n=>{var r,i;(i=(r=this.config).onUserLeft)==null||i.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 te.Room,this.setupRoomEventListeners()}setupRoomEventListeners(){this.room&&(this.room.on(te.RoomEvent.Connected,()=>{var n,r;this.connectionState=te.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 i;try{(i=this.room)!=null&&i.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(s){console.warn("VoxketClient: Failed to enable microphone after room connection:",s)}},1e3),this.textStreamHandlersRegistered||this.setupTextStreamHandlers()}),this.room.on(te.RoomEvent.Disconnected,n=>{var r;console.log("🔴 VoxketClient: Room disconnected, reason:",n),this.connectionState=te.ConnectionState.Disconnected,this.textStreamHandlersRegistered=!1,this.isAgentConnected=!1,console.log("🤖 VoxketClient: Agent marked as disconnected"),this.clearChatMessages(),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(te.RoomEvent.ConnectionStateChanged,n=>{this.connectionState=n,n===te.ConnectionState.Connecting&&this.emit("connection.connecting")}),this.room.on(te.RoomEvent.ParticipantConnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.joined",r)}),this.room.on(te.RoomEvent.ParticipantDisconnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.left",r)}),this.room.on(te.RoomEvent.LocalTrackPublished,n=>{console.log("🎬 VoxketClient: Local track published:",n.source),n.source===te.Track.Source.ScreenShare&&this.emit("track.unmuted",{source:"screenShare",enabled:!0})}),this.room.on(te.RoomEvent.LocalTrackUnpublished,n=>{console.log("🎬 VoxketClient: Local track unpublished:",n.source),n.source===te.Track.Source.ScreenShare&&this.emit("track.muted",{source:"screenShare",enabled:!1})}))}setupTextStreamHandlers(){if(!this.room)return;try{this.room.registerTextStreamHandler("lk.chat",async(r,i)=>{try{const s=await r.readAll(),o={id:`msg_${Date.now()}_${i.identity||"user"}_${Math.random().toString(36).substr(2,9)}`,content:s,timestamp:new Date,sender:{id:i.identity||"user",name:i.identity||"User",type:"participant"},metadata:{topic:"lk.chat"}};this.emit("chat.message.received",o)}catch(s){console.error("VoxketClient: Failed to process lk.chat message:",s)}})}catch(r){console.warn("VoxketClient: lk.chat handler already registered, skipping:",r)}try{console.log("📝 VoxketClient: Registering lk.transcription handler..."),this.room.registerTextStreamHandler("lk.transcription",async(r,i)=>{var s,o,a,l,c,u;console.log("📝 VoxketClient: Received transcription stream from:",i.identity);try{console.log("📝 VoxketClient: Processing transcription stream...");const d=i.identity===((o=(s=this.room)==null?void 0:s.localParticipant)==null?void 0:o.identity),h=Date.now(),m=i.identity,g=this.activeTranscriptions.get(m);let p,b=!0;g&&h-g.timestamp<1e3?(p=g.messageId,b=!1,console.log("📝 VoxketClient: Reusing existing transcription message ID:",p)):(p=`msg_${d?"user":"agent"}_${i.identity}_${h}`,this.activeTranscriptions.set(m,{messageId:p,timestamp:h}),console.log("📝 VoxketClient: Created new transcription message ID:",p));let v="";const k=((a=this.currentAgentInfo)==null?void 0:a.name)||i.identity||"AI Assistant";console.log("📝 VoxketClient: Using agent name:",k);const S=d?"participant":"agent",A=d?this.config.participantName||"User":k;console.log("📝 VoxketClient: Transcription sender info:",{participantIdentity:i.identity,localParticipantIdentity:(c=(l=this.room)==null?void 0:l.localParticipant)==null?void 0:c.identity,isFromUser:d,senderType:S,senderName:A});const T={id:p,content:"",timestamp:new Date,sender:{id:i.identity||"unknown",name:A,type:S},metadata:{topic:"lk.transcription",streaming:!0}};b&&this.emit("chat.message.received",T),console.log("📝 VoxketClient: Starting to read transcription stream...");for await(const L of r){console.log("📝 VoxketClient: Received chunk:",L.length,"chars"),v+=L;const y=this.convertMarkdownToText(v),N={...T,content:y,metadata:{...T.metadata,streaming:!0}};this.emit("chat.message.updated",N)}const C=this.convertMarkdownToText(v),M={...T,content:C,metadata:{...T.metadata,streaming:!1}};this.emit("chat.message.updated",M);const P={id:p,text:C,isFinal:!0,startTime:T.timestamp.getTime(),participantId:i.identity||"agent"};this.emit("transcription.received",P),console.log("📝 VoxketClient: Emitted transcription event:",P)}catch(d){console.error("VoxketClient: Failed to process lk.transcription message:",d);try{const h=await r.readAll(),m=((u=this.currentAgentInfo)==null?void 0:u.name)||i.identity||"AI Assistant",g={id:`msg_${Date.now()}_agent_transcription_${Math.random().toString(36).substr(2,9)}`,content:h,timestamp:new Date,sender:{id:i.identity||"agent",name:m,type:"agent"},metadata:{topic:"lk.transcription"}};this.emit("chat.message.received",g);const p={id:g.id,text:g.content,isFinal:!0,startTime:g.timestamp.getTime(),participantId:i.identity||"agent"};this.emit("transcription.received",p),console.log("📝 VoxketClient: Emitted fallback transcription event:",p)}catch(h){console.error("VoxketClient: Fallback failed for lk.transcription:",h)}}})}catch(r){console.warn("VoxketClient: lk.transcription handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("suggested_response",async r=>{const i=await r.readAll();let s=[];try{s=["tes","hello how are you","algebra make me learn that ","what is the meaning of life"]}catch(o){console.warn("VoxketClient: Failed to parse suggested_response:",o,i)}this.emit("suggested.response",s)})}catch(r){console.warn("VoxketClient: suggested_response handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("agent_state_changed",async(r,i)=>{const s=await r.readAll();console.log("🤖 VoxketClient: agent_state_changed stream received:",s);let o={};try{o=typeof s=="string"?JSON.parse(s.replace(/'/g,'"')):s}catch(a){console.warn("VoxketClient: Failed to parse agent_state_changed:",a,s)}this.isAgentConnected||(this.isAgentConnected=!0,console.log("🤖 VoxketClient: Agent marked as connected (first state change received)"),this.emit("agent.connected",o)),o.new_state==="speaking"?(this.setAgentState("speaking"),this.emit("agent.speaking",o)):o.new_state==="thinking"?(this.setAgentState("thinking"),this.emit("agent.thinking",o)):(o.new_state==="idle"||o.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,i)=>{try{const s=await r.readAll()}catch(s){console.error("VoxketClient: Error processing images stream:",s)}})}catch(r){console.warn("VoxketClient: images handler already registered, skipping:",r)}try{this.room.registerByteStreamHandler("images",async(r,i)=>{var s,o;try{const a=r.info,l={id:`img_${Date.now()}_${i.identity||"agent"}_${Math.random().toString(36).substr(2,9)}`,content:`�️ ${a.name||"Image"}`,sender:{id:i.identity||"agent",name:i.identity||"Agent",type:i.identity===((o=(s=this.room)==null?void 0:s.localParticipant)==null?void 0:o.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",l),r.onProgress&&(r.onProgress=m=>{const g={...l,metadata:{...l.metadata,downloadProgress:m||0}};this.emit("chat.message.updated",g)});const c=[];for await(const m of r)c.push(m);const u=new Blob(c,{type:a.mimeType||"application/octet-stream"}),d=URL.createObjectURL(u),h={...l,metadata:{...l.metadata,downloading:!1,downloadProgress:1,downloadUrl:d,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(i,s)=>{try{const o=await i.readAll();if(console.log(`📝 VoxketClient: Received '${r}' stream:`,o),r==="error"){let a={};try{a=typeof o=="string"?JSON.parse(o):o}catch{a={message:o}}console.warn("� VoxketClient: Agent error:",a),this.emit("agent.error",a)}else this.emit("text.stream.received",{topic:r,data:o,participantInfo:s})}catch(o){console.error(`VoxketClient: Failed to process '${r}' stream:`,o)}})}catch(i){console.warn(`VoxketClient: Handler for '${r}' already registered, skipping:`,i)}});try{this.room.registerTextStreamHandler("*",async(r,i)=>{var s;try{const o=await r.readAll(),a=((s=r.info)==null?void 0:s.topic)||"unknown";console.log(`📝 VoxketClient: Received unhandled text stream for topic '${a}':`,o),this.emit("text.stream.unhandled",{topic:a,data:o,participantInfo:i})}catch(o){console.error("VoxketClient: Failed to process unhandled text stream:",o)}})}catch(r){console.warn("VoxketClient: Generic text stream handler already registered, skipping:",r)}this.textStreamHandlersRegistered=!0}async fetchConnectionDetails(n,r,i){const s=n||this.config.agentId||"default-agent",o=r||this.config.participantName||"User",a=i||this.config.modalities||["voice"];try{const l={agent_id:s,participant_name:o,participant_metadata:{user_id:""},modality:a[0],modalities:a};console.log("🔗 VoxketClient: Creating session with modalities:",a);const c=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(l)});if(!c.ok){let h=`HTTP ${c.status}: Failed to fetch connection details`;try{const m=await c.json();m&&(m.error?h=`API Error: ${m.error}`:m.detail?h=`API Error: ${m.detail}`:m.message&&(h=`API Error: ${m.message}`))}catch{try{const g=await c.text();g&&(h=`API Error: ${g}`)}catch{}}throw new Error(h)}const u=await c.json();let d;return u.agent_info&&(d={id:u.agent_info.id||s,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=d),{serverUrl:u.wss_url,participantToken:u.token,voxketSessionId:u.session_id,agentInfo:d}}catch(l){console.error("VoxketClient: fetchConnectionDetails failed:",l);const c=new Ve(`Failed to fetch connection details: ${l instanceof Error?l.message:"Unknown error"}`,"CONNECTION_FAILED",l);throw this.emit("connection.error",c),c}}async connect(n,r,i){var s;try{this.emit("connection.connecting");const o=await this.fetchConnectionDetails(n,r,i);return await((s=this.room)==null?void 0:s.connect(o.serverUrl,o.participantToken)),this.isConnected=!0,o}catch(o){console.error("VoxketClient: Connection failed:",o);const a=new Ve(`Failed to connect to Voxket services: ${o instanceof Error?o.message:"Unknown error"}`,"CONNECTION_FAILED",o);throw this.emit("connection.error",a),a}}async disconnect(){var n;try{console.log("🔌 VoxketClient: Starting disconnect process..."),this.room&&(console.log("🔌 VoxketClient: Disconnecting from room:",{roomState:this.room.state,numParticipants:this.room.numParticipants,sessionId:(n=this.currentSession)==null?void 0:n.id}),await this.room.disconnect()),this.isConnected=!1,this.currentSession=null,this.currentAgentInfo=null,this.textStreamHandlersRegistered=!1,this.clearChatMessages(),console.log("🔌 VoxketClient: Creating new room instance..."),this.room=new te.Room,this.setupRoomEventListeners(),console.log("✅ VoxketClient: Disconnect completed successfully"),this.emit("connection.disconnected")}catch(r){console.error("❌ VoxketClient: Disconnect failed:",r);const i=new Ve("Failed to disconnect properly","NETWORK_ERROR",r);throw this.emit("connection.error",i),i}}async createSession(n){var r,i,s,o;try{const a=await this.connect(n.agentId,n.participantName,n.modalities),l={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=l,this.emit("session.created",l),(r=n.modalities)!=null&&r.includes("voice"))try{await new Promise(c=>setTimeout(c,500)),(i=this.room)!=null&&i.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(c){console.warn("VoxketClient: Failed to enable microphone, but continuing with session:",c)}if((s=n.modalities)!=null&&s.includes("video"))try{await new Promise(c=>setTimeout(c,200)),(o=this.room)!=null&&o.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(c){console.warn("VoxketClient: Failed to enable camera, but continuing with session:",c)}return setTimeout(()=>{var c;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:((c=this.room)==null?void 0:c.remoteParticipants.size)||0}))},1e3),l}catch(a){throw console.error("VoxketClient: Failed to create session:",a),a instanceof Ve?a:a instanceof TypeError&&a.message.includes("fetch")?new Ve("Network connection failed","CONNECTION_FAILED",a):a instanceof Error&&a.message.includes("Failed to fetch connection details")?new Ve(`API connection failed: ${a.message}`,"CONNECTION_FAILED",a):new Ve(`Failed to create session: ${a instanceof Error?a.message:"Unknown error"}`,"SESSION_NOT_FOUND",a)}}async startSession(n,r){const i={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(i)}async endSession(){var n,r;if(!this.currentSession)return null;try{const i={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,i),await this.disconnect(),i}catch(i){throw new Ve("Failed to end session","SESSION_NOT_FOUND",i)}}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 i=r.getTrackPublication(te.Track.Source.Microphone);if(i!=null&&i.track)return{source:te.Track.Source.Microphone,participant:r,publication:i}}return null}getAgentVideoTrack(){const n=this.getRemoteParticipants();for(const r of n){const i=r.getTrackPublication(te.Track.Source.Camera);if(i!=null&&i.track)return{source:te.Track.Source.Camera,participant:r,publication:i}}return null}getVideoTrackRefs(){const n=[],r=this.getLocalParticipant();if(r){const s=r.getTrackPublication(te.Track.Source.Camera);s!=null&&s.track&&n.push({source:te.Track.Source.Camera,participant:r,publication:s});const o=r.getTrackPublication(te.Track.Source.ScreenShare);o!=null&&o.track&&n.push({source:te.Track.Source.ScreenShare,participant:r,publication:o})}const i=this.getRemoteParticipants();for(const s of i){const o=s.getTrackPublication(te.Track.Source.Camera);o!=null&&o.track&&n.push({source:te.Track.Source.Camera,participant:s,publication:o});const a=s.getTrackPublication(te.Track.Source.ScreenShare);a!=null&&a.track&&n.push({source:te.Track.Source.ScreenShare,participant:s,publication:a})}return n}getCameraTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===te.Track.Source.Camera)}getScreenShareTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===te.Track.Source.ScreenShare)}getChatMessages(){return[...this.chatMessages]}addChatMessage(n){this.chatMessages.some(i=>i.id===n.id)||this.chatMessages.push(n)}updateChatMessage(n){const r=this.chatMessages.findIndex(i=>i.id===n.id);r!==-1&&(this.chatMessages[r]=n)}clearChatMessages(){this.chatMessages=[],this.activeTranscriptions.clear(),this.dismissCurrentInteraction(),this.renderedComponents.clear(),this.forceCleanupFullscreenOverlays(),console.log("🧹 VoxketClient: Cleared chat messages and transcription history"),this.emit("chat.history.cleared")}renderUI(n={}){var o,a,l,c,u,d,h,m,g;const r=this.resolveTarget(n.target||"body"),i=this.getTargetKey(r);if(Bo.has(r)){console.warn("⚠️ VoxketClient: Target is already being processed, skipping renderUI");return}if(Kt.has(r)){console.log("✋ VoxketClient: Target already has a React root in registry, updating existing props...");const p=this.renderedComponents.get(i);if(p&&p.root){const b={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:((o=n.modality)==null?void 0:o.includes("chat"))!==!1,suportsVideoInput:((a=n.modality)==null?void 0:a.includes("video"))===!0,suportsScreenShare:((l=n.modality)==null?void 0:l.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};try{p.root.render(j.createElement(ci,{config:this.config,autoConnect:n.autoStart||!1,client:this,children:j.createElement(ui,b)})),console.log("✅ VoxketClient: Successfully updated existing widget with new props");return}catch(v){throw console.error("Error re-rendering existing widget:",v),new Error(`Failed to update existing widget: ${v instanceof Error?v.message:"Unknown error"}`)}}else console.warn("⚠️ Registry inconsistency detected, cleaning up"),Kt.delete(r)}let s=this.renderedComponents.get(i);if(s&&s.target===r&&Kt.has(r)){console.log("🔄 VoxketClient: Reusing existing React root for target:",i);const p=s.root,b={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:((u=n.modality)==null?void 0:u.includes("video"))===!0,suportsScreenShare:((d=n.modality)==null?void 0:d.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};try{p.render(j.createElement(ci,{config:this.config,autoConnect:n.autoStart||!1,client:this,children:j.createElement(ui,b)}))}catch(v){throw console.error("Error rendering Voxket widget:",v),new Error(`Failed to render Voxket widget: ${v instanceof Error?v.message:"Unknown error"}`)}return}Bo.add(r);try{if(s){console.log("🧹 VoxketClient: Cleaning up existing component for different target");try{s.root.unmount(),this.renderedComponents.delete(i),Kt.delete(s.target),r.innerHTML=""}catch(v){console.warn("Failed to cleanup existing root:",v)}}if(Kt.has(r)){console.warn("⚠️ VoxketClient: Target already in registry, skipping root creation");return}console.log("🆕 VoxketClient: Creating new React root for target:",i);const p=Wm.createRoot(r);this.renderedComponents.set(i,{root:p,target:r}),Kt.add(r);const b={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:((h=n.modality)==null?void 0:h.includes("chat"))!==!1,suportsVideoInput:((m=n.modality)==null?void 0:m.includes("video"))===!0,suportsScreenShare:((g=n.modality)==null?void 0:g.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(!p||typeof p.render!="function")throw new Error("Invalid React root. Make sure React 18+ is properly installed and configured.");try{p.render(j.createElement(ci,{config:this.config,autoConnect:n.autoStart||!1,client:this,children:j.createElement(ui,b)}))}catch(v){throw console.error("Error rendering Voxket widget:",v),new Error(`Failed to render Voxket widget: ${v instanceof Error?v.message:"Unknown error"}`)}}finally{Bo.delete(r)}}removeUI(n){var i;const r=n?this.resolveTarget(n):null;if(r){const s=this.getTargetKey(r),o=this.renderedComponents.get(s);if(o){console.log("🗑️ VoxketClient: Removing UI for target:",s),this.renderedComponents.delete(s),Kt.delete(r);try{const l=o.target;l&&l.isConnected?(typeof((i=o.root)==null?void 0:i.unmount)=="function"&&(o.root.unmount(),console.log("✅ VoxketClient: UI unmounted for target:",s)),l.hasChildNodes()&&(l.innerHTML="")):console.log("ℹ️ VoxketClient: Target element already disconnected, skipping unmount")}catch(l){console.warn("Failed to unmount React root:",l)}}else console.log("ℹ️ VoxketClient: No component found for target, cleaning registry:",s),Kt.delete(r),r.isConnected&&r.hasChildNodes()&&(r.innerHTML="");r.querySelectorAll('[id*="voxket"], [class*="voxket"], .fixed.inset-0.z-50').forEach(l=>{try{l.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")||c.classList.contains("bg-opacity-30")))try{c.remove()}catch(u){console.warn("Failed to remove fixed element:",u)}})}}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(i){console.warn("Failed to remove overlay:",i)}})}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 i;if(!this.currentSession)throw console.error("VoxketClient: No active session found"),new Ve("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new Ve("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new Ve("No local participant","CONNECTION_FAILED");this.dismissCurrentInteraction();try{const s={id:`msg_${Date.now()}`,content:n,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:r||{}},o=await((i=this.room)==null?void 0:i.localParticipant.sendText(n,{topic:"lk.chat",destinationIdentities:[]}));this.emit("chat.message.sent",s)}catch(s){throw console.error("VoxketClient: Failed to send chat message:",s),new Ve("Failed to send message","NETWORK_ERROR",s)}}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 Ve("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new Ve("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new Ve("No local participant","CONNECTION_FAILED");if(!n||n.length===0)throw new Ve("No files provided","INVALID_PARAMETER");this.dismissCurrentInteraction();const i=n.filter(s=>s.type.startsWith("image/"));if(i.length===0)throw new Ve("Only image files are allowed","INVALID_PARAMETER");i.length!==n.length&&console.warn("VoxketClient: Some non-image files were filtered out");try{const s=i.map(async(o,a)=>{const c={id:`att_${Date.now()}_${a}`,content:`📎 ${o.name}`,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:{...r,type:"attachment",fileName:o.name,fileSize:o.size,mimeType:o.type,uploading:!0}};this.emit("chat.message.sent",c);const u=await this.room.localParticipant.sendFile(o,{mimeType:o.type,topic:"images",onProgress:h=>{const m={...c,metadata:{...c.metadata,uploadProgress:h}};this.emit("chat.message.updated",m)}});try{const h=new FileReader,m=new Promise((b,v)=>{h.onload=()=>{typeof h.result=="string"?b(h.result):v(new Error("Failed to convert to base64"))},h.onerror=v});h.readAsDataURL(o);const p={type:"image",data:await m,filename:o.name,mimeType:o.type,size:o.size};await this.room.localParticipant.sendText(JSON.stringify(p),{topic:"images",destinationIdentities:[]})}catch(h){console.warn("VoxketClient: Failed to send image data to agent:",h);try{const m=`I've shared an image: ${o.name}`;await this.room.localParticipant.sendText(m,{topic:"lk.chat",destinationIdentities:[]})}catch(m){console.warn("VoxketClient: Failed to send image notification to agent:",m)}}const d={...c,metadata:{...c.metadata,uploading:!1,uploadProgress:1,streamId:u.id}};return this.emit("chat.message.updated",d),u});await Promise.all(s)}catch(s){throw console.error("VoxketClient: Failed to send attachments:",s),new Ve("Failed to send attachments","NETWORK_ERROR",s)}}async sendAttachment(n,r){return this.sendAttachments([n],r)}toggleMicrophone(n){return this.setMicrophoneEnabled(n!==!1)}async setMicrophoneEnabled(n){var r,i;try{const s=(r=this.room)==null?void 0:r.localParticipant.isMicrophoneEnabled,o=n??!s;await((i=this.room)==null?void 0:i.localParticipant.setMicrophoneEnabled(o)),o?this.emit("track.unmuted",{source:"microphone",enabled:!0}):this.emit("track.muted",{source:"microphone",enabled:!1})}catch(s){throw console.error("VoxketClient: Failed to toggle microphone:",s),new Ve("Failed to toggle microphone","PERMISSION_DENIED",s)}}toggleCamera(n){return this.setCameraEnabled(n!==!1)}async setCameraEnabled(n){var r,i;try{const s=(r=this.room)==null?void 0:r.localParticipant.isCameraEnabled,o=n??!s;await((i=this.room)==null?void 0:i.localParticipant.setCameraEnabled(o)),o?this.emit("track.unmuted",{source:"camera",enabled:!0}):this.emit("track.muted",{source:"camera",enabled:!1})}catch(s){throw console.error("VoxketClient: Failed to toggle camera:",s),new Ve("Failed to toggle camera","PERMISSION_DENIED",s)}}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)),this.emit("track.unmuted",{source:"screenShare",enabled:!0})}catch(r){throw new Ve("Failed to start screen share","PERMISSION_DENIED",r)}}async stopScreenShare(){var n;try{await((n=this.room)==null?void 0:n.localParticipant.setScreenShareEnabled(!1)),this.emit("track.muted",{source:"screenShare",enabled:!1})}catch(r){throw new Ve("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 Ve("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 Ve("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(i){throw new Ve("Failed to set audio input device","DEVICE_ERROR",i)}}async setVideoInputDevice(n){var r;try{if(!((r=this.room)!=null&&r.localParticipant))throw new Error("Not connected to room")}catch(i){throw new Ve("Failed to set video input device","DEVICE_ERROR",i)}}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 i=s=>!!r.canPublish&&(r.canPublishSources.length===0||r.canPublishSources.includes(s));return{camera:i(1),microphone:i(2),screenShare:i(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===te.ConnectionState.Connected}getMicrophoneTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===te.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===te.Track.Source.Camera)return r.track;return null}getScreenShareTrack(){const n=this.getLocalParticipant();if(!n)return console.log("🎬 VoxketClient: getScreenShareTrack - no local participant"),null;for(const[,r]of n.trackPublications)if(r.source===te.Track.Source.ScreenShare)return console.log("🎬 VoxketClient: getScreenShareTrack - found screen share track:",{trackSid:r.trackSid,isMuted:r.isMuted,hasTrack:!!r.track}),r.track;return console.log("🎬 VoxketClient: getScreenShareTrack - no screen share track found"),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(),r=n?!n.isMuted:!1;return console.log("🎬 VoxketClient: isScreenShareEnabled check:",{hasTrack:!!n,trackMuted:n==null?void 0:n.isMuted,enabled:r}),r}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 Ve("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 Ve("Failed to stop recording","RECORDING_ERROR",r)}}async registerFrontendRPC(n,r,i="embedded"){return this.rpcManager.registerFrontendRPC(n,r,i)}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 i=>{try{const s=await i.readAll();r(s)}catch(s){console.error(`Error processing event for topic '${n}':`,s)}})}catch(i){console.warn(`VoxketClient: Handler for topic '${n}' may already be registered:`,i)}}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()}}const kE=ge.create(gh),SE=ge.create(uE),CE=ge.create(mE),EE=ge.create(wm);function TE({theme:e,mode:t,loadingText:n}){const r=et(e),i=()=>{switch(t){case"voice":return n||"Connecting to voice agent...";case"chat":return n||"Starting chat session...";case"video":return n||"Connecting to video call...";default:return n||"Connecting..."}};return f.jsxs("div",{className:"flex flex-col items-center justify-center h-full w-full p-8",children:[f.jsxs("div",{className:"text-center",children:[f.jsx("h3",{className:`text-lg font-semibold mb-2 ${r.text.accent}`,children:i()}),f.jsx("p",{className:`text-sm ${r.text.muted}`,children:"Please wait a moment..."})]}),f.jsxs("div",{className:"flex space-x-1 mt-4",children:[f.jsx("div",{className:"w-2 h-2 rounded-full animate-bounce bg-blue-500",style:{animationDelay:"0ms"}}),f.jsx("div",{className:"w-2 h-2 rounded-full animate-bounce bg-blue-500",style:{animationDelay:"150ms"}}),f.jsx("div",{className:"w-2 h-2 rounded-full animate-bounce bg-blue-500",style:{animationDelay:"300ms"}})]})]})}const AE=ge.create(TE);function jE({onClick:e,text:t="Open Chat",position:n="bottom-right",theme:r}){const i={"top-left":"top-4 left-4","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4"},s=et(r);return f.jsx(ge.button,{onClick:e,className:`voxket-popup-trigger fixed ${i[n]} z-50 px-4 py-2 rounded-full shadow-lg ${s.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},"data-position":n,children:t})}function qu({children:e,theme:t,displayType:n="widget",onClose:r,popupPosition:i="bottom-right",onExpand:s}){const o=et(t);if(n==="fullscreen")return f.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:f.jsxs("div",{className:"w-full h-full max-w-7xl max-h-[95vh] rounded-2xl relative bg-transparent flex flex-col",onClick:a=>{a.stopPropagation()},children:[r&&f.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:f.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:f.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"})})}),f.jsxs("div",{id:"voice-card",className:`voxket-widget-root theme-${t} ${o.card} w-full h-full flex flex-col rounded-xl shadow-2xl relative overflow-hidden`,"data-theme":t,style:{minHeight:"600px",height:"100%",contain:"layout style paint",overscrollBehavior:"contain"},children:[f.jsx("div",{className:o.cardTopGradient}),f.jsx("div",{className:o.cardPurpleBlur}),f.jsx("div",{className:o.cardPinkBlur}),f.jsx("div",{className:"relative z-10 flex flex-col h-full",children:e}),f.jsx("div",{className:o.cardPulse1}),f.jsx("div",{className:o.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 f.jsx("div",{className:"fixed rounded-2xl inset-0 z-[9999] pointer-events-none",children:f.jsxs("div",{className:`fixed rounded-2xl ${a[i]} pointer-events-auto`,children:[r&&f.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:"×"}),f.jsxs("div",{id:"voice-card",className:`voxket-widget-root theme-${t} ${o.card} rounded-2xl flex flex-col relative overflow-hidden`,"data-theme":t,style:{width:"350px",height:"500px",contain:"layout style paint",overscrollBehavior:"contain"},children:[f.jsx("div",{className:o.cardTopGradient}),f.jsx("div",{className:o.cardPurpleBlur}),f.jsx("div",{className:o.cardPinkBlur}),f.jsx("div",{className:"relative z-10 flex flex-col h-full w-full",children:e}),f.jsx("div",{className:o.cardPulse1}),f.jsx("div",{className:o.cardPulse2,style:{animationDelay:"1s"}})]})]})})}return f.jsxs("div",{id:"voice-card",className:`voxket-widget-root theme-${t} ${o.card} relative overflow-hidden`,"data-theme":t,style:{height:"100%",maxHeight:"100%",contain:"layout style paint",overscrollBehavior:"contain"},children:[f.jsx("div",{className:o.cardTopGradient}),f.jsx("div",{className:o.cardPurpleBlur}),f.jsx("div",{className:o.cardPinkBlur}),f.jsx("div",{className:"relative z-10 flex flex-col h-full",children:e}),f.jsx("div",{className:o.cardPulse1}),f.jsx("div",{className:o.cardPulse2,style:{animationDelay:"1s"}})]})}function PE(e){if(typeof window>"u")return null;const{agentId:t,participantName:n,baseUrl:r,appSecret:i,appId:s,prompts:o,statusMessage:a,welcomeTitle:l,welcomeSubTitle:c,className:u,width:d,height:h,loadingText:m,suportsChatInput:g=!0,suportsVideoInput:p=!0,suportsScreenShare:b=!0,theme:v="vox",onSessionStart:k,onSessionEnd:S,enableSessionLogging:A=!0,onSessionLogsUpdate:T,onSessionMetricsUpdate:C,modalities:M=["voice"],displayType:P="widget",popupPosition:L="bottom-right",popupTriggerText:y="Open Chat",onPopupToggle:N,voxketClient:D,onDisplayTypeChange:B}=e,[H,K]=x.useState(!1),[de,ie]=x.useState(null),[F,W]=x.useState(()=>{try{if(D)return!!D.getCurrentSession()}catch(G){console.error("Error checking existing session:",G)}return!1}),[w,z]=x.useState(!1),[oe,E]=x.useState(t||""),[U,se]=x.useState(n||"User"),[$,ee]=x.useState(()=>{try{if(D)return D.getCurrentSession()}catch(G){console.error("Error getting current session:",G)}return null}),[Q,V]=x.useState(()=>{var G,be,Ce;try{if(D){const je=D.getCurrentSession();if((G=je==null?void 0:je.activeModalities)!=null&&G.includes("chat"))return"chat";if((be=je==null?void 0:je.activeModalities)!=null&&be.includes("voice"))return"voice";if((Ce=je==null?void 0:je.activeModalities)!=null&&Ce.includes("video"))return"video"}}catch(je){console.error("Error determining current mode:",je)}return"welcome"}),[X,fe]=x.useState(!1);x.useEffect(()=>{P==="fullscreen"&&console.log("🎯 Widget: Switched to fullscreen mode")},[P]),x.useEffect(()=>{F&&!w?console.log("📊 Session started:",{currentMode:Q,sessionId:$==null?void 0:$.id}):!F&&!w&&Q==="welcome"&&console.log("📊 Returned to welcome screen")},[F,Q,w]);const R=x.useMemo(()=>{try{if(D)return console.log("🔄 Using existing VoxketClient to preserve session state"),D;if(!s||!i||!r){const be=`Missing required props: ${s?"":"appId "}${i?"":"appSecret "}${r?"":"baseUrl"}`;return console.error("❌ VoxketClient creation failed:",be),ie(new Error(be)),K(!0),null}const G={appId:s,appSecret:i,baseUrl:r,agentId:oe,participantName:U||"User",modalities:M};return console.log("🔧 Creating new VoxketClient with config:",{appId:s.substring(0,8)+"...",baseUrl:r,agentId:oe,participantName:U||"User",modalities:M}),new $r(G)}catch(G){return console.error("❌ Failed to create VoxketClient:",G),ie(G),K(!0),null}},[D,s,i,r,oe,U,M]),re=M,ne=x.useMemo(()=>{try{if(!R)return console.warn("⚠️ No VoxketClient available, creating fallback room"),new te.Room;const G=R.getRoom();return console.log("🏠 Widget: Room reference updated:",{roomExists:!!G,roomState:G==null?void 0:G.state,sessionStarted:F,currentMode:Q}),G||new te.Room}catch(G){return console.error("❌ Error getting room from client:",G),new te.Room}},[R,F,Q]);x.useEffect(()=>{if(ne){const G=()=>{console.log("🏠 Widget: Room state changed:",{state:ne.state,numParticipants:ne.numParticipants,isConnected:ne.state==="connected",sessionId:$==null?void 0:$.id})},be=(Ce,je,$e)=>{console.log("🎵 Widget: Track subscribed:",{trackKind:Ce.kind,trackSource:Ce.source,participantSid:$e.sid,participantIdentity:$e.identity,sessionId:$==null?void 0:$.id})};return ne.on(te.RoomEvent.Connected,G),ne.on(te.RoomEvent.Disconnected,G),ne.on(te.RoomEvent.TrackSubscribed,be),()=>{ne.off(te.RoomEvent.Connected,G),ne.off(te.RoomEvent.Disconnected,G),ne.off(te.RoomEvent.TrackSubscribed,be)}}},[ne,$==null?void 0:$.id]),x.useEffect(()=>{!w&&Q==="welcome"?console.log("🎬 Widget: Welcome screen ready"):F&&Q!=="welcome"&&console.log("🎬 Widget: Session mode active:",Q)},[Q,w,F]);const me={suportsChatInput:g,suportsVideoInput:p,suportsScreenShare:b};x.useEffect(()=>{(Q==="voice"||Q==="video"||Q==="chat")&&!$&&!F&&!w&&R&&!R.connected&&(console.log("🔄 Auto-correcting: Found orphaned mode without session, returning to welcome"),V("welcome"),z(!1))},[Q,$,F,w,R]);const{sessionMetrics:Z,sessionLogs:pe,logEvent:Ae}=km({room:ne,onSessionStart:k,onSessionEnd:S,enableConsoleLogging:A,enableLocalStorage:A,voxketSessionId:$==null?void 0:$.id});x.useEffect(()=>{T&&T(pe)},[pe,T]),x.useEffect(()=>{C&&Z&&C(Z)},[Z,C]),x.useEffect(()=>{if(!R)return;const G=()=>{const be=R.connected,Ce=R.getCurrentSession();console.log("🔗 Connection state changed:",{isConnected:be,currentSessionId:Ce==null?void 0:Ce.id,currentMode:Q,loading:w,sessionStarted:F}),!be&&F&&!w&&(console.log("🔴 Connection lost during active session - returning to welcome"),z(!1),W(!1),ee(null),V("welcome")),be&&Ce&&w&&(console.log("🟢 Connected with active session - removing loader"),z(!1),W(!0),ee(Ce))};return R.on("connectionStateChanged",G),R.on("sessionEnded",()=>{console.log("📞 Session ended - returning to welcome"),z(!1),W(!1),ee(null),V("welcome")}),()=>{R.off("connectionStateChanged",G),R.off("sessionEnded",()=>{})}},[R,Q,w,F]),x.useEffect(()=>{const G=Ce=>{console.log("🔴 Widget: Room disconnected:",Ce),console.log("🔍 Widget: Current state on disconnect:",{currentMode:Q,sessionStarted:F,currentSessionId:$==null?void 0:$.id,loading:w}),z(!1),W(!1),ee(null),V("welcome"),console.log("🏠 Widget: Automatically returning to welcome screen after disconnect")},be=Ce=>{console.log("📹 Media devices error:",Ce)};return ne.on(te.RoomEvent.MediaDevicesError,be),ne.on(te.RoomEvent.Disconnected,G),()=>{ne.off(te.RoomEvent.Disconnected,G),ne.off(te.RoomEvent.MediaDevicesError,be)}},[ne,Q,F,$==null?void 0:$.id,w]);const xe=async()=>{try{if(!R){console.error("❌ VoxketClient not available"),ie(new Error("VoxketClient not initialized")),K(!0);return}z(!0),V("voice"),console.log("🎤 Starting voice session...",{agentId:oe,participantName:U}),console.log("🎤 Pre-start state:",{currentMode:"voice",sessionStarted:!1,loading:!0}),Ae("USER_STARTED_VOICE_SESSION",{agentId:oe,participantName:U});const G=await R.startSession(oe,{participantName:U||"User",modalities:["voice",...p?["video"]:[]]});console.log("✅ Voice session started successfully:",G.id),ee(G),W(!0),z(!1),k&&k(G.id)}catch(G){console.error("❌ Failed to start voice session:",G),z(!1),W(!1),V("welcome")}},Me=async()=>{try{if(!R){console.error("❌ VoxketClient not available"),ie(new Error("VoxketClient not initialized")),K(!0);return}z(!0),V("chat"),console.log("💬 Starting chat session...",{agentId:oe,participantName:U}),Ae("USER_STARTED_CHAT_SESSION",{agentId:oe,participantName:U});const G=await R.startSession(oe,{participantName:U||"User",modalities:["chat"]});console.log("✅ Chat session started successfully:",G.id),ee(G),W(!0),z(!1),k&&k(G.id)}catch(G){console.error("❌ Failed to start chat session:",G),z(!1),W(!1),V("welcome")}},ze=async()=>{try{if(!R){console.error("❌ VoxketClient not available"),ie(new Error("VoxketClient not initialized")),K(!0);return}z(!0),V("video"),console.log("📺 Starting video session...",{agentId:oe,participantName:U}),console.log("📺 Pre-start state:",{currentMode:"video",sessionStarted:!1,loading:!0}),Ae("USER_STARTED_VIDEO_SESSION",{agentId:oe,participantName:U});const G=await R.startSession(oe,{participantName:U||"User",modalities:["video","voice"]});console.log("✅ Video session started successfully:",G.id),ee(G),W(!0),z(!1),k&&k(G.id)}catch(G){console.error("❌ Failed to start video session:",G),z(!1),W(!1),V("welcome")}},He=()=>{console.log("🔄 Widget: handleBackToWelcome called",{currentMode:Q,sessionStarted:F,currentSessionId:$==null?void 0:$.id,displayType:P,loading:w}),V("welcome"),z(!1),B&&B(e.displayType||"widget"),$&&F?(console.log("🧹 Widget: Cleaning up active session"),W(!1),ee(null),R&&(console.log("🔌 Widget: Disconnecting client and cleaning up room"),R.disconnect().catch(G=>{console.error("❌ Widget: Error during disconnect:",G)}))):(console.log("📝 Widget: No active session to clean up"),R&&R.connected&&(console.log("🔌 Widget: Force disconnecting client for fresh state"),R.disconnect().catch(G=>{console.error("❌ Widget: Error during force disconnect:",G)}))),P==="popup"&&!X&&fe(!0),console.log("✅ Widget: handleBackToWelcome completed",{newCurrentMode:"welcome",newLoading:!1,newSessionStarted:!1})},nt=()=>{const G=!X;fe(G),N&&N(G),!G&&!($&&F)&&(V("welcome"),W(!1),ee(null))},Zt=()=>{console.log("🔄 Closing fullscreen, switching to widget display type"),e.onDisplayTypeChange?e.onDisplayTypeChange("widget"):console.warn("⚠️ No onDisplayTypeChange callback provided")},Ft=()=>{if(console.log("🔄 Expand to fullscreen requested"),e.onDisplayTypeChange)e.onDisplayTypeChange("fullscreen");else{console.warn("⚠️ No onDisplayTypeChange callback provided for expand functionality");const G=document.getElementById("voice-card")||document.querySelector(".voxket-widget-container");G&&G.requestFullscreen&&G.requestFullscreen().catch(be=>{console.warn("⚠️ Fullscreen API not supported or failed:",be)})}};x.useEffect(()=>{var G,be,Ce;if(D&&R){const je=R.getCurrentSession();R.connected,je&&(console.log("✅ Restoring session state:",je.id),ee(je),W(!0),z(!1),(G=je.activeModalities)!=null&&G.includes("chat")?V("chat"):(be=je.activeModalities)!=null&&be.includes("voice")?V("voice"):(Ce=je.activeModalities)!=null&&Ce.includes("video")&&V("video"))}},[D,R]),x.useEffect(()=>()=>{!D&&R&&R.disconnect()},[R,D]);let _=Q==="video"?"w-[32rem]":"w-96",I=Q==="video"?"h-[30rem]":"h-[25rem]",q={};if(d&&(d.startsWith("w-")?_=d:(q.width=d,_="")),h&&(h.startsWith("h-")?I=h:(q.height=h,I="")),P==="popup"&&!X)return console.log("🟡 Showing popup trigger button"),f.jsx(jE,{onClick:nt,text:y,position:L,theme:v});if(H||!R){const G=(de==null?void 0:de.message)||"VoxketWidget encountered an error. Please check your configuration.";return f.jsx("div",{className:`voxket-widget-root theme-${v} flex items-center justify-center p-8 ${u||""}`,style:{width:d||"400px",height:h||"500px",border:"1px solid #ff4444",borderRadius:"8px",background:"#fff5f5",color:"#cc0000"},children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"text-4xl mb-4",children:"⚠️"}),f.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Widget Error"}),f.jsx("p",{className:"text-sm mb-4",children:G}),f.jsx("button",{onClick:()=>{K(!1),ie(null),window.location.reload()},className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors",children:"Retry"})]})})}let ue=`voxket-widget-root theme-${v}`,J={scrollMargin:0,scrollPadding:0,contain:"layout style paint"};P==="widget"?(ue+=` flex items-center justify-center min-h-fit ${_} ${I} ${u}`,J={...J,...q}):(ue=`${u||""}`,J={});const ke=f.jsx("div",{className:"h-full flex flex-col overflow-hidden relative z-10",children:f.jsxs(Qt,{mode:"wait",children:[Q==="welcome"&&!w&&f.jsx(EE,{agentId:oe,participantName:U||"",onAgentIdChange:E,onParticipantNameChange:se,onStartCall:xe,onStartChat:Me,onStartVideo:ze,disabled:F||w,prompts:o,statusMessage:a,title:l,subTitle:c,theme:v,modalities:re,initial:{opacity:0,y:0},animate:{opacity:1,y:0},exit:{opacity:0,y:40},transition:{duration:.3,ease:"easeInOut"}},"welcome"),w&&(Q==="voice"||Q==="chat"||Q==="video")&&f.jsx(AE,{theme:v,mode:Q,loadingText:m,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.3,ease:"easeInOut"}},`loading-${Q}`),Q==="voice"&&!w&&F&&R&&f.jsxs(ut.RoomContext.Provider,{value:ne,children:[f.jsx(ut.RoomAudioRenderer,{},`audio-${($==null?void 0:$.id)||"no-session"}`),f.jsx(ut.StartAudio,{label:"Start Audio"},`start-audio-${($==null?void 0:$.id)||"no-session"}`),f.jsx(kE,{loadingText:m,participantName:U||"User",capabilities:me,sessionStarted:F,disabled:!1,theme:v,client:R,displayType:P,onBack:P==="popup"?nt:He,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"voice-session")]}),Q==="chat"&&!w&&F&&R&&f.jsx(SE,{client:R,theme:v,displayType:P,onBack:P==="popup"?nt:He,onEndChat:He,disabled:!1,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"chat-view"),Q==="video"&&!w&&F&&R&&f.jsxs(ut.RoomContext.Provider,{value:ne,children:[f.jsx(ut.RoomAudioRenderer,{},`audio-video-${($==null?void 0:$.id)||"no-session"}`),f.jsx(ut.StartAudio,{label:"Start Audio"},`start-audio-video-${($==null?void 0:$.id)||"no-session"}`),f.jsx(CE,{client:R,theme:v,displayType:P,onBack:P==="popup"?nt:He,onEndCall:He,disabled:!1,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"video-session")]})]})});return P==="fullscreen"||P==="popup"?f.jsx(qu,{theme:v,displayType:P,popupPosition:L,onClose:P==="fullscreen"?Zt:nt,children:ke}):f.jsx("div",{className:ue,style:J,children:f.jsx(qu,{theme:v,displayType:P,popupPosition:L,onExpand:Ft,children:ke})})}function ui(e){return f.jsx(za,{children:f.jsx(PE,{...e})})}function NE({logs:e,onClear:t,onExport:n}){const[r,i]=j.useState(!1),[s,o]=j.useState(""),a=e.filter(l=>!s||l.event.toLowerCase().includes(s.toLowerCase()));return r?f.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:f.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-4xl w-full max-h-[80vh] flex flex-col m-4",children:[f.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[f.jsxs("h2",{className:"text-lg font-semibold",children:["Session Logs (",e.length,")"]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{type:"text",placeholder:"Filter events...",value:s,onChange:l=>o(l.target.value),className:"px-3 py-1 border rounded text-sm"}),f.jsx("button",{onClick:t,className:"px-3 py-1 bg-red-600 text-white rounded text-sm hover:bg-red-700",children:"Clear"}),f.jsx("button",{onClick:n,className:"px-3 py-1 bg-green-600 text-white rounded text-sm hover:bg-green-700",children:"Export"}),f.jsx("button",{onClick:()=>i(!1),className:"px-3 py-1 bg-gray-600 text-white rounded text-sm hover:bg-gray-700",children:"Close"})]})]}),f.jsx("div",{className:"flex-1 overflow-auto p-4",children:a.length===0?f.jsx("p",{className:"text-gray-500 text-center py-8",children:"No logs found"}):f.jsx("div",{className:"space-y-2",children:a.map((l,c)=>f.jsxs("div",{className:"border rounded p-3 text-sm",children:[f.jsxs("div",{className:"flex items-center justify-between mb-1",children:[f.jsx("span",{className:"font-semibold text-blue-600",children:l.event}),f.jsx("span",{className:"text-gray-500 text-xs",children:new Date(l.timestamp).toLocaleTimeString()})]}),l.sessionId&&f.jsxs("div",{className:"text-xs text-gray-600 mb-1",children:["Session: ",l.sessionId]}),l.data&&f.jsx("div",{className:"bg-gray-50 p-2 rounded text-xs",children:f.jsx("pre",{className:"whitespace-pre-wrap overflow-auto",children:JSON.stringify(l.data,null,2)})})]},c))})})]})}):f.jsxs("button",{onClick:()=>i(!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 ME({metrics:e}){return e?f.jsxs("div",{className:"bg-gray-100 p-4 rounded-lg",children:[f.jsx("h3",{className:"font-semibold mb-2",children:"Current Session"}),f.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[f.jsxs("div",{children:[f.jsx("span",{className:"text-gray-600",children:"Session ID:"}),f.jsx("div",{className:"font-mono text-xs",children:e.sessionId})]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-gray-600",children:"Start Time:"}),f.jsx("div",{children:new Date(e.startTime).toLocaleString()})]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-gray-600",children:"Messages:"}),f.jsx("div",{children:e.totalMessages})]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-gray-600",children:"Participants:"}),f.jsx("div",{children:e.participantCount})]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-gray-600",children:"Connection Issues:"}),f.jsx("div",{children:e.connectionIssues})]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-gray-600",children:"Duration:"}),f.jsxs("div",{children:[Math.round((Date.now()-new Date(e.startTime).getTime())/1e3),"s"]})]})]})]}):null}function kn(){const{currentSession:e,sessionState:t,sessionMetrics:n,createSession:r,endSession:i}=Dt(),s=j.useCallback(async(a,l)=>await r(a,l),[r]),o=j.useCallback(async()=>await i(),[i]);return{session:e,state:t,metrics:n,isActive:e!==null&&t!=="disconnected",isConnecting:t==="connecting",isConnected:t==="connected"||t==="active",start:s,stop:o}}function Em(){const{sessionMetrics:e,currentSession:t}=Dt();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 Tm(){const{setMicrophoneEnabled:e,client:t}=Dt(),[n,r]=j.useState(!1),[i,s]=j.useState(!1),o=j.useCallback(async()=>{if(!i){s(!0);try{const c=!n;await e(c),r(c)}catch(c){console.error("Failed to toggle microphone:",c)}finally{s(!1)}}},[n,i,e]),a=j.useCallback(async()=>{if(!(n||i)){s(!0);try{await e(!0),r(!0)}catch(c){console.error("Failed to enable microphone:",c)}finally{s(!1)}}},[n,i,e]),l=j.useCallback(async()=>{if(!(!n||i)){s(!0);try{await e(!1),r(!1)}catch(c){console.error("Failed to disable microphone:",c)}finally{s(!1)}}},[n,i,e]);return{isEnabled:n,isLoading:i,toggle:o,enable:a,disable:l}}function Am(){const{setCameraEnabled:e}=Dt(),[t,n]=j.useState(!1),[r,i]=j.useState(!1),s=j.useCallback(async()=>{if(!r){i(!0);try{const l=!t;await e(l),n(l)}catch(l){console.error("Failed to toggle camera:",l)}finally{i(!1)}}},[t,r,e]),o=j.useCallback(async()=>{if(!(t||r)){i(!0);try{await e(!0),n(!0)}catch(l){console.error("Failed to enable camera:",l)}finally{i(!1)}}},[t,r,e]),a=j.useCallback(async()=>{if(!(!t||r)){i(!0);try{await e(!1),n(!1)}catch(l){console.error("Failed to disable camera:",l)}finally{i(!1)}}},[t,r,e]);return{isEnabled:t,isLoading:r,toggle:s,enable:o,disable:a}}function jm(){const{startScreenShare:e,stopScreenShare:t}=Dt(),[n,r]=j.useState(!1),[i,s]=j.useState(!1),o=j.useCallback(async()=>{if(!(n||i)){s(!0);try{await e(),r(!0)}catch(c){console.error("Failed to start screen share:",c)}finally{s(!1)}}},[n,i,e]),a=j.useCallback(async()=>{if(!(!n||i)){s(!0);try{await t(),r(!1)}catch(c){console.error("Failed to stop screen share:",c)}finally{s(!1)}}},[n,i,t]),l=j.useCallback(async()=>{n?await a():await o()},[n,o,a]);return{isSharing:n,isLoading:i,start:o,stop:a,toggle:l}}function IE(){const{client:e}=Dt(),[t,n]=j.useState({tracks:[],layout:{type:"grid",showLocalVideo:!0,aspectRatio:"16:9"},isRecording:!1}),r=j.useMemo(()=>t.tracks.find(p=>p.isLocal),[t.tracks]),i=j.useMemo(()=>t.tracks.filter(p=>!p.isLocal),[t.tracks]),s=j.useCallback(async()=>{try{r!=null&&r.isEnabled?await(e==null?void 0:e.disableCamera()):await(e==null?void 0:e.enableCamera())}catch(p){throw console.error("Failed to toggle camera:",p),p}},[e,r]),o=j.useCallback(async()=>{try{t.tracks.find(b=>b.isScreenShare)?await(e==null?void 0:e.stopScreenShare()):await(e==null?void 0:e.startScreenShare())}catch(p){throw console.error("Failed to toggle screen share:",p),p}},[e,t.tracks]),a=j.useCallback(p=>{n(b=>({...b,layout:p}))},[]),l=j.useCallback(p=>{n(b=>({...b,pinnedTrack:p}))},[]),c=j.useCallback(()=>{n(p=>({...p,pinnedTrack:void 0}))},[]),u=j.useCallback(async()=>{try{await(e==null?void 0:e.startRecording()),n(p=>({...p,isRecording:!0}))}catch(p){throw console.error("Failed to start recording:",p),p}},[e]),d=j.useCallback(async()=>{try{await(e==null?void 0:e.stopRecording()),n(p=>({...p,isRecording:!1}))}catch(p){throw console.error("Failed to stop recording:",p),p}},[e]),h=j.useCallback(p=>t.tracks.find(b=>b.id===p),[t.tracks]),m=j.useCallback(p=>t.tracks.filter(b=>b.participantId===p),[t.tracks]),g=j.useCallback(p=>p.isEnabled&&t.tracks.includes(p),[t.tracks]);return j.useEffect(()=>{if(!e)return;const p=k=>{n(S=>({...S,tracks:[...S.tracks.filter(A=>A.id!==k.id),k]}))},b=k=>{n(S=>{var A;return{...S,tracks:S.tracks.filter(T=>T.id!==k),pinnedTrack:((A=S.pinnedTrack)==null?void 0:A.id)===k?void 0:S.pinnedTrack}})},v=k=>{n(S=>({...S,tracks:S.tracks.map(A=>A.id===k.id?k:A)}))};return e.on("videoTrackAdded",p),e.on("videoTrackRemoved",b),e.on("videoTrackUpdated",v),()=>{e.off("videoTrackAdded",p),e.off("videoTrackRemoved",b),e.off("videoTrackUpdated",v)}},[e]),{tracks:t.tracks,localTrack:r,remoteTraracks:i,pinnedTrack:t.pinnedTrack,layout:t.layout,isRecording:t.isRecording,toggleCamera:s,toggleScreenShare:o,setLayout:a,pinTrack:l,unpinTrack:c,startRecording:u,stopRecording:d,getTrackById:h,getTracksByParticipant:m,isTrackActive:g}}function Zi(){const{chatMessages:e,sendChatMessage:t,currentSession:n}=Dt(),[r,i]=j.useState(!1),s=j.useCallback(async c=>{if(!(!c.trim()||r||!n)){i(!0);try{await t(c.trim())}catch(u){throw console.error("Failed to send chat message:",u),u}finally{i(!1)}}},[t,r,n]),{userMessages:o,agentMessages:a,allMessages:l}=j.useMemo(()=>{const c=e.filter(d=>d.sender.type==="participant"),u=e.filter(d=>d.sender.type==="agent");return{userMessages:c,agentMessages:u,allMessages:e}},[e]);return{messages:l,userMessages:o,agentMessages:a,messageCount:l.length,isSending:r,canSend:!!n&&!r,send:s}}function RE(){const{send:e,isSending:t,canSend:n}=Zi(),[r,i]=j.useState(""),s=j.useCallback(async()=>{if(!(!r.trim()||!n))try{await e(r),i("")}catch(a){throw a}},[r,e,n]),o=j.useCallback(a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),s())},[s]);return{value:r,setValue:i,send:s,handleKeyPress:o,isSending:t,canSend:n&&r.trim().length>0}}function Wa(){const{isConnected:e,isConnecting:t,connectionError:n,connect:r,disconnect:i}=Dt(),s=j.useCallback(async()=>{if(!(e||t))try{await r()}catch(a){throw console.error("Failed to connect:",a),a}},[r,e,t]),o=j.useCallback(async()=>{if(e)try{await i()}catch(a){throw console.error("Failed to disconnect:",a),a}},[i,e]);return{isConnected:e,isConnecting:t,isDisconnected:!e&&!t,error:n,hasError:!!n,connect:s,disconnect:o}}function Pm(){const{participants:e}=Dt();return{participants:e,count:e.length,localParticipant:e.find(t=>t.isLocal),remoteParticipants:e.filter(t=>!t.isLocal)}}const Nm=j.createContext({}),_r=()=>j.useContext(Nm);function Mm({children:e,...t}){return f.jsx(Nm.Provider,{value:t,children:e})}function di({name:e,children:t,fallback:n,className:r}){return f.jsx("div",{className:`voxket-slot voxket-slot--${e} ${r||""}`,children:t||n})}function Im(e,t={}){return Object.assign(e,t)}function Rm({showMicrophoneControl:e=!0,showCameraControl:t=!0,showScreenShareControl:n=!0,showSessionActions:r=!0,customControls:i,className:s=""}){const o=kn(),a=Tm(),l=Am(),c=jm(),u=_r(),d=["voxket-session-controls",`voxket-session-controls--${u.variant||"default"}`,`voxket-session-controls--${u.size||"md"}`,o.isActive?"voxket-session-controls--active":"voxket-session-controls--inactive",s].filter(Boolean).join(" ");return!o.isActive&&!r?f.jsx("div",{className:d,children:f.jsx("div",{className:"voxket-controls-inactive",children:f.jsx("p",{children:"Controls available during active session"})})}):f.jsxs("div",{className:d,children:[r&&f.jsx("div",{className:"voxket-session-actions",children:o.isActive?f.jsx("button",{onClick:o.stop,className:"voxket-button voxket-button--danger",children:"End Session"}):f.jsx(VE,{})}),o.isActive&&f.jsxs("div",{className:"voxket-media-controls",children:[e&&f.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:[f.jsx("span",{className:"voxket-icon",children:"🎤"}),a.isLoading?"Loading...":a.isEnabled?"Mute":"Unmute"]}),t&&f.jsxs("button",{onClick:l.toggle,disabled:l.isLoading,className:`voxket-button voxket-button--media ${l.isEnabled?"voxket-button--active":""}`,title:l.isEnabled?"Stop camera":"Start camera",children:[f.jsx("span",{className:"voxket-icon",children:"📹"}),l.isLoading?"Loading...":l.isEnabled?"Stop Video":"Start Video"]}),n&&f.jsxs("button",{onClick:c.toggle,disabled:c.isLoading,className:`voxket-button voxket-button--media ${c.isSharing?"voxket-button--active":""}`,title:c.isSharing?"Stop screen share":"Start screen share",children:[f.jsx("span",{className:"voxket-icon",children:"🖥️"}),c.isLoading?"Loading...":c.isSharing?"Stop Share":"Share Screen"]})]}),i&&f.jsx("div",{className:"voxket-custom-controls",children:i})]})}function VE(){kn();const[e,t]=j.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 f.jsx("button",{onClick:n,disabled:e,className:"voxket-button voxket-button--primary",children:e?"Starting...":"Start Session"})}function Za({showConnectionStatus:e=!0,showSessionInfo:t=!0,showAgentInfo:n=!0,className:r=""}){const i=kn(),s=Wa(),o=_r(),a=["voxket-session-header",`voxket-session-header--${o.variant||"default"}`,`voxket-session-header--${o.size||"md"}`,r].filter(Boolean).join(" ");return f.jsxs("div",{className:a,children:[e&&f.jsxs("div",{className:"voxket-connection-status",children:[f.jsx("div",{className:`voxket-status-indicator ${s.isConnected?"connected":"disconnected"}`}),f.jsx("span",{className:"voxket-status-text",children:s.isConnecting?"Connecting...":s.isConnected?"Connected":"Disconnected"})]}),t&&i.session&&f.jsxs("div",{className:"voxket-session-info",children:[f.jsxs("div",{className:"voxket-session-id",children:["Session: ",i.session.id.slice(-8)]}),f.jsxs("div",{className:"voxket-session-state",children:["State: ",i.state]})]}),n&&i.session&&f.jsxs("div",{className:"voxket-agent-info",children:[f.jsxs("div",{className:"voxket-agent-id",children:["Agent: ",i.session.agentId]}),f.jsxs("div",{className:"voxket-modalities",children:["Modalities: ",i.session.activeModalities.join(", ")]})]}),s.error&&f.jsxs("div",{className:"voxket-error-message",children:["Error: ",s.error.message]})]})}function qa({showChat:e=!0,showTranscriptions:t=!1,customContent:n,className:r=""}){const i=kn(),s=Zi(),o=_r(),a=["voxket-session-content",`voxket-session-content--${o.variant||"default"}`,`voxket-session-content--${o.size||"md"}`,r].filter(Boolean).join(" ");return i.isActive?f.jsx("div",{className:a,children:n||f.jsxs(f.Fragment,{children:[e&&f.jsxs("div",{className:"voxket-chat-container",children:[f.jsxs("div",{className:"voxket-chat-messages",children:[s.messages.map(l=>f.jsxs("div",{className:`voxket-message voxket-message--${l.sender.type}`,children:[f.jsxs("div",{className:"voxket-message-header",children:[f.jsx("span",{className:"voxket-message-sender",children:l.sender.name}),f.jsx("span",{className:"voxket-message-time",children:l.timestamp.toLocaleTimeString()})]}),f.jsx("div",{className:"voxket-message-content",children:l.content})]},l.id)),s.messages.length===0&&f.jsx("div",{className:"voxket-empty-messages",children:f.jsx("p",{children:"No messages yet. Start the conversation!"})})]}),f.jsx(DE,{})]}),t&&f.jsx("div",{className:"voxket-transcriptions",children:f.jsx("div",{className:"voxket-transcription-placeholder",children:f.jsx("p",{children:"Voice transcriptions will appear here"})})})]})}):f.jsx("div",{className:a,children:f.jsx("div",{className:"voxket-inactive-state",children:f.jsxs("div",{className:"voxket-inactive-message",children:[f.jsx("h3",{children:"Start a conversation"}),f.jsx("p",{children:"Begin a session to start chatting with the AI agent"})]})})})}function DE(){const e=Zi(),[t,n]=j.useState(""),r=async()=>{if(!(!t.trim()||!e.canSend))try{await e.send(t),n("")}catch(s){console.error("Failed to send message:",s)}},i=s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),r())};return f.jsxs("div",{className:"voxket-chat-input",children:[f.jsx("input",{type:"text",value:t,onChange:s=>n(s.target.value),onKeyPress:i,placeholder:"Type your message...",disabled:!e.canSend,className:"voxket-input"}),f.jsx("button",{onClick:r,disabled:!e.canSend||!t.trim(),className:"voxket-send-button",children:e.isSending?"Sending...":"Send"})]})}function Ga({showMetrics:e=!0,showParticipants:t=!0,showStatus:n=!0,customFooter:r,className:i=""}){const s=kn(),o=Em(),a=Pm(),l=_r(),c=["voxket-session-footer",`voxket-session-footer--${l.variant||"default"}`,`voxket-session-footer--${l.size||"md"}`,i].filter(Boolean).join(" ");return s.isActive?f.jsx("div",{className:c,children:r||f.jsxs(f.Fragment,{children:[n&&f.jsxs("div",{className:"voxket-session-status",children:[f.jsx("div",{className:"voxket-status-indicator voxket-status-indicator--active"}),f.jsx("span",{className:"voxket-status-text",children:"Session Active"})]}),e&&o.metrics&&f.jsxs("div",{className:"voxket-session-metrics",children:[f.jsxs("div",{className:"voxket-metric",children:[f.jsx("span",{className:"voxket-metric-label",children:"Duration:"}),f.jsx("span",{className:"voxket-metric-value",children:FE(o.duration||0)})]}),f.jsxs("div",{className:"voxket-metric",children:[f.jsx("span",{className:"voxket-metric-label",children:"Messages:"}),f.jsx("span",{className:"voxket-metric-value",children:o.metrics.messageCount})]})]}),t&&f.jsxs("div",{className:"voxket-participants-info",children:[f.jsxs("span",{className:"voxket-participants-count",children:[a.count," participant",a.count!==1?"s":""]}),a.remoteParticipants.length>0&&f.jsx("div",{className:"voxket-participant-list",children:a.remoteParticipants.map(u=>f.jsx("span",{className:"voxket-participant-name",children:u.name},u.id))})]})]})}):f.jsx("div",{className:c,children:f.jsx("div",{className:"voxket-footer-inactive",children:f.jsx("span",{className:"voxket-status-text",children:"Ready to start session"})})})}function FE(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 LE({agentId:e,sessionConfig:t,autoStart:n=!1,onSessionStart:r,onSessionEnd:i,variant:s="default",size:o="md",theme:a,className:l="",children:c}){var m;const u=kn(),d=Wa();j.useEffect(()=>{n&&e&&d.isConnected&&!u.isActive&&u.start(e,t).catch(console.error)},[n,e,d.isConnected,u.isActive]),j.useEffect(()=>{var g;(g=u.session)!=null&&g.id&&r&&r(u.session.id)},[(m=u.session)==null?void 0:m.id,r]),j.useEffect(()=>()=>{u.isActive&&i&&u.stop().then(i).catch(console.error)},[]);const h=["voxket-session",`voxket-session--${s}`,`voxket-session--${o}`,u.isActive?"voxket-session--active":"voxket-session--inactive",l].filter(Boolean).join(" ");return f.jsx(Mm,{variant:s,size:o,theme:a,className:l,children:f.jsx("div",{className:h,children:c||f.jsxs(f.Fragment,{children:[f.jsx(di,{name:"header",fallback:f.jsx(Za,{})}),f.jsx(di,{name:"content",fallback:f.jsx(qa,{})}),f.jsx(di,{name:"footer",fallback:f.jsx(Ga,{})})]})})})}const Vm=Im(LE,{Header:Za,Content:qa,Footer:Ga,Controls:Rm}),xn={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)"}},As={...xn,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)"}},js={...xn,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"}},Dm=j.createContext(null),Fm=()=>{const e=j.useContext(Dm);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e};function OE({theme:e="default",themes:t={},children:n,cssVariables:r=!0,className:i=""}){const[s,o]=j.useState(()=>{const h={default:xn,dark:As,enterprise:js,...t};return typeof e=="string"?h[e]||xn:e}),[a,l]=j.useState(()=>({default:xn,dark:As,enterprise:js,...t})),c=h=>{if(typeof h=="string"){const m=a[h];m&&o(m)}else o(h)},u=h=>{l(m=>({...m,[h.name]:h}))};j.useEffect(()=>{if(r&&typeof document<"u"){const h=document.documentElement;Object.entries(Lm(s)).forEach(([m,g])=>{h.style.setProperty(`--voxket-${m}`,g)})}},[s,r]);const d={theme:s,setTheme:c,themes:a,registerTheme:u};return f.jsx(Dm.Provider,{value:d,children:f.jsx("div",{className:`voxket-theme voxket-theme--${s.name} ${i}`,children:n})})}function Lm(e){const t={},n=(r,i="")=>{for(const[s,o]of Object.entries(r)){const a=i?`${i}-${s}`:s;typeof o=="object"&&o!==null&&!Array.isArray(o)?n(o,a):t[a]=String(o)}};return n(e),t}function $E(e=xn,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 _E(e){var n;const{theme:t}=Fm();return((n=t.components)==null?void 0:n[e])||{}}const BE=Ua("voice-modality","voice",{onActivate:async e=>{const t=e.config;t.enableTranscription&&zE(e),t.enableVoiceActivation&&HE(e,t),console.log("Voice modality activated",t)},onDeactivate:async e=>{console.log("Voice modality deactivated")},onMessage:async(e,t)=>{t.type==="audio"&&UE(e,t)}});function zE(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 HE(e,t){const n=t.silenceThreshold||-50;console.log("Voice activation setup with threshold:",n)}function UE(e,t){console.log("Playing audio response:",t.content)}const WE=Ua("chat-modality","chat",{onActivate:async e=>{const t=e.config;t.enableRichText&&ZE(),t.enableFileUpload&&qE(e),t.enableCustomComponents&&GE(),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"?KE(e,t):t.type==="text"&&n.enableRichText&&YE(e,t)}});function ZE(e){console.log("Rich text support enabled")}function qE(e){console.log("File upload enabled"),e.on("chat.file.uploaded",t=>{console.log("File uploaded:",t.name)})}function GE(e){console.log("Custom components enabled");const t=new Map;t.set("quick-actions",XE),t.set("form",QE),t.set("card",JE),t.set("chart",eT)}function KE(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 YE(e,t){console.log("Processing rich text message:",t.content)}function XE(e){return{type:"quick-actions",actions:e.actions||[],layout:e.layout||"horizontal"}}function QE(e){return{type:"form",fields:e.fields||[],submitAction:e.submitAction,validation:e.validation}}function JE(e){return{type:"card",title:e.title,content:e.content,actions:e.actions,variant:e.variant||"default"}}function eT(e){return{type:"chart",chartType:e.chartType||"line",data:e.data,options:e.options}}function fi({track:e,participantName:t,showControls:n=!0,showName:r=!0,showMuteIndicator:i=!0,isPinned:s=!1,className:o="",onClick:a,onPin:l,onUnpin:c}){const u=j.useRef(null),[d,h]=j.useState(!1);j.useEffect(()=>{if(!u.current||!e.isEnabled)return;const b=u.current;return b.srcObject=null,()=>{b.srcObject&&(b.srcObject=null)}},[e]);const m=()=>{a==null||a(e)},g=b=>{b.stopPropagation(),s?c==null||c(e):l==null||l(e)},p=["voxket-video-tile",e.isLocal?"voxket-video-tile--local":"voxket-video-tile--remote",e.isScreenShare?"voxket-video-tile--screen-share":"voxket-video-tile--camera",s?"voxket-video-tile--pinned":"",e.isEnabled?"":"voxket-video-tile--disabled",d?"voxket-video-tile--hovered":"",o].filter(Boolean).join(" ");return f.jsxs("div",{className:p,onClick:m,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{aspectRatio:e.dimensions?`${e.dimensions.width} / ${e.dimensions.height}`:"16 / 9"},children:[f.jsx("video",{ref:u,className:"voxket-video-element",autoPlay:!0,playsInline:!0,muted:e.isLocal}),!e.isEnabled&&f.jsxs("div",{className:"voxket-video-placeholder",children:[f.jsx("div",{className:"voxket-video-placeholder-icon",children:e.isScreenShare?"🖥️":"📹"}),f.jsx("p",{className:"voxket-video-placeholder-text",children:e.isScreenShare?"Screen sharing paused":"Camera off"})]}),f.jsxs("div",{className:"voxket-video-overlay",children:[r&&t&&f.jsxs("div",{className:"voxket-video-name",children:[t,e.isLocal&&" (You)"]}),i&&!e.isEnabled&&f.jsx("div",{className:"voxket-video-mute-indicator",children:"🔇"}),n&&(d||s)&&f.jsxs("div",{className:"voxket-video-controls",children:[f.jsx("button",{className:`voxket-video-control-btn ${s?"voxket-video-control-btn--active":""}`,onClick:g,title:s?"Unpin video":"Pin video",children:"📌"}),e.isScreenShare&&f.jsx("div",{className:"voxket-video-indicator",children:"🖥️"}),e.source&&f.jsx("div",{className:"voxket-video-source",children:e.source})]})]}),!e.isEnabled&&f.jsx("div",{className:"voxket-video-loading",children:f.jsx("div",{className:"voxket-spinner"})})]})}function tT({tracks:e,layout:t,className:n="",onLayoutChange:r,onTrackClick:i,maxVisibleTracks:s=9,showPagination:o=!0}){const[a,l]=j.useState(0),[c,u]=j.useState(null),d=j.useMemo(()=>{let k=[...e];t.type==="speaker"&&c&&(k=[c,...e.filter(T=>T.id!==c.id)]);const S=a*s,A=S+s;return k.slice(S,A)},[e,t,c,a,s]),h=Math.ceil(e.length/s),m=j.useMemo(()=>{const k=d.length;switch(t.type){case"grid":const S=Math.ceil(Math.sqrt(k)),A=Math.ceil(k/S);return{display:"grid",gridTemplateColumns:`repeat(${S}, 1fr)`,gridTemplateRows:`repeat(${A}, 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,d.length]),g=k=>{u(k)},p=()=>{u(null)},b=k=>{r==null||r({...t,type:k})},v=["voxket-video-grid",`voxket-video-grid--${t.type}`,`voxket-video-grid--${d.length}-tracks`,n].filter(Boolean).join(" ");return e.length===0?f.jsx("div",{className:"voxket-video-grid-empty",children:f.jsxs("div",{className:"voxket-video-grid-empty-content",children:[f.jsx("div",{className:"voxket-video-grid-empty-icon",children:"📹"}),f.jsx("p",{children:"No video tracks available"})]})}):f.jsxs("div",{className:v,children:[f.jsxs("div",{className:"voxket-video-grid-controls",children:[f.jsx("div",{className:"voxket-video-layout-controls",children:["grid","speaker","sidebar","gallery"].map(k=>f.jsx("button",{className:`voxket-layout-btn ${t.type===k?"voxket-layout-btn--active":""}`,onClick:()=>b(k),title:`Switch to ${k} layout`,children:nT(k)},k))}),f.jsxs("div",{className:"voxket-video-count",children:[e.length," participant",e.length!==1?"s":""]})]}),f.jsx("div",{className:"voxket-video-grid-content",style:m,children:t.type==="speaker"&&c?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"voxket-video-speaker-main",children:f.jsx(fi,{track:c,participantName:`Participant ${c.participantId}`,isPinned:!0,onClick:i,onUnpin:p})}),f.jsx("div",{className:"voxket-video-speaker-sidebar",children:d.filter(k=>k.id!==c.id).map(k=>f.jsx(fi,{track:k,participantName:`Participant ${k.participantId}`,showControls:!1,onClick:i,onPin:g},k.id))})]}):d.map(k=>f.jsx(fi,{track:k,participantName:`Participant ${k.participantId}`,isPinned:(c==null?void 0:c.id)===k.id,onClick:i,onPin:g,onUnpin:p},k.id))}),o&&h>1&&f.jsxs("div",{className:"voxket-video-pagination",children:[f.jsx("button",{className:"voxket-pagination-btn",onClick:()=>l(Math.max(0,a-1)),disabled:a===0,children:"←"}),f.jsxs("span",{className:"voxket-pagination-info",children:["Page ",a+1," of ",h]}),f.jsx("button",{className:"voxket-pagination-btn",onClick:()=>l(Math.min(h-1,a+1)),disabled:a===h-1,children:"→"})]})]})}function nT(e){switch(e){case"grid":return"⊞";case"speaker":return"🎤";case"sidebar":return"⫸";case"gallery":return"⊡";case"picture-in-picture":return"⧉";default:return"⊞"}}function rT({localTrack:e,onToggleCamera:t,onToggleScreenShare:n,onLayoutChange:r,showLayoutControls:i=!0,showCameraControls:s=!0,showScreenShareControls:o=!0,className:a=""}){const l=["voxket-video-controls",a].filter(Boolean).join(" "),c=u=>{r==null||r({type:u,showLocalVideo:!0,aspectRatio:"16:9"})};return f.jsxs("div",{className:l,children:[s&&f.jsxs("div",{className:"voxket-video-controls-section",children:[f.jsx("h4",{className:"voxket-video-controls-title",children:"Camera"}),f.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:[f.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isEnabled?"📹":"📷"}),f.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isEnabled?"Camera On":"Camera Off"})]}),(e==null?void 0:e.dimensions)&&f.jsxs("div",{className:"voxket-video-info",children:[e.dimensions.width," × ",e.dimensions.height]})]}),o&&f.jsxs("div",{className:"voxket-video-controls-section",children:[f.jsx("h4",{className:"voxket-video-controls-title",children:"Screen Share"}),f.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:[f.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isScreenShare?"🛑":"🖥️"}),f.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isScreenShare?"Stop Sharing":"Share Screen"})]})]}),i&&f.jsxs("div",{className:"voxket-video-controls-section",children:[f.jsx("h4",{className:"voxket-video-controls-title",children:"Layout"}),f.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:d,label:h})=>f.jsxs("button",{className:"voxket-layout-control-btn",onClick:()=>c(u),title:`Switch to ${h} layout`,children:[f.jsx("span",{className:"voxket-control-icon",children:d}),f.jsx("span",{className:"voxket-control-label",children:h})]},u))})]}),f.jsxs("div",{className:"voxket-video-controls-section",children:[f.jsx("h4",{className:"voxket-video-controls-title",children:"Video Settings"}),f.jsxs("div",{className:"voxket-video-settings",children:[f.jsxs("div",{className:"voxket-setting-group",children:[f.jsx("label",{className:"voxket-setting-label",children:"Quality"}),f.jsxs("select",{className:"voxket-setting-select",children:[f.jsx("option",{value:"high",children:"High (720p)"}),f.jsx("option",{value:"medium",children:"Medium (480p)"}),f.jsx("option",{value:"low",children:"Low (240p)"})]})]}),f.jsxs("div",{className:"voxket-setting-group",children:[f.jsx("label",{className:"voxket-setting-label",children:"Frame Rate"}),f.jsxs("select",{className:"voxket-setting-select",children:[f.jsx("option",{value:"30",children:"30 fps"}),f.jsx("option",{value:"15",children:"15 fps"}),f.jsx("option",{value:"10",children:"10 fps"})]})]}),f.jsxs("div",{className:"voxket-setting-group",children:[f.jsx("label",{className:"voxket-setting-label",children:"Bandwidth"}),f.jsxs("select",{className:"voxket-setting-select",children:[f.jsx("option",{value:"unlimited",children:"Unlimited"}),f.jsx("option",{value:"1000",children:"1 Mbps"}),f.jsx("option",{value:"500",children:"500 Kbps"}),f.jsx("option",{value:"250",children:"250 Kbps"})]})]})]})]}),f.jsxs("div",{className:"voxket-video-controls-section",children:[f.jsx("h4",{className:"voxket-video-controls-title",children:"Statistics"}),f.jsxs("div",{className:"voxket-video-stats",children:[f.jsxs("div",{className:"voxket-stat-item",children:[f.jsx("span",{className:"voxket-stat-label",children:"Resolution:"}),f.jsx("span",{className:"voxket-stat-value",children:e!=null&&e.dimensions?`${e.dimensions.width}×${e.dimensions.height}`:"N/A"})]}),f.jsxs("div",{className:"voxket-stat-item",children:[f.jsx("span",{className:"voxket-stat-label",children:"Source:"}),f.jsx("span",{className:"voxket-stat-value",children:(e==null?void 0:e.source)||"None"})]}),f.jsxs("div",{className:"voxket-stat-item",children:[f.jsx("span",{className:"voxket-stat-label",children:"Status:"}),f.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 Om=({handler:e,loadData:t,data:n,client:r,addLocalMessage:i})=>{const[s,o]=x.useState(null),[a,l]=x.useState(!0),[c,u]=x.useState(!1),[d]=x.useState(Date.now());x.useEffect(()=>{(async()=>{try{if(l(!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"};o(b),console.log("📋 AssignmentView: Assignment loaded from RPC data:",b)}}catch(b){console.error("📋 AssignmentView: Error loading assignment:",b),o({title:"Assignment Loading Error",description:"There was an error loading the assignment details. Please try again.",estimated_time_of_completion:"Unknown"})}finally{l(!1)}})()},[n,t]);const h=({message:p,assignment:b})=>{const v=p.toLowerCase().includes("declined"),k=v?"bg-red-50 border-red-200":"bg-green-50 border-green-200",S=v?"text-red-700":"text-green-700",A=v?"❌":"🎉";return f.jsxs("div",{className:`max-w-sm mx-auto ${k} border rounded-lg shadow p-3 flex flex-col items-center`,children:[f.jsx("div",{className:"text-2xl mb-2",children:A}),f.jsx("div",{className:`${S} font-semibold text-sm mb-1`,children:p}),f.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:b.title}),f.jsx("div",{className:"text-xs text-gray-500",children:"Thank you for your response!"})]})},m=async()=>{if(!(!s||!e)){u(!0);try{const p={message:"accepted"};console.log("📋 AssignmentView: Assignment accepted:",p),e.didSuccess(p,f.jsx(h,{message:"Assignment accepted!",assignment:s}))}catch(p){console.error("📋 AssignmentView: Error accepting assignment:",p),e.didFail({error:"Failed to accept assignment"})}finally{u(!1)}}},g=async()=>{if(!(!s||!e)){u(!0);try{const p={message:"declined"};console.log("📋 AssignmentView: Assignment declined:",p),e.didSuccess(p,f.jsx(h,{message:"Assignment declined",assignment:s}))}catch(p){console.error("📋 AssignmentView: Error declining assignment:",p),e.didFail({error:"Failed to decline assignment"})}finally{u(!1)}}};return a?f.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:f.jsxs("div",{className:"flex items-center justify-center py-4",children:[f.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),f.jsx("span",{className:"ml-2 text-xs text-gray-600",children:"Loading assignment..."})]})}):s?f.jsxs("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg overflow-hidden",children:[f.jsx("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 text-white p-3",children:f.jsx("div",{className:"flex items-center justify-between",children:f.jsx("h3",{className:"text-xs font-semibold text-white truncate",children:s.title})})}),f.jsxs("div",{className:"p-3 text-black",children:[f.jsx("div",{className:"bg-gray-50 rounded p-2 mb-3",children:f.jsx("p",{className:"text-xs text-black leading-snug",children:s.description})}),f.jsx("div",{className:"mb-3 text-black",children:f.jsxs("div",{className:"flex items-center text-xs text-gray-600",children:[f.jsx("span",{className:"text-xs mr-1",children:"📅"}),f.jsxs("span",{children:["Est: ",s.estimated_time_of_completion]})]})}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("button",{onClick:m,disabled:c,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:c?f.jsxs("span",{className:"flex items-center justify-center",children:[f.jsx("div",{className:"animate-spin rounded-full h-2 w-2 border-b-2 border-white mr-1"}),f.jsx("span",{className:"text-xs",children:"Processing..."})]}):"Accept"}),f.jsx("button",{onClick:g,disabled:c,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"})]})]})]}):f.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:f.jsxs("div",{className:"text-center py-4",children:[f.jsx("div",{className:"text-red-600 text-sm font-semibold mb-2",children:"⚠️ Assignment Error"}),f.jsx("p",{className:"text-xs text-gray-600 mb-3",children:"Failed to load assignment details."})]})})};function iT(){const[e,t]=x.useState(null),[n,r]=x.useState([]);x.useEffect(()=>{const a=new $r({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",l=>{console.log("RPC Method Called:",l)}),a.on("rpc.interaction.completed",l=>{console.log("RPC Interaction Completed:",l)}),()=>{a.disconnect()}},[]);const i=async()=>{if(e)try{await e.registerFrontendRPC("give_assignment",Om,"embedded");const a=e.getRegisteredRpcMethods();r(a),console.log("✅ Assignment RPC registered successfully")}catch(a){console.error("❌ Failed to register assignment RPC:",a)}},s=async()=>{if(!e)return;const a=({handler:l,timeout:c})=>{const[u,d]=x.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"}],m=p=>{d(p)},g=()=>{const p=h.find(b=>b.id===u);l==null||l.didSuccess({selectedProduct:u,productName:p==null?void 0:p.name,price:p==null?void 0:p.price,timestamp:new Date().toISOString()})};return f.jsxs("div",{className:"p-6 bg-white rounded-lg",children:[f.jsx("h3",{className:"text-xl font-bold mb-4",children:"Choose Your Plan"}),f.jsx("p",{className:"text-gray-600 mb-4",children:"Select the plan that best fits your needs:"}),f.jsx("div",{className:"space-y-3 mb-6",children:h.map(p=>f.jsx("div",{onClick:()=>m(p.id),className:`p-4 border rounded-lg cursor-pointer transition-all ${u===p.id?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-gray-300"}`,children:f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsxs("div",{children:[f.jsx("h4",{className:"font-medium",children:p.name}),f.jsx("p",{className:"text-gray-600 text-sm",children:p.price})]}),f.jsx("div",{className:`w-4 h-4 rounded-full ${u===p.id?"bg-blue-500":"border-2 border-gray-300"}`})]})},p.id))}),f.jsxs("div",{className:"flex justify-end space-x-3",children:[f.jsx("button",{onClick:()=>l==null?void 0:l.dismissView(),className:"px-4 py-2 border border-gray-300 text-gray-700 rounded hover:bg-gray-50",children:"Cancel"}),f.jsx("button",{onClick:g,disabled:!u,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50",children:"Select Plan"})]}),c&&f.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Time remaining: ",c," seconds"]})]})};try{await e.registerFrontendRPC("recommend_product",a,"modal");const l=e.getRegisteredRpcMethods();r(l),console.log("✅ Product Recommendation RPC registered successfully")}catch(l){console.error("❌ Failed to register product recommendation RPC:",l)}},o=async()=>{if(!e)return;const a=({handler:l})=>{const[c,u]=x.useState(0),[d,h]=x.useState(""),m=()=>{l==null||l.didSuccess({rating:c,comment:d,timestamp:new Date().toISOString()})};return f.jsxs("div",{className:"p-4 bg-white rounded-lg",children:[f.jsx("h3",{className:"text-lg font-semibold mb-3",children:"How was your experience?"}),f.jsxs("div",{className:"mb-4",children:[f.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Rate your experience:"}),f.jsx("div",{className:"flex space-x-1",children:[1,2,3,4,5].map(g=>f.jsx("button",{onClick:()=>u(g),className:`text-2xl ${g<=c?"text-yellow-400":"text-gray-300"}`,children:"⭐"},g))})]}),f.jsxs("div",{className:"mb-4",children:[f.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Additional comments:"}),f.jsx("textarea",{value:d,onChange:g=>h(g.target.value),className:"w-full p-2 border border-gray-300 rounded text-sm",rows:3,placeholder:"Tell us more about your experience..."})]}),f.jsxs("div",{className:"flex justify-end space-x-2",children:[f.jsx("button",{onClick:()=>l==null?void 0:l.dismissView(),className:"px-3 py-1 text-sm border border-gray-300 text-gray-700 rounded hover:bg-gray-50",children:"Skip"}),f.jsx("button",{onClick:m,disabled:c===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 l=e.getRegisteredRpcMethods();r(l),console.log("✅ Feedback RPC registered successfully")}catch(l){console.error("❌ Failed to register feedback RPC:",l)}};return f.jsxs("div",{className:"p-6",children:[f.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Frontend RPC Examples"}),f.jsxs("div",{className:"space-y-4 mb-6",children:[f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Register RPC Methods"}),f.jsxs("div",{className:"space-x-2",children:[f.jsx("button",{onClick:i,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Register Assignment RPC"}),f.jsx("button",{onClick:s,className:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600",children:"Register Product Recommendation RPC"}),f.jsx("button",{onClick:o,className:"px-4 py-2 bg-purple-500 text-white rounded hover:bg-purple-600",children:"Register Feedback RPC"})]})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Registered Methods"}),n.length>0?f.jsx("ul",{className:"list-disc list-inside space-y-1",children:n.map(a=>f.jsx("li",{className:"text-gray-700",children:f.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:a})},a))}):f.jsx("p",{className:"text-gray-500",children:"No methods registered yet"})]})]}),f.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[f.jsx("h3",{className:"text-lg font-semibold mb-2",children:"How it works"}),f.jsxs("ol",{className:"list-decimal list-inside space-y-2 text-sm text-gray-700",children:[f.jsxs("li",{children:["Register RPC methods with React components using ",f.jsx("code",{children:"client.registerFrontendRPC()"})]}),f.jsx("li",{children:"When the agent calls an RPC method, the corresponding component will be displayed"}),f.jsx("li",{children:"Users interact with the component, and the response is sent back to the agent"}),f.jsx("li",{children:"Components can be displayed in different modes: embedded, modal, or fullscreen"}),f.jsx("li",{children:"Each component has a timeout and can handle success/failure scenarios"})]})]}),f.jsxs("div",{className:"mt-6 bg-blue-50 p-4 rounded-lg",children:[f.jsx("h3",{className:"text-lg font-semibold mb-2 text-blue-800",children:"Agent Side"}),f.jsx("p",{className:"text-sm text-blue-700 mb-2",children:"On the agent side, you can call these RPC methods like this:"}),f.jsx("pre",{className:"bg-white p-3 rounded text-xs text-gray-800 overflow-x-auto",children:`// Agent calls RPC method
163
+ `,style:{minHeight:"2.5rem",display:o===r?"block":"none"},children:s},o))})}function FE({statusMessage:e,theme:t}){const n=tt(t);return f.jsxs("div",{className:"z-10 flex items-center space-x-2 mt-2 pb-2",children:[f.jsx("div",{className:n.statusIndicator}),f.jsx("span",{className:`text-xs ${n.text.muted}`,children:e})]})}const Dm=j.forwardRef(({disabled:e,onStartCall:t,onStartChat:n,onStartVideo:r,prompts:i=['"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:s="Agent is ready",title:o="Choose how to interact",subTitle:a="Ask me anything or give me a task to complete",theme:l="vox",modalities:c=["voice","chat","video"]},u)=>{const d=tt(l),h=c.includes("voice"),m=c.includes("chat"),g=c.includes("video"),p=[h,m,g].filter(Boolean).length;return f.jsxs("div",{className:"flex p-8 flex-col items-center h-full justify-center w-full relative","aria-disabled":e,style:{background:"transparent"},children:[f.jsxs("div",{className:"mt-1 relative flex items-center justify-center mb-8 w-full",style:{minHeight:"120px"},children:[f.jsxs("div",{className:"absolute inset-0 flex items-center justify-center",children:[f.jsx("div",{className:d.pulseRings.ring1}),f.jsx("div",{className:d.pulseRings.ring2,style:{animationDelay:"0.5s"}}),f.jsx("div",{className:d.pulseRings.ring3,style:{animationDelay:"1s"}})]}),f.jsx("div",{className:"relative z-10 flex items-center justify-center",children:h&&m&&g?f.jsxs("div",{className:"flex gap-4 items-center justify-center",children:[f.jsx(oi,{onClick:t,disabled:e,theme:l}),f.jsx(Uo,{onClick:n,disabled:e,theme:l}),f.jsx(Wo,{onClick:r||t,disabled:e,theme:l})]}):p>1?f.jsxs("div",{className:"flex gap-6 items-center justify-center",children:[h&&f.jsx(oi,{onClick:t,disabled:e,theme:l}),m&&f.jsx(Uo,{onClick:n,disabled:e,theme:l}),g&&r&&f.jsx(Wo,{onClick:r,disabled:e,theme:l})]}):f.jsx("div",{className:"flex items-center justify-center",children:h?f.jsx(oi,{onClick:t,disabled:e,theme:l}):m?f.jsx(Uo,{onClick:n,disabled:e,theme:l}):g&&r?f.jsx(Wo,{onClick:r,disabled:e,theme:l}):f.jsx(oi,{onClick:t,disabled:e,theme:l})})})]}),f.jsxs("div",{className:"text-center flex flex-col items-center gap-y-2 mb-6 w-full",children:[f.jsx("h3",{className:`text-xl font-semibold mb-2 ${d.text.accent}`,children:o}),f.jsx("p",{className:`text-sm leading-relaxed px-4 ${d.text.secondary}`,children:a}),p>1&&f.jsxs("div",{className:"flex gap-6 mt-4 text-xs justify-center",children:[h&&f.jsxs("div",{className:"flex flex-col items-center gap-1",children:[f.jsx(jh,{className:"w-4 h-4"}),f.jsx("span",{className:d.text.muted,children:"Voice"})]}),m&&f.jsxs("div",{className:"flex flex-col items-center gap-1",children:[f.jsx(Ah,{className:"w-4 h-4"}),f.jsx("span",{className:d.text.muted,children:"Chat"})]}),g&&f.jsxs("div",{className:"flex flex-col items-center gap-1",children:[f.jsx(Ph,{className:"w-4 h-4"}),f.jsx("span",{className:d.text.muted,children:"Video"})]})]})]}),f.jsx(DE,{prompts:i,theme:l}),f.jsx(FE,{statusMessage:s,theme:l})]})});Dm.displayName="Welcome";class Ya extends x.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 x.createElement(t,{error:this.state.error})}return x.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 Fm({room:e,onSessionEnd:t,onSessionStart:n,enableConsoleLogging:r=!0,enableLocalStorage:i=!0,voxketSessionId:s}={}){const[o,a]=x.useState(null),[l,c]=x.useState([]),[u,d]=x.useState(null),[h,m]=x.useState([]),g=x.useCallback((k,S)=>{const A={timestamp:new Date,event:k,data:S,sessionId:o==null?void 0:o.sessionId,participantId:u==null?void 0:u.identity};if(c(T=>[...T,A]),i){const T=JSON.parse(localStorage.getItem("voxket-session-logs")||"[]");T.push(A),localStorage.setItem("voxket-session-logs",JSON.stringify(T))}return A},[o==null?void 0:o.sessionId,u==null?void 0:u.identity,r,i]);x.useEffect(()=>{if(!e)return;const k=()=>{const y=s||`session-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,M=new Date,D={sessionId:y,startTime:M,totalMessages:0,connectionIssues:0,participantCount:h.length,events:[]};a(D),g("SESSION_STARTED",{sessionId:y,startTime:M}),n==null||n(y)},S=()=>{if(o){const y=new Date,M=y.getTime()-o.startTime.getTime(),D={...o,endTime:y,duration:M,events:l};g("SESSION_ENDED",{sessionId:o.sessionId,duration:`${Math.round(M/1e3)}s`,totalMessages:o.totalMessages,connectionIssues:o.connectionIssues}),t==null||t(D),a(null),c([])}},A=y=>{g("CONNECTION_STATE_CHANGED",{state:y}),y===te.ConnectionState.Reconnecting&&o&&(a(M=>M?{...M,connectionIssues:M.connectionIssues+1}:null),g("CONNECTION_ISSUE",{type:"reconnecting"}))},T=y=>{g("TRACK_PUBLISHED",{trackKind:y.kind,trackSource:y.source})},C=y=>{g("TRACK_UNPUBLISHED",{trackKind:y.kind,trackSource:y.source})},N=(y,M)=>{o&&a(D=>D?{...D,totalMessages:D.totalMessages+1}:null),g("DATA_RECEIVED",{participantId:M==null?void 0:M.identity,dataSize:y.length})},P=y=>{g("PARTICIPANT_CONNECTED",{participantId:y.identity,participantName:y.name}),m(M=>[...M,y]),o&&a(M=>M?{...M,participantCount:M.participantCount+1}:null)},L=y=>{g("PARTICIPANT_DISCONNECTED",{participantId:y.identity,participantName:y.name}),m(M=>M.filter(D=>D.identity!==y.identity))};return e.localParticipant&&d(e.localParticipant),e.on(te.RoomEvent.Connected,k),e.on(te.RoomEvent.Disconnected,S),e.on(te.RoomEvent.ConnectionStateChanged,A),e.on(te.RoomEvent.TrackPublished,T),e.on(te.RoomEvent.TrackUnpublished,C),e.on(te.RoomEvent.DataReceived,N),e.on(te.RoomEvent.ParticipantConnected,P),e.on(te.RoomEvent.ParticipantDisconnected,L),()=>{e.off(te.RoomEvent.Connected,k),e.off(te.RoomEvent.Disconnected,S),e.off(te.RoomEvent.ConnectionStateChanged,A),e.off(te.RoomEvent.TrackPublished,T),e.off(te.RoomEvent.TrackUnpublished,C),e.off(te.RoomEvent.DataReceived,N),e.off(te.RoomEvent.ParticipantConnected,P),e.off(te.RoomEvent.ParticipantDisconnected,L)}},[e,o,l,h.length,g,t,n]);const p=x.useCallback(()=>i?JSON.parse(localStorage.getItem("voxket-session-logs")||"[]"):l,[l,i]),b=x.useCallback(()=>{i&&localStorage.removeItem("voxket-session-logs"),c([])},[i]),v=x.useCallback(()=>{const k=p(),S=JSON.stringify(k,null,2),A="data:application/json;charset=utf-8,"+encodeURIComponent(S),T=`voxket-session-logs-${new Date().toISOString().split("T")[0]}.json`,C=nh("a");C&&(C.setAttribute("href",A),C.setAttribute("download",T),C.click())},[p]);return{sessionMetrics:o,sessionLogs:l,logEvent:g,getSessionLogs:p,clearSessionLogs:b,exportSessionLogs:v}}class Xa{constructor(){Ue(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=(...i)=>{this.off(t,r),n(...i)};return this.on(t,r)}off(t,n){const r=this.listeners[t];if(!r)return;const i=r.indexOf(n);i>-1&&r.splice(i,1)}removeAllListeners(t){t?delete this.listeners[t]:this.listeners={}}emit(t,...n){const r=this.listeners[t];if(!r)return;const i=[...r];for(const s of i)try{s(...n)}catch(o){console.error(`Error in event listener for ${String(t)}:`,o)}}listenerCount(t){var n;return((n=this.listeners[t])==null?void 0:n.length)??0}eventNames(){return Object.keys(this.listeners)}}class Lm{constructor(t){Ue(this,"plugins",new Map);Ue(this,"installedPlugins",new Set);Ue(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 s of r.dependencies)this.installedPlugins.has(s)||await this.install(s);const i={...this.context,config:{...r.config,...n}};r.install&&await r.install(i),this.installedPlugins.add(t),this.setupPluginEvents(r,i)}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[i,s]of this.plugins)if(this.installedPlugins.has(i)&&((r=s.dependencies)!=null&&r.includes(t)))throw new Error(`Cannot uninstall '${t}' because '${i}' 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 LE(e){return e}function Qa(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 OE={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)})}},$E={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))}},_E={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})})}},Om=j.createContext(null);function fi({config:e,children:t,autoConnect:n=!1,client:r}){const[i,s]=j.useState(null),[o,a]=j.useState(!1),[l,c]=j.useState(!1),[u,d]=j.useState(null),[h,m]=j.useState(null),[g,p]=j.useState("idle"),[b,v]=j.useState(null),[k,S]=j.useState([]),[A,T]=j.useState([]),[C,N]=j.useState([]);j.useEffect(()=>{const W=r||new zr(e);s(W);const w=P(W);return n&&!r&&L(W),()=>{w(),r||W.disconnect().catch(console.error)}},[e,n,r]);const P=W=>{const w=()=>{c(!0),d(null)},z=()=>{a(!0),c(!1),d(null)},oe=()=>{a(!1),c(!1),m(null),p("idle"),S([]),T([]),N([])},E=re=>{d(re),c(!1)},U=re=>{m(re),p(re.state)},se=re=>{p(re),h&&m({...h,state:re})},$=(re,ne)=>{m(null),p("idle"),v(ne),S([]),T([]),N([])},ee=re=>{S(ne=>[...ne,re])},Q=re=>{S(ne=>ne.filter(me=>me.id!==re.id))},V=re=>{T(ne=>[...ne,re])},G=re=>{T(ne=>[...ne,re])},fe=re=>{console.log("📝 VoxketProvider: Received transcription:",re),N(ne=>ne.find(Z=>Z.id===re.id)?(console.log("📝 VoxketProvider: Duplicate transcription detected, skipping:",re.id),ne):(console.log("📝 VoxketProvider: Adding new transcription:",re.id),[...ne,re]))},R=()=>{console.log("🧹 VoxketProvider: Clearing chat messages and transcriptions"),T([]),N([])};return W.on("connection.connecting",w),W.on("connection.connected",z),W.on("connection.disconnected",oe),W.on("connection.error",E),W.on("session.created",U),W.on("session.state.changed",se),W.on("session.ended",$),W.on("participant.joined",ee),W.on("participant.left",Q),W.on("chat.message.received",V),W.on("chat.message.sent",G),W.on("transcription.received",fe),W.on("chat.history.cleared",R),()=>{console.log("📝 VoxketProvider: Cleaning up event listeners"),W.off("connection.connecting",w),W.off("connection.connected",z),W.off("connection.disconnected",oe),W.off("connection.error",E),W.off("session.created",U),W.off("session.state.changed",se),W.off("session.ended",$),W.off("participant.joined",ee),W.off("participant.left",Q),W.off("chat.message.received",V),W.off("chat.message.sent",G),W.off("chat.history.cleared",R),W.off("transcription.received",fe)}},L=async W=>{const w=W||i;if(w)try{await w.connect()}catch(z){console.error("Failed to connect:",z)}},F={client:i,isConnected:o,isConnecting:l,connectionError:u,currentSession:h,sessionState:g,sessionMetrics:b,participants:k,chatMessages:A,transcriptions:C,connect:()=>L(),disconnect:async()=>{if(i)try{await i.disconnect()}catch(W){console.error("Failed to disconnect:",W)}},createSession:async(W,w={})=>{if(!i)throw new Error("Client not initialized");const z={agentId:W,participantName:w.participantName||"User",metadata:w.metadata,modalities:w.modalities||["voice"]};return await i.createSession(z)},endSession:async()=>i?await i.endSession():null,sendChatMessage:async W=>{if(!i)throw new Error("Client not initialized");await i.sendChatMessage(W)},setMicrophoneEnabled:async W=>{if(!i)throw new Error("Client not initialized");await i.setMicrophoneEnabled(W)},setCameraEnabled:async W=>{if(!i)throw new Error("Client not initialized");await i.setCameraEnabled(W)},startScreenShare:async()=>{if(!i)throw new Error("Client not initialized");await i.startScreenShare()},stopScreenShare:async()=>{if(!i)throw new Error("Client not initialized");await i.stopScreenShare()}};return f.jsx(Om.Provider,{value:F,children:t})}function Ft(){const e=j.useContext(Om);if(!e)throw new Error("useVoxket must be used within a VoxketProvider");return e}class BE extends Xa{constructor(n){super();Ue(this,"room",null);Ue(this,"registeredMethods",new Map);Ue(this,"activeInteractions",new Map);Ue(this,"currentInteraction",null);n&&this.setRoom(n)}setRoom(n){this.room=n}async registerFrontendRPC(n,r,i="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 s={methodName:n,component:r,presentationMode:i};this.registeredMethods.set(n,s);try{this.room.registerRpcMethod(n,async o=>{console.log(`RpcManager: RPC method '${n}' called by ${o.callerIdentity}`),console.log("RpcManager: Payload:",o.payload),this.emit("rpc.method.called",{methodName:n,data:o});let a;console.log(`RpcManager: Current registration for '${n}':`,s);let l=o.responseTimeout||30;try{a=JSON.parse(o.payload)}catch{a=o.payload}try{const c=await this.awaitUserInteraction(n,r,i,a,l);return JSON.stringify(c)}catch(c){throw console.error(`RpcManager: Error in RPC method '${n}':`,c),c}}),this.emit("rpc.method.registered",{methodName:n}),console.log(`RpcManager: Successfully registered RPC method: ${n}`)}catch(o){throw console.error(`RpcManager: Failed to register RPC method '${n}':`,o),o}}async awaitUserInteraction(n,r,i,s,o){return new Promise((a,l)=>{const c=`${n}_${Date.now()}`;console.log(`RpcManager: Starting user interaction for method: ${n}, timeout: ${o} seconds`);const u={didSuccess:(h,m)=>{console.log(`RpcManager: User interaction successful for method: ${n}`,h),this.clearInteraction(c),this.currentInteraction=null;const g={success:!0,message:"User interaction completed successfully",data:h,timestamp:new Date,...m?{successView:m}:{}};this.emit("rpc.interaction.completed",{methodName:n,response:g}),a(g)},didFail:h=>{console.log(`RpcManager: User interaction failed for method: ${n}`,h),this.clearInteraction(c);const m={success:!1,message:"User interaction failed",error:h,timestamp:new Date};this.emit("rpc.interaction.completed",{methodName:n,response:m}),a(m)},dismissView:()=>{var m;console.log(`RpcManager: User dismissed interaction for method: ${n}`),console.log("RpcManager: Current interaction before dismiss:",(m=this.currentInteraction)==null?void 0:m.methodName),this.clearInteraction(c),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 g;((g=this.currentInteraction)==null?void 0:g.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(c),this.currentInteraction=null;const m={success:!0,message:`User interaction timed out after ${o} 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:m}),setTimeout(()=>{var g;((g=this.currentInteraction)==null?void 0:g.methodName)===n&&(console.log(`RpcManager: Force clearing interaction for ${n}`),this.currentInteraction=null)},0),a(m)}},d=setTimeout(()=>{u.didTimeout&&u.didTimeout()},o);this.activeInteractions.set(c,{resolve:h=>a(JSON.parse(h)),reject:l,timeoutId:d}),this.currentInteraction={isVisible:!0,methodName:n,component:r,presentationMode:i,timeout:o,data:s,handler:u},this.emit("rpc.interaction.started",{methodName:n,presentationMode:i}),setTimeout(async()=>{var h;if((h=this.currentInteraction)!=null&&h.handler)try{console.log(`RpcManager: Component created for method: ${n} with data:`,s)}catch(m){console.error("RpcManager: Error loading data into component:",m),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")}}class Ve extends Error{constructor(t,n,r){super(t),this.code=n,this.details=r,this.name="VoxketError"}}const Xt=new WeakSet,Zo=new WeakSet;class zr extends Xa{constructor(n){super();Ue(this,"config");Ue(this,"room",null);Ue(this,"pluginManager");Ue(this,"rpcManager");Ue(this,"isConnected",!1);Ue(this,"currentSession",null);Ue(this,"connectionState",te.ConnectionState.Disconnected);Ue(this,"renderedComponents",new Map);Ue(this,"textStreamHandlersRegistered",!1);Ue(this,"currentAgentInfo",null);Ue(this,"chatMessages",[]);Ue(this,"activeTranscriptions",new Map);Ue(this,"isAgentConnected",!1);Ue(this,"agentState","idle");this.config=n,this.pluginManager=new Lm(this),this.rpcManager=new BE,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,i;this.isConnected=!1,(i=(r=this.config).onDisconnected)==null||i.call(r,n)}),this.on("connection.error",n=>{var r,i;(i=(r=this.config).onError)==null||i.call(r,n)}),this.on("chat.message.received",n=>{var r,i;this.addChatMessage(n),(i=(r=this.config).onMessageReceived)==null||i.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,i;(i=(r=this.config).onTranscriptionReceived)==null||i.call(r,n)}),this.on("session.state.changed",n=>{var r,i;(i=(r=this.config).onSessionStateChanged)==null||i.call(r,n)}),this.on("session.created",n=>{var r,i;(i=(r=this.config).onSessionStart)==null||i.call(r,n.id)}),this.on("session.ended",(n,r)=>{var i,s;(s=(i=this.config).onSessionEnd)==null||s.call(i,r)}),this.on("participant.joined",n=>{var r,i;(i=(r=this.config).onUserJoined)==null||i.call(r,n.id)}),this.on("participant.left",n=>{var r,i;(i=(r=this.config).onUserLeft)==null||i.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 te.Room,this.setupRoomEventListeners()}setupRoomEventListeners(){this.room&&(this.room.on(te.RoomEvent.Connected,()=>{var n,r;this.connectionState=te.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 i;try{(i=this.room)!=null&&i.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(s){console.warn("VoxketClient: Failed to enable microphone after room connection:",s)}},1e3),this.textStreamHandlersRegistered||this.setupTextStreamHandlers()}),this.room.on(te.RoomEvent.Disconnected,n=>{var r;console.log("🔴 VoxketClient: Room disconnected, reason:",n),this.connectionState=te.ConnectionState.Disconnected,this.textStreamHandlersRegistered=!1,this.isAgentConnected=!1,console.log("🤖 VoxketClient: Agent marked as disconnected"),this.clearChatMessages(),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(te.RoomEvent.ConnectionStateChanged,n=>{this.connectionState=n,n===te.ConnectionState.Connecting&&this.emit("connection.connecting")}),this.room.on(te.RoomEvent.ParticipantConnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.joined",r)}),this.room.on(te.RoomEvent.ParticipantDisconnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.left",r)}),this.room.on(te.RoomEvent.LocalTrackPublished,n=>{console.log("🎬 VoxketClient: Local track published:",n.source),n.source===te.Track.Source.ScreenShare&&this.emit("track.unmuted",{source:"screenShare",enabled:!0})}),this.room.on(te.RoomEvent.LocalTrackUnpublished,n=>{console.log("🎬 VoxketClient: Local track unpublished:",n.source),n.source===te.Track.Source.ScreenShare&&this.emit("track.muted",{source:"screenShare",enabled:!1})}))}setupTextStreamHandlers(){if(!this.room)return;try{this.room.registerTextStreamHandler("lk.chat",async(r,i)=>{try{const s=await r.readAll(),o={id:`msg_${Date.now()}_${i.identity||"user"}_${Math.random().toString(36).substr(2,9)}`,content:s,timestamp:new Date,sender:{id:i.identity||"user",name:i.identity||"User",type:"participant"},metadata:{topic:"lk.chat"}};this.emit("chat.message.received",o)}catch(s){console.error("VoxketClient: Failed to process lk.chat message:",s)}})}catch(r){console.warn("VoxketClient: lk.chat handler already registered, skipping:",r)}try{console.log("📝 VoxketClient: Registering lk.transcription handler..."),this.room.registerTextStreamHandler("lk.transcription",async(r,i)=>{var s,o,a,l,c,u;console.log("📝 VoxketClient: Received transcription stream from:",i.identity);try{console.log("📝 VoxketClient: Processing transcription stream...");const d=i.identity===((o=(s=this.room)==null?void 0:s.localParticipant)==null?void 0:o.identity),h=Date.now(),m=i.identity,g=this.activeTranscriptions.get(m);let p,b=!0;g&&h-g.timestamp<1e3?(p=g.messageId,b=!1,console.log("📝 VoxketClient: Reusing existing transcription message ID:",p)):(p=`msg_${d?"user":"agent"}_${i.identity}_${h}`,this.activeTranscriptions.set(m,{messageId:p,timestamp:h}),console.log("📝 VoxketClient: Created new transcription message ID:",p));let v="";const k=((a=this.currentAgentInfo)==null?void 0:a.name)||i.identity||"AI Assistant";console.log("📝 VoxketClient: Using agent name:",k);const S=d?"participant":"agent",A=d?this.config.participantName||"User":k;console.log("📝 VoxketClient: Transcription sender info:",{participantIdentity:i.identity,localParticipantIdentity:(c=(l=this.room)==null?void 0:l.localParticipant)==null?void 0:c.identity,isFromUser:d,senderType:S,senderName:A});const T={id:p,content:"",timestamp:new Date,sender:{id:i.identity||"unknown",name:A,type:S},metadata:{topic:"lk.transcription",streaming:!0}};b&&this.emit("chat.message.received",T),console.log("📝 VoxketClient: Starting to read transcription stream...");for await(const L of r){console.log("📝 VoxketClient: Received chunk:",L.length,"chars"),v+=L;const y=this.convertMarkdownToText(v),M={...T,content:y,metadata:{...T.metadata,streaming:!0}};this.emit("chat.message.updated",M)}const C=this.convertMarkdownToText(v),N={...T,content:C,metadata:{...T.metadata,streaming:!1}};this.emit("chat.message.updated",N);const P={id:p,text:C,isFinal:!0,startTime:T.timestamp.getTime(),participantId:i.identity||"agent"};this.emit("transcription.received",P),console.log("📝 VoxketClient: Emitted transcription event:",P)}catch(d){console.error("VoxketClient: Failed to process lk.transcription message:",d);try{const h=await r.readAll(),m=((u=this.currentAgentInfo)==null?void 0:u.name)||i.identity||"AI Assistant",g={id:`msg_${Date.now()}_agent_transcription_${Math.random().toString(36).substr(2,9)}`,content:h,timestamp:new Date,sender:{id:i.identity||"agent",name:m,type:"agent"},metadata:{topic:"lk.transcription"}};this.emit("chat.message.received",g);const p={id:g.id,text:g.content,isFinal:!0,startTime:g.timestamp.getTime(),participantId:i.identity||"agent"};this.emit("transcription.received",p),console.log("📝 VoxketClient: Emitted fallback transcription event:",p)}catch(h){console.error("VoxketClient: Fallback failed for lk.transcription:",h)}}})}catch(r){console.warn("VoxketClient: lk.transcription handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("suggested_response",async r=>{const i=await r.readAll();let s=[];try{s=["tes","hello how are you","algebra make me learn that ","what is the meaning of life"]}catch(o){console.warn("VoxketClient: Failed to parse suggested_response:",o,i)}this.emit("suggested.response",s)})}catch(r){console.warn("VoxketClient: suggested_response handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("agent_state_changed",async(r,i)=>{const s=await r.readAll();console.log("🤖 VoxketClient: agent_state_changed stream received:",s);let o={};try{o=typeof s=="string"?JSON.parse(s.replace(/'/g,'"')):s}catch(a){console.warn("VoxketClient: Failed to parse agent_state_changed:",a,s)}this.isAgentConnected||(this.isAgentConnected=!0,console.log("🤖 VoxketClient: Agent marked as connected (first state change received)"),this.emit("agent.connected",o)),o.new_state==="speaking"?(this.setAgentState("speaking"),this.emit("agent.speaking",o)):o.new_state==="thinking"?(this.setAgentState("thinking"),this.emit("agent.thinking",o)):(o.new_state==="idle"||o.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,i)=>{try{const s=await r.readAll()}catch(s){console.error("VoxketClient: Error processing images stream:",s)}})}catch(r){console.warn("VoxketClient: images handler already registered, skipping:",r)}try{this.room.registerByteStreamHandler("images",async(r,i)=>{var s,o;try{const a=r.info,l={id:`img_${Date.now()}_${i.identity||"agent"}_${Math.random().toString(36).substr(2,9)}`,content:`�️ ${a.name||"Image"}`,sender:{id:i.identity||"agent",name:i.identity||"Agent",type:i.identity===((o=(s=this.room)==null?void 0:s.localParticipant)==null?void 0:o.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",l),r.onProgress&&(r.onProgress=m=>{const g={...l,metadata:{...l.metadata,downloadProgress:m||0}};this.emit("chat.message.updated",g)});const c=[];for await(const m of r)c.push(m);const u=new Blob(c,{type:a.mimeType||"application/octet-stream"}),d=URL.createObjectURL(u),h={...l,metadata:{...l.metadata,downloading:!1,downloadProgress:1,downloadUrl:d,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(i,s)=>{try{const o=await i.readAll();if(console.log(`📝 VoxketClient: Received '${r}' stream:`,o),r==="error"){let a={};try{a=typeof o=="string"?JSON.parse(o):o}catch{a={message:o}}console.warn("� VoxketClient: Agent error:",a),this.emit("agent.error",a)}else this.emit("text.stream.received",{topic:r,data:o,participantInfo:s})}catch(o){console.error(`VoxketClient: Failed to process '${r}' stream:`,o)}})}catch(i){console.warn(`VoxketClient: Handler for '${r}' already registered, skipping:`,i)}});try{this.room.registerTextStreamHandler("*",async(r,i)=>{var s;try{const o=await r.readAll(),a=((s=r.info)==null?void 0:s.topic)||"unknown";console.log(`📝 VoxketClient: Received unhandled text stream for topic '${a}':`,o),this.emit("text.stream.unhandled",{topic:a,data:o,participantInfo:i})}catch(o){console.error("VoxketClient: Failed to process unhandled text stream:",o)}})}catch(r){console.warn("VoxketClient: Generic text stream handler already registered, skipping:",r)}this.textStreamHandlersRegistered=!0}async fetchConnectionDetails(n,r,i){const s=n||this.config.agentId||"default-agent",o=r||this.config.participantName||"User",a=i||this.config.modalities||["voice"];try{const l={agent_id:s,participant_name:o,participant_metadata:{user_id:""},modality:a[0],modalities:a};console.log("🔗 VoxketClient: Creating session with modalities:",a);const c=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(l)});if(!c.ok){let h=`HTTP ${c.status}: Failed to fetch connection details`;try{const m=await c.json();m&&(m.error?h=`API Error: ${m.error}`:m.detail?h=`API Error: ${m.detail}`:m.message&&(h=`API Error: ${m.message}`))}catch{try{const g=await c.text();g&&(h=`API Error: ${g}`)}catch{}}throw new Error(h)}const u=await c.json();let d;return u.agent_info&&(d={id:u.agent_info.id||s,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=d),{serverUrl:u.wss_url,participantToken:u.token,voxketSessionId:u.session_id,agentInfo:d}}catch(l){console.error("VoxketClient: fetchConnectionDetails failed:",l);const c=new Ve(`Failed to fetch connection details: ${l instanceof Error?l.message:"Unknown error"}`,"CONNECTION_FAILED",l);throw this.emit("connection.error",c),c}}async connect(n,r,i){var s;try{this.emit("connection.connecting");const o=await this.fetchConnectionDetails(n,r,i);return await((s=this.room)==null?void 0:s.connect(o.serverUrl,o.participantToken)),this.isConnected=!0,o}catch(o){console.error("VoxketClient: Connection failed:",o);const a=new Ve(`Failed to connect to Voxket services: ${o instanceof Error?o.message:"Unknown error"}`,"CONNECTION_FAILED",o);throw this.emit("connection.error",a),a}}async disconnect(){var n;try{console.log("🔌 VoxketClient: Starting disconnect process..."),this.room&&(console.log("🔌 VoxketClient: Disconnecting from room:",{roomState:this.room.state,numParticipants:this.room.numParticipants,sessionId:(n=this.currentSession)==null?void 0:n.id}),await this.room.disconnect()),this.isConnected=!1,this.currentSession=null,this.currentAgentInfo=null,this.textStreamHandlersRegistered=!1,this.clearChatMessages(),console.log("🔌 VoxketClient: Creating new room instance..."),this.room=new te.Room,this.setupRoomEventListeners(),console.log("✅ VoxketClient: Disconnect completed successfully"),this.emit("connection.disconnected")}catch(r){console.error("❌ VoxketClient: Disconnect failed:",r);const i=new Ve("Failed to disconnect properly","NETWORK_ERROR",r);throw this.emit("connection.error",i),i}}async createSession(n){var r,i,s,o;try{const a=await this.connect(n.agentId,n.participantName,n.modalities),l={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=l,this.emit("session.created",l),(r=n.modalities)!=null&&r.includes("voice"))try{await new Promise(c=>setTimeout(c,500)),(i=this.room)!=null&&i.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(c){console.warn("VoxketClient: Failed to enable microphone, but continuing with session:",c)}if((s=n.modalities)!=null&&s.includes("video"))try{await new Promise(c=>setTimeout(c,200)),(o=this.room)!=null&&o.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(c){console.warn("VoxketClient: Failed to enable camera, but continuing with session:",c)}return setTimeout(()=>{var c;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:((c=this.room)==null?void 0:c.remoteParticipants.size)||0}))},1e3),l}catch(a){throw console.error("VoxketClient: Failed to create session:",a),a instanceof Ve?a:a instanceof TypeError&&a.message.includes("fetch")?new Ve("Network connection failed","CONNECTION_FAILED",a):a instanceof Error&&a.message.includes("Failed to fetch connection details")?new Ve(`API connection failed: ${a.message}`,"CONNECTION_FAILED",a):new Ve(`Failed to create session: ${a instanceof Error?a.message:"Unknown error"}`,"SESSION_NOT_FOUND",a)}}async startSession(n,r){const i={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(i)}async endSession(){var n,r;if(!this.currentSession)return null;try{const i={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,i),await this.disconnect(),i}catch(i){throw new Ve("Failed to end session","SESSION_NOT_FOUND",i)}}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 i=r.getTrackPublication(te.Track.Source.Microphone);if(i!=null&&i.track)return{source:te.Track.Source.Microphone,participant:r,publication:i}}return null}getAgentVideoTrack(){const n=this.getRemoteParticipants();for(const r of n){const i=r.getTrackPublication(te.Track.Source.Camera);if(i!=null&&i.track)return{source:te.Track.Source.Camera,participant:r,publication:i}}return null}getVideoTrackRefs(){const n=[],r=this.getLocalParticipant();if(r){const s=r.getTrackPublication(te.Track.Source.Camera);s!=null&&s.track&&n.push({source:te.Track.Source.Camera,participant:r,publication:s});const o=r.getTrackPublication(te.Track.Source.ScreenShare);o!=null&&o.track&&n.push({source:te.Track.Source.ScreenShare,participant:r,publication:o})}const i=this.getRemoteParticipants();for(const s of i){const o=s.getTrackPublication(te.Track.Source.Camera);o!=null&&o.track&&n.push({source:te.Track.Source.Camera,participant:s,publication:o});const a=s.getTrackPublication(te.Track.Source.ScreenShare);a!=null&&a.track&&n.push({source:te.Track.Source.ScreenShare,participant:s,publication:a})}return n}getCameraTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===te.Track.Source.Camera)}getScreenShareTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===te.Track.Source.ScreenShare)}getChatMessages(){return[...this.chatMessages]}addChatMessage(n){this.chatMessages.some(i=>i.id===n.id)||this.chatMessages.push(n)}updateChatMessage(n){const r=this.chatMessages.findIndex(i=>i.id===n.id);r!==-1&&(this.chatMessages[r]=n)}clearChatMessages(){this.chatMessages=[],this.activeTranscriptions.clear(),this.dismissCurrentInteraction(),this.renderedComponents.clear(),this.forceCleanupFullscreenOverlays(),console.log("🧹 VoxketClient: Cleared chat messages and transcription history"),this.emit("chat.history.cleared")}renderUI(n={}){var o,a,l,c,u,d,h,m,g;const r=this.resolveTarget(n.target||"body"),i=this.getTargetKey(r);if(Zo.has(r)){console.warn("⚠️ VoxketClient: Target is already being processed, skipping renderUI");return}if(Xt.has(r)){console.log("✋ VoxketClient: Target already has a React root in registry, updating existing props...");const p=this.renderedComponents.get(i);if(p&&p.root){const b={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:((o=n.modality)==null?void 0:o.includes("chat"))!==!1,suportsVideoInput:((a=n.modality)==null?void 0:a.includes("video"))===!0,suportsScreenShare:((l=n.modality)==null?void 0:l.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};try{p.root.render(j.createElement(fi,{config:this.config,autoConnect:n.autoStart||!1,client:this,children:j.createElement(hi,b)})),console.log("✅ VoxketClient: Successfully updated existing widget with new props");return}catch(v){throw console.error("Error re-rendering existing widget:",v),new Error(`Failed to update existing widget: ${v instanceof Error?v.message:"Unknown error"}`)}}else console.warn("⚠️ Registry inconsistency detected, cleaning up"),Xt.delete(r)}let s=this.renderedComponents.get(i);if(s&&s.target===r&&Xt.has(r)){console.log("🔄 VoxketClient: Reusing existing React root for target:",i);const p=s.root,b={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:((u=n.modality)==null?void 0:u.includes("video"))===!0,suportsScreenShare:((d=n.modality)==null?void 0:d.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};try{p.render(j.createElement(fi,{config:this.config,autoConnect:n.autoStart||!1,client:this,children:j.createElement(hi,b)}))}catch(v){throw console.error("Error rendering Voxket widget:",v),new Error(`Failed to render Voxket widget: ${v instanceof Error?v.message:"Unknown error"}`)}return}Zo.add(r);try{if(s){console.log("🧹 VoxketClient: Cleaning up existing component for different target");try{s.root.unmount(),this.renderedComponents.delete(i),Xt.delete(s.target),r.innerHTML=""}catch(v){console.warn("Failed to cleanup existing root:",v)}}if(Xt.has(r)){console.warn("⚠️ VoxketClient: Target already in registry, skipping root creation");return}console.log("🆕 VoxketClient: Creating new React root for target:",i);const p=op.createRoot(r);this.renderedComponents.set(i,{root:p,target:r}),Xt.add(r);const b={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:((h=n.modality)==null?void 0:h.includes("chat"))!==!1,suportsVideoInput:((m=n.modality)==null?void 0:m.includes("video"))===!0,suportsScreenShare:((g=n.modality)==null?void 0:g.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(!p||typeof p.render!="function")throw new Error("Invalid React root. Make sure React 18+ is properly installed and configured.");try{p.render(j.createElement(fi,{config:this.config,autoConnect:n.autoStart||!1,client:this,children:j.createElement(hi,b)}))}catch(v){throw console.error("Error rendering Voxket widget:",v),new Error(`Failed to render Voxket widget: ${v instanceof Error?v.message:"Unknown error"}`)}}finally{Zo.delete(r)}}removeUI(n){var i;const r=n?this.resolveTarget(n):null;if(r){const s=this.getTargetKey(r),o=this.renderedComponents.get(s);if(o){console.log("🗑️ VoxketClient: Removing UI for target:",s),this.renderedComponents.delete(s),Xt.delete(r);try{const l=o.target;l&&l.isConnected?(typeof((i=o.root)==null?void 0:i.unmount)=="function"&&(o.root.unmount(),console.log("✅ VoxketClient: UI unmounted for target:",s)),l.hasChildNodes()&&(l.innerHTML="")):console.log("ℹ️ VoxketClient: Target element already disconnected, skipping unmount")}catch(l){console.warn("Failed to unmount React root:",l)}}else console.log("ℹ️ VoxketClient: No component found for target, cleaning registry:",s),Xt.delete(r),r.isConnected&&r.hasChildNodes()&&(r.innerHTML="");r.querySelectorAll('[id*="voxket"], [class*="voxket"], .fixed.inset-0.z-50').forEach(l=>{try{l.remove()}catch(c){console.warn("Failed to remove element:",c)}}),wi&&Xe&&r===Xe.body&&r.querySelectorAll(".fixed.z-50, .fixed.inset-0").forEach(c=>{if(c.classList.contains("bg-black")&&(c.classList.contains("backdrop-blur-sm")||c.classList.contains("bg-opacity-30")))try{c.remove()}catch(u){console.warn("Failed to remove fixed element:",u)}})}}removeAllUI(){for(const[n,r]of this.renderedComponents)r.root.unmount();this.renderedComponents.clear(),this.forceCleanupFullscreenOverlays()}forceCleanupFullscreenOverlays(){if(!wi||!Xe)return;Xe.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(i){console.warn("Failed to remove overlay:",i)}})}resolveTarget(n){if(typeof n=="string"){const r=th(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 i;if(!this.currentSession)throw console.error("VoxketClient: No active session found"),new Ve("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new Ve("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new Ve("No local participant","CONNECTION_FAILED");this.dismissCurrentInteraction();try{const s={id:`msg_${Date.now()}`,content:n,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:r||{}},o=await((i=this.room)==null?void 0:i.localParticipant.sendText(n,{topic:"lk.chat",destinationIdentities:[]}));this.emit("chat.message.sent",s)}catch(s){throw console.error("VoxketClient: Failed to send chat message:",s),new Ve("Failed to send message","NETWORK_ERROR",s)}}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 Ve("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new Ve("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new Ve("No local participant","CONNECTION_FAILED");if(!n||n.length===0)throw new Ve("No files provided","INVALID_PARAMETER");this.dismissCurrentInteraction();const i=n.filter(s=>s.type.startsWith("image/"));if(i.length===0)throw new Ve("Only image files are allowed","INVALID_PARAMETER");i.length!==n.length&&console.warn("VoxketClient: Some non-image files were filtered out");try{const s=i.map(async(o,a)=>{const c={id:`att_${Date.now()}_${a}`,content:`📎 ${o.name}`,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:{...r,type:"attachment",fileName:o.name,fileSize:o.size,mimeType:o.type,uploading:!0}};this.emit("chat.message.sent",c);const u=await this.room.localParticipant.sendFile(o,{mimeType:o.type,topic:"images",onProgress:h=>{const m={...c,metadata:{...c.metadata,uploadProgress:h}};this.emit("chat.message.updated",m)}});try{const h=new FileReader,m=new Promise((b,v)=>{h.onload=()=>{typeof h.result=="string"?b(h.result):v(new Error("Failed to convert to base64"))},h.onerror=v});h.readAsDataURL(o);const p={type:"image",data:await m,filename:o.name,mimeType:o.type,size:o.size};await this.room.localParticipant.sendText(JSON.stringify(p),{topic:"images",destinationIdentities:[]})}catch(h){console.warn("VoxketClient: Failed to send image data to agent:",h);try{const m=`I've shared an image: ${o.name}`;await this.room.localParticipant.sendText(m,{topic:"lk.chat",destinationIdentities:[]})}catch(m){console.warn("VoxketClient: Failed to send image notification to agent:",m)}}const d={...c,metadata:{...c.metadata,uploading:!1,uploadProgress:1,streamId:u.id}};return this.emit("chat.message.updated",d),u});await Promise.all(s)}catch(s){throw console.error("VoxketClient: Failed to send attachments:",s),new Ve("Failed to send attachments","NETWORK_ERROR",s)}}async sendAttachment(n,r){return this.sendAttachments([n],r)}toggleMicrophone(n){return this.setMicrophoneEnabled(n!==!1)}async setMicrophoneEnabled(n){var r,i;try{const s=(r=this.room)==null?void 0:r.localParticipant.isMicrophoneEnabled,o=n??!s;await((i=this.room)==null?void 0:i.localParticipant.setMicrophoneEnabled(o)),o?this.emit("track.unmuted",{source:"microphone",enabled:!0}):this.emit("track.muted",{source:"microphone",enabled:!1})}catch(s){throw console.error("VoxketClient: Failed to toggle microphone:",s),new Ve("Failed to toggle microphone","PERMISSION_DENIED",s)}}toggleCamera(n){return this.setCameraEnabled(n!==!1)}async setCameraEnabled(n){var r,i;try{const s=(r=this.room)==null?void 0:r.localParticipant.isCameraEnabled,o=n??!s;await((i=this.room)==null?void 0:i.localParticipant.setCameraEnabled(o)),o?this.emit("track.unmuted",{source:"camera",enabled:!0}):this.emit("track.muted",{source:"camera",enabled:!1})}catch(s){throw console.error("VoxketClient: Failed to toggle camera:",s),new Ve("Failed to toggle camera","PERMISSION_DENIED",s)}}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)),this.emit("track.unmuted",{source:"screenShare",enabled:!0})}catch(r){throw new Ve("Failed to start screen share","PERMISSION_DENIED",r)}}async stopScreenShare(){var n;try{await((n=this.room)==null?void 0:n.localParticipant.setScreenShareEnabled(!1)),this.emit("track.muted",{source:"screenShare",enabled:!1})}catch(r){throw new Ve("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 Ve("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 Ve("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(i){throw new Ve("Failed to set audio input device","DEVICE_ERROR",i)}}async setVideoInputDevice(n){var r;try{if(!((r=this.room)!=null&&r.localParticipant))throw new Error("Not connected to room")}catch(i){throw new Ve("Failed to set video input device","DEVICE_ERROR",i)}}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 i=s=>!!r.canPublish&&(r.canPublishSources.length===0||r.canPublishSources.includes(s));return{camera:i(1),microphone:i(2),screenShare:i(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===te.ConnectionState.Connected}getMicrophoneTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===te.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===te.Track.Source.Camera)return r.track;return null}getScreenShareTrack(){const n=this.getLocalParticipant();if(!n)return console.log("🎬 VoxketClient: getScreenShareTrack - no local participant"),null;for(const[,r]of n.trackPublications)if(r.source===te.Track.Source.ScreenShare)return console.log("🎬 VoxketClient: getScreenShareTrack - found screen share track:",{trackSid:r.trackSid,isMuted:r.isMuted,hasTrack:!!r.track}),r.track;return console.log("🎬 VoxketClient: getScreenShareTrack - no screen share track found"),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(),r=n?!n.isMuted:!1;return console.log("🎬 VoxketClient: isScreenShareEnabled check:",{hasTrack:!!n,trackMuted:n==null?void 0:n.isMuted,enabled:r}),r}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 Ve("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 Ve("Failed to stop recording","RECORDING_ERROR",r)}}async registerFrontendRPC(n,r,i="embedded"){return this.rpcManager.registerFrontendRPC(n,r,i)}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 i=>{try{const s=await i.readAll();r(s)}catch(s){console.error(`Error processing event for topic '${n}':`,s)}})}catch(i){console.warn(`VoxketClient: Handler for topic '${n}' may already be registered:`,i)}}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()}}const zE=ge.create(Mh),HE=ge.create(ME),UE=ge.create(VE),WE=ge.create(Dm);function ZE({theme:e,mode:t,loadingText:n}){const r=tt(e),i=()=>{switch(t){case"voice":return n||"Connecting to voice agent...";case"chat":return n||"Starting chat session...";case"video":return n||"Connecting to video call...";default:return n||"Connecting..."}};return f.jsxs("div",{className:"flex flex-col items-center justify-center h-full w-full p-8",children:[f.jsxs("div",{className:"text-center",children:[f.jsx("h3",{className:`text-lg font-semibold mb-2 ${r.text.accent}`,children:i()}),f.jsx("p",{className:`text-sm ${r.text.muted}`,children:"Please wait a moment..."})]}),f.jsxs("div",{className:"flex space-x-1 mt-4",children:[f.jsx("div",{className:"w-2 h-2 rounded-full animate-bounce bg-blue-500",style:{animationDelay:"0ms"}}),f.jsx("div",{className:"w-2 h-2 rounded-full animate-bounce bg-blue-500",style:{animationDelay:"150ms"}}),f.jsx("div",{className:"w-2 h-2 rounded-full animate-bounce bg-blue-500",style:{animationDelay:"300ms"}})]})]})}const qE=ge.create(ZE);function GE({onClick:e,text:t="Open Chat",position:n="bottom-right",theme:r}){const i={"top-left":"top-4 left-4","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4"},s=tt(r);return f.jsx(ge.button,{onClick:e,className:`voxket-popup-trigger fixed ${i[n]} z-50 px-4 py-2 rounded-full shadow-lg ${s.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},"data-position":n,children:t})}function nd({children:e,theme:t,displayType:n="widget",onClose:r,popupPosition:i="bottom-right",onExpand:s}){const o=tt(t);if(n==="fullscreen")return f.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:f.jsxs("div",{className:"w-full h-full max-w-7xl max-h-[95vh] rounded-2xl relative bg-transparent flex flex-col",onClick:a=>{a.stopPropagation()},children:[r&&f.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:f.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:f.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"})})}),f.jsxs("div",{id:"voice-card",className:`voxket-widget-root theme-${t} ${o.card} w-full h-full flex flex-col rounded-xl shadow-2xl relative overflow-hidden`,"data-theme":t,style:{minHeight:"600px",height:"100%",contain:"layout style paint",overscrollBehavior:"contain"},children:[f.jsx("div",{className:o.cardTopGradient}),f.jsx("div",{className:o.cardPurpleBlur}),f.jsx("div",{className:o.cardPinkBlur}),f.jsx("div",{className:"relative z-10 flex flex-col h-full",children:e}),f.jsx("div",{className:o.cardPulse1}),f.jsx("div",{className:o.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 f.jsx("div",{className:"fixed rounded-2xl inset-0 z-[9999] pointer-events-none",children:f.jsxs("div",{className:`fixed rounded-2xl ${a[i]} pointer-events-auto`,children:[r&&f.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:"×"}),f.jsxs("div",{id:"voice-card",className:`voxket-widget-root theme-${t} ${o.card} rounded-2xl flex flex-col relative overflow-hidden`,"data-theme":t,style:{width:"350px",height:"500px",contain:"layout style paint",overscrollBehavior:"contain"},children:[f.jsx("div",{className:o.cardTopGradient}),f.jsx("div",{className:o.cardPurpleBlur}),f.jsx("div",{className:o.cardPinkBlur}),f.jsx("div",{className:"relative z-10 flex flex-col h-full w-full",children:e}),f.jsx("div",{className:o.cardPulse1}),f.jsx("div",{className:o.cardPulse2,style:{animationDelay:"1s"}})]})]})})}return f.jsxs("div",{id:"voice-card",className:`voxket-widget-root theme-${t} ${o.card} relative overflow-hidden`,"data-theme":t,style:{height:"100%",maxHeight:"100%",contain:"layout style paint",overscrollBehavior:"contain"},children:[f.jsx("div",{className:o.cardTopGradient}),f.jsx("div",{className:o.cardPurpleBlur}),f.jsx("div",{className:o.cardPinkBlur}),f.jsx("div",{className:"relative z-10 flex flex-col h-full",children:e}),f.jsx("div",{className:o.cardPulse1}),f.jsx("div",{className:o.cardPulse2,style:{animationDelay:"1s"}})]})}function KE(e){if(typeof window>"u")return null;const{agentId:t,participantName:n,baseUrl:r,appSecret:i,appId:s,prompts:o,statusMessage:a,welcomeTitle:l,welcomeSubTitle:c,className:u,width:d,height:h,loadingText:m,suportsChatInput:g=!0,suportsVideoInput:p=!0,suportsScreenShare:b=!0,theme:v="vox",onSessionStart:k,onSessionEnd:S,enableSessionLogging:A=!0,onSessionLogsUpdate:T,onSessionMetricsUpdate:C,modalities:N=["voice"],displayType:P="widget",popupPosition:L="bottom-right",popupTriggerText:y="Open Chat",onPopupToggle:M,voxketClient:D,onDisplayTypeChange:B}=e,[H,Y]=x.useState(!1),[de,ie]=x.useState(null),[F,W]=x.useState(()=>{try{if(D)return!!D.getCurrentSession()}catch(K){console.error("Error checking existing session:",K)}return!1}),[w,z]=x.useState(!1),[oe,E]=x.useState(t||""),[U,se]=x.useState(n||"User"),[$,ee]=x.useState(()=>{try{if(D)return D.getCurrentSession()}catch(K){console.error("Error getting current session:",K)}return null}),[Q,V]=x.useState(()=>{var K,be,Ce;try{if(D){const je=D.getCurrentSession();if((K=je==null?void 0:je.activeModalities)!=null&&K.includes("chat"))return"chat";if((be=je==null?void 0:je.activeModalities)!=null&&be.includes("voice"))return"voice";if((Ce=je==null?void 0:je.activeModalities)!=null&&Ce.includes("video"))return"video"}}catch(je){console.error("Error determining current mode:",je)}return"welcome"}),[G,fe]=x.useState(!1);x.useEffect(()=>{P==="fullscreen"&&console.log("🎯 Widget: Switched to fullscreen mode")},[P]),x.useEffect(()=>{F&&!w?console.log("📊 Session started:",{currentMode:Q,sessionId:$==null?void 0:$.id}):!F&&!w&&Q==="welcome"&&console.log("📊 Returned to welcome screen")},[F,Q,w]);const R=x.useMemo(()=>{try{if(D)return console.log("🔄 Using existing VoxketClient to preserve session state"),D;if(!s||!i||!r){const be=`Missing required props: ${s?"":"appId "}${i?"":"appSecret "}${r?"":"baseUrl"}`;return console.error("❌ VoxketClient creation failed:",be),ie(new Error(be)),Y(!0),null}const K={appId:s,appSecret:i,baseUrl:r,agentId:oe,participantName:U||"User",modalities:N};return console.log("🔧 Creating new VoxketClient with config:",{appId:s.substring(0,8)+"...",baseUrl:r,agentId:oe,participantName:U||"User",modalities:N}),new zr(K)}catch(K){return console.error("❌ Failed to create VoxketClient:",K),ie(K),Y(!0),null}},[D,s,i,r,oe,U,N]),re=N,ne=x.useMemo(()=>{try{if(!R)return console.warn("⚠️ No VoxketClient available, creating fallback room"),new te.Room;const K=R.getRoom();return console.log("🏠 Widget: Room reference updated:",{roomExists:!!K,roomState:K==null?void 0:K.state,sessionStarted:F,currentMode:Q}),K||new te.Room}catch(K){return console.error("❌ Error getting room from client:",K),new te.Room}},[R,F,Q]);x.useEffect(()=>{if(ne){const K=()=>{console.log("🏠 Widget: Room state changed:",{state:ne.state,numParticipants:ne.numParticipants,isConnected:ne.state==="connected",sessionId:$==null?void 0:$.id})},be=(Ce,je,$e)=>{console.log("🎵 Widget: Track subscribed:",{trackKind:Ce.kind,trackSource:Ce.source,participantSid:$e.sid,participantIdentity:$e.identity,sessionId:$==null?void 0:$.id})};return ne.on(te.RoomEvent.Connected,K),ne.on(te.RoomEvent.Disconnected,K),ne.on(te.RoomEvent.TrackSubscribed,be),()=>{ne.off(te.RoomEvent.Connected,K),ne.off(te.RoomEvent.Disconnected,K),ne.off(te.RoomEvent.TrackSubscribed,be)}}},[ne,$==null?void 0:$.id]),x.useEffect(()=>{!w&&Q==="welcome"?console.log("🎬 Widget: Welcome screen ready"):F&&Q!=="welcome"&&console.log("🎬 Widget: Session mode active:",Q)},[Q,w,F]);const me={suportsChatInput:g,suportsVideoInput:p,suportsScreenShare:b};x.useEffect(()=>{(Q==="voice"||Q==="video"||Q==="chat")&&!$&&!F&&!w&&R&&!R.connected&&(console.log("🔄 Auto-correcting: Found orphaned mode without session, returning to welcome"),V("welcome"),z(!1))},[Q,$,F,w,R]);const{sessionMetrics:Z,sessionLogs:pe,logEvent:Ae}=Fm({room:ne,onSessionStart:k,onSessionEnd:S,enableConsoleLogging:A,enableLocalStorage:A,voxketSessionId:$==null?void 0:$.id});x.useEffect(()=>{T&&T(pe)},[pe,T]),x.useEffect(()=>{C&&Z&&C(Z)},[Z,C]),x.useEffect(()=>{if(!R)return;const K=()=>{const be=R.connected,Ce=R.getCurrentSession();console.log("🔗 Connection state changed:",{isConnected:be,currentSessionId:Ce==null?void 0:Ce.id,currentMode:Q,loading:w,sessionStarted:F}),!be&&F&&!w&&(console.log("🔴 Connection lost during active session - returning to welcome"),z(!1),W(!1),ee(null),V("welcome")),be&&Ce&&w&&(console.log("🟢 Connected with active session - removing loader"),z(!1),W(!0),ee(Ce))};return R.on("connectionStateChanged",K),R.on("sessionEnded",()=>{console.log("📞 Session ended - returning to welcome"),z(!1),W(!1),ee(null),V("welcome")}),()=>{R.off("connectionStateChanged",K),R.off("sessionEnded",()=>{})}},[R,Q,w,F]),x.useEffect(()=>{const K=Ce=>{console.log("🔴 Widget: Room disconnected:",Ce),console.log("🔍 Widget: Current state on disconnect:",{currentMode:Q,sessionStarted:F,currentSessionId:$==null?void 0:$.id,loading:w}),z(!1),W(!1),ee(null),V("welcome"),console.log("🏠 Widget: Automatically returning to welcome screen after disconnect")},be=Ce=>{console.log("📹 Media devices error:",Ce)};return ne.on(te.RoomEvent.MediaDevicesError,be),ne.on(te.RoomEvent.Disconnected,K),()=>{ne.off(te.RoomEvent.Disconnected,K),ne.off(te.RoomEvent.MediaDevicesError,be)}},[ne,Q,F,$==null?void 0:$.id,w]);const xe=async()=>{try{if(!R){console.error("❌ VoxketClient not available"),ie(new Error("VoxketClient not initialized")),Y(!0);return}z(!0),V("voice"),console.log("🎤 Starting voice session...",{agentId:oe,participantName:U}),console.log("🎤 Pre-start state:",{currentMode:"voice",sessionStarted:!1,loading:!0}),Ae("USER_STARTED_VOICE_SESSION",{agentId:oe,participantName:U});const K=await R.startSession(oe,{participantName:U||"User",modalities:["voice",...p?["video"]:[]]});console.log("✅ Voice session started successfully:",K.id),ee(K),W(!0),z(!1),k&&k(K.id)}catch(K){console.error("❌ Failed to start voice session:",K),z(!1),W(!1),V("welcome")}},Ne=async()=>{try{if(!R){console.error("❌ VoxketClient not available"),ie(new Error("VoxketClient not initialized")),Y(!0);return}z(!0),V("chat"),console.log("💬 Starting chat session...",{agentId:oe,participantName:U}),Ae("USER_STARTED_CHAT_SESSION",{agentId:oe,participantName:U});const K=await R.startSession(oe,{participantName:U||"User",modalities:["chat"]});console.log("✅ Chat session started successfully:",K.id),ee(K),W(!0),z(!1),k&&k(K.id)}catch(K){console.error("❌ Failed to start chat session:",K),z(!1),W(!1),V("welcome")}},ze=async()=>{try{if(!R){console.error("❌ VoxketClient not available"),ie(new Error("VoxketClient not initialized")),Y(!0);return}z(!0),V("video"),console.log("📺 Starting video session...",{agentId:oe,participantName:U}),console.log("📺 Pre-start state:",{currentMode:"video",sessionStarted:!1,loading:!0}),Ae("USER_STARTED_VIDEO_SESSION",{agentId:oe,participantName:U});const K=await R.startSession(oe,{participantName:U||"User",modalities:["video","voice"]});console.log("✅ Video session started successfully:",K.id),ee(K),W(!0),z(!1),k&&k(K.id)}catch(K){console.error("❌ Failed to start video session:",K),z(!1),W(!1),V("welcome")}},He=()=>{console.log("🔄 Widget: handleBackToWelcome called",{currentMode:Q,sessionStarted:F,currentSessionId:$==null?void 0:$.id,displayType:P,loading:w}),V("welcome"),z(!1),B&&B(e.displayType||"widget"),$&&F?(console.log("🧹 Widget: Cleaning up active session"),W(!1),ee(null),R&&(console.log("🔌 Widget: Disconnecting client and cleaning up room"),R.disconnect().catch(K=>{console.error("❌ Widget: Error during disconnect:",K)}))):(console.log("📝 Widget: No active session to clean up"),R&&R.connected&&(console.log("🔌 Widget: Force disconnecting client for fresh state"),R.disconnect().catch(K=>{console.error("❌ Widget: Error during force disconnect:",K)}))),P==="popup"&&!G&&fe(!0),console.log("✅ Widget: handleBackToWelcome completed",{newCurrentMode:"welcome",newLoading:!1,newSessionStarted:!1})},rt=()=>{const K=!G;fe(K),M&&M(K),!K&&!($&&F)&&(V("welcome"),W(!1),ee(null))},Gt=()=>{console.log("🔄 Closing fullscreen, switching to widget display type"),e.onDisplayTypeChange?e.onDisplayTypeChange("widget"):console.warn("⚠️ No onDisplayTypeChange callback provided")},Lt=()=>{if(console.log("🔄 Expand to fullscreen requested"),e.onDisplayTypeChange)e.onDisplayTypeChange("fullscreen");else{console.warn("⚠️ No onDisplayTypeChange callback provided for expand functionality");const K=B1("voice-card")||th(".voxket-widget-container");K&&"requestFullscreen"in K&&K.requestFullscreen().catch(be=>{console.warn("⚠️ Fullscreen API not supported or failed:",be)})}};x.useEffect(()=>{var K,be,Ce;if(D&&R){const je=R.getCurrentSession();R.connected,je&&(console.log("✅ Restoring session state:",je.id),ee(je),W(!0),z(!1),(K=je.activeModalities)!=null&&K.includes("chat")?V("chat"):(be=je.activeModalities)!=null&&be.includes("voice")?V("voice"):(Ce=je.activeModalities)!=null&&Ce.includes("video")&&V("video"))}},[D,R]),x.useEffect(()=>()=>{!D&&R&&R.disconnect()},[R,D]);let _=Q==="video"?"w-[32rem]":"w-96",I=Q==="video"?"h-[30rem]":"h-[25rem]",q={};if(d&&(d.startsWith("w-")?_=d:(q.width=d,_="")),h&&(h.startsWith("h-")?I=h:(q.height=h,I="")),P==="popup"&&!G)return console.log("🟡 Showing popup trigger button"),f.jsx(GE,{onClick:rt,text:y,position:L,theme:v});if(H||!R){const K=(de==null?void 0:de.message)||"VoxketWidget encountered an error. Please check your configuration.";return f.jsx("div",{className:`voxket-widget-root theme-${v} flex items-center justify-center p-8 ${u||""}`,style:{width:d||"400px",height:h||"500px",border:"1px solid #ff4444",borderRadius:"8px",background:"#fff5f5",color:"#cc0000"},children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"text-4xl mb-4",children:"⚠️"}),f.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Widget Error"}),f.jsx("p",{className:"text-sm mb-4",children:K}),f.jsx("button",{onClick:()=>{Y(!1),ie(null),zt==null||zt.location.reload()},className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors",children:"Retry"})]})})}let ue=`voxket-widget-root theme-${v}`,J={scrollMargin:0,scrollPadding:0,contain:"layout style paint"};P==="widget"?(ue+=` flex items-center justify-center min-h-fit ${_} ${I} ${u}`,J={...J,...q}):(ue=`${u||""}`,J={});const ke=f.jsx("div",{className:"h-full flex flex-col overflow-hidden relative z-10",children:f.jsxs(en,{mode:"wait",children:[Q==="welcome"&&!w&&f.jsx(WE,{agentId:oe,participantName:U||"",onAgentIdChange:E,onParticipantNameChange:se,onStartCall:xe,onStartChat:Ne,onStartVideo:ze,disabled:F||w,prompts:o,statusMessage:a,title:l,subTitle:c,theme:v,modalities:re,initial:{opacity:0,y:0},animate:{opacity:1,y:0},exit:{opacity:0,y:40},transition:{duration:.3,ease:"easeInOut"}},"welcome"),w&&(Q==="voice"||Q==="chat"||Q==="video")&&f.jsx(qE,{theme:v,mode:Q,loadingText:m,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.3,ease:"easeInOut"}},`loading-${Q}`),Q==="voice"&&!w&&F&&R&&f.jsxs(dt.RoomContext.Provider,{value:ne,children:[f.jsx(dt.RoomAudioRenderer,{},`audio-${($==null?void 0:$.id)||"no-session"}`),f.jsx(dt.StartAudio,{label:"Start Audio"},`start-audio-${($==null?void 0:$.id)||"no-session"}`),f.jsx(zE,{loadingText:m,participantName:U||"User",capabilities:me,sessionStarted:F,disabled:!1,theme:v,client:R,displayType:P,onBack:P==="popup"?rt:He,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"voice-session")]}),Q==="chat"&&!w&&F&&R&&f.jsx(HE,{client:R,theme:v,displayType:P,onBack:P==="popup"?rt:He,onEndChat:He,disabled:!1,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"chat-view"),Q==="video"&&!w&&F&&R&&f.jsxs(dt.RoomContext.Provider,{value:ne,children:[f.jsx(dt.RoomAudioRenderer,{},`audio-video-${($==null?void 0:$.id)||"no-session"}`),f.jsx(dt.StartAudio,{label:"Start Audio"},`start-audio-video-${($==null?void 0:$.id)||"no-session"}`),f.jsx(UE,{client:R,theme:v,displayType:P,onBack:P==="popup"?rt:He,onEndCall:He,disabled:!1,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"video-session")]})]})});return P==="fullscreen"||P==="popup"?f.jsx(nd,{theme:v,displayType:P,popupPosition:L,onClose:P==="fullscreen"?Gt:rt,children:ke}):f.jsx("div",{className:ue,style:J,children:f.jsx(nd,{theme:v,displayType:P,popupPosition:L,onExpand:Lt,children:ke})})}function hi(e){return f.jsx(Ya,{children:f.jsx(KE,{...e})})}function YE({logs:e,onClear:t,onExport:n}){const[r,i]=j.useState(!1),[s,o]=j.useState(""),a=e.filter(l=>!s||l.event.toLowerCase().includes(s.toLowerCase()));return r?f.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:f.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-4xl w-full max-h-[80vh] flex flex-col m-4",children:[f.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[f.jsxs("h2",{className:"text-lg font-semibold",children:["Session Logs (",e.length,")"]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{type:"text",placeholder:"Filter events...",value:s,onChange:l=>o(l.target.value),className:"px-3 py-1 border rounded text-sm"}),f.jsx("button",{onClick:t,className:"px-3 py-1 bg-red-600 text-white rounded text-sm hover:bg-red-700",children:"Clear"}),f.jsx("button",{onClick:n,className:"px-3 py-1 bg-green-600 text-white rounded text-sm hover:bg-green-700",children:"Export"}),f.jsx("button",{onClick:()=>i(!1),className:"px-3 py-1 bg-gray-600 text-white rounded text-sm hover:bg-gray-700",children:"Close"})]})]}),f.jsx("div",{className:"flex-1 overflow-auto p-4",children:a.length===0?f.jsx("p",{className:"text-gray-500 text-center py-8",children:"No logs found"}):f.jsx("div",{className:"space-y-2",children:a.map((l,c)=>f.jsxs("div",{className:"border rounded p-3 text-sm",children:[f.jsxs("div",{className:"flex items-center justify-between mb-1",children:[f.jsx("span",{className:"font-semibold text-blue-600",children:l.event}),f.jsx("span",{className:"text-gray-500 text-xs",children:new Date(l.timestamp).toLocaleTimeString()})]}),l.sessionId&&f.jsxs("div",{className:"text-xs text-gray-600 mb-1",children:["Session: ",l.sessionId]}),l.data&&f.jsx("div",{className:"bg-gray-50 p-2 rounded text-xs",children:f.jsx("pre",{className:"whitespace-pre-wrap overflow-auto",children:JSON.stringify(l.data,null,2)})})]},c))})})]})}):f.jsxs("button",{onClick:()=>i(!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 XE({metrics:e}){return e?f.jsxs("div",{className:"bg-gray-100 p-4 rounded-lg",children:[f.jsx("h3",{className:"font-semibold mb-2",children:"Current Session"}),f.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[f.jsxs("div",{children:[f.jsx("span",{className:"text-gray-600",children:"Session ID:"}),f.jsx("div",{className:"font-mono text-xs",children:e.sessionId})]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-gray-600",children:"Start Time:"}),f.jsx("div",{children:new Date(e.startTime).toLocaleString()})]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-gray-600",children:"Messages:"}),f.jsx("div",{children:e.totalMessages})]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-gray-600",children:"Participants:"}),f.jsx("div",{children:e.participantCount})]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-gray-600",children:"Connection Issues:"}),f.jsx("div",{children:e.connectionIssues})]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-gray-600",children:"Duration:"}),f.jsxs("div",{children:[Math.round((Date.now()-new Date(e.startTime).getTime())/1e3),"s"]})]})]})]}):null}function Cn(){const{currentSession:e,sessionState:t,sessionMetrics:n,createSession:r,endSession:i}=Ft(),s=j.useCallback(async(a,l)=>await r(a,l),[r]),o=j.useCallback(async()=>await i(),[i]);return{session:e,state:t,metrics:n,isActive:e!==null&&t!=="disconnected",isConnecting:t==="connecting",isConnected:t==="connected"||t==="active",start:s,stop:o}}function $m(){const{sessionMetrics:e,currentSession:t}=Ft();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 _m(){const{setMicrophoneEnabled:e,client:t}=Ft(),[n,r]=j.useState(!1),[i,s]=j.useState(!1),o=j.useCallback(async()=>{if(!i){s(!0);try{const c=!n;await e(c),r(c)}catch(c){console.error("Failed to toggle microphone:",c)}finally{s(!1)}}},[n,i,e]),a=j.useCallback(async()=>{if(!(n||i)){s(!0);try{await e(!0),r(!0)}catch(c){console.error("Failed to enable microphone:",c)}finally{s(!1)}}},[n,i,e]),l=j.useCallback(async()=>{if(!(!n||i)){s(!0);try{await e(!1),r(!1)}catch(c){console.error("Failed to disable microphone:",c)}finally{s(!1)}}},[n,i,e]);return{isEnabled:n,isLoading:i,toggle:o,enable:a,disable:l}}function Bm(){const{setCameraEnabled:e}=Ft(),[t,n]=j.useState(!1),[r,i]=j.useState(!1),s=j.useCallback(async()=>{if(!r){i(!0);try{const l=!t;await e(l),n(l)}catch(l){console.error("Failed to toggle camera:",l)}finally{i(!1)}}},[t,r,e]),o=j.useCallback(async()=>{if(!(t||r)){i(!0);try{await e(!0),n(!0)}catch(l){console.error("Failed to enable camera:",l)}finally{i(!1)}}},[t,r,e]),a=j.useCallback(async()=>{if(!(!t||r)){i(!0);try{await e(!1),n(!1)}catch(l){console.error("Failed to disable camera:",l)}finally{i(!1)}}},[t,r,e]);return{isEnabled:t,isLoading:r,toggle:s,enable:o,disable:a}}function zm(){const{startScreenShare:e,stopScreenShare:t}=Ft(),[n,r]=j.useState(!1),[i,s]=j.useState(!1),o=j.useCallback(async()=>{if(!(n||i)){s(!0);try{await e(),r(!0)}catch(c){console.error("Failed to start screen share:",c)}finally{s(!1)}}},[n,i,e]),a=j.useCallback(async()=>{if(!(!n||i)){s(!0);try{await t(),r(!1)}catch(c){console.error("Failed to stop screen share:",c)}finally{s(!1)}}},[n,i,t]),l=j.useCallback(async()=>{n?await a():await o()},[n,o,a]);return{isSharing:n,isLoading:i,start:o,stop:a,toggle:l}}function QE(){const{client:e}=Ft(),[t,n]=j.useState({tracks:[],layout:{type:"grid",showLocalVideo:!0,aspectRatio:"16:9"},isRecording:!1}),r=j.useMemo(()=>t.tracks.find(p=>p.isLocal),[t.tracks]),i=j.useMemo(()=>t.tracks.filter(p=>!p.isLocal),[t.tracks]),s=j.useCallback(async()=>{try{r!=null&&r.isEnabled?await(e==null?void 0:e.disableCamera()):await(e==null?void 0:e.enableCamera())}catch(p){throw console.error("Failed to toggle camera:",p),p}},[e,r]),o=j.useCallback(async()=>{try{t.tracks.find(b=>b.isScreenShare)?await(e==null?void 0:e.stopScreenShare()):await(e==null?void 0:e.startScreenShare())}catch(p){throw console.error("Failed to toggle screen share:",p),p}},[e,t.tracks]),a=j.useCallback(p=>{n(b=>({...b,layout:p}))},[]),l=j.useCallback(p=>{n(b=>({...b,pinnedTrack:p}))},[]),c=j.useCallback(()=>{n(p=>({...p,pinnedTrack:void 0}))},[]),u=j.useCallback(async()=>{try{await(e==null?void 0:e.startRecording()),n(p=>({...p,isRecording:!0}))}catch(p){throw console.error("Failed to start recording:",p),p}},[e]),d=j.useCallback(async()=>{try{await(e==null?void 0:e.stopRecording()),n(p=>({...p,isRecording:!1}))}catch(p){throw console.error("Failed to stop recording:",p),p}},[e]),h=j.useCallback(p=>t.tracks.find(b=>b.id===p),[t.tracks]),m=j.useCallback(p=>t.tracks.filter(b=>b.participantId===p),[t.tracks]),g=j.useCallback(p=>p.isEnabled&&t.tracks.includes(p),[t.tracks]);return j.useEffect(()=>{if(!e)return;const p=k=>{n(S=>({...S,tracks:[...S.tracks.filter(A=>A.id!==k.id),k]}))},b=k=>{n(S=>{var A;return{...S,tracks:S.tracks.filter(T=>T.id!==k),pinnedTrack:((A=S.pinnedTrack)==null?void 0:A.id)===k?void 0:S.pinnedTrack}})},v=k=>{n(S=>({...S,tracks:S.tracks.map(A=>A.id===k.id?k:A)}))};return e.on("videoTrackAdded",p),e.on("videoTrackRemoved",b),e.on("videoTrackUpdated",v),()=>{e.off("videoTrackAdded",p),e.off("videoTrackRemoved",b),e.off("videoTrackUpdated",v)}},[e]),{tracks:t.tracks,localTrack:r,remoteTraracks:i,pinnedTrack:t.pinnedTrack,layout:t.layout,isRecording:t.isRecording,toggleCamera:s,toggleScreenShare:o,setLayout:a,pinTrack:l,unpinTrack:c,startRecording:u,stopRecording:d,getTrackById:h,getTracksByParticipant:m,isTrackActive:g}}function Xi(){const{chatMessages:e,sendChatMessage:t,currentSession:n}=Ft(),[r,i]=j.useState(!1),s=j.useCallback(async c=>{if(!(!c.trim()||r||!n)){i(!0);try{await t(c.trim())}catch(u){throw console.error("Failed to send chat message:",u),u}finally{i(!1)}}},[t,r,n]),{userMessages:o,agentMessages:a,allMessages:l}=j.useMemo(()=>{const c=e.filter(d=>d.sender.type==="participant"),u=e.filter(d=>d.sender.type==="agent");return{userMessages:c,agentMessages:u,allMessages:e}},[e]);return{messages:l,userMessages:o,agentMessages:a,messageCount:l.length,isSending:r,canSend:!!n&&!r,send:s}}function JE(){const{send:e,isSending:t,canSend:n}=Xi(),[r,i]=j.useState(""),s=j.useCallback(async()=>{if(!(!r.trim()||!n))try{await e(r),i("")}catch(a){throw a}},[r,e,n]),o=j.useCallback(a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),s())},[s]);return{value:r,setValue:i,send:s,handleKeyPress:o,isSending:t,canSend:n&&r.trim().length>0}}function Ja(){const{isConnected:e,isConnecting:t,connectionError:n,connect:r,disconnect:i}=Ft(),s=j.useCallback(async()=>{if(!(e||t))try{await r()}catch(a){throw console.error("Failed to connect:",a),a}},[r,e,t]),o=j.useCallback(async()=>{if(e)try{await i()}catch(a){throw console.error("Failed to disconnect:",a),a}},[i,e]);return{isConnected:e,isConnecting:t,isDisconnected:!e&&!t,error:n,hasError:!!n,connect:s,disconnect:o}}function Hm(){const{participants:e}=Ft();return{participants:e,count:e.length,localParticipant:e.find(t=>t.isLocal),remoteParticipants:e.filter(t=>!t.isLocal)}}const Um=j.createContext({}),Hr=()=>j.useContext(Um);function Wm({children:e,...t}){return f.jsx(Um.Provider,{value:t,children:e})}function mi({name:e,children:t,fallback:n,className:r}){return f.jsx("div",{className:`voxket-slot voxket-slot--${e} ${r||""}`,children:t||n})}function Zm(e,t={}){return Object.assign(e,t)}function qm({showMicrophoneControl:e=!0,showCameraControl:t=!0,showScreenShareControl:n=!0,showSessionActions:r=!0,customControls:i,className:s=""}){const o=Cn(),a=_m(),l=Bm(),c=zm(),u=Hr(),d=["voxket-session-controls",`voxket-session-controls--${u.variant||"default"}`,`voxket-session-controls--${u.size||"md"}`,o.isActive?"voxket-session-controls--active":"voxket-session-controls--inactive",s].filter(Boolean).join(" ");return!o.isActive&&!r?f.jsx("div",{className:d,children:f.jsx("div",{className:"voxket-controls-inactive",children:f.jsx("p",{children:"Controls available during active session"})})}):f.jsxs("div",{className:d,children:[r&&f.jsx("div",{className:"voxket-session-actions",children:o.isActive?f.jsx("button",{onClick:o.stop,className:"voxket-button voxket-button--danger",children:"End Session"}):f.jsx(eT,{})}),o.isActive&&f.jsxs("div",{className:"voxket-media-controls",children:[e&&f.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:[f.jsx("span",{className:"voxket-icon",children:"🎤"}),a.isLoading?"Loading...":a.isEnabled?"Mute":"Unmute"]}),t&&f.jsxs("button",{onClick:l.toggle,disabled:l.isLoading,className:`voxket-button voxket-button--media ${l.isEnabled?"voxket-button--active":""}`,title:l.isEnabled?"Stop camera":"Start camera",children:[f.jsx("span",{className:"voxket-icon",children:"📹"}),l.isLoading?"Loading...":l.isEnabled?"Stop Video":"Start Video"]}),n&&f.jsxs("button",{onClick:c.toggle,disabled:c.isLoading,className:`voxket-button voxket-button--media ${c.isSharing?"voxket-button--active":""}`,title:c.isSharing?"Stop screen share":"Start screen share",children:[f.jsx("span",{className:"voxket-icon",children:"🖥️"}),c.isLoading?"Loading...":c.isSharing?"Stop Share":"Share Screen"]})]}),i&&f.jsx("div",{className:"voxket-custom-controls",children:i})]})}function eT(){Cn();const[e,t]=j.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 f.jsx("button",{onClick:n,disabled:e,className:"voxket-button voxket-button--primary",children:e?"Starting...":"Start Session"})}function el({showConnectionStatus:e=!0,showSessionInfo:t=!0,showAgentInfo:n=!0,className:r=""}){const i=Cn(),s=Ja(),o=Hr(),a=["voxket-session-header",`voxket-session-header--${o.variant||"default"}`,`voxket-session-header--${o.size||"md"}`,r].filter(Boolean).join(" ");return f.jsxs("div",{className:a,children:[e&&f.jsxs("div",{className:"voxket-connection-status",children:[f.jsx("div",{className:`voxket-status-indicator ${s.isConnected?"connected":"disconnected"}`}),f.jsx("span",{className:"voxket-status-text",children:s.isConnecting?"Connecting...":s.isConnected?"Connected":"Disconnected"})]}),t&&i.session&&f.jsxs("div",{className:"voxket-session-info",children:[f.jsxs("div",{className:"voxket-session-id",children:["Session: ",i.session.id.slice(-8)]}),f.jsxs("div",{className:"voxket-session-state",children:["State: ",i.state]})]}),n&&i.session&&f.jsxs("div",{className:"voxket-agent-info",children:[f.jsxs("div",{className:"voxket-agent-id",children:["Agent: ",i.session.agentId]}),f.jsxs("div",{className:"voxket-modalities",children:["Modalities: ",i.session.activeModalities.join(", ")]})]}),s.error&&f.jsxs("div",{className:"voxket-error-message",children:["Error: ",s.error.message]})]})}function tl({showChat:e=!0,showTranscriptions:t=!1,customContent:n,className:r=""}){const i=Cn(),s=Xi(),o=Hr(),a=["voxket-session-content",`voxket-session-content--${o.variant||"default"}`,`voxket-session-content--${o.size||"md"}`,r].filter(Boolean).join(" ");return i.isActive?f.jsx("div",{className:a,children:n||f.jsxs(f.Fragment,{children:[e&&f.jsxs("div",{className:"voxket-chat-container",children:[f.jsxs("div",{className:"voxket-chat-messages",children:[s.messages.map(l=>f.jsxs("div",{className:`voxket-message voxket-message--${l.sender.type}`,children:[f.jsxs("div",{className:"voxket-message-header",children:[f.jsx("span",{className:"voxket-message-sender",children:l.sender.name}),f.jsx("span",{className:"voxket-message-time",children:l.timestamp.toLocaleTimeString()})]}),f.jsx("div",{className:"voxket-message-content",children:l.content})]},l.id)),s.messages.length===0&&f.jsx("div",{className:"voxket-empty-messages",children:f.jsx("p",{children:"No messages yet. Start the conversation!"})})]}),f.jsx(tT,{})]}),t&&f.jsx("div",{className:"voxket-transcriptions",children:f.jsx("div",{className:"voxket-transcription-placeholder",children:f.jsx("p",{children:"Voice transcriptions will appear here"})})})]})}):f.jsx("div",{className:a,children:f.jsx("div",{className:"voxket-inactive-state",children:f.jsxs("div",{className:"voxket-inactive-message",children:[f.jsx("h3",{children:"Start a conversation"}),f.jsx("p",{children:"Begin a session to start chatting with the AI agent"})]})})})}function tT(){const e=Xi(),[t,n]=j.useState(""),r=async()=>{if(!(!t.trim()||!e.canSend))try{await e.send(t),n("")}catch(s){console.error("Failed to send message:",s)}},i=s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),r())};return f.jsxs("div",{className:"voxket-chat-input",children:[f.jsx("input",{type:"text",value:t,onChange:s=>n(s.target.value),onKeyPress:i,placeholder:"Type your message...",disabled:!e.canSend,className:"voxket-input"}),f.jsx("button",{onClick:r,disabled:!e.canSend||!t.trim(),className:"voxket-send-button",children:e.isSending?"Sending...":"Send"})]})}function nl({showMetrics:e=!0,showParticipants:t=!0,showStatus:n=!0,customFooter:r,className:i=""}){const s=Cn(),o=$m(),a=Hm(),l=Hr(),c=["voxket-session-footer",`voxket-session-footer--${l.variant||"default"}`,`voxket-session-footer--${l.size||"md"}`,i].filter(Boolean).join(" ");return s.isActive?f.jsx("div",{className:c,children:r||f.jsxs(f.Fragment,{children:[n&&f.jsxs("div",{className:"voxket-session-status",children:[f.jsx("div",{className:"voxket-status-indicator voxket-status-indicator--active"}),f.jsx("span",{className:"voxket-status-text",children:"Session Active"})]}),e&&o.metrics&&f.jsxs("div",{className:"voxket-session-metrics",children:[f.jsxs("div",{className:"voxket-metric",children:[f.jsx("span",{className:"voxket-metric-label",children:"Duration:"}),f.jsx("span",{className:"voxket-metric-value",children:nT(o.duration||0)})]}),f.jsxs("div",{className:"voxket-metric",children:[f.jsx("span",{className:"voxket-metric-label",children:"Messages:"}),f.jsx("span",{className:"voxket-metric-value",children:o.metrics.messageCount})]})]}),t&&f.jsxs("div",{className:"voxket-participants-info",children:[f.jsxs("span",{className:"voxket-participants-count",children:[a.count," participant",a.count!==1?"s":""]}),a.remoteParticipants.length>0&&f.jsx("div",{className:"voxket-participant-list",children:a.remoteParticipants.map(u=>f.jsx("span",{className:"voxket-participant-name",children:u.name},u.id))})]})]})}):f.jsx("div",{className:c,children:f.jsx("div",{className:"voxket-footer-inactive",children:f.jsx("span",{className:"voxket-status-text",children:"Ready to start session"})})})}function nT(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 rT({agentId:e,sessionConfig:t,autoStart:n=!1,onSessionStart:r,onSessionEnd:i,variant:s="default",size:o="md",theme:a,className:l="",children:c}){var m;const u=Cn(),d=Ja();j.useEffect(()=>{n&&e&&d.isConnected&&!u.isActive&&u.start(e,t).catch(console.error)},[n,e,d.isConnected,u.isActive]),j.useEffect(()=>{var g;(g=u.session)!=null&&g.id&&r&&r(u.session.id)},[(m=u.session)==null?void 0:m.id,r]),j.useEffect(()=>()=>{u.isActive&&i&&u.stop().then(i).catch(console.error)},[]);const h=["voxket-session",`voxket-session--${s}`,`voxket-session--${o}`,u.isActive?"voxket-session--active":"voxket-session--inactive",l].filter(Boolean).join(" ");return f.jsx(Wm,{variant:s,size:o,theme:a,className:l,children:f.jsx("div",{className:h,children:c||f.jsxs(f.Fragment,{children:[f.jsx(mi,{name:"header",fallback:f.jsx(el,{})}),f.jsx(mi,{name:"content",fallback:f.jsx(tl,{})}),f.jsx(mi,{name:"footer",fallback:f.jsx(nl,{})})]})})})}const Gm=Zm(rT,{Header:el,Content:tl,Footer:nl,Controls:qm}),vn={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)"}},Is={...vn,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)"}},Rs={...vn,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"}},Km=j.createContext(null),Ym=()=>{const e=j.useContext(Km);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e};function iT({theme:e="default",themes:t={},children:n,cssVariables:r=!0,className:i=""}){const[s,o]=j.useState(()=>{const h={default:vn,dark:Is,enterprise:Rs,...t};return typeof e=="string"?h[e]||vn:e}),[a,l]=j.useState(()=>({default:vn,dark:Is,enterprise:Rs,...t})),c=h=>{if(typeof h=="string"){const m=a[h];m&&o(m)}else o(h)},u=h=>{l(m=>({...m,[h.name]:h}))};j.useEffect(()=>{if(r&&wi&&Xe){const h=Xe.documentElement;Object.entries(Xm(s)).forEach(([m,g])=>{h.style.setProperty(`--voxket-${m}`,g)})}},[s,r]);const d={theme:s,setTheme:c,themes:a,registerTheme:u};return f.jsx(Km.Provider,{value:d,children:f.jsx("div",{className:`voxket-theme voxket-theme--${s.name} ${i}`,children:n})})}function Xm(e){const t={},n=(r,i="")=>{for(const[s,o]of Object.entries(r)){const a=i?`${i}-${s}`:s;typeof o=="object"&&o!==null&&!Array.isArray(o)?n(o,a):t[a]=String(o)}};return n(e),t}function oT(e=vn,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 sT(e){var n;const{theme:t}=Ym();return((n=t.components)==null?void 0:n[e])||{}}const aT=Qa("voice-modality","voice",{onActivate:async e=>{const t=e.config;t.enableTranscription&&lT(e),t.enableVoiceActivation&&cT(e,t),console.log("Voice modality activated",t)},onDeactivate:async e=>{console.log("Voice modality deactivated")},onMessage:async(e,t)=>{t.type==="audio"&&uT(e,t)}});function lT(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 cT(e,t){const n=t.silenceThreshold||-50;console.log("Voice activation setup with threshold:",n)}function uT(e,t){console.log("Playing audio response:",t.content)}const dT=Qa("chat-modality","chat",{onActivate:async e=>{const t=e.config;t.enableRichText&&fT(),t.enableFileUpload&&hT(e),t.enableCustomComponents&&mT(),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"?pT(e,t):t.type==="text"&&n.enableRichText&&gT(e,t)}});function fT(e){console.log("Rich text support enabled")}function hT(e){console.log("File upload enabled"),e.on("chat.file.uploaded",t=>{console.log("File uploaded:",t.name)})}function mT(e){console.log("Custom components enabled");const t=new Map;t.set("quick-actions",yT),t.set("form",xT),t.set("card",bT),t.set("chart",vT)}function pT(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 gT(e,t){console.log("Processing rich text message:",t.content)}function yT(e){return{type:"quick-actions",actions:e.actions||[],layout:e.layout||"horizontal"}}function xT(e){return{type:"form",fields:e.fields||[],submitAction:e.submitAction,validation:e.validation}}function bT(e){return{type:"card",title:e.title,content:e.content,actions:e.actions,variant:e.variant||"default"}}function vT(e){return{type:"chart",chartType:e.chartType||"line",data:e.data,options:e.options}}function pi({track:e,participantName:t,showControls:n=!0,showName:r=!0,showMuteIndicator:i=!0,isPinned:s=!1,className:o="",onClick:a,onPin:l,onUnpin:c}){const u=j.useRef(null),[d,h]=j.useState(!1);j.useEffect(()=>{if(!u.current||!e.isEnabled)return;const b=u.current;return b.srcObject=null,()=>{b.srcObject&&(b.srcObject=null)}},[e]);const m=()=>{a==null||a(e)},g=b=>{b.stopPropagation(),s?c==null||c(e):l==null||l(e)},p=["voxket-video-tile",e.isLocal?"voxket-video-tile--local":"voxket-video-tile--remote",e.isScreenShare?"voxket-video-tile--screen-share":"voxket-video-tile--camera",s?"voxket-video-tile--pinned":"",e.isEnabled?"":"voxket-video-tile--disabled",d?"voxket-video-tile--hovered":"",o].filter(Boolean).join(" ");return f.jsxs("div",{className:p,onClick:m,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{aspectRatio:e.dimensions?`${e.dimensions.width} / ${e.dimensions.height}`:"16 / 9"},children:[f.jsx("video",{ref:u,className:"voxket-video-element",autoPlay:!0,playsInline:!0,muted:e.isLocal}),!e.isEnabled&&f.jsxs("div",{className:"voxket-video-placeholder",children:[f.jsx("div",{className:"voxket-video-placeholder-icon",children:e.isScreenShare?"🖥️":"📹"}),f.jsx("p",{className:"voxket-video-placeholder-text",children:e.isScreenShare?"Screen sharing paused":"Camera off"})]}),f.jsxs("div",{className:"voxket-video-overlay",children:[r&&t&&f.jsxs("div",{className:"voxket-video-name",children:[t,e.isLocal&&" (You)"]}),i&&!e.isEnabled&&f.jsx("div",{className:"voxket-video-mute-indicator",children:"🔇"}),n&&(d||s)&&f.jsxs("div",{className:"voxket-video-controls",children:[f.jsx("button",{className:`voxket-video-control-btn ${s?"voxket-video-control-btn--active":""}`,onClick:g,title:s?"Unpin video":"Pin video",children:"📌"}),e.isScreenShare&&f.jsx("div",{className:"voxket-video-indicator",children:"🖥️"}),e.source&&f.jsx("div",{className:"voxket-video-source",children:e.source})]})]}),!e.isEnabled&&f.jsx("div",{className:"voxket-video-loading",children:f.jsx("div",{className:"voxket-spinner"})})]})}function wT({tracks:e,layout:t,className:n="",onLayoutChange:r,onTrackClick:i,maxVisibleTracks:s=9,showPagination:o=!0}){const[a,l]=j.useState(0),[c,u]=j.useState(null),d=j.useMemo(()=>{let k=[...e];t.type==="speaker"&&c&&(k=[c,...e.filter(T=>T.id!==c.id)]);const S=a*s,A=S+s;return k.slice(S,A)},[e,t,c,a,s]),h=Math.ceil(e.length/s),m=j.useMemo(()=>{const k=d.length;switch(t.type){case"grid":const S=Math.ceil(Math.sqrt(k)),A=Math.ceil(k/S);return{display:"grid",gridTemplateColumns:`repeat(${S}, 1fr)`,gridTemplateRows:`repeat(${A}, 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,d.length]),g=k=>{u(k)},p=()=>{u(null)},b=k=>{r==null||r({...t,type:k})},v=["voxket-video-grid",`voxket-video-grid--${t.type}`,`voxket-video-grid--${d.length}-tracks`,n].filter(Boolean).join(" ");return e.length===0?f.jsx("div",{className:"voxket-video-grid-empty",children:f.jsxs("div",{className:"voxket-video-grid-empty-content",children:[f.jsx("div",{className:"voxket-video-grid-empty-icon",children:"📹"}),f.jsx("p",{children:"No video tracks available"})]})}):f.jsxs("div",{className:v,children:[f.jsxs("div",{className:"voxket-video-grid-controls",children:[f.jsx("div",{className:"voxket-video-layout-controls",children:["grid","speaker","sidebar","gallery"].map(k=>f.jsx("button",{className:`voxket-layout-btn ${t.type===k?"voxket-layout-btn--active":""}`,onClick:()=>b(k),title:`Switch to ${k} layout`,children:kT(k)},k))}),f.jsxs("div",{className:"voxket-video-count",children:[e.length," participant",e.length!==1?"s":""]})]}),f.jsx("div",{className:"voxket-video-grid-content",style:m,children:t.type==="speaker"&&c?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"voxket-video-speaker-main",children:f.jsx(pi,{track:c,participantName:`Participant ${c.participantId}`,isPinned:!0,onClick:i,onUnpin:p})}),f.jsx("div",{className:"voxket-video-speaker-sidebar",children:d.filter(k=>k.id!==c.id).map(k=>f.jsx(pi,{track:k,participantName:`Participant ${k.participantId}`,showControls:!1,onClick:i,onPin:g},k.id))})]}):d.map(k=>f.jsx(pi,{track:k,participantName:`Participant ${k.participantId}`,isPinned:(c==null?void 0:c.id)===k.id,onClick:i,onPin:g,onUnpin:p},k.id))}),o&&h>1&&f.jsxs("div",{className:"voxket-video-pagination",children:[f.jsx("button",{className:"voxket-pagination-btn",onClick:()=>l(Math.max(0,a-1)),disabled:a===0,children:"←"}),f.jsxs("span",{className:"voxket-pagination-info",children:["Page ",a+1," of ",h]}),f.jsx("button",{className:"voxket-pagination-btn",onClick:()=>l(Math.min(h-1,a+1)),disabled:a===h-1,children:"→"})]})]})}function kT(e){switch(e){case"grid":return"⊞";case"speaker":return"🎤";case"sidebar":return"⫸";case"gallery":return"⊡";case"picture-in-picture":return"⧉";default:return"⊞"}}function ST({localTrack:e,onToggleCamera:t,onToggleScreenShare:n,onLayoutChange:r,showLayoutControls:i=!0,showCameraControls:s=!0,showScreenShareControls:o=!0,className:a=""}){const l=["voxket-video-controls",a].filter(Boolean).join(" "),c=u=>{r==null||r({type:u,showLocalVideo:!0,aspectRatio:"16:9"})};return f.jsxs("div",{className:l,children:[s&&f.jsxs("div",{className:"voxket-video-controls-section",children:[f.jsx("h4",{className:"voxket-video-controls-title",children:"Camera"}),f.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:[f.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isEnabled?"📹":"📷"}),f.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isEnabled?"Camera On":"Camera Off"})]}),(e==null?void 0:e.dimensions)&&f.jsxs("div",{className:"voxket-video-info",children:[e.dimensions.width," × ",e.dimensions.height]})]}),o&&f.jsxs("div",{className:"voxket-video-controls-section",children:[f.jsx("h4",{className:"voxket-video-controls-title",children:"Screen Share"}),f.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:[f.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isScreenShare?"🛑":"🖥️"}),f.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isScreenShare?"Stop Sharing":"Share Screen"})]})]}),i&&f.jsxs("div",{className:"voxket-video-controls-section",children:[f.jsx("h4",{className:"voxket-video-controls-title",children:"Layout"}),f.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:d,label:h})=>f.jsxs("button",{className:"voxket-layout-control-btn",onClick:()=>c(u),title:`Switch to ${h} layout`,children:[f.jsx("span",{className:"voxket-control-icon",children:d}),f.jsx("span",{className:"voxket-control-label",children:h})]},u))})]}),f.jsxs("div",{className:"voxket-video-controls-section",children:[f.jsx("h4",{className:"voxket-video-controls-title",children:"Video Settings"}),f.jsxs("div",{className:"voxket-video-settings",children:[f.jsxs("div",{className:"voxket-setting-group",children:[f.jsx("label",{className:"voxket-setting-label",children:"Quality"}),f.jsxs("select",{className:"voxket-setting-select",children:[f.jsx("option",{value:"high",children:"High (720p)"}),f.jsx("option",{value:"medium",children:"Medium (480p)"}),f.jsx("option",{value:"low",children:"Low (240p)"})]})]}),f.jsxs("div",{className:"voxket-setting-group",children:[f.jsx("label",{className:"voxket-setting-label",children:"Frame Rate"}),f.jsxs("select",{className:"voxket-setting-select",children:[f.jsx("option",{value:"30",children:"30 fps"}),f.jsx("option",{value:"15",children:"15 fps"}),f.jsx("option",{value:"10",children:"10 fps"})]})]}),f.jsxs("div",{className:"voxket-setting-group",children:[f.jsx("label",{className:"voxket-setting-label",children:"Bandwidth"}),f.jsxs("select",{className:"voxket-setting-select",children:[f.jsx("option",{value:"unlimited",children:"Unlimited"}),f.jsx("option",{value:"1000",children:"1 Mbps"}),f.jsx("option",{value:"500",children:"500 Kbps"}),f.jsx("option",{value:"250",children:"250 Kbps"})]})]})]})]}),f.jsxs("div",{className:"voxket-video-controls-section",children:[f.jsx("h4",{className:"voxket-video-controls-title",children:"Statistics"}),f.jsxs("div",{className:"voxket-video-stats",children:[f.jsxs("div",{className:"voxket-stat-item",children:[f.jsx("span",{className:"voxket-stat-label",children:"Resolution:"}),f.jsx("span",{className:"voxket-stat-value",children:e!=null&&e.dimensions?`${e.dimensions.width}×${e.dimensions.height}`:"N/A"})]}),f.jsxs("div",{className:"voxket-stat-item",children:[f.jsx("span",{className:"voxket-stat-label",children:"Source:"}),f.jsx("span",{className:"voxket-stat-value",children:(e==null?void 0:e.source)||"None"})]}),f.jsxs("div",{className:"voxket-stat-item",children:[f.jsx("span",{className:"voxket-stat-label",children:"Status:"}),f.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 Qm=({handler:e,loadData:t,data:n,client:r,addLocalMessage:i})=>{const[s,o]=x.useState(null),[a,l]=x.useState(!0),[c,u]=x.useState(!1),[d]=x.useState(Date.now());x.useEffect(()=>{(async()=>{try{if(l(!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"};o(b),console.log("📋 AssignmentView: Assignment loaded from RPC data:",b)}}catch(b){console.error("📋 AssignmentView: Error loading assignment:",b),o({title:"Assignment Loading Error",description:"There was an error loading the assignment details. Please try again.",estimated_time_of_completion:"Unknown"})}finally{l(!1)}})()},[n,t]);const h=({message:p,assignment:b})=>{const v=p.toLowerCase().includes("declined"),k=v?"bg-red-50 border-red-200":"bg-green-50 border-green-200",S=v?"text-red-700":"text-green-700",A=v?"❌":"🎉";return f.jsxs("div",{className:`max-w-sm mx-auto ${k} border rounded-lg shadow p-3 flex flex-col items-center`,children:[f.jsx("div",{className:"text-2xl mb-2",children:A}),f.jsx("div",{className:`${S} font-semibold text-sm mb-1`,children:p}),f.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:b.title}),f.jsx("div",{className:"text-xs text-gray-500",children:"Thank you for your response!"})]})},m=async()=>{if(!(!s||!e)){u(!0);try{const p={message:"accepted"};console.log("📋 AssignmentView: Assignment accepted:",p),e.didSuccess(p,f.jsx(h,{message:"Assignment accepted!",assignment:s}))}catch(p){console.error("📋 AssignmentView: Error accepting assignment:",p),e.didFail({error:"Failed to accept assignment"})}finally{u(!1)}}},g=async()=>{if(!(!s||!e)){u(!0);try{const p={message:"declined"};console.log("📋 AssignmentView: Assignment declined:",p),e.didSuccess(p,f.jsx(h,{message:"Assignment declined",assignment:s}))}catch(p){console.error("📋 AssignmentView: Error declining assignment:",p),e.didFail({error:"Failed to decline assignment"})}finally{u(!1)}}};return a?f.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:f.jsxs("div",{className:"flex items-center justify-center py-4",children:[f.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),f.jsx("span",{className:"ml-2 text-xs text-gray-600",children:"Loading assignment..."})]})}):s?f.jsxs("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg overflow-hidden",children:[f.jsx("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 text-white p-3",children:f.jsx("div",{className:"flex items-center justify-between",children:f.jsx("h3",{className:"text-xs font-semibold text-white truncate",children:s.title})})}),f.jsxs("div",{className:"p-3 text-black",children:[f.jsx("div",{className:"bg-gray-50 rounded p-2 mb-3",children:f.jsx("p",{className:"text-xs text-black leading-snug",children:s.description})}),f.jsx("div",{className:"mb-3 text-black",children:f.jsxs("div",{className:"flex items-center text-xs text-gray-600",children:[f.jsx("span",{className:"text-xs mr-1",children:"📅"}),f.jsxs("span",{children:["Est: ",s.estimated_time_of_completion]})]})}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("button",{onClick:m,disabled:c,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:c?f.jsxs("span",{className:"flex items-center justify-center",children:[f.jsx("div",{className:"animate-spin rounded-full h-2 w-2 border-b-2 border-white mr-1"}),f.jsx("span",{className:"text-xs",children:"Processing..."})]}):"Accept"}),f.jsx("button",{onClick:g,disabled:c,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"})]})]})]}):f.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:f.jsxs("div",{className:"text-center py-4",children:[f.jsx("div",{className:"text-red-600 text-sm font-semibold mb-2",children:"⚠️ Assignment Error"}),f.jsx("p",{className:"text-xs text-gray-600 mb-3",children:"Failed to load assignment details."})]})})};function CT(){const[e,t]=x.useState(null),[n,r]=x.useState([]);x.useEffect(()=>{const a=new zr({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",l=>{console.log("RPC Method Called:",l)}),a.on("rpc.interaction.completed",l=>{console.log("RPC Interaction Completed:",l)}),()=>{a.disconnect()}},[]);const i=async()=>{if(e)try{await e.registerFrontendRPC("give_assignment",Qm,"embedded");const a=e.getRegisteredRpcMethods();r(a),console.log("✅ Assignment RPC registered successfully")}catch(a){console.error("❌ Failed to register assignment RPC:",a)}},s=async()=>{if(!e)return;const a=({handler:l,timeout:c})=>{const[u,d]=x.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"}],m=p=>{d(p)},g=()=>{const p=h.find(b=>b.id===u);l==null||l.didSuccess({selectedProduct:u,productName:p==null?void 0:p.name,price:p==null?void 0:p.price,timestamp:new Date().toISOString()})};return f.jsxs("div",{className:"p-6 bg-white rounded-lg",children:[f.jsx("h3",{className:"text-xl font-bold mb-4",children:"Choose Your Plan"}),f.jsx("p",{className:"text-gray-600 mb-4",children:"Select the plan that best fits your needs:"}),f.jsx("div",{className:"space-y-3 mb-6",children:h.map(p=>f.jsx("div",{onClick:()=>m(p.id),className:`p-4 border rounded-lg cursor-pointer transition-all ${u===p.id?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-gray-300"}`,children:f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsxs("div",{children:[f.jsx("h4",{className:"font-medium",children:p.name}),f.jsx("p",{className:"text-gray-600 text-sm",children:p.price})]}),f.jsx("div",{className:`w-4 h-4 rounded-full ${u===p.id?"bg-blue-500":"border-2 border-gray-300"}`})]})},p.id))}),f.jsxs("div",{className:"flex justify-end space-x-3",children:[f.jsx("button",{onClick:()=>l==null?void 0:l.dismissView(),className:"px-4 py-2 border border-gray-300 text-gray-700 rounded hover:bg-gray-50",children:"Cancel"}),f.jsx("button",{onClick:g,disabled:!u,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50",children:"Select Plan"})]}),c&&f.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Time remaining: ",c," seconds"]})]})};try{await e.registerFrontendRPC("recommend_product",a,"modal");const l=e.getRegisteredRpcMethods();r(l),console.log("✅ Product Recommendation RPC registered successfully")}catch(l){console.error("❌ Failed to register product recommendation RPC:",l)}},o=async()=>{if(!e)return;const a=({handler:l})=>{const[c,u]=x.useState(0),[d,h]=x.useState(""),m=()=>{l==null||l.didSuccess({rating:c,comment:d,timestamp:new Date().toISOString()})};return f.jsxs("div",{className:"p-4 bg-white rounded-lg",children:[f.jsx("h3",{className:"text-lg font-semibold mb-3",children:"How was your experience?"}),f.jsxs("div",{className:"mb-4",children:[f.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Rate your experience:"}),f.jsx("div",{className:"flex space-x-1",children:[1,2,3,4,5].map(g=>f.jsx("button",{onClick:()=>u(g),className:`text-2xl ${g<=c?"text-yellow-400":"text-gray-300"}`,children:"⭐"},g))})]}),f.jsxs("div",{className:"mb-4",children:[f.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Additional comments:"}),f.jsx("textarea",{value:d,onChange:g=>h(g.target.value),className:"w-full p-2 border border-gray-300 rounded text-sm",rows:3,placeholder:"Tell us more about your experience..."})]}),f.jsxs("div",{className:"flex justify-end space-x-2",children:[f.jsx("button",{onClick:()=>l==null?void 0:l.dismissView(),className:"px-3 py-1 text-sm border border-gray-300 text-gray-700 rounded hover:bg-gray-50",children:"Skip"}),f.jsx("button",{onClick:m,disabled:c===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 l=e.getRegisteredRpcMethods();r(l),console.log("✅ Feedback RPC registered successfully")}catch(l){console.error("❌ Failed to register feedback RPC:",l)}};return f.jsxs("div",{className:"p-6",children:[f.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Frontend RPC Examples"}),f.jsxs("div",{className:"space-y-4 mb-6",children:[f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Register RPC Methods"}),f.jsxs("div",{className:"space-x-2",children:[f.jsx("button",{onClick:i,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Register Assignment RPC"}),f.jsx("button",{onClick:s,className:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600",children:"Register Product Recommendation RPC"}),f.jsx("button",{onClick:o,className:"px-4 py-2 bg-purple-500 text-white rounded hover:bg-purple-600",children:"Register Feedback RPC"})]})]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Registered Methods"}),n.length>0?f.jsx("ul",{className:"list-disc list-inside space-y-1",children:n.map(a=>f.jsx("li",{className:"text-gray-700",children:f.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:a})},a))}):f.jsx("p",{className:"text-gray-500",children:"No methods registered yet"})]})]}),f.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[f.jsx("h3",{className:"text-lg font-semibold mb-2",children:"How it works"}),f.jsxs("ol",{className:"list-decimal list-inside space-y-2 text-sm text-gray-700",children:[f.jsxs("li",{children:["Register RPC methods with React components using ",f.jsx("code",{children:"client.registerFrontendRPC()"})]}),f.jsx("li",{children:"When the agent calls an RPC method, the corresponding component will be displayed"}),f.jsx("li",{children:"Users interact with the component, and the response is sent back to the agent"}),f.jsx("li",{children:"Components can be displayed in different modes: embedded, modal, or fullscreen"}),f.jsx("li",{children:"Each component has a timeout and can handle success/failure scenarios"})]})]}),f.jsxs("div",{className:"mt-6 bg-blue-50 p-4 rounded-lg",children:[f.jsx("h3",{className:"text-lg font-semibold mb-2 text-blue-800",children:"Agent Side"}),f.jsx("p",{className:"text-sm text-blue-700 mb-2",children:"On the agent side, you can call these RPC methods like this:"}),f.jsx("pre",{className:"bg-white p-3 rounded text-xs text-gray-800 overflow-x-auto",children:`// Agent calls RPC method
164
164
  const response = await participant.performRpc({
165
165
  method: 'give_assignment',
166
166
  data: JSON.stringify({
@@ -171,4 +171,4 @@ const response = await participant.performRpc({
171
171
  })
172
172
  });
173
173
 
174
- console.log('User response:', response);`})]})]})}const oT={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}),i=JSON.parse(r);return console.log("✅ Agent: Received user response:",i),await this.processAssignmentResponse(i),i}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"}}}},sT=e=>typeof window>"u"?null:x.createElement(za,{children:x.createElement(ui,e)});exports.AssignmentView=Om;exports.CompoundProvider=Mm;exports.InteractiveComponent=Tr;exports.PluginManager=Sm;exports.RpcExamples=iT;exports.SessionContainer=Vm;exports.SessionContent=qa;exports.SessionControls=Rm;exports.SessionFooter=Ga;exports.SessionHeader=Za;exports.SessionLogViewer=NE;exports.SessionMetricsComponent=ME;exports.Slot=di;exports.ThemeProvider=OE;exports.VideoControls=rT;exports.VideoGrid=tT;exports.VideoTile=fi;exports.VoxketClient=$r;exports.VoxketErrorBoundary=za;exports.VoxketEventEmitter=Ha;exports.VoxketProvider=ci;exports.VoxketSDK=$r;exports.VoxketSessionComponent=Vm;exports.agentRpcExample=oT;exports.analyticsPlugin=xE;exports.chatModalityPlugin=WE;exports.createCustomTheme=$E;exports.createModalityPlugin=Ua;exports.createPlugin=yE;exports.darkTheme=As;exports.debugPlugin=bE;exports.default=sT;exports.defaultTheme=xn;exports.enterpriseTheme=js;exports.flattenTheme=Lm;exports.metricsPlugin=vE;exports.useComponentTheme=_E;exports.useCompoundContext=_r;exports.useSessionLogging=km;exports.useTheme=Fm;exports.useVoxket=Dt;exports.useVoxketCamera=Am;exports.useVoxketChat=Zi;exports.useVoxketChatInput=RE;exports.useVoxketConnection=Wa;exports.useVoxketMetrics=Em;exports.useVoxketMicrophone=Tm;exports.useVoxketParticipants=Pm;exports.useVoxketScreenShare=jm;exports.useVoxketSession=kn;exports.useVoxketVideo=IE;exports.voiceModalityPlugin=BE;exports.withCompoundComponent=Im;
174
+ console.log('User response:', response);`})]})]})}const ET={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}),i=JSON.parse(r);return console.log("✅ Agent: Received user response:",i),await this.processAssignmentResponse(i),i}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"}}}},TT=e=>va?x.createElement(Ya,{children:x.createElement(hi,e)}):null;exports.AssignmentView=Qm;exports.CompoundProvider=Wm;exports.InteractiveComponent=Pr;exports.PluginManager=Lm;exports.RpcExamples=CT;exports.SessionContainer=Gm;exports.SessionContent=tl;exports.SessionControls=qm;exports.SessionFooter=nl;exports.SessionHeader=el;exports.SessionLogViewer=YE;exports.SessionMetricsComponent=XE;exports.Slot=mi;exports.ThemeProvider=iT;exports.VideoControls=ST;exports.VideoGrid=wT;exports.VideoTile=pi;exports.VoxketClient=zr;exports.VoxketErrorBoundary=Ya;exports.VoxketEventEmitter=Xa;exports.VoxketProvider=fi;exports.VoxketSDK=zr;exports.VoxketSessionComponent=Gm;exports.agentRpcExample=ET;exports.analyticsPlugin=OE;exports.chatModalityPlugin=dT;exports.createCustomTheme=oT;exports.createModalityPlugin=Qa;exports.createPlugin=LE;exports.darkTheme=Is;exports.debugPlugin=$E;exports.default=TT;exports.defaultTheme=vn;exports.enterpriseTheme=Rs;exports.flattenTheme=Xm;exports.metricsPlugin=_E;exports.useComponentTheme=sT;exports.useCompoundContext=Hr;exports.useSessionLogging=Fm;exports.useTheme=Ym;exports.useVoxket=Ft;exports.useVoxketCamera=Bm;exports.useVoxketChat=Xi;exports.useVoxketChatInput=JE;exports.useVoxketConnection=Ja;exports.useVoxketMetrics=$m;exports.useVoxketMicrophone=_m;exports.useVoxketParticipants=Hm;exports.useVoxketScreenShare=zm;exports.useVoxketSession=Cn;exports.useVoxketVideo=QE;exports.voiceModalityPlugin=aT;exports.withCompoundComponent=Zm;