@voxket-ai/voxket-live 1.0.138 → 1.0.140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +50 -50
  2. package/dist/index.js +5403 -5403
  3. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -18,7 +18,7 @@
18
18
  }
19
19
  })();
20
20
 
21
- "use strict";var zg=Object.defineProperty;var Ug=(e,t,n)=>t in e?zg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var at=(e,t,n)=>Ug(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const A=require("react"),h=require("react/jsx-runtime"),ce=require("livekit-client"),$t=require("@livekit/components-react"),We=require("lucide-react"),Ba=require("clsx"),Hg=require("@emotion/styled");require("@emotion/react");const Wg=require("react-dom/client"),yf=require("react-dom");function Gg(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 P=Gg(A),ja=A.createContext({});function $a(e){const t=A.useRef(null);return t.current===null&&(t.current=e()),t.current}const Va=typeof window<"u",xf=Va?A.useLayoutEffect:A.useEffect,So=A.createContext(null);function za(e,t){e.indexOf(t)===-1&&e.push(t)}function Ua(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const xn=(e,t,n)=>n>t?t:n<e?e:n;function Zs(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Nr=()=>{},wn=()=>{};process.env.NODE_ENV!=="production"&&(Nr=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Zs(t,n))},wn=(e,t,n)=>{if(!e)throw new Error(Zs(t,n))});const vn={},wf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function vf(e){return typeof e=="object"&&e!==null}const Ef=e=>/^0[^.\s]+$/u.test(e);function Ha(e){let t;return()=>(t===void 0&&(t=e()),t)}const Qt=e=>e,Kg=(e,t)=>n=>t(e(n)),hi=(...e)=>e.reduce(Kg),ni=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Wa{constructor(){this.subscriptions=[]}add(t){return za(this.subscriptions,t),()=>Ua(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 o=0;o<i;o++){const s=this.subscriptions[o];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const nn=e=>e*1e3,un=e=>e/1e3;function kf(e,t){return t?e*(1e3/t):0}const mc=new Set;function Ga(e,t,n){e||mc.has(t)||(console.warn(Zs(t,n)),mc.add(t))}const Sf=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,qg=1e-7,Yg=12;function Zg(e,t,n,r,i){let o,s,a=0;do s=t+(n-t)/2,o=Sf(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>qg&&++a<Yg);return s}function pi(e,t,n,r){if(e===t&&n===r)return Qt;const i=o=>Zg(o,0,1,e,n);return o=>o===0||o===1?o:Sf(i(o),t,r)}const Cf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,_f=e=>t=>1-e(1-t),Tf=pi(.33,1.53,.69,.99),Ka=_f(Tf),Nf=Cf(Ka),Af=e=>(e*=2)<1?.5*Ka(e):.5*(2-Math.pow(2,-10*(e-1))),qa=e=>1-Math.sin(Math.acos(e)),Rf=_f(qa),Mf=Cf(qa),Xg=pi(.42,0,1,1),Qg=pi(0,0,.58,1),If=pi(.42,0,.58,1),Jg=e=>Array.isArray(e)&&typeof e[0]!="number",Of=e=>Array.isArray(e)&&typeof e[0]=="number",gc={linear:Qt,easeIn:Xg,easeInOut:If,easeOut:Qg,circIn:qa,circInOut:Mf,circOut:Rf,backIn:Ka,backInOut:Nf,backOut:Tf,anticipate:Af},eb=e=>typeof e=="string",bc=e=>{if(Of(e)){wn(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,i]=e;return pi(t,n,r,i)}else if(eb(e))return wn(gc[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),gc[e];return e},Ri=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function tb(e,t){let n=new Set,r=new Set,i=!1,o=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,d=!1,f=!1)=>{const g=f&&i?n:r;return d&&s.add(u),g.has(u)||g.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(a=u,i){o=!0;return}i=!0,[n,r]=[r,n],n.forEach(l),n.clear(),i=!1,o&&(o=!1,c.process(u))}};return c}const nb=40;function Pf(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=Ri.reduce((v,_)=>(v[_]=tb(o),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:f,render:p,postRender:g}=s,m=()=>{const v=vn.useManualTiming?i.timestamp:performance.now();n=!1,vn.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(v-i.timestamp,nb),1)),i.timestamp=v,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),d.process(i),f.process(i),p.process(i),g.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))},x=()=>{n=!0,r=!0,i.isProcessing||e(m)};return{schedule:Ri.reduce((v,_)=>{const S=s[_];return v[_]=(C,M=!1,N=!1)=>(n||x(),S.schedule(C,M,N)),v},{}),cancel:v=>{for(let _=0;_<Ri.length;_++)s[Ri[_]].cancel(v)},state:i,steps:s}}const{schedule:st,cancel:Mn,state:Nt,steps:es}=Pf(typeof requestAnimationFrame<"u"?requestAnimationFrame:Qt,!0);let Xi;function rb(){Xi=void 0}const Vt={now:()=>(Xi===void 0&&Vt.set(Nt.isProcessing||vn.useManualTiming?Nt.timestamp:performance.now()),Xi),set:e=>{Xi=e,queueMicrotask(rb)}},Df=e=>t=>typeof t=="string"&&t.startsWith(e),Ya=Df("--"),ib=Df("var(--"),Za=e=>ib(e)?ob.test(e.split("/*")[0].trim()):!1,ob=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ar={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ri={...Ar,transform:e=>xn(0,1,e)},Mi={...Ar,default:1},qr=e=>Math.round(e*1e5)/1e5,Xa=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function sb(e){return e==null}const ab=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Qa=(e,t)=>n=>!!(typeof n=="string"&&ab.test(n)&&n.startsWith(e)||t&&!sb(n)&&Object.prototype.hasOwnProperty.call(n,t)),Lf=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,o,s,a]=r.match(Xa);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},lb=e=>xn(0,255,e),ts={...Ar,transform:e=>Math.round(lb(e))},Un={test:Qa("rgb","red"),parse:Lf("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+ts.transform(e)+", "+ts.transform(t)+", "+ts.transform(n)+", "+qr(ri.transform(r))+")"};function cb(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 Xs={test:Qa("#"),parse:cb,transform:Un.transform},mi=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),An=mi("deg"),dn=mi("%"),Ee=mi("px"),ub=mi("vh"),db=mi("vw"),yc={...dn,parse:e=>dn.parse(e)/100,transform:e=>dn.transform(e*100)},pr={test:Qa("hsl","hue"),parse:Lf("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+dn.transform(qr(t))+", "+dn.transform(qr(n))+", "+qr(ri.transform(r))+")"},wt={test:e=>Un.test(e)||Xs.test(e)||pr.test(e),parse:e=>Un.test(e)?Un.parse(e):pr.test(e)?pr.parse(e):Xs.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Un.transform(e):pr.transform(e),getAnimatableNone:e=>{const t=wt.parse(e);return t.alpha=0,wt.transform(t)}},fb=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function hb(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Xa))==null?void 0:t.length)||0)+(((n=e.match(fb))==null?void 0:n.length)||0)>0}const Ff="number",Bf="color",pb="var",mb="var(",xc="${}",gb=/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 ii(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const a=t.replace(gb,l=>(wt.test(l)?(r.color.push(o),i.push(Bf),n.push(wt.parse(l))):l.startsWith(mb)?(r.var.push(o),i.push(pb),n.push(l)):(r.number.push(o),i.push(Ff),n.push(parseFloat(l))),++o,xc)).split(xc);return{values:n,split:a,indexes:r,types:i}}function jf(e){return ii(e).values}function $f(e){const{split:t,types:n}=ii(e),r=t.length;return i=>{let o="";for(let s=0;s<r;s++)if(o+=t[s],i[s]!==void 0){const a=n[s];a===Ff?o+=qr(i[s]):a===Bf?o+=wt.transform(i[s]):o+=i[s]}return o}}const bb=e=>typeof e=="number"?0:wt.test(e)?wt.getAnimatableNone(e):e;function yb(e){const t=jf(e);return $f(e)(t.map(bb))}const In={test:hb,parse:jf,createTransformer:$f,getAnimatableNone:yb};function ns(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 xb({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,s=0;if(!t)i=o=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=ns(l,a,e+1/3),o=ns(l,a,e),s=ns(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}function lo(e,t){return n=>n>0?t:e}const ct=(e,t,n)=>e+(t-e)*n,rs=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},wb=[Xs,Un,pr],vb=e=>wb.find(t=>t.test(e));function wc(e){const t=vb(e);if(Nr(!!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===pr&&(n=xb(n)),n}const vc=(e,t)=>{const n=wc(e),r=wc(t);if(!n||!r)return lo(e,t);const i={...n};return o=>(i.red=rs(n.red,r.red,o),i.green=rs(n.green,r.green,o),i.blue=rs(n.blue,r.blue,o),i.alpha=ct(n.alpha,r.alpha,o),Un.transform(i))},Qs=new Set(["none","hidden"]);function Eb(e,t){return Qs.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function kb(e,t){return n=>ct(e,t,n)}function Ja(e){return typeof e=="number"?kb:typeof e=="string"?Za(e)?lo:wt.test(e)?vc:_b:Array.isArray(e)?Vf:typeof e=="object"?wt.test(e)?vc:Sb:lo}function Vf(e,t){const n=[...e],r=n.length,i=e.map((o,s)=>Ja(o)(o,t[s]));return o=>{for(let s=0;s<r;s++)n[s]=i[s](o);return n}}function Sb(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Ja(e[i])(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}}function Cb(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],s=e.indexes[o][r[o]],a=e.values[s]??0;n[i]=a,r[o]++}return n}const _b=(e,t)=>{const n=In.createTransformer(t),r=ii(e),i=ii(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?Qs.has(e)&&!i.values.length||Qs.has(t)&&!r.values.length?Eb(e,t):hi(Vf(Cb(r,i),i.values),n):(Nr(!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"),lo(e,t))};function zf(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ct(e,t,n):Ja(e)(e,t)}const Tb=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>st.update(t,n),stop:()=>Mn(t),now:()=>Nt.isProcessing?Nt.timestamp:Vt.now()}},Uf=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let o=0;o<i;o++)r+=Math.round(e(o/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},co=2e4;function el(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<co;)t+=n,r=e.next(t);return t>=co?1/0:t}function Nb(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(el(r),co);return{type:"keyframes",ease:o=>r.next(i*o).value/t,duration:un(i)}}const Ab=5;function Hf(e,t,n){const r=Math.max(t-Ab,0);return kf(n-e(r),t-r)}const lt={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},is=.001;function Rb({duration:e=lt.duration,bounce:t=lt.bounce,velocity:n=lt.velocity,mass:r=lt.mass}){let i,o;Nr(e<=nn(lt.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=xn(lt.minDamping,lt.maxDamping,s),e=xn(lt.minDuration,lt.maxDuration,un(e)),s<1?(i=c=>{const u=c*s,d=u*e,f=u-n,p=Js(c,s),g=Math.exp(-d);return is-f/p*g},o=c=>{const d=c*s*e,f=d*n+n,p=Math.pow(s,2)*Math.pow(c,2)*e,g=Math.exp(-d),m=Js(Math.pow(c,2),s);return(-i(c)+is>0?-1:1)*((f-p)*g)/m}):(i=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-is+u*d},o=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=Ib(i,o,a);if(e=nn(e),isNaN(l))return{stiffness:lt.stiffness,damping:lt.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const Mb=12;function Ib(e,t,n){let r=n;for(let i=1;i<Mb;i++)r=r-e(r)/t(r);return r}function Js(e,t){return e*Math.sqrt(1-t*t)}const Ob=["duration","bounce"],Pb=["stiffness","damping","mass"];function Ec(e,t){return t.some(n=>e[n]!==void 0)}function Db(e){let t={velocity:lt.velocity,stiffness:lt.stiffness,damping:lt.damping,mass:lt.mass,isResolvedFromDuration:!1,...e};if(!Ec(e,Pb)&&Ec(e,Ob))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,o=2*xn(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:lt.mass,stiffness:i,damping:o}}else{const n=Rb(e);t={...t,...n,mass:lt.mass},t.isResolvedFromDuration=!0}return t}function uo(e=lt.visualDuration,t=lt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Db({...n,velocity:-un(n.velocity||0)}),g=f||0,m=c/(2*Math.sqrt(l*u)),x=s-o,y=un(Math.sqrt(l/u)),k=Math.abs(x)<5;r||(r=k?lt.restSpeed.granular:lt.restSpeed.default),i||(i=k?lt.restDelta.granular:lt.restDelta.default);let v;if(m<1){const S=Js(y,m);v=C=>{const M=Math.exp(-m*y*C);return s-M*((g+m*y*x)/S*Math.sin(S*C)+x*Math.cos(S*C))}}else if(m===1)v=S=>s-Math.exp(-y*S)*(x+(g+y*x)*S);else{const S=y*Math.sqrt(m*m-1);v=C=>{const M=Math.exp(-m*y*C),N=Math.min(S*C,300);return s-M*((g+m*y*x)*Math.sinh(N)+S*x*Math.cosh(N))/S}}const _={calculatedDuration:p&&d||null,next:S=>{const C=v(S);if(p)a.done=S>=d;else{let M=S===0?g:0;m<1&&(M=S===0?nn(g):Hf(v,S,C));const N=Math.abs(M)<=r,I=Math.abs(s-C)<=i;a.done=N&&I}return a.value=a.done?s:C,a},toString:()=>{const S=Math.min(el(_),co),C=Uf(M=>_.next(S*M).value,S,30);return S+"ms "+C},toTransition:()=>{}};return _}uo.applyToOptions=e=>{const t=Nb(e,100,uo);return e.ease=t.ease,e.duration=nn(t.duration),e.type="keyframes",e};function ea({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},p=N=>a!==void 0&&N<a||l!==void 0&&N>l,g=N=>a===void 0?l:l===void 0||Math.abs(a-N)<Math.abs(l-N)?a:l;let m=n*t;const x=d+m,y=s===void 0?x:s(x);y!==x&&(m=y-d);const k=N=>-m*Math.exp(-N/r),v=N=>y+k(N),_=N=>{const I=k(N),b=v(N);f.done=Math.abs(I)<=c,f.value=f.done?y:b};let S,C;const M=N=>{p(f.value)&&(S=N,C=uo({keyframes:[f.value,g(f.value)],velocity:Hf(v,N,f.value),damping:i,stiffness:o,restDelta:c,restSpeed:u}))};return M(0),{calculatedDuration:null,next:N=>{let I=!1;return!C&&S===void 0&&(I=!0,_(N),M(N)),S!==void 0&&N>=S?C.next(N-S):(!I&&_(N),f)}}}function Lb(e,t,n){const r=[],i=n||vn.mix||zf,o=e.length-1;for(let s=0;s<o;s++){let a=i(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||Qt:t;a=hi(l,a)}r.push(a)}return r}function Fb(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(wn(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Lb(t,r,i),l=a.length,c=u=>{if(s&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=ni(e[d],e[d+1],u);return a[d](f)};return n?u=>c(xn(e[0],e[o-1],u)):c}function Bb(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=ni(0,t,r);e.push(ct(n,1,i))}}function jb(e){const t=[0];return Bb(t,e.length-1),t}function $b(e,t){return e.map(n=>n*t)}function Vb(e,t){return e.map(()=>t||If).splice(0,e.length-1)}function mr({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=Jg(r)?r.map(bc):bc(r),o={done:!1,value:t[0]},s=$b(n&&n.length===t.length?n:jb(t),e),a=Fb(s,t,{ease:Array.isArray(i)?i:Vb(t,i)});return{calculatedDuration:e,next:l=>(o.value=a(l),o.done=l>=e,o)}}const zb=e=>e!==null;function tl(e,{repeat:t,repeatType:n="loop"},r,i=1){const o=e.filter(zb),a=i<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!a||r===void 0?o[a]:r}const Ub={decay:ea,inertia:ea,tween:mr,keyframes:mr,spring:uo};function Wf(e){typeof e.type=="string"&&(e.type=Ub[e.type])}class nl{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 Hb=e=>e/100;class rl extends nl{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!==Vt.now()&&this.tick(Vt.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;Wf(t);const{type:n=mr,repeat:r=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=t;let{keyframes:a}=t;const l=n||mr;process.env.NODE_ENV!=="production"&&l!==mr&&wn(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==mr&&typeof a[0]!="number"&&(this.mixKeyframes=hi(Hb,zf(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=el(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:o,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:p,type:g,onUpdate:m,finalKeyframe:x}=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 y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,_=r;if(d){const N=Math.min(this.currentTime,i)/a;let I=Math.floor(N),b=N%1;!b&&N>=1&&(b=1),b===1&&I--,I=Math.min(I,d+1),!!(I%2)&&(f==="reverse"?(b=1-b,p&&(b-=p/a)):f==="mirror"&&(_=s)),v=xn(0,1,b)*a}const S=k?{done:!1,value:u[0]}:_.next(v);o&&(S.value=o(S.value));let{done:C}=S;!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!==ea&&(S.value=tl(u,this.options,x,this.speed)),m&&m(S.value),M&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return un(this.calculatedDuration)}get time(){return un(this.currentTime)}set time(t){var n;t=nn(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(Vt.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=un(this.currentTime))}play(){var i,o;if(this.isStopped)return;const{driver:t=Tb,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),(o=(i=this.options).onPlay)==null||o.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(Vt.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 Wb(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Hn=e=>e*180/Math.PI,ta=e=>{const t=Hn(Math.atan2(e[1],e[0]));return na(t)},Gb={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ta,rotateZ:ta,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},na=e=>(e=e%360,e<0&&(e+=360),e),kc=ta,Sc=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Cc=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Kb={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Sc,scaleY:Cc,scale:e=>(Sc(e)+Cc(e))/2,rotateX:e=>na(Hn(Math.atan2(e[6],e[5]))),rotateY:e=>na(Hn(Math.atan2(-e[2],e[0]))),rotateZ:kc,rotate:kc,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 ra(e){return e.includes("scale")?1:0}function ia(e,t){if(!e||e==="none")return ra(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=Kb,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Gb,i=a}if(!i)return ra(t);const o=r[t],s=i[1].split(",").map(Yb);return typeof o=="function"?o(s):s[o]}const qb=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ia(n,t)};function Yb(e){return parseFloat(e.trim())}const Rr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Mr=new Set(Rr),_c=e=>e===Ar||e===Ee,Zb=new Set(["x","y","z"]),Xb=Rr.filter(e=>!Zb.has(e));function Qb(e){const t=[];return Xb.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Gn={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})=>ia(t,"x"),y:(e,{transform:t})=>ia(t,"y")};Gn.translateX=Gn.x;Gn.translateY=Gn.y;const Kn=new Set;let oa=!1,sa=!1,aa=!1;function Gf(){if(sa){const e=Array.from(Kn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=Qb(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(([o,s])=>{var a;(a=r.getValue(o))==null||a.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}sa=!1,oa=!1,Kn.forEach(e=>e.complete(aa)),Kn.clear()}function Kf(){Kn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(sa=!0)})}function Jb(){aa=!0,Kf(),Gf(),aa=!1}class il{constructor(t,n,r,i,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(Kn.add(this),oa||(oa=!0,st.read(Kf),st.resolveKeyframes(Gf))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const o=i==null?void 0:i.get(),s=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const a=r.readValue(n,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),i&&o===void 0&&i.set(t[0])}Wb(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Kn.delete(this)}cancel(){this.state==="scheduled"&&(Kn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ey=e=>e.startsWith("--");function ty(e,t,n){ey(t)?e.style.setProperty(t,n):e.style[t]=n}const ny=Ha(()=>window.ScrollTimeline!==void 0),ry={};function iy(e,t){const n=Ha(e);return()=>ry[t]??n()}const qf=iy(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Wr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Tc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wr([0,.65,.55,1]),circOut:Wr([.55,0,1,.45]),backIn:Wr([.31,.01,.66,-.59]),backOut:Wr([.33,1.53,.69,.99])};function Yf(e,t){if(e)return typeof e=="function"?qf()?Uf(e,t):"ease-out":Of(e)?Wr(e):Array.isArray(e)?e.map(n=>Yf(n,t)||Tc.easeOut):Tc[e]}function oy(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=Yf(a,i);Array.isArray(d)&&(u.easing=d);const f={delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),e.animate(u,f)}function Zf(e){return typeof e=="function"&&"applyToOptions"in e}function sy({type:e,...t}){return Zf(e)&&qf()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class ay extends nl{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!o,this.allowFlatten=s,this.options=t,wn(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=sy(t);this.animation=oy(n,r,i,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=tl(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):ty(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 un(Number(t))}get time(){return un(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=nn(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&&ny()?(this.animation.timeline=t,Qt):n(this)}}const Xf={anticipate:Af,backInOut:Nf,circInOut:Mf};function ly(e){return e in Xf}function cy(e){typeof e.ease=="string"&&ly(e.ease)&&(e.ease=Xf[e.ease])}const Nc=10;class uy extends ay{constructor(t){cy(t),Wf(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:o,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new rl({...s,autoplay:!1}),l=nn(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-Nc).value,a.sample(l).value,Nc),a.stop()}}const Ac=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(In.test(e)||e==="0")&&!e.startsWith("url("));function dy(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 fy(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],s=Ac(i,t),a=Ac(o,t);return Nr(s===a,`You are trying to animate ${t} from "${i}" to "${o}". "${s?o:i}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:dy(e)||(n==="spring"||Zf(n))&&r}function la(e){e.duration=0,e.type}const hy=new Set(["opacity","clipPath","filter","transform"]),py=Ha(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function my(e){var u;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:o,type:s}=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 py()&&n&&hy.has(n)&&(n!=="transform"||!c)&&!l&&!r&&i!=="mirror"&&o!==0&&s!=="inertia"}const gy=40;class by extends nl{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s="loop",keyframes:a,name:l,motionValue:c,element:u,...d}){var g;super(),this.stop=()=>{var m,x;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=Vt.now();const f={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:o,repeatType:s,name:l,motionValue:c,element:u,...d},p=(u==null?void 0:u.KeyframeResolver)||il;this.keyframeResolver=new p(a,(m,x,y)=>this.onKeyframesResolved(m,x,f,!y),l,c,u),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,r,i){this.keyframeResolver=void 0;const{name:o,type:s,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=Vt.now(),fy(t,o,s,a)||((vn.instantAnimations||!l)&&(u==null||u(tl(t,r,n))),t[0]=t[t.length-1],la(r),r.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>gy?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},p=!c&&my(f)?new uy({...f,element:f.motionValue.owner.current}):new rl(f);p.finished.then(()=>this.notifyFinished()).catch(Qt),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Jb()),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 yy=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xy(e){const t=yy.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const wy=4;function Qf(e,t,n=1){wn(n<=wy,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=xy(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return wf(s)?parseFloat(s):s}return Za(i)?Qf(i,t,n+1):i}function ol(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Jf=new Set(["width","height","top","left","right","bottom",...Rr]),vy={test:e=>e==="auto",parse:e=>e},eh=e=>t=>t.test(e),th=[Ar,Ee,dn,An,db,ub,vy],Rc=e=>th.find(eh(e));function Ey(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Ef(e):!0}const ky=new Set(["brightness","contrast","saturate","opacity"]);function Sy(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Xa)||[];if(!r)return e;const i=n.replace(r,"");let o=ky.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const Cy=/\b([a-z-]*)\(.*?\)/gu,ca={...In,getAnimatableNone:e=>{const t=e.match(Cy);return t?t.map(Sy).join(" "):e}},Mc={...Ar,transform:Math.round},_y={rotate:An,rotateX:An,rotateY:An,rotateZ:An,scale:Mi,scaleX:Mi,scaleY:Mi,scaleZ:Mi,skew:An,skewX:An,skewY:An,distance:Ee,translateX:Ee,translateY:Ee,translateZ:Ee,x:Ee,y:Ee,z:Ee,perspective:Ee,transformPerspective:Ee,opacity:ri,originX:yc,originY:yc,originZ:Ee},sl={borderWidth:Ee,borderTopWidth:Ee,borderRightWidth:Ee,borderBottomWidth:Ee,borderLeftWidth:Ee,borderRadius:Ee,radius:Ee,borderTopLeftRadius:Ee,borderTopRightRadius:Ee,borderBottomRightRadius:Ee,borderBottomLeftRadius:Ee,width:Ee,maxWidth:Ee,height:Ee,maxHeight:Ee,top:Ee,right:Ee,bottom:Ee,left:Ee,padding:Ee,paddingTop:Ee,paddingRight:Ee,paddingBottom:Ee,paddingLeft:Ee,margin:Ee,marginTop:Ee,marginRight:Ee,marginBottom:Ee,marginLeft:Ee,backgroundPositionX:Ee,backgroundPositionY:Ee,..._y,zIndex:Mc,fillOpacity:ri,strokeOpacity:ri,numOctaves:Mc},Ty={...sl,color:wt,backgroundColor:wt,outlineColor:wt,fill:wt,stroke:wt,borderColor:wt,borderTopColor:wt,borderRightColor:wt,borderBottomColor:wt,borderLeftColor:wt,filter:ca,WebkitFilter:ca},nh=e=>Ty[e];function rh(e,t){let n=nh(e);return n!==ca&&(n=In),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Ny=new Set(["auto","none","0"]);function Ay(e,t,n){let r=0,i;for(;r<e.length&&!i;){const o=e[r];typeof o=="string"&&!Ny.has(o)&&ii(o).values.length&&(i=e[r]),r++}if(i&&n)for(const o of t)e[o]=rh(n,i)}class Ry extends il{constructor(t,n,r,i,o){super(t,n,r,i,o,!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(),Za(c))){const u=Qf(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Jf.has(r)||t.length!==2)return;const[i,o]=t,s=Rc(i),a=Rc(o);if(s!==a)if(_c(s)&&_c(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else Gn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||Ey(t[i]))&&r.push(i);r.length&&Ay(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=Gn[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 o=r.length-1,s=r[o];r[o]=Gn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function My(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 ih=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function oh(e){return vf(e)&&"offsetHeight"in e}const Ic=30,Iy=e=>!isNaN(parseFloat(e));class Oy{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const i=Vt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Vt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Iy(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ga(!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 Wa);const r=this.events[t].add(n);return t==="change"?()=>{r(),st.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=Vt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Ic)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ic);return kf(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 kr(e,t){return new Oy(e,t)}const{schedule:al}=Pf(queueMicrotask,!1),tn={x:!1,y:!1};function sh(){return tn.x||tn.y}function Py(e){return e==="x"||e==="y"?tn[e]?null:(tn[e]=!0,()=>{tn[e]=!1}):tn.x||tn.y?null:(tn.x=tn.y=!0,()=>{tn.x=tn.y=!1})}function ah(e,t){const n=My(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Oc(e){return!(e.pointerType==="touch"||sh())}function Dy(e,t,n={}){const[r,i,o]=ah(e,n),s=a=>{if(!Oc(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=d=>{Oc(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,i)};return r.forEach(a=>{a.addEventListener("pointerenter",s,i)}),o}const lh=(e,t)=>t?e===t?!0:lh(e,t.parentElement):!1,ll=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Ly=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Fy(e){return Ly.has(e.tagName)||e.tabIndex!==-1}const Qi=new WeakSet;function Pc(e){return t=>{t.key==="Enter"&&e(t)}}function os(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const By=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Pc(()=>{if(Qi.has(n))return;os(n,"down");const i=Pc(()=>{os(n,"up")}),o=()=>os(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Dc(e){return ll(e)&&!sh()}function jy(e,t,n={}){const[r,i,o]=ah(e,n),s=a=>{const l=a.currentTarget;if(!Dc(a))return;Qi.add(l);const c=t(l,a),u=(p,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),Qi.has(l)&&Qi.delete(l),Dc(p)&&typeof c=="function"&&c(p,{success:g})},d=p=>{u(p,l===window||l===document||n.useGlobalTarget||lh(l,p.target))},f=p=>{u(p,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,i),oh(a)&&(a.addEventListener("focus",c=>By(c,i)),!Fy(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function ch(e){return vf(e)&&"ownerSVGElement"in e}function $y(e){return ch(e)&&e.tagName==="svg"}const Mt=e=>!!(e&&e.getVelocity),Vy=[...th,wt,In],zy=e=>Vy.find(eh(e)),cl=A.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Uy extends P.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=oh(r)&&r.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=i-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Hy({children:e,isPresent:t,anchorX:n,root:r}){const i=A.useId(),o=A.useRef(null),s=A.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=A.useContext(cl);return A.useInsertionEffect(()=>{const{width:l,height:c,top:u,left:d,right:f}=s.current;if(t||!o.current||!l||!c)return;const p=n==="left"?`left: ${d}`:`right: ${f}`;o.current.dataset.motionPopId=i;const g=document.createElement("style");a&&(g.nonce=a);const m=r??document.head;return m.appendChild(g),g.sheet&&g.sheet.insertRule(`
21
+ "use strict";var Vg=Object.defineProperty;var zg=(e,t,n)=>t in e?Vg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var lt=(e,t,n)=>zg(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const A=require("react"),h=require("react/jsx-runtime"),se=require("livekit-client"),Ft=require("@livekit/components-react"),Ge=require("lucide-react"),Ba=require("clsx"),Ug=require("@emotion/styled");require("@emotion/react");const Hg=require("react-dom/client");function Wg(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 D=Wg(A),ja=A.createContext({});function $a(e){const t=A.useRef(null);return t.current===null&&(t.current=e()),t.current}const Va=typeof window<"u",yf=Va?A.useLayoutEffect:A.useEffect,So=A.createContext(null);function za(e,t){e.indexOf(t)===-1&&e.push(t)}function Ua(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const yn=(e,t,n)=>n>t?t:n<e?e:n;function Zs(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Nr=()=>{},xn=()=>{};process.env.NODE_ENV!=="production"&&(Nr=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Zs(t,n))},xn=(e,t,n)=>{if(!e)throw new Error(Zs(t,n))});const wn={},xf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function wf(e){return typeof e=="object"&&e!==null}const vf=e=>/^0[^.\s]+$/u.test(e);function Ha(e){let t;return()=>(t===void 0&&(t=e()),t)}const Zt=e=>e,Gg=(e,t)=>n=>t(e(n)),hi=(...e)=>e.reduce(Gg),ni=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Wa{constructor(){this.subscriptions=[]}add(t){return za(this.subscriptions,t),()=>Ua(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 o=0;o<i;o++){const s=this.subscriptions[o];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const en=e=>e*1e3,cn=e=>e/1e3;function Ef(e,t){return t?e*(1e3/t):0}const mc=new Set;function Ga(e,t,n){e||mc.has(t)||(console.warn(Zs(t,n)),mc.add(t))}const kf=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Kg=1e-7,qg=12;function Yg(e,t,n,r,i){let o,s,a=0;do s=t+(n-t)/2,o=kf(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>Kg&&++a<qg);return s}function pi(e,t,n,r){if(e===t&&n===r)return Zt;const i=o=>Yg(o,0,1,e,n);return o=>o===0||o===1?o:kf(i(o),t,r)}const Sf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Cf=e=>t=>1-e(1-t),_f=pi(.33,1.53,.69,.99),Ka=Cf(_f),Tf=Sf(Ka),Nf=e=>(e*=2)<1?.5*Ka(e):.5*(2-Math.pow(2,-10*(e-1))),qa=e=>1-Math.sin(Math.acos(e)),Af=Cf(qa),Rf=Sf(qa),Zg=pi(.42,0,1,1),Xg=pi(0,0,.58,1),Mf=pi(.42,0,.58,1),Qg=e=>Array.isArray(e)&&typeof e[0]!="number",If=e=>Array.isArray(e)&&typeof e[0]=="number",gc={linear:Zt,easeIn:Zg,easeInOut:Mf,easeOut:Xg,circIn:qa,circInOut:Rf,circOut:Af,backIn:Ka,backInOut:Tf,backOut:_f,anticipate:Nf},Jg=e=>typeof e=="string",bc=e=>{if(If(e)){xn(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,i]=e;return pi(t,n,r,i)}else if(Jg(e))return xn(gc[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),gc[e];return e},Ri=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function eb(e,t){let n=new Set,r=new Set,i=!1,o=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,d=!1,f=!1)=>{const g=f&&i?n:r;return d&&s.add(u),g.has(u)||g.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(a=u,i){o=!0;return}i=!0,[n,r]=[r,n],n.forEach(l),n.clear(),i=!1,o&&(o=!1,c.process(u))}};return c}const tb=40;function Of(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=Ri.reduce((v,_)=>(v[_]=eb(o),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:f,render:p,postRender:g}=s,m=()=>{const v=wn.useManualTiming?i.timestamp:performance.now();n=!1,wn.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(v-i.timestamp,tb),1)),i.timestamp=v,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),d.process(i),f.process(i),p.process(i),g.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))},x=()=>{n=!0,r=!0,i.isProcessing||e(m)};return{schedule:Ri.reduce((v,_)=>{const k=s[_];return v[_]=(C,M=!1,N=!1)=>(n||x(),k.schedule(C,M,N)),v},{}),cancel:v=>{for(let _=0;_<Ri.length;_++)s[Ri[_]].cancel(v)},state:i,steps:s}}const{schedule:at,cancel:Mn,state:Tt,steps:es}=Of(typeof requestAnimationFrame<"u"?requestAnimationFrame:Zt,!0);let Xi;function nb(){Xi=void 0}const Bt={now:()=>(Xi===void 0&&Bt.set(Tt.isProcessing||wn.useManualTiming?Tt.timestamp:performance.now()),Xi),set:e=>{Xi=e,queueMicrotask(nb)}},Pf=e=>t=>typeof t=="string"&&t.startsWith(e),Ya=Pf("--"),rb=Pf("var(--"),Za=e=>rb(e)?ib.test(e.split("/*")[0].trim()):!1,ib=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ar={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ri={...Ar,transform:e=>yn(0,1,e)},Mi={...Ar,default:1},qr=e=>Math.round(e*1e5)/1e5,Xa=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ob(e){return e==null}const sb=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Qa=(e,t)=>n=>!!(typeof n=="string"&&sb.test(n)&&n.startsWith(e)||t&&!ob(n)&&Object.prototype.hasOwnProperty.call(n,t)),Df=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,o,s,a]=r.match(Xa);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},ab=e=>yn(0,255,e),ts={...Ar,transform:e=>Math.round(ab(e))},Un={test:Qa("rgb","red"),parse:Df("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+ts.transform(e)+", "+ts.transform(t)+", "+ts.transform(n)+", "+qr(ri.transform(r))+")"};function lb(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 Xs={test:Qa("#"),parse:lb,transform:Un.transform},mi=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),An=mi("deg"),un=mi("%"),ve=mi("px"),cb=mi("vh"),ub=mi("vw"),yc={...un,parse:e=>un.parse(e)/100,transform:e=>un.transform(e*100)},pr={test:Qa("hsl","hue"),parse:Df("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+un.transform(qr(t))+", "+un.transform(qr(n))+", "+qr(ri.transform(r))+")"},wt={test:e=>Un.test(e)||Xs.test(e)||pr.test(e),parse:e=>Un.test(e)?Un.parse(e):pr.test(e)?pr.parse(e):Xs.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Un.transform(e):pr.transform(e),getAnimatableNone:e=>{const t=wt.parse(e);return t.alpha=0,wt.transform(t)}},db=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function fb(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Xa))==null?void 0:t.length)||0)+(((n=e.match(db))==null?void 0:n.length)||0)>0}const Lf="number",Ff="color",hb="var",pb="var(",xc="${}",mb=/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 ii(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const a=t.replace(mb,l=>(wt.test(l)?(r.color.push(o),i.push(Ff),n.push(wt.parse(l))):l.startsWith(pb)?(r.var.push(o),i.push(hb),n.push(l)):(r.number.push(o),i.push(Lf),n.push(parseFloat(l))),++o,xc)).split(xc);return{values:n,split:a,indexes:r,types:i}}function Bf(e){return ii(e).values}function jf(e){const{split:t,types:n}=ii(e),r=t.length;return i=>{let o="";for(let s=0;s<r;s++)if(o+=t[s],i[s]!==void 0){const a=n[s];a===Lf?o+=qr(i[s]):a===Ff?o+=wt.transform(i[s]):o+=i[s]}return o}}const gb=e=>typeof e=="number"?0:wt.test(e)?wt.getAnimatableNone(e):e;function bb(e){const t=Bf(e);return jf(e)(t.map(gb))}const In={test:fb,parse:Bf,createTransformer:jf,getAnimatableNone:bb};function ns(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 yb({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,s=0;if(!t)i=o=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=ns(l,a,e+1/3),o=ns(l,a,e),s=ns(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}function lo(e,t){return n=>n>0?t:e}const ut=(e,t,n)=>e+(t-e)*n,rs=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},xb=[Xs,Un,pr],wb=e=>xb.find(t=>t.test(e));function wc(e){const t=wb(e);if(Nr(!!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===pr&&(n=yb(n)),n}const vc=(e,t)=>{const n=wc(e),r=wc(t);if(!n||!r)return lo(e,t);const i={...n};return o=>(i.red=rs(n.red,r.red,o),i.green=rs(n.green,r.green,o),i.blue=rs(n.blue,r.blue,o),i.alpha=ut(n.alpha,r.alpha,o),Un.transform(i))},Qs=new Set(["none","hidden"]);function vb(e,t){return Qs.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Eb(e,t){return n=>ut(e,t,n)}function Ja(e){return typeof e=="number"?Eb:typeof e=="string"?Za(e)?lo:wt.test(e)?vc:Cb:Array.isArray(e)?$f:typeof e=="object"?wt.test(e)?vc:kb:lo}function $f(e,t){const n=[...e],r=n.length,i=e.map((o,s)=>Ja(o)(o,t[s]));return o=>{for(let s=0;s<r;s++)n[s]=i[s](o);return n}}function kb(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Ja(e[i])(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}}function Sb(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],s=e.indexes[o][r[o]],a=e.values[s]??0;n[i]=a,r[o]++}return n}const Cb=(e,t)=>{const n=In.createTransformer(t),r=ii(e),i=ii(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?Qs.has(e)&&!i.values.length||Qs.has(t)&&!r.values.length?vb(e,t):hi($f(Sb(r,i),i.values),n):(Nr(!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"),lo(e,t))};function Vf(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ut(e,t,n):Ja(e)(e,t)}const _b=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>at.update(t,n),stop:()=>Mn(t),now:()=>Tt.isProcessing?Tt.timestamp:Bt.now()}},zf=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let o=0;o<i;o++)r+=Math.round(e(o/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},co=2e4;function el(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<co;)t+=n,r=e.next(t);return t>=co?1/0:t}function Tb(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(el(r),co);return{type:"keyframes",ease:o=>r.next(i*o).value/t,duration:cn(i)}}const Nb=5;function Uf(e,t,n){const r=Math.max(t-Nb,0);return Ef(n-e(r),t-r)}const ct={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},is=.001;function Ab({duration:e=ct.duration,bounce:t=ct.bounce,velocity:n=ct.velocity,mass:r=ct.mass}){let i,o;Nr(e<=en(ct.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=yn(ct.minDamping,ct.maxDamping,s),e=yn(ct.minDuration,ct.maxDuration,cn(e)),s<1?(i=c=>{const u=c*s,d=u*e,f=u-n,p=Js(c,s),g=Math.exp(-d);return is-f/p*g},o=c=>{const d=c*s*e,f=d*n+n,p=Math.pow(s,2)*Math.pow(c,2)*e,g=Math.exp(-d),m=Js(Math.pow(c,2),s);return(-i(c)+is>0?-1:1)*((f-p)*g)/m}):(i=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-is+u*d},o=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=Mb(i,o,a);if(e=en(e),isNaN(l))return{stiffness:ct.stiffness,damping:ct.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const Rb=12;function Mb(e,t,n){let r=n;for(let i=1;i<Rb;i++)r=r-e(r)/t(r);return r}function Js(e,t){return e*Math.sqrt(1-t*t)}const Ib=["duration","bounce"],Ob=["stiffness","damping","mass"];function Ec(e,t){return t.some(n=>e[n]!==void 0)}function Pb(e){let t={velocity:ct.velocity,stiffness:ct.stiffness,damping:ct.damping,mass:ct.mass,isResolvedFromDuration:!1,...e};if(!Ec(e,Ob)&&Ec(e,Ib))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,o=2*yn(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:ct.mass,stiffness:i,damping:o}}else{const n=Ab(e);t={...t,...n,mass:ct.mass},t.isResolvedFromDuration=!0}return t}function uo(e=ct.visualDuration,t=ct.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Pb({...n,velocity:-cn(n.velocity||0)}),g=f||0,m=c/(2*Math.sqrt(l*u)),x=s-o,y=cn(Math.sqrt(l/u)),E=Math.abs(x)<5;r||(r=E?ct.restSpeed.granular:ct.restSpeed.default),i||(i=E?ct.restDelta.granular:ct.restDelta.default);let v;if(m<1){const k=Js(y,m);v=C=>{const M=Math.exp(-m*y*C);return s-M*((g+m*y*x)/k*Math.sin(k*C)+x*Math.cos(k*C))}}else if(m===1)v=k=>s-Math.exp(-y*k)*(x+(g+y*x)*k);else{const k=y*Math.sqrt(m*m-1);v=C=>{const M=Math.exp(-m*y*C),N=Math.min(k*C,300);return s-M*((g+m*y*x)*Math.sinh(N)+k*x*Math.cosh(N))/k}}const _={calculatedDuration:p&&d||null,next:k=>{const C=v(k);if(p)a.done=k>=d;else{let M=k===0?g:0;m<1&&(M=k===0?en(g):Uf(v,k,C));const N=Math.abs(M)<=r,I=Math.abs(s-C)<=i;a.done=N&&I}return a.value=a.done?s:C,a},toString:()=>{const k=Math.min(el(_),co),C=zf(M=>_.next(k*M).value,k,30);return k+"ms "+C},toTransition:()=>{}};return _}uo.applyToOptions=e=>{const t=Tb(e,100,uo);return e.ease=t.ease,e.duration=en(t.duration),e.type="keyframes",e};function ea({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},p=N=>a!==void 0&&N<a||l!==void 0&&N>l,g=N=>a===void 0?l:l===void 0||Math.abs(a-N)<Math.abs(l-N)?a:l;let m=n*t;const x=d+m,y=s===void 0?x:s(x);y!==x&&(m=y-d);const E=N=>-m*Math.exp(-N/r),v=N=>y+E(N),_=N=>{const I=E(N),b=v(N);f.done=Math.abs(I)<=c,f.value=f.done?y:b};let k,C;const M=N=>{p(f.value)&&(k=N,C=uo({keyframes:[f.value,g(f.value)],velocity:Uf(v,N,f.value),damping:i,stiffness:o,restDelta:c,restSpeed:u}))};return M(0),{calculatedDuration:null,next:N=>{let I=!1;return!C&&k===void 0&&(I=!0,_(N),M(N)),k!==void 0&&N>=k?C.next(N-k):(!I&&_(N),f)}}}function Db(e,t,n){const r=[],i=n||wn.mix||Vf,o=e.length-1;for(let s=0;s<o;s++){let a=i(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||Zt:t;a=hi(l,a)}r.push(a)}return r}function Lb(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(xn(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Db(t,r,i),l=a.length,c=u=>{if(s&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=ni(e[d],e[d+1],u);return a[d](f)};return n?u=>c(yn(e[0],e[o-1],u)):c}function Fb(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=ni(0,t,r);e.push(ut(n,1,i))}}function Bb(e){const t=[0];return Fb(t,e.length-1),t}function jb(e,t){return e.map(n=>n*t)}function $b(e,t){return e.map(()=>t||Mf).splice(0,e.length-1)}function mr({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=Qg(r)?r.map(bc):bc(r),o={done:!1,value:t[0]},s=jb(n&&n.length===t.length?n:Bb(t),e),a=Lb(s,t,{ease:Array.isArray(i)?i:$b(t,i)});return{calculatedDuration:e,next:l=>(o.value=a(l),o.done=l>=e,o)}}const Vb=e=>e!==null;function tl(e,{repeat:t,repeatType:n="loop"},r,i=1){const o=e.filter(Vb),a=i<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!a||r===void 0?o[a]:r}const zb={decay:ea,inertia:ea,tween:mr,keyframes:mr,spring:uo};function Hf(e){typeof e.type=="string"&&(e.type=zb[e.type])}class nl{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 Ub=e=>e/100;class rl extends nl{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!==Bt.now()&&this.tick(Bt.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;Hf(t);const{type:n=mr,repeat:r=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=t;let{keyframes:a}=t;const l=n||mr;process.env.NODE_ENV!=="production"&&l!==mr&&xn(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==mr&&typeof a[0]!="number"&&(this.mixKeyframes=hi(Ub,Vf(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=el(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:o,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:p,type:g,onUpdate:m,finalKeyframe:x}=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 y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),E=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,_=r;if(d){const N=Math.min(this.currentTime,i)/a;let I=Math.floor(N),b=N%1;!b&&N>=1&&(b=1),b===1&&I--,I=Math.min(I,d+1),!!(I%2)&&(f==="reverse"?(b=1-b,p&&(b-=p/a)):f==="mirror"&&(_=s)),v=yn(0,1,b)*a}const k=E?{done:!1,value:u[0]}:_.next(v);o&&(k.value=o(k.value));let{done:C}=k;!E&&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!==ea&&(k.value=tl(u,this.options,x,this.speed)),m&&m(k.value),M&&this.finish(),k}then(t,n){return this.finished.then(t,n)}get duration(){return cn(this.calculatedDuration)}get time(){return cn(this.currentTime)}set time(t){var n;t=en(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(Bt.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=cn(this.currentTime))}play(){var i,o;if(this.isStopped)return;const{driver:t=_b,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),(o=(i=this.options).onPlay)==null||o.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(Bt.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 Hb(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Hn=e=>e*180/Math.PI,ta=e=>{const t=Hn(Math.atan2(e[1],e[0]));return na(t)},Wb={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ta,rotateZ:ta,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},na=e=>(e=e%360,e<0&&(e+=360),e),kc=ta,Sc=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Cc=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Gb={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Sc,scaleY:Cc,scale:e=>(Sc(e)+Cc(e))/2,rotateX:e=>na(Hn(Math.atan2(e[6],e[5]))),rotateY:e=>na(Hn(Math.atan2(-e[2],e[0]))),rotateZ:kc,rotate:kc,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 ra(e){return e.includes("scale")?1:0}function ia(e,t){if(!e||e==="none")return ra(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=Gb,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Wb,i=a}if(!i)return ra(t);const o=r[t],s=i[1].split(",").map(qb);return typeof o=="function"?o(s):s[o]}const Kb=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ia(n,t)};function qb(e){return parseFloat(e.trim())}const Rr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Mr=new Set(Rr),_c=e=>e===Ar||e===ve,Yb=new Set(["x","y","z"]),Zb=Rr.filter(e=>!Yb.has(e));function Xb(e){const t=[];return Zb.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Gn={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})=>ia(t,"x"),y:(e,{transform:t})=>ia(t,"y")};Gn.translateX=Gn.x;Gn.translateY=Gn.y;const Kn=new Set;let oa=!1,sa=!1,aa=!1;function Wf(){if(sa){const e=Array.from(Kn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=Xb(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(([o,s])=>{var a;(a=r.getValue(o))==null||a.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}sa=!1,oa=!1,Kn.forEach(e=>e.complete(aa)),Kn.clear()}function Gf(){Kn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(sa=!0)})}function Qb(){aa=!0,Gf(),Wf(),aa=!1}class il{constructor(t,n,r,i,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(Kn.add(this),oa||(oa=!0,at.read(Gf),at.resolveKeyframes(Wf))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const o=i==null?void 0:i.get(),s=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const a=r.readValue(n,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),i&&o===void 0&&i.set(t[0])}Hb(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Kn.delete(this)}cancel(){this.state==="scheduled"&&(Kn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Jb=e=>e.startsWith("--");function ey(e,t,n){Jb(t)?e.style.setProperty(t,n):e.style[t]=n}const ty=Ha(()=>window.ScrollTimeline!==void 0),ny={};function ry(e,t){const n=Ha(e);return()=>ny[t]??n()}const Kf=ry(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Wr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Tc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wr([0,.65,.55,1]),circOut:Wr([.55,0,1,.45]),backIn:Wr([.31,.01,.66,-.59]),backOut:Wr([.33,1.53,.69,.99])};function qf(e,t){if(e)return typeof e=="function"?Kf()?zf(e,t):"ease-out":If(e)?Wr(e):Array.isArray(e)?e.map(n=>qf(n,t)||Tc.easeOut):Tc[e]}function iy(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=qf(a,i);Array.isArray(d)&&(u.easing=d);const f={delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),e.animate(u,f)}function Yf(e){return typeof e=="function"&&"applyToOptions"in e}function oy({type:e,...t}){return Yf(e)&&Kf()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class sy extends nl{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!o,this.allowFlatten=s,this.options=t,xn(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=oy(t);this.animation=iy(n,r,i,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=tl(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):ey(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 cn(Number(t))}get time(){return cn(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=en(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&&ty()?(this.animation.timeline=t,Zt):n(this)}}const Zf={anticipate:Nf,backInOut:Tf,circInOut:Rf};function ay(e){return e in Zf}function ly(e){typeof e.ease=="string"&&ay(e.ease)&&(e.ease=Zf[e.ease])}const Nc=10;class cy extends sy{constructor(t){ly(t),Hf(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:o,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new rl({...s,autoplay:!1}),l=en(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-Nc).value,a.sample(l).value,Nc),a.stop()}}const Ac=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(In.test(e)||e==="0")&&!e.startsWith("url("));function uy(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 dy(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],s=Ac(i,t),a=Ac(o,t);return Nr(s===a,`You are trying to animate ${t} from "${i}" to "${o}". "${s?o:i}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:uy(e)||(n==="spring"||Yf(n))&&r}function la(e){e.duration=0,e.type}const fy=new Set(["opacity","clipPath","filter","transform"]),hy=Ha(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function py(e){var u;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:o,type:s}=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 hy()&&n&&fy.has(n)&&(n!=="transform"||!c)&&!l&&!r&&i!=="mirror"&&o!==0&&s!=="inertia"}const my=40;class gy extends nl{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s="loop",keyframes:a,name:l,motionValue:c,element:u,...d}){var g;super(),this.stop=()=>{var m,x;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=Bt.now();const f={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:o,repeatType:s,name:l,motionValue:c,element:u,...d},p=(u==null?void 0:u.KeyframeResolver)||il;this.keyframeResolver=new p(a,(m,x,y)=>this.onKeyframesResolved(m,x,f,!y),l,c,u),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,r,i){this.keyframeResolver=void 0;const{name:o,type:s,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=Bt.now(),dy(t,o,s,a)||((wn.instantAnimations||!l)&&(u==null||u(tl(t,r,n))),t[0]=t[t.length-1],la(r),r.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>my?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},p=!c&&py(f)?new cy({...f,element:f.motionValue.owner.current}):new rl(f);p.finished.then(()=>this.notifyFinished()).catch(Zt),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Qb()),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 by=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yy(e){const t=by.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const xy=4;function Xf(e,t,n=1){xn(n<=xy,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=yy(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return xf(s)?parseFloat(s):s}return Za(i)?Xf(i,t,n+1):i}function ol(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Qf=new Set(["width","height","top","left","right","bottom",...Rr]),wy={test:e=>e==="auto",parse:e=>e},Jf=e=>t=>t.test(e),eh=[Ar,ve,un,An,ub,cb,wy],Rc=e=>eh.find(Jf(e));function vy(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||vf(e):!0}const Ey=new Set(["brightness","contrast","saturate","opacity"]);function ky(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Xa)||[];if(!r)return e;const i=n.replace(r,"");let o=Ey.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const Sy=/\b([a-z-]*)\(.*?\)/gu,ca={...In,getAnimatableNone:e=>{const t=e.match(Sy);return t?t.map(ky).join(" "):e}},Mc={...Ar,transform:Math.round},Cy={rotate:An,rotateX:An,rotateY:An,rotateZ:An,scale:Mi,scaleX:Mi,scaleY:Mi,scaleZ:Mi,skew:An,skewX:An,skewY:An,distance:ve,translateX:ve,translateY:ve,translateZ:ve,x:ve,y:ve,z:ve,perspective:ve,transformPerspective:ve,opacity:ri,originX:yc,originY:yc,originZ:ve},sl={borderWidth:ve,borderTopWidth:ve,borderRightWidth:ve,borderBottomWidth:ve,borderLeftWidth:ve,borderRadius:ve,radius:ve,borderTopLeftRadius:ve,borderTopRightRadius:ve,borderBottomRightRadius:ve,borderBottomLeftRadius:ve,width:ve,maxWidth:ve,height:ve,maxHeight:ve,top:ve,right:ve,bottom:ve,left:ve,padding:ve,paddingTop:ve,paddingRight:ve,paddingBottom:ve,paddingLeft:ve,margin:ve,marginTop:ve,marginRight:ve,marginBottom:ve,marginLeft:ve,backgroundPositionX:ve,backgroundPositionY:ve,...Cy,zIndex:Mc,fillOpacity:ri,strokeOpacity:ri,numOctaves:Mc},_y={...sl,color:wt,backgroundColor:wt,outlineColor:wt,fill:wt,stroke:wt,borderColor:wt,borderTopColor:wt,borderRightColor:wt,borderBottomColor:wt,borderLeftColor:wt,filter:ca,WebkitFilter:ca},th=e=>_y[e];function nh(e,t){let n=th(e);return n!==ca&&(n=In),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Ty=new Set(["auto","none","0"]);function Ny(e,t,n){let r=0,i;for(;r<e.length&&!i;){const o=e[r];typeof o=="string"&&!Ty.has(o)&&ii(o).values.length&&(i=e[r]),r++}if(i&&n)for(const o of t)e[o]=nh(n,i)}class Ay extends il{constructor(t,n,r,i,o){super(t,n,r,i,o,!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(),Za(c))){const u=Xf(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Qf.has(r)||t.length!==2)return;const[i,o]=t,s=Rc(i),a=Rc(o);if(s!==a)if(_c(s)&&_c(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else Gn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||vy(t[i]))&&r.push(i);r.length&&Ny(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=Gn[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 o=r.length-1,s=r[o];r[o]=Gn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function Ry(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 rh=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function ih(e){return wf(e)&&"offsetHeight"in e}const Ic=30,My=e=>!isNaN(parseFloat(e));class Iy{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const i=Bt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Bt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=My(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ga(!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 Wa);const r=this.events[t].add(n);return t==="change"?()=>{r(),at.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=Bt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Ic)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ic);return Ef(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 kr(e,t){return new Iy(e,t)}const{schedule:al}=Of(queueMicrotask,!1),Jt={x:!1,y:!1};function oh(){return Jt.x||Jt.y}function Oy(e){return e==="x"||e==="y"?Jt[e]?null:(Jt[e]=!0,()=>{Jt[e]=!1}):Jt.x||Jt.y?null:(Jt.x=Jt.y=!0,()=>{Jt.x=Jt.y=!1})}function sh(e,t){const n=Ry(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Oc(e){return!(e.pointerType==="touch"||oh())}function Py(e,t,n={}){const[r,i,o]=sh(e,n),s=a=>{if(!Oc(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=d=>{Oc(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,i)};return r.forEach(a=>{a.addEventListener("pointerenter",s,i)}),o}const ah=(e,t)=>t?e===t?!0:ah(e,t.parentElement):!1,ll=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Dy=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ly(e){return Dy.has(e.tagName)||e.tabIndex!==-1}const Qi=new WeakSet;function Pc(e){return t=>{t.key==="Enter"&&e(t)}}function os(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Fy=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Pc(()=>{if(Qi.has(n))return;os(n,"down");const i=Pc(()=>{os(n,"up")}),o=()=>os(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Dc(e){return ll(e)&&!oh()}function By(e,t,n={}){const[r,i,o]=sh(e,n),s=a=>{const l=a.currentTarget;if(!Dc(a))return;Qi.add(l);const c=t(l,a),u=(p,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),Qi.has(l)&&Qi.delete(l),Dc(p)&&typeof c=="function"&&c(p,{success:g})},d=p=>{u(p,l===window||l===document||n.useGlobalTarget||ah(l,p.target))},f=p=>{u(p,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,i),ih(a)&&(a.addEventListener("focus",c=>Fy(c,i)),!Ly(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function lh(e){return wf(e)&&"ownerSVGElement"in e}function jy(e){return lh(e)&&e.tagName==="svg"}const At=e=>!!(e&&e.getVelocity),$y=[...eh,wt,In],Vy=e=>$y.find(Jf(e)),cl=A.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class zy extends D.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=ih(r)&&r.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=i-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Uy({children:e,isPresent:t,anchorX:n,root:r}){const i=A.useId(),o=A.useRef(null),s=A.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=A.useContext(cl);return A.useInsertionEffect(()=>{const{width:l,height:c,top:u,left:d,right:f}=s.current;if(t||!o.current||!l||!c)return;const p=n==="left"?`left: ${d}`:`right: ${f}`;o.current.dataset.motionPopId=i;const g=document.createElement("style");a&&(g.nonce=a);const m=r??document.head;return m.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,79 +26,79 @@
26
26
  ${p}px !important;
27
27
  top: ${u}px !important;
28
28
  }
29
- `),()=>{m.contains(g)&&m.removeChild(g)}},[t]),h.jsx(Uy,{isPresent:t,childRef:o,sizeRef:s,children:P.cloneElement(e,{ref:o})})}const Wy=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s,anchorX:a,root:l})=>{const c=$a(Gy),u=A.useId();let d=!0,f=A.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:p=>{c.set(p,!0);for(const g of c.values())if(!g)return;r&&r()},register:p=>(c.set(p,!1),()=>c.delete(p))}),[n,c,r]);return o&&d&&(f={...f}),A.useMemo(()=>{c.forEach((p,g)=>c.set(g,!1))},[n]),P.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=h.jsx(Hy,{isPresent:n,anchorX:a,root:l,children:e})),h.jsx(So.Provider,{value:f,children:e})};function Gy(){return new Map}function uh(e=!0){const t=A.useContext(So);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,o=A.useId();A.useEffect(()=>{if(e)return i(o)},[e]);const s=A.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}const Ii=e=>e.key||"";function Lc(e){const t=[];return A.Children.forEach(e,n=>{A.isValidElement(n)&&t.push(n)}),t}const Sr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:o="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=uh(s),d=A.useMemo(()=>Lc(e),[e]),f=s&&!c?[]:d.map(Ii),p=A.useRef(!0),g=A.useRef(d),m=$a(()=>new Map),[x,y]=A.useState(d),[k,v]=A.useState(d);xf(()=>{p.current=!1,g.current=d;for(let C=0;C<k.length;C++){const M=Ii(k[C]);f.includes(M)?m.delete(M):m.get(M)!==!0&&m.set(M,!1)}},[k,f.length,f.join("-")]);const _=[];if(d!==x){let C=[...d];for(let M=0;M<k.length;M++){const N=k[M],I=Ii(N);f.includes(I)||(C.splice(M,0,N),_.push(N))}return o==="wait"&&_.length&&(C=_),v(Lc(C)),y(d),null}process.env.NODE_ENV!=="production"&&o==="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:S}=A.useContext(ja);return h.jsx(h.Fragment,{children:k.map(C=>{const M=Ii(C),N=s&&!c?!1:d===k||f.includes(M),I=()=>{if(m.has(M))m.set(M,!0);else return;let b=!0;m.forEach(R=>{R||(b=!1)}),b&&(S==null||S(),v(g.current),s&&(u==null||u()),r&&r())};return h.jsx(Wy,{isPresent:N,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:o,root:l,onExitComplete:N?void 0:I,anchorX:a,children:C},M)})})},dh=A.createContext({strict:!1}),Fc={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"]},Cr={};for(const e in Fc)Cr[e]={isEnabled:t=>Fc[e].some(n=>!!t[n])};function Ky(e){for(const t in e)Cr[t]={...Cr[t],...e[t]}}const qy=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 fo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||qy.has(e)}let fh=e=>!fo(e);function Yy(e){typeof e=="function"&&(fh=t=>t.startsWith("on")?!fo(t):e(t))}try{Yy(require("@emotion/is-prop-valid").default)}catch{}function Zy(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(fh(i)||n===!0&&fo(i)||!t&&!fo(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const Co=A.createContext({});function _o(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function oi(e){return typeof e=="string"||Array.isArray(e)}const ul=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dl=["initial",...ul];function To(e){return _o(e.animate)||dl.some(t=>oi(e[t]))}function hh(e){return!!(To(e)||e.variants)}function Xy(e,t){if(To(e)){const{initial:n,animate:r}=e;return{initial:n===!1||oi(n)?n:void 0,animate:oi(r)?r:void 0}}return e.inherit!==!1?t:{}}function Qy(e){const{initial:t,animate:n}=Xy(e,A.useContext(Co));return A.useMemo(()=>({initial:t,animate:n}),[Bc(t),Bc(n)])}function Bc(e){return Array.isArray(e)?e.join(" "):e}const si={};function Jy(e){for(const t in e)si[t]=e[t],Ya(t)&&(si[t].isCSSVariable=!0)}function ph(e,{layout:t,layoutId:n}){return Mr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!si[e]||e==="opacity")}const ex={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tx=Rr.length;function nx(e,t,n){let r="",i=!0;for(let o=0;o<tx;o++){const s=Rr[o],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=ih(a,sl[s]);if(!l){i=!1;const u=ex[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function fl(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(Mr.has(l)){s=!0;continue}else if(Ya(l)){i[l]=c;continue}else{const u=ih(c,sl[l]);l.startsWith("origin")?(a=!0,o[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=nx(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=o;r.transformOrigin=`${l} ${c} ${u}`}}const hl=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mh(e,t,n){for(const r in t)!Mt(t[r])&&!ph(r,n)&&(e[r]=t[r])}function rx({transformTemplate:e},t){return A.useMemo(()=>{const n=hl();return fl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ix(e,t){const n=e.style||{},r={};return mh(r,n,e),Object.assign(r,rx(e,t)),r}function ox(e,t){const n={},r=ix(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 sx={offset:"stroke-dashoffset",array:"stroke-dasharray"},ax={offset:"strokeDashoffset",array:"strokeDasharray"};function lx(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?sx:ax;e[o.offset]=Ee.transform(-r);const s=Ee.transform(t),a=Ee.transform(n);e[o.array]=`${s} ${a}`}function gh(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:o=1,pathOffset:s=0,...a},l,c,u){if(fl(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.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&&lx(d,i,o,s,!1)}const bh=()=>({...hl(),attrs:{}}),yh=e=>typeof e=="string"&&e.toLowerCase()==="svg";function cx(e,t,n,r){const i=A.useMemo(()=>{const o=bh();return gh(o,t,yh(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};mh(o,e.style,e),i.style={...o,...i.style}}return i}const ux=["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 pl(e){return typeof e!="string"||e.includes("-")?!1:!!(ux.indexOf(e)>-1||/[A-Z]/u.test(e))}function dx(e,t,n,{latestValues:r},i,o=!1){const a=(pl(e)?cx:ox)(t,r,i,e),l=Zy(t,typeof e=="string",o),c=e!==A.Fragment?{...l,...a,ref:n}:{},{children:u}=t,d=A.useMemo(()=>Mt(u)?u.get():u,[u]);return A.createElement(e,{...c,children:d})}function jc(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ml(e,t,n,r){if(typeof t=="function"){const[i,o]=jc(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=jc(r);t=t(n!==void 0?n:e.custom,i,o)}return t}function Ji(e){return Mt(e)?e.get():e}function fx({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:hx(n,r,i,e),renderState:t()}}function hx(e,t,n,r){const i={},o=r(e,{});for(const f in o)i[f]=Ji(o[f]);let{initial:s,animate:a}=e;const l=To(e),c=hh(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const d=u?a:s;if(d&&typeof d!="boolean"&&!_o(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){const g=ml(e,f[p]);if(g){const{transitionEnd:m,transition:x,...y}=g;for(const k in y){let v=y[k];if(Array.isArray(v)){const _=u?v.length-1:0;v=v[_]}v!==null&&(i[k]=v)}for(const k in m)i[k]=m[k]}}}return i}const xh=e=>(t,n)=>{const r=A.useContext(Co),i=A.useContext(So),o=()=>fx(e,t,r,i);return n?o():$a(o)};function gl(e,t,n){var o;const{style:r}=e,i={};for(const s in r)(Mt(r[s])||t.style&&Mt(t.style[s])||ph(s,e)||((o=n==null?void 0:n.getValue(s))==null?void 0:o.liveStyle)!==void 0)&&(i[s]=r[s]);return i}const px=xh({scrapeMotionValuesFromProps:gl,createRenderState:hl});function wh(e,t,n){const r=gl(e,t,n);for(const i in e)if(Mt(e[i])||Mt(t[i])){const o=Rr.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}const mx=xh({scrapeMotionValuesFromProps:wh,createRenderState:bh}),gx=Symbol.for("motionComponentSymbol");function gr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function bx(e,t,n){return A.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):gr(n)&&(n.current=r))},[t])}const bl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),yx="framerAppearId",vh="data-"+bl(yx),Eh=A.createContext({});function xx(e,t,n,r,i){var m,x;const{visualElement:o}=A.useContext(Co),s=A.useContext(dh),a=A.useContext(So),l=A.useContext(cl).reducedMotion,c=A.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,d=A.useContext(Eh);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&wx(c.current,n,i,d);const f=A.useRef(!1);A.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const p=n[vh],g=A.useRef(!!p&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,p))&&((x=window.MotionHasOptimisedAnimation)==null?void 0:x.call(window,p)));return xf(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),A.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)==null||y.call(window,p)}),g.current=!1),u.enteringChildren=void 0)}),u}function wx(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:kh(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&gr(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function kh(e){if(e)return e.options.allowProjection!==!1?e.projection:kh(e.parent)}function ss(e,{forwardMotionProps:t=!1}={},n,r){n&&Ky(n);const i=pl(e)?mx:px;function o(a,l){let c;const u={...A.useContext(cl),...a,layoutId:vx(a)},{isStatic:d}=u,f=Qy(a),p=i(a,d);if(!d&&Va){Ex(u,n);const g=kx(u);c=g.MeasureLayout,f.visualElement=xx(e,p,u,r,g.ProjectionNode)}return h.jsxs(Co.Provider,{value:f,children:[c&&f.visualElement?h.jsx(c,{visualElement:f.visualElement,...u}):null,dx(e,a,bx(p,f.visualElement,l),p,d,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=A.forwardRef(o);return s[gx]=e,s}function vx({layoutId:e}){const t=A.useContext(ja).id;return t&&e!==void 0?t+"-"+e:e}function Ex(e,t){const n=A.useContext(dh).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?Nr(!1,r,"lazy-strict-mode"):wn(!1,r,"lazy-strict-mode")}}function kx(e){const{drag:t,layout:n}=Cr;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 Sx(e,t){if(typeof Proxy>"u")return ss;const n=new Map,r=(o,s)=>ss(o,s,e,t),i=(o,s)=>(process.env.NODE_ENV!=="production"&&Ga(!1,"motion() is deprecated. Use motion.create() instead."),r(o,s));return new Proxy(i,{get:(o,s)=>s==="create"?r:(n.has(s)||n.set(s,ss(s,void 0,e,t)),n.get(s))})}function Sh({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Cx({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function _x(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 as(e){return e===void 0||e===1}function ua({scale:e,scaleX:t,scaleY:n}){return!as(e)||!as(t)||!as(n)}function zn(e){return ua(e)||Ch(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ch(e){return $c(e.x)||$c(e.y)}function $c(e){return e&&e!=="0%"}function ho(e,t,n){const r=e-n,i=t*r;return n+i}function Vc(e,t,n,r,i){return i!==void 0&&(e=ho(e,i,r)),ho(e,n,r)+t}function da(e,t=0,n=1,r,i){e.min=Vc(e.min,t,n,r,i),e.max=Vc(e.max,t,n,r,i)}function _h(e,{x:t,y:n}){da(e.x,t.translate,t.scale,t.originPoint),da(e.y,n.translate,n.scale,n.originPoint)}const zc=.999999999999,Uc=1.0000000000001;function Tx(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&yr(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,_h(e,s)),r&&zn(o.latestValues)&&yr(e,o.latestValues))}t.x<Uc&&t.x>zc&&(t.x=1),t.y<Uc&&t.y>zc&&(t.y=1)}function br(e,t){e.min=e.min+t,e.max=e.max+t}function Hc(e,t,n,r,i=.5){const o=ct(e.min,e.max,i);da(e,t,n,o,r)}function yr(e,t){Hc(e.x,t.x,t.scaleX,t.scale,t.originX),Hc(e.y,t.y,t.scaleY,t.scale,t.originY)}function Th(e,t){return Sh(_x(e.getBoundingClientRect(),t))}function Nx(e,t,n){const r=Th(e,n),{scroll:i}=t;return i&&(br(r.x,i.offset.x),br(r.y,i.offset.y)),r}const Wc=()=>({translate:0,scale:1,origin:0,originPoint:0}),xr=()=>({x:Wc(),y:Wc()}),Gc=()=>({min:0,max:0}),mt=()=>({x:Gc(),y:Gc()}),fa={current:null},Nh={current:!1};function Ax(){if(Nh.current=!0,!!Va)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>fa.current=e.matches;e.addEventListener("change",t),t()}else fa.current=!1}const Rx=new WeakMap;function Mx(e,t,n){for(const r in t){const i=t[r],o=n[r];if(Mt(i))e.addValue(r,i);else if(Mt(o))e.addValue(r,kr(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,kr(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Kc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ix{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=il,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 f=Vt.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,st.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;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=!!o,this.isControllingVariants=To(n),this.isVariantNode=hh(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];l[f]!==void 0&&Mt(p)&&p.set(l[f])}}mount(t){var n;this.current=t,Rx.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)),Nh.current||Ax(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:fa.current,process.env.NODE_ENV!=="production"&&Ga(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(),Mn(this.notifyUpdate),Mn(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=Mr.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&st.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Cr){const n=Cr[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 o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):mt()}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<Kc.length;r++){const i=Kc[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,s=t[o];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=Mx(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=kr(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"&&(wf(r)||Ef(r))?r=parseFloat(r):!zy(r)&&In.test(n)&&(r=rh(t,n)),this.setBaseTarget(t,Mt(r)?r.get():r)),Mt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const s=ml(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);s&&(r=s[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Mt(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 Wa),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){al.render(this.render)}}class Ah extends Ix{constructor(){super(...arguments),this.KeyframeResolver=Ry}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;Mt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Rh(e,{style:t,vars:n},r,i){const o=e.style;let s;for(s in t)o[s]=t[s];i==null||i.applyProjectionStyles(o,r);for(s in n)o.setProperty(s,n[s])}function Ox(e){return window.getComputedStyle(e)}class Px extends Ah{constructor(){super(...arguments),this.type="html",this.renderInstance=Rh}readValueFromInstance(t,n){var r;if(Mr.has(n))return(r=this.projection)!=null&&r.isProjecting?ra(n):qb(t,n);{const i=Ox(t),o=(Ya(n)?i.getPropertyValue(n):i[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Th(t,n)}build(t,n,r){fl(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return gl(t,n,r)}}const Mh=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 Dx(e,t,n,r){Rh(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Mh.has(i)?i:bl(i),t.attrs[i])}class Lx extends Ah{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=mt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Mr.has(n)){const r=nh(n);return r&&r.default||0}return n=Mh.has(n)?n:bl(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return wh(t,n,r)}build(t,n,r){gh(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){Dx(t,n,r,i)}mount(t){this.isSVGTag=yh(t.tagName),super.mount(t)}}const Fx=(e,t)=>pl(e)?new Lx(t):new Px(t,{allowProjection:e!==A.Fragment});function wr(e,t,n){const r=e.getProps();return ml(r,t,n!==void 0?n:r.custom,e)}const ha=e=>Array.isArray(e);function Bx(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,kr(n))}function jx(e){return ha(e)?e[e.length-1]||0:e}function $x(e,t){const n=wr(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const a=jx(o[s]);Bx(e,s,a)}}function Vx(e){return!!(Mt(e)&&e.add)}function pa(e,t){const n=e.getValue("willChange");if(Vx(n))return n.add(t);if(!n&&vn.WillChange){const r=new vn.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Ih(e){return e.props[vh]}const zx=e=>e!==null;function Ux(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(zx),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[o]}const Hx={type:"spring",stiffness:500,damping:25,restSpeed:10},Wx=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Gx={type:"keyframes",duration:.8},Kx={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},qx=(e,{keyframes:t})=>t.length>2?Gx:Mr.has(e)?e.startsWith("scale")?Wx(t[1]):Hx:Kx;function Yx({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const yl=(e,t,n,r={},i,o)=>s=>{const a=ol(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-nn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};Yx(a)||Object.assign(u,qx(e,u)),u.duration&&(u.duration=nn(u.duration)),u.repeatDelay&&(u.repeatDelay=nn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(la(u),u.delay===0&&(d=!0)),(vn.instantAnimations||vn.skipAnimations)&&(d=!0,la(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!o&&t.get()!==void 0){const f=Ux(u.keyframes,a);if(f!==void 0){st.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new rl(u):new by(u)};function Zx({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Oh(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(o=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),f=a[u];if(f===void 0||c&&Zx(c,u))continue;const p={delay:n,...ol(o||{},u)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===g&&!p.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const y=Ih(e);if(y){const k=window.MotionHandoffAnimation(y,u,st);k!==null&&(p.startTime=k,m=!0)}}pa(e,u),d.start(yl(u,d,f,e.shouldReduceMotion&&Jf.has(u)?{type:!1}:p,e,m));const x=d.animation;x&&l.push(x)}return s&&Promise.all(l).then(()=>{st.update(()=>{s&&$x(e,s)})}),l}function Ph(e,t,n,r=0,i=1){const o=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(o,s):i===1?o*r:a-o*r}function ma(e,t,n={}){var l;const r=wr(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 o=r?()=>Promise.all(Oh(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=i;return Xx(e,t,c,u,d,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,s]:[s,o];return c().then(()=>u())}else return Promise.all([o(),s(n.delay)])}function Xx(e,t,n=0,r=0,i=0,o=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(ma(l,t,{...s,delay:n+(typeof r=="function"?0:r)+Ph(e.variantChildren,l,r,i,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function Qx(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>ma(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=ma(e,t,n);else{const i=typeof t=="function"?wr(e,t,n.custom):t;r=Promise.all(Oh(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Dh(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 Jx=dl.length;function Lh(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Lh(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Jx;n++){const r=dl[n],i=e.props[r];(oi(i)||i===!1)&&(t[r]=i)}return t}const e0=[...ul].reverse(),t0=ul.length;function n0(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Qx(e,n,r)))}function r0(e){let t=n0(e),n=qc(),r=!0;const i=l=>(c,u)=>{var f;const d=wr(e,u,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:p,transitionEnd:g,...m}=d;c={...c,...m,...g}}return c};function o(l){t=l(e)}function s(l){const{props:c}=e,u=Lh(e.parent)||{},d=[],f=new Set;let p={},g=1/0;for(let x=0;x<t0;x++){const y=e0[x],k=n[y],v=c[y]!==void 0?c[y]:u[y],_=oi(v),S=y===l?k.isActive:null;S===!1&&(g=x);let C=v===u[y]&&v!==c[y]&&_;if(C&&r&&e.manuallyAnimateOnMount&&(C=!1),k.protectedKeys={...p},!k.isActive&&S===null||!v&&!k.prevProp||_o(v)||typeof v=="boolean")continue;const M=i0(k.prevProp,v);let N=M||y===l&&k.isActive&&!C&&_||x>g&&_,I=!1;const b=Array.isArray(v)?v:[v];let R=b.reduce(i(y),{});S===!1&&(R={});const{prevResolvedValues:O={}}=k,D={...O,...R},$=ne=>{N=!0,f.has(ne)&&(I=!0,f.delete(ne)),k.needsAnimating[ne]=!0;const j=e.getValue(ne);j&&(j.liveStyle=!1)};for(const ne in D){const j=R[ne],W=O[ne];if(p.hasOwnProperty(ne))continue;let w=!1;ha(j)&&ha(W)?w=!Dh(j,W):w=j!==W,w?j!=null?$(ne):f.add(ne):j!==void 0&&f.has(ne)?$(ne):k.protectedKeys[ne]=!0}k.prevProp=v,k.prevResolvedValues=R,k.isActive&&(p={...p,...R}),r&&e.blockInitialAnimation&&(N=!1);const U=C&&M;N&&(!U||I)&&d.push(...b.map(ne=>{const j={type:y};if(typeof ne=="string"&&r&&!U&&e.manuallyAnimateOnMount&&e.parent){const{parent:W}=e,w=wr(W,ne);if(W.enteringChildren&&w){const{delayChildren:F}=w.transition||{};j.delay=Ph(W.enteringChildren,e,F)}}return{animation:ne,options:j}}))}if(f.size){const x={};if(typeof c.initial!="boolean"){const y=wr(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(x.transition=y.transition)}f.forEach(y=>{const k=e.getBaseTarget(y),v=e.getValue(y);v&&(v.liveStyle=!0),x[y]=k??null}),d.push({animation:x})}let m=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(d):Promise.resolve()}function a(l,c){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var p;return(p=f.animationState)==null?void 0:p.setActive(l,c)}),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=qc(),r=!0}}}function i0(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Dh(t,e):!1}function jn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qc(){return{animate:jn(!0),whileInView:jn(),whileHover:jn(),whileTap:jn(),whileDrag:jn(),whileFocus:jn(),exit:jn()}}class Dn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class o0 extends Dn{constructor(t){super(t),t.animationState||(t.animationState=r0(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();_o(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 s0=0;class a0 extends Dn{constructor(){super(...arguments),this.id=s0++}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 l0={animation:{Feature:o0},exit:{Feature:a0}};function ai(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function gi(e){return{point:{x:e.pageX,y:e.pageY}}}const c0=e=>t=>ll(t)&&e(t,gi(t));function Yr(e,t,n,r){return ai(e,t,c0(n),r)}const Fh=1e-4,u0=1-Fh,d0=1+Fh,Bh=.01,f0=0-Bh,h0=0+Bh;function Lt(e){return e.max-e.min}function p0(e,t,n){return Math.abs(e-t)<=n}function Yc(e,t,n,r=.5){e.origin=r,e.originPoint=ct(t.min,t.max,e.origin),e.scale=Lt(n)/Lt(t),e.translate=ct(n.min,n.max,e.origin)-e.originPoint,(e.scale>=u0&&e.scale<=d0||isNaN(e.scale))&&(e.scale=1),(e.translate>=f0&&e.translate<=h0||isNaN(e.translate))&&(e.translate=0)}function Zr(e,t,n,r){Yc(e.x,t.x,n.x,r?r.originX:void 0),Yc(e.y,t.y,n.y,r?r.originY:void 0)}function Zc(e,t,n){e.min=n.min+t.min,e.max=e.min+Lt(t)}function m0(e,t,n){Zc(e.x,t.x,n.x),Zc(e.y,t.y,n.y)}function Xc(e,t,n){e.min=t.min-n.min,e.max=e.min+Lt(t)}function Xr(e,t,n){Xc(e.x,t.x,n.x),Xc(e.y,t.y,n.y)}function Yt(e){return[e("x"),e("y")]}const jh=({current:e})=>e?e.ownerDocument.defaultView:null,Qc=(e,t)=>Math.abs(e-t);function g0(e,t){const n=Qc(e.x,t.x),r=Qc(e.y,t.y);return Math.sqrt(n**2+r**2)}class $h{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:s=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 f=cs(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=g0(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!g)return;const{point:m}=f,{timestamp:x}=Nt;this.history.push({...m,timestamp:x});const{onStart:y,onMove:k}=this.handlers;p||(y&&y(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=ls(p,this.transformPagePoint),st.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:g,onSessionEnd:m,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=cs(f.type==="pointercancel"?this.lastMoveEventInfo:ls(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(f,y),m&&m(f,y)},!ll(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=i||window;const a=gi(t),l=ls(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=Nt;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,cs(l,this.history)),this.removeListeners=hi(Yr(this.contextWindow,"pointermove",this.handlePointerMove),Yr(this.contextWindow,"pointerup",this.handlePointerUp),Yr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Mn(this.updatePoint)}}function ls(e,t){return t?{point:t(e.point)}:e}function Jc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function cs({point:e},t){return{point:e,delta:Jc(e,Vh(t)),offset:Jc(e,b0(t)),velocity:y0(t,.1)}}function b0(e){return e[0]}function Vh(e){return e[e.length-1]}function y0(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=Vh(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>nn(t)));)n--;if(!r)return{x:0,y:0};const o=un(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function x0(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ct(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ct(n,e,r.max):Math.min(e,n)),e}function eu(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 w0(e,{top:t,left:n,bottom:r,right:i}){return{x:eu(e.x,n,i),y:eu(e.y,t,r)}}function tu(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 v0(e,t){return{x:tu(e.x,t.x),y:tu(e.y,t.y)}}function E0(e,t){let n=.5;const r=Lt(e),i=Lt(t);return i>r?n=ni(t.min,t.max-r,e.min):r>i&&(n=ni(e.min,e.max-i,t.min)),xn(0,1,n)}function k0(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 ga=.35;function S0(e=ga){return e===!1?e=0:e===!0&&(e=ga),{x:nu(e,"left","right"),y:nu(e,"top","bottom")}}function nu(e,t,n){return{min:ru(e,t),max:ru(e,n)}}function ru(e,t){return typeof e=="number"?e:e[t]||0}const C0=new WeakMap;class _0{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=mt(),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 o=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(gi(d).point)},s=(d,f)=>{const{drag:p,dragPropagation:g,onDragStart:m}=this.getProps();if(p&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Py(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Yt(y=>{let k=this.getAxisMotionValue(y).get()||0;if(dn.test(k)){const{projection:v}=this.visualElement;if(v&&v.layout){const _=v.layout.layoutBox[y];_&&(k=Lt(_)*(parseFloat(k)/100))}}this.originPoint[y]=k}),m&&st.postRender(()=>m(d,f)),pa(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:m,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=f;if(g&&this.currentDirection===null){this.currentDirection=T0(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),x&&x(d,f)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>Yt(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)==null?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new $h(t,{onSessionStart:o,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:jh(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!r)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&st.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||!Oi(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=x0(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;t&&gr(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=w0(r.layoutBox,t):this.constraints=!1,this.elastic=S0(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Yt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=k0(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!gr(t))return!1;const r=t.current;wn(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 o=Nx(r,i.root,this.visualElement.getTransformPagePoint());let s=v0(i.layout.layoutBox,o);if(n){const a=n(Cx(s));this.hasMutatedConstraints=!!a,a&&(s=Sh(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Yt(u=>{if(!Oi(u,n,this.currentDirection))return;let d=l&&l[u]||{};s&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return pa(this.visualElement,t),r.start(yl(t,r,0,n,this.visualElement,!1))}stopAnimation(){Yt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Yt(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){Yt(n=>{const{drag:r}=this.getProps();if(!Oi(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[n];o.set(t[n]-ct(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!gr(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Yt(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();i[s]=E0({min:l,max:l},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Yt(s=>{if(!Oi(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(ct(l,c,i[s]))})}addListeners(){if(!this.visualElement.current)return;C0.set(this.visualElement,this);const t=this.visualElement.current,n=Yr(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();gr(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),st.read(r);const s=ai(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Yt(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=ga,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function Oi(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function T0(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class N0 extends Dn{constructor(t){super(t),this.removeGroupControls=Qt,this.removeListeners=Qt,this.controls=new _0(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Qt}unmount(){this.removeGroupControls(),this.removeListeners()}}const iu=e=>(t,n)=>{e&&st.postRender(()=>e(t,n))};class A0 extends Dn{constructor(){super(...arguments),this.removePointerDownListener=Qt}onPointerDown(t){this.session=new $h(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:jh(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:iu(t),onStart:iu(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&st.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=Yr(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 eo={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ou(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Fr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ee.test(e))e=parseFloat(e);else return e;const n=ou(e,t.target.x),r=ou(e,t.target.y);return`${n}% ${r}%`}},R0={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=In.parse(e);if(i.length>5)return r;const o=In.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=l;const c=ct(a,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=c),typeof i[3+s]=="number"&&(i[3+s]/=c),o(i)}};let us=!1;class M0 extends A.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;Jy(I0),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),us&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),eo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,{projection:s}=r;return s&&(s.isPresent=o,us=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||st.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),al.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;us=!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 zh(e){const[t,n]=uh(),r=A.useContext(ja);return h.jsx(M0,{...e,layoutGroup:r,switchLayoutGroup:A.useContext(Eh),isPresent:t,safeToRemove:n})}const I0={borderRadius:{...Fr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fr,borderTopRightRadius:Fr,borderBottomLeftRadius:Fr,borderBottomRightRadius:Fr,boxShadow:R0};function O0(e,t,n){const r=Mt(e)?e:kr(e);return r.start(yl("",r,t,n)),r.animation}const P0=(e,t)=>e.depth-t.depth;class D0{constructor(){this.children=[],this.isDirty=!1}add(t){za(this.children,t),this.isDirty=!0}remove(t){Ua(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(P0),this.isDirty=!1,this.children.forEach(t)}}function L0(e,t){const n=Vt.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Mn(r),e(o-t))};return st.setup(r,!0),()=>Mn(r)}const Uh=["TopLeft","TopRight","BottomLeft","BottomRight"],F0=Uh.length,su=e=>typeof e=="string"?parseFloat(e):e,au=e=>typeof e=="number"||Ee.test(e);function B0(e,t,n,r,i,o){i?(e.opacity=ct(0,n.opacity??1,j0(r)),e.opacityExit=ct(t.opacity??1,0,$0(r))):o&&(e.opacity=ct(t.opacity??1,n.opacity??1,r));for(let s=0;s<F0;s++){const a=`border${Uh[s]}Radius`;let l=lu(t,a),c=lu(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||au(l)===au(c)?(e[a]=Math.max(ct(su(l),su(c),r),0),(dn.test(c)||dn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=ct(t.rotate||0,n.rotate||0,r))}function lu(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const j0=Hh(0,.5,Rf),$0=Hh(.5,.95,Qt);function Hh(e,t,n){return r=>r<e?0:r>t?1:n(ni(e,t,r))}function cu(e,t){e.min=t.min,e.max=t.max}function qt(e,t){cu(e.x,t.x),cu(e.y,t.y)}function uu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function du(e,t,n,r,i){return e-=t,e=ho(e,1/n,r),i!==void 0&&(e=ho(e,1/i,r)),e}function V0(e,t=0,n=1,r=.5,i,o=e,s=e){if(dn.test(t)&&(t=parseFloat(t),t=ct(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=ct(o.min,o.max,r);e===o&&(a-=t),e.min=du(e.min,t,n,a,i),e.max=du(e.max,t,n,a,i)}function fu(e,t,[n,r,i],o,s){V0(e,t[n],t[r],t[i],t.scale,o,s)}const z0=["x","scaleX","originX"],U0=["y","scaleY","originY"];function hu(e,t,n,r){fu(e.x,t,z0,n?n.x:void 0,r?r.x:void 0),fu(e.y,t,U0,n?n.y:void 0,r?r.y:void 0)}function pu(e){return e.translate===0&&e.scale===1}function Wh(e){return pu(e.x)&&pu(e.y)}function mu(e,t){return e.min===t.min&&e.max===t.max}function H0(e,t){return mu(e.x,t.x)&&mu(e.y,t.y)}function gu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Gh(e,t){return gu(e.x,t.x)&&gu(e.y,t.y)}function bu(e){return Lt(e.x)/Lt(e.y)}function yu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class W0{constructor(){this.members=[]}add(t){za(this.members,t),t.scheduleRender()}remove(t){if(Ua(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 o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade: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 G0(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:p,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}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 ds=["","X","Y","Z"],K0=1e3;let q0=0;function fs(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Kh(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ih(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",st,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Kh(r)}function qh({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=q0++,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(X0),this.nodes.forEach(tw),this.nodes.forEach(nw),this.nodes.forEach(Q0)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,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 D0)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Wa),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=ch(s)&&!$y(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),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 f=()=>this.root.updateBlockedByResize=!1;st.read(()=>{d=window.innerWidth}),e(s,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=L0(f,250),eo.hasAnimatedSinceResize&&(eo.hasAnimatedSinceResize=!1,this.nodes.forEach(vu)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||aw,{onLayoutAnimationStart:m,onLayoutAnimationComplete:x}=c.getProps(),y=!this.targetLayout||!Gh(this.targetLayout,p),k=!d&&f;if(this.options.layoutRoot||this.resumeFrom||k||d&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...ol(g,"layout"),onPlay:m,onComplete:x};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,k)}else d||vu(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Mn(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(rw),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Kh(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(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(wu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ew),this.nodes.forEach(Y0),this.nodes.forEach(Z0)):this.nodes.forEach(wu),this.clearAllSnapshots();const a=Vt.now();Nt.delta=xn(0,1e3/60,a-Nt.timestamp),Nt.timestamp=a,Nt.isProcessing=!0,es.update.process(Nt),es.preRender.process(Nt),es.render.process(Nt),Nt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,al.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(J0),this.sharedNodes.forEach(iw)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,st.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){st.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 s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=mt(),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,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Wh(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||zn(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),lw(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:s}=this.options;if(!s)return mt();const a=s.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(cw))){const{scroll:u}=this.root;u&&(br(a.x,u.offset.x),br(a.y,u.offset.y))}return a}removeElementScroll(s){var l;const a=mt();if(qt(a,s),(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:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&qt(a,s),br(a.x,d.offset.x),br(a.y,d.offset.y))}return a}applyTransform(s,a=!1){const l=mt();qt(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&yr(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),zn(u.latestValues)&&yr(l,u.latestValues)}return zn(this.latestValues)&&yr(l,this.latestValues),l}removeTransform(s){const a=mt();qt(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!zn(c.latestValues))continue;ua(c.latestValues)&&c.updateSnapshot();const u=mt(),d=c.measurePageBox();qt(u,d),hu(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return zn(this.latestValues)&&hu(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==Nt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var f;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(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=Nt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=mt(),this.relativeTargetOrigin=mt(),Xr(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),qt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=mt(),this.targetWithTransforms=mt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),m0(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):qt(this.target,this.layout.layoutBox),_h(this.target,this.targetDelta)):qt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=mt(),this.relativeTargetOrigin=mt(),Xr(this.relativeTargetOrigin,this.target,p.target),qt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ua(this.parent.latestValues)||Ch(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 s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Nt.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;qt(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;Tx(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=mt());const{target:p}=s;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(uu(this.prevProjectionDelta.x,this.projectionDelta.x),uu(this.prevProjectionDelta.y,this.projectionDelta.y)),Zr(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!yu(this.projectionDelta.x,this.prevProjectionDelta.x)||!yu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),s){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=xr(),this.projectionDelta=xr(),this.projectionDeltaWithTransform=xr()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=xr();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=mt(),p=l?l.source:void 0,g=this.layout?this.layout.source:void 0,m=p!==g,x=this.getStack(),y=!x||x.members.length<=1,k=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(sw));this.animationProgress=0;let v;this.mixTargetDelta=_=>{const S=_/1e3;Eu(d.x,s.x,S),Eu(d.y,s.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xr(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ow(this.relativeTarget,this.relativeTargetOrigin,f,S),v&&H0(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=mt()),qt(v,this.relativeTarget)),m&&(this.animationValues=u,B0(u,c,this.latestValues,S,k,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){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&&(Mn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=st.update(()=>{eo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=kr(0)),this.currentAnimation=O0(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),s.onUpdate&&s.onUpdate(u)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(K0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&Yh(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||mt();const d=Lt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=Lt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}qt(a,l),yr(a,u),Zr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new W0),this.sharedNodes.get(s).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 s=this.getStack();return s?s.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&fs("z",s,c,this.animationValues);for(let u=0;u<ds.length;u++)fs(`rotate${ds[u]}`,s,c,this.animationValues),fs(`skew${ds[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Ji(a==null?void 0:a.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Ji(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!zn(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=G0(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),s.transform=d;const{x:f,y:p}=this.projectionDelta;s.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in si){if(u[g]===void 0)continue;const{correct:m,applyTo:x,isCSSVariable:y}=si[g],k=d==="none"?u[g]:m(u[g],c);if(x){const v=x.length;for(let _=0;_<v;_++)s[x[_]]=k}else y?this.options.visualElement.renderState.vars[g]=k:s[g]=k}this.options.layoutId&&(s.pointerEvents=c===this?Ji(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var a;return(a=s.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(xu),this.root.sharedNodes.clear()}}}function Y0(e){e.updateLayout()}function Z0(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:o}=e.options,s=t.source!==e.layout.source;o==="size"?Yt(d=>{const f=s?t.measuredBox[d]:t.layoutBox[d],p=Lt(f);f.min=r[d].min,f.max=f.min+p}):Yh(o,t.layoutBox,r)&&Yt(d=>{const f=s?t.measuredBox[d]:t.layoutBox[d],p=Lt(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=xr();Zr(a,r,t.layoutBox);const l=xr();s?Zr(l,e.applyTransform(i,!0),t.measuredBox):Zr(l,r,t.layoutBox);const c=!Wh(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const g=mt();Xr(g,t.layoutBox,f.layoutBox);const m=mt();Xr(m,r,p.layoutBox),Gh(g,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,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 X0(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 Q0(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function J0(e){e.clearSnapshot()}function xu(e){e.clearMeasurements()}function wu(e){e.isLayoutDirty=!1}function ew(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function vu(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function tw(e){e.resolveTargetDelta()}function nw(e){e.calcProjection()}function rw(e){e.resetSkewAndRotation()}function iw(e){e.removeLeadSnapshot()}function Eu(e,t,n){e.translate=ct(t.translate,0,n),e.scale=ct(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ku(e,t,n,r){e.min=ct(t.min,n.min,r),e.max=ct(t.max,n.max,r)}function ow(e,t,n,r){ku(e.x,t.x,n.x,r),ku(e.y,t.y,n.y,r)}function sw(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const aw={duration:.45,ease:[.4,0,.1,1]},Su=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Cu=Su("applewebkit/")&&!Su("chrome/")?Math.round:Qt;function _u(e){e.min=Cu(e.min),e.max=Cu(e.max)}function lw(e){_u(e.x),_u(e.y)}function Yh(e,t,n){return e==="position"||e==="preserve-aspect"&&!p0(bu(t),bu(n),.2)}function cw(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const uw=qh({attachResizeListener:(e,t)=>ai(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),hs={current:void 0},Zh=qh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!hs.current){const e=new uw({});e.mount(window),e.setOptions({layoutScroll:!0}),hs.current=e}return hs.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),dw={pan:{Feature:A0},drag:{Feature:N0,ProjectionNode:Zh,MeasureLayout:zh}};function Tu(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&st.postRender(()=>o(t,gi(t)))}class fw extends Dn{mount(){const{current:t}=this.node;t&&(this.unmount=Dy(t,(n,r)=>(Tu(this.node,r,"Start"),i=>Tu(this.node,i,"End"))))}unmount(){}}class hw extends Dn{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=hi(ai(this.node.current,"focus",()=>this.onFocus()),ai(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Nu(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),o=r[i];o&&st.postRender(()=>o(t,gi(t)))}class pw extends Dn{mount(){const{current:t}=this.node;t&&(this.unmount=jy(t,(n,r)=>(Nu(this.node,r,"Start"),(i,{success:o})=>Nu(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ba=new WeakMap,ps=new WeakMap,mw=e=>{const t=ba.get(e.target);t&&t(e)},gw=e=>{e.forEach(mw)};function bw({root:e,...t}){const n=e||document;ps.has(n)||ps.set(n,{});const r=ps.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(gw,{root:e,...t})),r[i]}function yw(e,t,n){const r=bw(t);return ba.set(e,n),r.observe(e),()=>{ba.delete(e),r.unobserve(e)}}const xw={some:0,all:1};class ww extends Dn{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:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:xw[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!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(),f=c?u:d;f&&f(l)};return yw(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(vw(t,n))&&this.startObserver()}unmount(){}}function vw({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Ew={inView:{Feature:ww},tap:{Feature:pw},focus:{Feature:hw},hover:{Feature:fw}},kw={layout:{ProjectionNode:Zh,MeasureLayout:zh}},Sw={...l0,...Ew,...dw,...kw},Ie=Sx(Sw,Fx);function Cw(e){const[t,n]=A.useState(()=>e.getLocalParticipant()),[r,i]=A.useState(()=>e.getMicrophoneTrack());return A.useEffect(()=>{const o=()=>{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)};o(),e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("track.muted",o),e.on("track.unmuted",o);const s=e.getRoom();if(s){const a=()=>{console.log("🎤 Track published, updating participant state"),o()},l=()=>{console.log("🎤 Track unpublished, updating participant state"),o()};return s.on("localTrackPublished",a),s.on("localTrackUnpublished",l),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o),s.off("localTrackPublished",a),s.off("localTrackUnpublished",l)}}else return()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o)}},[e]),{localParticipant:t,microphoneTrack:r}}function to(e,t,n){const[r,i]=A.useState(!1),[o,s]=A.useState(!1);return A.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:o,toggle:async l=>{try{s(!0);const c=l!==void 0?l:!r;switch(console.log(`🎬 useVoxketTrackToggle: ${t} toggle called`,{currentEnabled:r,targetEnabled:c,forceEnabled:l}),t){case"microphone":await e.toggleMicrophone(c);break;case"camera":await e.toggleCamera(c);break;case"screenShare":c?(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(c){console.error(`🎬 useVoxketTrackToggle: ${t} toggle failed:`,c)}finally{s(!1)}}}}function _w(e){const[t,n]=A.useState(()=>e.getRoom()),[r,i]=A.useState(()=>e.getConnectionState());return A.useEffect(()=>{const o=()=>{n(e.getRoom()),i(e.getConnectionState())};return e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("connection.connecting",o),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("connection.connecting",o)}},[e]),t}function xl(e){const[t,n]=A.useState(()=>e.getIsAgentConnected()),[r,i]=A.useState(()=>e.getCurrentSession()),[o,s]=A.useState(()=>e.getCurrentAgentInfo()),[a,l]=A.useState(()=>e.getAgentState()),[c,u]=A.useState(()=>e.getAgentAudioTrack()),[d,f]=A.useState(()=>e.getAgentVideoTrack());return A.useEffect(()=>{const p=()=>{const v=e.getIsAgentConnected(),_=e.getCurrentSession(),S=e.getCurrentAgentInfo(),C=e.getAgentState(),M=e.getAgentAudioTrack(),N=e.getAgentVideoTrack();console.log("🤖 useVoxketVoiceAssistant: Updating state:",{isAgentConnected:v,hasSession:!!_,sessionId:_==null?void 0:_.id,hasAgentInfo:!!S,agentState:C,hasAudioTrack:!!M,hasVideoTrack:!!N}),n(v),i(_),s(S),l(C),u(M),f(N)};p();const g=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent connected event"),p()},m=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent disconnected event"),p()},x=()=>{console.log("🤖 useVoxketVoiceAssistant: Session changed event"),p()},y=()=>{console.log("🤖 useVoxketVoiceAssistant: Connection changed event"),p()},k=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent state changed event"),p()};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",m),e.on("session.created",x),e.on("session.ended",x),e.on("session.state.changed",x),e.on("connection.connected",y),()=>{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",m),e.off("session.created",x),e.off("session.ended",x),e.off("session.state.changed",x),e.off("connection.connected",y)}},[e]),{agent:{isActive:t,info:o},session:r,state:a,audioTrack:c,videoTrack:d}}function Tw(e){const[t,n]=A.useState(()=>e.getVideoTrackRefs()),[r,i]=A.useState(()=>e.getCameraTrackRefs()),[o,s]=A.useState(()=>e.getScreenShareTrackRefs());return A.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),s(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:o}}const wl="-",Nw=e=>{const t=Rw(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(wl);return a[0]===""&&a.length!==1&&a.shift(),Xh(a,t)||Aw(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},Xh=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Xh(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(wl);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},Au=/^\[(.+)\]$/,Aw=e=>{if(Au.test(e)){const t=Au.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Rw=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)ya(n[i],r,i,t);return r},ya=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Ru(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Mw(i)){ya(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{ya(s,Ru(t,o),n,r)})})},Ru=(e,t)=>{let n=e;return t.split(wl).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Mw=e=>e.isThemeGetter,Iw=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},xa="!",wa=":",Ow=wa.length,Pw=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let s=0,a=0,l=0,c;for(let g=0;g<i.length;g++){let m=i[g];if(s===0&&a===0){if(m===wa){o.push(i.slice(l,g)),l=g+Ow;continue}if(m==="/"){c=g;continue}}m==="["?s++:m==="]"?s--:m==="("?a++:m===")"&&a--}const u=o.length===0?i:i.substring(l),d=Dw(u),f=d!==u,p=c&&c>l?c-l:void 0;return{modifiers:o,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:p}};if(t){const i=t+wa,o=r;r=s=>s.startsWith(i)?o(s.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},Dw=e=>e.endsWith(xa)?e.substring(0,e.length-1):e.startsWith(xa)?e.substring(1):e,Lw=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let o=[];return r.forEach(s=>{s[0]==="["||t[s]?(i.push(...o.sort(),s),o=[]):o.push(s)}),i.push(...o.sort()),i}},Fw=e=>({cache:Iw(e.cacheSize),parseClassName:Pw(e),sortModifiers:Lw(e),...Nw(e)}),Bw=/\s+/,jw=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],a=e.trim().split(Bw);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let x=!!m,y=r(x?g.substring(0,m):g);if(!y){if(!x){l=u+(l.length>0?" "+l:l);continue}if(y=r(g),!y){l=u+(l.length>0?" "+l:l);continue}x=!1}const k=o(f).join(":"),v=p?k+xa:k,_=v+y;if(s.includes(_))continue;s.push(_);const S=i(y,x);for(let C=0;C<S.length;++C){const M=S[C];s.push(v+M)}l=u+(l.length>0?" "+l:l)}return l};function $w(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Qh(t))&&(r&&(r+=" "),r+=n);return r}const Qh=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Qh(e[r]))&&(n&&(n+=" "),n+=t);return n};function Vw(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=Fw(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=jw(l,n);return i(l,u),u}return function(){return o($w.apply(null,arguments))}}const kt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Jh=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ep=/^\((?:(\w[\w-]*):)?(.+)\)$/i,zw=/^\d+\/\d+$/,Uw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Hw=/\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$/,Ww=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Gw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Kw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nr=e=>zw.test(e),Pe=e=>!!e&&!Number.isNaN(Number(e)),_n=e=>!!e&&Number.isInteger(Number(e)),ms=e=>e.endsWith("%")&&Pe(e.slice(0,-1)),mn=e=>Uw.test(e),qw=()=>!0,Yw=e=>Hw.test(e)&&!Ww.test(e),tp=()=>!1,Zw=e=>Gw.test(e),Xw=e=>Kw.test(e),Qw=e=>!de(e)&&!fe(e),Jw=e=>Ir(e,ip,tp),de=e=>Jh.test(e),$n=e=>Ir(e,op,Yw),gs=e=>Ir(e,iv,Pe),Mu=e=>Ir(e,np,tp),ev=e=>Ir(e,rp,Xw),Pi=e=>Ir(e,sp,Zw),fe=e=>ep.test(e),Br=e=>Or(e,op),tv=e=>Or(e,ov),Iu=e=>Or(e,np),nv=e=>Or(e,ip),rv=e=>Or(e,rp),Di=e=>Or(e,sp,!0),Ir=(e,t,n)=>{const r=Jh.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Or=(e,t,n=!1)=>{const r=ep.exec(e);return r?r[1]?t(r[1]):n:!1},np=e=>e==="position"||e==="percentage",rp=e=>e==="image"||e==="url",ip=e=>e==="length"||e==="size"||e==="bg-size",op=e=>e==="length",iv=e=>e==="number",ov=e=>e==="family-name",sp=e=>e==="shadow",sv=()=>{const e=kt("color"),t=kt("font"),n=kt("text"),r=kt("font-weight"),i=kt("tracking"),o=kt("leading"),s=kt("breakpoint"),a=kt("container"),l=kt("spacing"),c=kt("radius"),u=kt("shadow"),d=kt("inset-shadow"),f=kt("text-shadow"),p=kt("drop-shadow"),g=kt("blur"),m=kt("perspective"),x=kt("aspect"),y=kt("ease"),k=kt("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[..._(),fe,de],C=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],N=()=>[fe,de,l],I=()=>[nr,"full","auto",...N()],b=()=>[_n,"none","subgrid",fe,de],R=()=>["auto",{span:["full",_n,fe,de]},_n,fe,de],O=()=>[_n,"auto",fe,de],D=()=>["auto","min","max","fr",fe,de],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],re=()=>["auto",...N()],ne=()=>[nr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],j=()=>[e,fe,de],W=()=>[..._(),Iu,Mu,{position:[fe,de]}],w=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",nv,Jw,{size:[fe,de]}],Y=()=>[ms,Br,$n],E=()=>["","none","full",c,fe,de],B=()=>["",Pe,Br,$n],z=()=>["solid","dashed","dotted","double"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>[Pe,ms,Iu,Mu],me=()=>["","none",g,fe,de],Q=()=>["none",Pe,fe,de],le=()=>["none",Pe,fe,de],he=()=>[Pe,fe,de],G=()=>[nr,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[mn],breakpoint:[mn],color:[qw],container:[mn],"drop-shadow":[mn],ease:["in","out","in-out"],font:[Qw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[mn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[mn],shadow:[mn],spacing:["px",Pe],text:[mn],"text-shadow":[mn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",nr,de,fe,x]}],container:["container"],columns:[{columns:[Pe,de,fe,a]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow: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:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[_n,"auto",fe,de]}],basis:[{basis:[nr,"full","auto",a,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,nr,"auto","initial","none",de]}],grow:[{grow:["",Pe,fe,de]}],shrink:[{shrink:["",Pe,fe,de]}],order:[{order:[_n,"first","last","none",fe,de]}],"grid-cols":[{"grid-cols":b()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":b()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:re()}],mx:[{mx:re()}],my:[{my:re()}],ms:[{ms:re()}],me:[{me:re()}],mt:[{mt:re()}],mr:[{mr:re()}],mb:[{mb:re()}],ml:[{ml:re()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:ne()}],w:[{w:[a,"screen",...ne()]}],"min-w":[{"min-w":[a,"screen","none",...ne()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...ne()]}],h:[{h:["screen","lh",...ne()]}],"min-h":[{"min-h":["screen","lh","none",...ne()]}],"max-h":[{"max-h":["screen","lh",...ne()]}],"font-size":[{text:["base",n,Br,$n]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,fe,gs]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ms,de]}],"font-family":[{font:[tv,de,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,fe,de]}],"line-clamp":[{"line-clamp":[Pe,"none",fe,gs]}],leading:[{leading:[o,...N()]}],"list-image":[{"list-image":["none",fe,de]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,de]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",fe,$n]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[Pe,"auto",fe,de]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,de]}],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",fe,de]}],"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:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},_n,fe,de],radial:["",fe,de],conic:[_n,fe,de]},rv,ev]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],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:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":B()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...z(),"hidden","none"]}],"divide-style":[{divide:[...z(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,fe,de]}],"outline-w":[{outline:["",Pe,Br,$n]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",u,Di,Pi]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",d,Di,Pi]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[Pe,$n]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",f,Di,Pi]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[Pe,fe,de]}],"mix-blend":[{"mix-blend":[...K(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":K()}],"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":[Pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":q()}],"mask-image-linear-to-pos":[{"mask-linear-to":q()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":q()}],"mask-image-t-to-pos":[{"mask-t-to":q()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":q()}],"mask-image-r-to-pos":[{"mask-r-to":q()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":q()}],"mask-image-b-to-pos":[{"mask-b-to":q()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":q()}],"mask-image-l-to-pos":[{"mask-l-to":q()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":q()}],"mask-image-x-to-pos":[{"mask-x-to":q()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":q()}],"mask-image-y-to-pos":[{"mask-y-to":q()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[fe,de]}],"mask-image-radial-from-pos":[{"mask-radial-from":q()}],"mask-image-radial-to-pos":[{"mask-radial-to":q()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[Pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":q()}],"mask-image-conic-to-pos":[{"mask-conic-to":q()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"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:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,de]}],filter:[{filter:["","none",fe,de]}],blur:[{blur:me()}],brightness:[{brightness:[Pe,fe,de]}],contrast:[{contrast:[Pe,fe,de]}],"drop-shadow":[{"drop-shadow":["","none",p,Di,Pi]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",Pe,fe,de]}],"hue-rotate":[{"hue-rotate":[Pe,fe,de]}],invert:[{invert:["",Pe,fe,de]}],saturate:[{saturate:[Pe,fe,de]}],sepia:[{sepia:["",Pe,fe,de]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,de]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,fe,de]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,fe,de]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,fe,de]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,fe,de]}],"backdrop-invert":[{"backdrop-invert":["",Pe,fe,de]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,fe,de]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,fe,de]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,fe,de]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,de]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",fe,de]}],ease:[{ease:["linear","initial",y,fe,de]}],delay:[{delay:[Pe,fe,de]}],animate:[{animate:["none",k,fe,de]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,fe,de]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:Q()}],"rotate-x":[{"rotate-x":Q()}],"rotate-y":[{"rotate-y":Q()}],"rotate-z":[{"rotate-z":Q()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":["scale-3d"],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[fe,de,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"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",fe,de]}],"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":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",fe,de]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[Pe,Br,$n,gs]}],stroke:[{stroke:["none",...j()]}],"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"]}},av=Vw(sv);function Je(...e){return av(Ba.clsx(e))}function No(e){var i;if(!e)return{sessionSettings:{},capabilities:{},modality:"voice"};const t={session_timer:((i=e.session_settings)==null?void 0:i.session_timer)||null},n=e.capabilities||{},r=e.modality||"voice";return{sessionSettings:t,capabilities:n,modality:r}}function lv(e,t){return e.capabilities[t]===!0}function Ao(e){return e.sessionSettings.session_timer||null}function ap(e){const t=e.capabilities;return{userVideoEnabled:t.user_video_enabled!==!1,agentAvatarEnabled:t.agent_avatar_enabled!==!1,screenshareEnabled:t.screenshare_session_enabled!==!1}}function lp(e){const t=e.capabilities;return{suggestedReplyEnabled:t.suggested_reply_enabled!==!1,attachmentsEnabled:t.support_in_chat_attachments!==!1}}function cp(e){return{...e.capabilities}}function up(e){const t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`}const dp=A.forwardRef(({state:e,audioTrack:t,className:n},r)=>h.jsx("div",{ref:r,className:Je("",n),children:t?h.jsx($t.BarVisualizer,{barCount:5,state:e,options:{minHeight:5},trackRef:t,className:Je("flex aspect-video w-40 items-center justify-center gap-1"),children:h.jsx("span",{className:Je(["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]"])})}):h.jsx("div",{className:Je("flex aspect-video w-40 items-center justify-center"),children:h.jsx("div",{className:"flex flex-col items-center justify-center",children:h.jsx("div",{className:"flex gap-1",children:Array.from({length:5}).map((i,o)=>h.jsx("span",{className:Je(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear",e==="speaking"&&"animate-pulse bg-[#5c64f6]",e==="thinking"&&"animate-pulse bg-yellow-500"])},o))})})})}));dp.displayName="AgentTile";const cv=({videoTrack:e,className:t,ref:n})=>{var r,i;return!e||!e.publication||!e.participant?h.jsx("div",{ref:n,className:Je(t),children:h.jsx("div",{className:"w-full h-full bg-gray-200 rounded-md flex items-center justify-center",children:h.jsx("span",{className:"text-gray-500",children:"No video available"})})}):h.jsx("div",{ref:n,className:Je(t),children:h.jsx($t.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"})})},uv=Ie.create($t.VideoTrack),dv=({trackRef:e,className:t,ref:n})=>{var r,i;return h.jsx("div",{className:Je("bg-muted overflow-hidden rounded-md",t),children:h.jsx(uv,{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:Je("h-full w-auto")})})},Ou=Ie.create(dv),fv=Ie.create(dp),hv=Ie.create(cv),gn={initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{type:"spring",stiffness:675,damping:75,mass:1}},rr={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 pv(e,t){const{localParticipant:n}=Cw(t),r=n==null?void 0:n.getTrackPublication(e);return A.useMemo(()=>r&&n?{source:e,participant:n,publication:r}:void 0,[e,r,n])}function mv({chatOpen:e,client:t}){const{agent:{isActive:n=!1}={},session:r,state:i="idle",audioTrack:o,videoTrack:s}=t?xl(t):{agent:{isActive:!1},session:null,state:"idle",audioTrack:null,videoTrack:null},[a]=$t.useTracks([ce.Track.Source.ScreenShare]),l=pv(ce.Track.Source.Camera,t),c=l&&!l.publication.isMuted,u=a&&!a.publication.isMuted,d=c||u,f=n||r&&r.state==="active",p={...gn.transition,delay:e?0:.15},g={...gn.animate,scale:e?1:3,transition:p},m={...gn.animate,transition:p},x=p,y=p,k=s&&s.publication&&s.participant;return h.jsx("div",{className:"relative w-full h-full z-10 flex items-center justify-center",children:h.jsx("div",{className:"relative w-full h-full max-w-2xl px-4 md:px-0",children:h.jsxs("div",{className:Je(rr.grid),children:[f&&h.jsx("div",{className:Je(["grid",!e&&rr.agentChatClosed,e&&d&&rr.agentChatOpenWithSecondTile,e&&!d&&rr.agentChatOpenWithoutSecondTile]),children:h.jsxs("div",{className:"h-full flex items-center justify-center",children:[!k&&h.jsx(fv,{layoutId:"agent",...gn,animate:g,transition:x,state:i,audioTrack:o||void 0,className:Je(e?"h-[90px]":"h-auto w-full")},"agent"),k&&s&&h.jsx(hv,{layoutId:"avatar",...gn,animate:m,transition:y,videoTrack:s,className:Je(e?"h-[90px] [&>video]:h-[90px] [&>video]:w-auto":"h-auto w-full")},"avatar")]})}),h.jsx("div",{className:Je(["grid",e&&rr.secondTileChatOpen,!e&&rr.secondTileChatClosed]),children:h.jsxs("div",{className:"w-full px-10 flex items-center shadow-2xl justify-between",children:[l&&c&&h.jsx(Ou,{layout:"position",layoutId:"camera",...gn,trackRef:l,transition:{...gn.transition,delay:e?0:.15},className:"h-[60px] order-1"},"camera"),u&&h.jsx(Ou,{layout:"position",layoutId:"screen",...gn,trackRef:a,transition:{...gn.transition,delay:e?0:.15},className:"h-[70px] order-2"},"screen")]})})]})})})}const gv={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"}},bv={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"}},yv={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"}},Pu={dark:gv,light:bv,vox:yv};function Ct(e){return Pu[e]||Pu.vox}function Du({timeout:e}){const[t,n]=A.useState(100),r=A.useRef(null),i=A.useRef(null);return A.useEffect(()=>{if(!e||e<=0)return;n(100),i.current=Date.now();const o=()=>{if(!e||i.current===null)return;const s=Date.now()-i.current,a=Math.max(0,100-s/e*100);n(a),a>0&&(r.current=requestAnimationFrame(o))};return r.current=requestAnimationFrame(o),()=>{r.current&&cancelAnimationFrame(r.current)}},[e]),!e||e<=0?null:h.jsx("div",{className:"w-full h-1 relative top-1 rounded-t-4xl bg-gray-700 overflow-hidden",children:h.jsx(Ie.div,{className:"h-1 rounded-t-4xl dark:bg-white bg-blue-200 ",initial:{width:"100%"},animate:{width:`${Math.max(t,2)}%`},transition:{duration:.1,ease:"linear"},style:{minWidth:"2%"}})})}function li({interaction:e,theme:t,onDismiss:n,client:r,addLocalMessage:i}){var a;if(!e||!e.isVisible||!e.component)return null;const[o]=P.useState(()=>Date.now()),s=()=>e.component?P.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}):h.jsx("div",{className:"p-4 text-red-500",children:"Component not found"});switch(e.presentationMode){case"fullscreen":return h.jsx(Sr,{children:h.jsxs(Ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx(Du,{timeout:e.timeout}),h.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/80 text-white border-b border-gray-700",children:[h.jsx("h3",{className:"text-lg font-semibold",children:e.methodName.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase())}),h.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:h.jsx(We.X,{className:"w-5 h-5"})})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:s()})]})});case"embedded":default:return h.jsx(Sr,{children:h.jsx(Ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-fit rounded-lg ",children:h.jsxs("div",{children:[h.jsx(Du,{timeout:e.timeout}),s()]})})})}}function ci({duration:e,theme:t="vox",onTimerExpired:n,className:r="",showIcon:i=!0}){const[o,s]=A.useState(e),[a,l]=A.useState(!1);A.useEffect(()=>{if(o<=0){l(!0),n==null||n();return}const u=setInterval(()=>{s(d=>{const f=d-1;return f<=0?(l(!0),n==null||n(),0):f})},1e3);return()=>clearInterval(u)},[o,n]),A.useEffect(()=>{s(e),l(!1)},[e]);const c=()=>a?"text-red-500":o<=60?"text-orange-500":o<=300?"text-yellow-500":t==="dark"?"text-gray-300":"text-gray-600";return h.jsxs("div",{className:`flex items-center gap-1 text-sm ${c()} ${r}`,children:[i&&h.jsx(We.Clock,{className:"w-4 h-4"}),h.jsx("span",{className:"font-mono",children:up(o)}),a&&h.jsx("span",{className:"text-xs ml-1 text-red-500",children:"(Expired)"})]})}const xv=({logLevel:e}={})=>{const t=$t.useRoomContext();P.useEffect(()=>(ce.setLogLevel(e??"debug"),window.__lk_room=t,()=>{window.__lk_room=void 0}),[t,e])},fp=P.forwardRef((e,t)=>{const{alt:n,color:r="currentColor",size:i="1em",weight:o="regular",mirrored:s=!1,children:a,weights:l,...c}=e;return P.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,fill:r,viewBox:"0 0 256 256",transform:s?"scale(-1, 1)":void 0,...c},!!n&&P.createElement("title",null,n),a,l.get(o))});fp.displayName="SSRBase";const wv=new Map([["bold",P.createElement(P.Fragment,null,P.createElement("path",{d:"M140,32V64a12,12,0,0,1-24,0V32a12,12,0,0,1,24,0Zm33.25,62.75a12,12,0,0,0,8.49-3.52L204.37,68.6a12,12,0,0,0-17-17L164.77,74.26a12,12,0,0,0,8.48,20.49ZM224,116H192a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24Zm-42.26,48.77a12,12,0,1,0-17,17l22.63,22.63a12,12,0,0,0,17-17ZM128,180a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V192A12,12,0,0,0,128,180ZM74.26,164.77,51.63,187.4a12,12,0,0,0,17,17l22.63-22.63a12,12,0,1,0-17-17ZM76,128a12,12,0,0,0-12-12H32a12,12,0,0,0,0,24H64A12,12,0,0,0,76,128ZM68.6,51.63a12,12,0,1,0-17,17L74.26,91.23a12,12,0,0,0,17-17Z"}))],["duotone",P.createElement(P.Fragment,null,P.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),P.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"}))],["fill",P.createElement(P.Fragment,null,P.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm33.94,58.75,17-17a8,8,0,0,1,11.32,11.32l-17,17a8,8,0,0,1-11.31-11.31ZM48,136a8,8,0,0,1,0-16H72a8,8,0,0,1,0,16Zm46.06,37.25-17,17a8,8,0,0,1-11.32-11.32l17-17a8,8,0,0,1,11.31,11.31Zm0-79.19a8,8,0,0,1-11.31,0l-17-17A8,8,0,0,1,77.09,65.77l17,17A8,8,0,0,1,94.06,94.06ZM136,208a8,8,0,0,1-16,0V184a8,8,0,0,1,16,0Zm0-136a8,8,0,0,1-16,0V48a8,8,0,0,1,16,0Zm54.23,118.23a8,8,0,0,1-11.32,0l-17-17a8,8,0,0,1,11.31-11.31l17,17A8,8,0,0,1,190.23,190.23ZM208,136H184a8,8,0,0,1,0-16h24a8,8,0,0,1,0,16Z"}))],["light",P.createElement(P.Fragment,null,P.createElement("path",{d:"M134,32V64a6,6,0,0,1-12,0V32a6,6,0,0,1,12,0Zm39.25,56.75A6,6,0,0,0,177.5,87l22.62-22.63a6,6,0,0,0-8.48-8.48L169,78.5a6,6,0,0,0,4.24,10.25ZM224,122H192a6,6,0,0,0,0,12h32a6,6,0,0,0,0-12Zm-46.5,47A6,6,0,0,0,169,177.5l22.63,22.62a6,6,0,0,0,8.48-8.48ZM128,186a6,6,0,0,0-6,6v32a6,6,0,0,0,12,0V192A6,6,0,0,0,128,186ZM78.5,169,55.88,191.64a6,6,0,1,0,8.48,8.48L87,177.5A6,6,0,1,0,78.5,169ZM70,128a6,6,0,0,0-6-6H32a6,6,0,0,0,0,12H64A6,6,0,0,0,70,128ZM64.36,55.88a6,6,0,0,0-8.48,8.48L78.5,87A6,6,0,1,0,87,78.5Z"}))],["regular",P.createElement(P.Fragment,null,P.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"}))],["thin",P.createElement(P.Fragment,null,P.createElement("path",{d:"M132,32V64a4,4,0,0,1-8,0V32a4,4,0,0,1,8,0Zm41.25,54.75a4,4,0,0,0,2.83-1.18L198.71,63a4,4,0,0,0-5.66-5.66L170.43,79.92a4,4,0,0,0,2.82,6.83ZM224,124H192a4,4,0,0,0,0,8h32a4,4,0,0,0,0-8Zm-47.92,46.43a4,4,0,1,0-5.65,5.65l22.62,22.63a4,4,0,0,0,5.66-5.66ZM128,188a4,4,0,0,0-4,4v32a4,4,0,0,0,8,0V192A4,4,0,0,0,128,188ZM79.92,170.43,57.29,193.05A4,4,0,0,0,63,198.71l22.62-22.63a4,4,0,1,0-5.65-5.65ZM68,128a4,4,0,0,0-4-4H32a4,4,0,0,0,0,8H64A4,4,0,0,0,68,128ZM63,57.29A4,4,0,0,0,57.29,63L79.92,85.57a4,4,0,1,0,5.65-5.65Z"}))]]),vl=P.forwardRef((e,t)=>P.createElement(fp,{ref:t,...e,weights:wv}));vl.displayName="SpinnerIcon";function vv(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ev=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kv=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Sv={};function Lu(e,t){return(Sv.jsx?kv:Ev).test(e)}const Cv=/[ \t\n\f\r]/g;function _v(e){return typeof e=="object"?e.type==="text"?Fu(e.value):!1:Fu(e)}function Fu(e){return e.replace(Cv,"")===""}class bi{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}bi.prototype.normal={};bi.prototype.property={};bi.prototype.space=void 0;function hp(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new bi(n,r,t)}function va(e){return e.toLowerCase()}class zt{constructor(t,n){this.attribute=n,this.property=t}}zt.prototype.attribute="";zt.prototype.booleanish=!1;zt.prototype.boolean=!1;zt.prototype.commaOrSpaceSeparated=!1;zt.prototype.commaSeparated=!1;zt.prototype.defined=!1;zt.prototype.mustUseProperty=!1;zt.prototype.number=!1;zt.prototype.overloadedBoolean=!1;zt.prototype.property="";zt.prototype.spaceSeparated=!1;zt.prototype.space=void 0;let Tv=0;const Me=Qn(),xt=Qn(),Ea=Qn(),X=Qn(),it=Qn(),vr=Qn(),Ht=Qn();function Qn(){return 2**++Tv}const ka=Object.freeze(Object.defineProperty({__proto__:null,boolean:Me,booleanish:xt,commaOrSpaceSeparated:Ht,commaSeparated:vr,number:X,overloadedBoolean:Ea,spaceSeparated:it},Symbol.toStringTag,{value:"Module"})),bs=Object.keys(ka);class El extends zt{constructor(t,n,r,i){let o=-1;if(super(t,n),Bu(this,"space",i),typeof r=="number")for(;++o<bs.length;){const s=bs[o];Bu(this,bs[o],(r&ka[s])===ka[s])}}}El.prototype.defined=!0;function Bu(e,t,n){n&&(e[t]=n)}function Pr(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new El(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[va(r)]=r,n[va(o.attribute)]=r}return new bi(t,n,e.space)}const pp=Pr({properties:{ariaActiveDescendant:null,ariaAtomic:xt,ariaAutoComplete:null,ariaBusy:xt,ariaChecked:xt,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:it,ariaCurrent:null,ariaDescribedBy:it,ariaDetails:null,ariaDisabled:xt,ariaDropEffect:it,ariaErrorMessage:null,ariaExpanded:xt,ariaFlowTo:it,ariaGrabbed:xt,ariaHasPopup:null,ariaHidden:xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:it,ariaLevel:X,ariaLive:null,ariaModal:xt,ariaMultiLine:xt,ariaMultiSelectable:xt,ariaOrientation:null,ariaOwns:it,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:xt,ariaReadOnly:xt,ariaRelevant:null,ariaRequired:xt,ariaRoleDescription:it,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:xt,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 mp(e,t){return t in e?e[t]:t}function gp(e,t){return mp(e,t.toLowerCase())}const Nv=Pr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:vr,acceptCharset:it,accessKey:it,action:null,allow:null,allowFullScreen:Me,allowPaymentRequest:Me,allowUserMedia:Me,alt:null,as:null,async:Me,autoCapitalize:null,autoComplete:it,autoFocus:Me,autoPlay:Me,blocking:it,capture:null,charSet:null,checked:Me,cite:null,className:it,cols:X,colSpan:null,content:null,contentEditable:xt,controls:Me,controlsList:it,coords:X|vr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Me,defer:Me,dir:null,dirName:null,disabled:Me,download:Ea,draggable:xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Me,formTarget:null,headers:it,height:X,hidden:Ea,high:X,href:null,hrefLang:null,htmlFor:it,httpEquiv:it,id:null,imageSizes:null,imageSrcSet:null,inert:Me,inputMode:null,integrity:null,is:null,isMap:Me,itemId:null,itemProp:it,itemRef:it,itemScope:Me,itemType:it,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Me,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:Me,muted:Me,name:null,nonce:null,noModule:Me,noValidate:Me,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:Me,optimum:X,pattern:null,ping:it,placeholder:null,playsInline:Me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Me,referrerPolicy:null,rel:it,required:Me,reversed:Me,rows:X,rowSpan:X,sandbox:it,scope:null,scoped:Me,seamless:Me,selected:Me,shadowRootClonable:Me,shadowRootDelegatesFocus:Me,shadowRootMode:null,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:xt,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:Me,useMap:null,value:xt,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:it,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:Me,declare:Me,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:Me,noHref:Me,noShade:Me,noWrap:Me,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:xt,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:Me,disableRemotePlayback:Me,prefix:null,property:null,results:X,security:null,unselectable:null},space:"html",transform:gp}),Av=Pr({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:Ht,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:it,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:Me,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:vr,g2:vr,glyphName:vr,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:Ht,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:it,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ht,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ht,rev:Ht,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ht,requiredFeatures:Ht,requiredFonts:Ht,requiredFormats:Ht,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:Ht,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:Ht,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:Ht,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:mp}),bp=Pr({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()}}),yp=Pr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:gp}),xp=Pr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Rv={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"},Mv=/[A-Z]/g,ju=/-[a-z]/g,Iv=/^data[-\w.:]+$/i;function Ov(e,t){const n=va(t);let r=t,i=zt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Iv.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ju,Dv);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ju.test(o)){let s=o.replace(Mv,Pv);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=El}return new i(r,t)}function Pv(e){return"-"+e.toLowerCase()}function Dv(e){return e.charAt(1).toUpperCase()}const Lv=hp([pp,Nv,bp,yp,xp],"html"),kl=hp([pp,Av,bp,yp,xp],"svg");function Fv(e){return e.join(" ").trim()}function Ro(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ir={},ys,$u;function Bv(){if($u)return ys;$u=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
30
- `,c="/",u="*",d="",f="comment",p="declaration";ys=function(m,x){if(typeof m!="string")throw new TypeError("First argument must be a string");if(!m)return[];x=x||{};var y=1,k=1;function v(D){var $=D.match(t);$&&(y+=$.length);var U=D.lastIndexOf(l);k=~U?D.length-U:k+D.length}function _(){var D={line:y,column:k};return function($){return $.position=new S(D),N(),$}}function S(D){this.start=D,this.end={line:y,column:k},this.source=x.source}S.prototype.content=m;function C(D){var $=new Error(x.source+":"+y+":"+k+": "+D);if($.reason=D,$.filename=x.source,$.line=y,$.column=k,$.source=m,!x.silent)throw $}function M(D){var $=D.exec(m);if($){var U=$[0];return v(U),m=m.slice(U.length),$}}function N(){M(n)}function I(D){var $;for(D=D||[];$=b();)$!==!1&&D.push($);return D}function b(){var D=_();if(!(c!=m.charAt(0)||u!=m.charAt(1))){for(var $=2;d!=m.charAt($)&&(u!=m.charAt($)||c!=m.charAt($+1));)++$;if($+=2,d===m.charAt($-1))return C("End of comment missing");var U=m.slice(2,$-2);return k+=2,v(U),m=m.slice($),k+=2,D({type:f,comment:U})}}function R(){var D=_(),$=M(r);if($){if(b(),!M(i))return C("property missing ':'");var U=M(o),re=D({type:p,property:g($[0].replace(e,d)),value:U?g(U[0].replace(e,d)):d});return M(s),re}}function O(){var D=[];I(D);for(var $;$=R();)$!==!1&&(D.push($),I(D));return D}return N(),O()};function g(m){return m?m.replace(a,d):d}return ys}var Vu;function jv(){if(Vu)return ir;Vu=1;var e=ir&&ir.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ir,"__esModule",{value:!0}),ir.default=n;var t=e(Bv());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var s=(0,t.default)(r),a=typeof i=="function";return s.forEach(function(l){if(l.type==="declaration"){var c=l.property,u=l.value;a?i(c,u,l):u&&(o=o||{},o[c]=u)}}),o}return ir}var jr={},zu;function $v(){if(zu)return jr;zu=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(c){return!c||n.test(c)||e.test(c)},s=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),o(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(i,a):c=c.replace(r,a),c.replace(t,s))};return jr.camelCase=l,jr}var $r,Uu;function Vv(){if(Uu)return $r;Uu=1;var e=$r&&$r.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(jv()),n=$v();function r(i,o){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(a,l){a&&l&&(s[(0,n.camelCase)(a,o)]=l)}),s}return r.default=r,$r=r,$r}var zv=Vv();const Uv=Ro(zv),wp=vp("end"),Sl=vp("start");function vp(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 Hv(e){const t=Sl(e),n=wp(e);if(t&&n)return{start:t,end:n}}function Qr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Hu(e.position):"start"in e||"end"in e?Hu(e):"line"in e||"column"in e?Sa(e):""}function Sa(e){return Wu(e&&e.line)+":"+Wu(e&&e.column)}function Hu(e){return Sa(e&&e.start)+"-"+Sa(e&&e.end)}function Wu(e){return e&&typeof e=="number"?e:1}class Ot extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.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=Qr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ot.prototype.file="";Ot.prototype.name="";Ot.prototype.reason="";Ot.prototype.message="";Ot.prototype.stack="";Ot.prototype.column=void 0;Ot.prototype.line=void 0;Ot.prototype.ancestors=void 0;Ot.prototype.cause=void 0;Ot.prototype.fatal=void 0;Ot.prototype.place=void 0;Ot.prototype.ruleId=void 0;Ot.prototype.source=void 0;const Cl={}.hasOwnProperty,Wv=new Map,Gv=/[A-Z]/g,Kv=new Set(["table","tbody","thead","tfoot","tr"]),qv=new Set(["td","th"]),Ep="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Yv(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=rE(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=nE(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"?kl:Lv,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=kp(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function kp(e,t,n){if(t.type==="element")return Zv(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Xv(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Jv(e,t,n);if(t.type==="mdxjsEsm")return Qv(e,t);if(t.type==="root")return eE(e,t,n);if(t.type==="text")return tE(e,t)}function Zv(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=kl,e.schema=i),e.ancestors.push(t);const o=Cp(e,t.tagName,!1),s=iE(e,t);let a=Tl(e,t);return Kv.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!_v(l):!0})),Sp(e,s,o,t),_l(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Xv(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)}ui(e,t.position)}function Qv(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ui(e,t.position)}function Jv(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=kl,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Cp(e,t.name,!0),s=oE(e,t),a=Tl(e,t);return Sp(e,s,o,t),_l(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function eE(e,t,n){const r={};return _l(r,Tl(e,t)),e.create(t,e.Fragment,r,n)}function tE(e,t){return t.value}function Sp(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function _l(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function nE(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function rE(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Sl(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function iE(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Cl.call(t.properties,i)){const o=sE(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&qv.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function oE(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ui(e,t.position);else{const i=r.name;let o;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,o=e.evaluater.evaluateExpression(a.expression)}else ui(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Tl(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Wv;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=kp(e,o,s);a!==void 0&&n.push(a)}return n}function sE(e,t,n){const r=Ov(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?vv(n):Fv(n)),r.property==="style"){let i=typeof n=="object"?n:aE(e,String(n));return e.stylePropertyNameCase==="css"&&(i=lE(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Rv[r.property]||r.property:r.attribute,n]}}function aE(e,t){try{return Uv(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ot("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=Ep+"#cannot-parse-style-attribute",i}}function Cp(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=Lu(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=Lu(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Cl.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ui(e)}function ui(e,t){const n=new Ot("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=Ep+"#cannot-handle-mdx-estrees-without-createevaluater",n}function lE(e){const t={};let n;for(n in e)Cl.call(e,n)&&(t[cE(n)]=e[n]);return t}function cE(e){let t=e.replace(Gv,uE);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function uE(e){return"-"+e.toLowerCase()}const xs={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"]},dE={};function Nl(e,t){const n=dE,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return _p(e,r,i)}function _p(e,t,n){if(fE(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 Gu(e.children,t,n)}return Array.isArray(e)?Gu(e,t,n):""}function Gu(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=_p(e[i],t,n);return r.join("")}function fE(e){return!!(e&&typeof e=="object")}const Ku=document.createElement("i");function Al(e){const t="&"+e+";";Ku.innerHTML=t;const n=Ku.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Gt(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Zt(e,t){return e.length>0?(Gt(e,e.length,0,t),e):t}const qu={}.hasOwnProperty;function Tp(e){const t={};let n=-1;for(;++n<e.length;)hE(t,e[n]);return t}function hE(e,t){let n;for(n in t){const i=(qu.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){qu.call(i,s)||(i[s]=[]);const a=o[s];pE(i[s],Array.isArray(a)?a:a?[a]:[])}}}function pE(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Gt(e,0,0,r)}function Np(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 rn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Dt=Ln(/[A-Za-z]/),It=Ln(/[\dA-Za-z]/),mE=Ln(/[#-'*+\--9=?A-Z^-~]/);function po(e){return e!==null&&(e<32||e===127)}const Ca=Ln(/\d/),gE=Ln(/[\dA-Fa-f]/),bE=Ln(/[!-/:-@[-`{-~]/);function xe(e){return e!==null&&e<-2}function et(e){return e!==null&&(e<0||e===32)}function De(e){return e===-2||e===-1||e===32}const Mo=Ln(new RegExp("\\p{P}|\\p{S}","u")),Zn=Ln(/\s/);function Ln(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Dr(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&It(e.charCodeAt(n+1))&&It(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Be(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return De(l)?(e.enter(n),a(l)):t(l)}function a(l){return De(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const yE={tokenize:xE};function xE(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"),Be(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return xe(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const wE={tokenize:vE},Yu={tokenize:EE};function vE(e){const t=this,n=[];let r=0,i,o,s;return a;function a(v){if(r<n.length){const _=n[r];return t.containerState=_[1],e.attempt(_[0].continuation,l,c)(v)}return c(v)}function l(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&k();const _=t.events.length;let S=_,C;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){C=t.events[S][1].end;break}y(r);let M=_;for(;M<t.events.length;)t.events[M][1].end={...C},M++;return Gt(t.events,S+1,0,t.events.slice(_)),t.events.length=M,c(v)}return a(v)}function c(v){if(r===n.length){if(!i)return f(v);if(i.currentConstruct&&i.currentConstruct.concrete)return g(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Yu,u,d)(v)}function u(v){return i&&k(),y(r),f(v)}function d(v){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(v)}function f(v){return t.containerState={},e.attempt(Yu,p,g)(v)}function p(v){return r++,n.push([t.currentConstruct,t.containerState]),f(v)}function g(v){if(v===null){i&&k(),y(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),m(v)}function m(v){if(v===null){x(e.exit("chunkFlow"),!0),y(0),e.consume(v);return}return xe(v)?(e.consume(v),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(v),m)}function x(v,_){const S=t.sliceStream(v);if(_&&S.push(null),v.previous=o,o&&(o.next=v),o=v,i.defineSkip(v.start),i.write(S),t.parser.lazy[v.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<s&&(!i.events[C][1].end||i.events[C][1].end.offset>s))return;const M=t.events.length;let N=M,I,b;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(I){b=t.events[N][1].end;break}I=!0}for(y(r),C=M;C<t.events.length;)t.events[C][1].end={...b},C++;Gt(t.events,N+1,0,t.events.slice(M)),t.events.length=C}}function y(v){let _=n.length;for(;_-- >v;){const S=n[_];t.containerState=S[1],S[0].exit.call(t,e)}n.length=v}function k(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function EE(e,t,n){return Be(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _r(e){if(e===null||et(e)||Zn(e))return 1;if(Mo(e))return 2}function Io(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const _a={name:"attention",resolveAll:kE,tokenize:SE};function kE(e,t){let n=-1,r,i,o,s,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},f={...e[n][1].start};Zu(d,-l),Zu(f,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Zt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Zt(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=Zt(c,Io(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Zt(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Zt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Gt(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 SE(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=_r(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),u=_r(l),d=!u||u===2&&i||n.includes(l),f=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?d:d&&(i||!f)),c._close=!!(o===42?f:f&&(u||!d)),t(l)}}function Zu(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const CE={name:"autolink",tokenize:_E};function _E(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Dt(p)?(e.consume(p),s):p===64?n(p):c(p)}function s(p){return p===43||p===45||p===46||It(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||It(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||po(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):mE(p)?(e.consume(p),c):n(p)}function u(p){return It(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||It(p))&&r++<63){const g=p===45?f:d;return e.consume(p),g}return n(p)}}const yi={partial:!0,tokenize:TE};function TE(e,t,n){return r;function r(o){return De(o)?Be(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||xe(o)?t(o):n(o)}}const Ap={continuation:{tokenize:AE},exit:RE,name:"blockQuote",tokenize:NE};function NE(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return De(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function AE(e,t,n){const r=this;return i;function i(s){return De(s)?Be(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Ap,t,n)(s)}}function RE(e){e.exit("blockQuote")}const Rp={name:"characterEscape",tokenize:ME};function ME(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return bE(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Mp={name:"characterReference",tokenize:IE};function IE(e,t,n){const r=this;let i=0,o,s;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"),o=31,s=It,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=gE,u):(e.enter("characterReferenceValue"),o=7,s=Ca,u(d))}function u(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return s===It&&!Al(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),u):n(d)}}const Xu={partial:!0,tokenize:PE},Qu={concrete:!0,name:"codeFenced",tokenize:OE};function OE(e,t,n){const r=this,i={partial:!0,tokenize:S};let o=0,s=0,a;return l;function l(C){return c(C)}function c(C){const M=r.events[r.events.length-1];return o=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?(s++,e.consume(C),u):s<3?n(C):(e.exit("codeFencedFenceSequence"),De(C)?Be(e,d,"whitespace")(C):d(C))}function d(C){return C===null||xe(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Xu,m,_)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(C))}function f(C){return C===null||xe(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):De(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Be(e,p,"whitespace")(C)):C===96&&C===a?n(C):(e.consume(C),f)}function p(C){return C===null||xe(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===null||xe(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===a?n(C):(e.consume(C),g)}function m(C){return e.attempt(i,_,x)(C)}function x(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),y}function y(C){return o>0&&De(C)?Be(e,k,"linePrefix",o+1)(C):k(C)}function k(C){return C===null||xe(C)?e.check(Xu,m,_)(C):(e.enter("codeFlowValue"),v(C))}function v(C){return C===null||xe(C)?(e.exit("codeFlowValue"),k(C)):(e.consume(C),v)}function _(C){return e.exit("codeFenced"),t(C)}function S(C,M,N){let I=0;return b;function b(U){return C.enter("lineEnding"),C.consume(U),C.exit("lineEnding"),R}function R(U){return C.enter("codeFencedFence"),De(U)?Be(C,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):O(U)}function O(U){return U===a?(C.enter("codeFencedFenceSequence"),D(U)):N(U)}function D(U){return U===a?(I++,C.consume(U),D):I>=s?(C.exit("codeFencedFenceSequence"),De(U)?Be(C,$,"whitespace")(U):$(U)):N(U)}function $(U){return U===null||xe(U)?(C.exit("codeFencedFence"),M(U)):N(U)}}}function PE(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ws={name:"codeIndented",tokenize:LE},DE={partial:!0,tokenize:FE};function LE(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Be(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):xe(c)?e.attempt(DE,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||xe(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function FE(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):xe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Be(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):xe(s)?i(s):n(s)}}const BE={name:"codeText",previous:$E,resolve:jE,tokenize:VE};function jE(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 $E(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function VE(e,t,n){let r=0,i,o;return s;function s(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?(o=e.enter("codeTextSequence"),i=0,u(d)):xe(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||xe(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)):(o.type="codeTextData",c(d))}}class zE{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 o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Vr(this.left,r),o.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),Vr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vr(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);Vr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Vr(this.left,n.reverse())}}}function Vr(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 Ip(e){const t={};let n=-1,r,i,o,s,a,l,c;const u=new zE(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,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,UE(u,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=u.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[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 Gt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function UE(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,d,f=-1,p=n,g=0,m=0;const x=[m];for(;p;){for(;e.get(++i)[1]!==p;);o.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(m=f+1,x.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),f=x.length;f--;){const y=a.slice(x[f],x[f+1]),k=o.pop();l.push([k,k+y.length-1]),e.splice(k,2,y)}for(l.reverse(),f=-1;++f<l.length;)c[g+l[f][0]]=g+l[f][1],g+=l[f][1]-l[f][0]-1;return c}const HE={resolve:GE,tokenize:KE},WE={partial:!0,tokenize:qE};function GE(e){return Ip(e),e}function KE(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?o(a):xe(a)?e.check(WE,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function qE(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Be(e,o,"linePrefix")}function o(s){if(s===null||xe(s))return n(s);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(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Op(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),f):y===null||y===32||y===41||po(y)?n(y):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(y))}function f(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(a),f(y)):y===null||y===60||xe(y)?n(y):(e.consume(y),y===92?g:p)}function g(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function m(y){return!u&&(y===null||y===41||et(y))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(y)):u<c&&y===40?(e.consume(y),u++,m):y===41?(e.consume(y),u--,m):y===null||y===32||y===40||po(y)?n(y):(e.consume(y),y===92?x:m)}function x(y){return y===40||y===41||y===92?(e.consume(y),m):m(y)}}function Pp(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):xe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||xe(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!De(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function Dp(e,t,n,r,i,o){let s;return a;function a(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),s=f===40?41:f,l):n(f)}function l(f){return f===s?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(o),c(f))}function c(f){return f===s?(e.exit(o),l(s)):f===null?n(f):xe(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Be(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===s||f===null||xe(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:u)}function d(f){return f===s||f===92?(e.consume(f),u):u(f)}}function Jr(e,t){let n;return r;function r(i){return xe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):De(i)?Be(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const YE={name:"definition",tokenize:XE},ZE={partial:!0,tokenize:QE};function XE(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return Pp.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=rn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return et(p)?Jr(e,c)(p):c(p)}function c(p){return Op(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(ZE,d,d)(p)}function d(p){return De(p)?Be(e,f,"whitespace")(p):f(p)}function f(p){return p===null||xe(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function QE(e,t,n){return r;function r(a){return et(a)?Jr(e,i)(a):n(a)}function i(a){return Dp(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return De(a)?Be(e,s,"whitespace")(a):s(a)}function s(a){return a===null||xe(a)?t(a):n(a)}}const JE={name:"hardBreakEscape",tokenize:ek};function ek(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return xe(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const tk={name:"headingAtx",resolve:nk,tokenize:rk};function nk(e,t){let n=e.length-2,r=3,i,o;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},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Gt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function rk(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||et(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||xe(u)?(e.exit("atxHeading"),t(u)):De(u)?Be(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||et(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const ik=["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"],Ju=["pre","script","style","textarea"],ok={concrete:!0,name:"htmlFlow",resolveTo:lk,tokenize:ck},sk={partial:!0,tokenize:dk},ak={partial:!0,tokenize:uk};function lk(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 ck(e,t,n){const r=this;let i,o,s,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),f):E===47?(e.consume(E),o=!0,m):E===63?(e.consume(E),i=3,r.interrupt?t:w):Dt(E)?(e.consume(E),s=String.fromCharCode(E),x):n(E)}function f(E){return E===45?(e.consume(E),i=2,p):E===91?(e.consume(E),i=5,a=0,g):Dt(E)?(e.consume(E),i=4,r.interrupt?t:w):n(E)}function p(E){return E===45?(e.consume(E),r.interrupt?t:w):n(E)}function g(E){const B="CDATA[";return E===B.charCodeAt(a++)?(e.consume(E),a===B.length?r.interrupt?t:O:g):n(E)}function m(E){return Dt(E)?(e.consume(E),s=String.fromCharCode(E),x):n(E)}function x(E){if(E===null||E===47||E===62||et(E)){const B=E===47,z=s.toLowerCase();return!B&&!o&&Ju.includes(z)?(i=1,r.interrupt?t(E):O(E)):ik.includes(s.toLowerCase())?(i=6,B?(e.consume(E),y):r.interrupt?t(E):O(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):o?k(E):v(E))}return E===45||It(E)?(e.consume(E),s+=String.fromCharCode(E),x):n(E)}function y(E){return E===62?(e.consume(E),r.interrupt?t:O):n(E)}function k(E){return De(E)?(e.consume(E),k):b(E)}function v(E){return E===47?(e.consume(E),b):E===58||E===95||Dt(E)?(e.consume(E),_):De(E)?(e.consume(E),v):b(E)}function _(E){return E===45||E===46||E===58||E===95||It(E)?(e.consume(E),_):S(E)}function S(E){return E===61?(e.consume(E),C):De(E)?(e.consume(E),S):v(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):De(E)?(e.consume(E),C):N(E)}function M(E){return E===l?(e.consume(E),l=null,I):E===null||xe(E)?n(E):(e.consume(E),M)}function N(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||et(E)?S(E):(e.consume(E),N)}function I(E){return E===47||E===62||De(E)?v(E):n(E)}function b(E){return E===62?(e.consume(E),R):n(E)}function R(E){return E===null||xe(E)?O(E):De(E)?(e.consume(E),R):n(E)}function O(E){return E===45&&i===2?(e.consume(E),re):E===60&&i===1?(e.consume(E),ne):E===62&&i===4?(e.consume(E),F):E===63&&i===3?(e.consume(E),w):E===93&&i===5?(e.consume(E),W):xe(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(sk,Y,D)(E)):E===null||xe(E)?(e.exit("htmlFlowData"),D(E)):(e.consume(E),O)}function D(E){return e.check(ak,$,Y)(E)}function $(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),U}function U(E){return E===null||xe(E)?D(E):(e.enter("htmlFlowData"),O(E))}function re(E){return E===45?(e.consume(E),w):O(E)}function ne(E){return E===47?(e.consume(E),s="",j):O(E)}function j(E){if(E===62){const B=s.toLowerCase();return Ju.includes(B)?(e.consume(E),F):O(E)}return Dt(E)&&s.length<8?(e.consume(E),s+=String.fromCharCode(E),j):O(E)}function W(E){return E===93?(e.consume(E),w):O(E)}function w(E){return E===62?(e.consume(E),F):E===45&&i===2?(e.consume(E),w):O(E)}function F(E){return E===null||xe(E)?(e.exit("htmlFlowData"),Y(E)):(e.consume(E),F)}function Y(E){return e.exit("htmlFlow"),t(E)}}function uk(e,t,n){const r=this;return i;function i(s){return xe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function dk(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yi,t,n)}}const fk={name:"htmlText",tokenize:hk};function hk(e,t,n){const r=this;let i,o,s;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),S):w===63?(e.consume(w),v):Dt(w)?(e.consume(w),N):n(w)}function c(w){return w===45?(e.consume(w),u):w===91?(e.consume(w),o=0,g):Dt(w)?(e.consume(w),k):n(w)}function u(w){return w===45?(e.consume(w),p):n(w)}function d(w){return w===null?n(w):w===45?(e.consume(w),f):xe(w)?(s=d,ne(w)):(e.consume(w),d)}function f(w){return w===45?(e.consume(w),p):d(w)}function p(w){return w===62?re(w):w===45?f(w):d(w)}function g(w){const F="CDATA[";return w===F.charCodeAt(o++)?(e.consume(w),o===F.length?m:g):n(w)}function m(w){return w===null?n(w):w===93?(e.consume(w),x):xe(w)?(s=m,ne(w)):(e.consume(w),m)}function x(w){return w===93?(e.consume(w),y):m(w)}function y(w){return w===62?re(w):w===93?(e.consume(w),y):m(w)}function k(w){return w===null||w===62?re(w):xe(w)?(s=k,ne(w)):(e.consume(w),k)}function v(w){return w===null?n(w):w===63?(e.consume(w),_):xe(w)?(s=v,ne(w)):(e.consume(w),v)}function _(w){return w===62?re(w):v(w)}function S(w){return Dt(w)?(e.consume(w),C):n(w)}function C(w){return w===45||It(w)?(e.consume(w),C):M(w)}function M(w){return xe(w)?(s=M,ne(w)):De(w)?(e.consume(w),M):re(w)}function N(w){return w===45||It(w)?(e.consume(w),N):w===47||w===62||et(w)?I(w):n(w)}function I(w){return w===47?(e.consume(w),re):w===58||w===95||Dt(w)?(e.consume(w),b):xe(w)?(s=I,ne(w)):De(w)?(e.consume(w),I):re(w)}function b(w){return w===45||w===46||w===58||w===95||It(w)?(e.consume(w),b):R(w)}function R(w){return w===61?(e.consume(w),O):xe(w)?(s=R,ne(w)):De(w)?(e.consume(w),R):I(w)}function O(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),i=w,D):xe(w)?(s=O,ne(w)):De(w)?(e.consume(w),O):(e.consume(w),$)}function D(w){return w===i?(e.consume(w),i=void 0,U):w===null?n(w):xe(w)?(s=D,ne(w)):(e.consume(w),D)}function $(w){return w===null||w===34||w===39||w===60||w===61||w===96?n(w):w===47||w===62||et(w)?I(w):(e.consume(w),$)}function U(w){return w===47||w===62||et(w)?I(w):n(w)}function re(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):n(w)}function ne(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),j}function j(w){return De(w)?Be(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):W(w)}function W(w){return e.enter("htmlTextData"),s(w)}}const Rl={name:"labelEnd",resolveAll:bk,resolveTo:yk,tokenize:xk},pk={tokenize:wk},mk={tokenize:vk},gk={tokenize:Ek};function bk(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&&Gt(e,0,e.length,n),e}function yk(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=Zt(a,e.slice(o+1,o+r+3)),a=Zt(a,[["enter",u,t]]),a=Zt(a,Io(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=Zt(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=Zt(a,e.slice(s+1)),a=Zt(a,[["exit",l,t]]),Gt(e,o,e.length,a),e}function xk(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(f){return o?o._inactive?d(f):(s=r.parser.defined.includes(rn(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(pk,u,s?u:d)(f):f===91?e.attempt(mk,u,s?c:d)(f):s?u(f):d(f)}function c(f){return e.attempt(gk,u,d)(f)}function u(f){return t(f)}function d(f){return o._balanced=!0,n(f)}}function wk(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 et(d)?Jr(e,o)(d):o(d)}function o(d){return d===41?u(d):Op(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return et(d)?Jr(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?Dp(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return et(d)?Jr(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 vk(e,t,n){const r=this;return i;function i(a){return Pp.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(rn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Ek(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const kk={name:"labelStartImage",resolveAll:Rl.resolveAll,tokenize:Sk};function Sk(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Ck={name:"labelStartLink",resolveAll:Rl.resolveAll,tokenize:_k};function _k(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const vs={name:"lineEnding",tokenize:Tk};function Tk(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Be(e,t,"linePrefix")}}const no={name:"thematicBreak",tokenize:Nk};function Nk(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||xe(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),De(c)?Be(e,a,"whitespace")(c):a(c))}}const jt={continuation:{tokenize:Ik},exit:Pk,name:"list",tokenize:Mk},Ak={partial:!0,tokenize:Dk},Rk={partial:!0,tokenize:Ok};function Mk(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Ca(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(no,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Ca(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(yi,r.interrupt?n:u,e.attempt(Ak,f,d))}function u(p){return r.containerState.initialBlankLine=!0,o++,f(p)}function d(p){return De(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Ik(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yi,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Be(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!De(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Rk,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Be(e,e.attempt(jt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Ok(e,t,n){const r=this;return Be(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Pk(e){e.exit(this.containerState.type)}function Dk(e,t,n){const r=this;return Be(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!De(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const ed={name:"setextUnderline",resolveTo:Lk,tokenize:Fk};function Lk(e,t){let n=e.length,r,i,o;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),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Fk(e,t,n){const r=this;let i;return o;function o(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,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),De(c)?Be(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||xe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Bk={tokenize:jk};function jk(e){const t=this,n=e.attempt(yi,r,e.attempt(this.parser.constructs.flowInitial,i,Be(e,e.attempt(this.parser.constructs.flow,i,e.attempt(HE,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const $k={resolveAll:Fp()},Vk=Lp("string"),zk=Lp("text");function Lp(e){return{resolveAll:Fp(e==="text"?Uk:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(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"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let f=-1;if(d)for(;++f<d.length;){const p=d[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Fp(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Uk(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 o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,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 Hk={42:jt,43:jt,45:jt,48:jt,49:jt,50:jt,51:jt,52:jt,53:jt,54:jt,55:jt,56:jt,57:jt,62:Ap},Wk={91:YE},Gk={[-2]:ws,[-1]:ws,32:ws},Kk={35:tk,42:no,45:[ed,no],60:ok,61:ed,95:no,96:Qu,126:Qu},qk={38:Mp,92:Rp},Yk={[-5]:vs,[-4]:vs,[-3]:vs,33:kk,38:Mp,42:_a,60:[CE,fk],91:Ck,92:[JE,Rp],93:Rl,95:_a,96:BE},Zk={null:[_a,$k]},Xk={null:[42,95]},Qk={null:[]},Jk=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Xk,contentInitial:Wk,disable:Qk,document:Hk,flow:Kk,flowInitial:Gk,insideSpan:Zk,string:qk,text:Yk},Symbol.toStringTag,{value:"Module"}));function eS(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={},o=[];let s=[],a=[];const l={attempt:M(S),check:M(C),consume:k,enter:v,exit:_,interrupt:M(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:g,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function d(R){return s=Zt(s,R),x(),s[s.length-1]!==null?[]:(N(t,0),c.events=Io(o,c.events,c),c.events)}function f(R,O){return nS(p(R),O)}function p(R){return tS(s,R)}function g(){const{_bufferIndex:R,_index:O,line:D,column:$,offset:U}=r;return{_bufferIndex:R,_index:O,line:D,column:$,offset:U}}function m(R){i[R.line]=R.column,b()}function x(){let R;for(;r._index<s.length;){const O=s[r._index];if(typeof O=="string")for(R=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===R&&r._bufferIndex<O.length;)y(O.charCodeAt(r._bufferIndex));else y(O)}}function y(R){u=u(R)}function k(R){xe(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,b()):R!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=R}function v(R,O){const D=O||{};return D.type=R,D.start=g(),c.events.push(["enter",D,c]),a.push(D),D}function _(R){const O=a.pop();return O.end=g(),c.events.push(["exit",O,c]),O}function S(R,O){N(R,O.from)}function C(R,O){O.restore()}function M(R,O){return D;function D($,U,re){let ne,j,W,w;return Array.isArray($)?Y($):"tokenize"in $?Y([$]):F($);function F(K){return q;function q(me){const Q=me!==null&&K[me],le=me!==null&&K.null,he=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(le)?le:le?[le]:[]];return Y(he)(me)}}function Y(K){return ne=K,j=0,K.length===0?re:E(K[j])}function E(K){return q;function q(me){return w=I(),W=K,K.partial||(c.currentConstruct=K),K.name&&c.parser.constructs.disable.null.includes(K.name)?z():K.tokenize.call(O?Object.assign(Object.create(c),O):c,l,B,z)(me)}}function B(K){return R(W,w),U}function z(K){return w.restore(),++j<ne.length?E(ne[j]):re}}}function N(R,O){R.resolveAll&&!o.includes(R)&&o.push(R),R.resolve&&Gt(c.events,O,c.events.length-O,R.resolve(c.events.slice(O),c)),R.resolveTo&&(c.events=R.resolveTo(c.events,c))}function I(){const R=g(),O=c.previous,D=c.currentConstruct,$=c.events.length,U=Array.from(a);return{from:$,restore:re};function re(){r=R,c.previous=O,c.currentConstruct=D,c.events.length=$,a=U,b()}}function b(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function tS(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function nS(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
29
+ `),()=>{m.contains(g)&&m.removeChild(g)}},[t]),h.jsx(zy,{isPresent:t,childRef:o,sizeRef:s,children:D.cloneElement(e,{ref:o})})}const Hy=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s,anchorX:a,root:l})=>{const c=$a(Wy),u=A.useId();let d=!0,f=A.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:p=>{c.set(p,!0);for(const g of c.values())if(!g)return;r&&r()},register:p=>(c.set(p,!1),()=>c.delete(p))}),[n,c,r]);return o&&d&&(f={...f}),A.useMemo(()=>{c.forEach((p,g)=>c.set(g,!1))},[n]),D.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=h.jsx(Uy,{isPresent:n,anchorX:a,root:l,children:e})),h.jsx(So.Provider,{value:f,children:e})};function Wy(){return new Map}function ch(e=!0){const t=A.useContext(So);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,o=A.useId();A.useEffect(()=>{if(e)return i(o)},[e]);const s=A.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}const Ii=e=>e.key||"";function Lc(e){const t=[];return A.Children.forEach(e,n=>{A.isValidElement(n)&&t.push(n)}),t}const Sr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:o="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=ch(s),d=A.useMemo(()=>Lc(e),[e]),f=s&&!c?[]:d.map(Ii),p=A.useRef(!0),g=A.useRef(d),m=$a(()=>new Map),[x,y]=A.useState(d),[E,v]=A.useState(d);yf(()=>{p.current=!1,g.current=d;for(let C=0;C<E.length;C++){const M=Ii(E[C]);f.includes(M)?m.delete(M):m.get(M)!==!0&&m.set(M,!1)}},[E,f.length,f.join("-")]);const _=[];if(d!==x){let C=[...d];for(let M=0;M<E.length;M++){const N=E[M],I=Ii(N);f.includes(I)||(C.splice(M,0,N),_.push(N))}return o==="wait"&&_.length&&(C=_),v(Lc(C)),y(d),null}process.env.NODE_ENV!=="production"&&o==="wait"&&E.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:k}=A.useContext(ja);return h.jsx(h.Fragment,{children:E.map(C=>{const M=Ii(C),N=s&&!c?!1:d===E||f.includes(M),I=()=>{if(m.has(M))m.set(M,!0);else return;let b=!0;m.forEach(R=>{R||(b=!1)}),b&&(k==null||k(),v(g.current),s&&(u==null||u()),r&&r())};return h.jsx(Hy,{isPresent:N,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:o,root:l,onExitComplete:N?void 0:I,anchorX:a,children:C},M)})})},uh=A.createContext({strict:!1}),Fc={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"]},Cr={};for(const e in Fc)Cr[e]={isEnabled:t=>Fc[e].some(n=>!!t[n])};function Gy(e){for(const t in e)Cr[t]={...Cr[t],...e[t]}}const Ky=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 fo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ky.has(e)}let dh=e=>!fo(e);function qy(e){typeof e=="function"&&(dh=t=>t.startsWith("on")?!fo(t):e(t))}try{qy(require("@emotion/is-prop-valid").default)}catch{}function Yy(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(dh(i)||n===!0&&fo(i)||!t&&!fo(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const Co=A.createContext({});function _o(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function oi(e){return typeof e=="string"||Array.isArray(e)}const ul=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dl=["initial",...ul];function To(e){return _o(e.animate)||dl.some(t=>oi(e[t]))}function fh(e){return!!(To(e)||e.variants)}function Zy(e,t){if(To(e)){const{initial:n,animate:r}=e;return{initial:n===!1||oi(n)?n:void 0,animate:oi(r)?r:void 0}}return e.inherit!==!1?t:{}}function Xy(e){const{initial:t,animate:n}=Zy(e,A.useContext(Co));return A.useMemo(()=>({initial:t,animate:n}),[Bc(t),Bc(n)])}function Bc(e){return Array.isArray(e)?e.join(" "):e}const si={};function Qy(e){for(const t in e)si[t]=e[t],Ya(t)&&(si[t].isCSSVariable=!0)}function hh(e,{layout:t,layoutId:n}){return Mr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!si[e]||e==="opacity")}const Jy={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ex=Rr.length;function tx(e,t,n){let r="",i=!0;for(let o=0;o<ex;o++){const s=Rr[o],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=rh(a,sl[s]);if(!l){i=!1;const u=Jy[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function fl(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(Mr.has(l)){s=!0;continue}else if(Ya(l)){i[l]=c;continue}else{const u=rh(c,sl[l]);l.startsWith("origin")?(a=!0,o[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=tx(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=o;r.transformOrigin=`${l} ${c} ${u}`}}const hl=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ph(e,t,n){for(const r in t)!At(t[r])&&!hh(r,n)&&(e[r]=t[r])}function nx({transformTemplate:e},t){return A.useMemo(()=>{const n=hl();return fl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function rx(e,t){const n=e.style||{},r={};return ph(r,n,e),Object.assign(r,nx(e,t)),r}function ix(e,t){const n={},r=rx(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 ox={offset:"stroke-dashoffset",array:"stroke-dasharray"},sx={offset:"strokeDashoffset",array:"strokeDasharray"};function ax(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?ox:sx;e[o.offset]=ve.transform(-r);const s=ve.transform(t),a=ve.transform(n);e[o.array]=`${s} ${a}`}function mh(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:o=1,pathOffset:s=0,...a},l,c,u){if(fl(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.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&&ax(d,i,o,s,!1)}const gh=()=>({...hl(),attrs:{}}),bh=e=>typeof e=="string"&&e.toLowerCase()==="svg";function lx(e,t,n,r){const i=A.useMemo(()=>{const o=gh();return mh(o,t,bh(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};ph(o,e.style,e),i.style={...o,...i.style}}return i}const cx=["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 pl(e){return typeof e!="string"||e.includes("-")?!1:!!(cx.indexOf(e)>-1||/[A-Z]/u.test(e))}function ux(e,t,n,{latestValues:r},i,o=!1){const a=(pl(e)?lx:ix)(t,r,i,e),l=Yy(t,typeof e=="string",o),c=e!==A.Fragment?{...l,...a,ref:n}:{},{children:u}=t,d=A.useMemo(()=>At(u)?u.get():u,[u]);return A.createElement(e,{...c,children:d})}function jc(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ml(e,t,n,r){if(typeof t=="function"){const[i,o]=jc(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=jc(r);t=t(n!==void 0?n:e.custom,i,o)}return t}function Ji(e){return At(e)?e.get():e}function dx({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:fx(n,r,i,e),renderState:t()}}function fx(e,t,n,r){const i={},o=r(e,{});for(const f in o)i[f]=Ji(o[f]);let{initial:s,animate:a}=e;const l=To(e),c=fh(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const d=u?a:s;if(d&&typeof d!="boolean"&&!_o(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){const g=ml(e,f[p]);if(g){const{transitionEnd:m,transition:x,...y}=g;for(const E in y){let v=y[E];if(Array.isArray(v)){const _=u?v.length-1:0;v=v[_]}v!==null&&(i[E]=v)}for(const E in m)i[E]=m[E]}}}return i}const yh=e=>(t,n)=>{const r=A.useContext(Co),i=A.useContext(So),o=()=>dx(e,t,r,i);return n?o():$a(o)};function gl(e,t,n){var o;const{style:r}=e,i={};for(const s in r)(At(r[s])||t.style&&At(t.style[s])||hh(s,e)||((o=n==null?void 0:n.getValue(s))==null?void 0:o.liveStyle)!==void 0)&&(i[s]=r[s]);return i}const hx=yh({scrapeMotionValuesFromProps:gl,createRenderState:hl});function xh(e,t,n){const r=gl(e,t,n);for(const i in e)if(At(e[i])||At(t[i])){const o=Rr.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}const px=yh({scrapeMotionValuesFromProps:xh,createRenderState:gh}),mx=Symbol.for("motionComponentSymbol");function gr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function gx(e,t,n){return A.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):gr(n)&&(n.current=r))},[t])}const bl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),bx="framerAppearId",wh="data-"+bl(bx),vh=A.createContext({});function yx(e,t,n,r,i){var m,x;const{visualElement:o}=A.useContext(Co),s=A.useContext(uh),a=A.useContext(So),l=A.useContext(cl).reducedMotion,c=A.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,d=A.useContext(vh);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&xx(c.current,n,i,d);const f=A.useRef(!1);A.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const p=n[wh],g=A.useRef(!!p&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,p))&&((x=window.MotionHasOptimisedAnimation)==null?void 0:x.call(window,p)));return yf(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),A.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)==null||y.call(window,p)}),g.current=!1),u.enteringChildren=void 0)}),u}function xx(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Eh(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&gr(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function Eh(e){if(e)return e.options.allowProjection!==!1?e.projection:Eh(e.parent)}function ss(e,{forwardMotionProps:t=!1}={},n,r){n&&Gy(n);const i=pl(e)?px:hx;function o(a,l){let c;const u={...A.useContext(cl),...a,layoutId:wx(a)},{isStatic:d}=u,f=Xy(a),p=i(a,d);if(!d&&Va){vx(u,n);const g=Ex(u);c=g.MeasureLayout,f.visualElement=yx(e,p,u,r,g.ProjectionNode)}return h.jsxs(Co.Provider,{value:f,children:[c&&f.visualElement?h.jsx(c,{visualElement:f.visualElement,...u}):null,ux(e,a,gx(p,f.visualElement,l),p,d,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=A.forwardRef(o);return s[mx]=e,s}function wx({layoutId:e}){const t=A.useContext(ja).id;return t&&e!==void 0?t+"-"+e:e}function vx(e,t){const n=A.useContext(uh).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?Nr(!1,r,"lazy-strict-mode"):xn(!1,r,"lazy-strict-mode")}}function Ex(e){const{drag:t,layout:n}=Cr;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 kx(e,t){if(typeof Proxy>"u")return ss;const n=new Map,r=(o,s)=>ss(o,s,e,t),i=(o,s)=>(process.env.NODE_ENV!=="production"&&Ga(!1,"motion() is deprecated. Use motion.create() instead."),r(o,s));return new Proxy(i,{get:(o,s)=>s==="create"?r:(n.has(s)||n.set(s,ss(s,void 0,e,t)),n.get(s))})}function kh({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Sx({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Cx(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 as(e){return e===void 0||e===1}function ua({scale:e,scaleX:t,scaleY:n}){return!as(e)||!as(t)||!as(n)}function zn(e){return ua(e)||Sh(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Sh(e){return $c(e.x)||$c(e.y)}function $c(e){return e&&e!=="0%"}function ho(e,t,n){const r=e-n,i=t*r;return n+i}function Vc(e,t,n,r,i){return i!==void 0&&(e=ho(e,i,r)),ho(e,n,r)+t}function da(e,t=0,n=1,r,i){e.min=Vc(e.min,t,n,r,i),e.max=Vc(e.max,t,n,r,i)}function Ch(e,{x:t,y:n}){da(e.x,t.translate,t.scale,t.originPoint),da(e.y,n.translate,n.scale,n.originPoint)}const zc=.999999999999,Uc=1.0000000000001;function _x(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&yr(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Ch(e,s)),r&&zn(o.latestValues)&&yr(e,o.latestValues))}t.x<Uc&&t.x>zc&&(t.x=1),t.y<Uc&&t.y>zc&&(t.y=1)}function br(e,t){e.min=e.min+t,e.max=e.max+t}function Hc(e,t,n,r,i=.5){const o=ut(e.min,e.max,i);da(e,t,n,o,r)}function yr(e,t){Hc(e.x,t.x,t.scaleX,t.scale,t.originX),Hc(e.y,t.y,t.scaleY,t.scale,t.originY)}function _h(e,t){return kh(Cx(e.getBoundingClientRect(),t))}function Tx(e,t,n){const r=_h(e,n),{scroll:i}=t;return i&&(br(r.x,i.offset.x),br(r.y,i.offset.y)),r}const Wc=()=>({translate:0,scale:1,origin:0,originPoint:0}),xr=()=>({x:Wc(),y:Wc()}),Gc=()=>({min:0,max:0}),mt=()=>({x:Gc(),y:Gc()}),fa={current:null},Th={current:!1};function Nx(){if(Th.current=!0,!!Va)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>fa.current=e.matches;e.addEventListener("change",t),t()}else fa.current=!1}const Ax=new WeakMap;function Rx(e,t,n){for(const r in t){const i=t[r],o=n[r];if(At(i))e.addValue(r,i);else if(At(o))e.addValue(r,kr(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,kr(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Kc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Mx{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=il,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 f=Bt.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,at.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;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=!!o,this.isControllingVariants=To(n),this.isVariantNode=fh(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];l[f]!==void 0&&At(p)&&p.set(l[f])}}mount(t){var n;this.current=t,Ax.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)),Th.current||Nx(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:fa.current,process.env.NODE_ENV!=="production"&&Ga(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(),Mn(this.notifyUpdate),Mn(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=Mr.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&at.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Cr){const n=Cr[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 o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):mt()}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<Kc.length;r++){const i=Kc[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,s=t[o];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=Rx(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=kr(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"&&(xf(r)||vf(r))?r=parseFloat(r):!Vy(r)&&In.test(n)&&(r=nh(t,n)),this.setBaseTarget(t,At(r)?r.get():r)),At(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const s=ml(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);s&&(r=s[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!At(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 Wa),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){al.render(this.render)}}class Nh extends Mx{constructor(){super(...arguments),this.KeyframeResolver=Ay}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;At(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Ah(e,{style:t,vars:n},r,i){const o=e.style;let s;for(s in t)o[s]=t[s];i==null||i.applyProjectionStyles(o,r);for(s in n)o.setProperty(s,n[s])}function Ix(e){return window.getComputedStyle(e)}class Ox extends Nh{constructor(){super(...arguments),this.type="html",this.renderInstance=Ah}readValueFromInstance(t,n){var r;if(Mr.has(n))return(r=this.projection)!=null&&r.isProjecting?ra(n):Kb(t,n);{const i=Ix(t),o=(Ya(n)?i.getPropertyValue(n):i[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return _h(t,n)}build(t,n,r){fl(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return gl(t,n,r)}}const Rh=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 Px(e,t,n,r){Ah(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Rh.has(i)?i:bl(i),t.attrs[i])}class Dx extends Nh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=mt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Mr.has(n)){const r=th(n);return r&&r.default||0}return n=Rh.has(n)?n:bl(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return xh(t,n,r)}build(t,n,r){mh(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){Px(t,n,r,i)}mount(t){this.isSVGTag=bh(t.tagName),super.mount(t)}}const Lx=(e,t)=>pl(e)?new Dx(t):new Ox(t,{allowProjection:e!==A.Fragment});function wr(e,t,n){const r=e.getProps();return ml(r,t,n!==void 0?n:r.custom,e)}const ha=e=>Array.isArray(e);function Fx(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,kr(n))}function Bx(e){return ha(e)?e[e.length-1]||0:e}function jx(e,t){const n=wr(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const a=Bx(o[s]);Fx(e,s,a)}}function $x(e){return!!(At(e)&&e.add)}function pa(e,t){const n=e.getValue("willChange");if($x(n))return n.add(t);if(!n&&wn.WillChange){const r=new wn.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Mh(e){return e.props[wh]}const Vx=e=>e!==null;function zx(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(Vx),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[o]}const Ux={type:"spring",stiffness:500,damping:25,restSpeed:10},Hx=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Wx={type:"keyframes",duration:.8},Gx={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Kx=(e,{keyframes:t})=>t.length>2?Wx:Mr.has(e)?e.startsWith("scale")?Hx(t[1]):Ux:Gx;function qx({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const yl=(e,t,n,r={},i,o)=>s=>{const a=ol(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-en(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};qx(a)||Object.assign(u,Kx(e,u)),u.duration&&(u.duration=en(u.duration)),u.repeatDelay&&(u.repeatDelay=en(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(la(u),u.delay===0&&(d=!0)),(wn.instantAnimations||wn.skipAnimations)&&(d=!0,la(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!o&&t.get()!==void 0){const f=zx(u.keyframes,a);if(f!==void 0){at.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new rl(u):new gy(u)};function Yx({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ih(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(o=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),f=a[u];if(f===void 0||c&&Yx(c,u))continue;const p={delay:n,...ol(o||{},u)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===g&&!p.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const y=Mh(e);if(y){const E=window.MotionHandoffAnimation(y,u,at);E!==null&&(p.startTime=E,m=!0)}}pa(e,u),d.start(yl(u,d,f,e.shouldReduceMotion&&Qf.has(u)?{type:!1}:p,e,m));const x=d.animation;x&&l.push(x)}return s&&Promise.all(l).then(()=>{at.update(()=>{s&&jx(e,s)})}),l}function Oh(e,t,n,r=0,i=1){const o=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(o,s):i===1?o*r:a-o*r}function ma(e,t,n={}){var l;const r=wr(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 o=r?()=>Promise.all(Ih(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=i;return Zx(e,t,c,u,d,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,s]:[s,o];return c().then(()=>u())}else return Promise.all([o(),s(n.delay)])}function Zx(e,t,n=0,r=0,i=0,o=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(ma(l,t,{...s,delay:n+(typeof r=="function"?0:r)+Oh(e.variantChildren,l,r,i,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function Xx(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>ma(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=ma(e,t,n);else{const i=typeof t=="function"?wr(e,t,n.custom):t;r=Promise.all(Ih(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Ph(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 Qx=dl.length;function Dh(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Dh(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Qx;n++){const r=dl[n],i=e.props[r];(oi(i)||i===!1)&&(t[r]=i)}return t}const Jx=[...ul].reverse(),e0=ul.length;function t0(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Xx(e,n,r)))}function n0(e){let t=t0(e),n=qc(),r=!0;const i=l=>(c,u)=>{var f;const d=wr(e,u,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:p,transitionEnd:g,...m}=d;c={...c,...m,...g}}return c};function o(l){t=l(e)}function s(l){const{props:c}=e,u=Dh(e.parent)||{},d=[],f=new Set;let p={},g=1/0;for(let x=0;x<e0;x++){const y=Jx[x],E=n[y],v=c[y]!==void 0?c[y]:u[y],_=oi(v),k=y===l?E.isActive:null;k===!1&&(g=x);let C=v===u[y]&&v!==c[y]&&_;if(C&&r&&e.manuallyAnimateOnMount&&(C=!1),E.protectedKeys={...p},!E.isActive&&k===null||!v&&!E.prevProp||_o(v)||typeof v=="boolean")continue;const M=r0(E.prevProp,v);let N=M||y===l&&E.isActive&&!C&&_||x>g&&_,I=!1;const b=Array.isArray(v)?v:[v];let R=b.reduce(i(y),{});k===!1&&(R={});const{prevResolvedValues:O={}}=E,L={...O,...R},j=ee=>{N=!0,f.has(ee)&&(I=!0,f.delete(ee)),E.needsAnimating[ee]=!0;const P=e.getValue(ee);P&&(P.liveStyle=!1)};for(const ee in L){const P=R[ee],W=O[ee];if(p.hasOwnProperty(ee))continue;let w=!1;ha(P)&&ha(W)?w=!Ph(P,W):w=P!==W,w?P!=null?j(ee):f.add(ee):P!==void 0&&f.has(ee)?j(ee):E.protectedKeys[ee]=!0}E.prevProp=v,E.prevResolvedValues=R,E.isActive&&(p={...p,...R}),r&&e.blockInitialAnimation&&(N=!1);const H=C&&M;N&&(!H||I)&&d.push(...b.map(ee=>{const P={type:y};if(typeof ee=="string"&&r&&!H&&e.manuallyAnimateOnMount&&e.parent){const{parent:W}=e,w=wr(W,ee);if(W.enteringChildren&&w){const{delayChildren:V}=w.transition||{};P.delay=Oh(W.enteringChildren,e,V)}}return{animation:ee,options:P}}))}if(f.size){const x={};if(typeof c.initial!="boolean"){const y=wr(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(x.transition=y.transition)}f.forEach(y=>{const E=e.getBaseTarget(y),v=e.getValue(y);v&&(v.liveStyle=!0),x[y]=E??null}),d.push({animation:x})}let m=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(d):Promise.resolve()}function a(l,c){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var p;return(p=f.animationState)==null?void 0:p.setActive(l,c)}),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=qc(),r=!0}}}function r0(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ph(t,e):!1}function jn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qc(){return{animate:jn(!0),whileInView:jn(),whileHover:jn(),whileTap:jn(),whileDrag:jn(),whileFocus:jn(),exit:jn()}}class Dn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class i0 extends Dn{constructor(t){super(t),t.animationState||(t.animationState=n0(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();_o(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 o0=0;class s0 extends Dn{constructor(){super(...arguments),this.id=o0++}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 a0={animation:{Feature:i0},exit:{Feature:s0}};function ai(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function gi(e){return{point:{x:e.pageX,y:e.pageY}}}const l0=e=>t=>ll(t)&&e(t,gi(t));function Yr(e,t,n,r){return ai(e,t,l0(n),r)}const Lh=1e-4,c0=1-Lh,u0=1+Lh,Fh=.01,d0=0-Fh,f0=0+Fh;function Dt(e){return e.max-e.min}function h0(e,t,n){return Math.abs(e-t)<=n}function Yc(e,t,n,r=.5){e.origin=r,e.originPoint=ut(t.min,t.max,e.origin),e.scale=Dt(n)/Dt(t),e.translate=ut(n.min,n.max,e.origin)-e.originPoint,(e.scale>=c0&&e.scale<=u0||isNaN(e.scale))&&(e.scale=1),(e.translate>=d0&&e.translate<=f0||isNaN(e.translate))&&(e.translate=0)}function Zr(e,t,n,r){Yc(e.x,t.x,n.x,r?r.originX:void 0),Yc(e.y,t.y,n.y,r?r.originY:void 0)}function Zc(e,t,n){e.min=n.min+t.min,e.max=e.min+Dt(t)}function p0(e,t,n){Zc(e.x,t.x,n.x),Zc(e.y,t.y,n.y)}function Xc(e,t,n){e.min=t.min-n.min,e.max=e.min+Dt(t)}function Xr(e,t,n){Xc(e.x,t.x,n.x),Xc(e.y,t.y,n.y)}function Kt(e){return[e("x"),e("y")]}const Bh=({current:e})=>e?e.ownerDocument.defaultView:null,Qc=(e,t)=>Math.abs(e-t);function m0(e,t){const n=Qc(e.x,t.x),r=Qc(e.y,t.y);return Math.sqrt(n**2+r**2)}class jh{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:s=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 f=cs(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=m0(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!g)return;const{point:m}=f,{timestamp:x}=Tt;this.history.push({...m,timestamp:x});const{onStart:y,onMove:E}=this.handlers;p||(y&&y(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=ls(p,this.transformPagePoint),at.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:g,onSessionEnd:m,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=cs(f.type==="pointercancel"?this.lastMoveEventInfo:ls(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(f,y),m&&m(f,y)},!ll(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=i||window;const a=gi(t),l=ls(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=Tt;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,cs(l,this.history)),this.removeListeners=hi(Yr(this.contextWindow,"pointermove",this.handlePointerMove),Yr(this.contextWindow,"pointerup",this.handlePointerUp),Yr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Mn(this.updatePoint)}}function ls(e,t){return t?{point:t(e.point)}:e}function Jc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function cs({point:e},t){return{point:e,delta:Jc(e,$h(t)),offset:Jc(e,g0(t)),velocity:b0(t,.1)}}function g0(e){return e[0]}function $h(e){return e[e.length-1]}function b0(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=$h(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>en(t)));)n--;if(!r)return{x:0,y:0};const o=cn(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function y0(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ut(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ut(n,e,r.max):Math.min(e,n)),e}function eu(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 x0(e,{top:t,left:n,bottom:r,right:i}){return{x:eu(e.x,n,i),y:eu(e.y,t,r)}}function tu(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 w0(e,t){return{x:tu(e.x,t.x),y:tu(e.y,t.y)}}function v0(e,t){let n=.5;const r=Dt(e),i=Dt(t);return i>r?n=ni(t.min,t.max-r,e.min):r>i&&(n=ni(e.min,e.max-i,t.min)),yn(0,1,n)}function E0(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 ga=.35;function k0(e=ga){return e===!1?e=0:e===!0&&(e=ga),{x:nu(e,"left","right"),y:nu(e,"top","bottom")}}function nu(e,t,n){return{min:ru(e,t),max:ru(e,n)}}function ru(e,t){return typeof e=="number"?e:e[t]||0}const S0=new WeakMap;class C0{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=mt(),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 o=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(gi(d).point)},s=(d,f)=>{const{drag:p,dragPropagation:g,onDragStart:m}=this.getProps();if(p&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Oy(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Kt(y=>{let E=this.getAxisMotionValue(y).get()||0;if(un.test(E)){const{projection:v}=this.visualElement;if(v&&v.layout){const _=v.layout.layoutBox[y];_&&(E=Dt(_)*(parseFloat(E)/100))}}this.originPoint[y]=E}),m&&at.postRender(()=>m(d,f)),pa(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:m,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=f;if(g&&this.currentDirection===null){this.currentDirection=_0(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),x&&x(d,f)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>Kt(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)==null?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new jh(t,{onSessionStart:o,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:Bh(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!r)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&at.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||!Oi(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=y0(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;t&&gr(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=x0(r.layoutBox,t):this.constraints=!1,this.elastic=k0(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Kt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=E0(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!gr(t))return!1;const r=t.current;xn(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 o=Tx(r,i.root,this.visualElement.getTransformPagePoint());let s=w0(i.layout.layoutBox,o);if(n){const a=n(Sx(s));this.hasMutatedConstraints=!!a,a&&(s=kh(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Kt(u=>{if(!Oi(u,n,this.currentDirection))return;let d=l&&l[u]||{};s&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return pa(this.visualElement,t),r.start(yl(t,r,0,n,this.visualElement,!1))}stopAnimation(){Kt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Kt(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){Kt(n=>{const{drag:r}=this.getProps();if(!Oi(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[n];o.set(t[n]-ut(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!gr(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Kt(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();i[s]=v0({min:l,max:l},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Kt(s=>{if(!Oi(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(ut(l,c,i[s]))})}addListeners(){if(!this.visualElement.current)return;S0.set(this.visualElement,this);const t=this.visualElement.current,n=Yr(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();gr(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),at.read(r);const s=ai(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Kt(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=ga,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function Oi(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function _0(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class T0 extends Dn{constructor(t){super(t),this.removeGroupControls=Zt,this.removeListeners=Zt,this.controls=new C0(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Zt}unmount(){this.removeGroupControls(),this.removeListeners()}}const iu=e=>(t,n)=>{e&&at.postRender(()=>e(t,n))};class N0 extends Dn{constructor(){super(...arguments),this.removePointerDownListener=Zt}onPointerDown(t){this.session=new jh(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Bh(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:iu(t),onStart:iu(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&at.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=Yr(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 eo={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ou(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Fr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ve.test(e))e=parseFloat(e);else return e;const n=ou(e,t.target.x),r=ou(e,t.target.y);return`${n}% ${r}%`}},A0={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=In.parse(e);if(i.length>5)return r;const o=In.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=l;const c=ut(a,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=c),typeof i[3+s]=="number"&&(i[3+s]/=c),o(i)}};let us=!1;class R0 extends A.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;Qy(M0),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),us&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),eo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,{projection:s}=r;return s&&(s.isPresent=o,us=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||at.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),al.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;us=!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 Vh(e){const[t,n]=ch(),r=A.useContext(ja);return h.jsx(R0,{...e,layoutGroup:r,switchLayoutGroup:A.useContext(vh),isPresent:t,safeToRemove:n})}const M0={borderRadius:{...Fr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fr,borderTopRightRadius:Fr,borderBottomLeftRadius:Fr,borderBottomRightRadius:Fr,boxShadow:A0};function I0(e,t,n){const r=At(e)?e:kr(e);return r.start(yl("",r,t,n)),r.animation}const O0=(e,t)=>e.depth-t.depth;class P0{constructor(){this.children=[],this.isDirty=!1}add(t){za(this.children,t),this.isDirty=!0}remove(t){Ua(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(O0),this.isDirty=!1,this.children.forEach(t)}}function D0(e,t){const n=Bt.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Mn(r),e(o-t))};return at.setup(r,!0),()=>Mn(r)}const zh=["TopLeft","TopRight","BottomLeft","BottomRight"],L0=zh.length,su=e=>typeof e=="string"?parseFloat(e):e,au=e=>typeof e=="number"||ve.test(e);function F0(e,t,n,r,i,o){i?(e.opacity=ut(0,n.opacity??1,B0(r)),e.opacityExit=ut(t.opacity??1,0,j0(r))):o&&(e.opacity=ut(t.opacity??1,n.opacity??1,r));for(let s=0;s<L0;s++){const a=`border${zh[s]}Radius`;let l=lu(t,a),c=lu(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||au(l)===au(c)?(e[a]=Math.max(ut(su(l),su(c),r),0),(un.test(c)||un.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=ut(t.rotate||0,n.rotate||0,r))}function lu(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const B0=Uh(0,.5,Af),j0=Uh(.5,.95,Zt);function Uh(e,t,n){return r=>r<e?0:r>t?1:n(ni(e,t,r))}function cu(e,t){e.min=t.min,e.max=t.max}function Gt(e,t){cu(e.x,t.x),cu(e.y,t.y)}function uu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function du(e,t,n,r,i){return e-=t,e=ho(e,1/n,r),i!==void 0&&(e=ho(e,1/i,r)),e}function $0(e,t=0,n=1,r=.5,i,o=e,s=e){if(un.test(t)&&(t=parseFloat(t),t=ut(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=ut(o.min,o.max,r);e===o&&(a-=t),e.min=du(e.min,t,n,a,i),e.max=du(e.max,t,n,a,i)}function fu(e,t,[n,r,i],o,s){$0(e,t[n],t[r],t[i],t.scale,o,s)}const V0=["x","scaleX","originX"],z0=["y","scaleY","originY"];function hu(e,t,n,r){fu(e.x,t,V0,n?n.x:void 0,r?r.x:void 0),fu(e.y,t,z0,n?n.y:void 0,r?r.y:void 0)}function pu(e){return e.translate===0&&e.scale===1}function Hh(e){return pu(e.x)&&pu(e.y)}function mu(e,t){return e.min===t.min&&e.max===t.max}function U0(e,t){return mu(e.x,t.x)&&mu(e.y,t.y)}function gu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Wh(e,t){return gu(e.x,t.x)&&gu(e.y,t.y)}function bu(e){return Dt(e.x)/Dt(e.y)}function yu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class H0{constructor(){this.members=[]}add(t){za(this.members,t),t.scheduleRender()}remove(t){if(Ua(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 o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade: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 W0(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:p,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}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 ds=["","X","Y","Z"],G0=1e3;let K0=0;function fs(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Gh(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Mh(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",at,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Gh(r)}function Kh({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=K0++,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(Z0),this.nodes.forEach(ew),this.nodes.forEach(tw),this.nodes.forEach(X0)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,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 P0)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Wa),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=lh(s)&&!jy(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),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 f=()=>this.root.updateBlockedByResize=!1;at.read(()=>{d=window.innerWidth}),e(s,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=D0(f,250),eo.hasAnimatedSinceResize&&(eo.hasAnimatedSinceResize=!1,this.nodes.forEach(vu)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||sw,{onLayoutAnimationStart:m,onLayoutAnimationComplete:x}=c.getProps(),y=!this.targetLayout||!Wh(this.targetLayout,p),E=!d&&f;if(this.options.layoutRoot||this.resumeFrom||E||d&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...ol(g,"layout"),onPlay:m,onComplete:x};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,E)}else d||vu(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Mn(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(nw),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Gh(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(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(wu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(J0),this.nodes.forEach(q0),this.nodes.forEach(Y0)):this.nodes.forEach(wu),this.clearAllSnapshots();const a=Bt.now();Tt.delta=yn(0,1e3/60,a-Tt.timestamp),Tt.timestamp=a,Tt.isProcessing=!0,es.update.process(Tt),es.preRender.process(Tt),es.render.process(Tt),Tt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,al.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Q0),this.sharedNodes.forEach(rw)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,at.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){at.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Dt(this.snapshot.measuredBox.x)&&!Dt(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 s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=mt(),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,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Hh(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||zn(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),aw(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:s}=this.options;if(!s)return mt();const a=s.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(lw))){const{scroll:u}=this.root;u&&(br(a.x,u.offset.x),br(a.y,u.offset.y))}return a}removeElementScroll(s){var l;const a=mt();if(Gt(a,s),(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:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&Gt(a,s),br(a.x,d.offset.x),br(a.y,d.offset.y))}return a}applyTransform(s,a=!1){const l=mt();Gt(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&yr(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),zn(u.latestValues)&&yr(l,u.latestValues)}return zn(this.latestValues)&&yr(l,this.latestValues),l}removeTransform(s){const a=mt();Gt(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!zn(c.latestValues))continue;ua(c.latestValues)&&c.updateSnapshot();const u=mt(),d=c.measurePageBox();Gt(u,d),hu(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return zn(this.latestValues)&&hu(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==Tt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var f;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(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=Tt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=mt(),this.relativeTargetOrigin=mt(),Xr(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Gt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=mt(),this.targetWithTransforms=mt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),p0(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Gt(this.target,this.layout.layoutBox),Ch(this.target,this.targetDelta)):Gt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=mt(),this.relativeTargetOrigin=mt(),Xr(this.relativeTargetOrigin,this.target,p.target),Gt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ua(this.parent.latestValues)||Sh(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 s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Tt.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;Gt(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;_x(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=mt());const{target:p}=s;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(uu(this.prevProjectionDelta.x,this.projectionDelta.x),uu(this.prevProjectionDelta.y,this.projectionDelta.y)),Zr(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!yu(this.projectionDelta.x,this.prevProjectionDelta.x)||!yu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),s){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=xr(),this.projectionDelta=xr(),this.projectionDeltaWithTransform=xr()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=xr();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=mt(),p=l?l.source:void 0,g=this.layout?this.layout.source:void 0,m=p!==g,x=this.getStack(),y=!x||x.members.length<=1,E=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(ow));this.animationProgress=0;let v;this.mixTargetDelta=_=>{const k=_/1e3;Eu(d.x,s.x,k),Eu(d.y,s.y,k),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xr(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),iw(this.relativeTarget,this.relativeTargetOrigin,f,k),v&&U0(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=mt()),Gt(v,this.relativeTarget)),m&&(this.animationValues=u,F0(u,c,this.latestValues,k,E,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){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&&(Mn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=at.update(()=>{eo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=kr(0)),this.currentAnimation=I0(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),s.onUpdate&&s.onUpdate(u)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(G0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&qh(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||mt();const d=Dt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=Dt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}Gt(a,l),yr(a,u),Zr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new H0),this.sharedNodes.get(s).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 s=this.getStack();return s?s.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&fs("z",s,c,this.animationValues);for(let u=0;u<ds.length;u++)fs(`rotate${ds[u]}`,s,c,this.animationValues),fs(`skew${ds[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Ji(a==null?void 0:a.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Ji(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!zn(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=W0(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),s.transform=d;const{x:f,y:p}=this.projectionDelta;s.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in si){if(u[g]===void 0)continue;const{correct:m,applyTo:x,isCSSVariable:y}=si[g],E=d==="none"?u[g]:m(u[g],c);if(x){const v=x.length;for(let _=0;_<v;_++)s[x[_]]=E}else y?this.options.visualElement.renderState.vars[g]=E:s[g]=E}this.options.layoutId&&(s.pointerEvents=c===this?Ji(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var a;return(a=s.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(xu),this.root.sharedNodes.clear()}}}function q0(e){e.updateLayout()}function Y0(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:o}=e.options,s=t.source!==e.layout.source;o==="size"?Kt(d=>{const f=s?t.measuredBox[d]:t.layoutBox[d],p=Dt(f);f.min=r[d].min,f.max=f.min+p}):qh(o,t.layoutBox,r)&&Kt(d=>{const f=s?t.measuredBox[d]:t.layoutBox[d],p=Dt(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=xr();Zr(a,r,t.layoutBox);const l=xr();s?Zr(l,e.applyTransform(i,!0),t.measuredBox):Zr(l,r,t.layoutBox);const c=!Hh(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const g=mt();Xr(g,t.layoutBox,f.layoutBox);const m=mt();Xr(m,r,p.layoutBox),Wh(g,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,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 Z0(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 X0(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Q0(e){e.clearSnapshot()}function xu(e){e.clearMeasurements()}function wu(e){e.isLayoutDirty=!1}function J0(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function vu(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ew(e){e.resolveTargetDelta()}function tw(e){e.calcProjection()}function nw(e){e.resetSkewAndRotation()}function rw(e){e.removeLeadSnapshot()}function Eu(e,t,n){e.translate=ut(t.translate,0,n),e.scale=ut(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ku(e,t,n,r){e.min=ut(t.min,n.min,r),e.max=ut(t.max,n.max,r)}function iw(e,t,n,r){ku(e.x,t.x,n.x,r),ku(e.y,t.y,n.y,r)}function ow(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const sw={duration:.45,ease:[.4,0,.1,1]},Su=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Cu=Su("applewebkit/")&&!Su("chrome/")?Math.round:Zt;function _u(e){e.min=Cu(e.min),e.max=Cu(e.max)}function aw(e){_u(e.x),_u(e.y)}function qh(e,t,n){return e==="position"||e==="preserve-aspect"&&!h0(bu(t),bu(n),.2)}function lw(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const cw=Kh({attachResizeListener:(e,t)=>ai(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),hs={current:void 0},Yh=Kh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!hs.current){const e=new cw({});e.mount(window),e.setOptions({layoutScroll:!0}),hs.current=e}return hs.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),uw={pan:{Feature:N0},drag:{Feature:T0,ProjectionNode:Yh,MeasureLayout:Vh}};function Tu(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&at.postRender(()=>o(t,gi(t)))}class dw extends Dn{mount(){const{current:t}=this.node;t&&(this.unmount=Py(t,(n,r)=>(Tu(this.node,r,"Start"),i=>Tu(this.node,i,"End"))))}unmount(){}}class fw extends Dn{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=hi(ai(this.node.current,"focus",()=>this.onFocus()),ai(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Nu(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),o=r[i];o&&at.postRender(()=>o(t,gi(t)))}class hw extends Dn{mount(){const{current:t}=this.node;t&&(this.unmount=By(t,(n,r)=>(Nu(this.node,r,"Start"),(i,{success:o})=>Nu(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ba=new WeakMap,ps=new WeakMap,pw=e=>{const t=ba.get(e.target);t&&t(e)},mw=e=>{e.forEach(pw)};function gw({root:e,...t}){const n=e||document;ps.has(n)||ps.set(n,{});const r=ps.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(mw,{root:e,...t})),r[i]}function bw(e,t,n){const r=gw(t);return ba.set(e,n),r.observe(e),()=>{ba.delete(e),r.unobserve(e)}}const yw={some:0,all:1};class xw extends Dn{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:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:yw[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!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(),f=c?u:d;f&&f(l)};return bw(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(ww(t,n))&&this.startObserver()}unmount(){}}function ww({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const vw={inView:{Feature:xw},tap:{Feature:hw},focus:{Feature:fw},hover:{Feature:dw}},Ew={layout:{ProjectionNode:Yh,MeasureLayout:Vh}},kw={...a0,...vw,...uw,...Ew},Me=kx(kw,Lx);function Sw(e){const[t,n]=A.useState(()=>e.getLocalParticipant()),[r,i]=A.useState(()=>e.getMicrophoneTrack());return A.useEffect(()=>{const o=()=>{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)};o(),e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("track.muted",o),e.on("track.unmuted",o);const s=e.getRoom();if(s){const a=()=>{console.log("🎤 Track published, updating participant state"),o()},l=()=>{console.log("🎤 Track unpublished, updating participant state"),o()};return s.on("localTrackPublished",a),s.on("localTrackUnpublished",l),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o),s.off("localTrackPublished",a),s.off("localTrackUnpublished",l)}}else return()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o)}},[e]),{localParticipant:t,microphoneTrack:r}}function to(e,t,n){const[r,i]=A.useState(!1),[o,s]=A.useState(!1);return A.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:o,toggle:async l=>{try{s(!0);const c=l!==void 0?l:!r;switch(console.log(`🎬 useVoxketTrackToggle: ${t} toggle called`,{currentEnabled:r,targetEnabled:c,forceEnabled:l}),t){case"microphone":await e.toggleMicrophone(c);break;case"camera":await e.toggleCamera(c);break;case"screenShare":c?(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(c){console.error(`🎬 useVoxketTrackToggle: ${t} toggle failed:`,c)}finally{s(!1)}}}}function Cw(e){const[t,n]=A.useState(()=>e.getRoom()),[r,i]=A.useState(()=>e.getConnectionState());return A.useEffect(()=>{const o=()=>{n(e.getRoom()),i(e.getConnectionState())};return e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("connection.connecting",o),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("connection.connecting",o)}},[e]),t}function xl(e){const[t,n]=A.useState(()=>e.getIsAgentConnected()),[r,i]=A.useState(()=>e.getCurrentSession()),[o,s]=A.useState(()=>e.getCurrentAgentInfo()),[a,l]=A.useState(()=>e.getAgentState()),[c,u]=A.useState(()=>e.getAgentAudioTrack()),[d,f]=A.useState(()=>e.getAgentVideoTrack());return A.useEffect(()=>{const p=()=>{const v=e.getIsAgentConnected(),_=e.getCurrentSession(),k=e.getCurrentAgentInfo(),C=e.getAgentState(),M=e.getAgentAudioTrack(),N=e.getAgentVideoTrack();console.log("🤖 useVoxketVoiceAssistant: Updating state:",{isAgentConnected:v,hasSession:!!_,sessionId:_==null?void 0:_.id,hasAgentInfo:!!k,agentState:C,hasAudioTrack:!!M,hasVideoTrack:!!N}),n(v),i(_),s(k),l(C),u(M),f(N)};p();const g=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent connected event"),p()},m=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent disconnected event"),p()},x=()=>{console.log("🤖 useVoxketVoiceAssistant: Session changed event"),p()},y=()=>{console.log("🤖 useVoxketVoiceAssistant: Connection changed event"),p()},E=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent state changed event"),p()};return e.on("agent.connected",g),e.on("agent.speaking",g),e.on("agent.thinking",g),e.on("agent.state.changed",E),e.on("connection.disconnected",m),e.on("session.created",x),e.on("session.ended",x),e.on("session.state.changed",x),e.on("connection.connected",y),()=>{e.off("agent.connected",g),e.off("agent.speaking",g),e.off("agent.thinking",g),e.off("agent.state.changed",E),e.off("connection.disconnected",m),e.off("session.created",x),e.off("session.ended",x),e.off("session.state.changed",x),e.off("connection.connected",y)}},[e]),{agent:{isActive:t,info:o},session:r,state:a,audioTrack:c,videoTrack:d}}function _w(e){const[t,n]=A.useState(()=>e.getVideoTrackRefs()),[r,i]=A.useState(()=>e.getCameraTrackRefs()),[o,s]=A.useState(()=>e.getScreenShareTrackRefs());return A.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),s(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:o}}const wl="-",Tw=e=>{const t=Aw(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(wl);return a[0]===""&&a.length!==1&&a.shift(),Zh(a,t)||Nw(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},Zh=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Zh(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(wl);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},Au=/^\[(.+)\]$/,Nw=e=>{if(Au.test(e)){const t=Au.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Aw=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)ya(n[i],r,i,t);return r},ya=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Ru(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Rw(i)){ya(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{ya(s,Ru(t,o),n,r)})})},Ru=(e,t)=>{let n=e;return t.split(wl).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Rw=e=>e.isThemeGetter,Mw=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},xa="!",wa=":",Iw=wa.length,Ow=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let s=0,a=0,l=0,c;for(let g=0;g<i.length;g++){let m=i[g];if(s===0&&a===0){if(m===wa){o.push(i.slice(l,g)),l=g+Iw;continue}if(m==="/"){c=g;continue}}m==="["?s++:m==="]"?s--:m==="("?a++:m===")"&&a--}const u=o.length===0?i:i.substring(l),d=Pw(u),f=d!==u,p=c&&c>l?c-l:void 0;return{modifiers:o,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:p}};if(t){const i=t+wa,o=r;r=s=>s.startsWith(i)?o(s.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},Pw=e=>e.endsWith(xa)?e.substring(0,e.length-1):e.startsWith(xa)?e.substring(1):e,Dw=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let o=[];return r.forEach(s=>{s[0]==="["||t[s]?(i.push(...o.sort(),s),o=[]):o.push(s)}),i.push(...o.sort()),i}},Lw=e=>({cache:Mw(e.cacheSize),parseClassName:Ow(e),sortModifiers:Dw(e),...Tw(e)}),Fw=/\s+/,Bw=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],a=e.trim().split(Fw);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let x=!!m,y=r(x?g.substring(0,m):g);if(!y){if(!x){l=u+(l.length>0?" "+l:l);continue}if(y=r(g),!y){l=u+(l.length>0?" "+l:l);continue}x=!1}const E=o(f).join(":"),v=p?E+xa:E,_=v+y;if(s.includes(_))continue;s.push(_);const k=i(y,x);for(let C=0;C<k.length;++C){const M=k[C];s.push(v+M)}l=u+(l.length>0?" "+l:l)}return l};function jw(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Xh(t))&&(r&&(r+=" "),r+=n);return r}const Xh=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Xh(e[r]))&&(n&&(n+=" "),n+=t);return n};function $w(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=Lw(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=Bw(l,n);return i(l,u),u}return function(){return o(jw.apply(null,arguments))}}const kt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Qh=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Jh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Vw=/^\d+\/\d+$/,zw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Uw=/\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$/,Hw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ww=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nr=e=>Vw.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),_n=e=>!!e&&Number.isInteger(Number(e)),ms=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),pn=e=>zw.test(e),Kw=()=>!0,qw=e=>Uw.test(e)&&!Hw.test(e),ep=()=>!1,Yw=e=>Ww.test(e),Zw=e=>Gw.test(e),Xw=e=>!ce(e)&&!ue(e),Qw=e=>Ir(e,rp,ep),ce=e=>Qh.test(e),$n=e=>Ir(e,ip,qw),gs=e=>Ir(e,rv,Oe),Mu=e=>Ir(e,tp,ep),Jw=e=>Ir(e,np,Zw),Pi=e=>Ir(e,op,Yw),ue=e=>Jh.test(e),Br=e=>Or(e,ip),ev=e=>Or(e,iv),Iu=e=>Or(e,tp),tv=e=>Or(e,rp),nv=e=>Or(e,np),Di=e=>Or(e,op,!0),Ir=(e,t,n)=>{const r=Qh.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Or=(e,t,n=!1)=>{const r=Jh.exec(e);return r?r[1]?t(r[1]):n:!1},tp=e=>e==="position"||e==="percentage",np=e=>e==="image"||e==="url",rp=e=>e==="length"||e==="size"||e==="bg-size",ip=e=>e==="length",rv=e=>e==="number",iv=e=>e==="family-name",op=e=>e==="shadow",ov=()=>{const e=kt("color"),t=kt("font"),n=kt("text"),r=kt("font-weight"),i=kt("tracking"),o=kt("leading"),s=kt("breakpoint"),a=kt("container"),l=kt("spacing"),c=kt("radius"),u=kt("shadow"),d=kt("inset-shadow"),f=kt("text-shadow"),p=kt("drop-shadow"),g=kt("blur"),m=kt("perspective"),x=kt("aspect"),y=kt("ease"),E=kt("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[..._(),ue,ce],C=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],N=()=>[ue,ce,l],I=()=>[nr,"full","auto",...N()],b=()=>[_n,"none","subgrid",ue,ce],R=()=>["auto",{span:["full",_n,ue,ce]},_n,ue,ce],O=()=>[_n,"auto",ue,ce],L=()=>["auto","min","max","fr",ue,ce],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],ie=()=>["auto",...N()],ee=()=>[nr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],P=()=>[e,ue,ce],W=()=>[..._(),Iu,Mu,{position:[ue,ce]}],w=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",tv,Qw,{size:[ue,ce]}],Y=()=>[ms,Br,$n],S=()=>["","none","full",c,ue,ce],$=()=>["",Oe,Br,$n],q=()=>["solid","dashed","dotted","double"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[Oe,ms,Iu,Mu],te=()=>["","none",g,ue,ce],ae=()=>["none",Oe,ue,ce],de=()=>["none",Oe,ue,ce],De=()=>[Oe,ue,ce],U=()=>[nr,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pn],breakpoint:[pn],color:[Kw],container:[pn],"drop-shadow":[pn],ease:["in","out","in-out"],font:[Xw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pn],shadow:[pn],spacing:["px",Oe],text:[pn],"text-shadow":[pn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",nr,ce,ue,x]}],container:["container"],columns:[{columns:[Oe,ce,ue,a]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"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:k()}],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:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[_n,"auto",ue,ce]}],basis:[{basis:[nr,"full","auto",a,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,nr,"auto","initial","none",ce]}],grow:[{grow:["",Oe,ue,ce]}],shrink:[{shrink:["",Oe,ue,ce]}],order:[{order:[_n,"first","last","none",ue,ce]}],"grid-cols":[{"grid-cols":b()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":b()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:ie()}],mx:[{mx:ie()}],my:[{my:ie()}],ms:[{ms:ie()}],me:[{me:ie()}],mt:[{mt:ie()}],mr:[{mr:ie()}],mb:[{mb:ie()}],ml:[{ml:ie()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],w:[{w:[a,"screen",...ee()]}],"min-w":[{"min-w":[a,"screen","none",...ee()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh",...ee()]}],"font-size":[{text:["base",n,Br,$n]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ue,gs]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ms,ce]}],"font-family":[{font:[ev,ce,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,ue,ce]}],"line-clamp":[{"line-clamp":[Oe,"none",ue,gs]}],leading:[{leading:[o,...N()]}],"list-image":[{"list-image":["none",ue,ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ue,ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",ue,$n]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Oe,"auto",ue,ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ue,ce]}],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",ue,ce]}],"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:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},_n,ue,ce],radial:["",ue,ce],conic:[_n,ue,ce]},nv,Jw]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:S()}],"rounded-s":[{"rounded-s":S()}],"rounded-e":[{"rounded-e":S()}],"rounded-t":[{"rounded-t":S()}],"rounded-r":[{"rounded-r":S()}],"rounded-b":[{"rounded-b":S()}],"rounded-l":[{"rounded-l":S()}],"rounded-ss":[{"rounded-ss":S()}],"rounded-se":[{"rounded-se":S()}],"rounded-ee":[{"rounded-ee":S()}],"rounded-es":[{"rounded-es":S()}],"rounded-tl":[{"rounded-tl":S()}],"rounded-tr":[{"rounded-tr":S()}],"rounded-br":[{"rounded-br":S()}],"rounded-bl":[{"rounded-bl":S()}],"border-w":[{border:$()}],"border-w-x":[{"border-x":$()}],"border-w-y":[{"border-y":$()}],"border-w-s":[{"border-s":$()}],"border-w-e":[{"border-e":$()}],"border-w-t":[{"border-t":$()}],"border-w-r":[{"border-r":$()}],"border-w-b":[{"border-b":$()}],"border-w-l":[{"border-l":$()}],"divide-x":[{"divide-x":$()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":$()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...q(),"hidden","none"]}],"divide-style":[{divide:[...q(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,ue,ce]}],"outline-w":[{outline:["",Oe,Br,$n]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",u,Di,Pi]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",d,Di,Pi]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Oe,$n]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":$()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",f,Di,Pi]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Oe,ue,ce]}],"mix-blend":[{"mix-blend":[...B(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":B()}],"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":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[ue,ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"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:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ue,ce]}],filter:[{filter:["","none",ue,ce]}],blur:[{blur:te()}],brightness:[{brightness:[Oe,ue,ce]}],contrast:[{contrast:[Oe,ue,ce]}],"drop-shadow":[{"drop-shadow":["","none",p,Di,Pi]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",Oe,ue,ce]}],"hue-rotate":[{"hue-rotate":[Oe,ue,ce]}],invert:[{invert:["",Oe,ue,ce]}],saturate:[{saturate:[Oe,ue,ce]}],sepia:[{sepia:["",Oe,ue,ce]}],"backdrop-filter":[{"backdrop-filter":["","none",ue,ce]}],"backdrop-blur":[{"backdrop-blur":te()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,ue,ce]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,ue,ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,ue,ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,ue,ce]}],"backdrop-invert":[{"backdrop-invert":["",Oe,ue,ce]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,ue,ce]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,ue,ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,ue,ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ue,ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",ue,ce]}],ease:[{ease:["linear","initial",y,ue,ce]}],delay:[{delay:[Oe,ue,ce]}],animate:[{animate:["none",E,ue,ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ue,ce]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:De()}],"skew-x":[{"skew-x":De()}],"skew-y":[{"skew-y":De()}],transform:[{transform:[ue,ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:U()}],"translate-x":[{"translate-x":U()}],"translate-y":[{"translate-y":U()}],"translate-z":[{"translate-z":U()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"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",ue,ce]}],"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":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",ue,ce]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[Oe,Br,$n,gs]}],stroke:[{stroke:["none",...P()]}],"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"]}},sv=$w(ov);function et(...e){return sv(Ba.clsx(e))}function No(e){var i;if(!e)return{sessionSettings:{},capabilities:{},modality:"voice"};const t={session_timer:((i=e.session_settings)==null?void 0:i.session_timer)||null},n=e.capabilities||{},r=e.modality||"voice";return{sessionSettings:t,capabilities:n,modality:r}}function av(e,t){return e.capabilities[t]===!0}function Ao(e){return e.sessionSettings.session_timer||null}function sp(e){const t=e.capabilities;return{userVideoEnabled:t.user_video_enabled!==!1,agentAvatarEnabled:t.agent_avatar_enabled!==!1,screenshareEnabled:t.screenshare_session_enabled!==!1}}function ap(e){const t=e.capabilities;return{suggestedReplyEnabled:t.suggested_reply_enabled!==!1,attachmentsEnabled:t.support_in_chat_attachments!==!1}}function lp(e){return{...e.capabilities}}function cp(e){const t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`}const up=A.forwardRef(({state:e,audioTrack:t,className:n},r)=>h.jsx("div",{ref:r,className:et("",n),children:t?h.jsx(Ft.BarVisualizer,{barCount:5,state:e,options:{minHeight:5},trackRef:t,className:et("flex aspect-video w-40 items-center justify-center gap-1"),children:h.jsx("span",{className:et(["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]"])})}):h.jsx("div",{className:et("flex aspect-video w-40 items-center justify-center"),children:h.jsx("div",{className:"flex flex-col items-center justify-center",children:h.jsx("div",{className:"flex gap-1",children:Array.from({length:5}).map((i,o)=>h.jsx("span",{className:et(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear",e==="speaking"&&"animate-pulse bg-[#5c64f6]",e==="thinking"&&"animate-pulse bg-yellow-500"])},o))})})})}));up.displayName="AgentTile";const lv=({videoTrack:e,className:t,ref:n})=>{var r,i;return!e||!e.publication||!e.participant?h.jsx("div",{ref:n,className:et(t),children:h.jsx("div",{className:"w-full h-full bg-gray-200 rounded-md flex items-center justify-center",children:h.jsx("span",{className:"text-gray-500",children:"No video available"})})}):h.jsx("div",{ref:n,className:et(t),children:h.jsx(Ft.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"})})},cv=Me.create(Ft.VideoTrack),uv=({trackRef:e,className:t,ref:n})=>{var r,i;return h.jsx("div",{className:et("bg-muted overflow-hidden rounded-md",t),children:h.jsx(cv,{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:et("h-full w-auto")})})},Ou=Me.create(uv),dv=Me.create(up),fv=Me.create(lv),mn={initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{type:"spring",stiffness:675,damping:75,mass:1}},rr={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 hv(e,t){const{localParticipant:n}=Sw(t),r=n==null?void 0:n.getTrackPublication(e);return A.useMemo(()=>r&&n?{source:e,participant:n,publication:r}:void 0,[e,r,n])}function pv({chatOpen:e,client:t}){const{agent:{isActive:n=!1}={},session:r,state:i="idle",audioTrack:o,videoTrack:s}=t?xl(t):{agent:{isActive:!1},session:null,state:"idle",audioTrack:null,videoTrack:null},[a]=Ft.useTracks([se.Track.Source.ScreenShare]),l=hv(se.Track.Source.Camera,t),c=l&&!l.publication.isMuted,u=a&&!a.publication.isMuted,d=c||u,f=n||r&&r.state==="active",p={...mn.transition,delay:e?0:.15},g={...mn.animate,scale:e?1:3,transition:p},m={...mn.animate,transition:p},x=p,y=p,E=s&&s.publication&&s.participant;return h.jsx("div",{className:"relative w-full h-full z-10 flex items-center justify-center",children:h.jsx("div",{className:"relative w-full h-full max-w-2xl px-4 md:px-0",children:h.jsxs("div",{className:et(rr.grid),children:[f&&h.jsx("div",{className:et(["grid",!e&&rr.agentChatClosed,e&&d&&rr.agentChatOpenWithSecondTile,e&&!d&&rr.agentChatOpenWithoutSecondTile]),children:h.jsxs("div",{className:"h-full flex items-center justify-center",children:[!E&&h.jsx(dv,{layoutId:"agent",...mn,animate:g,transition:x,state:i,audioTrack:o||void 0,className:et(e?"h-[90px]":"h-auto w-full")},"agent"),E&&s&&h.jsx(fv,{layoutId:"avatar",...mn,animate:m,transition:y,videoTrack:s,className:et(e?"h-[90px] [&>video]:h-[90px] [&>video]:w-auto":"h-auto w-full")},"avatar")]})}),h.jsx("div",{className:et(["grid",e&&rr.secondTileChatOpen,!e&&rr.secondTileChatClosed]),children:h.jsxs("div",{className:"w-full px-10 flex items-center shadow-2xl justify-between",children:[l&&c&&h.jsx(Ou,{layout:"position",layoutId:"camera",...mn,trackRef:l,transition:{...mn.transition,delay:e?0:.15},className:"h-[60px] order-1"},"camera"),u&&h.jsx(Ou,{layout:"position",layoutId:"screen",...mn,trackRef:a,transition:{...mn.transition,delay:e?0:.15},className:"h-[70px] order-2"},"screen")]})})]})})})}const mv={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"}},gv={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"}},bv={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"}},Pu={dark:mv,light:gv,vox:bv};function Ct(e){return Pu[e]||Pu.vox}function Du({timeout:e}){const[t,n]=A.useState(100),r=A.useRef(null),i=A.useRef(null);return A.useEffect(()=>{if(!e||e<=0)return;n(100),i.current=Date.now();const o=()=>{if(!e||i.current===null)return;const s=Date.now()-i.current,a=Math.max(0,100-s/e*100);n(a),a>0&&(r.current=requestAnimationFrame(o))};return r.current=requestAnimationFrame(o),()=>{r.current&&cancelAnimationFrame(r.current)}},[e]),!e||e<=0?null:h.jsx("div",{className:"w-full h-1 relative top-1 rounded-t-4xl bg-gray-700 overflow-hidden",children:h.jsx(Me.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 li({interaction:e,theme:t,onDismiss:n,client:r,addLocalMessage:i}){var a;if(!e||!e.isVisible||!e.component)return null;const[o]=D.useState(()=>Date.now()),s=()=>e.component?D.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}):h.jsx("div",{className:"p-4 text-red-500",children:"Component not found"});switch(e.presentationMode){case"fullscreen":return h.jsx(Sr,{children:h.jsxs(Me.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx(Du,{timeout:e.timeout}),h.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/80 text-white border-b border-gray-700",children:[h.jsx("h3",{className:"text-lg font-semibold",children:e.methodName.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase())}),h.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:h.jsx(Ge.X,{className:"w-5 h-5"})})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:s()})]})});case"embedded":default:return h.jsx(Sr,{children:h.jsx(Me.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-fit rounded-lg ",children:h.jsxs("div",{children:[h.jsx(Du,{timeout:e.timeout}),s()]})})})}}function ci({duration:e,theme:t="vox",onTimerExpired:n,className:r="",showIcon:i=!0}){const[o,s]=A.useState(e),[a,l]=A.useState(!1);A.useEffect(()=>{if(o<=0){l(!0),n==null||n();return}const u=setInterval(()=>{s(d=>{const f=d-1;return f<=0?(l(!0),n==null||n(),0):f})},1e3);return()=>clearInterval(u)},[o,n]),A.useEffect(()=>{s(e),l(!1)},[e]);const c=()=>a?"text-red-500":o<=60?"text-orange-500":o<=300?"text-yellow-500":t==="dark"?"text-gray-300":"text-gray-600";return h.jsxs("div",{className:`flex items-center gap-1 text-sm ${c()} ${r}`,children:[i&&h.jsx(Ge.Clock,{className:"w-4 h-4"}),h.jsx("span",{className:"font-mono",children:cp(o)}),a&&h.jsx("span",{className:"text-xs ml-1 text-red-500",children:"(Expired)"})]})}const yv=({logLevel:e}={})=>{const t=Ft.useRoomContext();D.useEffect(()=>(se.setLogLevel(e??"debug"),window.__lk_room=t,()=>{window.__lk_room=void 0}),[t,e])},dp=D.forwardRef((e,t)=>{const{alt:n,color:r="currentColor",size:i="1em",weight:o="regular",mirrored:s=!1,children:a,weights:l,...c}=e;return D.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,fill:r,viewBox:"0 0 256 256",transform:s?"scale(-1, 1)":void 0,...c},!!n&&D.createElement("title",null,n),a,l.get(o))});dp.displayName="SSRBase";const xv=new Map([["bold",D.createElement(D.Fragment,null,D.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",D.createElement(D.Fragment,null,D.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),D.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",D.createElement(D.Fragment,null,D.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",D.createElement(D.Fragment,null,D.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",D.createElement(D.Fragment,null,D.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",D.createElement(D.Fragment,null,D.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"}))]]),vl=D.forwardRef((e,t)=>D.createElement(dp,{ref:t,...e,weights:xv}));vl.displayName="SpinnerIcon";function wv(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vv=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ev=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kv={};function Lu(e,t){return(kv.jsx?Ev:vv).test(e)}const Sv=/[ \t\n\f\r]/g;function Cv(e){return typeof e=="object"?e.type==="text"?Fu(e.value):!1:Fu(e)}function Fu(e){return e.replace(Sv,"")===""}class bi{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}bi.prototype.normal={};bi.prototype.property={};bi.prototype.space=void 0;function fp(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new bi(n,r,t)}function va(e){return e.toLowerCase()}class jt{constructor(t,n){this.attribute=n,this.property=t}}jt.prototype.attribute="";jt.prototype.booleanish=!1;jt.prototype.boolean=!1;jt.prototype.commaOrSpaceSeparated=!1;jt.prototype.commaSeparated=!1;jt.prototype.defined=!1;jt.prototype.mustUseProperty=!1;jt.prototype.number=!1;jt.prototype.overloadedBoolean=!1;jt.prototype.property="";jt.prototype.spaceSeparated=!1;jt.prototype.space=void 0;let _v=0;const Re=Qn(),xt=Qn(),Ea=Qn(),X=Qn(),it=Qn(),vr=Qn(),zt=Qn();function Qn(){return 2**++_v}const ka=Object.freeze(Object.defineProperty({__proto__:null,boolean:Re,booleanish:xt,commaOrSpaceSeparated:zt,commaSeparated:vr,number:X,overloadedBoolean:Ea,spaceSeparated:it},Symbol.toStringTag,{value:"Module"})),bs=Object.keys(ka);class El extends jt{constructor(t,n,r,i){let o=-1;if(super(t,n),Bu(this,"space",i),typeof r=="number")for(;++o<bs.length;){const s=bs[o];Bu(this,bs[o],(r&ka[s])===ka[s])}}}El.prototype.defined=!0;function Bu(e,t,n){n&&(e[t]=n)}function Pr(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new El(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[va(r)]=r,n[va(o.attribute)]=r}return new bi(t,n,e.space)}const hp=Pr({properties:{ariaActiveDescendant:null,ariaAtomic:xt,ariaAutoComplete:null,ariaBusy:xt,ariaChecked:xt,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:it,ariaCurrent:null,ariaDescribedBy:it,ariaDetails:null,ariaDisabled:xt,ariaDropEffect:it,ariaErrorMessage:null,ariaExpanded:xt,ariaFlowTo:it,ariaGrabbed:xt,ariaHasPopup:null,ariaHidden:xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:it,ariaLevel:X,ariaLive:null,ariaModal:xt,ariaMultiLine:xt,ariaMultiSelectable:xt,ariaOrientation:null,ariaOwns:it,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:xt,ariaReadOnly:xt,ariaRelevant:null,ariaRequired:xt,ariaRoleDescription:it,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:xt,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 pp(e,t){return t in e?e[t]:t}function mp(e,t){return pp(e,t.toLowerCase())}const Tv=Pr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:vr,acceptCharset:it,accessKey:it,action:null,allow:null,allowFullScreen:Re,allowPaymentRequest:Re,allowUserMedia:Re,alt:null,as:null,async:Re,autoCapitalize:null,autoComplete:it,autoFocus:Re,autoPlay:Re,blocking:it,capture:null,charSet:null,checked:Re,cite:null,className:it,cols:X,colSpan:null,content:null,contentEditable:xt,controls:Re,controlsList:it,coords:X|vr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Re,defer:Re,dir:null,dirName:null,disabled:Re,download:Ea,draggable:xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Re,formTarget:null,headers:it,height:X,hidden:Ea,high:X,href:null,hrefLang:null,htmlFor:it,httpEquiv:it,id:null,imageSizes:null,imageSrcSet:null,inert:Re,inputMode:null,integrity:null,is:null,isMap:Re,itemId:null,itemProp:it,itemRef:it,itemScope:Re,itemType:it,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Re,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:Re,muted:Re,name:null,nonce:null,noModule:Re,noValidate:Re,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:Re,optimum:X,pattern:null,ping:it,placeholder:null,playsInline:Re,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Re,referrerPolicy:null,rel:it,required:Re,reversed:Re,rows:X,rowSpan:X,sandbox:it,scope:null,scoped:Re,seamless:Re,selected:Re,shadowRootClonable:Re,shadowRootDelegatesFocus:Re,shadowRootMode:null,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:xt,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:Re,useMap:null,value:xt,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:it,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:Re,declare:Re,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:Re,noHref:Re,noShade:Re,noWrap:Re,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:xt,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:Re,disableRemotePlayback:Re,prefix:null,property:null,results:X,security:null,unselectable:null},space:"html",transform:mp}),Nv=Pr({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:zt,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:it,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:Re,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:vr,g2:vr,glyphName:vr,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:zt,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:it,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zt,rev:zt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zt,requiredFeatures:zt,requiredFonts:zt,requiredFormats:zt,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:zt,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:zt,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:zt,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:pp}),gp=Pr({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()}}),bp=Pr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:mp}),yp=Pr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Av={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"},Rv=/[A-Z]/g,ju=/-[a-z]/g,Mv=/^data[-\w.:]+$/i;function Iv(e,t){const n=va(t);let r=t,i=jt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Mv.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ju,Pv);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ju.test(o)){let s=o.replace(Rv,Ov);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=El}return new i(r,t)}function Ov(e){return"-"+e.toLowerCase()}function Pv(e){return e.charAt(1).toUpperCase()}const Dv=fp([hp,Tv,gp,bp,yp],"html"),kl=fp([hp,Nv,gp,bp,yp],"svg");function Lv(e){return e.join(" ").trim()}function Ro(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ir={},ys,$u;function Fv(){if($u)return ys;$u=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
30
+ `,c="/",u="*",d="",f="comment",p="declaration";ys=function(m,x){if(typeof m!="string")throw new TypeError("First argument must be a string");if(!m)return[];x=x||{};var y=1,E=1;function v(L){var j=L.match(t);j&&(y+=j.length);var H=L.lastIndexOf(l);E=~H?L.length-H:E+L.length}function _(){var L={line:y,column:E};return function(j){return j.position=new k(L),N(),j}}function k(L){this.start=L,this.end={line:y,column:E},this.source=x.source}k.prototype.content=m;function C(L){var j=new Error(x.source+":"+y+":"+E+": "+L);if(j.reason=L,j.filename=x.source,j.line=y,j.column=E,j.source=m,!x.silent)throw j}function M(L){var j=L.exec(m);if(j){var H=j[0];return v(H),m=m.slice(H.length),j}}function N(){M(n)}function I(L){var j;for(L=L||[];j=b();)j!==!1&&L.push(j);return L}function b(){var L=_();if(!(c!=m.charAt(0)||u!=m.charAt(1))){for(var j=2;d!=m.charAt(j)&&(u!=m.charAt(j)||c!=m.charAt(j+1));)++j;if(j+=2,d===m.charAt(j-1))return C("End of comment missing");var H=m.slice(2,j-2);return E+=2,v(H),m=m.slice(j),E+=2,L({type:f,comment:H})}}function R(){var L=_(),j=M(r);if(j){if(b(),!M(i))return C("property missing ':'");var H=M(o),ie=L({type:p,property:g(j[0].replace(e,d)),value:H?g(H[0].replace(e,d)):d});return M(s),ie}}function O(){var L=[];I(L);for(var j;j=R();)j!==!1&&(L.push(j),I(L));return L}return N(),O()};function g(m){return m?m.replace(a,d):d}return ys}var Vu;function Bv(){if(Vu)return ir;Vu=1;var e=ir&&ir.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ir,"__esModule",{value:!0}),ir.default=n;var t=e(Fv());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var s=(0,t.default)(r),a=typeof i=="function";return s.forEach(function(l){if(l.type==="declaration"){var c=l.property,u=l.value;a?i(c,u,l):u&&(o=o||{},o[c]=u)}}),o}return ir}var jr={},zu;function jv(){if(zu)return jr;zu=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(c){return!c||n.test(c)||e.test(c)},s=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),o(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(i,a):c=c.replace(r,a),c.replace(t,s))};return jr.camelCase=l,jr}var $r,Uu;function $v(){if(Uu)return $r;Uu=1;var e=$r&&$r.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Bv()),n=jv();function r(i,o){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(a,l){a&&l&&(s[(0,n.camelCase)(a,o)]=l)}),s}return r.default=r,$r=r,$r}var Vv=$v();const zv=Ro(Vv),xp=wp("end"),Sl=wp("start");function wp(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 Uv(e){const t=Sl(e),n=xp(e);if(t&&n)return{start:t,end:n}}function Qr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Hu(e.position):"start"in e||"end"in e?Hu(e):"line"in e||"column"in e?Sa(e):""}function Sa(e){return Wu(e&&e.line)+":"+Wu(e&&e.column)}function Hu(e){return Sa(e&&e.start)+"-"+Sa(e&&e.end)}function Wu(e){return e&&typeof e=="number"?e:1}class Mt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.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=Qr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Mt.prototype.file="";Mt.prototype.name="";Mt.prototype.reason="";Mt.prototype.message="";Mt.prototype.stack="";Mt.prototype.column=void 0;Mt.prototype.line=void 0;Mt.prototype.ancestors=void 0;Mt.prototype.cause=void 0;Mt.prototype.fatal=void 0;Mt.prototype.place=void 0;Mt.prototype.ruleId=void 0;Mt.prototype.source=void 0;const Cl={}.hasOwnProperty,Hv=new Map,Wv=/[A-Z]/g,Gv=new Set(["table","tbody","thead","tfoot","tr"]),Kv=new Set(["td","th"]),vp="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qv(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=nE(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=tE(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"?kl:Dv,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Ep(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Ep(e,t,n){if(t.type==="element")return Yv(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Zv(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qv(e,t,n);if(t.type==="mdxjsEsm")return Xv(e,t);if(t.type==="root")return Jv(e,t,n);if(t.type==="text")return eE(e,t)}function Yv(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=kl,e.schema=i),e.ancestors.push(t);const o=Sp(e,t.tagName,!1),s=rE(e,t);let a=Tl(e,t);return Gv.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Cv(l):!0})),kp(e,s,o,t),_l(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Zv(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)}ui(e,t.position)}function Xv(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ui(e,t.position)}function Qv(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=kl,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Sp(e,t.name,!0),s=iE(e,t),a=Tl(e,t);return kp(e,s,o,t),_l(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Jv(e,t,n){const r={};return _l(r,Tl(e,t)),e.create(t,e.Fragment,r,n)}function eE(e,t){return t.value}function kp(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function _l(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function tE(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function nE(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Sl(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function rE(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Cl.call(t.properties,i)){const o=oE(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Kv.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function iE(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ui(e,t.position);else{const i=r.name;let o;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,o=e.evaluater.evaluateExpression(a.expression)}else ui(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Tl(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Hv;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=Ep(e,o,s);a!==void 0&&n.push(a)}return n}function oE(e,t,n){const r=Iv(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?wv(n):Lv(n)),r.property==="style"){let i=typeof n=="object"?n:sE(e,String(n));return e.stylePropertyNameCase==="css"&&(i=aE(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Av[r.property]||r.property:r.attribute,n]}}function sE(e,t){try{return zv(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Mt("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=vp+"#cannot-parse-style-attribute",i}}function Sp(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=Lu(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=Lu(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Cl.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ui(e)}function ui(e,t){const n=new Mt("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=vp+"#cannot-handle-mdx-estrees-without-createevaluater",n}function aE(e){const t={};let n;for(n in e)Cl.call(e,n)&&(t[lE(n)]=e[n]);return t}function lE(e){let t=e.replace(Wv,cE);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function cE(e){return"-"+e.toLowerCase()}const xs={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"]},uE={};function Nl(e,t){const n=uE,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Cp(e,r,i)}function Cp(e,t,n){if(dE(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 Gu(e.children,t,n)}return Array.isArray(e)?Gu(e,t,n):""}function Gu(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Cp(e[i],t,n);return r.join("")}function dE(e){return!!(e&&typeof e=="object")}const Ku=document.createElement("i");function Al(e){const t="&"+e+";";Ku.innerHTML=t;const n=Ku.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ht(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function qt(e,t){return e.length>0?(Ht(e,e.length,0,t),e):t}const qu={}.hasOwnProperty;function _p(e){const t={};let n=-1;for(;++n<e.length;)fE(t,e[n]);return t}function fE(e,t){let n;for(n in t){const i=(qu.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){qu.call(i,s)||(i[s]=[]);const a=o[s];hE(i[s],Array.isArray(a)?a:a?[a]:[])}}}function hE(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ht(e,0,0,r)}function Tp(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 tn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pt=Ln(/[A-Za-z]/),Rt=Ln(/[\dA-Za-z]/),pE=Ln(/[#-'*+\--9=?A-Z^-~]/);function po(e){return e!==null&&(e<32||e===127)}const Ca=Ln(/\d/),mE=Ln(/[\dA-Fa-f]/),gE=Ln(/[!-/:-@[-`{-~]/);function be(e){return e!==null&&e<-2}function tt(e){return e!==null&&(e<0||e===32)}function Pe(e){return e===-2||e===-1||e===32}const Mo=Ln(new RegExp("\\p{P}|\\p{S}","u")),Zn=Ln(/\s/);function Ln(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Dr(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Rt(e.charCodeAt(n+1))&&Rt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Fe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Pe(l)?(e.enter(n),a(l)):t(l)}function a(l){return Pe(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const bE={tokenize:yE};function yE(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"),Fe(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return be(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const xE={tokenize:wE},Yu={tokenize:vE};function wE(e){const t=this,n=[];let r=0,i,o,s;return a;function a(v){if(r<n.length){const _=n[r];return t.containerState=_[1],e.attempt(_[0].continuation,l,c)(v)}return c(v)}function l(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const _=t.events.length;let k=_,C;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){C=t.events[k][1].end;break}y(r);let M=_;for(;M<t.events.length;)t.events[M][1].end={...C},M++;return Ht(t.events,k+1,0,t.events.slice(_)),t.events.length=M,c(v)}return a(v)}function c(v){if(r===n.length){if(!i)return f(v);if(i.currentConstruct&&i.currentConstruct.concrete)return g(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Yu,u,d)(v)}function u(v){return i&&E(),y(r),f(v)}function d(v){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(v)}function f(v){return t.containerState={},e.attempt(Yu,p,g)(v)}function p(v){return r++,n.push([t.currentConstruct,t.containerState]),f(v)}function g(v){if(v===null){i&&E(),y(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),m(v)}function m(v){if(v===null){x(e.exit("chunkFlow"),!0),y(0),e.consume(v);return}return be(v)?(e.consume(v),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(v),m)}function x(v,_){const k=t.sliceStream(v);if(_&&k.push(null),v.previous=o,o&&(o.next=v),o=v,i.defineSkip(v.start),i.write(k),t.parser.lazy[v.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<s&&(!i.events[C][1].end||i.events[C][1].end.offset>s))return;const M=t.events.length;let N=M,I,b;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(I){b=t.events[N][1].end;break}I=!0}for(y(r),C=M;C<t.events.length;)t.events[C][1].end={...b},C++;Ht(t.events,N+1,0,t.events.slice(M)),t.events.length=C}}function y(v){let _=n.length;for(;_-- >v;){const k=n[_];t.containerState=k[1],k[0].exit.call(t,e)}n.length=v}function E(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function vE(e,t,n){return Fe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _r(e){if(e===null||tt(e)||Zn(e))return 1;if(Mo(e))return 2}function Io(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const _a={name:"attention",resolveAll:EE,tokenize:kE};function EE(e,t){let n=-1,r,i,o,s,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},f={...e[n][1].start};Zu(d,-l),Zu(f,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=qt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=qt(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=qt(c,Io(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=qt(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=qt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Ht(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 kE(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=_r(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),u=_r(l),d=!u||u===2&&i||n.includes(l),f=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?d:d&&(i||!f)),c._close=!!(o===42?f:f&&(u||!d)),t(l)}}function Zu(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const SE={name:"autolink",tokenize:CE};function CE(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Pt(p)?(e.consume(p),s):p===64?n(p):c(p)}function s(p){return p===43||p===45||p===46||Rt(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Rt(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||po(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):pE(p)?(e.consume(p),c):n(p)}function u(p){return Rt(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||Rt(p))&&r++<63){const g=p===45?f:d;return e.consume(p),g}return n(p)}}const yi={partial:!0,tokenize:_E};function _E(e,t,n){return r;function r(o){return Pe(o)?Fe(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||be(o)?t(o):n(o)}}const Np={continuation:{tokenize:NE},exit:AE,name:"blockQuote",tokenize:TE};function TE(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Pe(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function NE(e,t,n){const r=this;return i;function i(s){return Pe(s)?Fe(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Np,t,n)(s)}}function AE(e){e.exit("blockQuote")}const Ap={name:"characterEscape",tokenize:RE};function RE(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return gE(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Rp={name:"characterReference",tokenize:ME};function ME(e,t,n){const r=this;let i=0,o,s;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"),o=31,s=Rt,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=mE,u):(e.enter("characterReferenceValue"),o=7,s=Ca,u(d))}function u(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return s===Rt&&!Al(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),u):n(d)}}const Xu={partial:!0,tokenize:OE},Qu={concrete:!0,name:"codeFenced",tokenize:IE};function IE(e,t,n){const r=this,i={partial:!0,tokenize:k};let o=0,s=0,a;return l;function l(C){return c(C)}function c(C){const M=r.events[r.events.length-1];return o=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?(s++,e.consume(C),u):s<3?n(C):(e.exit("codeFencedFenceSequence"),Pe(C)?Fe(e,d,"whitespace")(C):d(C))}function d(C){return C===null||be(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Xu,m,_)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(C))}function f(C){return C===null||be(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):Pe(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Fe(e,p,"whitespace")(C)):C===96&&C===a?n(C):(e.consume(C),f)}function p(C){return C===null||be(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===null||be(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===a?n(C):(e.consume(C),g)}function m(C){return e.attempt(i,_,x)(C)}function x(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),y}function y(C){return o>0&&Pe(C)?Fe(e,E,"linePrefix",o+1)(C):E(C)}function E(C){return C===null||be(C)?e.check(Xu,m,_)(C):(e.enter("codeFlowValue"),v(C))}function v(C){return C===null||be(C)?(e.exit("codeFlowValue"),E(C)):(e.consume(C),v)}function _(C){return e.exit("codeFenced"),t(C)}function k(C,M,N){let I=0;return b;function b(H){return C.enter("lineEnding"),C.consume(H),C.exit("lineEnding"),R}function R(H){return C.enter("codeFencedFence"),Pe(H)?Fe(C,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):O(H)}function O(H){return H===a?(C.enter("codeFencedFenceSequence"),L(H)):N(H)}function L(H){return H===a?(I++,C.consume(H),L):I>=s?(C.exit("codeFencedFenceSequence"),Pe(H)?Fe(C,j,"whitespace")(H):j(H)):N(H)}function j(H){return H===null||be(H)?(C.exit("codeFencedFence"),M(H)):N(H)}}}function OE(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ws={name:"codeIndented",tokenize:DE},PE={partial:!0,tokenize:LE};function DE(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Fe(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):be(c)?e.attempt(PE,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||be(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function LE(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):be(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Fe(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):be(s)?i(s):n(s)}}const FE={name:"codeText",previous:jE,resolve:BE,tokenize:$E};function BE(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 jE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $E(e,t,n){let r=0,i,o;return s;function s(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?(o=e.enter("codeTextSequence"),i=0,u(d)):be(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||be(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)):(o.type="codeTextData",c(d))}}class VE{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 o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Vr(this.left,r),o.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),Vr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vr(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);Vr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Vr(this.left,n.reverse())}}}function Vr(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 Mp(e){const t={};let n=-1,r,i,o,s,a,l,c;const u=new VE(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,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,zE(u,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=u.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[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 Ht(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function zE(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,d,f=-1,p=n,g=0,m=0;const x=[m];for(;p;){for(;e.get(++i)[1]!==p;);o.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(m=f+1,x.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),f=x.length;f--;){const y=a.slice(x[f],x[f+1]),E=o.pop();l.push([E,E+y.length-1]),e.splice(E,2,y)}for(l.reverse(),f=-1;++f<l.length;)c[g+l[f][0]]=g+l[f][1],g+=l[f][1]-l[f][0]-1;return c}const UE={resolve:WE,tokenize:GE},HE={partial:!0,tokenize:KE};function WE(e){return Mp(e),e}function GE(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?o(a):be(a)?e.check(HE,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function KE(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Fe(e,o,"linePrefix")}function o(s){if(s===null||be(s))return n(s);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(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Ip(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),f):y===null||y===32||y===41||po(y)?n(y):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(y))}function f(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(a),f(y)):y===null||y===60||be(y)?n(y):(e.consume(y),y===92?g:p)}function g(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function m(y){return!u&&(y===null||y===41||tt(y))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(y)):u<c&&y===40?(e.consume(y),u++,m):y===41?(e.consume(y),u--,m):y===null||y===32||y===40||po(y)?n(y):(e.consume(y),y===92?x:m)}function x(y){return y===40||y===41||y===92?(e.consume(y),m):m(y)}}function Op(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):be(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||be(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!Pe(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function Pp(e,t,n,r,i,o){let s;return a;function a(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),s=f===40?41:f,l):n(f)}function l(f){return f===s?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(o),c(f))}function c(f){return f===s?(e.exit(o),l(s)):f===null?n(f):be(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Fe(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===s||f===null||be(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:u)}function d(f){return f===s||f===92?(e.consume(f),u):u(f)}}function Jr(e,t){let n;return r;function r(i){return be(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Pe(i)?Fe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const qE={name:"definition",tokenize:ZE},YE={partial:!0,tokenize:XE};function ZE(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return Op.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=tn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return tt(p)?Jr(e,c)(p):c(p)}function c(p){return Ip(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(YE,d,d)(p)}function d(p){return Pe(p)?Fe(e,f,"whitespace")(p):f(p)}function f(p){return p===null||be(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function XE(e,t,n){return r;function r(a){return tt(a)?Jr(e,i)(a):n(a)}function i(a){return Pp(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Pe(a)?Fe(e,s,"whitespace")(a):s(a)}function s(a){return a===null||be(a)?t(a):n(a)}}const QE={name:"hardBreakEscape",tokenize:JE};function JE(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return be(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const ek={name:"headingAtx",resolve:tk,tokenize:nk};function tk(e,t){let n=e.length-2,r=3,i,o;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},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ht(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function nk(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||tt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||be(u)?(e.exit("atxHeading"),t(u)):Pe(u)?Fe(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||tt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const rk=["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"],Ju=["pre","script","style","textarea"],ik={concrete:!0,name:"htmlFlow",resolveTo:ak,tokenize:lk},ok={partial:!0,tokenize:uk},sk={partial:!0,tokenize:ck};function ak(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 lk(e,t,n){const r=this;let i,o,s,a,l;return c;function c(S){return u(S)}function u(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),d}function d(S){return S===33?(e.consume(S),f):S===47?(e.consume(S),o=!0,m):S===63?(e.consume(S),i=3,r.interrupt?t:w):Pt(S)?(e.consume(S),s=String.fromCharCode(S),x):n(S)}function f(S){return S===45?(e.consume(S),i=2,p):S===91?(e.consume(S),i=5,a=0,g):Pt(S)?(e.consume(S),i=4,r.interrupt?t:w):n(S)}function p(S){return S===45?(e.consume(S),r.interrupt?t:w):n(S)}function g(S){const $="CDATA[";return S===$.charCodeAt(a++)?(e.consume(S),a===$.length?r.interrupt?t:O:g):n(S)}function m(S){return Pt(S)?(e.consume(S),s=String.fromCharCode(S),x):n(S)}function x(S){if(S===null||S===47||S===62||tt(S)){const $=S===47,q=s.toLowerCase();return!$&&!o&&Ju.includes(q)?(i=1,r.interrupt?t(S):O(S)):rk.includes(s.toLowerCase())?(i=6,$?(e.consume(S),y):r.interrupt?t(S):O(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):o?E(S):v(S))}return S===45||Rt(S)?(e.consume(S),s+=String.fromCharCode(S),x):n(S)}function y(S){return S===62?(e.consume(S),r.interrupt?t:O):n(S)}function E(S){return Pe(S)?(e.consume(S),E):b(S)}function v(S){return S===47?(e.consume(S),b):S===58||S===95||Pt(S)?(e.consume(S),_):Pe(S)?(e.consume(S),v):b(S)}function _(S){return S===45||S===46||S===58||S===95||Rt(S)?(e.consume(S),_):k(S)}function k(S){return S===61?(e.consume(S),C):Pe(S)?(e.consume(S),k):v(S)}function C(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),l=S,M):Pe(S)?(e.consume(S),C):N(S)}function M(S){return S===l?(e.consume(S),l=null,I):S===null||be(S)?n(S):(e.consume(S),M)}function N(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||tt(S)?k(S):(e.consume(S),N)}function I(S){return S===47||S===62||Pe(S)?v(S):n(S)}function b(S){return S===62?(e.consume(S),R):n(S)}function R(S){return S===null||be(S)?O(S):Pe(S)?(e.consume(S),R):n(S)}function O(S){return S===45&&i===2?(e.consume(S),ie):S===60&&i===1?(e.consume(S),ee):S===62&&i===4?(e.consume(S),V):S===63&&i===3?(e.consume(S),w):S===93&&i===5?(e.consume(S),W):be(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ok,Y,L)(S)):S===null||be(S)?(e.exit("htmlFlowData"),L(S)):(e.consume(S),O)}function L(S){return e.check(sk,j,Y)(S)}function j(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),H}function H(S){return S===null||be(S)?L(S):(e.enter("htmlFlowData"),O(S))}function ie(S){return S===45?(e.consume(S),w):O(S)}function ee(S){return S===47?(e.consume(S),s="",P):O(S)}function P(S){if(S===62){const $=s.toLowerCase();return Ju.includes($)?(e.consume(S),V):O(S)}return Pt(S)&&s.length<8?(e.consume(S),s+=String.fromCharCode(S),P):O(S)}function W(S){return S===93?(e.consume(S),w):O(S)}function w(S){return S===62?(e.consume(S),V):S===45&&i===2?(e.consume(S),w):O(S)}function V(S){return S===null||be(S)?(e.exit("htmlFlowData"),Y(S)):(e.consume(S),V)}function Y(S){return e.exit("htmlFlow"),t(S)}}function ck(e,t,n){const r=this;return i;function i(s){return be(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function uk(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yi,t,n)}}const dk={name:"htmlText",tokenize:fk};function fk(e,t,n){const r=this;let i,o,s;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),k):w===63?(e.consume(w),v):Pt(w)?(e.consume(w),N):n(w)}function c(w){return w===45?(e.consume(w),u):w===91?(e.consume(w),o=0,g):Pt(w)?(e.consume(w),E):n(w)}function u(w){return w===45?(e.consume(w),p):n(w)}function d(w){return w===null?n(w):w===45?(e.consume(w),f):be(w)?(s=d,ee(w)):(e.consume(w),d)}function f(w){return w===45?(e.consume(w),p):d(w)}function p(w){return w===62?ie(w):w===45?f(w):d(w)}function g(w){const V="CDATA[";return w===V.charCodeAt(o++)?(e.consume(w),o===V.length?m:g):n(w)}function m(w){return w===null?n(w):w===93?(e.consume(w),x):be(w)?(s=m,ee(w)):(e.consume(w),m)}function x(w){return w===93?(e.consume(w),y):m(w)}function y(w){return w===62?ie(w):w===93?(e.consume(w),y):m(w)}function E(w){return w===null||w===62?ie(w):be(w)?(s=E,ee(w)):(e.consume(w),E)}function v(w){return w===null?n(w):w===63?(e.consume(w),_):be(w)?(s=v,ee(w)):(e.consume(w),v)}function _(w){return w===62?ie(w):v(w)}function k(w){return Pt(w)?(e.consume(w),C):n(w)}function C(w){return w===45||Rt(w)?(e.consume(w),C):M(w)}function M(w){return be(w)?(s=M,ee(w)):Pe(w)?(e.consume(w),M):ie(w)}function N(w){return w===45||Rt(w)?(e.consume(w),N):w===47||w===62||tt(w)?I(w):n(w)}function I(w){return w===47?(e.consume(w),ie):w===58||w===95||Pt(w)?(e.consume(w),b):be(w)?(s=I,ee(w)):Pe(w)?(e.consume(w),I):ie(w)}function b(w){return w===45||w===46||w===58||w===95||Rt(w)?(e.consume(w),b):R(w)}function R(w){return w===61?(e.consume(w),O):be(w)?(s=R,ee(w)):Pe(w)?(e.consume(w),R):I(w)}function O(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),i=w,L):be(w)?(s=O,ee(w)):Pe(w)?(e.consume(w),O):(e.consume(w),j)}function L(w){return w===i?(e.consume(w),i=void 0,H):w===null?n(w):be(w)?(s=L,ee(w)):(e.consume(w),L)}function j(w){return w===null||w===34||w===39||w===60||w===61||w===96?n(w):w===47||w===62||tt(w)?I(w):(e.consume(w),j)}function H(w){return w===47||w===62||tt(w)?I(w):n(w)}function ie(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):n(w)}function ee(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),P}function P(w){return Pe(w)?Fe(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):W(w)}function W(w){return e.enter("htmlTextData"),s(w)}}const Rl={name:"labelEnd",resolveAll:gk,resolveTo:bk,tokenize:yk},hk={tokenize:xk},pk={tokenize:wk},mk={tokenize:vk};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&&Ht(e,0,e.length,n),e}function bk(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=qt(a,e.slice(o+1,o+r+3)),a=qt(a,[["enter",u,t]]),a=qt(a,Io(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=qt(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=qt(a,e.slice(s+1)),a=qt(a,[["exit",l,t]]),Ht(e,o,e.length,a),e}function yk(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(f){return o?o._inactive?d(f):(s=r.parser.defined.includes(tn(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(hk,u,s?u:d)(f):f===91?e.attempt(pk,u,s?c:d)(f):s?u(f):d(f)}function c(f){return e.attempt(mk,u,d)(f)}function u(f){return t(f)}function d(f){return o._balanced=!0,n(f)}}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 tt(d)?Jr(e,o)(d):o(d)}function o(d){return d===41?u(d):Ip(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return tt(d)?Jr(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?Pp(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return tt(d)?Jr(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 wk(e,t,n){const r=this;return i;function i(a){return Op.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(tn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function vk(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const Ek={name:"labelStartImage",resolveAll:Rl.resolveAll,tokenize:kk};function kk(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Sk={name:"labelStartLink",resolveAll:Rl.resolveAll,tokenize:Ck};function Ck(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const vs={name:"lineEnding",tokenize:_k};function _k(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Fe(e,t,"linePrefix")}}const no={name:"thematicBreak",tokenize:Tk};function Tk(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||be(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Pe(c)?Fe(e,a,"whitespace")(c):a(c))}}const Lt={continuation:{tokenize:Mk},exit:Ok,name:"list",tokenize:Rk},Nk={partial:!0,tokenize:Pk},Ak={partial:!0,tokenize:Ik};function Rk(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Ca(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(no,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Ca(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(yi,r.interrupt?n:u,e.attempt(Nk,f,d))}function u(p){return r.containerState.initialBlankLine=!0,o++,f(p)}function d(p){return Pe(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Mk(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yi,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Fe(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Pe(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ak,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Fe(e,e.attempt(Lt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Ik(e,t,n){const r=this;return Fe(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Ok(e){e.exit(this.containerState.type)}function Pk(e,t,n){const r=this;return Fe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Pe(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const ed={name:"setextUnderline",resolveTo:Dk,tokenize:Lk};function Dk(e,t){let n=e.length,r,i,o;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),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Lk(e,t,n){const r=this;let i;return o;function o(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,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Pe(c)?Fe(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||be(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Fk={tokenize:Bk};function Bk(e){const t=this,n=e.attempt(yi,r,e.attempt(this.parser.constructs.flowInitial,i,Fe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(UE,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const jk={resolveAll:Lp()},$k=Dp("string"),Vk=Dp("text");function Dp(e){return{resolveAll:Lp(e==="text"?zk:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(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"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let f=-1;if(d)for(;++f<d.length;){const p=d[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Lp(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function zk(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 o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,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 Uk={42:Lt,43:Lt,45:Lt,48:Lt,49:Lt,50:Lt,51:Lt,52:Lt,53:Lt,54:Lt,55:Lt,56:Lt,57:Lt,62:Np},Hk={91:qE},Wk={[-2]:ws,[-1]:ws,32:ws},Gk={35:ek,42:no,45:[ed,no],60:ik,61:ed,95:no,96:Qu,126:Qu},Kk={38:Rp,92:Ap},qk={[-5]:vs,[-4]:vs,[-3]:vs,33:Ek,38:Rp,42:_a,60:[SE,dk],91:Sk,92:[QE,Ap],93:Rl,95:_a,96:FE},Yk={null:[_a,jk]},Zk={null:[42,95]},Xk={null:[]},Qk=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Zk,contentInitial:Hk,disable:Xk,document:Uk,flow:Gk,flowInitial:Wk,insideSpan:Yk,string:Kk,text:qk},Symbol.toStringTag,{value:"Module"}));function Jk(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={},o=[];let s=[],a=[];const l={attempt:M(k),check:M(C),consume:E,enter:v,exit:_,interrupt:M(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:g,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function d(R){return s=qt(s,R),x(),s[s.length-1]!==null?[]:(N(t,0),c.events=Io(o,c.events,c),c.events)}function f(R,O){return tS(p(R),O)}function p(R){return eS(s,R)}function g(){const{_bufferIndex:R,_index:O,line:L,column:j,offset:H}=r;return{_bufferIndex:R,_index:O,line:L,column:j,offset:H}}function m(R){i[R.line]=R.column,b()}function x(){let R;for(;r._index<s.length;){const O=s[r._index];if(typeof O=="string")for(R=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===R&&r._bufferIndex<O.length;)y(O.charCodeAt(r._bufferIndex));else y(O)}}function y(R){u=u(R)}function E(R){be(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,b()):R!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=R}function v(R,O){const L=O||{};return L.type=R,L.start=g(),c.events.push(["enter",L,c]),a.push(L),L}function _(R){const O=a.pop();return O.end=g(),c.events.push(["exit",O,c]),O}function k(R,O){N(R,O.from)}function C(R,O){O.restore()}function M(R,O){return L;function L(j,H,ie){let ee,P,W,w;return Array.isArray(j)?Y(j):"tokenize"in j?Y([j]):V(j);function V(B){return Q;function Q(te){const ae=te!==null&&B[te],de=te!==null&&B.null,De=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(de)?de:de?[de]:[]];return Y(De)(te)}}function Y(B){return ee=B,P=0,B.length===0?ie:S(B[P])}function S(B){return Q;function Q(te){return w=I(),W=B,B.partial||(c.currentConstruct=B),B.name&&c.parser.constructs.disable.null.includes(B.name)?q():B.tokenize.call(O?Object.assign(Object.create(c),O):c,l,$,q)(te)}}function $(B){return R(W,w),H}function q(B){return w.restore(),++P<ee.length?S(ee[P]):ie}}}function N(R,O){R.resolveAll&&!o.includes(R)&&o.push(R),R.resolve&&Ht(c.events,O,c.events.length-O,R.resolve(c.events.slice(O),c)),R.resolveTo&&(c.events=R.resolveTo(c.events,c))}function I(){const R=g(),O=c.previous,L=c.currentConstruct,j=c.events.length,H=Array.from(a);return{from:j,restore:ie};function ie(){r=R,c.previous=O,c.currentConstruct=L,c.events.length=j,a=H,b()}}function b(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function eS(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function tS(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
31
31
  `;break}case-3:{s=`\r
32
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function rS(e){const r={constructs:Tp([Jk,...(e||{}).extensions||[]]),content:i(yE),defined:[],document:i(wE),flow:i(Bk),lazy:{},string:i(Vk),text:i(zk)};return r;function i(o){return s;function s(a){return eS(r,o,a)}}}function iS(e){for(;!Ip(e););return e}const td=/[\0\t\n\r]/g;function oS(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let c,u,d,f,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(td.lastIndex=d,c=td.exec(o),f=c&&c.index!==void 0?c.index:o.length,p=o.charCodeAt(f),!c){t=o.slice(d);break}if(p===10&&d===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<f&&(l.push(o.slice(d,f)),e+=f-d),p){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=f+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const sS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function aS(e){return e.replace(sS,lS)}function lS(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Np(n.slice(o?2:1),o?16:10)}return Al(n)||e}const Bp={}.hasOwnProperty;function cS(e,t,n){return typeof t!="string"&&(n=t,t=void 0),uS(n)(iS(rS(n).document().write(oS()(e,t,!0))))}function uS(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ne),autolinkProtocol:I,autolinkEmail:I,atxHeading:o(te),blockQuote:o(le),characterEscape:I,characterReference:I,codeFenced:o(he),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(he,s),codeText:o(G,s),codeTextData:I,data:I,codeFlowValue:I,definition:o(Se),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Z),hardBreakEscape:o(ye),hardBreakTrailing:o(ye),htmlFlow:o(ae,s),htmlFlowData:I,htmlText:o(ae,s),htmlTextData:I,image:o(ve),label:s,link:o(Ne),listItem:o(Ce),listItemValue:f,listOrdered:o(_e,d),listUnordered:o(_e),paragraph:o(bt),reference:E,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(te),strong:o(vt),thematicBreak:o(ut)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:Q,autolinkProtocol:me,blockQuote:l(),characterEscapeValue:b,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:K,characterReference:q,codeFenced:l(x),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:b,codeIndented:l(y),codeText:l(U),codeTextData:b,data:b,definition:l(),definitionDestinationString:_,definitionLabelString:k,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(O),hardBreakTrailing:l(O),htmlFlow:l(D),htmlFlowData:b,htmlText:l($),htmlTextData:b,image:l(ne),label:W,labelText:j,lineEnding:R,link:l(re),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:B,resourceDestinationString:w,resourceTitleString:F,resource:Y,setextHeading:l(N),setextHeadingLineSequence:M,setextHeadingText:C,strong:l(),thematicBreak:l()}};jp(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(L){let J={type:"root",children:[]};const we={stack:[J],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},Re=[];let $e=-1;for(;++$e<L.length;)if(L[$e][1].type==="listOrdered"||L[$e][1].type==="listUnordered")if(L[$e][0]==="enter")Re.push($e);else{const _t=Re.pop();$e=i(L,_t,$e)}for($e=-1;++$e<L.length;){const _t=t[L[$e][0]];Bp.call(_t,L[$e][1].type)&&_t[L[$e][1].type].call(Object.assign({sliceSerialize:L[$e][2].sliceSerialize},we),L[$e][1])}if(we.tokenStack.length>0){const _t=we.tokenStack[we.tokenStack.length-1];(_t[1]||nd).call(we,void 0,_t[0])}for(J.position={start:Tn(L.length>0?L[0][1].start:{line:1,column:1,offset:0}),end:Tn(L.length>0?L[L.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<t.transforms.length;)J=t.transforms[$e](J)||J;return J}function i(L,J,we){let Re=J-1,$e=-1,_t=!1,Ft,Bt,oe,tt;for(;++Re<=we;){const Fe=L[Re];switch(Fe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Fe[0]==="enter"?$e++:$e--,tt=void 0;break}case"lineEndingBlank":{Fe[0]==="enter"&&(Ft&&!tt&&!$e&&!oe&&(oe=Re),tt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:tt=void 0}if(!$e&&Fe[0]==="enter"&&Fe[1].type==="listItemPrefix"||$e===-1&&Fe[0]==="exit"&&(Fe[1].type==="listUnordered"||Fe[1].type==="listOrdered")){if(Ft){let Ge=Re;for(Bt=void 0;Ge--;){const At=L[Ge];if(At[1].type==="lineEnding"||At[1].type==="lineEndingBlank"){if(At[0]==="exit")continue;Bt&&(L[Bt][1].type="lineEndingBlank",_t=!0),At[1].type="lineEnding",Bt=Ge}else if(!(At[1].type==="linePrefix"||At[1].type==="blockQuotePrefix"||At[1].type==="blockQuotePrefixWhitespace"||At[1].type==="blockQuoteMarker"||At[1].type==="listItemIndent"))break}oe&&(!Bt||oe<Bt)&&(Ft._spread=!0),Ft.end=Object.assign({},Bt?L[Bt][1].start:Fe[1].end),L.splice(Bt||Re,0,["exit",Ft,Fe[2]]),Re++,we++}if(Fe[1].type==="listItemPrefix"){const Ge={type:"listItem",_spread:!1,start:Object.assign({},Fe[1].start),end:void 0};Ft=Ge,L.splice(Re,0,["enter",Ge,Fe[2]]),Re++,we++,oe=void 0,tt=!0}}}return L[J][1]._spread=_t,we}function o(L,J){return we;function we(Re){a.call(this,L(Re),Re),J&&J.call(this,Re)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(L,J,we){this.stack[this.stack.length-1].children.push(L),this.stack.push(L),this.tokenStack.push([J,we||void 0]),L.position={start:Tn(J.start),end:void 0}}function l(L){return J;function J(we){L&&L.call(this,we),c.call(this,we)}}function c(L,J){const we=this.stack.pop(),Re=this.tokenStack.pop();if(Re)Re[0].type!==L.type&&(J?J.call(this,L,Re[0]):(Re[1]||nd).call(this,L,Re[0]));else throw new Error("Cannot close `"+L.type+"` ("+Qr({start:L.start,end:L.end})+"): it’s not open");we.position.end=Tn(L.end)}function u(){return Nl(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(L){if(this.data.expectingFirstListItemValue){const J=this.stack[this.stack.length-2];J.start=Number.parseInt(this.sliceSerialize(L),10),this.data.expectingFirstListItemValue=void 0}}function p(){const L=this.resume(),J=this.stack[this.stack.length-1];J.lang=L}function g(){const L=this.resume(),J=this.stack[this.stack.length-1];J.meta=L}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const L=this.resume(),J=this.stack[this.stack.length-1];J.value=L.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const L=this.resume(),J=this.stack[this.stack.length-1];J.value=L.replace(/(\r?\n|\r)$/g,"")}function k(L){const J=this.resume(),we=this.stack[this.stack.length-1];we.label=J,we.identifier=rn(this.sliceSerialize(L)).toLowerCase()}function v(){const L=this.resume(),J=this.stack[this.stack.length-1];J.title=L}function _(){const L=this.resume(),J=this.stack[this.stack.length-1];J.url=L}function S(L){const J=this.stack[this.stack.length-1];if(!J.depth){const we=this.sliceSerialize(L).length;J.depth=we}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function M(L){const J=this.stack[this.stack.length-1];J.depth=this.sliceSerialize(L).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function I(L){const we=this.stack[this.stack.length-1].children;let Re=we[we.length-1];(!Re||Re.type!=="text")&&(Re=je(),Re.position={start:Tn(L.start),end:void 0},we.push(Re)),this.stack.push(Re)}function b(L){const J=this.stack.pop();J.value+=this.sliceSerialize(L),J.position.end=Tn(L.end)}function R(L){const J=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=J.children[J.children.length-1];we.position.end=Tn(L.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(J.type)&&(I.call(this,L),b.call(this,L))}function O(){this.data.atHardBreak=!0}function D(){const L=this.resume(),J=this.stack[this.stack.length-1];J.value=L}function $(){const L=this.resume(),J=this.stack[this.stack.length-1];J.value=L}function U(){const L=this.resume(),J=this.stack[this.stack.length-1];J.value=L}function re(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const J=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=J,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function ne(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const J=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=J,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function j(L){const J=this.sliceSerialize(L),we=this.stack[this.stack.length-2];we.label=aS(J),we.identifier=rn(J).toLowerCase()}function W(){const L=this.stack[this.stack.length-1],J=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const Re=L.children;we.children=Re}else we.alt=J}function w(){const L=this.resume(),J=this.stack[this.stack.length-1];J.url=L}function F(){const L=this.resume(),J=this.stack[this.stack.length-1];J.title=L}function Y(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function B(L){const J=this.resume(),we=this.stack[this.stack.length-1];we.label=J,we.identifier=rn(this.sliceSerialize(L)).toLowerCase(),this.data.referenceType="full"}function z(L){this.data.characterReferenceType=L.type}function K(L){const J=this.sliceSerialize(L),we=this.data.characterReferenceType;let Re;we?(Re=Np(J,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Re=Al(J);const $e=this.stack[this.stack.length-1];$e.value+=Re}function q(L){const J=this.stack.pop();J.position.end=Tn(L.end)}function me(L){b.call(this,L);const J=this.stack[this.stack.length-1];J.url=this.sliceSerialize(L)}function Q(L){b.call(this,L);const J=this.stack[this.stack.length-1];J.url="mailto:"+this.sliceSerialize(L)}function le(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function G(){return{type:"inlineCode",value:""}}function Se(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Z(){return{type:"emphasis",children:[]}}function te(){return{type:"heading",depth:0,children:[]}}function ye(){return{type:"break"}}function ae(){return{type:"html",value:""}}function ve(){return{type:"image",title:null,url:"",alt:null}}function Ne(){return{type:"link",title:null,url:"",children:[]}}function _e(L){return{type:"list",ordered:L.type==="listOrdered",start:null,spread:L._spread,children:[]}}function Ce(L){return{type:"listItem",spread:L._spread,checked:null,children:[]}}function bt(){return{type:"paragraph",children:[]}}function vt(){return{type:"strong",children:[]}}function je(){return{type:"text",value:""}}function ut(){return{type:"thematicBreak"}}}function Tn(e){return{line:e.line,column:e.column,offset:e.offset}}function jp(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?jp(e,r):dS(e,r)}}function dS(e,t){let n;for(n in t)if(Bp.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 nd(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Qr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Qr({start:t.start,end:t.end})+") is still open")}function fS(e){const t=this;t.parser=n;function n(r){return cS(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hS(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 pS(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
33
- `}]}function mS(e,t){const n=t.value?t.value+`
34
- `:"",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 gS(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bS(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yS(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Dr(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+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(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function xS(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 wS(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function $p(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),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function vS(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $p(e,t);const i={src:Dr(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function ES(e,t){const n={src:Dr(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 kS(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 SS(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $p(e,t);const i={href:Dr(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function CS(e,t){const n={href:Dr(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 _S(e,t,n){const r=e.all(t),i=n?TS(n):Vp(t),o={},s=[];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:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
32
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function nS(e){const r={constructs:_p([Qk,...(e||{}).extensions||[]]),content:i(bE),defined:[],document:i(xE),flow:i(Fk),lazy:{},string:i($k),text:i(Vk)};return r;function i(o){return s;function s(a){return Jk(r,o,a)}}}function rS(e){for(;!Mp(e););return e}const td=/[\0\t\n\r]/g;function iS(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let c,u,d,f,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(td.lastIndex=d,c=td.exec(o),f=c&&c.index!==void 0?c.index:o.length,p=o.charCodeAt(f),!c){t=o.slice(d);break}if(p===10&&d===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<f&&(l.push(o.slice(d,f)),e+=f-d),p){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=f+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const oS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sS(e){return e.replace(oS,aS)}function aS(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Tp(n.slice(o?2:1),o?16:10)}return Al(n)||e}const Fp={}.hasOwnProperty;function lS(e,t,n){return typeof t!="string"&&(n=t,t=void 0),cS(n)(rS(nS(n).document().write(iS()(e,t,!0))))}function cS(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Te),autolinkProtocol:I,autolinkEmail:I,atxHeading:o(ye),blockQuote:o(de),characterEscape:I,characterReference:I,codeFenced:o(De),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(De,s),codeText:o(U,s),codeTextData:I,data:I,codeFlowValue:I,definition:o(Ce),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(K),hardBreakEscape:o(me),hardBreakTrailing:o(me),htmlFlow:o(ge,s),htmlFlowData:I,htmlText:o(ge,s),htmlTextData:I,image:o(Ee),label:s,link:o(Te),listItem:o(we),listItemValue:f,listOrdered:o(Ne,d),listUnordered:o(Ne),paragraph:o(ot),reference:S,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ye),strong:o(vt),thematicBreak:o(bt)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:ae,autolinkProtocol:te,blockQuote:l(),characterEscapeValue:b,characterReferenceMarkerHexadecimal:q,characterReferenceMarkerNumeric:q,characterReferenceValue:B,characterReference:Q,codeFenced:l(x),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:b,codeIndented:l(y),codeText:l(H),codeTextData:b,data:b,definition:l(),definitionDestinationString:_,definitionLabelString:E,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(O),hardBreakTrailing:l(O),htmlFlow:l(L),htmlFlowData:b,htmlText:l(j),htmlTextData:b,image:l(ee),label:W,labelText:P,lineEnding:R,link:l(ie),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:$,resourceDestinationString:w,resourceTitleString:V,resource:Y,setextHeading:l(N),setextHeadingLineSequence:M,setextHeadingText:C,strong:l(),thematicBreak:l()}};Bp(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(F){let Z={type:"root",children:[]};const xe={stack:[Z],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},Ae=[];let Be=-1;for(;++Be<F.length;)if(F[Be][1].type==="listOrdered"||F[Be][1].type==="listUnordered")if(F[Be][0]==="enter")Ae.push(Be);else{const ne=Ae.pop();Be=i(F,ne,Be)}for(Be=-1;++Be<F.length;){const ne=t[F[Be][0]];Fp.call(ne,F[Be][1].type)&&ne[F[Be][1].type].call(Object.assign({sliceSerialize:F[Be][2].sliceSerialize},xe),F[Be][1])}if(xe.tokenStack.length>0){const ne=xe.tokenStack[xe.tokenStack.length-1];(ne[1]||nd).call(xe,void 0,ne[0])}for(Z.position={start:Tn(F.length>0?F[0][1].start:{line:1,column:1,offset:0}),end:Tn(F.length>0?F[F.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<t.transforms.length;)Z=t.transforms[Be](Z)||Z;return Z}function i(F,Z,xe){let Ae=Z-1,Be=-1,ne=!1,$e,Ve,Ke,nn;for(;++Ae<=xe;){const It=F[Ae];switch(It[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{It[0]==="enter"?Be++:Be--,nn=void 0;break}case"lineEndingBlank":{It[0]==="enter"&&($e&&!nn&&!Be&&!Ke&&(Ke=Ae),nn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:nn=void 0}if(!Be&&It[0]==="enter"&&It[1].type==="listItemPrefix"||Be===-1&&It[0]==="exit"&&(It[1].type==="listUnordered"||It[1].type==="listOrdered")){if($e){let kn=Ae;for(Ve=void 0;kn--;){const $t=F[kn];if($t[1].type==="lineEnding"||$t[1].type==="lineEndingBlank"){if($t[0]==="exit")continue;Ve&&(F[Ve][1].type="lineEndingBlank",ne=!0),$t[1].type="lineEnding",Ve=kn}else if(!($t[1].type==="linePrefix"||$t[1].type==="blockQuotePrefix"||$t[1].type==="blockQuotePrefixWhitespace"||$t[1].type==="blockQuoteMarker"||$t[1].type==="listItemIndent"))break}Ke&&(!Ve||Ke<Ve)&&($e._spread=!0),$e.end=Object.assign({},Ve?F[Ve][1].start:It[1].end),F.splice(Ve||Ae,0,["exit",$e,It[2]]),Ae++,xe++}if(It[1].type==="listItemPrefix"){const kn={type:"listItem",_spread:!1,start:Object.assign({},It[1].start),end:void 0};$e=kn,F.splice(Ae,0,["enter",kn,It[2]]),Ae++,xe++,Ke=void 0,nn=!0}}}return F[Z][1]._spread=ne,xe}function o(F,Z){return xe;function xe(Ae){a.call(this,F(Ae),Ae),Z&&Z.call(this,Ae)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(F,Z,xe){this.stack[this.stack.length-1].children.push(F),this.stack.push(F),this.tokenStack.push([Z,xe||void 0]),F.position={start:Tn(Z.start),end:void 0}}function l(F){return Z;function Z(xe){F&&F.call(this,xe),c.call(this,xe)}}function c(F,Z){const xe=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==F.type&&(Z?Z.call(this,F,Ae[0]):(Ae[1]||nd).call(this,F,Ae[0]));else throw new Error("Cannot close `"+F.type+"` ("+Qr({start:F.start,end:F.end})+"): it’s not open");xe.position.end=Tn(F.end)}function u(){return Nl(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(F){if(this.data.expectingFirstListItemValue){const Z=this.stack[this.stack.length-2];Z.start=Number.parseInt(this.sliceSerialize(F),10),this.data.expectingFirstListItemValue=void 0}}function p(){const F=this.resume(),Z=this.stack[this.stack.length-1];Z.lang=F}function g(){const F=this.resume(),Z=this.stack[this.stack.length-1];Z.meta=F}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const F=this.resume(),Z=this.stack[this.stack.length-1];Z.value=F.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const F=this.resume(),Z=this.stack[this.stack.length-1];Z.value=F.replace(/(\r?\n|\r)$/g,"")}function E(F){const Z=this.resume(),xe=this.stack[this.stack.length-1];xe.label=Z,xe.identifier=tn(this.sliceSerialize(F)).toLowerCase()}function v(){const F=this.resume(),Z=this.stack[this.stack.length-1];Z.title=F}function _(){const F=this.resume(),Z=this.stack[this.stack.length-1];Z.url=F}function k(F){const Z=this.stack[this.stack.length-1];if(!Z.depth){const xe=this.sliceSerialize(F).length;Z.depth=xe}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function M(F){const Z=this.stack[this.stack.length-1];Z.depth=this.sliceSerialize(F).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function I(F){const xe=this.stack[this.stack.length-1].children;let Ae=xe[xe.length-1];(!Ae||Ae.type!=="text")&&(Ae=He(),Ae.position={start:Tn(F.start),end:void 0},xe.push(Ae)),this.stack.push(Ae)}function b(F){const Z=this.stack.pop();Z.value+=this.sliceSerialize(F),Z.position.end=Tn(F.end)}function R(F){const Z=this.stack[this.stack.length-1];if(this.data.atHardBreak){const xe=Z.children[Z.children.length-1];xe.position.end=Tn(F.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Z.type)&&(I.call(this,F),b.call(this,F))}function O(){this.data.atHardBreak=!0}function L(){const F=this.resume(),Z=this.stack[this.stack.length-1];Z.value=F}function j(){const F=this.resume(),Z=this.stack[this.stack.length-1];Z.value=F}function H(){const F=this.resume(),Z=this.stack[this.stack.length-1];Z.value=F}function ie(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const Z=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=Z,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function ee(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const Z=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=Z,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function P(F){const Z=this.sliceSerialize(F),xe=this.stack[this.stack.length-2];xe.label=sS(Z),xe.identifier=tn(Z).toLowerCase()}function W(){const F=this.stack[this.stack.length-1],Z=this.resume(),xe=this.stack[this.stack.length-1];if(this.data.inReference=!0,xe.type==="link"){const Ae=F.children;xe.children=Ae}else xe.alt=Z}function w(){const F=this.resume(),Z=this.stack[this.stack.length-1];Z.url=F}function V(){const F=this.resume(),Z=this.stack[this.stack.length-1];Z.title=F}function Y(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function $(F){const Z=this.resume(),xe=this.stack[this.stack.length-1];xe.label=Z,xe.identifier=tn(this.sliceSerialize(F)).toLowerCase(),this.data.referenceType="full"}function q(F){this.data.characterReferenceType=F.type}function B(F){const Z=this.sliceSerialize(F),xe=this.data.characterReferenceType;let Ae;xe?(Ae=Tp(Z,xe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=Al(Z);const Be=this.stack[this.stack.length-1];Be.value+=Ae}function Q(F){const Z=this.stack.pop();Z.position.end=Tn(F.end)}function te(F){b.call(this,F);const Z=this.stack[this.stack.length-1];Z.url=this.sliceSerialize(F)}function ae(F){b.call(this,F);const Z=this.stack[this.stack.length-1];Z.url="mailto:"+this.sliceSerialize(F)}function de(){return{type:"blockquote",children:[]}}function De(){return{type:"code",lang:null,meta:null,value:""}}function U(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function K(){return{type:"emphasis",children:[]}}function ye(){return{type:"heading",depth:0,children:[]}}function me(){return{type:"break"}}function ge(){return{type:"html",value:""}}function Ee(){return{type:"image",title:null,url:"",alt:null}}function Te(){return{type:"link",title:null,url:"",children:[]}}function Ne(F){return{type:"list",ordered:F.type==="listOrdered",start:null,spread:F._spread,children:[]}}function we(F){return{type:"listItem",spread:F._spread,checked:null,children:[]}}function ot(){return{type:"paragraph",children:[]}}function vt(){return{type:"strong",children:[]}}function He(){return{type:"text",value:""}}function bt(){return{type:"thematicBreak"}}}function Tn(e){return{line:e.line,column:e.column,offset:e.offset}}function Bp(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Bp(e,r):uS(e,r)}}function uS(e,t){let n;for(n in t)if(Fp.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 nd(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Qr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Qr({start:t.start,end:t.end})+") is still open")}function dS(e){const t=this;t.parser=n;function n(r){return lS(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function fS(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 hS(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
33
+ `}]}function pS(e,t){const n=t.value?t.value+`
34
+ `:"",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 mS(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 bS(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Dr(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+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(s)}]};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 jp(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),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function wS(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return jp(e,t);const i={src:Dr(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function vS(e,t){const n={src:Dr(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 ES(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 kS(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return jp(e,t);const i={href:Dr(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function SS(e,t){const n={href:Dr(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 CS(e,t,n){const r=e.all(t),i=n?_S(n):$p(t),o={},s=[];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:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
35
35
  `}),u.type==="element"&&u.tagName==="p"&&!i?s.push(...u.children):s.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
36
- `});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)}function TS(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=Vp(n[r])}return t}function Vp(e){const t=e.spread;return t??e.children.length>1}function NS(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 s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function AS(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RS(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function MS(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function IS(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Sl(t.children[1]),l=wp(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function OS(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const d=t.children[l],f={},p=s?s[l]:void 0;p&&(f.align=p);let g={type:"element",tagName:o,properties:f,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 PS(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const rd=9,id=32;function DS(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(od(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(od(t.slice(i),i>0,!1)),o.join("")}function od(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===rd||o===id;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===rd||o===id;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function LS(e,t){const n={type:"text",value:DS(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function FS(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const BS={blockquote:hS,break:pS,code:mS,delete:gS,emphasis:bS,footnoteReference:yS,heading:xS,html:wS,imageReference:vS,image:ES,inlineCode:kS,linkReference:SS,link:CS,listItem:_S,list:NS,paragraph:AS,root:RS,strong:MS,table:IS,tableCell:PS,tableRow:OS,text:LS,thematicBreak:FS,toml:Li,yaml:Li,definition:Li,footnoteDefinition:Li};function Li(){}const zp=-1,Oo=0,ei=1,mo=2,Ml=3,Il=4,Ol=5,Pl=6,Up=7,Hp=8,sd=typeof self=="object"?self:globalThis,jS=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Oo:case zp:return n(s,i);case ei:{const a=n([],i);for(const l of s)a.push(r(l));return a}case mo:{const a=n({},i);for(const[l,c]of s)a[r(l)]=r(c);return a}case Ml:return n(new Date(s),i);case Il:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case Ol:{const a=n(new Map,i);for(const[l,c]of s)a.set(r(l),r(c));return a}case Pl:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case Up:{const{name:a,message:l}=s;return n(new sd[a](l),i)}case Hp:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new sd[o](s),i)};return r},ad=e=>jS(new Map,e)(0),or="",{toString:$S}={},{keys:VS}=Object,zr=e=>{const t=typeof e;if(t!=="object"||!e)return[Oo,t];const n=$S.call(e).slice(8,-1);switch(n){case"Array":return[ei,or];case"Object":return[mo,or];case"Date":return[Ml,or];case"RegExp":return[Il,or];case"Map":return[Ol,or];case"Set":return[Pl,or];case"DataView":return[ei,n]}return n.includes("Array")?[ei,n]:n.includes("Error")?[Up,n]:[mo,n]},Fi=([e,t])=>e===Oo&&(t==="function"||t==="symbol"),zS=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=zr(s);switch(a){case Oo:{let u=s;switch(l){case"bigint":a=Hp,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([zp],s)}return i([a,u],s)}case ei:{if(l){let f=s;return l==="DataView"?f=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(s)),i([l,[...f]],s)}const u=[],d=i([a,u],s);for(const f of s)u.push(o(f));return d}case mo:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const u=[],d=i([a,u],s);for(const f of VS(s))(e||!Fi(zr(s[f])))&&u.push([o(f),o(s[f])]);return d}case Ml:return i([a,s.toISOString()],s);case Il:{const{source:u,flags:d}=s;return i([a,{source:u,flags:d}],s)}case Ol:{const u=[],d=i([a,u],s);for(const[f,p]of s)(e||!(Fi(zr(f))||Fi(zr(p))))&&u.push([o(f),o(p)]);return d}case Pl:{const u=[],d=i([a,u],s);for(const f of s)(e||!Fi(zr(f)))&&u.push(o(f));return d}}const{message:c}=s;return i([a,{name:l,message:c}],s)};return o},ld=(e,{json:t,lossy:n}={})=>{const r=[];return zS(!(t||n),!!t,new Map,r)(e),r},go=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ad(ld(e,t)):structuredClone(e):(e,t)=>ad(ld(e,t));function US(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 HS(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function WS(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||US,r=e.options.footnoteBackLabel||HS,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=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(),f=Dr(d.toLowerCase());let p=0;const g=[],m=e.footnoteCounts.get(d);for(;m!==void 0&&++p<=m;){g.length>0&&g.push({type:"text",value:" "});let k=typeof n=="string"?n:n(l,p);typeof k=="string"&&(k={type:"text",value:k}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const x=u[u.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const k=x.children[x.children.length-1];k&&k.type==="text"?k.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...g)}else u.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(u,!0)};e.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...go(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
36
+ `});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)}function _S(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=$p(n[r])}return t}function $p(e){const t=e.spread;return t??e.children.length>1}function TS(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 s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function NS(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AS(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function RS(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function MS(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Sl(t.children[1]),l=xp(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function IS(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const d=t.children[l],f={},p=s?s[l]:void 0;p&&(f.align=p);let g={type:"element",tagName:o,properties:f,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 OS(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const rd=9,id=32;function PS(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(od(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(od(t.slice(i),i>0,!1)),o.join("")}function od(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===rd||o===id;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===rd||o===id;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function DS(e,t){const n={type:"text",value:PS(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function LS(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const FS={blockquote:fS,break:hS,code:pS,delete:mS,emphasis:gS,footnoteReference:bS,heading:yS,html:xS,imageReference:wS,image:vS,inlineCode:ES,linkReference:kS,link:SS,listItem:CS,list:TS,paragraph:NS,root:AS,strong:RS,table:MS,tableCell:OS,tableRow:IS,text:DS,thematicBreak:LS,toml:Li,yaml:Li,definition:Li,footnoteDefinition:Li};function Li(){}const Vp=-1,Oo=0,ei=1,mo=2,Ml=3,Il=4,Ol=5,Pl=6,zp=7,Up=8,sd=typeof self=="object"?self:globalThis,BS=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Oo:case Vp:return n(s,i);case ei:{const a=n([],i);for(const l of s)a.push(r(l));return a}case mo:{const a=n({},i);for(const[l,c]of s)a[r(l)]=r(c);return a}case Ml:return n(new Date(s),i);case Il:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case Ol:{const a=n(new Map,i);for(const[l,c]of s)a.set(r(l),r(c));return a}case Pl:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case zp:{const{name:a,message:l}=s;return n(new sd[a](l),i)}case Up:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new sd[o](s),i)};return r},ad=e=>BS(new Map,e)(0),or="",{toString:jS}={},{keys:$S}=Object,zr=e=>{const t=typeof e;if(t!=="object"||!e)return[Oo,t];const n=jS.call(e).slice(8,-1);switch(n){case"Array":return[ei,or];case"Object":return[mo,or];case"Date":return[Ml,or];case"RegExp":return[Il,or];case"Map":return[Ol,or];case"Set":return[Pl,or];case"DataView":return[ei,n]}return n.includes("Array")?[ei,n]:n.includes("Error")?[zp,n]:[mo,n]},Fi=([e,t])=>e===Oo&&(t==="function"||t==="symbol"),VS=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=zr(s);switch(a){case Oo:{let u=s;switch(l){case"bigint":a=Up,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([Vp],s)}return i([a,u],s)}case ei:{if(l){let f=s;return l==="DataView"?f=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(s)),i([l,[...f]],s)}const u=[],d=i([a,u],s);for(const f of s)u.push(o(f));return d}case mo:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const u=[],d=i([a,u],s);for(const f of $S(s))(e||!Fi(zr(s[f])))&&u.push([o(f),o(s[f])]);return d}case Ml:return i([a,s.toISOString()],s);case Il:{const{source:u,flags:d}=s;return i([a,{source:u,flags:d}],s)}case Ol:{const u=[],d=i([a,u],s);for(const[f,p]of s)(e||!(Fi(zr(f))||Fi(zr(p))))&&u.push([o(f),o(p)]);return d}case Pl:{const u=[],d=i([a,u],s);for(const f of s)(e||!Fi(zr(f)))&&u.push(o(f));return d}}const{message:c}=s;return i([a,{name:l,message:c}],s)};return o},ld=(e,{json:t,lossy:n}={})=>{const r=[];return VS(!(t||n),!!t,new Map,r)(e),r},go=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ad(ld(e,t)):structuredClone(e):(e,t)=>ad(ld(e,t));function zS(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 US(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function HS(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||zS,r=e.options.footnoteBackLabel||US,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=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(),f=Dr(d.toLowerCase());let p=0;const g=[],m=e.footnoteCounts.get(d);for(;m!==void 0&&++p<=m;){g.length>0&&g.push({type:"text",value:" "});let E=typeof n=="string"?n:n(l,p);typeof E=="string"&&(E={type:"text",value:E}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const x=u[u.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const E=x.children[x.children.length-1];E&&E.type==="text"?E.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...g)}else u.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(u,!0)};e.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...go(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
37
37
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
38
- `}]}}const xi=function(e){if(e==null)return YS;if(typeof e=="function")return Po(e);if(typeof e=="object")return Array.isArray(e)?GS(e):KS(e);if(typeof e=="string")return qS(e);throw new Error("Expected function, string, or object as test")};function GS(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=xi(e[n]);return Po(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function KS(e){const t=e;return Po(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function qS(e){return Po(t);function t(n){return n&&n.type===e}}function Po(e){return t;function t(n,r,i){return!!(ZS(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function YS(){return!0}function ZS(e){return e!==null&&typeof e=="object"&&"type"in e}const Wp=[],XS=!0,Ta=!1,QS="skip";function Gp(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=xi(i),s=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 p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=Wp,g,m,x;if((!t||o(l,c,u[u.length-1]||void 0))&&(p=JS(n(l,u)),p[0]===Ta))return p;if("children"in l&&l.children){const y=l;if(y.children&&p[0]!==QS)for(m=(r?y.children.length:-1)+s,x=u.concat(y);m>-1&&m<y.children.length;){const k=y.children[m];if(g=a(k,m,x)(),g[0]===Ta)return g;m=typeof g[1]=="number"?g[1]:m+s}}return p}}}function JS(e){return Array.isArray(e)?e:typeof e=="number"?[XS,e]:e==null?Wp:[e]}function Do(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),Gp(e,o,a,i);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}const Na={}.hasOwnProperty,eC={};function tC(e,t){const n=t||eC,r=new Map,i=new Map,o=new Map,s={...BS,...n.handlers},a={all:c,applyData:rC,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:nC,wrap:oC};return Do(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,f=String(u.identifier).toUpperCase();d.has(f)||d.set(f,u)}}),a;function l(u,d){const f=u.type,p=a.handlers[f];if(Na.call(a.handlers,f)&&p)return p(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(f)){if("children"in u){const{children:m,...x}=u,y=go(x);return y.children=a.all(u),y}return go(u)}return(a.options.unknownHandler||iC)(a,u,d)}function c(u){const d=[];if("children"in u){const f=u.children;let p=-1;for(;++p<f.length;){const g=a.one(f[p],u);if(g){if(p&&f[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=cd(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=cd(m.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function nC(e,t){e.position&&(t.position=Hv(e))}function rC(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,go(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function iC(e,t){const n=t.data||{},r="value"in t&&!(Na.call(n,"hProperties")||Na.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 oC(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
38
+ `}]}}const xi=function(e){if(e==null)return qS;if(typeof e=="function")return Po(e);if(typeof e=="object")return Array.isArray(e)?WS(e):GS(e);if(typeof e=="string")return KS(e);throw new Error("Expected function, string, or object as test")};function WS(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=xi(e[n]);return Po(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function GS(e){const t=e;return Po(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function KS(e){return Po(t);function t(n){return n&&n.type===e}}function Po(e){return t;function t(n,r,i){return!!(YS(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function qS(){return!0}function YS(e){return e!==null&&typeof e=="object"&&"type"in e}const Hp=[],ZS=!0,Ta=!1,XS="skip";function Wp(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=xi(i),s=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 p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=Hp,g,m,x;if((!t||o(l,c,u[u.length-1]||void 0))&&(p=QS(n(l,u)),p[0]===Ta))return p;if("children"in l&&l.children){const y=l;if(y.children&&p[0]!==XS)for(m=(r?y.children.length:-1)+s,x=u.concat(y);m>-1&&m<y.children.length;){const E=y.children[m];if(g=a(E,m,x)(),g[0]===Ta)return g;m=typeof g[1]=="number"?g[1]:m+s}}return p}}}function QS(e){return Array.isArray(e)?e:typeof e=="number"?[ZS,e]:e==null?Hp:[e]}function Do(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),Wp(e,o,a,i);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}const Na={}.hasOwnProperty,JS={};function eC(e,t){const n=t||JS,r=new Map,i=new Map,o=new Map,s={...FS,...n.handlers},a={all:c,applyData:nC,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:tC,wrap:iC};return Do(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,f=String(u.identifier).toUpperCase();d.has(f)||d.set(f,u)}}),a;function l(u,d){const f=u.type,p=a.handlers[f];if(Na.call(a.handlers,f)&&p)return p(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(f)){if("children"in u){const{children:m,...x}=u,y=go(x);return y.children=a.all(u),y}return go(u)}return(a.options.unknownHandler||rC)(a,u,d)}function c(u){const d=[];if("children"in u){const f=u.children;let p=-1;for(;++p<f.length;){const g=a.one(f[p],u);if(g){if(p&&f[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=cd(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=cd(m.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function tC(e,t){e.position&&(t.position=Uv(e))}function nC(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,go(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function rC(e,t){const n=t.data||{},r="value"in t&&!(Na.call(n,"hProperties")||Na.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 iC(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
39
39
  `});++r<e.length;)r&&n.push({type:"text",value:`
40
40
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
41
- `}),n}function cd(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ud(e,t){const n=tC(e,t),r=n.one(e,void 0),i=WS(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
42
- `},i),o}function sC(e,t){return e&&"run"in e?async function(n,r){const i=ud(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ud(n,{file:r,...e||t})}}function dd(e){if(e)throw e}var Es,fd;function aC(){if(fd)return Es;fd=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]"},o=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 f;for(f in c);return typeof f>"u"||e.call(c,f)},s=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 Es=function l(){var c,u,d,f,p,g,m=arguments[0],x=1,y=arguments.length,k=!1;for(typeof m=="boolean"&&(k=m,m=arguments[1]||{},x=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});x<y;++x)if(c=arguments[x],c!=null)for(u in c)d=a(m,u),f=a(c,u),m!==f&&(k&&f&&(o(f)||(p=i(f)))?(p?(p=!1,g=d&&i(d)?d:[]):g=d&&o(d)?d:{},s(m,{name:u,newValue:l(k,g,f)})):typeof f<"u"&&s(m,{name:u,newValue:f}));return m},Es}var lC=aC();const ks=Ro(lC);function Aa(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 cC(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...c){const u=e[++o];let d=-1;if(l){s(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?uC(u,a)(...c):s(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 uC(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const cn={basename:dC,dirname:fC,extname:hC,join:pC,sep:"/"};function dC(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');wi(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function fC(e){if(wi(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 hC(e){wi(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function pC(...e){let t=-1,n;for(;++t<e.length;)wi(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":mC(n)}function mC(e){wi(e);const t=e.codePointAt(0)===47;let n=gC(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function gC(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===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=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function wi(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const bC={cwd:yC};function yC(){return"/"}function Ra(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function xC(e){if(typeof e=="string")e=new URL(e);else if(!Ra(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 wC(e)}function wC(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 Ss=["history","path","basename","stem","extname","dirname"];class Kp{constructor(t){let n;t?Ra(t)?n={path:t}:typeof t=="string"||vC(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":bC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ss.length;){const o=Ss[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Ss.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?cn.basename(this.path):void 0}set basename(t){_s(t,"basename"),Cs(t,"basename"),this.path=cn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?cn.dirname(this.path):void 0}set dirname(t){hd(this.basename,"dirname"),this.path=cn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?cn.extname(this.path):void 0}set extname(t){if(Cs(t,"extname"),hd(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=cn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ra(t)&&(t=xC(t)),_s(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?cn.basename(this.path,this.extname):void 0}set stem(t){_s(t,"stem"),Cs(t,"stem"),this.path=cn.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 Ot(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 Cs(e,t){if(e&&e.includes(cn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+cn.sep+"`")}function _s(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function hd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function vC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const EC=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},kC={}.hasOwnProperty;class Dl extends EC{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=cC()}copy(){const t=new Dl;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ks(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(As("data",this.frozen),this.namespace[t]=n,this):kC.call(this.namespace,t)&&this.namespace[t]||void 0:t?(As("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=Bi(t),r=this.parser||this.Parser;return Ts("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ts("process",this.parser||this.Parser),Ns("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Bi(t),l=r.parse(a);r.run(l,a,function(u,d,f){if(u||!d||!f)return c(u);const p=d,g=r.stringify(p,f);_C(g)?f.value=g:f.result=g,c(u,f)});function c(u,d){u||!d?s(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Ts("processSync",this.parser||this.Parser),Ns("processSync",this.compiler||this.Compiler),this.process(t,i),md("processSync","process",n),r;function i(o,s){n=!0,dd(o),r=s}}run(t,n,r){pd(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Bi(n);i.run(t,l,c);function c(u,d,f){const p=d||t;u?a(u):s?s(p):r(void 0,p,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),md("runSync","run",r),i;function o(s,a){dd(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Bi(n),i=this.compiler||this.Compiler;return Ns("stringify",i),pd(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(As("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(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=ks(!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];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===c){f=d;break}if(f===-1)r.push([c,...u]);else if(u.length>0){let[p,...g]=u;const m=r[f][1];Aa(m)&&Aa(p)&&(p=ks(!0,m,p)),r[f]=[c,p,...g]}}}}const SC=new Dl().freeze();function Ts(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ns(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function As(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 pd(e){if(!Aa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function md(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Bi(e){return CC(e)?e:new Kp(e)}function CC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function _C(e){return typeof e=="string"||TC(e)}function TC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const NC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",gd=[],bd={allowDangerousHtml:!0},AC=/^(https?|ircs?|mailto|xmpp)$/i,RC=[{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 MC(e){const t=IC(e),n=OC(e);return PC(t.runSync(t.parse(n),n),e)}function IC(e){const t=e.rehypePlugins||gd,n=e.remarkPlugins||gd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...bd}:bd;return SC().use(fS).use(n).use(sC,r).use(t)}function OC(e){const t=e.children||"",n=new Kp;return typeof t=="string"&&(n.value=t),n}function PC(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||DC;for(const u of RC)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+NC+u.id,void 0);return Do(e,c),Yv(e,{Fragment:h.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function c(u,d,f){if(u.type==="raw"&&f&&typeof d=="number")return s?f.children.splice(d,1):f.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let p;for(p in xs)if(Object.hasOwn(xs,p)&&Object.hasOwn(u.properties,p)){const g=u.properties[p],m=xs[p];(m===null||m.includes(u.tagName))&&(u.properties[p]=l(String(g||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):o?o.includes(u.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(u,d,f)),p&&f&&typeof d=="number")return a&&u.children?f.children.splice(d,1,...u.children):f.children.splice(d,1),d}}}function DC(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||AC.test(e.slice(0,t))?e:""}function yd(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 LC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function FC(e,t,n){const i=xi((n||{}).ignore||[]),o=BC(t);let s=-1;for(;++s<o.length;)Gp(e,"text",a);function a(c,u){let d=-1,f;for(;++d<u.length;){const p=u[d],g=f?f.children:void 0;if(i(p,g?g.indexOf(p):void 0,f))return;f=p}if(f)return l(c,u)}function l(c,u){const d=u[u.length-1],f=o[s][0],p=o[s][1];let g=0;const x=d.children.indexOf(c);let y=!1,k=[];f.lastIndex=0;let v=f.exec(c.value);for(;v;){const _=v.index,S={index:v.index,input:v.input,stack:[...u,c]};let C=p(...v,S);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?f.lastIndex=_+1:(g!==_&&k.push({type:"text",value:c.value.slice(g,_)}),Array.isArray(C)?k.push(...C):C&&k.push(C),g=_+v[0].length,y=!0),!f.global)break;v=f.exec(c.value)}return y?(g<c.value.length&&k.push({type:"text",value:c.value.slice(g)}),d.children.splice(x,1,...k)):k=[c],x+k.length}}function BC(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([jC(i[0]),$C(i[1])])}return t}function jC(e){return typeof e=="string"?new RegExp(LC(e),"g"):e}function $C(e){return typeof e=="function"?e:function(){return e}}const Rs="phrasing",Ms=["autolink","link","image","label"];function VC(){return{transforms:[qC],enter:{literalAutolink:UC,literalAutolinkEmail:Is,literalAutolinkHttp:Is,literalAutolinkWww:Is},exit:{literalAutolink:KC,literalAutolinkEmail:GC,literalAutolinkHttp:HC,literalAutolinkWww:WC}}}function zC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Rs,notInConstruct:Ms},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Rs,notInConstruct:Ms},{character:":",before:"[ps]",after:"\\/",inConstruct:Rs,notInConstruct:Ms}]}}function UC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Is(e){this.config.enter.autolinkProtocol.call(this,e)}function HC(e){this.config.exit.autolinkProtocol.call(this,e)}function WC(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 GC(e){this.config.exit.autolinkEmail.call(this,e)}function KC(e){this.exit(e)}function qC(e){FC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,YC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ZC]],{ignore:["link","linkReference"]})}function YC(e,t,n,r,i){let o="";if(!qp(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!XC(n)))return!1;const s=QC(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function ZC(e,t,n,r){return!qp(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function XC(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 QC(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=yd(e,"(");let o=yd(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function qp(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Zn(n)||Mo(n))&&(!t||n!==47)}Yp.peek=a_;function JC(){this.buffer()}function e_(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function t_(){this.buffer()}function n_(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function r_(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=rn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function i_(e){this.exit(e)}function o_(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=rn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function s_(e){this.exit(e)}function a_(){return"["}function Yp(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function l_(){return{enter:{gfmFootnoteCallString:JC,gfmFootnoteCall:e_,gfmFootnoteDefinitionLabelString:t_,gfmFootnoteDefinition:n_},exit:{gfmFootnoteCallString:r_,gfmFootnoteCall:i_,gfmFootnoteDefinitionLabelString:o_,gfmFootnoteDefinition:s_}}}function c_(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Yp},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const a=o.createTracker(s);let l=a.move("[^");const c=o.enter("footnoteDefinition"),u=o.enter("label");return l+=a.move(o.safe(o.associationId(r),{before:l,after:"]"})),u(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
43
- `:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Zp:u_))),c(),l}}function u_(e,t,n){return t===0?e:Zp(e,t,n)}function Zp(e,t,n){return(n?"":" ")+e}const d_=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Xp.peek=g_;function f_(){return{canContainEols:["delete"],enter:{strikethrough:p_},exit:{strikethrough:m_}}}function h_(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:d_}],handlers:{delete:Xp}}}function p_(e){this.enter({type:"delete",children:[]},e)}function m_(e){this.exit(e)}function Xp(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function g_(){return"~"}function b_(e){return e.length}function y_(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||b_,o=[],s=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const m=[],x=[];let y=-1;for(e[u].length>c&&(c=e[u].length);++y<e[u].length;){const k=x_(e[u][y]);if(n.alignDelimiters!==!1){const v=i(k);x[y]=v,(l[y]===void 0||v>l[y])&&(l[y]=v)}m.push(k)}s[u]=m,a[u]=x}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)o[d]=xd(r[d]);else{const m=xd(r);for(;++d<c;)o[d]=m}d=-1;const f=[],p=[];for(;++d<c;){const m=o[d];let x="",y="";m===99?(x=":",y=":"):m===108?x=":":m===114&&(y=":");let k=n.alignDelimiters===!1?1:Math.max(1,l[d]-x.length-y.length);const v=x+"-".repeat(k)+y;n.alignDelimiters!==!1&&(k=x.length+k+y.length,k>l[d]&&(l[d]=k),p[d]=k),f[d]=v}s.splice(1,0,f),a.splice(1,0,p),u=-1;const g=[];for(;++u<s.length;){const m=s[u],x=a[u];d=-1;const y=[];for(;++d<c;){const k=m[d]||"";let v="",_="";if(n.alignDelimiters!==!1){const S=l[d]-(x[d]||0),C=o[d];C===114?v=" ".repeat(S):C===99?S%2?(v=" ".repeat(S/2+.5),_=" ".repeat(S/2-.5)):(v=" ".repeat(S/2),_=v):_=" ".repeat(S)}n.delimiterStart!==!1&&!d&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&k==="")&&(n.delimiterStart!==!1||d)&&y.push(" "),n.alignDelimiters!==!1&&y.push(v),y.push(k),n.alignDelimiters!==!1&&y.push(_),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&y.push("|")}g.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
44
- `)}function x_(e){return e==null?"":String(e)}function xd(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 w_(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),v_);return i(),s}function v_(e,t,n){return">"+(n?"":" ")+e}function E_(e,t){return wd(e,t.inConstruct,!0)&&!wd(e,t.notInConstruct,!1)}function wd(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 vd(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
45
- `&&E_(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
46
- `}function k_(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function S_(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 C_(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 __(e,t,n,r){const i=C_(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(S_(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(o,T_);return d(),f}const a=n.createTracker(r),l=i.repeat(Math.max(k_(o,i)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const d=n.enter(`codeFencedLang${s}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${s}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
41
+ `}),n}function cd(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ud(e,t){const n=eC(e,t),r=n.one(e,void 0),i=HS(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
42
+ `},i),o}function oC(e,t){return e&&"run"in e?async function(n,r){const i=ud(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ud(n,{file:r,...e||t})}}function dd(e){if(e)throw e}var Es,fd;function sC(){if(fd)return Es;fd=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]"},o=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 f;for(f in c);return typeof f>"u"||e.call(c,f)},s=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 Es=function l(){var c,u,d,f,p,g,m=arguments[0],x=1,y=arguments.length,E=!1;for(typeof m=="boolean"&&(E=m,m=arguments[1]||{},x=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});x<y;++x)if(c=arguments[x],c!=null)for(u in c)d=a(m,u),f=a(c,u),m!==f&&(E&&f&&(o(f)||(p=i(f)))?(p?(p=!1,g=d&&i(d)?d:[]):g=d&&o(d)?d:{},s(m,{name:u,newValue:l(E,g,f)})):typeof f<"u"&&s(m,{name:u,newValue:f}));return m},Es}var aC=sC();const ks=Ro(aC);function Aa(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 lC(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...c){const u=e[++o];let d=-1;if(l){s(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?cC(u,a)(...c):s(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 cC(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const ln={basename:uC,dirname:dC,extname:fC,join:hC,sep:"/"};function uC(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');wi(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function dC(e){if(wi(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 fC(e){wi(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function hC(...e){let t=-1,n;for(;++t<e.length;)wi(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":pC(n)}function pC(e){wi(e);const t=e.codePointAt(0)===47;let n=mC(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function mC(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===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=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function wi(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const gC={cwd:bC};function bC(){return"/"}function Ra(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(!Ra(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 Ss=["history","path","basename","stem","extname","dirname"];class Gp{constructor(t){let n;t?Ra(t)?n={path:t}:typeof t=="string"||wC(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<Ss.length;){const o=Ss[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Ss.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ln.basename(this.path):void 0}set basename(t){_s(t,"basename"),Cs(t,"basename"),this.path=ln.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ln.dirname(this.path):void 0}set dirname(t){hd(this.basename,"dirname"),this.path=ln.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ln.extname(this.path):void 0}set extname(t){if(Cs(t,"extname"),hd(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=ln.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ra(t)&&(t=yC(t)),_s(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ln.basename(this.path,this.extname):void 0}set stem(t){_s(t,"stem"),Cs(t,"stem"),this.path=ln.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 Mt(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 Cs(e,t){if(e&&e.includes(ln.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ln.sep+"`")}function _s(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function hd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function wC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vC=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},EC={}.hasOwnProperty;class Dl extends vC{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=lC()}copy(){const t=new Dl;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ks(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(As("data",this.frozen),this.namespace[t]=n,this):EC.call(this.namespace,t)&&this.namespace[t]||void 0:t?(As("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=Bi(t),r=this.parser||this.Parser;return Ts("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ts("process",this.parser||this.Parser),Ns("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Bi(t),l=r.parse(a);r.run(l,a,function(u,d,f){if(u||!d||!f)return c(u);const p=d,g=r.stringify(p,f);CC(g)?f.value=g:f.result=g,c(u,f)});function c(u,d){u||!d?s(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Ts("processSync",this.parser||this.Parser),Ns("processSync",this.compiler||this.Compiler),this.process(t,i),md("processSync","process",n),r;function i(o,s){n=!0,dd(o),r=s}}run(t,n,r){pd(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Bi(n);i.run(t,l,c);function c(u,d,f){const p=d||t;u?a(u):s?s(p):r(void 0,p,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),md("runSync","run",r),i;function o(s,a){dd(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Bi(n),i=this.compiler||this.Compiler;return Ns("stringify",i),pd(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(As("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(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=ks(!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];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===c){f=d;break}if(f===-1)r.push([c,...u]);else if(u.length>0){let[p,...g]=u;const m=r[f][1];Aa(m)&&Aa(p)&&(p=ks(!0,m,p)),r[f]=[c,p,...g]}}}}const kC=new Dl().freeze();function Ts(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ns(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function As(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 pd(e){if(!Aa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function md(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Bi(e){return SC(e)?e:new Gp(e)}function SC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function CC(e){return typeof e=="string"||_C(e)}function _C(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const TC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",gd=[],bd={allowDangerousHtml:!0},NC=/^(https?|ircs?|mailto|xmpp)$/i,AC=[{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 RC(e){const t=MC(e),n=IC(e);return OC(t.runSync(t.parse(n),n),e)}function MC(e){const t=e.rehypePlugins||gd,n=e.remarkPlugins||gd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...bd}:bd;return kC().use(dS).use(n).use(oC,r).use(t)}function IC(e){const t=e.children||"",n=new Gp;return typeof t=="string"&&(n.value=t),n}function OC(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||PC;for(const u of AC)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+TC+u.id,void 0);return Do(e,c),qv(e,{Fragment:h.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function c(u,d,f){if(u.type==="raw"&&f&&typeof d=="number")return s?f.children.splice(d,1):f.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let p;for(p in xs)if(Object.hasOwn(xs,p)&&Object.hasOwn(u.properties,p)){const g=u.properties[p],m=xs[p];(m===null||m.includes(u.tagName))&&(u.properties[p]=l(String(g||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):o?o.includes(u.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(u,d,f)),p&&f&&typeof d=="number")return a&&u.children?f.children.splice(d,1,...u.children):f.children.splice(d,1),d}}}function PC(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||NC.test(e.slice(0,t))?e:""}function yd(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 DC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function LC(e,t,n){const i=xi((n||{}).ignore||[]),o=FC(t);let s=-1;for(;++s<o.length;)Wp(e,"text",a);function a(c,u){let d=-1,f;for(;++d<u.length;){const p=u[d],g=f?f.children:void 0;if(i(p,g?g.indexOf(p):void 0,f))return;f=p}if(f)return l(c,u)}function l(c,u){const d=u[u.length-1],f=o[s][0],p=o[s][1];let g=0;const x=d.children.indexOf(c);let y=!1,E=[];f.lastIndex=0;let v=f.exec(c.value);for(;v;){const _=v.index,k={index:v.index,input:v.input,stack:[...u,c]};let C=p(...v,k);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?f.lastIndex=_+1:(g!==_&&E.push({type:"text",value:c.value.slice(g,_)}),Array.isArray(C)?E.push(...C):C&&E.push(C),g=_+v[0].length,y=!0),!f.global)break;v=f.exec(c.value)}return y?(g<c.value.length&&E.push({type:"text",value:c.value.slice(g)}),d.children.splice(x,1,...E)):E=[c],x+E.length}}function FC(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([BC(i[0]),jC(i[1])])}return t}function BC(e){return typeof e=="string"?new RegExp(DC(e),"g"):e}function jC(e){return typeof e=="function"?e:function(){return e}}const Rs="phrasing",Ms=["autolink","link","image","label"];function $C(){return{transforms:[KC],enter:{literalAutolink:zC,literalAutolinkEmail:Is,literalAutolinkHttp:Is,literalAutolinkWww:Is},exit:{literalAutolink:GC,literalAutolinkEmail:WC,literalAutolinkHttp:UC,literalAutolinkWww:HC}}}function VC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Rs,notInConstruct:Ms},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Rs,notInConstruct:Ms},{character:":",before:"[ps]",after:"\\/",inConstruct:Rs,notInConstruct:Ms}]}}function zC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Is(e){this.config.enter.autolinkProtocol.call(this,e)}function UC(e){this.config.exit.autolinkProtocol.call(this,e)}function HC(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 WC(e){this.config.exit.autolinkEmail.call(this,e)}function GC(e){this.exit(e)}function KC(e){LC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,qC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),YC]],{ignore:["link","linkReference"]})}function qC(e,t,n,r,i){let o="";if(!Kp(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!ZC(n)))return!1;const s=XC(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function YC(e,t,n,r){return!Kp(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function ZC(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 XC(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=yd(e,"(");let o=yd(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Kp(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Zn(n)||Mo(n))&&(!t||n!==47)}qp.peek=s_;function QC(){this.buffer()}function JC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function e_(){this.buffer()}function t_(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function n_(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=tn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function r_(e){this.exit(e)}function i_(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=tn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function o_(e){this.exit(e)}function s_(){return"["}function qp(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function a_(){return{enter:{gfmFootnoteCallString:QC,gfmFootnoteCall:JC,gfmFootnoteDefinitionLabelString:e_,gfmFootnoteDefinition:t_},exit:{gfmFootnoteCallString:n_,gfmFootnoteCall:r_,gfmFootnoteDefinitionLabelString:i_,gfmFootnoteDefinition:o_}}}function l_(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:qp},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const a=o.createTracker(s);let l=a.move("[^");const c=o.enter("footnoteDefinition"),u=o.enter("label");return l+=a.move(o.safe(o.associationId(r),{before:l,after:"]"})),u(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
43
+ `:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Yp:c_))),c(),l}}function c_(e,t,n){return t===0?e:Yp(e,t,n)}function Yp(e,t,n){return(n?"":" ")+e}const u_=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Zp.peek=m_;function d_(){return{canContainEols:["delete"],enter:{strikethrough:h_},exit:{strikethrough:p_}}}function f_(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:u_}],handlers:{delete:Zp}}}function h_(e){this.enter({type:"delete",children:[]},e)}function p_(e){this.exit(e)}function Zp(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function m_(){return"~"}function g_(e){return e.length}function b_(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||g_,o=[],s=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const m=[],x=[];let y=-1;for(e[u].length>c&&(c=e[u].length);++y<e[u].length;){const E=y_(e[u][y]);if(n.alignDelimiters!==!1){const v=i(E);x[y]=v,(l[y]===void 0||v>l[y])&&(l[y]=v)}m.push(E)}s[u]=m,a[u]=x}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)o[d]=xd(r[d]);else{const m=xd(r);for(;++d<c;)o[d]=m}d=-1;const f=[],p=[];for(;++d<c;){const m=o[d];let x="",y="";m===99?(x=":",y=":"):m===108?x=":":m===114&&(y=":");let E=n.alignDelimiters===!1?1:Math.max(1,l[d]-x.length-y.length);const v=x+"-".repeat(E)+y;n.alignDelimiters!==!1&&(E=x.length+E+y.length,E>l[d]&&(l[d]=E),p[d]=E),f[d]=v}s.splice(1,0,f),a.splice(1,0,p),u=-1;const g=[];for(;++u<s.length;){const m=s[u],x=a[u];d=-1;const y=[];for(;++d<c;){const E=m[d]||"";let v="",_="";if(n.alignDelimiters!==!1){const k=l[d]-(x[d]||0),C=o[d];C===114?v=" ".repeat(k):C===99?k%2?(v=" ".repeat(k/2+.5),_=" ".repeat(k/2-.5)):(v=" ".repeat(k/2),_=v):_=" ".repeat(k)}n.delimiterStart!==!1&&!d&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||d)&&y.push(" "),n.alignDelimiters!==!1&&y.push(v),y.push(E),n.alignDelimiters!==!1&&y.push(_),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&y.push("|")}g.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
44
+ `)}function y_(e){return e==null?"":String(e)}function xd(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 x_(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),w_);return i(),s}function w_(e,t,n){return">"+(n?"":" ")+e}function v_(e,t){return wd(e,t.inConstruct,!0)&&!wd(e,t.notInConstruct,!1)}function wd(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 vd(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
45
+ `&&v_(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
46
+ `}function E_(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function k_(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 S_(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 C_(e,t,n,r){const i=S_(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(k_(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(o,__);return d(),f}const a=n.createTracker(r),l=i.repeat(Math.max(E_(o,i)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const d=n.enter(`codeFencedLang${s}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${s}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
47
47
  `,encode:["`"],...a.current()})),d()}return u+=a.move(`
48
48
  `),o&&(u+=a.move(o+`
49
- `)),u+=a.move(l),c(),u}function T_(e,t,n){return(n?"":" ")+e}function Ll(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 N_(e,t,n,r){const i=Ll(n),o=i==='"'?"Quote":"Apostrophe",s=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?" ":`
50
- `,...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),s(),c}function A_(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 di(e){return"&#x"+e.toString(16).toUpperCase()+";"}function bo(e,t,n){const r=_r(e),i=_r(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}}Qp.peek=R_;function Qp(e,t,n,r){const i=A_(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=l.charCodeAt(0),u=bo(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=di(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=bo(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+di(d));const p=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},a+l+p}function R_(e,t,n){return n.options.emphasis||"*"}function M_(e,t){let n=!1;return Do(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ta}),!!((!e.depth||e.depth<3)&&Nl(e)&&(t.options.setext||n))}function I_(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(M_(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),f=n.containerPhrasing(e,{...o.current(),before:`
49
+ `)),u+=a.move(l),c(),u}function __(e,t,n){return(n?"":" ")+e}function Ll(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 T_(e,t,n,r){const i=Ll(n),o=i==='"'?"Quote":"Apostrophe",s=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?" ":`
50
+ `,...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),s(),c}function N_(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 di(e){return"&#x"+e.toString(16).toUpperCase()+";"}function bo(e,t,n){const r=_r(e),i=_r(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}}Xp.peek=A_;function Xp(e,t,n,r){const i=N_(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=l.charCodeAt(0),u=bo(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=di(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=bo(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+di(d));const p=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},a+l+p}function A_(e,t,n){return n.options.emphasis||"*"}function R_(e,t){let n=!1;return Do(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ta}),!!((!e.depth||e.depth<3)&&Nl(e)&&(t.options.setext||n))}function M_(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(R_(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),f=n.containerPhrasing(e,{...o.current(),before:`
51
51
  `,after:`
52
52
  `});return d(),u(),f+`
53
53
  `+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
54
54
  `))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");o.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
55
- `,...o.current()});return/^[\t ]/.test(c)&&(c=di(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),a(),c}Jp.peek=O_;function Jp(e){return e.value||""}function O_(){return"<"}em.peek=P_;function em(e,t,n,r){const i=Ll(n),o=i==='"'?"Quote":"Apostrophe",s=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${o}`),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(")"),s(),c}function P_(){return"!"}tm.peek=D_;function tm(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=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+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function D_(){return"!"}nm.peek=L_;function nm(e,t,n){let r=e.value||"",i="`",o=-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+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let l;if(s.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 L_(){return"`"}function rm(e,t){const n=Nl(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))}im.peek=F_;function im(e,t,n,r){const i=Ll(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(rm(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let d=s.move("<");return d+=s.move(n.containerPhrasing(e,{before:d,after:">",...s.current()})),d+=s.move(">"),a(),n.stack=u,d}a=n.enter("link"),l=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=s.move(" "+i),c+=s.move(n.safe(e.title,{before:c,after:i,...s.current()})),c+=s.move(i),l()),c+=s.move(")"),a(),c}function F_(e,t,n){return rm(e,n)?"<":"["}om.peek=B_;function om(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=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+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function B_(){return"["}function Fl(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 j_(e){const t=Fl(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 $_(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 sm(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 V_(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?$_(n):Fl(n);const a=e.ordered?s==="."?")":".":j_(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&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),sm(n)===s&&u){let d=-1;for(;++d<e.children.length;){const f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const c=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),c}function z_(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 U_(e,t,n,r){const i=z_(n);let o=n.bulletCurrent||Fl(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(d,f,p){return f?(p?"":" ".repeat(s))+d:(p?o:o+" ".repeat(s-o.length))+d}}function H_(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const W_=xi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function G_(e,t,n,r){return(e.children.some(function(s){return W_(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function K_(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}am.peek=q_;function am(e,t,n,r){const i=K_(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=l.charCodeAt(0),u=bo(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=di(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=bo(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+di(d));const p=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},a+l+p}function q_(e,t,n){return n.options.strong||"*"}function Y_(e,t,n,r){return n.safe(e.value,r)}function Z_(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 X_(e,t,n){const r=(sm(n)+(n.options.ruleSpaces?" ":"")).repeat(Z_(n));return n.options.ruleSpaces?r.slice(0,-1):r}const lm={blockquote:w_,break:vd,code:__,definition:N_,emphasis:Qp,hardBreak:vd,heading:I_,html:Jp,image:em,imageReference:tm,inlineCode:nm,link:im,linkReference:om,list:V_,listItem:U_,paragraph:H_,root:G_,strong:am,text:Y_,thematicBreak:X_};function Q_(){return{enter:{table:J_,tableData:Ed,tableHeader:Ed,tableRow:tT},exit:{codeText:nT,table:eT,tableData:Os,tableHeader:Os,tableRow:Os}}}function J_(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 eT(e){this.exit(e),this.data.inTable=void 0}function tT(e){this.enter({type:"tableRow",children:[]},e)}function Os(e){this.exit(e)}function Ed(e){this.enter({type:"tableCell",children:[]},e)}function nT(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,rT));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function rT(e,t){return t==="|"?t:e}function iT(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
56
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:s,tableCell:l,tableRow:a}};function s(p,g,m,x){return c(u(p,m,x),p.align)}function a(p,g,m,x){const y=d(p,m,x),k=c([y]);return k.slice(0,k.indexOf(`
57
- `))}function l(p,g,m,x){const y=m.enter("tableCell"),k=m.enter("phrasing"),v=m.containerPhrasing(p,{...x,before:o,after:o});return k(),y(),v}function c(p,g){return y_(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function u(p,g,m){const x=p.children;let y=-1;const k=[],v=g.enter("table");for(;++y<x.length;)k[y]=d(x[y],g,m);return v(),k}function d(p,g,m){const x=p.children;let y=-1;const k=[],v=g.enter("tableRow");for(;++y<x.length;)k[y]=l(x[y],p,g,m);return v(),k}function f(p,g,m){let x=lm.inlineCode(p,g,m);return m.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function oT(){return{exit:{taskListCheckValueChecked:kd,taskListCheckValueUnchecked:kd,paragraph:aT}}}function sT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:lT}}}function kd(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function aT(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 o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===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 lT(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=lm.listItem(e,t,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function cT(){return[VC(),l_(),f_(),Q_(),oT()]}function uT(e){return{extensions:[zC(),c_(e),h_(),iT(e),sT()]}}const dT={tokenize:bT,partial:!0},cm={tokenize:yT,partial:!0},um={tokenize:xT,partial:!0},dm={tokenize:wT,partial:!0},fT={tokenize:vT,partial:!0},fm={name:"wwwAutolink",tokenize:mT,previous:pm},hm={name:"protocolAutolink",tokenize:gT,previous:mm},kn={name:"emailAutolink",tokenize:pT,previous:gm},fn={};function hT(){return{text:fn}}let Vn=48;for(;Vn<123;)fn[Vn]=kn,Vn++,Vn===58?Vn=65:Vn===91&&(Vn=97);fn[43]=kn;fn[45]=kn;fn[46]=kn;fn[95]=kn;fn[72]=[kn,hm];fn[104]=[kn,hm];fn[87]=[kn,fm];fn[119]=[kn,fm];function pT(e,t,n){const r=this;let i,o;return s;function s(d){return!Ma(d)||!gm.call(r,r.previous)||Bl(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return Ma(d)?(e.consume(d),a):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(fT,u,c)(d):d===45||d===95||It(d)?(o=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return o&&i&&Dt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function mT(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!pm.call(r,r.previous)||Bl(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(dT,e.attempt(cm,e.attempt(um,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function gT(e,t,n){const r=this;let i="",o=!1;return s;function s(d){return(d===72||d===104)&&mm.call(r,r.previous)&&!Bl(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(Dt(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),o?c:(o=!0,l)):n(d)}function c(d){return d===null||po(d)||et(d)||Zn(d)||Mo(d)?n(d):e.attempt(cm,e.attempt(um,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function bT(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function yT(e,t,n){let r,i,o;return s;function s(c){return c===46||c===95?e.check(dm,l,a)(c):c===null||et(c)||Zn(c)||c!==45&&Mo(c)?l(c):(o=!0,e.consume(c),s)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function l(c){return i||r||!o?n(c):t(c)}}function xT(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(dm,t,o)(s):s===null||et(s)||Zn(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function wT(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),o):a===93?(e.consume(a),i):a===60||a===null||et(a)||Zn(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||et(a)||Zn(a)?t(a):r(a)}function o(a){return Dt(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):Dt(a)?(e.consume(a),s):n(a)}}function vT(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return It(o)?n(o):t(o)}}function pm(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||et(e)}function mm(e){return!Dt(e)}function gm(e){return!(e===47||Ma(e))}function Ma(e){return e===43||e===45||e===46||e===95||It(e)}function Bl(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 ET={tokenize:RT,partial:!0};function kT(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:TT,continuation:{tokenize:NT},exit:AT}},text:{91:{name:"gfmFootnoteCall",tokenize:_T},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ST,resolveTo:CT}}}}function ST(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=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(!s||!s._balanced)return n(l);const c=rn(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function CT(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 o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function _T(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;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(o>999||d===93&&!s||d===null||d===91||et(d))return n(d);if(d===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(rn(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return et(d)||(s=!0),o++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),o++,c):c(d)}}function TT(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=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(s>999||g===93&&!a||g===null||g===91||et(g))return n(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return o=rn(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return et(g)||(a=!0),s++,e.consume(g),g===92?d:u}function d(g){return g===91||g===92||g===93?(e.consume(g),s++,u):u(g)}function f(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(o)||i.push(o),Be(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function NT(e,t,n){return e.check(yi,t,e.attempt(ET,t,n))}function AT(e){e.exit("gfmFootnoteDefinition")}function RT(e,t,n){const r=this;return Be(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function MT(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let c=l;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[l][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[l][1].end)},d={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[l][1].start)},f=[["enter",u,a],["enter",s[c][1],a],["exit",s[c][1],a],["enter",d,a]],p=a.parser.constructs.insideSpan.null;p&&Gt(f,f.length,0,Io(p,s.slice(c+1,l),a)),Gt(f,f.length,0,[["exit",d,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",u,a]]),Gt(s,c-1,l-c+3,f),l=c+f.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){const c=this.previous,u=this.events;let d=0;return f;function f(g){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const m=_r(c);if(g===126)return d>1?l(g):(s.consume(g),d++,p);if(d<2&&!n)return l(g);const x=s.exit("strikethroughSequenceTemporary"),y=_r(g);return x._open=!y||y===2&&!!m,x._close=!m||m===2&&!!y,a(g)}}}class IT{constructor(){this.map=[]}add(t,n,r){OT(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[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 o of i)t.push(o);i=r.pop()}this.map.length=0}}function OT(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 PT(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 o=r.length-1;r[o]=r[o]==="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 DT(){return{flow:{null:{name:"table",tokenize:LT,resolveAll:FT}}}}function LT(e,t,n){const r=this;let i=0,o=0,s;return a;function a(b){let R=r.events.length-1;for(;R>-1;){const $=r.events[R][1].type;if($==="lineEnding"||$==="linePrefix")R--;else break}const O=R>-1?r.events[R][1].type:null,D=O==="tableHead"||O==="tableRow"?C:l;return D===C&&r.parser.lazy[r.now().line]?n(b):D(b)}function l(b){return e.enter("tableHead"),e.enter("tableRow"),c(b)}function c(b){return b===124||(s=!0,o+=1),u(b)}function u(b){return b===null?n(b):xe(b)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):n(b):De(b)?Be(e,u,"whitespace")(b):(o+=1,s&&(s=!1,i+=1),b===124?(e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),s=!0,u):(e.enter("data"),d(b)))}function d(b){return b===null||b===124||et(b)?(e.exit("data"),u(b)):(e.consume(b),b===92?f:d)}function f(b){return b===92||b===124?(e.consume(b),d):d(b)}function p(b){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(b):(e.enter("tableDelimiterRow"),s=!1,De(b)?Be(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):g(b))}function g(b){return b===45||b===58?x(b):b===124?(s=!0,e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),m):S(b)}function m(b){return De(b)?Be(e,x,"whitespace")(b):x(b)}function x(b){return b===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(b),e.exit("tableDelimiterMarker"),y):b===45?(o+=1,y(b)):b===null||xe(b)?_(b):S(b)}function y(b){return b===45?(e.enter("tableDelimiterFiller"),k(b)):S(b)}function k(b){return b===45?(e.consume(b),k):b===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(b),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(b))}function v(b){return De(b)?Be(e,_,"whitespace")(b):_(b)}function _(b){return b===124?g(b):b===null||xe(b)?!s||i!==o?S(b):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(b)):S(b)}function S(b){return n(b)}function C(b){return e.enter("tableRow"),M(b)}function M(b){return b===124?(e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),M):b===null||xe(b)?(e.exit("tableRow"),t(b)):De(b)?Be(e,M,"whitespace")(b):(e.enter("data"),N(b))}function N(b){return b===null||b===124||et(b)?(e.exit("data"),M(b)):(e.consume(b),b===92?I:N)}function I(b){return b===92||b===124?(e.consume(b),N):N(b)}}function FT(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,c,u,d;const f=new IT;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(a=!1,l!==0&&(Sd(f,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(n,0,[["enter",c,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.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,s[2]===0&&(o[1]!==0&&(s[0]=s[1],d=ji(f,t,o,i,void 0,d),o=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],d=ji(f,t,o,i,void 0,d)),o=s,s=[o[1],n,0,0])):g.type==="tableHead"?(a=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],d=ji(f,t,o,i,n,d)):s[1]!==0&&(d=ji(f,t,s,i,n,d)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&Sd(f,t,l,c,u),f.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=PT(t.events,n))}return e}function ji(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},dr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=dr(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=dr(t.events,n[2]),u=dr(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 f=t.events[n[2]],p=t.events[n[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,m=n[3]-n[2]-1;e.add(g,m,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(o.end=Object.assign({},dr(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Sd(e,t,n,r,i){const o=[],s=dr(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function dr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const BT={name:"tasklistCheck",tokenize:$T};function jT(){return{text:{91:BT}}}function $T(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"),o)}function o(l){return et(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return xe(l)?t(l):De(l)?e.check({tokenize:VT},t,n)(l):n(l)}}function VT(e,t,n){return Be(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function zT(e){return Tp([hT(),kT(),MT(e),DT(),jT()])}const UT={};function HT(e){const t=this,n=e||UT,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(zT(n)),o.push(cT()),s.push(uT(n))}const Cd=function(e,t,n){const r=xi(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]},Jn=function(e){if(e==null)return KT;if(typeof e=="string")return GT(e);if(typeof e=="object")return WT(e);if(typeof e=="function")return jl(e);throw new Error("Expected function, string, or array as `test`")};function WT(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Jn(e[n]);return jl(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function GT(e){return jl(t);function t(n){return n.tagName===e}}function jl(e){return t;function t(n,r,i){return!!(qT(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function KT(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function qT(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const _d=/\n/g,Td=/[\t ]+/g,Ia=Jn("br"),Nd=Jn(n1),YT=Jn("p"),Ad=Jn("tr"),ZT=Jn(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",t1,r1]),bm=Jn(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function XT(e,t){const n=t||{},r="children"in e?e.children:[],i=bm(e),o=wm(e,{whitespace:n.whitespace||"normal"}),s=[];(e.type==="text"||e.type==="comment")&&s.push(...xm(e,{breakBefore:!0,breakAfter:!0}));let a=-1;for(;++a<r.length;)s.push(...ym(r[a],e,{whitespace:o,breakBefore:a?void 0:i,breakAfter:a<r.length-1?Ia(r[a+1]):i}));const l=[];let c;for(a=-1;++a<s.length;){const u=s[a];typeof u=="number"?c!==void 0&&u>c&&(c=u):u&&(c!==void 0&&c>-1&&l.push(`
58
- `.repeat(c)||" "),c=-1,l.push(u))}return l.join("")}function ym(e,t,n){return e.type==="element"?QT(e,t,n):e.type==="text"?n.whitespace==="normal"?xm(e,n):JT(e):[]}function QT(e,t,n){const r=wm(e,n),i=e.children||[];let o=-1,s=[];if(ZT(e))return s;let a,l;for(Ia(e)||Ad(e)&&Cd(t,e,Ad)?l=`
59
- `:YT(e)?(a=2,l=2):bm(e)&&(a=1,l=1);++o<i.length;)s=s.concat(ym(i[o],e,{whitespace:r,breakBefore:o?void 0:a,breakAfter:o<i.length-1?Ia(i[o+1]):l}));return Nd(e)&&Cd(t,e,Nd)&&s.push(" "),a&&s.unshift(a),l&&s.push(l),s}function xm(e,t){const n=String(e.value),r=[],i=[];let o=0;for(;o<=n.length;){_d.lastIndex=o;const l=_d.exec(n),c=l&&"index"in l?l.index:n.length;r.push(e1(n.slice(o,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,c===n.length?t.breakAfter:!0)),o=c+1}let s=-1,a;for(;++s<r.length;)r[s].charCodeAt(r[s].length-1)===8203||s<r.length-1&&r[s+1].charCodeAt(0)===8203?(i.push(r[s]),a=void 0):r[s]?(typeof a=="number"&&i.push(a),i.push(r[s]),a=0):(s===0||s===r.length-1)&&i.push(0);return i}function JT(e){return[String(e.value)]}function e1(e,t,n){const r=[];let i=0,o;for(;i<e.length;){Td.lastIndex=i;const s=Td.exec(e);o=s?s.index:e.length,!i&&!o&&s&&!t&&r.push(""),i!==o&&r.push(e.slice(i,o)),i=s?o+s[0].length:o}return i!==o&&!n&&r.push(""),r.join(" ")}function wm(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function t1(e){return!!(e.properties||{}).hidden}function n1(e){return e.tagName==="td"||e.tagName==="th"}function r1(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function i1(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],x=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:x},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},C=[S,d,a,n,e.C_BLOCK_COMMENT_MODE,u,c],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:C.concat([{begin:/\(/,end:/\)/,keywords:_,contains:C.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(M,N,S,C,[d,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:_,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function o1(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=i1(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function s1(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(a);const l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],x=["true","false"],y={match:/(\/[a-z._-]+)+/},k=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],v=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],_=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:x,built_in:[...k,...v,"set","shopt",..._,...S]},contains:[p,e.SHEBANG(),g,d,o,s,y,a,l,c,u,n]}}function a1(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",x={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[d,a,n,e.C_BLOCK_COMMENT_MODE,u,c],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:y.concat([{begin:/\(/,end:/\)/,keywords:x,contains:y.concat(["self"]),relevance:0}]),relevance:0},v={begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:x,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:x,disableAutodetect:!0,illegal:"</",contains:[].concat(k,v,y,[d,{begin:e.IDENT_RE+"::",keywords:x},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:d,strings:c,keywords:x}}}function l1(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],x=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:x},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},C=[S,d,a,n,e.C_BLOCK_COMMENT_MODE,u,c],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:C.concat([{begin:/\(/,end:/\)/,keywords:_,contains:C.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(M,N,S,C,[d,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:_,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function c1(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:t,literal:r},a=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},u={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},d=e.inherit(u,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:s},p=e.inherit(f,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},x=e.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});f.contains=[m,g,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],p.contains=[x,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[c,m,g,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},k={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},v=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,k,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,k,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+v+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,k],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[y,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const u1=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),d1=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],f1=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],h1=[...d1,...f1],p1=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),m1=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),g1=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),b1=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function y1(e){const t=e.regex,n=u1(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+m1.join("|")+")"},{begin:":(:)?("+g1.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+b1.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:p1.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+h1.join("|")+")\\b"}]}}function x1(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function w1(e){const o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,illegal:/["']/}]}]}}function v1(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function E1(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,o,i,s,n,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,u=/'[^']*'/,d=t.either(l,c,u),f=t.concat(d,"(\\s*\\.\\s*",d,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:f,className:"attr",starts:{end:/$/,contains:[r,a,o,i,s,n]}}]}}var fr="[0-9](_*[0-9])*",$i=`\\.(${fr})`,Vi="[0-9a-fA-F](_*[0-9a-fA-F])*",Rd={className:"number",variants:[{begin:`(\\b(${fr})((${$i})|\\.)?|(${$i}))[eE][+-]?(${fr})[fFdD]?\\b`},{begin:`\\b(${fr})((${$i})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${$i})[fFdD]?\\b`},{begin:`\\b(${fr})[fFdD]\\b`},{begin:`\\b0[xX]((${Vi})\\.?|(${Vi})?\\.(${Vi}))[pP][+-]?(${fr})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Vi})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function vm(e,t,n){return n===-1?"":e.replace(t,r=>vm(e,t,n-1))}function k1(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+vm("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Rd,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Rd,c]}}const Md="[A-Za-z$_][0-9A-Za-z$_]*",S1=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],C1=["true","false","null","undefined","NaN","Infinity"],Em=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],km=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Sm=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],_1=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],T1=[].concat(Sm,Em,km);function N1(e){const t=e.regex,n=(j,{after:W})=>{const w="</"+j[0].slice(1);return j.input.indexOf(w,W)!==-1},r=Md,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(j,W)=>{const w=j[0].length+j.index,F=j.input[w];if(F==="<"||F===","){W.ignoreMatch();return}F===">"&&(n(j,{after:w})||W.ignoreMatch());let Y;const E=j.input.substring(w);if(Y=E.match(/^\s*=/)){W.ignoreMatch();return}if((Y=E.match(/^\s+extends\s+/))&&Y.index===0){W.ignoreMatch();return}}},a={$pattern:Md,keyword:S1,literal:C1,built_in:T1,"variable.language":_1},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},x={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},k={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,x,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(v)});const _=[].concat(k,f.contains),S=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(_)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:S},M={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Em,...km]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},b={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function O(j){return t.concat("(?!",j.join("|"),")")}const D={match:t.concat(/\b/,O([...Sm,"super","import"].map(j=>`${j}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},re="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ne={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(re)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,x,k,{match:/\$\d+/},d,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},ne,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,e.REGEXP_MODE,{className:"function",begin:re,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},b,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},D,R,M,U,{match:/\$[(.]/}]}}function A1(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var hr="[0-9](_*[0-9])*",zi=`\\.(${hr})`,Ui="[0-9a-fA-F](_*[0-9a-fA-F])*",R1={className:"number",variants:[{begin:`(\\b(${hr})((${zi})|\\.)?|(${zi}))[eE][+-]?(${hr})[fFdD]?\\b`},{begin:`\\b(${hr})((${zi})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${zi})[fFdD]?\\b`},{begin:`\\b(${hr})[fFdD]\\b`},{begin:`\\b0[xX]((${Ui})\\.?|(${Ui})?\\.(${Ui}))[pP][+-]?(${hr})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ui})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function M1(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);const a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(s,{className:"string"}),"self"]}]},c=R1,u=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,u,n,r,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,a,l,s,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
60
- `},c]}}const I1=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),O1=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],P1=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],D1=[...O1,...P1],L1=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Cm=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),_m=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),F1=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),B1=Cm.concat(_m).sort().reverse();function j1(e){const t=I1(e),n=B1,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],a=[],l=function(v){return{className:"string",begin:"~?"+v+".*?"+v}},c=function(v,_,S){return{className:v,begin:_,relevance:S}},u={$pattern:/[a-z-]+/,keyword:r,attribute:L1.join(" ")},d={begin:"\\(",end:"\\)",contains:a,keywords:u,relevance:0};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,d,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const f=a.concat({begin:/\{/,end:/\}/,contains:s}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},g={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+F1.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:a,relevance:0}},x={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+D1.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",o,0),c("selector-id","#"+o),c("selector-class","\\."+o,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Cm.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+_m.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},t.FUNCTION_DISPATCH]},k={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,x,k,g,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function $1(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function V1(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},i={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},s={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,i,o,s]}}function z1(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=e.inherit(c,{contains:[]}),f=e.inherit(u,{contains:[]});c.contains.push(f),u.contains.push(d);let p=[n,l];return[c,u,d,f].forEach(y=>{y.contains=y.contains.concat(p)}),p=p.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,o,c,u,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,l,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function U1(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function H1(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,o,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(m,x,y="\\1")=>{const k=y==="\\1"?y:t.concat(y,x);return t.concat(t.concat("(?:",m,")"),x,/(?:\\.|[^\\\/])*?/,k,/(?:\\.|[^\\\/])*?/,y,r)},p=(m,x,y)=>t.concat(t.concat("(?:",m,")"),x,/(?:\\.|[^\\\/])*?/,y,r),g=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",t.either(...d,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...d,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=g,s.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:g}}function W1(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=t.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":($,U)=>{U.data._beginMatch=$[1]||$[2]},"on:end":($,U)=>{U.data._beginMatch!==$[1]&&U.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
61
- ]`,g={scope:"string",variants:[u,c,d,f]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},x=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],k=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],_={keyword:y,literal:($=>{const U=[];return $.forEach(re=>{U.push(re),re.toLowerCase()===re?U.push(re.toUpperCase()):U.push(re.toLowerCase())}),U})(x),built_in:k},S=$=>$.map(U=>U.replace(/\|\d+$/,"")),C={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",S(k).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},M=t.concat(r,"\\b(?!\\()"),N={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),M],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),M],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},I={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},b={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[I,s,N,e.C_BLOCK_COMMENT_MODE,g,m,C]},R={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",S(y).join("\\b|"),"|",S(k).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[b]};b.contains.push(R);const O=[I,N,e.C_BLOCK_COMMENT_MODE,g,m,C],D={begin:t.concat(/#\[\s*\\?/,t.either(i,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:x,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:x,keyword:["new","array"]},contains:["self",...O]},...O,{scope:"meta",variants:[{match:i},{match:o}]}]};return{case_insensitive:!1,keywords:_,contains:[D,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},s,R,N,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},C,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:_,contains:["self",D,s,N,e.C_BLOCK_COMMENT_MODE,g,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,m]}}function G1(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function K1(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function q1(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},u={begin:/\{\{/,relevance:0},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,u,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",p=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,g=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${p}))[eE][+-]?(${f})[jJ]?(?=${g})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${f})[jJ](?=${g})`}]},x={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,m,d,e.HASH_COMMENT_MODE]}]};return c.contains=[d,m,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,x,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,y,d]}]}}function Y1(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Z1(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function X1(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:s},d={className:"string",contains:[e.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,u]})]}]},f="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},C=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);u.contains=C,m.contains=C;const b=[{begin:/^\s*=>/,starts:{end:"$",contains:C}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:C}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(b).concat(c).concat(C)}}function Q1(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:u,keyword:a,literal:l,built_in:c},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:u}},{className:"punctuation",begin:"->"},o]}}const J1=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),eN=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],tN=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],nN=[...eN,...tN],rN=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),iN=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),oN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),sN=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function aN(e){const t=J1(e),n=oN,r=iN,i="@[a-z-]+",o="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+nN.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+sN.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:rN.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function lN(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function cN(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=u,g=[...c,...l].filter(S=>!u.includes(S)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},x={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function k(S){return t.concat(/\b/,t.either(...S.map(C=>C.replace(/\s+/,"\\s+"))),/\b/)}const v={scope:"keyword",match:k(f),relevance:0};function _(S,{exceptions:C,when:M}={}){const N=M;return C=C||[],S.map(I=>I.match(/\|\d+$/)||C.includes(I)?I:N(I)?`${I}|0`:I)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(g,{when:S=>S.length<3}),literal:o,type:a,built_in:d},contains:[{scope:"type",match:k(s)},v,y,m,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,x]}}function Tm(e){return e?typeof e=="string"?e:e.source:null}function Ur(e){return Ze("(?=",e,")")}function Ze(...e){return e.map(n=>Tm(n)).join("")}function uN(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Pt(...e){return"("+(uN(e).capture?"":"?:")+e.map(r=>Tm(r)).join("|")+")"}const $l=e=>Ze(/\b/,e,/\w$/.test(e)?/\b/:/\B/),dN=["Protocol","Type"].map($l),Id=["init","self"].map($l),fN=["Any","Self"],Ps=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Od=["false","nil","true"],hN=["assignment","associativity","higherThan","left","lowerThan","none","right"],pN=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Pd=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Nm=Pt(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Am=Pt(Nm,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Ds=Ze(Nm,Am,"*"),Rm=Pt(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),yo=Pt(Rm,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ln=Ze(Rm,yo,"*"),Hi=Ze(/[A-Z]/,yo,"*"),mN=["attached","autoclosure",Ze(/convention\(/,Pt("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ze(/objc\(/,ln,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],gN=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function bN(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Pt(...dN,...Id)],className:{2:"keyword"}},o={match:Ze(/\./,Pt(...Ps)),relevance:0},s=Ps.filter(ye=>typeof ye=="string").concat(["_|0"]),a=Ps.filter(ye=>typeof ye!="string").concat(fN).map($l),l={variants:[{className:"keyword",match:Pt(...a,...Id)}]},c={$pattern:Pt(/\b\w+/,/#\w+/),keyword:s.concat(pN),literal:Od},u=[i,o,l],d={match:Ze(/\./,Pt(...Pd)),relevance:0},f={className:"built_in",match:Ze(/\b/,Pt(...Pd),/(?=\()/)},p=[d,f],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:Ds},{match:`\\.(\\.|${Am})+`}]},x=[g,m],y="([0-9]_*)+",k="([0-9a-fA-F]_*)+",v={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${k})(\\.(${k}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(ye="")=>({className:"subst",variants:[{match:Ze(/\\/,ye,/[0\\tnr"']/)},{match:Ze(/\\/,ye,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(ye="")=>({className:"subst",match:Ze(/\\/,ye,/[\t ]*(?:[\r\n]|\r\n)/)}),C=(ye="")=>({className:"subst",label:"interpol",begin:Ze(/\\/,ye,/\(/),end:/\)/}),M=(ye="")=>({begin:Ze(ye,/"""/),end:Ze(/"""/,ye),contains:[_(ye),S(ye),C(ye)]}),N=(ye="")=>({begin:Ze(ye,/"/),end:Ze(/"/,ye),contains:[_(ye),C(ye)]}),I={className:"string",variants:[M(),M("#"),M("##"),M("###"),N(),N("#"),N("##"),N("###")]},b=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],R={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:b},O=ye=>{const ae=Ze(ye,/\//),ve=Ze(/\//,ye);return{begin:ae,end:ve,contains:[...b,{scope:"comment",begin:`#(?!.*${ve})`,end:/$/}]}},D={scope:"regexp",variants:[O("###"),O("##"),O("#"),R]},$={match:Ze(/`/,ln,/`/)},U={className:"variable",match:/\$\d+/},re={className:"variable",match:`\\$${yo}+`},ne=[$,U,re],j={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:gN,contains:[...x,v,I]}]}},W={scope:"keyword",match:Ze(/@/,Pt(...mN),Ur(Pt(/\(/,/\s+/)))},w={scope:"meta",match:Ze(/@/,ln)},F=[j,W,w],Y={match:Ur(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ze(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,yo,"+")},{className:"type",match:Hi,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ze(/\s+&\s+/,Ur(Hi)),relevance:0}]},E={begin:/</,end:/>/,keywords:c,contains:[...r,...u,...F,g,Y]};Y.contains.push(E);const B={match:Ze(ln,/\s*:/),keywords:"_|0",relevance:0},z={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",B,...r,D,...u,...p,...x,v,I,...ne,...F,Y]},K={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,Y]},q={begin:Pt(Ur(Ze(ln,/\s*:/)),Ur(Ze(ln,/\s+/,ln,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ln}]},me={begin:/\(/,end:/\)/,keywords:c,contains:[q,...r,...u,...x,v,I,...F,Y,z],endsParent:!0,illegal:/["']/},Q={match:[/(func|macro)/,/\s+/,Pt($.match,ln,Ds)],className:{1:"keyword",3:"title.function"},contains:[K,me,t],illegal:[/\[/,/%/]},le={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[K,me,t],illegal:/\[|%/},he={match:[/operator/,/\s+/,Ds],className:{1:"keyword",3:"title"}},G={begin:[/precedencegroup/,/\s+/,Hi],className:{1:"keyword",3:"title"},contains:[Y],keywords:[...hN,...Od],end:/}/},Se={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Z={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},te={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ln,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[K,...u,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:Hi},...u],relevance:0}]};for(const ye of I.variants){const ae=ye.contains.find(Ne=>Ne.label==="interpol");ae.keywords=c;const ve=[...u,...p,...x,v,I,...ne];ae.contains=[...ve,{begin:/\(/,end:/\)/,contains:["self",...ve]}]}return{name:"Swift",keywords:c,contains:[...r,Q,le,Se,Z,te,he,G,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},D,...u,...p,...x,v,I,...ne,...F,Y,z]}}const xo="[A-Za-z$_][0-9A-Za-z$_]*",Mm=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Im=["true","false","null","undefined","NaN","Infinity"],Om=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Pm=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Dm=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Lm=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Fm=[].concat(Dm,Om,Pm);function yN(e){const t=e.regex,n=(j,{after:W})=>{const w="</"+j[0].slice(1);return j.input.indexOf(w,W)!==-1},r=xo,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(j,W)=>{const w=j[0].length+j.index,F=j.input[w];if(F==="<"||F===","){W.ignoreMatch();return}F===">"&&(n(j,{after:w})||W.ignoreMatch());let Y;const E=j.input.substring(w);if(Y=E.match(/^\s*=/)){W.ignoreMatch();return}if((Y=E.match(/^\s+extends\s+/))&&Y.index===0){W.ignoreMatch();return}}},a={$pattern:xo,keyword:Mm,literal:Im,built_in:Fm,"variable.language":Lm},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},x={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},k={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,x,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(v)});const _=[].concat(k,f.contains),S=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(_)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:S},M={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Om,...Pm]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},b={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function O(j){return t.concat("(?!",j.join("|"),")")}const D={match:t.concat(/\b/,O([...Dm,"super","import"].map(j=>`${j}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},re="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ne={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(re)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,x,k,{match:/\$\d+/},d,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},ne,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,e.REGEXP_MODE,{className:"function",begin:re,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},b,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},D,R,M,U,{match:/\$[(.]/}]}}function xN(e){const t=e.regex,n=yN(e),r=xo,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:xo,keyword:Mm.concat(l),literal:Im,built_in:Fm.concat(i),"variable.language":Lm},u={className:"meta",begin:"@"+r},d=(m,x,y)=>{const k=m.contains.findIndex(v=>v.label===x);if(k===-1)throw new Error("can not find mode to replace");m.contains.splice(k,1,y)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(u);const f=n.contains.find(m=>m.scope==="attr"),p=Object.assign({},f,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,f,p]),n.contains=n.contains.concat([u,o,s,p]),d(n,"shebang",e.SHEBANG()),d(n,"use_strict",a);const g=n.contains.find(m=>m.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function wN(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,i),/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,t.either(o,i),/ +/,t.either(s,a),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,c,u,d,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function vN(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,e.QUOTE_STRING_MODE,l,c,a]}}function EN(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(o,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,l,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,s,l,a]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function kN(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},a=e.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},x=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},f,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,m,o,s],y=[...x];return y.pop(),y.push(a),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:x}}const SN={arduino:o1,bash:s1,c:a1,cpp:l1,csharp:c1,css:y1,diff:x1,go:w1,graphql:v1,ini:E1,java:k1,javascript:N1,json:A1,kotlin:M1,less:j1,lua:$1,makefile:V1,markdown:z1,objectivec:U1,perl:H1,php:W1,"php-template":G1,plaintext:K1,python:q1,"python-repl":Y1,r:Z1,ruby:X1,rust:Q1,scss:aN,shell:lN,sql:cN,swift:bN,typescript:xN,vbnet:wN,wasm:vN,xml:EN,yaml:kN};var Ls,Dd;function CN(){if(Dd)return Ls;Dd=1;function e(T){return T instanceof Map?T.clear=T.delete=T.set=function(){throw new Error("map is read-only")}:T instanceof Set&&(T.add=T.clear=T.delete=function(){throw new Error("set is read-only")}),Object.freeze(T),Object.getOwnPropertyNames(T).forEach(H=>{const ie=T[H],Te=typeof ie;(Te==="object"||Te==="function")&&!Object.isFrozen(ie)&&e(ie)}),T}class t{constructor(H){H.data===void 0&&(H.data={}),this.data=H.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(T){return T.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function r(T,...H){const ie=Object.create(null);for(const Te in T)ie[Te]=T[Te];return H.forEach(function(Te){for(const ht in Te)ie[ht]=Te[ht]}),ie}const i="</span>",o=T=>!!T.scope,s=(T,{prefix:H})=>{if(T.startsWith("language:"))return T.replace("language:","language-");if(T.includes(".")){const ie=T.split(".");return[`${H}${ie.shift()}`,...ie.map((Te,ht)=>`${Te}${"_".repeat(ht+1)}`)].join(" ")}return`${H}${T}`};class a{constructor(H,ie){this.buffer="",this.classPrefix=ie.classPrefix,H.walk(this)}addText(H){this.buffer+=n(H)}openNode(H){if(!o(H))return;const ie=s(H.scope,{prefix:this.classPrefix});this.span(ie)}closeNode(H){o(H)&&(this.buffer+=i)}value(){return this.buffer}span(H){this.buffer+=`<span class="${H}">`}}const l=(T={})=>{const H={children:[]};return Object.assign(H,T),H};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(H){this.top.children.push(H)}openNode(H){const ie=l({scope:H});this.add(ie),this.stack.push(ie)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(H){return this.constructor._walk(H,this.rootNode)}static _walk(H,ie){return typeof ie=="string"?H.addText(ie):ie.children&&(H.openNode(ie),ie.children.forEach(Te=>this._walk(H,Te)),H.closeNode(ie)),H}static _collapse(H){typeof H!="string"&&H.children&&(H.children.every(ie=>typeof ie=="string")?H.children=[H.children.join("")]:H.children.forEach(ie=>{c._collapse(ie)}))}}class u extends c{constructor(H){super(),this.options=H}addText(H){H!==""&&this.add(H)}startScope(H){this.openNode(H)}endScope(){this.closeNode()}__addSublanguage(H,ie){const Te=H.root;ie&&(Te.scope=`language:${ie}`),this.add(Te)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(T){return T?typeof T=="string"?T:T.source:null}function f(T){return m("(?=",T,")")}function p(T){return m("(?:",T,")*")}function g(T){return m("(?:",T,")?")}function m(...T){return T.map(ie=>d(ie)).join("")}function x(T){const H=T[T.length-1];return typeof H=="object"&&H.constructor===Object?(T.splice(T.length-1,1),H):{}}function y(...T){return"("+(x(T).capture?"":"?:")+T.map(Te=>d(Te)).join("|")+")"}function k(T){return new RegExp(T.toString()+"|").exec("").length-1}function v(T,H){const ie=T&&T.exec(H);return ie&&ie.index===0}const _=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function S(T,{joinWith:H}){let ie=0;return T.map(Te=>{ie+=1;const ht=ie;let pt=d(Te),pe="";for(;pt.length>0;){const ue=_.exec(pt);if(!ue){pe+=pt;break}pe+=pt.substring(0,ue.index),pt=pt.substring(ue.index+ue[0].length),ue[0][0]==="\\"&&ue[1]?pe+="\\"+String(Number(ue[1])+ht):(pe+=ue[0],ue[0]==="("&&ie++)}return pe}).map(Te=>`(${Te})`).join(H)}const C=/\b\B/,M="[a-zA-Z]\\w*",N="[a-zA-Z_]\\w*",I="\\b\\d+(\\.\\d+)?",b="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",R="\\b(0b[01]+)",O="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",D=(T={})=>{const H=/^#![ ]*\//;return T.binary&&(T.begin=m(H,/.*\b/,T.binary,/\b.*/)),r({scope:"meta",begin:H,end:/$/,relevance:0,"on:begin":(ie,Te)=>{ie.index!==0&&Te.ignoreMatch()}},T)},$={begin:"\\\\[\\s\\S]",relevance:0},U={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[$]},re={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[$]},ne={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},j=function(T,H,ie={}){const Te=r({scope:"comment",begin:T,end:H,contains:[]},ie);Te.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const ht=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Te.contains.push({begin:m(/[ ]+/,"(",ht,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Te},W=j("//","$"),w=j("/\\*","\\*/"),F=j("#","$"),Y={scope:"number",begin:I,relevance:0},E={scope:"number",begin:b,relevance:0},B={scope:"number",begin:R,relevance:0},z={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[$,{begin:/\[/,end:/\]/,relevance:0,contains:[$]}]},K={scope:"title",begin:M,relevance:0},q={scope:"title",begin:N,relevance:0},me={begin:"\\.\\s*"+N,relevance:0};var le=Object.freeze({__proto__:null,APOS_STRING_MODE:U,BACKSLASH_ESCAPE:$,BINARY_NUMBER_MODE:B,BINARY_NUMBER_RE:R,COMMENT:j,C_BLOCK_COMMENT_MODE:w,C_LINE_COMMENT_MODE:W,C_NUMBER_MODE:E,C_NUMBER_RE:b,END_SAME_AS_BEGIN:function(T){return Object.assign(T,{"on:begin":(H,ie)=>{ie.data._beginMatch=H[1]},"on:end":(H,ie)=>{ie.data._beginMatch!==H[1]&&ie.ignoreMatch()}})},HASH_COMMENT_MODE:F,IDENT_RE:M,MATCH_NOTHING_RE:C,METHOD_GUARD:me,NUMBER_MODE:Y,NUMBER_RE:I,PHRASAL_WORDS_MODE:ne,QUOTE_STRING_MODE:re,REGEXP_MODE:z,RE_STARTERS_RE:O,SHEBANG:D,TITLE_MODE:K,UNDERSCORE_IDENT_RE:N,UNDERSCORE_TITLE_MODE:q});function he(T,H){T.input[T.index-1]==="."&&H.ignoreMatch()}function G(T,H){T.className!==void 0&&(T.scope=T.className,delete T.className)}function Se(T,H){H&&T.beginKeywords&&(T.begin="\\b("+T.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",T.__beforeBegin=he,T.keywords=T.keywords||T.beginKeywords,delete T.beginKeywords,T.relevance===void 0&&(T.relevance=0))}function Z(T,H){Array.isArray(T.illegal)&&(T.illegal=y(...T.illegal))}function te(T,H){if(T.match){if(T.begin||T.end)throw new Error("begin & end are not supported with match");T.begin=T.match,delete T.match}}function ye(T,H){T.relevance===void 0&&(T.relevance=1)}const ae=(T,H)=>{if(!T.beforeMatch)return;if(T.starts)throw new Error("beforeMatch cannot be used with starts");const ie=Object.assign({},T);Object.keys(T).forEach(Te=>{delete T[Te]}),T.keywords=ie.keywords,T.begin=m(ie.beforeMatch,f(ie.begin)),T.starts={relevance:0,contains:[Object.assign(ie,{endsParent:!0})]},T.relevance=0,delete ie.beforeMatch},ve=["of","and","for","in","not","or","if","then","parent","list","value"],Ne="keyword";function _e(T,H,ie=Ne){const Te=Object.create(null);return typeof T=="string"?ht(ie,T.split(" ")):Array.isArray(T)?ht(ie,T):Object.keys(T).forEach(function(pt){Object.assign(Te,_e(T[pt],H,pt))}),Te;function ht(pt,pe){H&&(pe=pe.map(ue=>ue.toLowerCase())),pe.forEach(function(ue){const ke=ue.split("|");Te[ke[0]]=[pt,Ce(ke[0],ke[1])]})}}function Ce(T,H){return H?Number(H):bt(T)?0:1}function bt(T){return ve.includes(T.toLowerCase())}const vt={},je=T=>{console.error(T)},ut=(T,...H)=>{console.log(`WARN: ${T}`,...H)},L=(T,H)=>{vt[`${T}/${H}`]||(console.log(`Deprecated as of ${T}. ${H}`),vt[`${T}/${H}`]=!0)},J=new Error;function we(T,H,{key:ie}){let Te=0;const ht=T[ie],pt={},pe={};for(let ue=1;ue<=H.length;ue++)pe[ue+Te]=ht[ue],pt[ue+Te]=!0,Te+=k(H[ue-1]);T[ie]=pe,T[ie]._emit=pt,T[ie]._multi=!0}function Re(T){if(Array.isArray(T.begin)){if(T.skip||T.excludeBegin||T.returnBegin)throw je("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),J;if(typeof T.beginScope!="object"||T.beginScope===null)throw je("beginScope must be object"),J;we(T,T.begin,{key:"beginScope"}),T.begin=S(T.begin,{joinWith:""})}}function $e(T){if(Array.isArray(T.end)){if(T.skip||T.excludeEnd||T.returnEnd)throw je("skip, excludeEnd, returnEnd not compatible with endScope: {}"),J;if(typeof T.endScope!="object"||T.endScope===null)throw je("endScope must be object"),J;we(T,T.end,{key:"endScope"}),T.end=S(T.end,{joinWith:""})}}function _t(T){T.scope&&typeof T.scope=="object"&&T.scope!==null&&(T.beginScope=T.scope,delete T.scope)}function Ft(T){_t(T),typeof T.beginScope=="string"&&(T.beginScope={_wrap:T.beginScope}),typeof T.endScope=="string"&&(T.endScope={_wrap:T.endScope}),Re(T),$e(T)}function Bt(T){function H(pe,ue){return new RegExp(d(pe),"m"+(T.case_insensitive?"i":"")+(T.unicodeRegex?"u":"")+(ue?"g":""))}class ie{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ue,ke){ke.position=this.position++,this.matchIndexes[this.matchAt]=ke,this.regexes.push([ke,ue]),this.matchAt+=k(ue)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ue=this.regexes.map(ke=>ke[1]);this.matcherRe=H(S(ue,{joinWith:"|"}),!0),this.lastIndex=0}exec(ue){this.matcherRe.lastIndex=this.lastIndex;const ke=this.matcherRe.exec(ue);if(!ke)return null;const St=ke.findIndex((Lr,qo)=>qo>0&&Lr!==void 0),yt=this.matchIndexes[St];return ke.splice(0,St),Object.assign(ke,yt)}}class Te{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ue){if(this.multiRegexes[ue])return this.multiRegexes[ue];const ke=new ie;return this.rules.slice(ue).forEach(([St,yt])=>ke.addRule(St,yt)),ke.compile(),this.multiRegexes[ue]=ke,ke}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ue,ke){this.rules.push([ue,ke]),ke.type==="begin"&&this.count++}exec(ue){const ke=this.getMatcher(this.regexIndex);ke.lastIndex=this.lastIndex;let St=ke.exec(ue);if(this.resumingScanAtSamePosition()&&!(St&&St.index===this.lastIndex)){const yt=this.getMatcher(0);yt.lastIndex=this.lastIndex+1,St=yt.exec(ue)}return St&&(this.regexIndex+=St.position+1,this.regexIndex===this.count&&this.considerAll()),St}}function ht(pe){const ue=new Te;return pe.contains.forEach(ke=>ue.addRule(ke.begin,{rule:ke,type:"begin"})),pe.terminatorEnd&&ue.addRule(pe.terminatorEnd,{type:"end"}),pe.illegal&&ue.addRule(pe.illegal,{type:"illegal"}),ue}function pt(pe,ue){const ke=pe;if(pe.isCompiled)return ke;[G,te,Ft,ae].forEach(yt=>yt(pe,ue)),T.compilerExtensions.forEach(yt=>yt(pe,ue)),pe.__beforeBegin=null,[Se,Z,ye].forEach(yt=>yt(pe,ue)),pe.isCompiled=!0;let St=null;return typeof pe.keywords=="object"&&pe.keywords.$pattern&&(pe.keywords=Object.assign({},pe.keywords),St=pe.keywords.$pattern,delete pe.keywords.$pattern),St=St||/\w+/,pe.keywords&&(pe.keywords=_e(pe.keywords,T.case_insensitive)),ke.keywordPatternRe=H(St,!0),ue&&(pe.begin||(pe.begin=/\B|\b/),ke.beginRe=H(ke.begin),!pe.end&&!pe.endsWithParent&&(pe.end=/\B|\b/),pe.end&&(ke.endRe=H(ke.end)),ke.terminatorEnd=d(ke.end)||"",pe.endsWithParent&&ue.terminatorEnd&&(ke.terminatorEnd+=(pe.end?"|":"")+ue.terminatorEnd)),pe.illegal&&(ke.illegalRe=H(pe.illegal)),pe.contains||(pe.contains=[]),pe.contains=[].concat(...pe.contains.map(function(yt){return tt(yt==="self"?pe:yt)})),pe.contains.forEach(function(yt){pt(yt,ke)}),pe.starts&&pt(pe.starts,ue),ke.matcher=ht(ke),ke}if(T.compilerExtensions||(T.compilerExtensions=[]),T.contains&&T.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return T.classNameAliases=r(T.classNameAliases||{}),pt(T)}function oe(T){return T?T.endsWithParent||oe(T.starts):!1}function tt(T){return T.variants&&!T.cachedVariants&&(T.cachedVariants=T.variants.map(function(H){return r(T,{variants:null},H)})),T.cachedVariants?T.cachedVariants:oe(T)?r(T,{starts:T.starts?r(T.starts):null}):Object.isFrozen(T)?r(T):T}var Fe="11.11.1";class Ge extends Error{constructor(H,ie){super(H),this.name="HTMLInjectionError",this.html=ie}}const At=n,ic=r,oc=Symbol("nomatch"),kg=7,sc=function(T){const H=Object.create(null),ie=Object.create(null),Te=[];let ht=!0;const pt="Could not find the language '{}', did you forget to load/include a language module?",pe={disableAutodetect:!0,name:"Plain text",contains:[]};let ue={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function ke(ee){return ue.noHighlightRe.test(ee)}function St(ee){let be=ee.className+" ";be+=ee.parentNode?ee.parentNode.className:"";const Le=ue.languageDetectRe.exec(be);if(Le){const nt=Sn(Le[1]);return nt||(ut(pt.replace("{}",Le[1])),ut("Falling back to no-highlight mode for this block.",ee)),nt?Le[1]:"no-highlight"}return be.split(/\s+/).find(nt=>ke(nt)||Sn(nt))}function yt(ee,be,Le){let nt="",Et="";typeof be=="object"?(nt=ee,Le=be.ignoreIllegals,Et=be.language):(L("10.7.0","highlight(lang, code, ...args) has been deprecated."),L("10.7.0",`Please use highlight(code, options) instead.
62
- https://github.com/highlightjs/highlight.js/issues/2277`),Et=ee,nt=be),Le===void 0&&(Le=!0);const en={code:nt,language:Et};_i("before:highlight",en);const Cn=en.result?en.result:Lr(en.language,en.code,Le);return Cn.code=en.code,_i("after:highlight",Cn),Cn}function Lr(ee,be,Le,nt){const Et=Object.create(null);function en(se,ge){return se.keywords[ge]}function Cn(){if(!Ae.keywords){Tt.addText(rt);return}let se=0;Ae.keywordPatternRe.lastIndex=0;let ge=Ae.keywordPatternRe.exec(rt),Oe="";for(;ge;){Oe+=rt.substring(se,ge.index);const He=sn.case_insensitive?ge[0].toLowerCase():ge[0],Rt=en(Ae,He);if(Rt){const[pn,$g]=Rt;if(Tt.addText(Oe),Oe="",Et[He]=(Et[He]||0)+1,Et[He]<=kg&&(Ai+=$g),pn.startsWith("_"))Oe+=ge[0];else{const Vg=sn.classNameAliases[pn]||pn;on(ge[0],Vg)}}else Oe+=ge[0];se=Ae.keywordPatternRe.lastIndex,ge=Ae.keywordPatternRe.exec(rt)}Oe+=rt.substring(se),Tt.addText(Oe)}function Ti(){if(rt==="")return;let se=null;if(typeof Ae.subLanguage=="string"){if(!H[Ae.subLanguage]){Tt.addText(rt);return}se=Lr(Ae.subLanguage,rt,!0,pc[Ae.subLanguage]),pc[Ae.subLanguage]=se._top}else se=Yo(rt,Ae.subLanguage.length?Ae.subLanguage:null);Ae.relevance>0&&(Ai+=se.relevance),Tt.__addSublanguage(se._emitter,se.language)}function Ut(){Ae.subLanguage!=null?Ti():Cn(),rt=""}function on(se,ge){se!==""&&(Tt.startScope(ge),Tt.addText(se),Tt.endScope())}function uc(se,ge){let Oe=1;const He=ge.length-1;for(;Oe<=He;){if(!se._emit[Oe]){Oe++;continue}const Rt=sn.classNameAliases[se[Oe]]||se[Oe],pn=ge[Oe];Rt?on(pn,Rt):(rt=pn,Cn(),rt=""),Oe++}}function dc(se,ge){return se.scope&&typeof se.scope=="string"&&Tt.openNode(sn.classNameAliases[se.scope]||se.scope),se.beginScope&&(se.beginScope._wrap?(on(rt,sn.classNameAliases[se.beginScope._wrap]||se.beginScope._wrap),rt=""):se.beginScope._multi&&(uc(se.beginScope,ge),rt="")),Ae=Object.create(se,{parent:{value:Ae}}),Ae}function fc(se,ge,Oe){let He=v(se.endRe,Oe);if(He){if(se["on:end"]){const Rt=new t(se);se["on:end"](ge,Rt),Rt.isMatchIgnored&&(He=!1)}if(He){for(;se.endsParent&&se.parent;)se=se.parent;return se}}if(se.endsWithParent)return fc(se.parent,ge,Oe)}function Dg(se){return Ae.matcher.regexIndex===0?(rt+=se[0],1):(Jo=!0,0)}function Lg(se){const ge=se[0],Oe=se.rule,He=new t(Oe),Rt=[Oe.__beforeBegin,Oe["on:begin"]];for(const pn of Rt)if(pn&&(pn(se,He),He.isMatchIgnored))return Dg(ge);return Oe.skip?rt+=ge:(Oe.excludeBegin&&(rt+=ge),Ut(),!Oe.returnBegin&&!Oe.excludeBegin&&(rt=ge)),dc(Oe,se),Oe.returnBegin?0:ge.length}function Fg(se){const ge=se[0],Oe=be.substring(se.index),He=fc(Ae,se,Oe);if(!He)return oc;const Rt=Ae;Ae.endScope&&Ae.endScope._wrap?(Ut(),on(ge,Ae.endScope._wrap)):Ae.endScope&&Ae.endScope._multi?(Ut(),uc(Ae.endScope,se)):Rt.skip?rt+=ge:(Rt.returnEnd||Rt.excludeEnd||(rt+=ge),Ut(),Rt.excludeEnd&&(rt=ge));do Ae.scope&&Tt.closeNode(),!Ae.skip&&!Ae.subLanguage&&(Ai+=Ae.relevance),Ae=Ae.parent;while(Ae!==He.parent);return He.starts&&dc(He.starts,se),Rt.returnEnd?0:ge.length}function Bg(){const se=[];for(let ge=Ae;ge!==sn;ge=ge.parent)ge.scope&&se.unshift(ge.scope);se.forEach(ge=>Tt.openNode(ge))}let Ni={};function hc(se,ge){const Oe=ge&&ge[0];if(rt+=se,Oe==null)return Ut(),0;if(Ni.type==="begin"&&ge.type==="end"&&Ni.index===ge.index&&Oe===""){if(rt+=be.slice(ge.index,ge.index+1),!ht){const He=new Error(`0 width match regex (${ee})`);throw He.languageName=ee,He.badRule=Ni.rule,He}return 1}if(Ni=ge,ge.type==="begin")return Lg(ge);if(ge.type==="illegal"&&!Le){const He=new Error('Illegal lexeme "'+Oe+'" for mode "'+(Ae.scope||"<unnamed>")+'"');throw He.mode=Ae,He}else if(ge.type==="end"){const He=Fg(ge);if(He!==oc)return He}if(ge.type==="illegal"&&Oe==="")return rt+=`
63
- `,1;if(Qo>1e5&&Qo>ge.index*3)throw new Error("potential infinite loop, way more iterations than matches");return rt+=Oe,Oe.length}const sn=Sn(ee);if(!sn)throw je(pt.replace("{}",ee)),new Error('Unknown language: "'+ee+'"');const jg=Bt(sn);let Xo="",Ae=nt||jg;const pc={},Tt=new ue.__emitter(ue);Bg();let rt="",Ai=0,Bn=0,Qo=0,Jo=!1;try{if(sn.__emitTokens)sn.__emitTokens(be,Tt);else{for(Ae.matcher.considerAll();;){Qo++,Jo?Jo=!1:Ae.matcher.considerAll(),Ae.matcher.lastIndex=Bn;const se=Ae.matcher.exec(be);if(!se)break;const ge=be.substring(Bn,se.index),Oe=hc(ge,se);Bn=se.index+Oe}hc(be.substring(Bn))}return Tt.finalize(),Xo=Tt.toHTML(),{language:ee,value:Xo,relevance:Ai,illegal:!1,_emitter:Tt,_top:Ae}}catch(se){if(se.message&&se.message.includes("Illegal"))return{language:ee,value:At(be),illegal:!0,relevance:0,_illegalBy:{message:se.message,index:Bn,context:be.slice(Bn-100,Bn+100),mode:se.mode,resultSoFar:Xo},_emitter:Tt};if(ht)return{language:ee,value:At(be),illegal:!1,relevance:0,errorRaised:se,_emitter:Tt,_top:Ae};throw se}}function qo(ee){const be={value:At(ee),illegal:!1,relevance:0,_top:pe,_emitter:new ue.__emitter(ue)};return be._emitter.addText(ee),be}function Yo(ee,be){be=be||ue.languages||Object.keys(H);const Le=qo(ee),nt=be.filter(Sn).filter(cc).map(Ut=>Lr(Ut,ee,!1));nt.unshift(Le);const Et=nt.sort((Ut,on)=>{if(Ut.relevance!==on.relevance)return on.relevance-Ut.relevance;if(Ut.language&&on.language){if(Sn(Ut.language).supersetOf===on.language)return 1;if(Sn(on.language).supersetOf===Ut.language)return-1}return 0}),[en,Cn]=Et,Ti=en;return Ti.secondBest=Cn,Ti}function Sg(ee,be,Le){const nt=be&&ie[be]||Le;ee.classList.add("hljs"),ee.classList.add(`language-${nt}`)}function Zo(ee){let be=null;const Le=St(ee);if(ke(Le))return;if(_i("before:highlightElement",{el:ee,language:Le}),ee.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ee);return}if(ee.children.length>0&&(ue.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ee)),ue.throwUnescapedHTML))throw new Ge("One of your code blocks includes unescaped HTML.",ee.innerHTML);be=ee;const nt=be.textContent,Et=Le?yt(nt,{language:Le,ignoreIllegals:!0}):Yo(nt);ee.innerHTML=Et.value,ee.dataset.highlighted="yes",Sg(ee,Le,Et.language),ee.result={language:Et.language,re:Et.relevance,relevance:Et.relevance},Et.secondBest&&(ee.secondBest={language:Et.secondBest.language,relevance:Et.secondBest.relevance}),_i("after:highlightElement",{el:ee,result:Et,text:nt})}function Cg(ee){ue=ic(ue,ee)}const _g=()=>{Ci(),L("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Tg(){Ci(),L("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ac=!1;function Ci(){function ee(){Ci()}if(document.readyState==="loading"){ac||window.addEventListener("DOMContentLoaded",ee,!1),ac=!0;return}document.querySelectorAll(ue.cssSelector).forEach(Zo)}function Ng(ee,be){let Le=null;try{Le=be(T)}catch(nt){if(je("Language definition for '{}' could not be registered.".replace("{}",ee)),ht)je(nt);else throw nt;Le=pe}Le.name||(Le.name=ee),H[ee]=Le,Le.rawDefinition=be.bind(null,T),Le.aliases&&lc(Le.aliases,{languageName:ee})}function Ag(ee){delete H[ee];for(const be of Object.keys(ie))ie[be]===ee&&delete ie[be]}function Rg(){return Object.keys(H)}function Sn(ee){return ee=(ee||"").toLowerCase(),H[ee]||H[ie[ee]]}function lc(ee,{languageName:be}){typeof ee=="string"&&(ee=[ee]),ee.forEach(Le=>{ie[Le.toLowerCase()]=be})}function cc(ee){const be=Sn(ee);return be&&!be.disableAutodetect}function Mg(ee){ee["before:highlightBlock"]&&!ee["before:highlightElement"]&&(ee["before:highlightElement"]=be=>{ee["before:highlightBlock"](Object.assign({block:be.el},be))}),ee["after:highlightBlock"]&&!ee["after:highlightElement"]&&(ee["after:highlightElement"]=be=>{ee["after:highlightBlock"](Object.assign({block:be.el},be))})}function Ig(ee){Mg(ee),Te.push(ee)}function Og(ee){const be=Te.indexOf(ee);be!==-1&&Te.splice(be,1)}function _i(ee,be){const Le=ee;Te.forEach(function(nt){nt[Le]&&nt[Le](be)})}function Pg(ee){return L("10.7.0","highlightBlock will be removed entirely in v12.0"),L("10.7.0","Please use highlightElement now."),Zo(ee)}Object.assign(T,{highlight:yt,highlightAuto:Yo,highlightAll:Ci,highlightElement:Zo,highlightBlock:Pg,configure:Cg,initHighlighting:_g,initHighlightingOnLoad:Tg,registerLanguage:Ng,unregisterLanguage:Ag,listLanguages:Rg,getLanguage:Sn,registerAliases:lc,autoDetection:cc,inherit:ic,addPlugin:Ig,removePlugin:Og}),T.debugMode=function(){ht=!1},T.safeMode=function(){ht=!0},T.versionString=Fe,T.regex={concat:m,lookahead:f,either:y,optional:g,anyNumberOfTimes:p};for(const ee in le)typeof le[ee]=="object"&&e(le[ee]);return Object.assign(T,le),T},tr=sc({});return tr.newInstance=()=>sc({}),Ls=tr,tr.HighlightJS=tr,tr.default=tr,Ls}var _N=CN();const TN=Ro(_N),Ld={},NN="hljs-";function AN(e){const t=TN.newInstance();return e&&o(e),{highlight:n,highlightAuto:r,listLanguages:i,register:o,registerAlias:s,registered:a};function n(l,c,u){const d=u||Ld,f=typeof d.prefix=="string"?d.prefix:NN;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:RN,classPrefix:f});const p=t.highlight(c,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const g=p._emitter.root,m=g.data;return m.language=p.language,m.relevance=p.relevance,g}function r(l,c){const d=(c||Ld).subset||i();let f=-1,p=0,g;for(;++f<d.length;){const m=d[f];if(!t.getLanguage(m))continue;const x=n(m,l,c);x.data&&x.data.relevance!==void 0&&x.data.relevance>p&&(p=x.data.relevance,g=x)}return g||{type:"root",children:[],data:{language:void 0,relevance:p}}}function i(){return t.listLanguages()}function o(l,c){if(typeof l=="string")t.registerLanguage(l,c);else{let u;for(u in l)Object.hasOwn(l,u)&&t.registerLanguage(u,l[u])}}function s(l,c){if(typeof l=="string")t.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else{let u;for(u in l)if(Object.hasOwn(l,u)){const d=l[u];t.registerAliases(typeof d=="string"?d:[...d],{languageName:u})}}}function a(l){return!!t.getLanguage(l)}}class RN{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=this,r=t.split(".").map(function(s,a){return a?s+"_".repeat(a):n.options.classPrefix+s}),i=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(o),this.stack.push(o)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const MN={};function IN(e){const t=e||MN,n=t.aliases,r=t.detect||!1,i=t.languages||SN,o=t.plainText,s=t.prefix,a=t.subset;let l="hljs";const c=AN(i);if(n&&c.registerAlias(n),s){const u=s.indexOf("-");l=u===-1?s:s.slice(0,u)}return function(u,d){Do(u,"element",function(f,p,g){if(f.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const m=ON(f);if(m===!1||!m&&!r||m&&o&&o.includes(m))return;Array.isArray(f.properties.className)||(f.properties.className=[]),f.properties.className.includes(l)||f.properties.className.unshift(l);const x=XT(f,{whitespace:"pre"});let y;try{y=m?c.highlight(m,x,{prefix:s}):c.highlightAuto(x,{prefix:s,subset:a})}catch(k){const v=k;if(m&&/Unknown language/.test(v.message)){d.message("Cannot highlight as `"+m+"`, it’s not registered",{ancestors:[g,f],cause:v,place:f.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw v}!m&&y.data&&y.data.language&&f.properties.className.push("language-"+y.data.language),y.children.length>0&&(f.children=y.children)})}}function ON(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){const i=String(t[n]);if(i==="no-highlight"||i==="nohighlight")return!1;!r&&i.slice(0,5)==="lang-"&&(r=i.slice(5)),!r&&i.slice(0,9)==="language-"&&(r=i.slice(9))}return r}function PN({onSendMessage:e,onSendAttachments:t,disabled:n,theme:r,onEndChat:i,attachmentsEnabled:o=!0}){const[s,a]=P.useState(""),[l,c]=P.useState(!1),u=P.useRef(null),d=P.useRef(null),[f,p]=P.useState(!1),g=Ct(r);P.useEffect(()=>{const S=()=>{const C=navigator.userAgent.toLowerCase(),N=["android","iphone","ipad","mobile","tablet"].some(R=>C.includes(R)),I="ontouchstart"in window||navigator.maxTouchPoints>0,b=window.innerWidth<=768;p(N||I&&b)};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const m=S=>{S.preventDefault(),s.trim()&&!n&&(e(s.trim()),a(""))},x=S=>{S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),m(S))},y=S=>{const C=S.target.files;if(C&&C.length>0){const M=Array.from(C),N=M.filter(I=>I.type.startsWith("image/"));if(N.length===0){console.warn("No valid image files selected");return}N.length!==M.length&&console.warn("Some non-image files were filtered out"),t(N),u.current&&(u.current.value="")}},k=()=>{!n&&u.current&&u.current.click()},v=()=>{!n&&f&&d.current&&d.current.click()},_=S=>{const C=S.target.files;if(C&&C.length>0){const M=C[0];M.type.startsWith("image/")?t([M]):console.warn("Selected file is not an image"),d.current&&(d.current.value="")}};return h.jsx("div",{className:"px-4 py-3 !w-full backdrop-blur-xl border-0 shadow-lg ",children:h.jsx("form",{onSubmit:m,className:"flex items-center !w-full",children:h.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":g.chatInput.container}`,children:[o&&h.jsx(Ie.button,{type:"button",onClick:k,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${g.chatInput.attachButton}`,disabled:n,"aria-label":"Attach file",children:h.jsx(We.Paperclip,{className:"w-4 h-4"})}),o&&f&&h.jsx(Ie.button,{type:"button",onClick:v,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${g.chatInput.attachButton}`,disabled:n,"aria-label":"Take photo",children:h.jsx(We.Camera,{className:"w-4 h-4"})}),o&&h.jsx("input",{ref:u,type:"file",multiple:!0,onChange:y,className:"hidden",accept:"image/*"}),o&&h.jsx("input",{ref:d,type:"file",onChange:_,className:"hidden",accept:"image/*",capture:"environment"}),h.jsx("textarea",{value:s,onChange:S=>a(S.target.value),onKeyDown:x,onFocus:()=>c(!0),onBlur:()=>c(!1),placeholder:"Type your message...",disabled:n,className:`flex-1 px-2 py-1 bg-transparent resize-none min-h-[32px] max-h-20 focus:outline-none text-sm border-0 ${g.chatInput.textarea}`,rows:1,style:{height:"auto",minHeight:"32px"},onInput:S=>{const C=S.target;C.style.height="auto",C.style.height=`${Math.min(C.scrollHeight,80)}px`}}),h.jsx(Ie.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?g.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:h.jsx(We.SendHorizontal,{className:"w-4 h-4"})}),i&&h.jsx(Ie.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 ${g.chatInput.endButton}`,"aria-label":"End chat",children:h.jsx(We.PhoneOff,{className:"w-4 h-4"})})]})})})}function DN({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[i,o]=P.useState(""),[s,a]=P.useState(0);return P.useEffect(()=>{if(n){o(e);return}if(t){o(e);return}if(s<e.length){const l=setTimeout(()=>{o(e.slice(0,s+1)),a(s+1)},r);return()=>clearTimeout(l)}},[e,s,t,r,n]),P.useEffect(()=>{n||(a(0),o(""))},[e,n]),h.jsxs("span",{className:"relative",children:[h.jsx("span",{className:"inline-block",children:i}),!t&&h.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(l=>h.jsx(Ie.span,{className:"w-1.5 h-1.5 bg-current rounded-full mx-0.5",animate:{y:[0,-4,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:l*.2,ease:"easeInOut"}},l))})]})}function LN({message:e,theme:t,isOwn:n,isStreaming:r=!1}){var u,d,f,p;const i=Ct(t),o=e.sender.name?e.sender.name.split(" ").map(g=>g[0]).join("").toUpperCase().slice(0,2):"U",s=((u=e==null?void 0:e.metadata)==null?void 0:u.format)==="markdown"||((d=e==null?void 0:e.metadata)==null?void 0:d.markdown)===!0||/(\n|^)#\s|\n##\s|```|\*\s|\-\s|\d+\.\s|>\s|!\[|\]\(https?:\/\//.test(e.content)||/^```markdown\s[\s\S]*```$/.test(e.content.trim())||/^``markdown\s[\s\S]*``?$/.test(e.content.trim())||/^``markdown\s[\s\S]*$/.test(e.content.trim())||/^`markdown\s[\s\S]*`$/.test(e.content.trim())||/\[.*\]\(.*\)/.test(e.content)||/\|.*\|/.test(e.content)||/^-\s/.test(e.content)||/^\*\s/.test(e.content)||/^\d+\.\s/.test(e.content)||/(^|\n)#.*\n#/.test(e.content)||/```[\s\S]*?```[\s\S]*?```/.test(e.content)||/#.*\n/.test(e.content)&&(/```/.test(e.content)||/^\s*[\-\*]\s/m.test(e.content))||e.content.includes("README")&&/#/.test(e.content)||/^`+markdown\s/.test(e.content.trim()),a=P.useMemo(()=>{if(!s)return e.content;const g=e.content.trim(),m=g.match(/^```markdown\s?([\s\S]*?)```$/);if(m)return m[1].trim();let x=g.match(/^``markdown\s?([\s\S]*?)``$/);if(x)return x[1].trim();if(g.startsWith("``markdown"))return g.replace(/^``markdown\s*\n?/,"").replace(/``?$/,"").trim();const y=g.match(/^`markdown\s?([\s\S]*?)`$/);return y?y[1].trim():e.content},[e.content,s]),l=g=>{const m=/(https?:\/\/[^\s<>"{}|\\^`[\]]*)/g;return g.split(m).map((y,k)=>m.test(y)?h.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:`underline font-medium transition-colors hover:opacity-80 cursor-pointer ${t==="dark"?"text-blue-400 hover:text-blue-300":"text-blue-600 hover:text-blue-800"}`,onClick:v=>{v.preventDefault(),window.open(y,"_blank","noopener,noreferrer")},children:y},k):y)},c={h1:g=>h.jsx("h1",{className:`text-lg font-bold mt-4 mb-2 pb-1 border-b ${t==="dark"?"border-gray-600 text-gray-100":"border-gray-200 text-gray-900"}`,...g}),h2:g=>h.jsx("h2",{className:`text-base font-semibold mt-3 mb-2 ${t==="dark"?"text-gray-200":"text-gray-800"}`,...g}),h3:g=>h.jsx("h3",{className:`text-sm font-semibold mt-2 mb-1 ${t==="dark"?"text-gray-300":"text-gray-700"}`,...g}),p:g=>h.jsx("p",{className:"my-2 leading-relaxed",...g}),a:({href:g,children:m,...x})=>{const y=g||(typeof m=="string"&&m.startsWith("http")?m:"#");return h.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:`underline font-medium transition-colors hover:opacity-80 cursor-pointer ${t==="dark"?"text-blue-400 hover:text-blue-300":"text-blue-600 hover:text-blue-800"}`,onClick:k=>{if(!y||y==="#"){k.preventDefault();return}},...x,children:m})},code:({inline:g,className:m,children:x,...y})=>{const k=/language-(\w+)/.exec(m||""),v=k?k[1]:"";return g?h.jsx("code",{className:`px-1.5 py-0.5 rounded text-[0.85em] font-mono ${t==="dark"?"bg-gray-700 text-gray-200":"bg-gray-100 text-gray-800"}`,...y,children:x}):h.jsxs("div",{className:"my-3",children:[v&&h.jsx("div",{className:`px-3 py-1 text-xs font-medium rounded-t-md ${t==="dark"?"bg-gray-900 text-gray-300 border-b border-gray-700":"bg-gray-50 text-gray-600 border-b border-gray-200"}`,children:v}),h.jsx("pre",{className:`overflow-x-auto text-sm ${v?"rounded-t-none":""} rounded-md ${t==="dark"?"bg-gray-900 border border-gray-700 text-gray-100":"bg-gray-50 border border-gray-200 text-gray-900"}`,style:{margin:0},children:h.jsx("code",{className:`block p-3 font-mono ${t==="dark"?"text-gray-100":"text-gray-900"} ${m||""}`,...y,children:x})})]})},pre:({children:g,...m})=>h.jsx(h.Fragment,{children:g}),ul:g=>h.jsx("ul",{className:"list-disc pl-5 my-2 space-y-1",...g}),ol:g=>h.jsx("ol",{className:"list-decimal pl-5 my-2 space-y-1",...g}),li:g=>h.jsx("li",{className:"leading-relaxed",...g}),blockquote:g=>h.jsx("blockquote",{className:`border-l-4 pl-4 italic my-3 ${t==="dark"?"border-gray-600 text-gray-300 bg-gray-800/30":"border-gray-300 text-gray-600 bg-gray-50/50"}`,...g}),img:g=>h.jsx("img",{className:"max-w-full h-auto rounded-md my-2 shadow-sm",loading:"lazy",...g}),table:g=>h.jsx("div",{className:"overflow-x-auto my-3",children:h.jsx("table",{className:`min-w-full text-left text-sm border rounded-md ${t==="dark"?"border-gray-600":"border-gray-200"}`,...g})}),th:g=>h.jsx("th",{className:`px-3 py-2 font-semibold border-b ${t==="dark"?"bg-gray-800 border-gray-600 text-gray-200":"bg-gray-50 border-gray-200 text-gray-700"}`,...g}),td:g=>h.jsx("td",{className:`px-3 py-2 border-b ${t==="dark"?"border-gray-700":"border-gray-200"}`,...g}),hr:g=>h.jsx("hr",{className:`my-4 border-0 h-px ${t==="dark"?"bg-gray-600":"bg-gray-300"}`,...g}),strong:g=>h.jsx("strong",{className:"font-semibold",...g}),em:g=>h.jsx("em",{className:"italic",...g})};return h.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-1`,children:h.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 max-w-[85%] min-w-0`,children:[h.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${n?t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700":t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:o}),h.jsxs("div",{className:`
55
+ `,...o.current()});return/^[\t ]/.test(c)&&(c=di(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),a(),c}Qp.peek=I_;function Qp(e){return e.value||""}function I_(){return"<"}Jp.peek=O_;function Jp(e,t,n,r){const i=Ll(n),o=i==='"'?"Quote":"Apostrophe",s=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${o}`),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(")"),s(),c}function O_(){return"!"}em.peek=P_;function em(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=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+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function P_(){return"!"}tm.peek=D_;function tm(e,t,n){let r=e.value||"",i="`",o=-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+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let l;if(s.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 D_(){return"`"}function nm(e,t){const n=Nl(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))}rm.peek=L_;function rm(e,t,n,r){const i=Ll(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(nm(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let d=s.move("<");return d+=s.move(n.containerPhrasing(e,{before:d,after:">",...s.current()})),d+=s.move(">"),a(),n.stack=u,d}a=n.enter("link"),l=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=s.move(" "+i),c+=s.move(n.safe(e.title,{before:c,after:i,...s.current()})),c+=s.move(i),l()),c+=s.move(")"),a(),c}function L_(e,t,n){return nm(e,n)?"<":"["}im.peek=F_;function im(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=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+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function F_(){return"["}function Fl(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 B_(e){const t=Fl(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 j_(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 om(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 $_(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?j_(n):Fl(n);const a=e.ordered?s==="."?")":".":B_(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&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),om(n)===s&&u){let d=-1;for(;++d<e.children.length;){const f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const c=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),c}function V_(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 z_(e,t,n,r){const i=V_(n);let o=n.bulletCurrent||Fl(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(d,f,p){return f?(p?"":" ".repeat(s))+d:(p?o:o+" ".repeat(s-o.length))+d}}function U_(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const H_=xi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function W_(e,t,n,r){return(e.children.some(function(s){return H_(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function G_(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}sm.peek=K_;function sm(e,t,n,r){const i=G_(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=l.charCodeAt(0),u=bo(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=di(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=bo(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+di(d));const p=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},a+l+p}function K_(e,t,n){return n.options.strong||"*"}function q_(e,t,n,r){return n.safe(e.value,r)}function Y_(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 Z_(e,t,n){const r=(om(n)+(n.options.ruleSpaces?" ":"")).repeat(Y_(n));return n.options.ruleSpaces?r.slice(0,-1):r}const am={blockquote:x_,break:vd,code:C_,definition:T_,emphasis:Xp,hardBreak:vd,heading:M_,html:Qp,image:Jp,imageReference:em,inlineCode:tm,link:rm,linkReference:im,list:$_,listItem:z_,paragraph:U_,root:W_,strong:sm,text:q_,thematicBreak:Z_};function X_(){return{enter:{table:Q_,tableData:Ed,tableHeader:Ed,tableRow:eT},exit:{codeText:tT,table:J_,tableData:Os,tableHeader:Os,tableRow:Os}}}function Q_(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 J_(e){this.exit(e),this.data.inTable=void 0}function eT(e){this.enter({type:"tableRow",children:[]},e)}function Os(e){this.exit(e)}function Ed(e){this.enter({type:"tableCell",children:[]},e)}function tT(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,nT));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function nT(e,t){return t==="|"?t:e}function rT(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
56
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:s,tableCell:l,tableRow:a}};function s(p,g,m,x){return c(u(p,m,x),p.align)}function a(p,g,m,x){const y=d(p,m,x),E=c([y]);return E.slice(0,E.indexOf(`
57
+ `))}function l(p,g,m,x){const y=m.enter("tableCell"),E=m.enter("phrasing"),v=m.containerPhrasing(p,{...x,before:o,after:o});return E(),y(),v}function c(p,g){return b_(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function u(p,g,m){const x=p.children;let y=-1;const E=[],v=g.enter("table");for(;++y<x.length;)E[y]=d(x[y],g,m);return v(),E}function d(p,g,m){const x=p.children;let y=-1;const E=[],v=g.enter("tableRow");for(;++y<x.length;)E[y]=l(x[y],p,g,m);return v(),E}function f(p,g,m){let x=am.inlineCode(p,g,m);return m.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function iT(){return{exit:{taskListCheckValueChecked:kd,taskListCheckValueUnchecked:kd,paragraph:sT}}}function oT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:aT}}}function kd(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function sT(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 o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===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 aT(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=am.listItem(e,t,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function lT(){return[$C(),a_(),d_(),X_(),iT()]}function cT(e){return{extensions:[VC(),l_(e),f_(),rT(e),oT()]}}const uT={tokenize:gT,partial:!0},lm={tokenize:bT,partial:!0},cm={tokenize:yT,partial:!0},um={tokenize:xT,partial:!0},dT={tokenize:wT,partial:!0},dm={name:"wwwAutolink",tokenize:pT,previous:hm},fm={name:"protocolAutolink",tokenize:mT,previous:pm},En={name:"emailAutolink",tokenize:hT,previous:mm},dn={};function fT(){return{text:dn}}let Vn=48;for(;Vn<123;)dn[Vn]=En,Vn++,Vn===58?Vn=65:Vn===91&&(Vn=97);dn[43]=En;dn[45]=En;dn[46]=En;dn[95]=En;dn[72]=[En,fm];dn[104]=[En,fm];dn[87]=[En,dm];dn[119]=[En,dm];function hT(e,t,n){const r=this;let i,o;return s;function s(d){return!Ma(d)||!mm.call(r,r.previous)||Bl(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return Ma(d)?(e.consume(d),a):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(dT,u,c)(d):d===45||d===95||Rt(d)?(o=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return o&&i&&Pt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function pT(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!hm.call(r,r.previous)||Bl(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(uT,e.attempt(lm,e.attempt(cm,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function mT(e,t,n){const r=this;let i="",o=!1;return s;function s(d){return(d===72||d===104)&&pm.call(r,r.previous)&&!Bl(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(Pt(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),o?c:(o=!0,l)):n(d)}function c(d){return d===null||po(d)||tt(d)||Zn(d)||Mo(d)?n(d):e.attempt(lm,e.attempt(cm,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function gT(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function bT(e,t,n){let r,i,o;return s;function s(c){return c===46||c===95?e.check(um,l,a)(c):c===null||tt(c)||Zn(c)||c!==45&&Mo(c)?l(c):(o=!0,e.consume(c),s)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function l(c){return i||r||!o?n(c):t(c)}}function yT(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(um,t,o)(s):s===null||tt(s)||Zn(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function xT(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),o):a===93?(e.consume(a),i):a===60||a===null||tt(a)||Zn(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||tt(a)||Zn(a)?t(a):r(a)}function o(a){return Pt(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):Pt(a)?(e.consume(a),s):n(a)}}function wT(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return Rt(o)?n(o):t(o)}}function hm(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||tt(e)}function pm(e){return!Pt(e)}function mm(e){return!(e===47||Ma(e))}function Ma(e){return e===43||e===45||e===46||e===95||Rt(e)}function Bl(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 vT={tokenize:AT,partial:!0};function ET(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:_T,continuation:{tokenize:TT},exit:NT}},text:{91:{name:"gfmFootnoteCall",tokenize:CT},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:kT,resolveTo:ST}}}}function kT(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=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(!s||!s._balanced)return n(l);const c=tn(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function ST(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 o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function CT(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;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(o>999||d===93&&!s||d===null||d===91||tt(d))return n(d);if(d===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(tn(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return tt(d)||(s=!0),o++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),o++,c):c(d)}}function _T(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=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(s>999||g===93&&!a||g===null||g===91||tt(g))return n(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return o=tn(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return tt(g)||(a=!0),s++,e.consume(g),g===92?d:u}function d(g){return g===91||g===92||g===93?(e.consume(g),s++,u):u(g)}function f(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(o)||i.push(o),Fe(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function TT(e,t,n){return e.check(yi,t,e.attempt(vT,t,n))}function NT(e){e.exit("gfmFootnoteDefinition")}function AT(e,t,n){const r=this;return Fe(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function RT(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let c=l;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[l][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[l][1].end)},d={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[l][1].start)},f=[["enter",u,a],["enter",s[c][1],a],["exit",s[c][1],a],["enter",d,a]],p=a.parser.constructs.insideSpan.null;p&&Ht(f,f.length,0,Io(p,s.slice(c+1,l),a)),Ht(f,f.length,0,[["exit",d,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",u,a]]),Ht(s,c-1,l-c+3,f),l=c+f.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){const c=this.previous,u=this.events;let d=0;return f;function f(g){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const m=_r(c);if(g===126)return d>1?l(g):(s.consume(g),d++,p);if(d<2&&!n)return l(g);const x=s.exit("strikethroughSequenceTemporary"),y=_r(g);return x._open=!y||y===2&&!!m,x._close=!m||m===2&&!!y,a(g)}}}class MT{constructor(){this.map=[]}add(t,n,r){IT(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[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 o of i)t.push(o);i=r.pop()}this.map.length=0}}function IT(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 OT(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 o=r.length-1;r[o]=r[o]==="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 PT(){return{flow:{null:{name:"table",tokenize:DT,resolveAll:LT}}}}function DT(e,t,n){const r=this;let i=0,o=0,s;return a;function a(b){let R=r.events.length-1;for(;R>-1;){const j=r.events[R][1].type;if(j==="lineEnding"||j==="linePrefix")R--;else break}const O=R>-1?r.events[R][1].type:null,L=O==="tableHead"||O==="tableRow"?C:l;return L===C&&r.parser.lazy[r.now().line]?n(b):L(b)}function l(b){return e.enter("tableHead"),e.enter("tableRow"),c(b)}function c(b){return b===124||(s=!0,o+=1),u(b)}function u(b){return b===null?n(b):be(b)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):n(b):Pe(b)?Fe(e,u,"whitespace")(b):(o+=1,s&&(s=!1,i+=1),b===124?(e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),s=!0,u):(e.enter("data"),d(b)))}function d(b){return b===null||b===124||tt(b)?(e.exit("data"),u(b)):(e.consume(b),b===92?f:d)}function f(b){return b===92||b===124?(e.consume(b),d):d(b)}function p(b){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(b):(e.enter("tableDelimiterRow"),s=!1,Pe(b)?Fe(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):g(b))}function g(b){return b===45||b===58?x(b):b===124?(s=!0,e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),m):k(b)}function m(b){return Pe(b)?Fe(e,x,"whitespace")(b):x(b)}function x(b){return b===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(b),e.exit("tableDelimiterMarker"),y):b===45?(o+=1,y(b)):b===null||be(b)?_(b):k(b)}function y(b){return b===45?(e.enter("tableDelimiterFiller"),E(b)):k(b)}function E(b){return b===45?(e.consume(b),E):b===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(b),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(b))}function v(b){return Pe(b)?Fe(e,_,"whitespace")(b):_(b)}function _(b){return b===124?g(b):b===null||be(b)?!s||i!==o?k(b):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(b)):k(b)}function k(b){return n(b)}function C(b){return e.enter("tableRow"),M(b)}function M(b){return b===124?(e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),M):b===null||be(b)?(e.exit("tableRow"),t(b)):Pe(b)?Fe(e,M,"whitespace")(b):(e.enter("data"),N(b))}function N(b){return b===null||b===124||tt(b)?(e.exit("data"),M(b)):(e.consume(b),b===92?I:N)}function I(b){return b===92||b===124?(e.consume(b),N):N(b)}}function LT(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,c,u,d;const f=new MT;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(a=!1,l!==0&&(Sd(f,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(n,0,[["enter",c,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.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,s[2]===0&&(o[1]!==0&&(s[0]=s[1],d=ji(f,t,o,i,void 0,d),o=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],d=ji(f,t,o,i,void 0,d)),o=s,s=[o[1],n,0,0])):g.type==="tableHead"?(a=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],d=ji(f,t,o,i,n,d)):s[1]!==0&&(d=ji(f,t,s,i,n,d)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&Sd(f,t,l,c,u),f.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=OT(t.events,n))}return e}function ji(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},dr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=dr(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=dr(t.events,n[2]),u=dr(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 f=t.events[n[2]],p=t.events[n[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,m=n[3]-n[2]-1;e.add(g,m,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(o.end=Object.assign({},dr(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Sd(e,t,n,r,i){const o=[],s=dr(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function dr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const FT={name:"tasklistCheck",tokenize:jT};function BT(){return{text:{91:FT}}}function jT(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"),o)}function o(l){return tt(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return be(l)?t(l):Pe(l)?e.check({tokenize:$T},t,n)(l):n(l)}}function $T(e,t,n){return Fe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function VT(e){return _p([fT(),ET(),RT(e),PT(),BT()])}const zT={};function UT(e){const t=this,n=e||zT,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(VT(n)),o.push(lT()),s.push(cT(n))}const Cd=function(e,t,n){const r=xi(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]},Jn=function(e){if(e==null)return GT;if(typeof e=="string")return WT(e);if(typeof e=="object")return HT(e);if(typeof e=="function")return jl(e);throw new Error("Expected function, string, or array as `test`")};function HT(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Jn(e[n]);return jl(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function WT(e){return jl(t);function t(n){return n.tagName===e}}function jl(e){return t;function t(n,r,i){return!!(KT(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function GT(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function KT(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const _d=/\n/g,Td=/[\t ]+/g,Ia=Jn("br"),Nd=Jn(t1),qT=Jn("p"),Ad=Jn("tr"),YT=Jn(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",e1,n1]),gm=Jn(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function ZT(e,t){const n=t||{},r="children"in e?e.children:[],i=gm(e),o=xm(e,{whitespace:n.whitespace||"normal"}),s=[];(e.type==="text"||e.type==="comment")&&s.push(...ym(e,{breakBefore:!0,breakAfter:!0}));let a=-1;for(;++a<r.length;)s.push(...bm(r[a],e,{whitespace:o,breakBefore:a?void 0:i,breakAfter:a<r.length-1?Ia(r[a+1]):i}));const l=[];let c;for(a=-1;++a<s.length;){const u=s[a];typeof u=="number"?c!==void 0&&u>c&&(c=u):u&&(c!==void 0&&c>-1&&l.push(`
58
+ `.repeat(c)||" "),c=-1,l.push(u))}return l.join("")}function bm(e,t,n){return e.type==="element"?XT(e,t,n):e.type==="text"?n.whitespace==="normal"?ym(e,n):QT(e):[]}function XT(e,t,n){const r=xm(e,n),i=e.children||[];let o=-1,s=[];if(YT(e))return s;let a,l;for(Ia(e)||Ad(e)&&Cd(t,e,Ad)?l=`
59
+ `:qT(e)?(a=2,l=2):gm(e)&&(a=1,l=1);++o<i.length;)s=s.concat(bm(i[o],e,{whitespace:r,breakBefore:o?void 0:a,breakAfter:o<i.length-1?Ia(i[o+1]):l}));return Nd(e)&&Cd(t,e,Nd)&&s.push(" "),a&&s.unshift(a),l&&s.push(l),s}function ym(e,t){const n=String(e.value),r=[],i=[];let o=0;for(;o<=n.length;){_d.lastIndex=o;const l=_d.exec(n),c=l&&"index"in l?l.index:n.length;r.push(JT(n.slice(o,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,c===n.length?t.breakAfter:!0)),o=c+1}let s=-1,a;for(;++s<r.length;)r[s].charCodeAt(r[s].length-1)===8203||s<r.length-1&&r[s+1].charCodeAt(0)===8203?(i.push(r[s]),a=void 0):r[s]?(typeof a=="number"&&i.push(a),i.push(r[s]),a=0):(s===0||s===r.length-1)&&i.push(0);return i}function QT(e){return[String(e.value)]}function JT(e,t,n){const r=[];let i=0,o;for(;i<e.length;){Td.lastIndex=i;const s=Td.exec(e);o=s?s.index:e.length,!i&&!o&&s&&!t&&r.push(""),i!==o&&r.push(e.slice(i,o)),i=s?o+s[0].length:o}return i!==o&&!n&&r.push(""),r.join(" ")}function xm(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function e1(e){return!!(e.properties||{}).hidden}function t1(e){return e.tagName==="td"||e.tagName==="th"}function n1(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function r1(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],x=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:x},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},C=[k,d,a,n,e.C_BLOCK_COMMENT_MODE,u,c],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:C.concat([{begin:/\(/,end:/\)/,keywords:_,contains:C.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(M,N,k,C,[d,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:_,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function i1(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=r1(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function o1(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(a);const l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],x=["true","false"],y={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],v=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],_=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:x,built_in:[...E,...v,"set","shopt",..._,...k]},contains:[p,e.SHEBANG(),g,d,o,s,y,a,l,c,u,n]}}function s1(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",x={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[d,a,n,e.C_BLOCK_COMMENT_MODE,u,c],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:y.concat([{begin:/\(/,end:/\)/,keywords:x,contains:y.concat(["self"]),relevance:0}]),relevance:0},v={begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:x,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:x,disableAutodetect:!0,illegal:"</",contains:[].concat(E,v,y,[d,{begin:e.IDENT_RE+"::",keywords:x},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:d,strings:c,keywords:x}}}function a1(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],x=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:x},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},C=[k,d,a,n,e.C_BLOCK_COMMENT_MODE,u,c],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:C.concat([{begin:/\(/,end:/\)/,keywords:_,contains:C.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(M,N,k,C,[d,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:_,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function l1(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:t,literal:r},a=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},u={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},d=e.inherit(u,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:s},p=e.inherit(f,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},x=e.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});f.contains=[m,g,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],p.contains=[x,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[c,m,g,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},v=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+v+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,E],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[y,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const c1=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),u1=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],d1=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],f1=[...u1,...d1],h1=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),p1=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),m1=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),g1=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function b1(e){const t=e.regex,n=c1(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+p1.join("|")+")"},{begin:":(:)?("+m1.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+g1.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:h1.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+f1.join("|")+")\\b"}]}}function y1(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function x1(e){const o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,illegal:/["']/}]}]}}function w1(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function v1(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,o,i,s,n,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,u=/'[^']*'/,d=t.either(l,c,u),f=t.concat(d,"(\\s*\\.\\s*",d,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:f,className:"attr",starts:{end:/$/,contains:[r,a,o,i,s,n]}}]}}var fr="[0-9](_*[0-9])*",$i=`\\.(${fr})`,Vi="[0-9a-fA-F](_*[0-9a-fA-F])*",Rd={className:"number",variants:[{begin:`(\\b(${fr})((${$i})|\\.)?|(${$i}))[eE][+-]?(${fr})[fFdD]?\\b`},{begin:`\\b(${fr})((${$i})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${$i})[fFdD]?\\b`},{begin:`\\b(${fr})[fFdD]\\b`},{begin:`\\b0[xX]((${Vi})\\.?|(${Vi})?\\.(${Vi}))[pP][+-]?(${fr})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Vi})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function wm(e,t,n){return n===-1?"":e.replace(t,r=>wm(e,t,n-1))}function E1(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+wm("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Rd,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Rd,c]}}const Md="[A-Za-z$_][0-9A-Za-z$_]*",k1=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],S1=["true","false","null","undefined","NaN","Infinity"],vm=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Em=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],km=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],C1=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],_1=[].concat(km,vm,Em);function T1(e){const t=e.regex,n=(P,{after:W})=>{const w="</"+P[0].slice(1);return P.input.indexOf(w,W)!==-1},r=Md,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,W)=>{const w=P[0].length+P.index,V=P.input[w];if(V==="<"||V===","){W.ignoreMatch();return}V===">"&&(n(P,{after:w})||W.ignoreMatch());let Y;const S=P.input.substring(w);if(Y=S.match(/^\s*=/)){W.ignoreMatch();return}if((Y=S.match(/^\s+extends\s+/))&&Y.index===0){W.ignoreMatch();return}}},a={$pattern:Md,keyword:k1,literal:S1,built_in:_1,"variable.language":C1},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},x={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,x,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(v)});const _=[].concat(E,f.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(_)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:k},M={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...vm,...Em]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},b={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function O(P){return t.concat("(?!",P.join("|"),")")}const L={match:t.concat(/\b/,O([...km,"super","import"].map(P=>`${P}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},ie="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ee={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ie)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,x,E,{match:/\$\d+/},d,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},ee,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:ie,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},b,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},j,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},L,R,M,H,{match:/\$[(.]/}]}}function N1(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var hr="[0-9](_*[0-9])*",zi=`\\.(${hr})`,Ui="[0-9a-fA-F](_*[0-9a-fA-F])*",A1={className:"number",variants:[{begin:`(\\b(${hr})((${zi})|\\.)?|(${zi}))[eE][+-]?(${hr})[fFdD]?\\b`},{begin:`\\b(${hr})((${zi})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${zi})[fFdD]?\\b`},{begin:`\\b(${hr})[fFdD]\\b`},{begin:`\\b0[xX]((${Ui})\\.?|(${Ui})?\\.(${Ui}))[pP][+-]?(${hr})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ui})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function R1(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);const a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(s,{className:"string"}),"self"]}]},c=A1,u=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,u,n,r,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,a,l,s,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
60
+ `},c]}}const M1=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),I1=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],O1=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],P1=[...I1,...O1],D1=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Sm=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Cm=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),L1=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),F1=Sm.concat(Cm).sort().reverse();function B1(e){const t=M1(e),n=F1,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],a=[],l=function(v){return{className:"string",begin:"~?"+v+".*?"+v}},c=function(v,_,k){return{className:v,begin:_,relevance:k}},u={$pattern:/[a-z-]+/,keyword:r,attribute:D1.join(" ")},d={begin:"\\(",end:"\\)",contains:a,keywords:u,relevance:0};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,d,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const f=a.concat({begin:/\{/,end:/\}/,contains:s}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},g={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+L1.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:a,relevance:0}},x={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+P1.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",o,0),c("selector-id","#"+o),c("selector-class","\\."+o,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Sm.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Cm.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},t.FUNCTION_DISPATCH]},E={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,x,E,g,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function j1(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function $1(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},i={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},s={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,i,o,s]}}function V1(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=e.inherit(c,{contains:[]}),f=e.inherit(u,{contains:[]});c.contains.push(f),u.contains.push(d);let p=[n,l];return[c,u,d,f].forEach(y=>{y.contains=y.contains.concat(p)}),p=p.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,o,c,u,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,l,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function z1(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function U1(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,o,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(m,x,y="\\1")=>{const E=y==="\\1"?y:t.concat(y,x);return t.concat(t.concat("(?:",m,")"),x,/(?:\\.|[^\\\/])*?/,E,/(?:\\.|[^\\\/])*?/,y,r)},p=(m,x,y)=>t.concat(t.concat("(?:",m,")"),x,/(?:\\.|[^\\\/])*?/,y,r),g=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",t.either(...d,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...d,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=g,s.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:g}}function H1(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=t.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(j,H)=>{H.data._beginMatch=j[1]||j[2]},"on:end":(j,H)=>{H.data._beginMatch!==j[1]&&H.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
61
+ ]`,g={scope:"string",variants:[u,c,d,f]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},x=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],E=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],_={keyword:y,literal:(j=>{const H=[];return j.forEach(ie=>{H.push(ie),ie.toLowerCase()===ie?H.push(ie.toUpperCase()):H.push(ie.toLowerCase())}),H})(x),built_in:E},k=j=>j.map(H=>H.replace(/\|\d+$/,"")),C={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",k(E).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},M=t.concat(r,"\\b(?!\\()"),N={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),M],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),M],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},I={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},b={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[I,s,N,e.C_BLOCK_COMMENT_MODE,g,m,C]},R={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(E).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[b]};b.contains.push(R);const O=[I,N,e.C_BLOCK_COMMENT_MODE,g,m,C],L={begin:t.concat(/#\[\s*\\?/,t.either(i,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:x,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:x,keyword:["new","array"]},contains:["self",...O]},...O,{scope:"meta",variants:[{match:i},{match:o}]}]};return{case_insensitive:!1,keywords:_,contains:[L,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},s,R,N,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},C,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:_,contains:["self",L,s,N,e.C_BLOCK_COMMENT_MODE,g,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,m]}}function W1(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function G1(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function K1(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},u={begin:/\{\{/,relevance:0},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,u,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",p=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,g=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${p}))[eE][+-]?(${f})[jJ]?(?=${g})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${f})[jJ](?=${g})`}]},x={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,m,d,e.HASH_COMMENT_MODE]}]};return c.contains=[d,m,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,x,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,y,d]}]}}function q1(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Y1(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Z1(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:s},d={className:"string",contains:[e.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,u]})]}]},f="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},C=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);u.contains=C,m.contains=C;const b=[{begin:/^\s*=>/,starts:{end:"$",contains:C}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:C}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(b).concat(c).concat(C)}}function X1(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:u,keyword:a,literal:l,built_in:c},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:u}},{className:"punctuation",begin:"->"},o]}}const Q1=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),J1=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],eN=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],tN=[...J1,...eN],nN=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),rN=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),iN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),oN=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function sN(e){const t=Q1(e),n=iN,r=rN,i="@[a-z-]+",o="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+tN.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+oN.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:nN.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function aN(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function lN(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=u,g=[...c,...l].filter(k=>!u.includes(k)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},x={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function E(k){return t.concat(/\b/,t.either(...k.map(C=>C.replace(/\s+/,"\\s+"))),/\b/)}const v={scope:"keyword",match:E(f),relevance:0};function _(k,{exceptions:C,when:M}={}){const N=M;return C=C||[],k.map(I=>I.match(/\|\d+$/)||C.includes(I)?I:N(I)?`${I}|0`:I)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(g,{when:k=>k.length<3}),literal:o,type:a,built_in:d},contains:[{scope:"type",match:E(s)},v,y,m,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,x]}}function _m(e){return e?typeof e=="string"?e:e.source:null}function Ur(e){return Xe("(?=",e,")")}function Xe(...e){return e.map(n=>_m(n)).join("")}function cN(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Ot(...e){return"("+(cN(e).capture?"":"?:")+e.map(r=>_m(r)).join("|")+")"}const $l=e=>Xe(/\b/,e,/\w$/.test(e)?/\b/:/\B/),uN=["Protocol","Type"].map($l),Id=["init","self"].map($l),dN=["Any","Self"],Ps=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Od=["false","nil","true"],fN=["assignment","associativity","higherThan","left","lowerThan","none","right"],hN=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Pd=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Tm=Ot(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Nm=Ot(Tm,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Ds=Xe(Tm,Nm,"*"),Am=Ot(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),yo=Ot(Am,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),an=Xe(Am,yo,"*"),Hi=Xe(/[A-Z]/,yo,"*"),pN=["attached","autoclosure",Xe(/convention\(/,Ot("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Xe(/objc\(/,an,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],mN=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function gN(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Ot(...uN,...Id)],className:{2:"keyword"}},o={match:Xe(/\./,Ot(...Ps)),relevance:0},s=Ps.filter(me=>typeof me=="string").concat(["_|0"]),a=Ps.filter(me=>typeof me!="string").concat(dN).map($l),l={variants:[{className:"keyword",match:Ot(...a,...Id)}]},c={$pattern:Ot(/\b\w+/,/#\w+/),keyword:s.concat(hN),literal:Od},u=[i,o,l],d={match:Xe(/\./,Ot(...Pd)),relevance:0},f={className:"built_in",match:Xe(/\b/,Ot(...Pd),/(?=\()/)},p=[d,f],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:Ds},{match:`\\.(\\.|${Nm})+`}]},x=[g,m],y="([0-9]_*)+",E="([0-9a-fA-F]_*)+",v={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${E})(\\.(${E}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(me="")=>({className:"subst",variants:[{match:Xe(/\\/,me,/[0\\tnr"']/)},{match:Xe(/\\/,me,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(me="")=>({className:"subst",match:Xe(/\\/,me,/[\t ]*(?:[\r\n]|\r\n)/)}),C=(me="")=>({className:"subst",label:"interpol",begin:Xe(/\\/,me,/\(/),end:/\)/}),M=(me="")=>({begin:Xe(me,/"""/),end:Xe(/"""/,me),contains:[_(me),k(me),C(me)]}),N=(me="")=>({begin:Xe(me,/"/),end:Xe(/"/,me),contains:[_(me),C(me)]}),I={className:"string",variants:[M(),M("#"),M("##"),M("###"),N(),N("#"),N("##"),N("###")]},b=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],R={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:b},O=me=>{const ge=Xe(me,/\//),Ee=Xe(/\//,me);return{begin:ge,end:Ee,contains:[...b,{scope:"comment",begin:`#(?!.*${Ee})`,end:/$/}]}},L={scope:"regexp",variants:[O("###"),O("##"),O("#"),R]},j={match:Xe(/`/,an,/`/)},H={className:"variable",match:/\$\d+/},ie={className:"variable",match:`\\$${yo}+`},ee=[j,H,ie],P={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:mN,contains:[...x,v,I]}]}},W={scope:"keyword",match:Xe(/@/,Ot(...pN),Ur(Ot(/\(/,/\s+/)))},w={scope:"meta",match:Xe(/@/,an)},V=[P,W,w],Y={match:Ur(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Xe(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,yo,"+")},{className:"type",match:Hi,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Xe(/\s+&\s+/,Ur(Hi)),relevance:0}]},S={begin:/</,end:/>/,keywords:c,contains:[...r,...u,...V,g,Y]};Y.contains.push(S);const $={match:Xe(an,/\s*:/),keywords:"_|0",relevance:0},q={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",$,...r,L,...u,...p,...x,v,I,...ee,...V,Y]},B={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,Y]},Q={begin:Ot(Ur(Xe(an,/\s*:/)),Ur(Xe(an,/\s+/,an,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:an}]},te={begin:/\(/,end:/\)/,keywords:c,contains:[Q,...r,...u,...x,v,I,...V,Y,q],endsParent:!0,illegal:/["']/},ae={match:[/(func|macro)/,/\s+/,Ot(j.match,an,Ds)],className:{1:"keyword",3:"title.function"},contains:[B,te,t],illegal:[/\[/,/%/]},de={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[B,te,t],illegal:/\[|%/},De={match:[/operator/,/\s+/,Ds],className:{1:"keyword",3:"title"}},U={begin:[/precedencegroup/,/\s+/,Hi],className:{1:"keyword",3:"title"},contains:[Y],keywords:[...fN,...Od],end:/}/},Ce={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},K={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ye={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,an,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[B,...u,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:Hi},...u],relevance:0}]};for(const me of I.variants){const ge=me.contains.find(Te=>Te.label==="interpol");ge.keywords=c;const Ee=[...u,...p,...x,v,I,...ee];ge.contains=[...Ee,{begin:/\(/,end:/\)/,contains:["self",...Ee]}]}return{name:"Swift",keywords:c,contains:[...r,ae,de,Ce,K,ye,De,U,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},L,...u,...p,...x,v,I,...ee,...V,Y,q]}}const xo="[A-Za-z$_][0-9A-Za-z$_]*",Rm=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Mm=["true","false","null","undefined","NaN","Infinity"],Im=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Om=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Pm=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Dm=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Lm=[].concat(Pm,Im,Om);function bN(e){const t=e.regex,n=(P,{after:W})=>{const w="</"+P[0].slice(1);return P.input.indexOf(w,W)!==-1},r=xo,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,W)=>{const w=P[0].length+P.index,V=P.input[w];if(V==="<"||V===","){W.ignoreMatch();return}V===">"&&(n(P,{after:w})||W.ignoreMatch());let Y;const S=P.input.substring(w);if(Y=S.match(/^\s*=/)){W.ignoreMatch();return}if((Y=S.match(/^\s+extends\s+/))&&Y.index===0){W.ignoreMatch();return}}},a={$pattern:xo,keyword:Rm,literal:Mm,built_in:Lm,"variable.language":Dm},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},x={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,x,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(v)});const _=[].concat(E,f.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(_)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:k},M={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Im,...Om]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},b={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function O(P){return t.concat("(?!",P.join("|"),")")}const L={match:t.concat(/\b/,O([...Pm,"super","import"].map(P=>`${P}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},ie="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ee={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ie)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,x,E,{match:/\$\d+/},d,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},ee,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:ie,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},b,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},j,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},L,R,M,H,{match:/\$[(.]/}]}}function yN(e){const t=e.regex,n=bN(e),r=xo,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:xo,keyword:Rm.concat(l),literal:Mm,built_in:Lm.concat(i),"variable.language":Dm},u={className:"meta",begin:"@"+r},d=(m,x,y)=>{const E=m.contains.findIndex(v=>v.label===x);if(E===-1)throw new Error("can not find mode to replace");m.contains.splice(E,1,y)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(u);const f=n.contains.find(m=>m.scope==="attr"),p=Object.assign({},f,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,f,p]),n.contains=n.contains.concat([u,o,s,p]),d(n,"shebang",e.SHEBANG()),d(n,"use_strict",a);const g=n.contains.find(m=>m.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function xN(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,i),/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,t.either(o,i),/ +/,t.either(s,a),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,c,u,d,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function wN(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,e.QUOTE_STRING_MODE,l,c,a]}}function vN(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(o,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,l,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,s,l,a]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function EN(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},a=e.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},x=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},f,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,m,o,s],y=[...x];return y.pop(),y.push(a),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:x}}const kN={arduino:i1,bash:o1,c:s1,cpp:a1,csharp:l1,css:b1,diff:y1,go:x1,graphql:w1,ini:v1,java:E1,javascript:T1,json:N1,kotlin:R1,less:B1,lua:j1,makefile:$1,markdown:V1,objectivec:z1,perl:U1,php:H1,"php-template":W1,plaintext:G1,python:K1,"python-repl":q1,r:Y1,ruby:Z1,rust:X1,scss:sN,shell:aN,sql:lN,swift:gN,typescript:yN,vbnet:xN,wasm:wN,xml:vN,yaml:EN};var Ls,Dd;function SN(){if(Dd)return Ls;Dd=1;function e(T){return T instanceof Map?T.clear=T.delete=T.set=function(){throw new Error("map is read-only")}:T instanceof Set&&(T.add=T.clear=T.delete=function(){throw new Error("set is read-only")}),Object.freeze(T),Object.getOwnPropertyNames(T).forEach(G=>{const re=T[G],Se=typeof re;(Se==="object"||Se==="function")&&!Object.isFrozen(re)&&e(re)}),T}class t{constructor(G){G.data===void 0&&(G.data={}),this.data=G.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(T){return T.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function r(T,...G){const re=Object.create(null);for(const Se in T)re[Se]=T[Se];return G.forEach(function(Se){for(const ht in Se)re[ht]=Se[ht]}),re}const i="</span>",o=T=>!!T.scope,s=(T,{prefix:G})=>{if(T.startsWith("language:"))return T.replace("language:","language-");if(T.includes(".")){const re=T.split(".");return[`${G}${re.shift()}`,...re.map((Se,ht)=>`${Se}${"_".repeat(ht+1)}`)].join(" ")}return`${G}${T}`};class a{constructor(G,re){this.buffer="",this.classPrefix=re.classPrefix,G.walk(this)}addText(G){this.buffer+=n(G)}openNode(G){if(!o(G))return;const re=s(G.scope,{prefix:this.classPrefix});this.span(re)}closeNode(G){o(G)&&(this.buffer+=i)}value(){return this.buffer}span(G){this.buffer+=`<span class="${G}">`}}const l=(T={})=>{const G={children:[]};return Object.assign(G,T),G};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(G){this.top.children.push(G)}openNode(G){const re=l({scope:G});this.add(re),this.stack.push(re)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(G){return this.constructor._walk(G,this.rootNode)}static _walk(G,re){return typeof re=="string"?G.addText(re):re.children&&(G.openNode(re),re.children.forEach(Se=>this._walk(G,Se)),G.closeNode(re)),G}static _collapse(G){typeof G!="string"&&G.children&&(G.children.every(re=>typeof re=="string")?G.children=[G.children.join("")]:G.children.forEach(re=>{c._collapse(re)}))}}class u extends c{constructor(G){super(),this.options=G}addText(G){G!==""&&this.add(G)}startScope(G){this.openNode(G)}endScope(){this.closeNode()}__addSublanguage(G,re){const Se=G.root;re&&(Se.scope=`language:${re}`),this.add(Se)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(T){return T?typeof T=="string"?T:T.source:null}function f(T){return m("(?=",T,")")}function p(T){return m("(?:",T,")*")}function g(T){return m("(?:",T,")?")}function m(...T){return T.map(re=>d(re)).join("")}function x(T){const G=T[T.length-1];return typeof G=="object"&&G.constructor===Object?(T.splice(T.length-1,1),G):{}}function y(...T){return"("+(x(T).capture?"":"?:")+T.map(Se=>d(Se)).join("|")+")"}function E(T){return new RegExp(T.toString()+"|").exec("").length-1}function v(T,G){const re=T&&T.exec(G);return re&&re.index===0}const _=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function k(T,{joinWith:G}){let re=0;return T.map(Se=>{re+=1;const ht=re;let pt=d(Se),fe="";for(;pt.length>0;){const le=_.exec(pt);if(!le){fe+=pt;break}fe+=pt.substring(0,le.index),pt=pt.substring(le.index+le[0].length),le[0][0]==="\\"&&le[1]?fe+="\\"+String(Number(le[1])+ht):(fe+=le[0],le[0]==="("&&re++)}return fe}).map(Se=>`(${Se})`).join(G)}const C=/\b\B/,M="[a-zA-Z]\\w*",N="[a-zA-Z_]\\w*",I="\\b\\d+(\\.\\d+)?",b="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",R="\\b(0b[01]+)",O="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",L=(T={})=>{const G=/^#![ ]*\//;return T.binary&&(T.begin=m(G,/.*\b/,T.binary,/\b.*/)),r({scope:"meta",begin:G,end:/$/,relevance:0,"on:begin":(re,Se)=>{re.index!==0&&Se.ignoreMatch()}},T)},j={begin:"\\\\[\\s\\S]",relevance:0},H={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[j]},ie={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[j]},ee={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},P=function(T,G,re={}){const Se=r({scope:"comment",begin:T,end:G,contains:[]},re);Se.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const ht=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Se.contains.push({begin:m(/[ ]+/,"(",ht,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Se},W=P("//","$"),w=P("/\\*","\\*/"),V=P("#","$"),Y={scope:"number",begin:I,relevance:0},S={scope:"number",begin:b,relevance:0},$={scope:"number",begin:R,relevance:0},q={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[j,{begin:/\[/,end:/\]/,relevance:0,contains:[j]}]},B={scope:"title",begin:M,relevance:0},Q={scope:"title",begin:N,relevance:0},te={begin:"\\.\\s*"+N,relevance:0};var de=Object.freeze({__proto__:null,APOS_STRING_MODE:H,BACKSLASH_ESCAPE:j,BINARY_NUMBER_MODE:$,BINARY_NUMBER_RE:R,COMMENT:P,C_BLOCK_COMMENT_MODE:w,C_LINE_COMMENT_MODE:W,C_NUMBER_MODE:S,C_NUMBER_RE:b,END_SAME_AS_BEGIN:function(T){return Object.assign(T,{"on:begin":(G,re)=>{re.data._beginMatch=G[1]},"on:end":(G,re)=>{re.data._beginMatch!==G[1]&&re.ignoreMatch()}})},HASH_COMMENT_MODE:V,IDENT_RE:M,MATCH_NOTHING_RE:C,METHOD_GUARD:te,NUMBER_MODE:Y,NUMBER_RE:I,PHRASAL_WORDS_MODE:ee,QUOTE_STRING_MODE:ie,REGEXP_MODE:q,RE_STARTERS_RE:O,SHEBANG:L,TITLE_MODE:B,UNDERSCORE_IDENT_RE:N,UNDERSCORE_TITLE_MODE:Q});function De(T,G){T.input[T.index-1]==="."&&G.ignoreMatch()}function U(T,G){T.className!==void 0&&(T.scope=T.className,delete T.className)}function Ce(T,G){G&&T.beginKeywords&&(T.begin="\\b("+T.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",T.__beforeBegin=De,T.keywords=T.keywords||T.beginKeywords,delete T.beginKeywords,T.relevance===void 0&&(T.relevance=0))}function K(T,G){Array.isArray(T.illegal)&&(T.illegal=y(...T.illegal))}function ye(T,G){if(T.match){if(T.begin||T.end)throw new Error("begin & end are not supported with match");T.begin=T.match,delete T.match}}function me(T,G){T.relevance===void 0&&(T.relevance=1)}const ge=(T,G)=>{if(!T.beforeMatch)return;if(T.starts)throw new Error("beforeMatch cannot be used with starts");const re=Object.assign({},T);Object.keys(T).forEach(Se=>{delete T[Se]}),T.keywords=re.keywords,T.begin=m(re.beforeMatch,f(re.begin)),T.starts={relevance:0,contains:[Object.assign(re,{endsParent:!0})]},T.relevance=0,delete re.beforeMatch},Ee=["of","and","for","in","not","or","if","then","parent","list","value"],Te="keyword";function Ne(T,G,re=Te){const Se=Object.create(null);return typeof T=="string"?ht(re,T.split(" ")):Array.isArray(T)?ht(re,T):Object.keys(T).forEach(function(pt){Object.assign(Se,Ne(T[pt],G,pt))}),Se;function ht(pt,fe){G&&(fe=fe.map(le=>le.toLowerCase())),fe.forEach(function(le){const ke=le.split("|");Se[ke[0]]=[pt,we(ke[0],ke[1])]})}}function we(T,G){return G?Number(G):ot(T)?0:1}function ot(T){return Ee.includes(T.toLowerCase())}const vt={},He=T=>{console.error(T)},bt=(T,...G)=>{console.log(`WARN: ${T}`,...G)},F=(T,G)=>{vt[`${T}/${G}`]||(console.log(`Deprecated as of ${T}. ${G}`),vt[`${T}/${G}`]=!0)},Z=new Error;function xe(T,G,{key:re}){let Se=0;const ht=T[re],pt={},fe={};for(let le=1;le<=G.length;le++)fe[le+Se]=ht[le],pt[le+Se]=!0,Se+=E(G[le-1]);T[re]=fe,T[re]._emit=pt,T[re]._multi=!0}function Ae(T){if(Array.isArray(T.begin)){if(T.skip||T.excludeBegin||T.returnBegin)throw He("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Z;if(typeof T.beginScope!="object"||T.beginScope===null)throw He("beginScope must be object"),Z;xe(T,T.begin,{key:"beginScope"}),T.begin=k(T.begin,{joinWith:""})}}function Be(T){if(Array.isArray(T.end)){if(T.skip||T.excludeEnd||T.returnEnd)throw He("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Z;if(typeof T.endScope!="object"||T.endScope===null)throw He("endScope must be object"),Z;xe(T,T.end,{key:"endScope"}),T.end=k(T.end,{joinWith:""})}}function ne(T){T.scope&&typeof T.scope=="object"&&T.scope!==null&&(T.beginScope=T.scope,delete T.scope)}function $e(T){ne(T),typeof T.beginScope=="string"&&(T.beginScope={_wrap:T.beginScope}),typeof T.endScope=="string"&&(T.endScope={_wrap:T.endScope}),Ae(T),Be(T)}function Ve(T){function G(fe,le){return new RegExp(d(fe),"m"+(T.case_insensitive?"i":"")+(T.unicodeRegex?"u":"")+(le?"g":""))}class re{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(le,ke){ke.position=this.position++,this.matchIndexes[this.matchAt]=ke,this.regexes.push([ke,le]),this.matchAt+=E(le)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const le=this.regexes.map(ke=>ke[1]);this.matcherRe=G(k(le,{joinWith:"|"}),!0),this.lastIndex=0}exec(le){this.matcherRe.lastIndex=this.lastIndex;const ke=this.matcherRe.exec(le);if(!ke)return null;const St=ke.findIndex((Lr,qo)=>qo>0&&Lr!==void 0),yt=this.matchIndexes[St];return ke.splice(0,St),Object.assign(ke,yt)}}class Se{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(le){if(this.multiRegexes[le])return this.multiRegexes[le];const ke=new re;return this.rules.slice(le).forEach(([St,yt])=>ke.addRule(St,yt)),ke.compile(),this.multiRegexes[le]=ke,ke}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(le,ke){this.rules.push([le,ke]),ke.type==="begin"&&this.count++}exec(le){const ke=this.getMatcher(this.regexIndex);ke.lastIndex=this.lastIndex;let St=ke.exec(le);if(this.resumingScanAtSamePosition()&&!(St&&St.index===this.lastIndex)){const yt=this.getMatcher(0);yt.lastIndex=this.lastIndex+1,St=yt.exec(le)}return St&&(this.regexIndex+=St.position+1,this.regexIndex===this.count&&this.considerAll()),St}}function ht(fe){const le=new Se;return fe.contains.forEach(ke=>le.addRule(ke.begin,{rule:ke,type:"begin"})),fe.terminatorEnd&&le.addRule(fe.terminatorEnd,{type:"end"}),fe.illegal&&le.addRule(fe.illegal,{type:"illegal"}),le}function pt(fe,le){const ke=fe;if(fe.isCompiled)return ke;[U,ye,$e,ge].forEach(yt=>yt(fe,le)),T.compilerExtensions.forEach(yt=>yt(fe,le)),fe.__beforeBegin=null,[Ce,K,me].forEach(yt=>yt(fe,le)),fe.isCompiled=!0;let St=null;return typeof fe.keywords=="object"&&fe.keywords.$pattern&&(fe.keywords=Object.assign({},fe.keywords),St=fe.keywords.$pattern,delete fe.keywords.$pattern),St=St||/\w+/,fe.keywords&&(fe.keywords=Ne(fe.keywords,T.case_insensitive)),ke.keywordPatternRe=G(St,!0),le&&(fe.begin||(fe.begin=/\B|\b/),ke.beginRe=G(ke.begin),!fe.end&&!fe.endsWithParent&&(fe.end=/\B|\b/),fe.end&&(ke.endRe=G(ke.end)),ke.terminatorEnd=d(ke.end)||"",fe.endsWithParent&&le.terminatorEnd&&(ke.terminatorEnd+=(fe.end?"|":"")+le.terminatorEnd)),fe.illegal&&(ke.illegalRe=G(fe.illegal)),fe.contains||(fe.contains=[]),fe.contains=[].concat(...fe.contains.map(function(yt){return nn(yt==="self"?fe:yt)})),fe.contains.forEach(function(yt){pt(yt,ke)}),fe.starts&&pt(fe.starts,le),ke.matcher=ht(ke),ke}if(T.compilerExtensions||(T.compilerExtensions=[]),T.contains&&T.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return T.classNameAliases=r(T.classNameAliases||{}),pt(T)}function Ke(T){return T?T.endsWithParent||Ke(T.starts):!1}function nn(T){return T.variants&&!T.cachedVariants&&(T.cachedVariants=T.variants.map(function(G){return r(T,{variants:null},G)})),T.cachedVariants?T.cachedVariants:Ke(T)?r(T,{starts:T.starts?r(T.starts):null}):Object.isFrozen(T)?r(T):T}var It="11.11.1";class kn extends Error{constructor(G,re){super(G),this.name="HTMLInjectionError",this.html=re}}const $t=n,ic=r,oc=Symbol("nomatch"),Eg=7,sc=function(T){const G=Object.create(null),re=Object.create(null),Se=[];let ht=!0;const pt="Could not find the language '{}', did you forget to load/include a language module?",fe={disableAutodetect:!0,name:"Plain text",contains:[]};let le={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function ke(J){return le.noHighlightRe.test(J)}function St(J){let pe=J.className+" ";pe+=J.parentNode?J.parentNode.className:"";const Le=le.languageDetectRe.exec(pe);if(Le){const nt=Sn(Le[1]);return nt||(bt(pt.replace("{}",Le[1])),bt("Falling back to no-highlight mode for this block.",J)),nt?Le[1]:"no-highlight"}return pe.split(/\s+/).find(nt=>ke(nt)||Sn(nt))}function yt(J,pe,Le){let nt="",Et="";typeof pe=="object"?(nt=J,Le=pe.ignoreIllegals,Et=pe.language):(F("10.7.0","highlight(lang, code, ...args) has been deprecated."),F("10.7.0",`Please use highlight(code, options) instead.
62
+ https://github.com/highlightjs/highlight.js/issues/2277`),Et=J,nt=pe),Le===void 0&&(Le=!0);const Qt={code:nt,language:Et};_i("before:highlight",Qt);const Cn=Qt.result?Qt.result:Lr(Qt.language,Qt.code,Le);return Cn.code=Qt.code,_i("after:highlight",Cn),Cn}function Lr(J,pe,Le,nt){const Et=Object.create(null);function Qt(oe,he){return oe.keywords[he]}function Cn(){if(!_e.keywords){_t.addText(rt);return}let oe=0;_e.keywordPatternRe.lastIndex=0;let he=_e.keywordPatternRe.exec(rt),Ie="";for(;he;){Ie+=rt.substring(oe,he.index);const We=on.case_insensitive?he[0].toLowerCase():he[0],Nt=Qt(_e,We);if(Nt){const[hn,jg]=Nt;if(_t.addText(Ie),Ie="",Et[We]=(Et[We]||0)+1,Et[We]<=Eg&&(Ai+=jg),hn.startsWith("_"))Ie+=he[0];else{const $g=on.classNameAliases[hn]||hn;rn(he[0],$g)}}else Ie+=he[0];oe=_e.keywordPatternRe.lastIndex,he=_e.keywordPatternRe.exec(rt)}Ie+=rt.substring(oe),_t.addText(Ie)}function Ti(){if(rt==="")return;let oe=null;if(typeof _e.subLanguage=="string"){if(!G[_e.subLanguage]){_t.addText(rt);return}oe=Lr(_e.subLanguage,rt,!0,pc[_e.subLanguage]),pc[_e.subLanguage]=oe._top}else oe=Yo(rt,_e.subLanguage.length?_e.subLanguage:null);_e.relevance>0&&(Ai+=oe.relevance),_t.__addSublanguage(oe._emitter,oe.language)}function Vt(){_e.subLanguage!=null?Ti():Cn(),rt=""}function rn(oe,he){oe!==""&&(_t.startScope(he),_t.addText(oe),_t.endScope())}function uc(oe,he){let Ie=1;const We=he.length-1;for(;Ie<=We;){if(!oe._emit[Ie]){Ie++;continue}const Nt=on.classNameAliases[oe[Ie]]||oe[Ie],hn=he[Ie];Nt?rn(hn,Nt):(rt=hn,Cn(),rt=""),Ie++}}function dc(oe,he){return oe.scope&&typeof oe.scope=="string"&&_t.openNode(on.classNameAliases[oe.scope]||oe.scope),oe.beginScope&&(oe.beginScope._wrap?(rn(rt,on.classNameAliases[oe.beginScope._wrap]||oe.beginScope._wrap),rt=""):oe.beginScope._multi&&(uc(oe.beginScope,he),rt="")),_e=Object.create(oe,{parent:{value:_e}}),_e}function fc(oe,he,Ie){let We=v(oe.endRe,Ie);if(We){if(oe["on:end"]){const Nt=new t(oe);oe["on:end"](he,Nt),Nt.isMatchIgnored&&(We=!1)}if(We){for(;oe.endsParent&&oe.parent;)oe=oe.parent;return oe}}if(oe.endsWithParent)return fc(oe.parent,he,Ie)}function Pg(oe){return _e.matcher.regexIndex===0?(rt+=oe[0],1):(Jo=!0,0)}function Dg(oe){const he=oe[0],Ie=oe.rule,We=new t(Ie),Nt=[Ie.__beforeBegin,Ie["on:begin"]];for(const hn of Nt)if(hn&&(hn(oe,We),We.isMatchIgnored))return Pg(he);return Ie.skip?rt+=he:(Ie.excludeBegin&&(rt+=he),Vt(),!Ie.returnBegin&&!Ie.excludeBegin&&(rt=he)),dc(Ie,oe),Ie.returnBegin?0:he.length}function Lg(oe){const he=oe[0],Ie=pe.substring(oe.index),We=fc(_e,oe,Ie);if(!We)return oc;const Nt=_e;_e.endScope&&_e.endScope._wrap?(Vt(),rn(he,_e.endScope._wrap)):_e.endScope&&_e.endScope._multi?(Vt(),uc(_e.endScope,oe)):Nt.skip?rt+=he:(Nt.returnEnd||Nt.excludeEnd||(rt+=he),Vt(),Nt.excludeEnd&&(rt=he));do _e.scope&&_t.closeNode(),!_e.skip&&!_e.subLanguage&&(Ai+=_e.relevance),_e=_e.parent;while(_e!==We.parent);return We.starts&&dc(We.starts,oe),Nt.returnEnd?0:he.length}function Fg(){const oe=[];for(let he=_e;he!==on;he=he.parent)he.scope&&oe.unshift(he.scope);oe.forEach(he=>_t.openNode(he))}let Ni={};function hc(oe,he){const Ie=he&&he[0];if(rt+=oe,Ie==null)return Vt(),0;if(Ni.type==="begin"&&he.type==="end"&&Ni.index===he.index&&Ie===""){if(rt+=pe.slice(he.index,he.index+1),!ht){const We=new Error(`0 width match regex (${J})`);throw We.languageName=J,We.badRule=Ni.rule,We}return 1}if(Ni=he,he.type==="begin")return Dg(he);if(he.type==="illegal"&&!Le){const We=new Error('Illegal lexeme "'+Ie+'" for mode "'+(_e.scope||"<unnamed>")+'"');throw We.mode=_e,We}else if(he.type==="end"){const We=Lg(he);if(We!==oc)return We}if(he.type==="illegal"&&Ie==="")return rt+=`
63
+ `,1;if(Qo>1e5&&Qo>he.index*3)throw new Error("potential infinite loop, way more iterations than matches");return rt+=Ie,Ie.length}const on=Sn(J);if(!on)throw He(pt.replace("{}",J)),new Error('Unknown language: "'+J+'"');const Bg=Ve(on);let Xo="",_e=nt||Bg;const pc={},_t=new le.__emitter(le);Fg();let rt="",Ai=0,Bn=0,Qo=0,Jo=!1;try{if(on.__emitTokens)on.__emitTokens(pe,_t);else{for(_e.matcher.considerAll();;){Qo++,Jo?Jo=!1:_e.matcher.considerAll(),_e.matcher.lastIndex=Bn;const oe=_e.matcher.exec(pe);if(!oe)break;const he=pe.substring(Bn,oe.index),Ie=hc(he,oe);Bn=oe.index+Ie}hc(pe.substring(Bn))}return _t.finalize(),Xo=_t.toHTML(),{language:J,value:Xo,relevance:Ai,illegal:!1,_emitter:_t,_top:_e}}catch(oe){if(oe.message&&oe.message.includes("Illegal"))return{language:J,value:$t(pe),illegal:!0,relevance:0,_illegalBy:{message:oe.message,index:Bn,context:pe.slice(Bn-100,Bn+100),mode:oe.mode,resultSoFar:Xo},_emitter:_t};if(ht)return{language:J,value:$t(pe),illegal:!1,relevance:0,errorRaised:oe,_emitter:_t,_top:_e};throw oe}}function qo(J){const pe={value:$t(J),illegal:!1,relevance:0,_top:fe,_emitter:new le.__emitter(le)};return pe._emitter.addText(J),pe}function Yo(J,pe){pe=pe||le.languages||Object.keys(G);const Le=qo(J),nt=pe.filter(Sn).filter(cc).map(Vt=>Lr(Vt,J,!1));nt.unshift(Le);const Et=nt.sort((Vt,rn)=>{if(Vt.relevance!==rn.relevance)return rn.relevance-Vt.relevance;if(Vt.language&&rn.language){if(Sn(Vt.language).supersetOf===rn.language)return 1;if(Sn(rn.language).supersetOf===Vt.language)return-1}return 0}),[Qt,Cn]=Et,Ti=Qt;return Ti.secondBest=Cn,Ti}function kg(J,pe,Le){const nt=pe&&re[pe]||Le;J.classList.add("hljs"),J.classList.add(`language-${nt}`)}function Zo(J){let pe=null;const Le=St(J);if(ke(Le))return;if(_i("before:highlightElement",{el:J,language:Le}),J.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",J);return}if(J.children.length>0&&(le.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(J)),le.throwUnescapedHTML))throw new kn("One of your code blocks includes unescaped HTML.",J.innerHTML);pe=J;const nt=pe.textContent,Et=Le?yt(nt,{language:Le,ignoreIllegals:!0}):Yo(nt);J.innerHTML=Et.value,J.dataset.highlighted="yes",kg(J,Le,Et.language),J.result={language:Et.language,re:Et.relevance,relevance:Et.relevance},Et.secondBest&&(J.secondBest={language:Et.secondBest.language,relevance:Et.secondBest.relevance}),_i("after:highlightElement",{el:J,result:Et,text:nt})}function Sg(J){le=ic(le,J)}const Cg=()=>{Ci(),F("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function _g(){Ci(),F("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ac=!1;function Ci(){function J(){Ci()}if(document.readyState==="loading"){ac||window.addEventListener("DOMContentLoaded",J,!1),ac=!0;return}document.querySelectorAll(le.cssSelector).forEach(Zo)}function Tg(J,pe){let Le=null;try{Le=pe(T)}catch(nt){if(He("Language definition for '{}' could not be registered.".replace("{}",J)),ht)He(nt);else throw nt;Le=fe}Le.name||(Le.name=J),G[J]=Le,Le.rawDefinition=pe.bind(null,T),Le.aliases&&lc(Le.aliases,{languageName:J})}function Ng(J){delete G[J];for(const pe of Object.keys(re))re[pe]===J&&delete re[pe]}function Ag(){return Object.keys(G)}function Sn(J){return J=(J||"").toLowerCase(),G[J]||G[re[J]]}function lc(J,{languageName:pe}){typeof J=="string"&&(J=[J]),J.forEach(Le=>{re[Le.toLowerCase()]=pe})}function cc(J){const pe=Sn(J);return pe&&!pe.disableAutodetect}function Rg(J){J["before:highlightBlock"]&&!J["before:highlightElement"]&&(J["before:highlightElement"]=pe=>{J["before:highlightBlock"](Object.assign({block:pe.el},pe))}),J["after:highlightBlock"]&&!J["after:highlightElement"]&&(J["after:highlightElement"]=pe=>{J["after:highlightBlock"](Object.assign({block:pe.el},pe))})}function Mg(J){Rg(J),Se.push(J)}function Ig(J){const pe=Se.indexOf(J);pe!==-1&&Se.splice(pe,1)}function _i(J,pe){const Le=J;Se.forEach(function(nt){nt[Le]&&nt[Le](pe)})}function Og(J){return F("10.7.0","highlightBlock will be removed entirely in v12.0"),F("10.7.0","Please use highlightElement now."),Zo(J)}Object.assign(T,{highlight:yt,highlightAuto:Yo,highlightAll:Ci,highlightElement:Zo,highlightBlock:Og,configure:Sg,initHighlighting:Cg,initHighlightingOnLoad:_g,registerLanguage:Tg,unregisterLanguage:Ng,listLanguages:Ag,getLanguage:Sn,registerAliases:lc,autoDetection:cc,inherit:ic,addPlugin:Mg,removePlugin:Ig}),T.debugMode=function(){ht=!1},T.safeMode=function(){ht=!0},T.versionString=It,T.regex={concat:m,lookahead:f,either:y,optional:g,anyNumberOfTimes:p};for(const J in de)typeof de[J]=="object"&&e(de[J]);return Object.assign(T,de),T},tr=sc({});return tr.newInstance=()=>sc({}),Ls=tr,tr.HighlightJS=tr,tr.default=tr,Ls}var CN=SN();const _N=Ro(CN),Ld={},TN="hljs-";function NN(e){const t=_N.newInstance();return e&&o(e),{highlight:n,highlightAuto:r,listLanguages:i,register:o,registerAlias:s,registered:a};function n(l,c,u){const d=u||Ld,f=typeof d.prefix=="string"?d.prefix:TN;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:AN,classPrefix:f});const p=t.highlight(c,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const g=p._emitter.root,m=g.data;return m.language=p.language,m.relevance=p.relevance,g}function r(l,c){const d=(c||Ld).subset||i();let f=-1,p=0,g;for(;++f<d.length;){const m=d[f];if(!t.getLanguage(m))continue;const x=n(m,l,c);x.data&&x.data.relevance!==void 0&&x.data.relevance>p&&(p=x.data.relevance,g=x)}return g||{type:"root",children:[],data:{language:void 0,relevance:p}}}function i(){return t.listLanguages()}function o(l,c){if(typeof l=="string")t.registerLanguage(l,c);else{let u;for(u in l)Object.hasOwn(l,u)&&t.registerLanguage(u,l[u])}}function s(l,c){if(typeof l=="string")t.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else{let u;for(u in l)if(Object.hasOwn(l,u)){const d=l[u];t.registerAliases(typeof d=="string"?d:[...d],{languageName:u})}}}function a(l){return!!t.getLanguage(l)}}class AN{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=this,r=t.split(".").map(function(s,a){return a?s+"_".repeat(a):n.options.classPrefix+s}),i=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(o),this.stack.push(o)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const RN={};function MN(e){const t=e||RN,n=t.aliases,r=t.detect||!1,i=t.languages||kN,o=t.plainText,s=t.prefix,a=t.subset;let l="hljs";const c=NN(i);if(n&&c.registerAlias(n),s){const u=s.indexOf("-");l=u===-1?s:s.slice(0,u)}return function(u,d){Do(u,"element",function(f,p,g){if(f.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const m=IN(f);if(m===!1||!m&&!r||m&&o&&o.includes(m))return;Array.isArray(f.properties.className)||(f.properties.className=[]),f.properties.className.includes(l)||f.properties.className.unshift(l);const x=ZT(f,{whitespace:"pre"});let y;try{y=m?c.highlight(m,x,{prefix:s}):c.highlightAuto(x,{prefix:s,subset:a})}catch(E){const v=E;if(m&&/Unknown language/.test(v.message)){d.message("Cannot highlight as `"+m+"`, it’s not registered",{ancestors:[g,f],cause:v,place:f.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw v}!m&&y.data&&y.data.language&&f.properties.className.push("language-"+y.data.language),y.children.length>0&&(f.children=y.children)})}}function IN(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){const i=String(t[n]);if(i==="no-highlight"||i==="nohighlight")return!1;!r&&i.slice(0,5)==="lang-"&&(r=i.slice(5)),!r&&i.slice(0,9)==="language-"&&(r=i.slice(9))}return r}function ON({onSendMessage:e,onSendAttachments:t,disabled:n,theme:r,onEndChat:i,attachmentsEnabled:o=!0}){const[s,a]=D.useState(""),[l,c]=D.useState(!1),u=D.useRef(null),d=D.useRef(null),[f,p]=D.useState(!1),g=Ct(r);D.useEffect(()=>{const k=()=>{const C=navigator.userAgent.toLowerCase(),N=["android","iphone","ipad","mobile","tablet"].some(R=>C.includes(R)),I="ontouchstart"in window||navigator.maxTouchPoints>0,b=window.innerWidth<=768;p(N||I&&b)};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]);const m=k=>{k.preventDefault(),s.trim()&&!n&&(e(s.trim()),a(""))},x=k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),m(k))},y=k=>{const C=k.target.files;if(C&&C.length>0){const M=Array.from(C),N=M.filter(I=>I.type.startsWith("image/"));if(N.length===0){console.warn("No valid image files selected");return}N.length!==M.length&&console.warn("Some non-image files were filtered out"),t(N),u.current&&(u.current.value="")}},E=()=>{!n&&u.current&&u.current.click()},v=()=>{!n&&f&&d.current&&d.current.click()},_=k=>{const C=k.target.files;if(C&&C.length>0){const M=C[0];M.type.startsWith("image/")?t([M]):console.warn("Selected file is not an image"),d.current&&(d.current.value="")}};return h.jsx("div",{className:"px-4 py-3 !w-full backdrop-blur-xl border-0 shadow-lg ",children:h.jsx("form",{onSubmit:m,className:"flex items-center !w-full",children:h.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":g.chatInput.container}`,children:[o&&h.jsx(Me.button,{type:"button",onClick:E,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${g.chatInput.attachButton}`,disabled:n,"aria-label":"Attach file",children:h.jsx(Ge.Paperclip,{className:"w-4 h-4"})}),o&&f&&h.jsx(Me.button,{type:"button",onClick:v,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1 rounded-full transition-all duration-200 border-0 ${g.chatInput.attachButton}`,disabled:n,"aria-label":"Take photo",children:h.jsx(Ge.Camera,{className:"w-4 h-4"})}),o&&h.jsx("input",{ref:u,type:"file",multiple:!0,onChange:y,className:"hidden",accept:"image/*"}),o&&h.jsx("input",{ref:d,type:"file",onChange:_,className:"hidden",accept:"image/*",capture:"environment"}),h.jsx("textarea",{value:s,onChange:k=>a(k.target.value),onKeyDown:x,onFocus:()=>c(!0),onBlur:()=>c(!1),placeholder:"Type your message...",disabled:n,className:`flex-1 px-2 py-1 bg-transparent resize-none min-h-[32px] max-h-20 focus:outline-none text-sm border-0 ${g.chatInput.textarea}`,rows:1,style:{height:"auto",minHeight:"32px"},onInput:k=>{const C=k.target;C.style.height="auto",C.style.height=`${Math.min(C.scrollHeight,80)}px`}}),h.jsx(Me.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?g.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:h.jsx(Ge.SendHorizontal,{className:"w-4 h-4"})}),i&&h.jsx(Me.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 ${g.chatInput.endButton}`,"aria-label":"End chat",children:h.jsx(Ge.PhoneOff,{className:"w-4 h-4"})})]})})})}function PN({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[i,o]=D.useState(""),[s,a]=D.useState(0);return D.useEffect(()=>{if(n){o(e);return}if(t){o(e);return}if(s<e.length){const l=setTimeout(()=>{o(e.slice(0,s+1)),a(s+1)},r);return()=>clearTimeout(l)}},[e,s,t,r,n]),D.useEffect(()=>{n||(a(0),o(""))},[e,n]),h.jsxs("span",{className:"relative",children:[h.jsx("span",{className:"inline-block",children:i}),!t&&h.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(l=>h.jsx(Me.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 DN({message:e,theme:t,isOwn:n,isStreaming:r=!1}){var u,d,f,p;const i=Ct(t),o=e.sender.name?e.sender.name.split(" ").map(g=>g[0]).join("").toUpperCase().slice(0,2):"U",s=((u=e==null?void 0:e.metadata)==null?void 0:u.format)==="markdown"||((d=e==null?void 0:e.metadata)==null?void 0:d.markdown)===!0||/(\n|^)#\s|\n##\s|```|\*\s|\-\s|\d+\.\s|>\s|!\[|\]\(https?:\/\//.test(e.content)||/^```markdown\s[\s\S]*```$/.test(e.content.trim())||/^``markdown\s[\s\S]*``?$/.test(e.content.trim())||/^``markdown\s[\s\S]*$/.test(e.content.trim())||/^`markdown\s[\s\S]*`$/.test(e.content.trim())||/\[.*\]\(.*\)/.test(e.content)||/\|.*\|/.test(e.content)||/^-\s/.test(e.content)||/^\*\s/.test(e.content)||/^\d+\.\s/.test(e.content)||/(^|\n)#.*\n#/.test(e.content)||/```[\s\S]*?```[\s\S]*?```/.test(e.content)||/#.*\n/.test(e.content)&&(/```/.test(e.content)||/^\s*[\-\*]\s/m.test(e.content))||e.content.includes("README")&&/#/.test(e.content)||/^`+markdown\s/.test(e.content.trim()),a=D.useMemo(()=>{if(!s)return e.content;const g=e.content.trim(),m=g.match(/^```markdown\s?([\s\S]*?)```$/);if(m)return m[1].trim();let x=g.match(/^``markdown\s?([\s\S]*?)``$/);if(x)return x[1].trim();if(g.startsWith("``markdown"))return g.replace(/^``markdown\s*\n?/,"").replace(/``?$/,"").trim();const y=g.match(/^`markdown\s?([\s\S]*?)`$/);return y?y[1].trim():e.content},[e.content,s]),l=g=>{const m=/(https?:\/\/[^\s<>"{}|\\^`[\]]*)/g;return g.split(m).map((y,E)=>m.test(y)?h.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:`underline font-medium transition-colors hover:opacity-80 cursor-pointer ${t==="dark"?"text-blue-400 hover:text-blue-300":"text-blue-600 hover:text-blue-800"}`,onClick:v=>{v.preventDefault(),window.open(y,"_blank","noopener,noreferrer")},children:y},E):y)},c={h1:g=>h.jsx("h1",{className:`text-lg font-bold mt-4 mb-2 pb-1 border-b ${t==="dark"?"border-gray-600 text-gray-100":"border-gray-200 text-gray-900"}`,...g}),h2:g=>h.jsx("h2",{className:`text-base font-semibold mt-3 mb-2 ${t==="dark"?"text-gray-200":"text-gray-800"}`,...g}),h3:g=>h.jsx("h3",{className:`text-sm font-semibold mt-2 mb-1 ${t==="dark"?"text-gray-300":"text-gray-700"}`,...g}),p:g=>h.jsx("p",{className:"my-2 leading-relaxed",...g}),a:({href:g,children:m,...x})=>{const y=g||(typeof m=="string"&&m.startsWith("http")?m:"#");return h.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:`underline font-medium transition-colors hover:opacity-80 cursor-pointer ${t==="dark"?"text-blue-400 hover:text-blue-300":"text-blue-600 hover:text-blue-800"}`,onClick:E=>{if(!y||y==="#"){E.preventDefault();return}},...x,children:m})},code:({inline:g,className:m,children:x,...y})=>{const E=/language-(\w+)/.exec(m||""),v=E?E[1]:"";return g?h.jsx("code",{className:`px-1.5 py-0.5 rounded text-[0.85em] font-mono ${t==="dark"?"bg-gray-700 text-gray-200":"bg-gray-100 text-gray-800"}`,...y,children:x}):h.jsxs("div",{className:"my-3",children:[v&&h.jsx("div",{className:`px-3 py-1 text-xs font-medium rounded-t-md ${t==="dark"?"bg-gray-900 text-gray-300 border-b border-gray-700":"bg-gray-50 text-gray-600 border-b border-gray-200"}`,children:v}),h.jsx("pre",{className:`overflow-x-auto text-sm ${v?"rounded-t-none":""} rounded-md ${t==="dark"?"bg-gray-900 border border-gray-700 text-gray-100":"bg-gray-50 border border-gray-200 text-gray-900"}`,style:{margin:0},children:h.jsx("code",{className:`block p-3 font-mono ${t==="dark"?"text-gray-100":"text-gray-900"} ${m||""}`,...y,children:x})})]})},pre:({children:g,...m})=>h.jsx(h.Fragment,{children:g}),ul:g=>h.jsx("ul",{className:"list-disc pl-5 my-2 space-y-1",...g}),ol:g=>h.jsx("ol",{className:"list-decimal pl-5 my-2 space-y-1",...g}),li:g=>h.jsx("li",{className:"leading-relaxed",...g}),blockquote:g=>h.jsx("blockquote",{className:`border-l-4 pl-4 italic my-3 ${t==="dark"?"border-gray-600 text-gray-300 bg-gray-800/30":"border-gray-300 text-gray-600 bg-gray-50/50"}`,...g}),img:g=>h.jsx("img",{className:"max-w-full h-auto rounded-md my-2 shadow-sm",loading:"lazy",...g}),table:g=>h.jsx("div",{className:"overflow-x-auto my-3",children:h.jsx("table",{className:`min-w-full text-left text-sm border rounded-md ${t==="dark"?"border-gray-600":"border-gray-200"}`,...g})}),th:g=>h.jsx("th",{className:`px-3 py-2 font-semibold border-b ${t==="dark"?"bg-gray-800 border-gray-600 text-gray-200":"bg-gray-50 border-gray-200 text-gray-700"}`,...g}),td:g=>h.jsx("td",{className:`px-3 py-2 border-b ${t==="dark"?"border-gray-700":"border-gray-200"}`,...g}),hr:g=>h.jsx("hr",{className:`my-4 border-0 h-px ${t==="dark"?"bg-gray-600":"bg-gray-300"}`,...g}),strong:g=>h.jsx("strong",{className:"font-semibold",...g}),em:g=>h.jsx("em",{className:"italic",...g})};return h.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-1`,children:h.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 max-w-[85%] min-w-0`,children:[h.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${n?t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700":t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:o}),h.jsxs("div",{className:`
64
64
  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
65
65
  ${n?`${i.chatMessage.own} rounded-br-md`:`${i.chatMessage.other} rounded-bl-md`}
66
66
  ${r?"shimmer":""}
67
67
  transition-all duration-200 group-hover:scale-[1.02]
68
- `,style:{wordWrap:"break-word",overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[h.jsx("div",{className:"leading-relaxed text-sm overflow-hidden",children:((f=e.metadata)==null?void 0:f.type)==="attachment"?h.jsx(jN,{message:e,theme:t,isOwn:n}):r&&!n?h.jsx(DN,{text:e.content,isComplete:!r,isRealTimeStream:((p=e.metadata)==null?void 0:p.streaming)===!0,speed:35}):s?h.jsx(MC,{remarkPlugins:[HT],rehypePlugins:[IN],components:c,children:a}):h.jsx("span",{className:"whitespace-pre-wrap break-words",children:l(e.content)})}),h.jsx("div",{className:"text-xs",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}function FN(e,t){return e.startsWith("image/")?We.Image:e.startsWith("video/")?We.Video:e.startsWith("audio/")?We.Music:e.includes("zip")||e.includes("rar")||e.includes("archive")?We.Archive:We.FileText}function BN(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 jN({message:e,theme:t,isOwn:n}){const r=Ct(t),i=e.metadata,o=(i==null?void 0:i.fileName)||"Unknown file",s=(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,f=i==null?void 0:i.downloadUrl,p=i==null?void 0:i.file,g=FN(a),m=l||c,x=l?u:d,y=l?"Downloading...":c?"Uploading...":"Complete",[k,v]=P.useState(null);P.useEffect(()=>{if(f)v(f);else if(p&&a.startsWith("image/")){const M=URL.createObjectURL(p);return v(M),()=>URL.revokeObjectURL(M)}else v(null)},[f,p,a]);const _=()=>{if(f){const M=document.createElement("a");M.href=f,M.download=o,M.click()}},C=a.startsWith("image/")&&k;return h.jsxs("div",{className:"flex flex-col gap-2 max-w-full sm:max-w-sm",children:[C&&h.jsxs("div",{className:"relative rounded-lg overflow-hidden",children:[h.jsx("img",{src:k,alt:o,className:"max-w-full h-auto max-h-48 object-cover rounded-lg cursor-pointer",onClick:_}),h.jsx("div",{className:"absolute inset-0 bg-black/0 hover:bg-black/10 transition-colors duration-200 cursor-pointer"})]}),h.jsxs("div",{className:`
68
+ `,style:{wordWrap:"break-word",overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[h.jsx("div",{className:"leading-relaxed text-sm overflow-hidden",children:((f=e.metadata)==null?void 0:f.type)==="attachment"?h.jsx(BN,{message:e,theme:t,isOwn:n}):r&&!n?h.jsx(PN,{text:e.content,isComplete:!r,isRealTimeStream:((p=e.metadata)==null?void 0:p.streaming)===!0,speed:35}):s?h.jsx(RC,{remarkPlugins:[UT],rehypePlugins:[MN],components:c,children:a}):h.jsx("span",{className:"whitespace-pre-wrap break-words",children:l(e.content)})}),h.jsx("div",{className:"text-xs",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}function LN(e,t){return e.startsWith("image/")?Ge.Image:e.startsWith("video/")?Ge.Video:e.startsWith("audio/")?Ge.Music:e.includes("zip")||e.includes("rar")||e.includes("archive")?Ge.Archive:Ge.FileText}function FN(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 BN({message:e,theme:t,isOwn:n}){const r=Ct(t),i=e.metadata,o=(i==null?void 0:i.fileName)||"Unknown file",s=(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,f=i==null?void 0:i.downloadUrl,p=i==null?void 0:i.file,g=LN(a),m=l||c,x=l?u:d,y=l?"Downloading...":c?"Uploading...":"Complete",[E,v]=D.useState(null);D.useEffect(()=>{if(f)v(f);else if(p&&a.startsWith("image/")){const M=URL.createObjectURL(p);return v(M),()=>URL.revokeObjectURL(M)}else v(null)},[f,p,a]);const _=()=>{if(f){const M=document.createElement("a");M.href=f,M.download=o,M.click()}},C=a.startsWith("image/")&&E;return h.jsxs("div",{className:"flex flex-col gap-2 max-w-full sm:max-w-sm",children:[C&&h.jsxs("div",{className:"relative rounded-lg overflow-hidden",children:[h.jsx("img",{src:E,alt:o,className:"max-w-full h-auto max-h-48 object-cover rounded-lg cursor-pointer",onClick:_}),h.jsx("div",{className:"absolute inset-0 bg-black/0 hover:bg-black/10 transition-colors duration-200 cursor-pointer"})]}),h.jsxs("div",{className:`
69
69
  flex items-center gap-3 p-3 rounded-lg border transition-all duration-200
70
70
  ${t==="light"?"bg-gray-50 border-gray-200 hover:bg-gray-100":"bg-gray-800/50 border-gray-700 hover:bg-gray-700/50"}
71
71
  `,children:[h.jsx("div",{className:`
72
72
  p-2 rounded-lg flex-shrink-0
73
73
  ${t==="light"?"bg-blue-100 text-blue-600":"bg-blue-900/50 text-blue-400"}
74
- `,children:h.jsx(g,{className:"w-5 h-5"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:`font-medium text-sm truncate ${r.text.primary}`,children:o}),h.jsxs("div",{className:`text-xs ${r.text.muted}`,children:[s>0&&BN(s),m&&h.jsxs(h.Fragment,{children:[s>0&&" • ",y," ",Math.round(x*100),"%"]})]}),m&&h.jsx("div",{className:`
74
+ `,children:h.jsx(g,{className:"w-5 h-5"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:`font-medium text-sm truncate ${r.text.primary}`,children:o}),h.jsxs("div",{className:`text-xs ${r.text.muted}`,children:[s>0&&FN(s),m&&h.jsxs(h.Fragment,{children:[s>0&&" • ",y," ",Math.round(x*100),"%"]})]}),m&&h.jsx("div",{className:`
75
75
  w-full h-1 rounded-full mt-1 overflow-hidden
76
76
  ${t==="light"?"bg-gray-200":"bg-gray-700"}
77
- `,children:h.jsx(Ie.div,{className:`h-full ${t==="light"?"bg-blue-500":"bg-blue-400"}`,initial:{width:0},animate:{width:`${x*100}%`},transition:{duration:.3}})})]}),f&&!m&&h.jsx(Ie.button,{onClick:_,whileHover:{scale:1.05},whileTap:{scale:.95},className:`
77
+ `,children:h.jsx(Me.div,{className:`h-full ${t==="light"?"bg-blue-500":"bg-blue-400"}`,initial:{width:0},animate:{width:`${x*100}%`},transition:{duration:.3}})})]}),f&&!m&&h.jsx(Me.button,{onClick:_,whileHover:{scale:1.05},whileTap:{scale:.95},className:`
78
78
  p-2 rounded-lg transition-colors duration-200
79
79
  ${t==="light"?"hover:bg-gray-200 text-gray-600 hover:text-gray-800":"hover:bg-gray-600 text-gray-400 hover:text-gray-200"}
80
- `,"aria-label":"Download file",children:h.jsx(We.Download,{className:"w-4 h-4"})})]})]})}function $N(){return h.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:[h.jsx("div",{className:"text-2xl mb-2",children:"✅"}),h.jsx("div",{className:"text-green-700 font-semibold text-sm mb-1",children:"Success!"}),h.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"Your action was completed successfully."})]})}function VN(){return h.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:[h.jsx("div",{className:"text-2xl mb-2",children:"⏰"}),h.jsx("div",{className:"text-yellow-700 font-semibold text-sm mb-1",children:"Interaction timed out"}),h.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"No response was provided in time."})]})}function Vl({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:i="widget",onEndChat:o,showTimer:s=!0}){const a=P.useMemo(()=>{const Z=e.getCurrentAgentInfo();return No(Z)},[e]),{suggestedReplyEnabled:l,attachmentsEnabled:c}=P.useMemo(()=>lp(a),[a]),u=P.useMemo(()=>Ao(a),[a]),[d,f]=P.useState(()=>e&&typeof e.getChatMessages=="function"?e.getChatMessages():[]),[p,g]=P.useState(!0),[m,x]=P.useState(()=>{const Z=e&&typeof e.getCurrentSession=="function"&&!!e.getCurrentSession(),te=e&&typeof e.getChatMessages=="function"&&e.getChatMessages().length>0;return!Z&&!te}),[y,k]=P.useState(new Set),[v,_]=P.useState([]),[S,C]=P.useState(!1),[M,N]=P.useState(!1),[I,b]=P.useState(()=>e.getCurrentInteraction()),R=P.useRef(null),O=P.useRef(null),[D,$]=P.useState(!0),U=Ct(t);P.useEffect(()=>{const Z=()=>{const te=navigator.userAgent.toLowerCase(),ae=["android","iphone","ipad","mobile","tablet"].some(Ce=>te.includes(Ce)),ve="ontouchstart"in window||navigator.maxTouchPoints>0,Ne=window.innerWidth<=768,_e=ae||ve&&Ne;C(_e),_e&&i==="widget"&&N(!0)};return Z(),window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[i]),P.useEffect(()=>(M&&S&&(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)),()=>{M&&S&&(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))}),[M,S]);const re=e.getCurrentAgentInfo(),ne=(re==null?void 0:re.name)||"AI Assistant",j=ne.split(" ").map(Z=>Z[0]).join("").toUpperCase().slice(0,2),W=P.useCallback(Z=>{const te={id:`local_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:Z,timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{isLocal:!0}};f(ye=>[...ye,te])},[]),w=P.useCallback((Z=!1)=>{if(O.current){const te=O.current;Z?te.scrollTop=te.scrollHeight:te.scrollTo({top:te.scrollHeight,behavior:"smooth"})}},[]),F=P.useCallback(()=>{if(O.current){const{scrollTop:Z,scrollHeight:te,clientHeight:ye}=O.current;return te-Z-ye<100}return!0},[]),Y=P.useCallback(()=>{const Z=F();$(Z)},[F]),E=P.useCallback((Z=!1)=>{D&&w(Z)},[D,w]);P.useEffect(()=>{if(D&&d.length>0){E(!0);const Z=setTimeout(()=>{D&&E(!1)},10);return()=>clearTimeout(Z)}},[d.length,E,D]),P.useEffect(()=>{if(I&&D){E(!0);const Z=setTimeout(()=>{D&&E(!1)},50);return()=>clearTimeout(Z)}},[I,E,D]),P.useEffect(()=>{const Z=ae=>{if(console.log("ChatView: Received message:",ae),x(!1),I&&ae.sender.type==="agent"){console.log("ChatView: Queuing agent message due to active interaction:",I.methodName),_(ve=>[...ve,ae]);return}ae.sender.type==="agent"&&g(!1),f(ve=>{var _e;if(ve.some(Ce=>Ce.id===ae.id))return console.log("ChatView: Message already exists, skipping:",ae.id),ve;if(console.log("ChatView: Adding new message:",ae.id),ae.sender.type==="agent"&&(k(Ce=>new Set(Ce).add(ae.id)),!((_e=ae.metadata)!=null&&_e.streaming))){const Ce=ae.content.length*35+1e3;setTimeout(()=>{k(bt=>{const vt=new Set(bt);return vt.delete(ae.id),vt})},Ce)}return[...ve,ae]}),setTimeout(()=>{D&&E(!0)},0)},te=ae=>{var ve;if(console.log("ChatView: Updated message:",ae),I&&ae.sender.type==="agent"){console.log("ChatView: Queuing agent message update due to active interaction:",I.methodName),_(Ne=>{const _e=Ne.findIndex(Ce=>Ce.id===ae.id);if(_e>=0){const Ce=[...Ne];return Ce[_e]=ae,Ce}else return[...Ne,ae]});return}f(Ne=>Ne.map(_e=>_e.id===ae.id?{...ae}:_e)),setTimeout(()=>{D&&E(!0)},0),(ve=ae.metadata)!=null&&ve.streaming||k(Ne=>{const _e=new Set(Ne);return _e.delete(ae.id),_e})},ye=ae=>{console.log("ChatView: Sent message:",ae),x(!1),f(ve=>ve.some(_e=>_e.id===ae.id)?(console.log("ChatView: Sent message already exists, skipping:",ae.id),ve):(console.log("ChatView: Adding sent message:",ae.id),[...ve,ae])),setTimeout(()=>{D&&E(!0)},0)};return e.on("chat.message.received",Z),e.on("chat.message.updated",te),e.on("chat.message.sent",ye),()=>{e.off("chat.message.received",Z),e.off("chat.message.updated",te),e.off("chat.message.sent",ye)}},[e,I,D,E]),P.useEffect(()=>{const Z=ve=>{console.log("ChatView: RPC interaction started:",ve);const Ne=e.getCurrentInteraction();console.log("ChatView: Got interaction from client:",Ne==null?void 0:Ne.methodName),b(Ne),g(!1),D&&(E(!0),setTimeout(()=>{D&&E(!1)},100))},te=ve=>{if(console.log("ChatView: RPC interaction completed:",ve),b(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages"),f(Ne=>{const _e=[...Ne];return v.forEach(Ce=>{var vt;if(!_e.some(je=>je.id===Ce.id)&&(console.log("ChatView: Adding queued message:",Ce.id),_e.push(Ce),Ce.sender.type==="agent"&&(k(je=>new Set(je).add(Ce.id)),!((vt=Ce.metadata)!=null&&vt.streaming)))){const je=Ce.content.length*35+1e3;setTimeout(()=>{k(ut=>{const L=new Set(ut);return L.delete(Ce.id),L})},je)}}),_e}),_([]),setTimeout(()=>{D&&E(!0)},0)),ve&&ve.response&&ve.response.success){let Ne=null;ve.response.successView?Ne=ve.response.successView:ve.successView&&(Ne=ve.successView),f(_e=>{const Ce=[..._e].reverse().findIndex(ut=>ut.sender.type==="participant");let bt=_e.length;Ce!==-1&&(bt=_e.length-Ce);const vt={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||h.jsx($N,{})}};e&&typeof e.addChatMessage=="function"&&e.addChatMessage(vt);const je=[..._e];return je.splice(bt,0,vt),je})}},ye=async ve=>{I&&(console.log("ChatView: Dismissing active interaction due to timeout"),e.dismissCurrentInteraction()),b(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages after timeout"),f(_e=>{const Ce=[..._e];return v.forEach(bt=>{var je;if(!Ce.some(ut=>ut.id===bt.id)&&(Ce.push(bt),bt.sender.type==="agent"&&(k(ut=>new Set(ut).add(bt.id)),!((je=bt.metadata)!=null&&je.streaming)))){const ut=bt.content.length*35+1e3;setTimeout(()=>{k(L=>{const J=new Set(L);return J.delete(bt.id),J})},ut)}}),Ce}),_([]),setTimeout(()=>{D&&E(!0)},0));let Ne=null;ve&&ve.response&&ve.response.timeoutView?Ne=ve.response.timeoutView:ve&&ve.timeoutView&&(Ne=ve.timeoutView),f(_e=>{const Ce={id:`timeout_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"agent",name:ne,type:"agent"},metadata:{type:"timeoutView",view:Ne||h.jsx(VN,{})}};return e&&typeof e.addChatMessage=="function"&&e.addChatMessage(Ce),[..._e,Ce]}),setTimeout(()=>{e.getCurrentInteraction()||b(null)},100)},ae=async ve=>{console.log("ChatView: RPC interaction dismissed:",ve),console.log("ChatView: Current interaction before dismiss:",I==null?void 0:I.methodName),b(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages after dismissal"),f(Ne=>{const _e=[...Ne];return v.forEach(Ce=>{var vt;if(!_e.some(je=>je.id===Ce.id)&&(_e.push(Ce),Ce.sender.type==="agent"&&(k(je=>new Set(je).add(Ce.id)),!((vt=Ce.metadata)!=null&&vt.streaming)))){const je=Ce.content.length*35+1e3;setTimeout(()=>{k(ut=>{const L=new Set(ut);return L.delete(Ce.id),L})},je)}}),_e}),_([]),setTimeout(()=>{D&&E(!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&&b(null)},50),console.log("ChatView: Set currentInteraction to null after dismiss")};return e.on("rpc.interaction.started",Z),e.on("rpc.interaction.completed",te),e.on("rpc.interaction.timeout",ye),e.on("rpc.interaction.dismissed",ae),()=>{e.off("rpc.interaction.started",Z),e.off("rpc.interaction.completed",te),e.off("rpc.interaction.timeout",ye),e.off("rpc.interaction.dismissed",ae)}},[e,D,E,ne,v]),P.useEffect(()=>{const Z=()=>{if(console.log("ChatView: Agent is thinking"),I){console.log("ChatView: Suppressing thinking indicator due to active interaction:",I.methodName);return}g(!0)},te=()=>{console.log("ChatView: Agent is speaking"),g(!1)};return e.on("agent.thinking",Z),e.on("agent.speaking",te),()=>{e.off("agent.thinking",Z),e.off("agent.speaking",te)}},[e,I]),P.useEffect(()=>{const Z=e.getCurrentInteraction();Z?(console.log("ChatView: Restoring interaction state on mount/client change:",Z.methodName),b(Z)):b(null)},[e]),P.useEffect(()=>{console.log("ChatView: Display type changed to:",i,"Current interaction:",(I==null?void 0:I.methodName)||"none")},[i,I]);const B=async Z=>{try{I&&(console.log("ChatView: Dismissing active interaction due to user message send"),e.dismissCurrentInteraction(),b(null)),await e.sendChatMessage(Z)}catch(te){console.error("Failed to send message:",te)}},z=async Z=>{try{I&&(console.log("ChatView: Dismissing active interaction due to user attachment send"),e.dismissCurrentInteraction(),b(null)),await e.sendAttachments(Z),console.log("Attachments sent successfully:",Z.map(te=>te.name))}catch(te){console.error("Failed to send attachments:",te)}},[K,q]=P.useState([]);P.useEffect(()=>{const Z=te=>{q(Array.isArray(te)?te:["tes","hello how are you","algebra make me learn that ","what is the meaning of life"])};return e.on("suggested.response",Z),()=>{e.off("suggested.response",Z)}},[e]);const me=M&&S?"fullscreen":i,Q=me==="fullscreen"?M&&S?"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",le=me==="fullscreen"?M&&S?"flex items-center w-full justify-between px-3 h-11 bg-black/80 text-white border-b border-gray-700":`flex items-center w-full justify-between px-5 h-12 border-b ${U.chatHeader.container}`:`flex items-center w-full justify-between px-4 h-12 border-b ${U.chatHeader.container}`,he=me==="fullscreen"?M&&S?"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",G="flex-shrink-0 !w-full",Se=()=>{N(!1),n&&n()};return h.jsxs("div",{className:`${Q} relative`,children:[h.jsx("div",{className:le,children:h.jsxs("div",{className:"flex items-center justify-between w-full",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("h3",{className:`font-semibold text-sm leading-tight ${M&&S?"text-white":U.text.primary}`,children:ne})}),s&&u&&h.jsx("div",{className:"flex-1 flex justify-center",children:h.jsx(ci,{duration:u,theme:t,onTimerExpired:()=>{console.log("Session timer expired")},showIcon:!1,className:"text-xs"})}),n&&h.jsx(Ie.button,{onClick:Se,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-2 rounded-full transition-colors ml-1 ${M&&S?"bg-white/20 hover:bg-white/30 text-white":t==="light"?"bg-gray-100 hover:bg-gray-200 text-gray-600":"bg-gray-700/60 hover:bg-gray-600/60 text-gray-200"}`,"aria-label":"Close chat",children:"✕"})]})}),h.jsxs("div",{ref:O,className:`${he} flex flex-col`,style:{scrollBehavior:"smooth",scrollbarWidth:"none",contain:"layout style paint",overscrollBehavior:"contain"},onScroll:Y,children:[" ",d.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-center py-12",children:[h.jsx(Ie.div,{transition:{duration:2,repeat:1/0,ease:"easeInOut"},className:"w-16 h-16 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white font-bold text-xl mb-6 shadow-xl",children:j}),h.jsxs("p",{className:`text-base mb-2 ${M&&S?"text-white":U.text.secondary}`,children:[ne," is joining..."]}),h.jsx("p",{className:`text-xs ${M&&S?"text-gray-300":U.text.muted}`,children:"Your conversation will begin shortly"})]}):h.jsx("div",{className:"w-full space-y-3 py-4 flex-1 flex flex-col justify-end",children:h.jsxs("div",{className:"space-y-3",children:[d.map((Z,te)=>{var ye,ae;return h.jsx("div",{children:((ye=Z.metadata)==null?void 0:ye.type)==="successView"?h.jsx("div",{className:"flex w-full justify-end mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row-reverse flex items-end gap-3 max-w-[85%] min-w-0",children:[h.jsx(Ie.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1},className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:"Y"}),h.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 ${U.chatMessage.own} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[Z.metadata.view,h.jsx("div",{className:`text-xs ${U.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:Z.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((ae=Z.metadata)==null?void 0:ae.type)==="timeoutView"?h.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.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:j}),h.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 ${U.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[Z.metadata.view,h.jsx("div",{className:`text-xs ${U.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:Z.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):h.jsx(LN,{message:Z,theme:t,isOwn:Z.sender.type==="participant",isStreaming:y.has(Z.id)})},Z.id)}),p&&!I&&h.jsx(Ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:d.length*.1},className:"flex w-full justify-start mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.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:j}),h.jsx("div",{className:`relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover ${U.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:h.jsx("span",{className:"inline-flex items-center",children:[0,1,2].map(Z=>h.jsx(Ie.span,{className:"w-1.5 h-1.5 bg-current rounded-full mx-0.5",animate:{y:[0,-4,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:Z*.2,ease:"easeInOut"}},Z))})})]})}),I&&I.presentationMode==="embedded"&&h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.jsx(Ie.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1},className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:j}),h.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 ${U.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[h.jsx(li,{interaction:I,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:W},I.methodName),h.jsx(Ie.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:`text-xs ${U.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]}),h.jsx("div",{ref:R})]})})]}),!D&&h.jsx(Ie.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onClick:()=>{$(!0),w(!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:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})}),l&&K.length>0&&h.jsx("div",{className:"w-full flex overflow-x-auto gap-2 px-4 py-2 mb-1 scrollbar-hide",children:K.map((Z,te)=>{var ye;return h.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
81
- ${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":((ye=U.suggestedResponse)==null?void 0:ye.container)||"bg-gradient-to-br from-blue-500 to-purple-600 text-white border-blue-400 hover:from-blue-600 hover:to-purple-700"}
82
- `,style:{boxShadow:t==="vox"?"0 2px 8px 0 rgba(80,60,200,0.10)":void 0,borderWidth:1},onClick:()=>{B(Z),q([])},children:Z},Z+te)})}),I&&I.presentationMode!=="embedded"&&h.jsx(li,{interaction:I,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:W},I.methodName),h.jsx(Ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:G,children:h.jsx(PN,{onSendMessage:B,onSendAttachments:z,disabled:r,theme:t,onEndChat:o,attachmentsEnabled:c})})]})}const Bm=A.forwardRef(({disabled:e,sessionStarted:t,participantName:n="User",loadingText:r="Waiting for agent to connect...",theme:i="vox",client:o,displayType:s="widget",onBack:a},l)=>{var W,w,F,Y,E;const[c,u]=A.useState(!1),[d,f]=A.useState(!1),[p,g]=A.useState(!1),[m,x]=A.useState(()=>{var B;return((B=o==null?void 0:o.getCurrentInteraction)==null?void 0:B.call(o))||null}),[y,k]=A.useState(()=>t),v=A.useRef(null),_=A.useMemo(()=>{var z;const B=(z=o==null?void 0:o.getCurrentAgentInfo)==null?void 0:z.call(o);return No(B)},[o]),S=A.useMemo(()=>Ao(_),[_]);A.useMemo(()=>cp(_),[_]);const C=A.useRef(null),[M,N]=A.useState(64);A.useLayoutEffect(()=>{const B=C.current;if(!B)return;const z=()=>N(B.offsetHeight||64);z();const K=new ResizeObserver(()=>z());return K.observe(B),window.addEventListener("resize",z),()=>{K.disconnect(),window.removeEventListener("resize",z)}},[]),xv();const{agent:{isActive:I=!1}={}}=o?xl(o):{agent:{isActive:!1}},b=to(o,"microphone"),R=Ct(i),O=A.useMemo(()=>o!=null&&o.getCurrentSession?!!o.getCurrentSession():!1,[o]),D=A.useMemo(()=>o!=null&&o.getIsAgentConnected&&o.getIsAgentConnected()||p,[o,p]),$=I||D;A.useEffect(()=>{$&&y&&k(!1)},[$,y]),A.useEffect(()=>{if(t&&!$){const B=setTimeout(()=>{O&&!$&&(g(!0),f(!1))},5e3),z=setTimeout(()=>{$||f(!0)},3e4);return()=>{clearTimeout(B),clearTimeout(z)}}else $&&f(!1)},[t,$,O]),A.useEffect(()=>{if(!o)return;const B=()=>{x(null),u(!1),f(!1)};return o.on("connection.disconnected",B),()=>o.off("connection.disconnected",B)},[o]),A.useEffect(()=>{if(!o)return;const B=()=>{g(!0),f(!1),k(!1)},z=B,K=B,q=()=>{g(!1),t&&k(!0)};return o.on("agent.connected",B),o.on("agent.speaking",z),o.on("agent.thinking",K),o.on("connection.disconnected",q),()=>{o.off("agent.connected",B),o.off("agent.speaking",z),o.off("agent.thinking",K),o.off("connection.disconnected",q)}},[o,t]),A.useEffect(()=>{if(!o)return;const B=()=>x(o.getCurrentInteraction()),z=()=>x(null);return o.on("rpc.interaction.started",B),o.on("rpc.interaction.completed",z),o.on("rpc.interaction.timeout",z),o.on("rpc.interaction.dismissed",z),()=>{o.off("rpc.interaction.started",B),o.off("rpc.interaction.completed",z),o.off("rpc.interaction.timeout",z),o.off("rpc.interaction.dismissed",z)}},[o]),A.useEffect(()=>{var z;if(!o)return;const B=(z=o.getCurrentInteraction)==null?void 0:z.call(o);x(B||null)},[o]),A.useEffect(()=>{var z,K;const B=((K=(z=o==null?void 0:o.getCurrentSession)==null?void 0:z.call(o))==null?void 0:K.id)||null;v.current,v.current=B},[o]),A.useEffect(()=>{m&&c&&u(!1)},[m,c]);const U=A.useCallback(B=>{},[]),re=A.useCallback(()=>{var B,z,K;try{m&&(x(null),(B=o==null?void 0:o.dismissCurrentInteraction)==null||B.call(o)),u(!1),f(!1),(z=o==null?void 0:o.endSession)==null||z.call(o),(K=o==null?void 0:o.disconnect)==null||K.call(o),a==null||a()}catch(q){console.error("Failed to end call:",q),x(null),u(!1),f(!1),a==null||a()}},[o,m,a]),ne=Je("w-full flex flex-col items-center justify-center",s==="fullscreen"?"w-full max-w-none mx-0 h-full":"w-full mx-auto",R.main,s==="fullscreen"?"max-w-none":"","overflow-hidden h-full"),j=a&&(s==="popup"||s==="fullscreen");return y?h.jsx("main",{ref:l,className:Je(ne,"relative",e&&"pointer-events-none opacity-50"),children:(j||S)&&h.jsxs("div",{className:`flex items-center justify-between w-full p-4 border-b ${((W=R.chatHeader)==null?void 0:W.container)||"border-gray-200"}`,children:[h.jsx("div",{children:h.jsx("h3",{className:`font-semibold ${R.text.primary}`,children:"Voice Session"})}),S&&h.jsx(ci,{duration:S,theme:i,onTimerExpired:()=>{console.log("Session timer expired")}})]})}):h.jsxs("main",{ref:l,className:Je(ne,"relative",e&&"pointer-events-none opacity-50"),style:{minHeight:0},children:[(j||S)&&h.jsxs("div",{className:`flex items-center justify-between w-full p-4 border-b ${((w=R.chatHeader)==null?void 0:w.container)||"border-gray-200"}`,children:[h.jsx("div",{children:h.jsx("h3",{className:`font-semibold ${R.text.primary}`,children:"Voice Session"})}),S&&h.jsx(ci,{duration:S,theme:i,onTimerExpired:()=>{console.log("Session timer expired")}})]}),h.jsxs("div",{className:"w-full flex-1 flex flex-col items-center px-0 min-h-0 overflow-hidden",children:[!$&&h.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full min-h-[180px]",children:[h.jsx(Ie.div,{animate:{rotate:360,scale:[1,1.1,1]},transition:{rotate:{duration:2,repeat:1/0,ease:"linear"},scale:{duration:1,repeat:1/0,ease:"easeInOut"}},className:"w-12 h-12 mb-4",children:h.jsx(vl,{className:R.spinner,weight:"bold"})}),h.jsx(Ie.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-sm opacity-80 ${R.text.muted} text-center max-w-xs`,children:d?"Agent is taking longer than expected...":r}),h.jsx(Ie.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${R.text.muted} mt-2 text-center opacity-60`,children:d?"Please check your connection or try again.":"Agent is connecting... This may take a moment."}),d&&a&&h.jsx(Ie.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:a,className:`mt-4 px-4 py-2 rounded-lg ${((F=R.chatHeader)==null?void 0:F.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]}),$&&h.jsxs(h.Fragment,{children:[c&&h.jsx("div",{className:Je("absolute left-0 right-0 top-0 flex flex-col transition-[opacity,translate] duration-300 ease-out z-10",i==="light"?"bg-white":"bg-gray-900/95 backdrop-blur-sm","translate-y-0 opacity-100 delay-200"),style:{bottom:`${M}px`},children:h.jsx(Vl,{client:o,theme:i,displayType:s==="fullscreen"?"fullscreen":"widget",disabled:e,onBack:()=>u(!1),showTimer:!1})}),!c&&h.jsxs("div",{className:Je("flex-1 flex flex-col items-center w-full h-full min-h-0",(m==null?void 0:m.presentationMode)==="embedded"?"justify-end":"justify-center"),children:[h.jsx(Ie.div,{className:"w-full flex justify-center",animate:{y:(m==null?void 0:m.presentationMode)==="embedded"?-8:0},transition:{duration:.3,ease:"easeOut"},children:h.jsx(mv,{chatOpen:c,client:o},`media-tiles-${((E=(Y=o==null?void 0:o.getCurrentSession)==null?void 0:Y.call(o))==null?void 0:E.id)||"no-session"}`)}),h.jsx(Sr,{mode:"wait",children:m&&m.presentationMode==="embedded"&&h.jsx(Ie.div,{initial:{opacity:0,y:20,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:20,height:0},transition:{duration:.3,ease:"easeOut"},className:Je("w-full relative mt-4 flex justify-center",s==="fullscreen"?"max-w-4xl":"max-w-md"),children:h.jsx("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl border border-white/20 shadow-lg overflow-hidden",children:h.jsx(li,{interaction:m,theme:i,onDismiss:()=>{var B;return(B=o==null?void 0:o.dismissCurrentInteraction)==null?void 0:B.call(o)},client:o,addLocalMessage:U})})},`embedded-${m.methodName}`)})]})]})]}),h.jsx(Sr,{mode:"wait",children:m&&m.presentationMode!=="embedded"&&!c&&h.jsx("div",{className:Je("absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm",s==="fullscreen"?"bg-black/70":"bg-black/50"),children:h.jsx(Ie.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},className:Je("relative w-full overflow-hidden",s==="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:h.jsx(li,{interaction:m,theme:i,onDismiss:()=>{var B;return(B=o==null?void 0:o.dismissCurrentInteraction)==null?void 0:B.call(o)},client:o,addLocalMessage:U})},`modal-${m.methodName}`)})}),h.jsx("div",{ref:C,className:"relative z-30 mt-auto w-full",children:h.jsx(zN,{onToggleMicrophone:()=>b.toggle(),onToggleChat:()=>u(!c),onEndCall:re,theme:i,microphoneEnabled:b.enabled,chatOpen:c,isMicrophoneLoading:b.pending,disabled:e})})]})});Bm.displayName="SessionView";function zN({onToggleMicrophone:e,onToggleChat:t,onEndCall:n,theme:r,microphoneEnabled:i=!0,chatOpen:o,isMicrophoneLoading:s=!1,disabled:a}){var c,u,d,f,p;const l=Ct(r);return h.jsxs("div",{className:Je("flex items-center justify-center gap-3 px-3 py-2 w-full backdrop-blur-xl border-t",r==="light"?"bg-white/95 border-gray-200":"bg-gray-900/90 border-gray-700"),children:[e&&h.jsx("button",{onClick:e,disabled:a||s,className:`p-3 rounded-full transition-all duration-200 ${i?((c=l.video)==null?void 0:c.controlEnabled)||"bg-green-500 text-white":((u=l.video)==null?void 0:u.controlDisabled)||"bg-red-500 text-white"} ${a?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:i?"Mute microphone":"Unmute microphone",children:s?h.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):i?h.jsx(We.Mic,{className:"w-5 h-5"}):h.jsx(We.MicOff,{className:"w-5 h-5"})}),h.jsx("button",{onClick:t,disabled:a,className:`relative p-3 rounded-full transition-all duration-200 ${o?((d=l.video)==null?void 0:d.controlEnabled)||"bg-blue-500 text-white":((f=l.video)==null?void 0:f.controlDisabled)||"bg-gray-500 text-white"} ${a?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:o?"Hide transcription":"Show transcription",children:h.jsx(We.MessageCircle,{className:"w-5 h-5"})}),n&&h.jsx("button",{onClick:n,disabled:a,className:`p-3 rounded-full transition-all duration-200 ${((p=l.video)==null?void 0:p.endCall)||"bg-red-500 text-white hover:bg-red-600"} ${a?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"End call",children:h.jsx(We.PhoneOff,{className:"w-5 h-5"})})]})}function UN({onToggleMicrophone:e,onToggleCamera:t,onToggleScreenShare:n,onToggleChat:r,onEndCall:i,theme:o,microphoneEnabled:s,cameraEnabled:a,screenShareEnabled:l,chatOpen:c,isMicrophoneLoading:u,isCameraLoading:d,isScreenShareLoading:f,disabled:p,userVideoEnabled:g=!0,screenshareEnabled:m=!0}){const x=Ct(o);return h.jsxs("div",{className:Je("flex items-center justify-center gap-3 px-3 py-2 w-full backdrop-blur-xl border-t",o==="light"?"bg-white/95 border-gray-200":"bg-gray-900/90 border-gray-700"),children:[h.jsx("button",{onClick:e,disabled:p||u,className:`p-3 rounded-full transition-all duration-200 ${s?x.video.controlEnabled:x.video.controlDisabled} ${p?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:s?"Mute microphone":"Unmute microphone",children:u?h.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):s?h.jsx(We.Mic,{className:"w-5 h-5"}):h.jsx(We.MicOff,{className:"w-5 h-5"})}),g&&h.jsx("button",{onClick:t,disabled:p||d,className:`p-3 rounded-full transition-all duration-200 ${a?x.video.controlEnabled:x.video.controlDisabled} ${p?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:a?"Turn off camera":"Turn on camera",children:d?h.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):a?h.jsx(We.Camera,{className:"w-5 h-5"}):h.jsx(We.CameraOff,{className:"w-5 h-5"})}),m&&h.jsx("button",{onClick:n,disabled:p||f,className:`p-3 rounded-full transition-all duration-200 ${l?x.video.controlEnabled:x.video.controlDisabled} ${p?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:l?"Stop screen share":"Share screen",children:f?h.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):h.jsx(We.Monitor,{className:"w-5 h-5"})}),h.jsx("button",{onClick:r,disabled:p,className:`relative p-3 rounded-full transition-all duration-200 ${c?x.video.controlEnabled:x.video.controlDisabled} ${p?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:c?"Hide chat":"Show chat & transcription",children:h.jsx(We.MessageCircle,{className:"w-5 h-5"})}),i&&h.jsx("button",{onClick:i,disabled:p,className:`p-3 rounded-full transition-all duration-200 ${x.video.endCall} ${p?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"End call",children:h.jsx(We.PhoneOff,{className:"w-5 h-5"})})]})}function Fd({trackRef:e,participant:t,isLocal:n=!1,className:r="",theme:i}){var l;const o=Ct(i),s=(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 h.jsxs("div",{className:`relative rounded-lg overflow-hidden ${o.video.tile} ${r}`,children:[a?h.jsx($t.VideoTrack,{trackRef:e,className:"w-full h-full object-cover"}):h.jsx("div",{className:`w-full h-full flex items-center justify-center ${o.video.placeholder}`,children:h.jsx("div",{className:"text-center",children:h.jsx("div",{className:`w-16 h-16 mx-auto mb-2 rounded-full flex items-center justify-center ${o.video.avatar}`,children:h.jsx(We.User,{className:"w-8 h-8"})})})}),h.jsx("div",{className:`absolute bottom-2 left-2 px-2 py-1 rounded text-xs ${o.video.nameOverlay}`,children:s}),((l=e==null?void 0:e.publication)==null?void 0:l.isMuted)&&h.jsx("div",{className:`absolute top-2 right-2 p-1 rounded ${o.video.mutedIndicator}`,children:h.jsx(We.CameraOff,{className:"w-4 h-4"})})]})}function HN({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:i,onEndCall:o}){var B;const s=Ct(t),[a,l]=P.useState(!1),[c,u]=P.useState(!1),d=P.useMemo(()=>{const z=e.getCurrentAgentInfo();return No(z)},[e]),{userVideoEnabled:f,agentAvatarEnabled:p,screenshareEnabled:g}=P.useMemo(()=>ap(d),[d]),m=P.useMemo(()=>Ao(d),[d]),x=P.useRef(null),[y,k]=P.useState(64);P.useLayoutEffect(()=>{const z=x.current;if(!z)return;const K=()=>k(z.offsetHeight||64);K();const q=new ResizeObserver(()=>K());return q.observe(z),window.addEventListener("resize",K),()=>{q.disconnect(),window.removeEventListener("resize",K)}},[]);const[v,_]=P.useState(null),S=_w(e),{videoTrackRefs:C,screenShareTrackRefs:M}=Tw(e),{agent:{isActive:N=!1}={},state:I="idle",audioTrack:b}=e?xl(e):{agent:{isActive:!1},state:"idle",audioTrack:null},R=P.useMemo(()=>e.getRemoteParticipants(),[e,S]),O=to(e,"microphone"),D=to(e,"camera"),$=to(e,"screenShare"),U=P.useCallback(async()=>{D.pending||await D.toggle()},[D]),re=P.useCallback(async()=>{$.pending||await $.toggle()},[$]),ne=P.useCallback(()=>{l(z=>!z)},[]),j=P.useCallback(()=>{o?o():n&&n()},[o,n]);P.useEffect(()=>{if(!e)return;const z=K=>{console.log("📺 Video: Interactive UI state updated:",K),_(K)};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]),P.useEffect(()=>{if(N)u(!1);else{const z=setTimeout(()=>{N||u(!0)},3e4);return()=>{clearTimeout(z)}}},[N]);const W=S==null?void 0:S.localParticipant,w=P.useMemo(()=>(e?e.getCameraTrackRefs():[]).find(z=>z.participant===W),[e,W]),Y=C.filter(z=>z.participant!==W)[0],E=P.useMemo(()=>(M||[]).find(z=>z.participant===W),[M,W]);return h.jsxs("div",{className:`flex flex-col h-full ${s.video.container} relative`,children:[h.jsxs("div",{className:`flex items-center justify-between p-4 border-b ${s.video.header}`,children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:`w-3 h-3 rounded-full ${s.video.statusDot}`}),h.jsx("span",{className:"font-medium",children:"Video Call"}),h.jsxs("span",{className:"text-sm opacity-70",children:[R.length+1," participant",R.length!==0?"s":""]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[m&&h.jsx(ci,{duration:m,theme:t,onTimerExpired:()=>{console.log("Session timer expired")}}),h.jsx("button",{className:`p-2 rounded-lg transition-colors ${s.video.headerButton}`,title:"Layout options",children:h.jsx(We.LayoutGrid,{className:"w-4 h-4"})})]})]}),h.jsxs("div",{className:"relative flex-1 min-h-0",children:[!N&&h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsxs("div",{className:"text-center",children:[h.jsx(Ie.div,{animate:{rotate:360,scale:[1,1.1,1]},transition:{rotate:{duration:2,repeat:1/0,ease:"linear"},scale:{duration:1,repeat:1/0,ease:"easeInOut"}},className:"w-12 h-12 mb-4 mx-auto",children:h.jsx(vl,{className:s.spinner,weight:"bold"})}),h.jsx(Ie.p,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-lg opacity-70 ${s.text.muted}`,children:c?"Agent is taking longer than expected...":"Waiting for agent to join..."}),h.jsx(Ie.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${s.text.muted} mt-2 opacity-60`,children:c?"Please check your connection or try again.":"Agent is connecting... This may take a moment."}),c&&n&&h.jsx(Ie.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:n,className:`mt-4 px-4 py-2 rounded-lg ${((B=s.chatHeader)==null?void 0:B.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]})}),N&&!a&&h.jsx("div",{className:"p-4 min-h-0 h-full",children:h.jsxs("div",{className:"relative w-full h-full rounded-lg overflow-hidden",children:[p?Y?h.jsx(Fd,{trackRef:Y,participant:Y.participant,isLocal:!1,theme:t,className:"w-full h-full"}):h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx(We.Users,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),h.jsx("p",{className:"text-lg opacity-70",children:"Waiting for agent video..."})]})}):h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsx("div",{className:"text-center",children:h.jsxs("div",{className:"mb-4",children:[h.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-gradient-to-br from-[#6721a4] to-[#5c64f6] flex items-center justify-center",children:h.jsx(We.User,{className:"w-8 h-8 text-white"})}),N&&(b?h.jsx($t.BarVisualizer,{barCount:5,state:I,options:{minHeight:5},trackRef:b,className:"flex items-center justify-center gap-1",children:h.jsx("span",{className:Je(["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]"])})}):h.jsx("div",{className:"flex items-center justify-center gap-1",children:Array.from({length:5}).map((z,K)=>h.jsx("span",{className:Je(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear",I==="speaking"&&"bg-[#5c64f6]",I==="thinking"&&"animate-pulse bg-yellow-500"])},K))}))]})})}),E&&h.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:h.jsxs("div",{className:"relative w-full h-full bg-black/40",children:[h.jsx($t.VideoTrack,{trackRef:E,className:"w-full h-full object-contain"}),h.jsx("div",{className:`absolute top-1 left-1 px-1.5 py-0.5 rounded text-xs ${s.video.nameOverlay}`,children:h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(We.Monitor,{className:"w-3 h-3"}),h.jsx("span",{className:"text-xs",children:"Sharing"})]})})]})}),w&&f&&h.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:h.jsx(Fd,{trackRef:w,participant:W||void 0,isLocal:!0,theme:t,className:"w-full h-full"})})]})})]}),h.jsx(Sr,{mode:"wait",children:a&&h.jsx(Ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeOut"},className:Je("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:`${y}px`},children:h.jsx(Vl,{client:e,theme:t,displayType:i==="fullscreen"?"fullscreen":"widget",disabled:r,onBack:()=>l(!1),showTimer:!1})})}),h.jsx("div",{ref:x,className:"relative z-30 mt-auto",children:h.jsx(UN,{onToggleMicrophone:()=>O.toggle(),onToggleCamera:U,onToggleScreenShare:re,onToggleChat:ne,onEndCall:j,theme:t,microphoneEnabled:O.enabled,cameraEnabled:D.enabled,screenShareEnabled:$.enabled,chatOpen:a,isMicrophoneLoading:O.pending,isCameraLoading:D.pending,isScreenShareLoading:$.pending,disabled:r,userVideoEnabled:f,screenshareEnabled:g})})]})}const Bd=e=>e,WN=()=>{let e=Bd;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Bd}}},GN=WN();function On(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 Xn(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":On(7));return e.charAt(0).toUpperCase()+e.slice(1)}var Wi={exports:{}},Gi={exports:{}},ze={};/** @license React v16.13.1
80
+ `,"aria-label":"Download file",children:h.jsx(Ge.Download,{className:"w-4 h-4"})})]})]})}function jN(){return h.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:[h.jsx("div",{className:"text-2xl mb-2",children:"✅"}),h.jsx("div",{className:"text-green-700 font-semibold text-sm mb-1",children:"Success!"}),h.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"Your action was completed successfully."})]})}function $N(){return h.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:[h.jsx("div",{className:"text-2xl mb-2",children:"⏰"}),h.jsx("div",{className:"text-yellow-700 font-semibold text-sm mb-1",children:"Interaction timed out"}),h.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"No response was provided in time."})]})}function Vl({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:i="widget",onEndChat:o,showTimer:s=!0}){const a=D.useMemo(()=>{const K=e.getCurrentAgentInfo();return No(K)},[e]),{suggestedReplyEnabled:l,attachmentsEnabled:c}=D.useMemo(()=>ap(a),[a]),u=D.useMemo(()=>Ao(a),[a]),[d,f]=D.useState(()=>e&&typeof e.getChatMessages=="function"?e.getChatMessages():[]),[p,g]=D.useState(!0),[m,x]=D.useState(()=>{const K=e&&typeof e.getCurrentSession=="function"&&!!e.getCurrentSession(),ye=e&&typeof e.getChatMessages=="function"&&e.getChatMessages().length>0;return!K&&!ye}),[y,E]=D.useState(new Set),[v,_]=D.useState([]),[k,C]=D.useState(!1),[M,N]=D.useState(!1),[I,b]=D.useState(()=>e.getCurrentInteraction()),R=D.useRef(null),O=D.useRef(null),[L,j]=D.useState(!0),H=Ct(t);D.useEffect(()=>{const K=()=>{const ye=navigator.userAgent.toLowerCase(),ge=["android","iphone","ipad","mobile","tablet"].some(we=>ye.includes(we)),Ee="ontouchstart"in window||navigator.maxTouchPoints>0,Te=window.innerWidth<=768,Ne=ge||Ee&&Te;C(Ne),Ne&&i==="widget"&&N(!0)};return K(),window.addEventListener("resize",K),()=>window.removeEventListener("resize",K)},[i]),D.useEffect(()=>(M&&k&&(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)),()=>{M&&k&&(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))}),[M,k]);const ie=e.getCurrentAgentInfo(),ee=(ie==null?void 0:ie.name)||"AI Assistant",P=ee.split(" ").map(K=>K[0]).join("").toUpperCase().slice(0,2),W=D.useCallback(K=>{const ye={id:`local_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:K,timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{isLocal:!0}};f(me=>[...me,ye])},[]),w=D.useCallback((K=!1)=>{if(O.current){const ye=O.current;K?ye.scrollTop=ye.scrollHeight:ye.scrollTo({top:ye.scrollHeight,behavior:"smooth"})}},[]),V=D.useCallback(()=>{if(O.current){const{scrollTop:K,scrollHeight:ye,clientHeight:me}=O.current;return ye-K-me<100}return!0},[]),Y=D.useCallback(()=>{const K=V();j(K)},[V]),S=D.useCallback((K=!1)=>{L&&w(K)},[L,w]);D.useEffect(()=>{if(L&&d.length>0){S(!0);const K=setTimeout(()=>{L&&S(!1)},10);return()=>clearTimeout(K)}},[d.length,S,L]),D.useEffect(()=>{if(I&&L){S(!0);const K=setTimeout(()=>{L&&S(!1)},50);return()=>clearTimeout(K)}},[I,S,L]),D.useEffect(()=>{const K=ge=>{if(console.log("ChatView: Received message:",ge),x(!1),I&&ge.sender.type==="agent"){console.log("ChatView: Queuing agent message due to active interaction:",I.methodName),_(Ee=>[...Ee,ge]);return}ge.sender.type==="agent"&&g(!1),f(Ee=>{var Ne;if(Ee.some(we=>we.id===ge.id))return console.log("ChatView: Message already exists, skipping:",ge.id),Ee;if(console.log("ChatView: Adding new message:",ge.id),ge.sender.type==="agent"&&(E(we=>new Set(we).add(ge.id)),!((Ne=ge.metadata)!=null&&Ne.streaming))){const we=ge.content.length*35+1e3;setTimeout(()=>{E(ot=>{const vt=new Set(ot);return vt.delete(ge.id),vt})},we)}return[...Ee,ge]}),setTimeout(()=>{L&&S(!0)},0)},ye=ge=>{var Ee;if(console.log("ChatView: Updated message:",ge),I&&ge.sender.type==="agent"){console.log("ChatView: Queuing agent message update due to active interaction:",I.methodName),_(Te=>{const Ne=Te.findIndex(we=>we.id===ge.id);if(Ne>=0){const we=[...Te];return we[Ne]=ge,we}else return[...Te,ge]});return}f(Te=>Te.map(Ne=>Ne.id===ge.id?{...ge}:Ne)),setTimeout(()=>{L&&S(!0)},0),(Ee=ge.metadata)!=null&&Ee.streaming||E(Te=>{const Ne=new Set(Te);return Ne.delete(ge.id),Ne})},me=ge=>{console.log("ChatView: Sent message:",ge),x(!1),f(Ee=>Ee.some(Ne=>Ne.id===ge.id)?(console.log("ChatView: Sent message already exists, skipping:",ge.id),Ee):(console.log("ChatView: Adding sent message:",ge.id),[...Ee,ge])),setTimeout(()=>{L&&S(!0)},0)};return e.on("chat.message.received",K),e.on("chat.message.updated",ye),e.on("chat.message.sent",me),()=>{e.off("chat.message.received",K),e.off("chat.message.updated",ye),e.off("chat.message.sent",me)}},[e,I,L,S]),D.useEffect(()=>{const K=Ee=>{console.log("ChatView: RPC interaction started:",Ee);const Te=e.getCurrentInteraction();console.log("ChatView: Got interaction from client:",Te==null?void 0:Te.methodName),b(Te),g(!1),L&&(S(!0),setTimeout(()=>{L&&S(!1)},100))},ye=Ee=>{if(console.log("ChatView: RPC interaction completed:",Ee),b(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages"),f(Te=>{const Ne=[...Te];return v.forEach(we=>{var vt;if(!Ne.some(He=>He.id===we.id)&&(console.log("ChatView: Adding queued message:",we.id),Ne.push(we),we.sender.type==="agent"&&(E(He=>new Set(He).add(we.id)),!((vt=we.metadata)!=null&&vt.streaming)))){const He=we.content.length*35+1e3;setTimeout(()=>{E(bt=>{const F=new Set(bt);return F.delete(we.id),F})},He)}}),Ne}),_([]),setTimeout(()=>{L&&S(!0)},0)),Ee&&Ee.response&&Ee.response.success){let Te=null;Ee.response.successView?Te=Ee.response.successView:Ee.successView&&(Te=Ee.successView),f(Ne=>{const we=[...Ne].reverse().findIndex(bt=>bt.sender.type==="participant");let ot=Ne.length;we!==-1&&(ot=Ne.length-we);const vt={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:Te||h.jsx(jN,{})}};e&&typeof e.addChatMessage=="function"&&e.addChatMessage(vt);const He=[...Ne];return He.splice(ot,0,vt),He})}},me=async Ee=>{I&&(console.log("ChatView: Dismissing active interaction due to timeout"),e.dismissCurrentInteraction()),b(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages after timeout"),f(Ne=>{const we=[...Ne];return v.forEach(ot=>{var He;if(!we.some(bt=>bt.id===ot.id)&&(we.push(ot),ot.sender.type==="agent"&&(E(bt=>new Set(bt).add(ot.id)),!((He=ot.metadata)!=null&&He.streaming)))){const bt=ot.content.length*35+1e3;setTimeout(()=>{E(F=>{const Z=new Set(F);return Z.delete(ot.id),Z})},bt)}}),we}),_([]),setTimeout(()=>{L&&S(!0)},0));let Te=null;Ee&&Ee.response&&Ee.response.timeoutView?Te=Ee.response.timeoutView:Ee&&Ee.timeoutView&&(Te=Ee.timeoutView),f(Ne=>{const we={id:`timeout_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"agent",name:ee,type:"agent"},metadata:{type:"timeoutView",view:Te||h.jsx($N,{})}};return e&&typeof e.addChatMessage=="function"&&e.addChatMessage(we),[...Ne,we]}),setTimeout(()=>{e.getCurrentInteraction()||b(null)},100)},ge=async Ee=>{console.log("ChatView: RPC interaction dismissed:",Ee),console.log("ChatView: Current interaction before dismiss:",I==null?void 0:I.methodName),b(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages after dismissal"),f(Te=>{const Ne=[...Te];return v.forEach(we=>{var vt;if(!Ne.some(He=>He.id===we.id)&&(Ne.push(we),we.sender.type==="agent"&&(E(He=>new Set(He).add(we.id)),!((vt=we.metadata)!=null&&vt.streaming)))){const He=we.content.length*35+1e3;setTimeout(()=>{E(bt=>{const F=new Set(bt);return F.delete(we.id),F})},He)}}),Ne}),_([]),setTimeout(()=>{L&&S(!0)},0)),setTimeout(()=>{const Te=e.getCurrentInteraction();console.log("ChatView: Latest interaction from client after dismiss:",(Te==null?void 0:Te.methodName)||"null"),Te===null&&b(null)},50),console.log("ChatView: Set currentInteraction to null after dismiss")};return e.on("rpc.interaction.started",K),e.on("rpc.interaction.completed",ye),e.on("rpc.interaction.timeout",me),e.on("rpc.interaction.dismissed",ge),()=>{e.off("rpc.interaction.started",K),e.off("rpc.interaction.completed",ye),e.off("rpc.interaction.timeout",me),e.off("rpc.interaction.dismissed",ge)}},[e,L,S,ee,v]),D.useEffect(()=>{const K=()=>{if(console.log("ChatView: Agent is thinking"),I){console.log("ChatView: Suppressing thinking indicator due to active interaction:",I.methodName);return}g(!0)},ye=()=>{console.log("ChatView: Agent is speaking"),g(!1)};return e.on("agent.thinking",K),e.on("agent.speaking",ye),()=>{e.off("agent.thinking",K),e.off("agent.speaking",ye)}},[e,I]),D.useEffect(()=>{const K=e.getCurrentInteraction();K?(console.log("ChatView: Restoring interaction state on mount/client change:",K.methodName),b(K)):b(null)},[e]),D.useEffect(()=>{console.log("ChatView: Display type changed to:",i,"Current interaction:",(I==null?void 0:I.methodName)||"none")},[i,I]);const $=async K=>{try{I&&(console.log("ChatView: Dismissing active interaction due to user message send"),e.dismissCurrentInteraction(),b(null)),await e.sendChatMessage(K)}catch(ye){console.error("Failed to send message:",ye)}},q=async K=>{try{I&&(console.log("ChatView: Dismissing active interaction due to user attachment send"),e.dismissCurrentInteraction(),b(null)),await e.sendAttachments(K),console.log("Attachments sent successfully:",K.map(ye=>ye.name))}catch(ye){console.error("Failed to send attachments:",ye)}},[B,Q]=D.useState([]);D.useEffect(()=>{const K=ye=>{Q(Array.isArray(ye)?ye:["tes","hello how are you","algebra make me learn that ","what is the meaning of life"])};return e.on("suggested.response",K),()=>{e.off("suggested.response",K)}},[e]);const te=M&&k?"fullscreen":i,ae=te==="fullscreen"?M&&k?"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",de=te==="fullscreen"?M&&k?"flex items-center w-full justify-between px-3 h-11 bg-black/80 text-white border-b border-gray-700":`flex items-center w-full justify-between px-5 h-12 border-b ${H.chatHeader.container}`:`flex items-center w-full justify-between px-4 h-12 border-b ${H.chatHeader.container}`,De=te==="fullscreen"?M&&k?"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",U="flex-shrink-0 !w-full",Ce=()=>{N(!1),n&&n()};return h.jsxs("div",{className:`${ae} relative`,children:[h.jsx("div",{className:de,children:h.jsxs("div",{className:"flex items-center justify-between w-full",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("h3",{className:`font-semibold text-sm leading-tight ${M&&k?"text-white":H.text.primary}`,children:ee})}),s&&u&&h.jsx("div",{className:"flex-1 flex justify-center",children:h.jsx(ci,{duration:u,theme:t,onTimerExpired:()=>{console.log("Session timer expired")},showIcon:!1,className:"text-xs"})}),n&&h.jsx(Me.button,{onClick:Ce,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-2 rounded-full transition-colors ml-1 ${M&&k?"bg-white/20 hover:bg-white/30 text-white":t==="light"?"bg-gray-100 hover:bg-gray-200 text-gray-600":"bg-gray-700/60 hover:bg-gray-600/60 text-gray-200"}`,"aria-label":"Close chat",children:"✕"})]})}),h.jsxs("div",{ref:O,className:`${De} flex flex-col`,style:{scrollBehavior:"smooth",scrollbarWidth:"none",contain:"layout style paint",overscrollBehavior:"contain"},onScroll:Y,children:[" ",d.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-center py-12",children:[h.jsx(Me.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:P}),h.jsxs("p",{className:`text-base mb-2 ${M&&k?"text-white":H.text.secondary}`,children:[ee," is joining..."]}),h.jsx("p",{className:`text-xs ${M&&k?"text-gray-300":H.text.muted}`,children:"Your conversation will begin shortly"})]}):h.jsx("div",{className:"w-full space-y-3 py-4 flex-1 flex flex-col justify-end",children:h.jsxs("div",{className:"space-y-3",children:[d.map((K,ye)=>{var me,ge;return h.jsx("div",{children:((me=K.metadata)==null?void 0:me.type)==="successView"?h.jsx("div",{className:"flex w-full justify-end mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row-reverse flex items-end gap-3 max-w-[85%] min-w-0",children:[h.jsx(Me.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"}),h.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 ${H.chatMessage.own} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[K.metadata.view,h.jsx("div",{className:`text-xs ${H.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:K.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((ge=K.metadata)==null?void 0:ge.type)==="timeoutView"?h.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.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:P}),h.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 ${H.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[K.metadata.view,h.jsx("div",{className:`text-xs ${H.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:K.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):h.jsx(DN,{message:K,theme:t,isOwn:K.sender.type==="participant",isStreaming:y.has(K.id)})},K.id)}),p&&!I&&h.jsx(Me.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:d.length*.1},className:"flex w-full justify-start mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.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:P}),h.jsx("div",{className:`relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover ${H.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:h.jsx("span",{className:"inline-flex items-center",children:[0,1,2].map(K=>h.jsx(Me.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:K*.2,ease:"easeInOut"}},K))})})]})}),I&&I.presentationMode==="embedded"&&h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.jsx(Me.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:P}),h.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 ${H.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[h.jsx(li,{interaction:I,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:W},I.methodName),h.jsx(Me.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:`text-xs ${H.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 `,children:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]}),h.jsx("div",{ref:R})]})})]}),!L&&h.jsx(Me.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onClick:()=>{j(!0),w(!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:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})}),l&&B.length>0&&h.jsx("div",{className:"w-full flex overflow-x-auto gap-2 px-4 py-2 mb-1 scrollbar-hide",children:B.map((K,ye)=>{var me;return h.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
81
+ ${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":((me=H.suggestedResponse)==null?void 0:me.container)||"bg-gradient-to-br from-blue-500 to-purple-600 text-white border-blue-400 hover:from-blue-600 hover:to-purple-700"}
82
+ `,style:{boxShadow:t==="vox"?"0 2px 8px 0 rgba(80,60,200,0.10)":void 0,borderWidth:1},onClick:()=>{$(K),Q([])},children:K},K+ye)})}),I&&I.presentationMode!=="embedded"&&h.jsx(li,{interaction:I,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:W},I.methodName),h.jsx(Me.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:U,children:h.jsx(ON,{onSendMessage:$,onSendAttachments:q,disabled:r,theme:t,onEndChat:o,attachmentsEnabled:c})})]})}const Fm=A.forwardRef(({disabled:e,sessionStarted:t,participantName:n="User",loadingText:r="Waiting for agent to connect...",theme:i="vox",client:o,displayType:s="widget",onBack:a},l)=>{var W,w,V,Y,S;const[c,u]=A.useState(!1),[d,f]=A.useState(!1),[p,g]=A.useState(!1),[m,x]=A.useState(()=>{var $;return(($=o==null?void 0:o.getCurrentInteraction)==null?void 0:$.call(o))||null}),[y,E]=A.useState(()=>t),v=A.useRef(null),_=A.useMemo(()=>{var q;const $=(q=o==null?void 0:o.getCurrentAgentInfo)==null?void 0:q.call(o);return No($)},[o]),k=A.useMemo(()=>Ao(_),[_]);A.useMemo(()=>lp(_),[_]);const C=A.useRef(null),[M,N]=A.useState(64);A.useLayoutEffect(()=>{const $=C.current;if(!$)return;const q=()=>N($.offsetHeight||64);q();const B=new ResizeObserver(()=>q());return B.observe($),window.addEventListener("resize",q),()=>{B.disconnect(),window.removeEventListener("resize",q)}},[]),yv();const{agent:{isActive:I=!1}={}}=o?xl(o):{agent:{isActive:!1}},b=to(o,"microphone"),R=Ct(i),O=A.useMemo(()=>o!=null&&o.getCurrentSession?!!o.getCurrentSession():!1,[o]),L=A.useMemo(()=>o!=null&&o.getIsAgentConnected&&o.getIsAgentConnected()||p,[o,p]),j=I||L;A.useEffect(()=>{j&&y&&E(!1)},[j,y]),A.useEffect(()=>{if(t&&!j){const $=setTimeout(()=>{O&&!j&&(g(!0),f(!1))},5e3),q=setTimeout(()=>{j||f(!0)},3e4);return()=>{clearTimeout($),clearTimeout(q)}}else j&&f(!1)},[t,j,O]),A.useEffect(()=>{if(!o)return;const $=()=>{x(null),u(!1),f(!1)};return o.on("connection.disconnected",$),()=>o.off("connection.disconnected",$)},[o]),A.useEffect(()=>{if(!o)return;const $=()=>{g(!0),f(!1),E(!1)},q=$,B=$,Q=()=>{g(!1),t&&E(!0)};return o.on("agent.connected",$),o.on("agent.speaking",q),o.on("agent.thinking",B),o.on("connection.disconnected",Q),()=>{o.off("agent.connected",$),o.off("agent.speaking",q),o.off("agent.thinking",B),o.off("connection.disconnected",Q)}},[o,t]),A.useEffect(()=>{if(!o)return;const $=()=>x(o.getCurrentInteraction()),q=()=>x(null);return o.on("rpc.interaction.started",$),o.on("rpc.interaction.completed",q),o.on("rpc.interaction.timeout",q),o.on("rpc.interaction.dismissed",q),()=>{o.off("rpc.interaction.started",$),o.off("rpc.interaction.completed",q),o.off("rpc.interaction.timeout",q),o.off("rpc.interaction.dismissed",q)}},[o]),A.useEffect(()=>{var q;if(!o)return;const $=(q=o.getCurrentInteraction)==null?void 0:q.call(o);x($||null)},[o]),A.useEffect(()=>{var q,B;const $=((B=(q=o==null?void 0:o.getCurrentSession)==null?void 0:q.call(o))==null?void 0:B.id)||null;v.current,v.current=$},[o]),A.useEffect(()=>{m&&c&&u(!1)},[m,c]);const H=A.useCallback($=>{},[]),ie=A.useCallback(()=>{var $,q,B;try{m&&(x(null),($=o==null?void 0:o.dismissCurrentInteraction)==null||$.call(o)),u(!1),f(!1),(q=o==null?void 0:o.endSession)==null||q.call(o),(B=o==null?void 0:o.disconnect)==null||B.call(o),a==null||a()}catch(Q){console.error("Failed to end call:",Q),x(null),u(!1),f(!1),a==null||a()}},[o,m,a]),ee=et("w-full flex flex-col items-center justify-center",s==="fullscreen"?"w-full max-w-none mx-0 h-full":"w-full mx-auto",R.main,s==="fullscreen"?"max-w-none":"","overflow-hidden h-full"),P=a&&(s==="popup"||s==="fullscreen");return y?h.jsx("main",{ref:l,className:et(ee,"relative",e&&"pointer-events-none opacity-50"),children:(P||k)&&h.jsxs("div",{className:`flex items-center justify-between w-full p-4 border-b ${((W=R.chatHeader)==null?void 0:W.container)||"border-gray-200"}`,children:[h.jsx("div",{children:h.jsx("h3",{className:`font-semibold ${R.text.primary}`,children:"Voice Session"})}),k&&h.jsx(ci,{duration:k,theme:i,onTimerExpired:()=>{console.log("Session timer expired")}})]})}):h.jsxs("main",{ref:l,className:et(ee,"relative",e&&"pointer-events-none opacity-50"),style:{minHeight:0},children:[(P||k)&&h.jsxs("div",{className:`flex items-center justify-between w-full p-4 border-b ${((w=R.chatHeader)==null?void 0:w.container)||"border-gray-200"}`,children:[h.jsx("div",{children:h.jsx("h3",{className:`font-semibold ${R.text.primary}`,children:"Voice Session"})}),k&&h.jsx(ci,{duration:k,theme:i,onTimerExpired:()=>{console.log("Session timer expired")}})]}),h.jsxs("div",{className:"w-full flex-1 flex flex-col items-center px-0 min-h-0 overflow-hidden",children:[!j&&h.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full min-h-[180px]",children:[h.jsx(Me.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:h.jsx(vl,{className:R.spinner,weight:"bold"})}),h.jsx(Me.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-sm opacity-80 ${R.text.muted} text-center max-w-xs`,children:d?"Agent is taking longer than expected...":r}),h.jsx(Me.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${R.text.muted} mt-2 text-center opacity-60`,children:d?"Please check your connection or try again.":"Agent is connecting... This may take a moment."}),d&&a&&h.jsx(Me.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:a,className:`mt-4 px-4 py-2 rounded-lg ${((V=R.chatHeader)==null?void 0:V.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]}),j&&h.jsxs(h.Fragment,{children:[c&&h.jsx("div",{className:et("absolute left-0 right-0 top-0 flex flex-col transition-[opacity,translate] duration-300 ease-out z-10",i==="light"?"bg-white":"bg-gray-900/95 backdrop-blur-sm","translate-y-0 opacity-100 delay-200"),style:{bottom:`${M}px`},children:h.jsx(Vl,{client:o,theme:i,displayType:s==="fullscreen"?"fullscreen":"widget",disabled:e,onBack:()=>u(!1),showTimer:!1})}),!c&&h.jsxs("div",{className:et("flex-1 flex flex-col items-center w-full h-full min-h-0",(m==null?void 0:m.presentationMode)==="embedded"?"justify-end":"justify-center"),children:[h.jsx(Me.div,{className:"w-full flex justify-center",animate:{y:(m==null?void 0:m.presentationMode)==="embedded"?-8:0},transition:{duration:.3,ease:"easeOut"},children:h.jsx(pv,{chatOpen:c,client:o},`media-tiles-${((S=(Y=o==null?void 0:o.getCurrentSession)==null?void 0:Y.call(o))==null?void 0:S.id)||"no-session"}`)}),h.jsx(Sr,{mode:"wait",children:m&&m.presentationMode==="embedded"&&h.jsx(Me.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:et("w-full relative mt-4 flex justify-center",s==="fullscreen"?"max-w-4xl":"max-w-md"),children:h.jsx("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl border border-white/20 shadow-lg overflow-hidden",children:h.jsx(li,{interaction:m,theme:i,onDismiss:()=>{var $;return($=o==null?void 0:o.dismissCurrentInteraction)==null?void 0:$.call(o)},client:o,addLocalMessage:H})})},`embedded-${m.methodName}`)})]})]})]}),h.jsx(Sr,{mode:"wait",children:m&&m.presentationMode!=="embedded"&&!c&&h.jsx("div",{className:et("absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm",s==="fullscreen"?"bg-black/70":"bg-black/50"),children:h.jsx(Me.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},className:et("relative w-full overflow-hidden",s==="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:h.jsx(li,{interaction:m,theme:i,onDismiss:()=>{var $;return($=o==null?void 0:o.dismissCurrentInteraction)==null?void 0:$.call(o)},client:o,addLocalMessage:H})},`modal-${m.methodName}`)})}),h.jsx("div",{ref:C,className:"relative z-30 mt-auto w-full",children:h.jsx(VN,{onToggleMicrophone:()=>b.toggle(),onToggleChat:()=>u(!c),onEndCall:ie,theme:i,microphoneEnabled:b.enabled,chatOpen:c,isMicrophoneLoading:b.pending,disabled:e})})]})});Fm.displayName="SessionView";function VN({onToggleMicrophone:e,onToggleChat:t,onEndCall:n,theme:r,microphoneEnabled:i=!0,chatOpen:o,isMicrophoneLoading:s=!1,disabled:a}){var c,u,d,f,p;const l=Ct(r);return h.jsxs("div",{className:et("flex items-center justify-center gap-3 px-3 py-2 w-full backdrop-blur-xl border-t",r==="light"?"bg-white/95 border-gray-200":"bg-gray-900/90 border-gray-700"),children:[e&&h.jsx("button",{onClick:e,disabled:a||s,className:`p-3 rounded-full transition-all duration-200 ${i?((c=l.video)==null?void 0:c.controlEnabled)||"bg-green-500 text-white":((u=l.video)==null?void 0:u.controlDisabled)||"bg-red-500 text-white"} ${a?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:i?"Mute microphone":"Unmute microphone",children:s?h.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):i?h.jsx(Ge.Mic,{className:"w-5 h-5"}):h.jsx(Ge.MicOff,{className:"w-5 h-5"})}),h.jsx("button",{onClick:t,disabled:a,className:`relative p-3 rounded-full transition-all duration-200 ${o?((d=l.video)==null?void 0:d.controlEnabled)||"bg-blue-500 text-white":((f=l.video)==null?void 0:f.controlDisabled)||"bg-gray-500 text-white"} ${a?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:o?"Hide transcription":"Show transcription",children:h.jsx(Ge.MessageCircle,{className:"w-5 h-5"})}),n&&h.jsx("button",{onClick:n,disabled:a,className:`p-3 rounded-full transition-all duration-200 ${((p=l.video)==null?void 0:p.endCall)||"bg-red-500 text-white hover:bg-red-600"} ${a?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"End call",children:h.jsx(Ge.PhoneOff,{className:"w-5 h-5"})})]})}function zN({onToggleMicrophone:e,onToggleCamera:t,onToggleScreenShare:n,onToggleChat:r,onEndCall:i,theme:o,microphoneEnabled:s,cameraEnabled:a,screenShareEnabled:l,chatOpen:c,isMicrophoneLoading:u,isCameraLoading:d,isScreenShareLoading:f,disabled:p,userVideoEnabled:g=!0,screenshareEnabled:m=!0}){const x=Ct(o);return h.jsxs("div",{className:et("flex items-center justify-center gap-3 px-3 py-2 w-full backdrop-blur-xl border-t",o==="light"?"bg-white/95 border-gray-200":"bg-gray-900/90 border-gray-700"),children:[h.jsx("button",{onClick:e,disabled:p||u,className:`p-3 rounded-full transition-all duration-200 ${s?x.video.controlEnabled:x.video.controlDisabled} ${p?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:s?"Mute microphone":"Unmute microphone",children:u?h.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):s?h.jsx(Ge.Mic,{className:"w-5 h-5"}):h.jsx(Ge.MicOff,{className:"w-5 h-5"})}),g&&h.jsx("button",{onClick:t,disabled:p||d,className:`p-3 rounded-full transition-all duration-200 ${a?x.video.controlEnabled:x.video.controlDisabled} ${p?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:a?"Turn off camera":"Turn on camera",children:d?h.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):a?h.jsx(Ge.Camera,{className:"w-5 h-5"}):h.jsx(Ge.CameraOff,{className:"w-5 h-5"})}),m&&h.jsx("button",{onClick:n,disabled:p||f,className:`p-3 rounded-full transition-all duration-200 ${l?x.video.controlEnabled:x.video.controlDisabled} ${p?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:l?"Stop screen share":"Share screen",children:f?h.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"}):h.jsx(Ge.Monitor,{className:"w-5 h-5"})}),h.jsx("button",{onClick:r,disabled:p,className:`relative p-3 rounded-full transition-all duration-200 ${c?x.video.controlEnabled:x.video.controlDisabled} ${p?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:c?"Hide chat":"Show chat & transcription",children:h.jsx(Ge.MessageCircle,{className:"w-5 h-5"})}),i&&h.jsx("button",{onClick:i,disabled:p,className:`p-3 rounded-full transition-all duration-200 ${x.video.endCall} ${p?"opacity-50 cursor-not-allowed":"hover:scale-105"}`,title:"End call",children:h.jsx(Ge.PhoneOff,{className:"w-5 h-5"})})]})}function Fd({trackRef:e,participant:t,isLocal:n=!1,className:r="",theme:i}){var l;const o=Ct(i),s=(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 h.jsxs("div",{className:`relative rounded-lg overflow-hidden ${o.video.tile} ${r}`,children:[a?h.jsx(Ft.VideoTrack,{trackRef:e,className:"w-full h-full object-cover"}):h.jsx("div",{className:`w-full h-full flex items-center justify-center ${o.video.placeholder}`,children:h.jsx("div",{className:"text-center",children:h.jsx("div",{className:`w-16 h-16 mx-auto mb-2 rounded-full flex items-center justify-center ${o.video.avatar}`,children:h.jsx(Ge.User,{className:"w-8 h-8"})})})}),h.jsx("div",{className:`absolute bottom-2 left-2 px-2 py-1 rounded text-xs ${o.video.nameOverlay}`,children:s}),((l=e==null?void 0:e.publication)==null?void 0:l.isMuted)&&h.jsx("div",{className:`absolute top-2 right-2 p-1 rounded ${o.video.mutedIndicator}`,children:h.jsx(Ge.CameraOff,{className:"w-4 h-4"})})]})}function UN({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:i,onEndCall:o}){var $;const s=Ct(t),[a,l]=D.useState(!1),[c,u]=D.useState(!1),d=D.useMemo(()=>{const q=e.getCurrentAgentInfo();return No(q)},[e]),{userVideoEnabled:f,agentAvatarEnabled:p,screenshareEnabled:g}=D.useMemo(()=>sp(d),[d]),m=D.useMemo(()=>Ao(d),[d]),x=D.useRef(null),[y,E]=D.useState(64);D.useLayoutEffect(()=>{const q=x.current;if(!q)return;const B=()=>E(q.offsetHeight||64);B();const Q=new ResizeObserver(()=>B());return Q.observe(q),window.addEventListener("resize",B),()=>{Q.disconnect(),window.removeEventListener("resize",B)}},[]);const[v,_]=D.useState(null),k=Cw(e),{videoTrackRefs:C,screenShareTrackRefs:M}=_w(e),{agent:{isActive:N=!1}={},state:I="idle",audioTrack:b}=e?xl(e):{agent:{isActive:!1},state:"idle",audioTrack:null},R=D.useMemo(()=>e.getRemoteParticipants(),[e,k]),O=to(e,"microphone"),L=to(e,"camera"),j=to(e,"screenShare"),H=D.useCallback(async()=>{L.pending||await L.toggle()},[L]),ie=D.useCallback(async()=>{j.pending||await j.toggle()},[j]),ee=D.useCallback(()=>{l(q=>!q)},[]),P=D.useCallback(()=>{o?o():n&&n()},[o,n]);D.useEffect(()=>{if(!e)return;const q=B=>{console.log("📺 Video: Interactive UI state updated:",B),_(B)};return e.on("interactive.ui.update",q),e.on("interactive.ui.show",q),()=>{e.off("interactive.ui.update",q),e.off("interactive.ui.show",q)}},[e]),D.useEffect(()=>{if(N)u(!1);else{const q=setTimeout(()=>{N||u(!0)},3e4);return()=>{clearTimeout(q)}}},[N]);const W=k==null?void 0:k.localParticipant,w=D.useMemo(()=>(e?e.getCameraTrackRefs():[]).find(q=>q.participant===W),[e,W]),Y=C.filter(q=>q.participant!==W)[0],S=D.useMemo(()=>(M||[]).find(q=>q.participant===W),[M,W]);return h.jsxs("div",{className:`flex flex-col h-full ${s.video.container} relative`,children:[h.jsxs("div",{className:`flex items-center justify-between p-4 border-b ${s.video.header}`,children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:`w-3 h-3 rounded-full ${s.video.statusDot}`}),h.jsx("span",{className:"font-medium",children:"Video Call"}),h.jsxs("span",{className:"text-sm opacity-70",children:[R.length+1," participant",R.length!==0?"s":""]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[m&&h.jsx(ci,{duration:m,theme:t,onTimerExpired:()=>{console.log("Session timer expired")}}),h.jsx("button",{className:`p-2 rounded-lg transition-colors ${s.video.headerButton}`,title:"Layout options",children:h.jsx(Ge.LayoutGrid,{className:"w-4 h-4"})})]})]}),h.jsxs("div",{className:"relative flex-1 min-h-0",children:[!N&&h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsxs("div",{className:"text-center",children:[h.jsx(Me.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 mx-auto",children:h.jsx(vl,{className:s.spinner,weight:"bold"})}),h.jsx(Me.p,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-lg opacity-70 ${s.text.muted}`,children:c?"Agent is taking longer than expected...":"Waiting for agent to join..."}),h.jsx(Me.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${s.text.muted} mt-2 opacity-60`,children:c?"Please check your connection or try again.":"Agent is connecting... This may take a moment."}),c&&n&&h.jsx(Me.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:n,className:`mt-4 px-4 py-2 rounded-lg ${(($=s.chatHeader)==null?void 0:$.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]})}),N&&!a&&h.jsx("div",{className:"p-4 min-h-0 h-full",children:h.jsxs("div",{className:"relative w-full h-full rounded-lg overflow-hidden",children:[p?Y?h.jsx(Fd,{trackRef:Y,participant:Y.participant,isLocal:!1,theme:t,className:"w-full h-full"}):h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx(Ge.Users,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),h.jsx("p",{className:"text-lg opacity-70",children:"Waiting for agent video..."})]})}):h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsx("div",{className:"text-center",children:h.jsxs("div",{className:"mb-4",children:[h.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-gradient-to-br from-[#6721a4] to-[#5c64f6] flex items-center justify-center",children:h.jsx(Ge.User,{className:"w-8 h-8 text-white"})}),N&&(b?h.jsx(Ft.BarVisualizer,{barCount:5,state:I,options:{minHeight:5},trackRef:b,className:"flex items-center justify-center gap-1",children:h.jsx("span",{className:et(["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]"])})}):h.jsx("div",{className:"flex items-center justify-center gap-1",children:Array.from({length:5}).map((q,B)=>h.jsx("span",{className:et(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear",I==="speaking"&&"bg-[#5c64f6]",I==="thinking"&&"animate-pulse bg-yellow-500"])},B))}))]})})}),S&&h.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:h.jsxs("div",{className:"relative w-full h-full bg-black/40",children:[h.jsx(Ft.VideoTrack,{trackRef:S,className:"w-full h-full object-contain"}),h.jsx("div",{className:`absolute top-1 left-1 px-1.5 py-0.5 rounded text-xs ${s.video.nameOverlay}`,children:h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(Ge.Monitor,{className:"w-3 h-3"}),h.jsx("span",{className:"text-xs",children:"Sharing"})]})})]})}),w&&f&&h.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:h.jsx(Fd,{trackRef:w,participant:W||void 0,isLocal:!0,theme:t,className:"w-full h-full"})})]})})]}),h.jsx(Sr,{mode:"wait",children:a&&h.jsx(Me.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeOut"},className:et("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:`${y}px`},children:h.jsx(Vl,{client:e,theme:t,displayType:i==="fullscreen"?"fullscreen":"widget",disabled:r,onBack:()=>l(!1),showTimer:!1})})}),h.jsx("div",{ref:x,className:"relative z-30 mt-auto",children:h.jsx(zN,{onToggleMicrophone:()=>O.toggle(),onToggleCamera:H,onToggleScreenShare:ie,onToggleChat:ee,onEndCall:P,theme:t,microphoneEnabled:O.enabled,cameraEnabled:L.enabled,screenShareEnabled:j.enabled,chatOpen:a,isMicrophoneLoading:O.pending,isCameraLoading:L.pending,isScreenShareLoading:j.pending,disabled:r,userVideoEnabled:f,screenshareEnabled:g})})]})}const Bd=e=>e,HN=()=>{let e=Bd;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Bd}}},WN=HN();function On(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 Xn(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":On(7));return e.charAt(0).toUpperCase()+e.slice(1)}var Wi={exports:{}},Gi={exports:{}},ze={};/** @license React v16.13.1
83
83
  * react-is.production.min.js
84
84
  *
85
85
  * Copyright (c) Facebook, Inc. and its affiliates.
86
86
  *
87
87
  * This source code is licensed under the MIT license found in the
88
88
  * LICENSE file in the root directory of this source tree.
89
- */var jd;function KN(){if(jd)return ze;jd=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,o=e?Symbol.for("react.profiler"):60114,s=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,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function v(S){if(typeof S=="object"&&S!==null){var C=S.$$typeof;switch(C){case t:switch(S=S.type,S){case l:case c:case r:case o:case i:case d:return S;default:switch(S=S&&S.$$typeof,S){case a:case u:case g:case p:case s:return S;default:return C}}case n:return C}}}function _(S){return v(S)===c}return ze.AsyncMode=l,ze.ConcurrentMode=c,ze.ContextConsumer=a,ze.ContextProvider=s,ze.Element=t,ze.ForwardRef=u,ze.Fragment=r,ze.Lazy=g,ze.Memo=p,ze.Portal=n,ze.Profiler=o,ze.StrictMode=i,ze.Suspense=d,ze.isAsyncMode=function(S){return _(S)||v(S)===l},ze.isConcurrentMode=_,ze.isContextConsumer=function(S){return v(S)===a},ze.isContextProvider=function(S){return v(S)===s},ze.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===t},ze.isForwardRef=function(S){return v(S)===u},ze.isFragment=function(S){return v(S)===r},ze.isLazy=function(S){return v(S)===g},ze.isMemo=function(S){return v(S)===p},ze.isPortal=function(S){return v(S)===n},ze.isProfiler=function(S){return v(S)===o},ze.isStrictMode=function(S){return v(S)===i},ze.isSuspense=function(S){return v(S)===d},ze.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===c||S===o||S===i||S===d||S===f||typeof S=="object"&&S!==null&&(S.$$typeof===g||S.$$typeof===p||S.$$typeof===s||S.$$typeof===a||S.$$typeof===u||S.$$typeof===x||S.$$typeof===y||S.$$typeof===k||S.$$typeof===m)},ze.typeOf=v,ze}var Ue={};/** @license React v16.13.1
89
+ */var jd;function GN(){if(jd)return ze;jd=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,o=e?Symbol.for("react.profiler"):60114,s=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,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function v(k){if(typeof k=="object"&&k!==null){var C=k.$$typeof;switch(C){case t:switch(k=k.type,k){case l:case c:case r:case o:case i:case d:return k;default:switch(k=k&&k.$$typeof,k){case a:case u:case g:case p:case s:return k;default:return C}}case n:return C}}}function _(k){return v(k)===c}return ze.AsyncMode=l,ze.ConcurrentMode=c,ze.ContextConsumer=a,ze.ContextProvider=s,ze.Element=t,ze.ForwardRef=u,ze.Fragment=r,ze.Lazy=g,ze.Memo=p,ze.Portal=n,ze.Profiler=o,ze.StrictMode=i,ze.Suspense=d,ze.isAsyncMode=function(k){return _(k)||v(k)===l},ze.isConcurrentMode=_,ze.isContextConsumer=function(k){return v(k)===a},ze.isContextProvider=function(k){return v(k)===s},ze.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===t},ze.isForwardRef=function(k){return v(k)===u},ze.isFragment=function(k){return v(k)===r},ze.isLazy=function(k){return v(k)===g},ze.isMemo=function(k){return v(k)===p},ze.isPortal=function(k){return v(k)===n},ze.isProfiler=function(k){return v(k)===o},ze.isStrictMode=function(k){return v(k)===i},ze.isSuspense=function(k){return v(k)===d},ze.isValidElementType=function(k){return typeof k=="string"||typeof k=="function"||k===r||k===c||k===o||k===i||k===d||k===f||typeof k=="object"&&k!==null&&(k.$$typeof===g||k.$$typeof===p||k.$$typeof===s||k.$$typeof===a||k.$$typeof===u||k.$$typeof===x||k.$$typeof===y||k.$$typeof===E||k.$$typeof===m)},ze.typeOf=v,ze}var Ue={};/** @license React v16.13.1
90
90
  * react-is.development.js
91
91
  *
92
92
  * Copyright (c) Facebook, Inc. and its affiliates.
93
93
  *
94
94
  * This source code is licensed under the MIT license found in the
95
95
  * LICENSE file in the root directory of this source tree.
96
- */var $d;function qN(){return $d||($d=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,o=e?Symbol.for("react.profiler"):60114,s=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,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function v(G){return typeof G=="string"||typeof G=="function"||G===r||G===c||G===o||G===i||G===d||G===f||typeof G=="object"&&G!==null&&(G.$$typeof===g||G.$$typeof===p||G.$$typeof===s||G.$$typeof===a||G.$$typeof===u||G.$$typeof===x||G.$$typeof===y||G.$$typeof===k||G.$$typeof===m)}function _(G){if(typeof G=="object"&&G!==null){var Se=G.$$typeof;switch(Se){case t:var Z=G.type;switch(Z){case l:case c:case r:case o:case i:case d:return Z;default:var te=Z&&Z.$$typeof;switch(te){case a:case u:case g:case p:case s:return te;default:return Se}}case n:return Se}}}var S=l,C=c,M=a,N=s,I=t,b=u,R=r,O=g,D=p,$=n,U=o,re=i,ne=d,j=!1;function W(G){return j||(j=!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(G)||_(G)===l}function w(G){return _(G)===c}function F(G){return _(G)===a}function Y(G){return _(G)===s}function E(G){return typeof G=="object"&&G!==null&&G.$$typeof===t}function B(G){return _(G)===u}function z(G){return _(G)===r}function K(G){return _(G)===g}function q(G){return _(G)===p}function me(G){return _(G)===n}function Q(G){return _(G)===o}function le(G){return _(G)===i}function he(G){return _(G)===d}Ue.AsyncMode=S,Ue.ConcurrentMode=C,Ue.ContextConsumer=M,Ue.ContextProvider=N,Ue.Element=I,Ue.ForwardRef=b,Ue.Fragment=R,Ue.Lazy=O,Ue.Memo=D,Ue.Portal=$,Ue.Profiler=U,Ue.StrictMode=re,Ue.Suspense=ne,Ue.isAsyncMode=W,Ue.isConcurrentMode=w,Ue.isContextConsumer=F,Ue.isContextProvider=Y,Ue.isElement=E,Ue.isForwardRef=B,Ue.isFragment=z,Ue.isLazy=K,Ue.isMemo=q,Ue.isPortal=me,Ue.isProfiler=Q,Ue.isStrictMode=le,Ue.isSuspense=he,Ue.isValidElementType=v,Ue.typeOf=_}()),Ue}var Vd;function jm(){return Vd||(Vd=1,process.env.NODE_ENV==="production"?Gi.exports=KN():Gi.exports=qN()),Gi.exports}/*
96
+ */var $d;function KN(){return $d||($d=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,o=e?Symbol.for("react.profiler"):60114,s=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,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function v(U){return typeof U=="string"||typeof U=="function"||U===r||U===c||U===o||U===i||U===d||U===f||typeof U=="object"&&U!==null&&(U.$$typeof===g||U.$$typeof===p||U.$$typeof===s||U.$$typeof===a||U.$$typeof===u||U.$$typeof===x||U.$$typeof===y||U.$$typeof===E||U.$$typeof===m)}function _(U){if(typeof U=="object"&&U!==null){var Ce=U.$$typeof;switch(Ce){case t:var K=U.type;switch(K){case l:case c:case r:case o:case i:case d:return K;default:var ye=K&&K.$$typeof;switch(ye){case a:case u:case g:case p:case s:return ye;default:return Ce}}case n:return Ce}}}var k=l,C=c,M=a,N=s,I=t,b=u,R=r,O=g,L=p,j=n,H=o,ie=i,ee=d,P=!1;function W(U){return P||(P=!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(U)||_(U)===l}function w(U){return _(U)===c}function V(U){return _(U)===a}function Y(U){return _(U)===s}function S(U){return typeof U=="object"&&U!==null&&U.$$typeof===t}function $(U){return _(U)===u}function q(U){return _(U)===r}function B(U){return _(U)===g}function Q(U){return _(U)===p}function te(U){return _(U)===n}function ae(U){return _(U)===o}function de(U){return _(U)===i}function De(U){return _(U)===d}Ue.AsyncMode=k,Ue.ConcurrentMode=C,Ue.ContextConsumer=M,Ue.ContextProvider=N,Ue.Element=I,Ue.ForwardRef=b,Ue.Fragment=R,Ue.Lazy=O,Ue.Memo=L,Ue.Portal=j,Ue.Profiler=H,Ue.StrictMode=ie,Ue.Suspense=ee,Ue.isAsyncMode=W,Ue.isConcurrentMode=w,Ue.isContextConsumer=V,Ue.isContextProvider=Y,Ue.isElement=S,Ue.isForwardRef=$,Ue.isFragment=q,Ue.isLazy=B,Ue.isMemo=Q,Ue.isPortal=te,Ue.isProfiler=ae,Ue.isStrictMode=de,Ue.isSuspense=De,Ue.isValidElementType=v,Ue.typeOf=_}()),Ue}var Vd;function Bm(){return Vd||(Vd=1,process.env.NODE_ENV==="production"?Gi.exports=GN():Gi.exports=KN()),Gi.exports}/*
97
97
  object-assign
98
98
  (c) Sindre Sorhus
99
99
  @license MIT
100
- */var Fs,zd;function YN(){if(zd)return Fs;zd=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[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 Fs=i()?Object.assign:function(o,s){for(var a,l=r(o),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 f=0;f<c.length;f++)n.call(a,c[f])&&(l[c[f]]=a[c[f]])}}return l},Fs}var Bs,Ud;function zl(){if(Ud)return Bs;Ud=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Bs=e,Bs}var js,Hd;function $m(){return Hd||(Hd=1,js=Function.call.bind(Object.prototype.hasOwnProperty)),js}var $s,Wd;function ZN(){if(Wd)return $s;Wd=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=zl(),n={},r=$m();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in o)if(r(o,u)){var d;try{if(typeof o[u]!="function"){var f=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=o[u](s,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 p=c?c():"";e("Failed "+a+" type: "+d.message+(p??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},$s=i,$s}var Vs,Gd;function XN(){if(Gd)return Vs;Gd=1;var e=jm(),t=YN(),n=zl(),r=$m(),i=ZN(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return Vs=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(w){var F=w&&(c&&w[c]||w[u]);if(typeof F=="function")return F}var f="<<anonymous>>",p={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:k(),arrayOf:v,element:_(),elementType:S(),instanceOf:C,node:b(),objectOf:N,oneOf:M,oneOfType:I,shape:O,exact:D};function g(w,F){return w===F?w!==0||1/w===1/F:w!==w&&F!==F}function m(w,F){this.message=w,this.data=F&&typeof F=="object"?F:{},this.stack=""}m.prototype=Error.prototype;function x(w){if(process.env.NODE_ENV!=="production")var F={},Y=0;function E(z,K,q,me,Q,le,he){if(me=me||f,le=le||q,he!==n){if(l){var G=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 G.name="Invariant Violation",G}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Se=me+":"+q;!F[Se]&&Y<3&&(o("You are manually calling a React.PropTypes validation function for the `"+le+"` prop on `"+me+"`. 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."),F[Se]=!0,Y++)}}return K[q]==null?z?K[q]===null?new m("The "+Q+" `"+le+"` is marked as required "+("in `"+me+"`, but its value is `null`.")):new m("The "+Q+" `"+le+"` is marked as required in "+("`"+me+"`, but its value is `undefined`.")):null:w(K,q,me,Q,le)}var B=E.bind(null,!1);return B.isRequired=E.bind(null,!0),B}function y(w){function F(Y,E,B,z,K,q){var me=Y[E],Q=re(me);if(Q!==w){var le=ne(me);return new m("Invalid "+z+" `"+K+"` of type "+("`"+le+"` supplied to `"+B+"`, expected ")+("`"+w+"`."),{expectedType:w})}return null}return x(F)}function k(){return x(s)}function v(w){function F(Y,E,B,z,K){if(typeof w!="function")return new m("Property `"+K+"` of component `"+B+"` has invalid PropType notation inside arrayOf.");var q=Y[E];if(!Array.isArray(q)){var me=re(q);return new m("Invalid "+z+" `"+K+"` of type "+("`"+me+"` supplied to `"+B+"`, expected an array."))}for(var Q=0;Q<q.length;Q++){var le=w(q,Q,B,z,K+"["+Q+"]",n);if(le instanceof Error)return le}return null}return x(F)}function _(){function w(F,Y,E,B,z){var K=F[Y];if(!a(K)){var q=re(K);return new m("Invalid "+B+" `"+z+"` of type "+("`"+q+"` supplied to `"+E+"`, expected a single ReactElement."))}return null}return x(w)}function S(){function w(F,Y,E,B,z){var K=F[Y];if(!e.isValidElementType(K)){var q=re(K);return new m("Invalid "+B+" `"+z+"` of type "+("`"+q+"` supplied to `"+E+"`, expected a single ReactElement type."))}return null}return x(w)}function C(w){function F(Y,E,B,z,K){if(!(Y[E]instanceof w)){var q=w.name||f,me=W(Y[E]);return new m("Invalid "+z+" `"+K+"` of type "+("`"+me+"` supplied to `"+B+"`, expected ")+("instance of `"+q+"`."))}return null}return x(F)}function M(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function F(Y,E,B,z,K){for(var q=Y[E],me=0;me<w.length;me++)if(g(q,w[me]))return null;var Q=JSON.stringify(w,function(he,G){var Se=ne(G);return Se==="symbol"?String(G):G});return new m("Invalid "+z+" `"+K+"` of value `"+String(q)+"` "+("supplied to `"+B+"`, expected one of "+Q+"."))}return x(F)}function N(w){function F(Y,E,B,z,K){if(typeof w!="function")return new m("Property `"+K+"` of component `"+B+"` has invalid PropType notation inside objectOf.");var q=Y[E],me=re(q);if(me!=="object")return new m("Invalid "+z+" `"+K+"` of type "+("`"+me+"` supplied to `"+B+"`, expected an object."));for(var Q in q)if(r(q,Q)){var le=w(q,Q,B,z,K+"."+Q,n);if(le instanceof Error)return le}return null}return x(F)}function I(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var F=0;F<w.length;F++){var Y=w[F];if(typeof Y!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+j(Y)+" at index "+F+"."),s}function E(B,z,K,q,me){for(var Q=[],le=0;le<w.length;le++){var he=w[le],G=he(B,z,K,q,me,n);if(G==null)return null;G.data&&r(G.data,"expectedType")&&Q.push(G.data.expectedType)}var Se=Q.length>0?", expected one of type ["+Q.join(", ")+"]":"";return new m("Invalid "+q+" `"+me+"` supplied to "+("`"+K+"`"+Se+"."))}return x(E)}function b(){function w(F,Y,E,B,z){return $(F[Y])?null:new m("Invalid "+B+" `"+z+"` supplied to "+("`"+E+"`, expected a ReactNode."))}return x(w)}function R(w,F,Y,E,B){return new m((w||"React class")+": "+F+" type `"+Y+"."+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+B+"`.")}function O(w){function F(Y,E,B,z,K){var q=Y[E],me=re(q);if(me!=="object")return new m("Invalid "+z+" `"+K+"` of type `"+me+"` "+("supplied to `"+B+"`, expected `object`."));for(var Q in w){var le=w[Q];if(typeof le!="function")return R(B,z,K,Q,ne(le));var he=le(q,Q,B,z,K+"."+Q,n);if(he)return he}return null}return x(F)}function D(w){function F(Y,E,B,z,K){var q=Y[E],me=re(q);if(me!=="object")return new m("Invalid "+z+" `"+K+"` of type `"+me+"` "+("supplied to `"+B+"`, expected `object`."));var Q=t({},Y[E],w);for(var le in Q){var he=w[le];if(r(w,le)&&typeof he!="function")return R(B,z,K,le,ne(he));if(!he)return new m("Invalid "+z+" `"+K+"` key `"+le+"` supplied to `"+B+"`.\nBad object: "+JSON.stringify(Y[E],null," ")+`
101
- Valid keys: `+JSON.stringify(Object.keys(w),null," "));var G=he(q,le,B,z,K+"."+le,n);if(G)return G}return null}return x(F)}function $(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($);if(w===null||a(w))return!0;var F=d(w);if(F){var Y=F.call(w),E;if(F!==w.entries){for(;!(E=Y.next()).done;)if(!$(E.value))return!1}else for(;!(E=Y.next()).done;){var B=E.value;if(B&&!$(B[1]))return!1}}else return!1;return!0;default:return!1}}function U(w,F){return w==="symbol"?!0:F?F["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&F instanceof Symbol:!1}function re(w){var F=typeof w;return Array.isArray(w)?"array":w instanceof RegExp?"object":U(F,w)?"symbol":F}function ne(w){if(typeof w>"u"||w===null)return""+w;var F=re(w);if(F==="object"){if(w instanceof Date)return"date";if(w instanceof RegExp)return"regexp"}return F}function j(w){var F=ne(w);switch(F){case"array":case"object":return"an "+F;case"boolean":case"date":case"regexp":return"a "+F;default:return F}}function W(w){return!w.constructor||!w.constructor.name?f:w.constructor.name}return p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},Vs}var zs,Kd;function QN(){if(Kd)return zs;Kd=1;var e=zl();function t(){}function n(){}return n.resetWarningCache=t,zs=function(){function r(s,a,l,c,u,d){if(d!==e){var f=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 f.name="Invariant Violation",f}}r.isRequired=r;function i(){return r}var o={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 o.PropTypes=o,o},zs}var qd;function JN(){if(qd)return Wi.exports;if(qd=1,process.env.NODE_ENV!=="production"){var e=jm(),t=!0;Wi.exports=XN()(e.isElement,t)}else Wi.exports=QN()();return Wi.exports}var eA=JN();const Ve=Ro(eA);function tA(e,t,n=void 0){const r={};for(const i in e){const o=e[i];let s="",a=!0;for(let l=0;l<o.length;l+=1){const c=o[l];c&&(s+=(a===!0?"":" ")+t(c),a=!1,n&&n[c]&&(s+=" "+n[c]))}r[i]=s}return r}var Ki={exports:{}},Ke={};/**
100
+ */var Fs,zd;function qN(){if(zd)return Fs;zd=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[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 Fs=i()?Object.assign:function(o,s){for(var a,l=r(o),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 f=0;f<c.length;f++)n.call(a,c[f])&&(l[c[f]]=a[c[f]])}}return l},Fs}var Bs,Ud;function zl(){if(Ud)return Bs;Ud=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Bs=e,Bs}var js,Hd;function jm(){return Hd||(Hd=1,js=Function.call.bind(Object.prototype.hasOwnProperty)),js}var $s,Wd;function YN(){if(Wd)return $s;Wd=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=zl(),n={},r=jm();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in o)if(r(o,u)){var d;try{if(typeof o[u]!="function"){var f=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=o[u](s,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 p=c?c():"";e("Failed "+a+" type: "+d.message+(p??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},$s=i,$s}var Vs,Gd;function ZN(){if(Gd)return Vs;Gd=1;var e=Bm(),t=qN(),n=zl(),r=jm(),i=YN(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return Vs=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(w){var V=w&&(c&&w[c]||w[u]);if(typeof V=="function")return V}var f="<<anonymous>>",p={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:E(),arrayOf:v,element:_(),elementType:k(),instanceOf:C,node:b(),objectOf:N,oneOf:M,oneOfType:I,shape:O,exact:L};function g(w,V){return w===V?w!==0||1/w===1/V:w!==w&&V!==V}function m(w,V){this.message=w,this.data=V&&typeof V=="object"?V:{},this.stack=""}m.prototype=Error.prototype;function x(w){if(process.env.NODE_ENV!=="production")var V={},Y=0;function S(q,B,Q,te,ae,de,De){if(te=te||f,de=de||Q,De!==n){if(l){var U=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 U.name="Invariant Violation",U}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ce=te+":"+Q;!V[Ce]&&Y<3&&(o("You are manually calling a React.PropTypes validation function for the `"+de+"` prop on `"+te+"`. 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."),V[Ce]=!0,Y++)}}return B[Q]==null?q?B[Q]===null?new m("The "+ae+" `"+de+"` is marked as required "+("in `"+te+"`, but its value is `null`.")):new m("The "+ae+" `"+de+"` is marked as required in "+("`"+te+"`, but its value is `undefined`.")):null:w(B,Q,te,ae,de)}var $=S.bind(null,!1);return $.isRequired=S.bind(null,!0),$}function y(w){function V(Y,S,$,q,B,Q){var te=Y[S],ae=ie(te);if(ae!==w){var de=ee(te);return new m("Invalid "+q+" `"+B+"` of type "+("`"+de+"` supplied to `"+$+"`, expected ")+("`"+w+"`."),{expectedType:w})}return null}return x(V)}function E(){return x(s)}function v(w){function V(Y,S,$,q,B){if(typeof w!="function")return new m("Property `"+B+"` of component `"+$+"` has invalid PropType notation inside arrayOf.");var Q=Y[S];if(!Array.isArray(Q)){var te=ie(Q);return new m("Invalid "+q+" `"+B+"` of type "+("`"+te+"` supplied to `"+$+"`, expected an array."))}for(var ae=0;ae<Q.length;ae++){var de=w(Q,ae,$,q,B+"["+ae+"]",n);if(de instanceof Error)return de}return null}return x(V)}function _(){function w(V,Y,S,$,q){var B=V[Y];if(!a(B)){var Q=ie(B);return new m("Invalid "+$+" `"+q+"` of type "+("`"+Q+"` supplied to `"+S+"`, expected a single ReactElement."))}return null}return x(w)}function k(){function w(V,Y,S,$,q){var B=V[Y];if(!e.isValidElementType(B)){var Q=ie(B);return new m("Invalid "+$+" `"+q+"` of type "+("`"+Q+"` supplied to `"+S+"`, expected a single ReactElement type."))}return null}return x(w)}function C(w){function V(Y,S,$,q,B){if(!(Y[S]instanceof w)){var Q=w.name||f,te=W(Y[S]);return new m("Invalid "+q+" `"+B+"` of type "+("`"+te+"` supplied to `"+$+"`, expected ")+("instance of `"+Q+"`."))}return null}return x(V)}function M(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function V(Y,S,$,q,B){for(var Q=Y[S],te=0;te<w.length;te++)if(g(Q,w[te]))return null;var ae=JSON.stringify(w,function(De,U){var Ce=ee(U);return Ce==="symbol"?String(U):U});return new m("Invalid "+q+" `"+B+"` of value `"+String(Q)+"` "+("supplied to `"+$+"`, expected one of "+ae+"."))}return x(V)}function N(w){function V(Y,S,$,q,B){if(typeof w!="function")return new m("Property `"+B+"` of component `"+$+"` has invalid PropType notation inside objectOf.");var Q=Y[S],te=ie(Q);if(te!=="object")return new m("Invalid "+q+" `"+B+"` of type "+("`"+te+"` supplied to `"+$+"`, expected an object."));for(var ae in Q)if(r(Q,ae)){var de=w(Q,ae,$,q,B+"."+ae,n);if(de instanceof Error)return de}return null}return x(V)}function I(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var V=0;V<w.length;V++){var Y=w[V];if(typeof Y!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+P(Y)+" at index "+V+"."),s}function S($,q,B,Q,te){for(var ae=[],de=0;de<w.length;de++){var De=w[de],U=De($,q,B,Q,te,n);if(U==null)return null;U.data&&r(U.data,"expectedType")&&ae.push(U.data.expectedType)}var Ce=ae.length>0?", expected one of type ["+ae.join(", ")+"]":"";return new m("Invalid "+Q+" `"+te+"` supplied to "+("`"+B+"`"+Ce+"."))}return x(S)}function b(){function w(V,Y,S,$,q){return j(V[Y])?null:new m("Invalid "+$+" `"+q+"` supplied to "+("`"+S+"`, expected a ReactNode."))}return x(w)}function R(w,V,Y,S,$){return new m((w||"React class")+": "+V+" type `"+Y+"."+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+$+"`.")}function O(w){function V(Y,S,$,q,B){var Q=Y[S],te=ie(Q);if(te!=="object")return new m("Invalid "+q+" `"+B+"` of type `"+te+"` "+("supplied to `"+$+"`, expected `object`."));for(var ae in w){var de=w[ae];if(typeof de!="function")return R($,q,B,ae,ee(de));var De=de(Q,ae,$,q,B+"."+ae,n);if(De)return De}return null}return x(V)}function L(w){function V(Y,S,$,q,B){var Q=Y[S],te=ie(Q);if(te!=="object")return new m("Invalid "+q+" `"+B+"` of type `"+te+"` "+("supplied to `"+$+"`, expected `object`."));var ae=t({},Y[S],w);for(var de in ae){var De=w[de];if(r(w,de)&&typeof De!="function")return R($,q,B,de,ee(De));if(!De)return new m("Invalid "+q+" `"+B+"` key `"+de+"` supplied to `"+$+"`.\nBad object: "+JSON.stringify(Y[S],null," ")+`
101
+ Valid keys: `+JSON.stringify(Object.keys(w),null," "));var U=De(Q,de,$,q,B+"."+de,n);if(U)return U}return null}return x(V)}function j(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(j);if(w===null||a(w))return!0;var V=d(w);if(V){var Y=V.call(w),S;if(V!==w.entries){for(;!(S=Y.next()).done;)if(!j(S.value))return!1}else for(;!(S=Y.next()).done;){var $=S.value;if($&&!j($[1]))return!1}}else return!1;return!0;default:return!1}}function H(w,V){return w==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function ie(w){var V=typeof w;return Array.isArray(w)?"array":w instanceof RegExp?"object":H(V,w)?"symbol":V}function ee(w){if(typeof w>"u"||w===null)return""+w;var V=ie(w);if(V==="object"){if(w instanceof Date)return"date";if(w instanceof RegExp)return"regexp"}return V}function P(w){var V=ee(w);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function W(w){return!w.constructor||!w.constructor.name?f:w.constructor.name}return p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},Vs}var zs,Kd;function XN(){if(Kd)return zs;Kd=1;var e=zl();function t(){}function n(){}return n.resetWarningCache=t,zs=function(){function r(s,a,l,c,u,d){if(d!==e){var f=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 f.name="Invariant Violation",f}}r.isRequired=r;function i(){return r}var o={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 o.PropTypes=o,o},zs}var qd;function QN(){if(qd)return Wi.exports;if(qd=1,process.env.NODE_ENV!=="production"){var e=Bm(),t=!0;Wi.exports=ZN()(e.isElement,t)}else Wi.exports=XN()();return Wi.exports}var JN=QN();const je=Ro(JN);function eA(e,t,n=void 0){const r={};for(const i in e){const o=e[i];let s="",a=!0;for(let l=0;l<o.length;l+=1){const c=o[l];c&&(s+=(a===!0?"":" ")+t(c),a=!1,n&&n[c]&&(s+=" "+n[c]))}r[i]=s}return r}var Ki={exports:{}},qe={};/**
102
102
  * @license React
103
103
  * react-is.production.js
104
104
  *
@@ -106,7 +106,7 @@ Valid keys: `+JSON.stringify(Object.keys(w),null," "));var G=he(q,le,B,z,K+"."+
106
106
  *
107
107
  * This source code is licensed under the MIT license found in the
108
108
  * LICENSE file in the root directory of this source tree.
109
- */var Yd;function nA(){if(Yd)return Ke;Yd=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"),o=Symbol.for("react.consumer"),s=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"),f=Symbol.for("react.view_transition"),p=Symbol.for("react.client.reference");function g(m){if(typeof m=="object"&&m!==null){var x=m.$$typeof;switch(x){case e:switch(m=m.type,m){case n:case i:case r:case l:case c:case f:return m;default:switch(m=m&&m.$$typeof,m){case s:case a:case d:case u:return m;case o:return m;default:return x}}case t:return x}}}return Ke.ContextConsumer=o,Ke.ContextProvider=s,Ke.Element=e,Ke.ForwardRef=a,Ke.Fragment=n,Ke.Lazy=d,Ke.Memo=u,Ke.Portal=t,Ke.Profiler=i,Ke.StrictMode=r,Ke.Suspense=l,Ke.SuspenseList=c,Ke.isContextConsumer=function(m){return g(m)===o},Ke.isContextProvider=function(m){return g(m)===s},Ke.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===e},Ke.isForwardRef=function(m){return g(m)===a},Ke.isFragment=function(m){return g(m)===n},Ke.isLazy=function(m){return g(m)===d},Ke.isMemo=function(m){return g(m)===u},Ke.isPortal=function(m){return g(m)===t},Ke.isProfiler=function(m){return g(m)===i},Ke.isStrictMode=function(m){return g(m)===r},Ke.isSuspense=function(m){return g(m)===l},Ke.isSuspenseList=function(m){return g(m)===c},Ke.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===i||m===r||m===l||m===c||typeof m=="object"&&m!==null&&(m.$$typeof===d||m.$$typeof===u||m.$$typeof===s||m.$$typeof===o||m.$$typeof===a||m.$$typeof===p||m.getModuleId!==void 0)},Ke.typeOf=g,Ke}var qe={};/**
109
+ */var Yd;function tA(){if(Yd)return qe;Yd=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"),o=Symbol.for("react.consumer"),s=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"),f=Symbol.for("react.view_transition"),p=Symbol.for("react.client.reference");function g(m){if(typeof m=="object"&&m!==null){var x=m.$$typeof;switch(x){case e:switch(m=m.type,m){case n:case i:case r:case l:case c:case f:return m;default:switch(m=m&&m.$$typeof,m){case s:case a:case d:case u:return m;case o:return m;default:return x}}case t:return x}}}return qe.ContextConsumer=o,qe.ContextProvider=s,qe.Element=e,qe.ForwardRef=a,qe.Fragment=n,qe.Lazy=d,qe.Memo=u,qe.Portal=t,qe.Profiler=i,qe.StrictMode=r,qe.Suspense=l,qe.SuspenseList=c,qe.isContextConsumer=function(m){return g(m)===o},qe.isContextProvider=function(m){return g(m)===s},qe.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===e},qe.isForwardRef=function(m){return g(m)===a},qe.isFragment=function(m){return g(m)===n},qe.isLazy=function(m){return g(m)===d},qe.isMemo=function(m){return g(m)===u},qe.isPortal=function(m){return g(m)===t},qe.isProfiler=function(m){return g(m)===i},qe.isStrictMode=function(m){return g(m)===r},qe.isSuspense=function(m){return g(m)===l},qe.isSuspenseList=function(m){return g(m)===c},qe.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===i||m===r||m===l||m===c||typeof m=="object"&&m!==null&&(m.$$typeof===d||m.$$typeof===u||m.$$typeof===s||m.$$typeof===o||m.$$typeof===a||m.$$typeof===p||m.getModuleId!==void 0)},qe.typeOf=g,qe}var Ye={};/**
110
110
  * @license React
111
111
  * react-is.development.js
112
112
  *
@@ -114,21 +114,21 @@ Valid keys: `+JSON.stringify(Object.keys(w),null," "));var G=he(q,le,B,z,K+"."+
114
114
  *
115
115
  * This source code is licensed under the MIT license found in the
116
116
  * LICENSE file in the root directory of this source tree.
117
- */var Zd;function rA(){return Zd||(Zd=1,process.env.NODE_ENV!=="production"&&function(){function e(m){if(typeof m=="object"&&m!==null){var x=m.$$typeof;switch(x){case t:switch(m=m.type,m){case r:case o:case i:case c:case u:case p:return m;default:switch(m=m&&m.$$typeof,m){case a:case l:case f:case d:return m;case s:return m;default:return x}}case n:return x}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=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"),f=Symbol.for("react.lazy"),p=Symbol.for("react.view_transition"),g=Symbol.for("react.client.reference");qe.ContextConsumer=s,qe.ContextProvider=a,qe.Element=t,qe.ForwardRef=l,qe.Fragment=r,qe.Lazy=f,qe.Memo=d,qe.Portal=n,qe.Profiler=o,qe.StrictMode=i,qe.Suspense=c,qe.SuspenseList=u,qe.isContextConsumer=function(m){return e(m)===s},qe.isContextProvider=function(m){return e(m)===a},qe.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===t},qe.isForwardRef=function(m){return e(m)===l},qe.isFragment=function(m){return e(m)===r},qe.isLazy=function(m){return e(m)===f},qe.isMemo=function(m){return e(m)===d},qe.isPortal=function(m){return e(m)===n},qe.isProfiler=function(m){return e(m)===o},qe.isStrictMode=function(m){return e(m)===i},qe.isSuspense=function(m){return e(m)===c},qe.isSuspenseList=function(m){return e(m)===u},qe.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===r||m===o||m===i||m===c||m===u||typeof m=="object"&&m!==null&&(m.$$typeof===f||m.$$typeof===d||m.$$typeof===a||m.$$typeof===s||m.$$typeof===l||m.$$typeof===g||m.getModuleId!==void 0)},qe.typeOf=e}()),qe}var Xd;function iA(){return Xd||(Xd=1,process.env.NODE_ENV==="production"?Ki.exports=nA():Ki.exports=rA()),Ki.exports}var wo=iA();function yn(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 Vm(e){if(P.isValidElement(e)||wo.isValidElementType(e)||!yn(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Vm(e[n])}),t}function Kt(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return yn(e)&&yn(t)&&Object.keys(t).forEach(i=>{P.isValidElement(t[i])||wo.isValidElementType(t[i])?r[i]=t[i]:yn(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&yn(e[i])?r[i]=Kt(e[i],t[i],n):n.clone?r[i]=yn(t[i])?Vm(t[i]):t[i]:r[i]=t[i]}),r}function ti(e,t){return t?Kt(e,t,{clone:!1}):e}const Fn=process.env.NODE_ENV!=="production"?Ve.oneOfType([Ve.number,Ve.string,Ve.object,Ve.array]):{};function Qd(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,i)=>{var s,a;const o=/min-width:\s*([0-9.]+)/;return+(((s=r.match(o))==null?void 0:s[1])||0)-+(((a=i.match(o))==null?void 0:a[1])||0)});return n.length?n.reduce((r,i)=>{const o=t[i];return delete r[i],r[i]=o,r},{...t}):t}function oA(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function sA(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>\`.
118
- For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:On(18,`(${t})`));return null}const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(o)}function aA(e){const t=(o,s)=>o.replace("@media",s?`@container ${s}`:"@container");function n(o,s){o.up=(...a)=>t(e.breakpoints.up(...a),s),o.down=(...a)=>t(e.breakpoints.down(...a),s),o.between=(...a)=>t(e.breakpoints.between(...a),s),o.only=(...a)=>t(e.breakpoints.only(...a),s),o.not=(...a)=>{const l=t(e.breakpoints.not(...a),s);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=o=>(n(r,o),r);return n(i),{...e,containerQueries:i}}const Lo={xs:0,sm:600,md:900,lg:1200,xl:1536},Jd={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Lo[e]}px)`},lA={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Lo[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function En(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||Jd;return t.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(t[l]),s),{})}if(typeof t=="object"){const o=r.breakpoints||Jd;return Object.keys(t).reduce((s,a)=>{if(oA(o.keys,a)){const l=sA(r.containerQueries?r:lA,a);l&&(s[l]=n(t[a],a))}else if(Object.keys(o.values||Lo).includes(a)){const l=o.up(a);s[l]=n(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return n(t)}function cA(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,i)=>{const o=e.up(i);return r[o]={},r},{}))||{}}function ef(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function Fo(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function vo(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=Fo(e,n)||r,t&&(i=t(i,r,e)),i}function gt(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=Fo(l,r)||{};return En(s,a,d=>{let f=vo(c,i,d);return d===f&&typeof d=="string"&&(f=vo(c,i,`${t}${d==="default"?"":Xn(d)}`,d)),n===!1?f:{[n]:f}})};return o.propTypes=process.env.NODE_ENV!=="production"?{[t]:Fn}:{},o.filterProps=[t],o}function uA(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const dA={m:"margin",p:"padding"},fA={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},tf={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},hA=uA(e=>{if(e.length>2)if(tf[e])e=tf[e];else return[e];const[t,n]=e.split(""),r=dA[t],i=fA[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Bo=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],jo=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],pA=[...Bo,...jo];function vi(e,t,n,r){const i=Fo(e,t,!0)??n;return typeof i=="number"||typeof i=="string"?o=>typeof o=="string"?o:(process.env.NODE_ENV!=="production"&&typeof o!="number"&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${o}.`),typeof i=="string"?i.startsWith("var(")&&o===0?0:i.startsWith("var(")&&o===1?i:`calc(${o} * ${i})`:i*o):Array.isArray(i)?o=>{if(typeof o=="string")return o;const s=Math.abs(o);process.env.NODE_ENV!=="production"&&(Number.isInteger(s)?s>i.length-1&&console.error([`MUI: The value provided (${s}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${s} > ${i.length-1}, you need to add the missing values.`].join(`
117
+ */var Zd;function nA(){return Zd||(Zd=1,process.env.NODE_ENV!=="production"&&function(){function e(m){if(typeof m=="object"&&m!==null){var x=m.$$typeof;switch(x){case t:switch(m=m.type,m){case r:case o:case i:case c:case u:case p:return m;default:switch(m=m&&m.$$typeof,m){case a:case l:case f:case d:return m;case s:return m;default:return x}}case n:return x}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=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"),f=Symbol.for("react.lazy"),p=Symbol.for("react.view_transition"),g=Symbol.for("react.client.reference");Ye.ContextConsumer=s,Ye.ContextProvider=a,Ye.Element=t,Ye.ForwardRef=l,Ye.Fragment=r,Ye.Lazy=f,Ye.Memo=d,Ye.Portal=n,Ye.Profiler=o,Ye.StrictMode=i,Ye.Suspense=c,Ye.SuspenseList=u,Ye.isContextConsumer=function(m){return e(m)===s},Ye.isContextProvider=function(m){return e(m)===a},Ye.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===t},Ye.isForwardRef=function(m){return e(m)===l},Ye.isFragment=function(m){return e(m)===r},Ye.isLazy=function(m){return e(m)===f},Ye.isMemo=function(m){return e(m)===d},Ye.isPortal=function(m){return e(m)===n},Ye.isProfiler=function(m){return e(m)===o},Ye.isStrictMode=function(m){return e(m)===i},Ye.isSuspense=function(m){return e(m)===c},Ye.isSuspenseList=function(m){return e(m)===u},Ye.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===r||m===o||m===i||m===c||m===u||typeof m=="object"&&m!==null&&(m.$$typeof===f||m.$$typeof===d||m.$$typeof===a||m.$$typeof===s||m.$$typeof===l||m.$$typeof===g||m.getModuleId!==void 0)},Ye.typeOf=e}()),Ye}var Xd;function rA(){return Xd||(Xd=1,process.env.NODE_ENV==="production"?Ki.exports=tA():Ki.exports=nA()),Ki.exports}var wo=rA();function bn(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 $m(e){if(D.isValidElement(e)||wo.isValidElementType(e)||!bn(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=$m(e[n])}),t}function Wt(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return bn(e)&&bn(t)&&Object.keys(t).forEach(i=>{D.isValidElement(t[i])||wo.isValidElementType(t[i])?r[i]=t[i]:bn(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&bn(e[i])?r[i]=Wt(e[i],t[i],n):n.clone?r[i]=bn(t[i])?$m(t[i]):t[i]:r[i]=t[i]}),r}function ti(e,t){return t?Wt(e,t,{clone:!1}):e}const Fn=process.env.NODE_ENV!=="production"?je.oneOfType([je.number,je.string,je.object,je.array]):{};function Qd(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,i)=>{var s,a;const o=/min-width:\s*([0-9.]+)/;return+(((s=r.match(o))==null?void 0:s[1])||0)-+(((a=i.match(o))==null?void 0:a[1])||0)});return n.length?n.reduce((r,i)=>{const o=t[i];return delete r[i],r[i]=o,r},{...t}):t}function iA(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function oA(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>\`.
118
+ For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:On(18,`(${t})`));return null}const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(o)}function sA(e){const t=(o,s)=>o.replace("@media",s?`@container ${s}`:"@container");function n(o,s){o.up=(...a)=>t(e.breakpoints.up(...a),s),o.down=(...a)=>t(e.breakpoints.down(...a),s),o.between=(...a)=>t(e.breakpoints.between(...a),s),o.only=(...a)=>t(e.breakpoints.only(...a),s),o.not=(...a)=>{const l=t(e.breakpoints.not(...a),s);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=o=>(n(r,o),r);return n(i),{...e,containerQueries:i}}const Lo={xs:0,sm:600,md:900,lg:1200,xl:1536},Jd={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Lo[e]}px)`},aA={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Lo[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function vn(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||Jd;return t.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(t[l]),s),{})}if(typeof t=="object"){const o=r.breakpoints||Jd;return Object.keys(t).reduce((s,a)=>{if(iA(o.keys,a)){const l=oA(r.containerQueries?r:aA,a);l&&(s[l]=n(t[a],a))}else if(Object.keys(o.values||Lo).includes(a)){const l=o.up(a);s[l]=n(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return n(t)}function lA(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,i)=>{const o=e.up(i);return r[o]={},r},{}))||{}}function ef(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function Fo(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function vo(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=Fo(e,n)||r,t&&(i=t(i,r,e)),i}function gt(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=Fo(l,r)||{};return vn(s,a,d=>{let f=vo(c,i,d);return d===f&&typeof d=="string"&&(f=vo(c,i,`${t}${d==="default"?"":Xn(d)}`,d)),n===!1?f:{[n]:f}})};return o.propTypes=process.env.NODE_ENV!=="production"?{[t]:Fn}:{},o.filterProps=[t],o}function cA(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const uA={m:"margin",p:"padding"},dA={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},tf={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},fA=cA(e=>{if(e.length>2)if(tf[e])e=tf[e];else return[e];const[t,n]=e.split(""),r=uA[t],i=dA[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Bo=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],jo=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],hA=[...Bo,...jo];function vi(e,t,n,r){const i=Fo(e,t,!0)??n;return typeof i=="number"||typeof i=="string"?o=>typeof o=="string"?o:(process.env.NODE_ENV!=="production"&&typeof o!="number"&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${o}.`),typeof i=="string"?i.startsWith("var(")&&o===0?0:i.startsWith("var(")&&o===1?i:`calc(${o} * ${i})`:i*o):Array.isArray(i)?o=>{if(typeof o=="string")return o;const s=Math.abs(o);process.env.NODE_ENV!=="production"&&(Number.isInteger(s)?s>i.length-1&&console.error([`MUI: The value provided (${s}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${s} > ${i.length-1}, you need to add the missing values.`].join(`
119
119
  `)):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(`
120
120
  `)));const a=i[s];return o>=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(`
121
- `)),()=>{})}function Ul(e){return vi(e,"spacing",8,"spacing")}function Ei(e,t){return typeof t=="string"||t==null?t:e(t)}function mA(e,t){return n=>e.reduce((r,i)=>(r[i]=Ei(t,n),r),{})}function gA(e,t,n,r){if(!t.includes(n))return null;const i=hA(n),o=mA(i,r),s=e[n];return En(e,s,o)}function zm(e,t){const n=Ul(e.theme);return Object.keys(e).map(r=>gA(e,t,r,n)).reduce(ti,{})}function dt(e){return zm(e,Bo)}dt.propTypes=process.env.NODE_ENV!=="production"?Bo.reduce((e,t)=>(e[t]=Fn,e),{}):{};dt.filterProps=Bo;function ft(e){return zm(e,jo)}ft.propTypes=process.env.NODE_ENV!=="production"?jo.reduce((e,t)=>(e[t]=Fn,e),{}):{};ft.filterProps=jo;process.env.NODE_ENV!=="production"&&pA.reduce((e,t)=>(e[t]=Fn,e),{});function $o(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?ti(i,t[o](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 Xt(e){return typeof e!="number"?e:`${e}px solid`}function Jt(e,t){return gt({prop:e,themeKey:"borders",transform:t})}const bA=Jt("border",Xt),yA=Jt("borderTop",Xt),xA=Jt("borderRight",Xt),wA=Jt("borderBottom",Xt),vA=Jt("borderLeft",Xt),EA=Jt("borderColor"),kA=Jt("borderTopColor"),SA=Jt("borderRightColor"),CA=Jt("borderBottomColor"),_A=Jt("borderLeftColor"),TA=Jt("outline",Xt),NA=Jt("outlineColor"),Vo=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=vi(e.theme,"shape.borderRadius",4,"borderRadius"),n=r=>({borderRadius:Ei(t,r)});return En(e,e.borderRadius,n)}return null};Vo.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:Fn}:{};Vo.filterProps=["borderRadius"];$o(bA,yA,xA,wA,vA,EA,kA,SA,CA,_A,Vo,TA,NA);const zo=e=>{if(e.gap!==void 0&&e.gap!==null){const t=vi(e.theme,"spacing",8,"gap"),n=r=>({gap:Ei(t,r)});return En(e,e.gap,n)}return null};zo.propTypes=process.env.NODE_ENV!=="production"?{gap:Fn}:{};zo.filterProps=["gap"];const Uo=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=vi(e.theme,"spacing",8,"columnGap"),n=r=>({columnGap:Ei(t,r)});return En(e,e.columnGap,n)}return null};Uo.propTypes=process.env.NODE_ENV!=="production"?{columnGap:Fn}:{};Uo.filterProps=["columnGap"];const Ho=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=vi(e.theme,"spacing",8,"rowGap"),n=r=>({rowGap:Ei(t,r)});return En(e,e.rowGap,n)}return null};Ho.propTypes=process.env.NODE_ENV!=="production"?{rowGap:Fn}:{};Ho.filterProps=["rowGap"];const AA=gt({prop:"gridColumn"}),RA=gt({prop:"gridRow"}),MA=gt({prop:"gridAutoFlow"}),IA=gt({prop:"gridAutoColumns"}),OA=gt({prop:"gridAutoRows"}),PA=gt({prop:"gridTemplateColumns"}),DA=gt({prop:"gridTemplateRows"}),LA=gt({prop:"gridTemplateAreas"}),FA=gt({prop:"gridArea"});$o(zo,Uo,Ho,AA,RA,MA,IA,OA,PA,DA,LA,FA);function Er(e,t){return t==="grey"?t:e}const BA=gt({prop:"color",themeKey:"palette",transform:Er}),jA=gt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Er}),$A=gt({prop:"backgroundColor",themeKey:"palette",transform:Er});$o(BA,jA,$A);function Wt(e){return e<=1&&e!==0?`${e*100}%`:e}const VA=gt({prop:"width",transform:Wt}),Hl=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var i,o,s,a,l;const r=((s=(o=(i=e.theme)==null?void 0:i.breakpoints)==null?void 0:o.values)==null?void 0:s[n])||Lo[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:Wt(n)}};return En(e,e.maxWidth,t)}return null};Hl.filterProps=["maxWidth"];const zA=gt({prop:"minWidth",transform:Wt}),UA=gt({prop:"height",transform:Wt}),HA=gt({prop:"maxHeight",transform:Wt}),WA=gt({prop:"minHeight",transform:Wt});gt({prop:"size",cssProperty:"width",transform:Wt});gt({prop:"size",cssProperty:"height",transform:Wt});const GA=gt({prop:"boxSizing"});$o(VA,Hl,zA,UA,HA,WA,GA);const Wo={border:{themeKey:"borders",transform:Xt},borderTop:{themeKey:"borders",transform:Xt},borderRight:{themeKey:"borders",transform:Xt},borderBottom:{themeKey:"borders",transform:Xt},borderLeft:{themeKey:"borders",transform:Xt},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Xt},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Vo},color:{themeKey:"palette",transform:Er},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Er},backgroundColor:{themeKey:"palette",transform:Er},p:{style:ft},pt:{style:ft},pr:{style:ft},pb:{style:ft},pl:{style:ft},px:{style:ft},py:{style:ft},padding:{style:ft},paddingTop:{style:ft},paddingRight:{style:ft},paddingBottom:{style:ft},paddingLeft:{style:ft},paddingX:{style:ft},paddingY:{style:ft},paddingInline:{style:ft},paddingInlineStart:{style:ft},paddingInlineEnd:{style:ft},paddingBlock:{style:ft},paddingBlockStart:{style:ft},paddingBlockEnd:{style:ft},m:{style:dt},mt:{style:dt},mr:{style:dt},mb:{style:dt},ml:{style:dt},mx:{style:dt},my:{style:dt},margin:{style:dt},marginTop:{style:dt},marginRight:{style:dt},marginBottom:{style:dt},marginLeft:{style:dt},marginX:{style:dt},marginY:{style:dt},marginInline:{style:dt},marginInlineStart:{style:dt},marginInlineEnd:{style:dt},marginBlock:{style:dt},marginBlockStart:{style:dt},marginBlockEnd:{style:dt},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:zo},rowGap:{style:Ho},columnGap:{style:Uo},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Wt},maxWidth:{style:Hl},minWidth:{transform:Wt},height:{transform:Wt},maxHeight:{transform:Wt},minHeight:{transform:Wt},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 KA(...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 qA(e,t){return typeof e=="function"?e(t):e}function YA(){function e(n,r,i,o){const s={[n]:r,theme:i},a=o[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 f=Fo(i,c)||{};return d?d(s):En(s,r,g=>{let m=vo(f,u,g);return g===m&&typeof g=="string"&&(m=vo(f,u,`${n}${g==="default"?"":Xn(g)}`,g)),l===!1?m:{[l]:m}})}function t(n){const{sx:r,theme:i={},nested:o}=n||{};if(!r)return null;const s=i.unstable_sxConfig??Wo;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=cA(i.breakpoints),d=Object.keys(u);let f=u;return Object.keys(c).forEach(p=>{const g=qA(c[p],i);if(g!=null)if(typeof g=="object")if(s[p])f=ti(f,e(p,g,i,s));else{const m=En({theme:i},g,x=>({[p]:x}));KA(m,g)?f[p]=t({sx:g,theme:i,nested:!0}):f=ti(f,m)}else f=ti(f,e(p,g,i,s))}),!o&&i.modularCssLayers?{"@layer sx":Qd(i,ef(d,f))}:Qd(i,ef(d,f))}return Array.isArray(r)?r.map(a):a(r)}return t}const Tr=YA();Tr.filterProps=["sx"];function ZA(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 XA={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 QA(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var JA=/[A-Z]|^ms/g,eR=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Um=function(t){return t.charCodeAt(1)===45},nf=function(t){return t!=null&&typeof t!="boolean"},Us=QA(function(e){return Um(e)?e:e.replace(JA,"-$&").toLowerCase()}),rf=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(eR,function(r,i,o){return Rn={name:i,styles:o,next:Rn},i})}return XA[t]!==1&&!Um(t)&&typeof n=="number"&&n!==0?n+"px":n};function Eo(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 Rn={name:i.name,styles:i.styles,next:Rn},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Rn={name:s.name,styles:s.styles,next:Rn},s=s.next;var a=o.styles+";";return a}return tR(e,t,n)}}var l=n;return l}function tR(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Eo(e,t,n[i])+";";else for(var o in n){var s=n[o];if(typeof s!="object"){var a=s;nf(a)&&(r+=Us(o)+":"+rf(o,a)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&t==null)for(var l=0;l<s.length;l++)nf(s[l])&&(r+=Us(o)+":"+rf(o,s[l])+";");else{var c=Eo(e,t,s);switch(o){case"animation":case"animationName":{r+=Us(o)+":"+c+";";break}default:r+=o+"{"+c+"}"}}}return r}var of=/label:\s*([^\s;{]+)\s*(;|$)/g,Rn;function nR(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="";Rn=void 0;var o=e[0];if(o==null||o.raw===void 0)r=!1,i+=Eo(n,t,o);else{var s=o;i+=s[0]}for(var a=1;a<e.length;a++)if(i+=Eo(n,t,e[a]),r){var l=o;i+=l[a]}of.lastIndex=0;for(var c="",u;(u=of.exec(i))!==null;)c+="-"+u[1];var d=ZA(i)+c;return{name:d,styles:i,next:Rn}}/**
121
+ `)),()=>{})}function Ul(e){return vi(e,"spacing",8,"spacing")}function Ei(e,t){return typeof t=="string"||t==null?t:e(t)}function pA(e,t){return n=>e.reduce((r,i)=>(r[i]=Ei(t,n),r),{})}function mA(e,t,n,r){if(!t.includes(n))return null;const i=fA(n),o=pA(i,r),s=e[n];return vn(e,s,o)}function Vm(e,t){const n=Ul(e.theme);return Object.keys(e).map(r=>mA(e,t,r,n)).reduce(ti,{})}function dt(e){return Vm(e,Bo)}dt.propTypes=process.env.NODE_ENV!=="production"?Bo.reduce((e,t)=>(e[t]=Fn,e),{}):{};dt.filterProps=Bo;function ft(e){return Vm(e,jo)}ft.propTypes=process.env.NODE_ENV!=="production"?jo.reduce((e,t)=>(e[t]=Fn,e),{}):{};ft.filterProps=jo;process.env.NODE_ENV!=="production"&&hA.reduce((e,t)=>(e[t]=Fn,e),{});function $o(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?ti(i,t[o](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 Yt(e){return typeof e!="number"?e:`${e}px solid`}function Xt(e,t){return gt({prop:e,themeKey:"borders",transform:t})}const gA=Xt("border",Yt),bA=Xt("borderTop",Yt),yA=Xt("borderRight",Yt),xA=Xt("borderBottom",Yt),wA=Xt("borderLeft",Yt),vA=Xt("borderColor"),EA=Xt("borderTopColor"),kA=Xt("borderRightColor"),SA=Xt("borderBottomColor"),CA=Xt("borderLeftColor"),_A=Xt("outline",Yt),TA=Xt("outlineColor"),Vo=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=vi(e.theme,"shape.borderRadius",4,"borderRadius"),n=r=>({borderRadius:Ei(t,r)});return vn(e,e.borderRadius,n)}return null};Vo.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:Fn}:{};Vo.filterProps=["borderRadius"];$o(gA,bA,yA,xA,wA,vA,EA,kA,SA,CA,Vo,_A,TA);const zo=e=>{if(e.gap!==void 0&&e.gap!==null){const t=vi(e.theme,"spacing",8,"gap"),n=r=>({gap:Ei(t,r)});return vn(e,e.gap,n)}return null};zo.propTypes=process.env.NODE_ENV!=="production"?{gap:Fn}:{};zo.filterProps=["gap"];const Uo=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=vi(e.theme,"spacing",8,"columnGap"),n=r=>({columnGap:Ei(t,r)});return vn(e,e.columnGap,n)}return null};Uo.propTypes=process.env.NODE_ENV!=="production"?{columnGap:Fn}:{};Uo.filterProps=["columnGap"];const Ho=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=vi(e.theme,"spacing",8,"rowGap"),n=r=>({rowGap:Ei(t,r)});return vn(e,e.rowGap,n)}return null};Ho.propTypes=process.env.NODE_ENV!=="production"?{rowGap:Fn}:{};Ho.filterProps=["rowGap"];const NA=gt({prop:"gridColumn"}),AA=gt({prop:"gridRow"}),RA=gt({prop:"gridAutoFlow"}),MA=gt({prop:"gridAutoColumns"}),IA=gt({prop:"gridAutoRows"}),OA=gt({prop:"gridTemplateColumns"}),PA=gt({prop:"gridTemplateRows"}),DA=gt({prop:"gridTemplateAreas"}),LA=gt({prop:"gridArea"});$o(zo,Uo,Ho,NA,AA,RA,MA,IA,OA,PA,DA,LA);function Er(e,t){return t==="grey"?t:e}const FA=gt({prop:"color",themeKey:"palette",transform:Er}),BA=gt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Er}),jA=gt({prop:"backgroundColor",themeKey:"palette",transform:Er});$o(FA,BA,jA);function Ut(e){return e<=1&&e!==0?`${e*100}%`:e}const $A=gt({prop:"width",transform:Ut}),Hl=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var i,o,s,a,l;const r=((s=(o=(i=e.theme)==null?void 0:i.breakpoints)==null?void 0:o.values)==null?void 0:s[n])||Lo[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:Ut(n)}};return vn(e,e.maxWidth,t)}return null};Hl.filterProps=["maxWidth"];const VA=gt({prop:"minWidth",transform:Ut}),zA=gt({prop:"height",transform:Ut}),UA=gt({prop:"maxHeight",transform:Ut}),HA=gt({prop:"minHeight",transform:Ut});gt({prop:"size",cssProperty:"width",transform:Ut});gt({prop:"size",cssProperty:"height",transform:Ut});const WA=gt({prop:"boxSizing"});$o($A,Hl,VA,zA,UA,HA,WA);const Wo={border:{themeKey:"borders",transform:Yt},borderTop:{themeKey:"borders",transform:Yt},borderRight:{themeKey:"borders",transform:Yt},borderBottom:{themeKey:"borders",transform:Yt},borderLeft:{themeKey:"borders",transform:Yt},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Yt},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Vo},color:{themeKey:"palette",transform:Er},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Er},backgroundColor:{themeKey:"palette",transform:Er},p:{style:ft},pt:{style:ft},pr:{style:ft},pb:{style:ft},pl:{style:ft},px:{style:ft},py:{style:ft},padding:{style:ft},paddingTop:{style:ft},paddingRight:{style:ft},paddingBottom:{style:ft},paddingLeft:{style:ft},paddingX:{style:ft},paddingY:{style:ft},paddingInline:{style:ft},paddingInlineStart:{style:ft},paddingInlineEnd:{style:ft},paddingBlock:{style:ft},paddingBlockStart:{style:ft},paddingBlockEnd:{style:ft},m:{style:dt},mt:{style:dt},mr:{style:dt},mb:{style:dt},ml:{style:dt},mx:{style:dt},my:{style:dt},margin:{style:dt},marginTop:{style:dt},marginRight:{style:dt},marginBottom:{style:dt},marginLeft:{style:dt},marginX:{style:dt},marginY:{style:dt},marginInline:{style:dt},marginInlineStart:{style:dt},marginInlineEnd:{style:dt},marginBlock:{style:dt},marginBlockStart:{style:dt},marginBlockEnd:{style:dt},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:zo},rowGap:{style:Ho},columnGap:{style:Uo},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Ut},maxWidth:{style:Hl},minWidth:{transform:Ut},height:{transform:Ut},maxHeight:{transform:Ut},minHeight:{transform:Ut},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 GA(...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 KA(e,t){return typeof e=="function"?e(t):e}function qA(){function e(n,r,i,o){const s={[n]:r,theme:i},a=o[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 f=Fo(i,c)||{};return d?d(s):vn(s,r,g=>{let m=vo(f,u,g);return g===m&&typeof g=="string"&&(m=vo(f,u,`${n}${g==="default"?"":Xn(g)}`,g)),l===!1?m:{[l]:m}})}function t(n){const{sx:r,theme:i={},nested:o}=n||{};if(!r)return null;const s=i.unstable_sxConfig??Wo;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=lA(i.breakpoints),d=Object.keys(u);let f=u;return Object.keys(c).forEach(p=>{const g=KA(c[p],i);if(g!=null)if(typeof g=="object")if(s[p])f=ti(f,e(p,g,i,s));else{const m=vn({theme:i},g,x=>({[p]:x}));GA(m,g)?f[p]=t({sx:g,theme:i,nested:!0}):f=ti(f,m)}else f=ti(f,e(p,g,i,s))}),!o&&i.modularCssLayers?{"@layer sx":Qd(i,ef(d,f))}:Qd(i,ef(d,f))}return Array.isArray(r)?r.map(a):a(r)}return t}const Tr=qA();Tr.filterProps=["sx"];function YA(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 ZA={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 XA(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var QA=/[A-Z]|^ms/g,JA=/_EMO_([^_]+?)_([^]*?)_EMO_/g,zm=function(t){return t.charCodeAt(1)===45},nf=function(t){return t!=null&&typeof t!="boolean"},Us=XA(function(e){return zm(e)?e:e.replace(QA,"-$&").toLowerCase()}),rf=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(JA,function(r,i,o){return Rn={name:i,styles:o,next:Rn},i})}return ZA[t]!==1&&!zm(t)&&typeof n=="number"&&n!==0?n+"px":n};function Eo(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 Rn={name:i.name,styles:i.styles,next:Rn},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Rn={name:s.name,styles:s.styles,next:Rn},s=s.next;var a=o.styles+";";return a}return eR(e,t,n)}}var l=n;return l}function eR(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Eo(e,t,n[i])+";";else for(var o in n){var s=n[o];if(typeof s!="object"){var a=s;nf(a)&&(r+=Us(o)+":"+rf(o,a)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&t==null)for(var l=0;l<s.length;l++)nf(s[l])&&(r+=Us(o)+":"+rf(o,s[l])+";");else{var c=Eo(e,t,s);switch(o){case"animation":case"animationName":{r+=Us(o)+":"+c+";";break}default:r+=o+"{"+c+"}"}}}return r}var of=/label:\s*([^\s;{]+)\s*(;|$)/g,Rn;function tR(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="";Rn=void 0;var o=e[0];if(o==null||o.raw===void 0)r=!1,i+=Eo(n,t,o);else{var s=o;i+=s[0]}for(var a=1;a<e.length;a++)if(i+=Eo(n,t,e[a]),r){var l=o;i+=l[a]}of.lastIndex=0;for(var c="",u;(u=of.exec(i))!==null;)c+="-"+u[1];var d=YA(i)+c;return{name:d,styles:i,next:Rn}}/**
122
122
  * @mui/styled-engine v7.2.0
123
123
  *
124
124
  * @license MIT
125
125
  * This source code is licensed under the MIT license found in the
126
126
  * LICENSE file in the root directory of this source tree.
127
- */function rR(e,t){const n=Hg(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(`
128
- `)):r.some(o=>o===void 0)&&console.error(`MUI: the styled(${i})(...args) API requires all its args to be defined.`),n(...r)}:n}function iR(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const sf=[];function qn(e){return sf[0]=e,nR(sf)}const oR=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 sR(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=e,o=oR(t),s=Object.keys(o);function a(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${n})`}function l(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-r/100}${n})`}function c(f,p){const g=s.indexOf(p);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${n}) and (max-width:${(g!==-1&&typeof t[s[g]]=="number"?t[s[g]]:p)-r/100}${n})`}function u(f){return s.indexOf(f)+1<s.length?c(f,s[s.indexOf(f)+1]):a(f)}function d(f){const p=s.indexOf(f);return p===0?a(s[1]):p===s.length-1?l(s[p]):c(f,s[s.indexOf(f)+1]).replace("@media","@media not all and")}return{keys:s,values:o,up:a,down:l,between:c,only:u,not:d,unit:n,...i}}const aR={borderRadius:4};function Hm(e=8,t=Ul({spacing:e})){if(e.mui)return e;const n=(...r)=>(process.env.NODE_ENV!=="production"&&(r.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${r.length}`)),(r.length===0?[1]:r).map(o=>{const s=t(o);return typeof s=="number"?`${s}px`:s}).join(" "));return n.mui=!0,n}function lR(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 Wm(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={},...s}=e,a=sR(n),l=Hm(i);let c=Kt({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...aR,...o}},s);return c=aA(c),c.applyStyles=lR,c=t.reduce((u,d)=>Kt(u,d),c),c.unstable_sxConfig={...Wo,...s==null?void 0:s.unstable_sxConfig},c.unstable_sx=function(d){return Tr({sx:d,theme:this})},c}const cR={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 Wl(e,t,n="Mui"){const r=cR[t];return r?`${n}-${r}`:`${GN.generate(e)}-${t}`}function uR(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=Wl(e,i,n)}),r}function Gm(e,t=""){return e.displayName||e.name||t}function af(e,t,n){const r=Gm(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function dR(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return Gm(e,"Component");if(typeof e=="object")switch(e.$$typeof){case wo.ForwardRef:return af(e,e.render,"ForwardRef");case wo.Memo:return af(e,e.type,"memo");default:return}}}function Km(e){const{variants:t,...n}=e,r={variants:t,style:qn(n),isProcessed:!0};return r.style===n||t&&t.forEach(i=>{typeof i.style!="function"&&(i.style=qn(i.style))}),r}const fR=Wm();function Hs(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Wn(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function hR(e){return e?(t,n)=>n[e]:null}function pR(e,t,n){e.theme=yR(e.theme)?n:e.theme[t]||e.theme}function ro(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(i=>ro(e,i,n));if(Array.isArray(r==null?void 0:r.variants)){let i;if(r.isProcessed)i=n?Wn(r.style,n):r.style;else{const{variants:o,...s}=r;i=n?Wn(qn(s),n):s}return qm(e,r.variants,[i],n)}return r!=null&&r.isProcessed?n?Wn(qn(r.style),n):r.style:n?Wn(qn(r),n):r}function qm(e,t,n=[],r=void 0){var o;let i;e:for(let s=0;s<t.length;s+=1){const a=t[s];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]&&((o=e.ownerState)==null?void 0:o[l])!==a.props[l])continue e;typeof a.style=="function"?(i??(i={...e,...e.ownerState,ownerState:e.ownerState}),n.push(r?Wn(qn(a.style(i)),r):a.style(i))):n.push(r?Wn(qn(a.style),r):a.style)}return n}function mR(e={}){const{themeId:t,defaultTheme:n=fR,rootShouldForwardProp:r=Hs,slotShouldForwardProp:i=Hs}=e;function o(a){pR(a,t,n)}return(a,l={})=>{iR(a,C=>C.filter(M=>M!==Tr));const{name:c,slot:u,skipVariantsResolver:d,skipSx:f,overridesResolver:p=hR(Ym(u)),...g}=l,m=c&&c.startsWith("Mui")||u?"components":"custom",x=d!==void 0?d:u&&u!=="Root"&&u!=="root"||!1,y=f||!1;let k=Hs;u==="Root"||u==="root"?k=r:u?k=i:xR(a)&&(k=void 0);const v=rR(a,{shouldForwardProp:k,label:bR(c,u),...g}),_=C=>{if(C.__emotion_real===C)return C;if(typeof C=="function")return function(N){return ro(N,C,N.theme.modularCssLayers?m:void 0)};if(yn(C)){const M=Km(C);return function(I){return M.variants?ro(I,M,I.theme.modularCssLayers?m:void 0):I.theme.modularCssLayers?Wn(M.style,m):M.style}}return C},S=(...C)=>{const M=[],N=C.map(_),I=[];if(M.push(o),c&&p&&I.push(function(D){var ne,j;const U=(j=(ne=D.theme.components)==null?void 0:ne[c])==null?void 0:j.styleOverrides;if(!U)return null;const re={};for(const W in U)re[W]=ro(D,U[W],D.theme.modularCssLayers?"theme":void 0);return p(D,re)}),c&&!x&&I.push(function(D){var re,ne;const $=D.theme,U=(ne=(re=$==null?void 0:$.components)==null?void 0:re[c])==null?void 0:ne.variants;return U?qm(D,U,[],D.theme.modularCssLayers?"theme":void 0):null}),y||I.push(Tr),Array.isArray(N[0])){const O=N.shift(),D=new Array(M.length).fill(""),$=new Array(I.length).fill("");let U;U=[...D,...O,...$],U.raw=[...D,...O.raw,...$],M.unshift(U)}const b=[...M,...N,...I],R=v(...b);return a.muiName&&(R.muiName=a.muiName),process.env.NODE_ENV!=="production"&&(R.displayName=gR(c,u,a)),R};return v.withConfig&&(S.withConfig=v.withConfig),S}}function gR(e,t,n){return e?`${e}${Xn(t||"")}`:`Styled(${dR(n)})`}function bR(e,t){let n;return process.env.NODE_ENV!=="production"&&e&&(n=`${e}-${Ym(t||"Root")}`),n}function yR(e){for(const t in e)return!1;return!0}function xR(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Ym(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Oa(e,t,n=!1){const r={...t};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const o=i;if(o==="components"||o==="slots")r[o]={...e[o],...r[o]};else if(o==="componentsProps"||o==="slotProps"){const s=e[o],a=t[o];if(!a)r[o]=s||{};else if(!s)r[o]=a;else{r[o]={...a};for(const l in s)if(Object.prototype.hasOwnProperty.call(s,l)){const c=l;r[o][c]=Oa(s[c],a[c],n)}}}else o==="className"&&n&&t.className?r.className=Ba(e==null?void 0:e.className,t==null?void 0:t.className):o==="style"&&n&&t.style?r.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:r[o]===void 0&&(r[o]=e[o])}return r}function wR(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Gl(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}].`),wR(e,t,n)}function vR(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 Pn(e){if(e.type)return e;if(e.charAt(0)==="#")return Pn(vR(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.
127
+ */function nR(e,t){const n=Ug(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(`
128
+ `)):r.some(o=>o===void 0)&&console.error(`MUI: the styled(${i})(...args) API requires all its args to be defined.`),n(...r)}:n}function rR(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const sf=[];function qn(e){return sf[0]=e,tR(sf)}const iR=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 oR(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=e,o=iR(t),s=Object.keys(o);function a(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${n})`}function l(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-r/100}${n})`}function c(f,p){const g=s.indexOf(p);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${n}) and (max-width:${(g!==-1&&typeof t[s[g]]=="number"?t[s[g]]:p)-r/100}${n})`}function u(f){return s.indexOf(f)+1<s.length?c(f,s[s.indexOf(f)+1]):a(f)}function d(f){const p=s.indexOf(f);return p===0?a(s[1]):p===s.length-1?l(s[p]):c(f,s[s.indexOf(f)+1]).replace("@media","@media not all and")}return{keys:s,values:o,up:a,down:l,between:c,only:u,not:d,unit:n,...i}}const sR={borderRadius:4};function Um(e=8,t=Ul({spacing:e})){if(e.mui)return e;const n=(...r)=>(process.env.NODE_ENV!=="production"&&(r.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${r.length}`)),(r.length===0?[1]:r).map(o=>{const s=t(o);return typeof s=="number"?`${s}px`:s}).join(" "));return n.mui=!0,n}function aR(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 Hm(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={},...s}=e,a=oR(n),l=Um(i);let c=Wt({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...sR,...o}},s);return c=sA(c),c.applyStyles=aR,c=t.reduce((u,d)=>Wt(u,d),c),c.unstable_sxConfig={...Wo,...s==null?void 0:s.unstable_sxConfig},c.unstable_sx=function(d){return Tr({sx:d,theme:this})},c}const lR={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 Wl(e,t,n="Mui"){const r=lR[t];return r?`${n}-${r}`:`${WN.generate(e)}-${t}`}function cR(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=Wl(e,i,n)}),r}function Wm(e,t=""){return e.displayName||e.name||t}function af(e,t,n){const r=Wm(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function uR(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return Wm(e,"Component");if(typeof e=="object")switch(e.$$typeof){case wo.ForwardRef:return af(e,e.render,"ForwardRef");case wo.Memo:return af(e,e.type,"memo");default:return}}}function Gm(e){const{variants:t,...n}=e,r={variants:t,style:qn(n),isProcessed:!0};return r.style===n||t&&t.forEach(i=>{typeof i.style!="function"&&(i.style=qn(i.style))}),r}const dR=Hm();function Hs(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Wn(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function fR(e){return e?(t,n)=>n[e]:null}function hR(e,t,n){e.theme=bR(e.theme)?n:e.theme[t]||e.theme}function ro(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(i=>ro(e,i,n));if(Array.isArray(r==null?void 0:r.variants)){let i;if(r.isProcessed)i=n?Wn(r.style,n):r.style;else{const{variants:o,...s}=r;i=n?Wn(qn(s),n):s}return Km(e,r.variants,[i],n)}return r!=null&&r.isProcessed?n?Wn(qn(r.style),n):r.style:n?Wn(qn(r),n):r}function Km(e,t,n=[],r=void 0){var o;let i;e:for(let s=0;s<t.length;s+=1){const a=t[s];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]&&((o=e.ownerState)==null?void 0:o[l])!==a.props[l])continue e;typeof a.style=="function"?(i??(i={...e,...e.ownerState,ownerState:e.ownerState}),n.push(r?Wn(qn(a.style(i)),r):a.style(i))):n.push(r?Wn(qn(a.style),r):a.style)}return n}function pR(e={}){const{themeId:t,defaultTheme:n=dR,rootShouldForwardProp:r=Hs,slotShouldForwardProp:i=Hs}=e;function o(a){hR(a,t,n)}return(a,l={})=>{rR(a,C=>C.filter(M=>M!==Tr));const{name:c,slot:u,skipVariantsResolver:d,skipSx:f,overridesResolver:p=fR(qm(u)),...g}=l,m=c&&c.startsWith("Mui")||u?"components":"custom",x=d!==void 0?d:u&&u!=="Root"&&u!=="root"||!1,y=f||!1;let E=Hs;u==="Root"||u==="root"?E=r:u?E=i:yR(a)&&(E=void 0);const v=nR(a,{shouldForwardProp:E,label:gR(c,u),...g}),_=C=>{if(C.__emotion_real===C)return C;if(typeof C=="function")return function(N){return ro(N,C,N.theme.modularCssLayers?m:void 0)};if(bn(C)){const M=Gm(C);return function(I){return M.variants?ro(I,M,I.theme.modularCssLayers?m:void 0):I.theme.modularCssLayers?Wn(M.style,m):M.style}}return C},k=(...C)=>{const M=[],N=C.map(_),I=[];if(M.push(o),c&&p&&I.push(function(L){var ee,P;const H=(P=(ee=L.theme.components)==null?void 0:ee[c])==null?void 0:P.styleOverrides;if(!H)return null;const ie={};for(const W in H)ie[W]=ro(L,H[W],L.theme.modularCssLayers?"theme":void 0);return p(L,ie)}),c&&!x&&I.push(function(L){var ie,ee;const j=L.theme,H=(ee=(ie=j==null?void 0:j.components)==null?void 0:ie[c])==null?void 0:ee.variants;return H?Km(L,H,[],L.theme.modularCssLayers?"theme":void 0):null}),y||I.push(Tr),Array.isArray(N[0])){const O=N.shift(),L=new Array(M.length).fill(""),j=new Array(I.length).fill("");let H;H=[...L,...O,...j],H.raw=[...L,...O.raw,...j],M.unshift(H)}const b=[...M,...N,...I],R=v(...b);return a.muiName&&(R.muiName=a.muiName),process.env.NODE_ENV!=="production"&&(R.displayName=mR(c,u,a)),R};return v.withConfig&&(k.withConfig=v.withConfig),k}}function mR(e,t,n){return e?`${e}${Xn(t||"")}`:`Styled(${uR(n)})`}function gR(e,t){let n;return process.env.NODE_ENV!=="production"&&e&&(n=`${e}-${qm(t||"Root")}`),n}function bR(e){for(const t in e)return!1;return!0}function yR(e){return typeof e=="string"&&e.charCodeAt(0)>96}function qm(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Oa(e,t,n=!1){const r={...t};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const o=i;if(o==="components"||o==="slots")r[o]={...e[o],...r[o]};else if(o==="componentsProps"||o==="slotProps"){const s=e[o],a=t[o];if(!a)r[o]=s||{};else if(!s)r[o]=a;else{r[o]={...a};for(const l in s)if(Object.prototype.hasOwnProperty.call(s,l)){const c=l;r[o][c]=Oa(s[c],a[c],n)}}}else o==="className"&&n&&t.className?r.className=Ba(e==null?void 0:e.className,t==null?void 0:t.className):o==="style"&&n&&t.style?r.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:r[o]===void 0&&(r[o]=e[o])}return r}function xR(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Gl(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}].`),xR(e,t,n)}function wR(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 Pn(e){if(e.type)return e;if(e.charAt(0)==="#")return Pn(wR(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.
129
129
  The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:On(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.
130
- The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:On(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const ER=e=>{const t=Pn(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},Gr=(e,t)=>{try{return ER(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Go(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,o)=>o<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 Zm(e){e=Pn(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),s=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),Go({type:a,values:l})}function Pa(e){e=Pn(e);let t=e.type==="hsl"||e.type==="hsla"?Pn(Zm(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 lf(e,t){const n=Pa(e),r=Pa(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function kR(e,t){return e=Pn(e),t=Gl(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Go(e)}function qi(e,t,n){try{return kR(e,t)}catch{return e}}function Kl(e,t){if(e=Pn(e),t=Gl(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 Go(e)}function Xe(e,t,n){try{return Kl(e,t)}catch{return e}}function ql(e,t){if(e=Pn(e),t=Gl(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 Go(e)}function Qe(e,t,n){try{return ql(e,t)}catch{return e}}function SR(e,t=.15){return Pa(e)>.5?Kl(e,t):ql(e,t)}function Yi(e,t,n){try{return SR(e,t)}catch{return e}}const CR=P.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ve.node,Ve.object);function _R(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?Oa(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?Oa(i,r,t.components.mergeClassNameAndStyle):r}function TR({props:e,name:t}){const n=P.useContext(CR);return _R({props:e,name:t,theme:{components:n}})}const cf={theme:void 0};function NR(e){let t,n;return function(i){let o=t;return(o===void 0||i.theme!==n)&&(cf.theme=i.theme,o=Km(e(cf)),t=o,n=i.theme),o}}function AR(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 uf=(e,t,n,r=[])=>{let i=e;t.forEach((o,s)=>{s===t.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},RR=(e,t,n)=>{function r(i,o=[],s=[]){Object.entries(i).forEach(([a,l])=>{(!n||n&&!n([...o,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...o,a],Array.isArray(l)?[...s,a]:s):t([...o,a],l,s))})}r(e)},MR=(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 Ws(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},o={},s={};return RR(e,(a,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const u=`--${n?`${n}-`:""}${a.join("-")}`,d=MR(a,l);Object.assign(i,{[u]:d}),uf(o,a,`var(${u})`,c),uf(s,a,`var(${u}, ${d})`,c)}},a=>a[0]==="vars"),{css:i,vars:o,varsWithDefaults:s}}function IR(e,t={}){const{getSelector:n=x,disableCssColorScheme:r,colorSchemeSelector:i}=t,{colorSchemes:o={},components:s,defaultColorScheme:a="light",...l}=e,{vars:c,css:u,varsWithDefaults:d}=Ws(l,t);let f=d;const p={},{[a]:g,...m}=o;if(Object.entries(m||{}).forEach(([v,_])=>{const{vars:S,css:C,varsWithDefaults:M}=Ws(_,t);f=Kt(f,M),p[v]={css:C,vars:S}}),g){const{css:v,vars:_,varsWithDefaults:S}=Ws(g,t);f=Kt(f,S),p[a]={css:v,vars:_}}function x(v,_){var C,M;let S=i;if(i==="class"&&(S=".%s"),i==="data"&&(S="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(S=`[${i}="%s"]`),v){if(S==="media")return e.defaultColorScheme===v?":root":{[`@media (prefers-color-scheme: ${((M=(C=o[v])==null?void 0:C.palette)==null?void 0:M.mode)||v})`]:{":root":_}};if(S)return e.defaultColorScheme===v?`:root, ${S.replace("%s",String(v))}`:S.replace("%s",String(v))}return":root"}return{vars:f,generateThemeVars:()=>{let v={...c};return Object.entries(p).forEach(([,{vars:_}])=>{v=Kt(v,_)}),v},generateStyleSheets:()=>{var N,I;const v=[],_=e.defaultColorScheme||"light";function S(b,R){Object.keys(R).length&&v.push(typeof b=="string"?{[b]:{...R}}:b)}S(n(void 0,{...u}),u);const{[_]:C,...M}=p;if(C){const{css:b}=C,R=(I=(N=o[_])==null?void 0:N.palette)==null?void 0:I.mode,O=!r&&R?{colorScheme:R,...b}:{...b};S(n(_,{...O}),O)}return Object.entries(M).forEach(([b,{css:R}])=>{var $,U;const O=(U=($=o[b])==null?void 0:$.palette)==null?void 0:U.mode,D=!r&&O?{colorScheme:O,...R}:{...R};S(n(b,{...D}),D)}),v}}}function OR(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 fi={black:"#000",white:"#fff"},PR={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"},sr={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},ar={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},Hr={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},lr={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},cr={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},ur={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function Xm(){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:fi.white,default:fi.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 DR=Xm();function Qm(){return{text:{primary:fi.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:fi.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 df=Qm();function ff(e,t,n,r){const i=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=ql(e.main,i):t==="dark"&&(e.dark=Kl(e.main,o)))}function LR(e="light"){return e==="dark"?{main:lr[200],light:lr[50],dark:lr[400]}:{main:lr[700],light:lr[400],dark:lr[800]}}function FR(e="light"){return e==="dark"?{main:sr[200],light:sr[50],dark:sr[400]}:{main:sr[500],light:sr[300],dark:sr[700]}}function BR(e="light"){return e==="dark"?{main:ar[500],light:ar[300],dark:ar[700]}:{main:ar[700],light:ar[400],dark:ar[800]}}function jR(e="light"){return e==="dark"?{main:cr[400],light:cr[300],dark:cr[700]}:{main:cr[700],light:cr[500],dark:cr[900]}}function $R(e="light"){return e==="dark"?{main:ur[400],light:ur[300],dark:ur[700]}:{main:ur[800],light:ur[500],dark:ur[900]}}function VR(e="light"){return e==="dark"?{main:Hr[400],light:Hr[300],dark:Hr[700]}:{main:"#ed6c02",light:Hr[500],dark:Hr[900]}}function Yl(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,...i}=e,o=e.primary||LR(t),s=e.secondary||FR(t),a=e.error||BR(t),l=e.info||jR(t),c=e.success||$R(t),u=e.warning||VR(t);function d(m){const x=lf(m,df.text.primary)>=n?df.text.primary:DR.text.primary;if(process.env.NODE_ENV!=="production"){const y=lf(m,x);y<3&&console.error([`MUI: The contrast ratio of ${y}:1 for ${x} on ${m}`,"falls below the WCAG recommended absolute minimum contrast ratio of 3:1.","https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join(`
131
- `))}return x}const f=({color:m,name:x,mainShade:y=500,lightShade:k=300,darkShade:v=700})=>{if(m={...m},!m.main&&m[y]&&(m.main=m[y]),!m.hasOwnProperty("main"))throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${x?` (${x})`:""} provided to augmentColor(color) is invalid.
130
+ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:On(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const vR=e=>{const t=Pn(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},Gr=(e,t)=>{try{return vR(e)}catch{return t&&process.env.NODE_ENV!=="production"&&console.warn(t),e}};function Go(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,o)=>o<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 Ym(e){e=Pn(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),s=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),Go({type:a,values:l})}function Pa(e){e=Pn(e);let t=e.type==="hsl"||e.type==="hsla"?Pn(Ym(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 lf(e,t){const n=Pa(e),r=Pa(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function ER(e,t){return e=Pn(e),t=Gl(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Go(e)}function qi(e,t,n){try{return ER(e,t)}catch{return e}}function Kl(e,t){if(e=Pn(e),t=Gl(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 Go(e)}function Qe(e,t,n){try{return Kl(e,t)}catch{return e}}function ql(e,t){if(e=Pn(e),t=Gl(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 Go(e)}function Je(e,t,n){try{return ql(e,t)}catch{return e}}function kR(e,t=.15){return Pa(e)>.5?Kl(e,t):ql(e,t)}function Yi(e,t,n){try{return kR(e,t)}catch{return e}}const SR=D.createContext(void 0);process.env.NODE_ENV!=="production"&&(je.node,je.object);function CR(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?Oa(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?Oa(i,r,t.components.mergeClassNameAndStyle):r}function _R({props:e,name:t}){const n=D.useContext(SR);return CR({props:e,name:t,theme:{components:n}})}const cf={theme:void 0};function TR(e){let t,n;return function(i){let o=t;return(o===void 0||i.theme!==n)&&(cf.theme=i.theme,o=Gm(e(cf)),t=o,n=i.theme),o}}function NR(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 uf=(e,t,n,r=[])=>{let i=e;t.forEach((o,s)=>{s===t.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},AR=(e,t,n)=>{function r(i,o=[],s=[]){Object.entries(i).forEach(([a,l])=>{(!n||n&&!n([...o,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...o,a],Array.isArray(l)?[...s,a]:s):t([...o,a],l,s))})}r(e)},RR=(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 Ws(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},o={},s={};return AR(e,(a,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const u=`--${n?`${n}-`:""}${a.join("-")}`,d=RR(a,l);Object.assign(i,{[u]:d}),uf(o,a,`var(${u})`,c),uf(s,a,`var(${u}, ${d})`,c)}},a=>a[0]==="vars"),{css:i,vars:o,varsWithDefaults:s}}function MR(e,t={}){const{getSelector:n=x,disableCssColorScheme:r,colorSchemeSelector:i}=t,{colorSchemes:o={},components:s,defaultColorScheme:a="light",...l}=e,{vars:c,css:u,varsWithDefaults:d}=Ws(l,t);let f=d;const p={},{[a]:g,...m}=o;if(Object.entries(m||{}).forEach(([v,_])=>{const{vars:k,css:C,varsWithDefaults:M}=Ws(_,t);f=Wt(f,M),p[v]={css:C,vars:k}}),g){const{css:v,vars:_,varsWithDefaults:k}=Ws(g,t);f=Wt(f,k),p[a]={css:v,vars:_}}function x(v,_){var C,M;let k=i;if(i==="class"&&(k=".%s"),i==="data"&&(k="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(k=`[${i}="%s"]`),v){if(k==="media")return e.defaultColorScheme===v?":root":{[`@media (prefers-color-scheme: ${((M=(C=o[v])==null?void 0:C.palette)==null?void 0:M.mode)||v})`]:{":root":_}};if(k)return e.defaultColorScheme===v?`:root, ${k.replace("%s",String(v))}`:k.replace("%s",String(v))}return":root"}return{vars:f,generateThemeVars:()=>{let v={...c};return Object.entries(p).forEach(([,{vars:_}])=>{v=Wt(v,_)}),v},generateStyleSheets:()=>{var N,I;const v=[],_=e.defaultColorScheme||"light";function k(b,R){Object.keys(R).length&&v.push(typeof b=="string"?{[b]:{...R}}:b)}k(n(void 0,{...u}),u);const{[_]:C,...M}=p;if(C){const{css:b}=C,R=(I=(N=o[_])==null?void 0:N.palette)==null?void 0:I.mode,O=!r&&R?{colorScheme:R,...b}:{...b};k(n(_,{...O}),O)}return Object.entries(M).forEach(([b,{css:R}])=>{var j,H;const O=(H=(j=o[b])==null?void 0:j.palette)==null?void 0:H.mode,L=!r&&O?{colorScheme:O,...R}:{...R};k(n(b,{...L}),L)}),v}}}function IR(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 fi={black:"#000",white:"#fff"},OR={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"},sr={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},ar={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},Hr={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},lr={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},cr={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},ur={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function Zm(){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:fi.white,default:fi.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 PR=Zm();function Xm(){return{text:{primary:fi.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:fi.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 df=Xm();function ff(e,t,n,r){const i=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=ql(e.main,i):t==="dark"&&(e.dark=Kl(e.main,o)))}function DR(e="light"){return e==="dark"?{main:lr[200],light:lr[50],dark:lr[400]}:{main:lr[700],light:lr[400],dark:lr[800]}}function LR(e="light"){return e==="dark"?{main:sr[200],light:sr[50],dark:sr[400]}:{main:sr[500],light:sr[300],dark:sr[700]}}function FR(e="light"){return e==="dark"?{main:ar[500],light:ar[300],dark:ar[700]}:{main:ar[700],light:ar[400],dark:ar[800]}}function BR(e="light"){return e==="dark"?{main:cr[400],light:cr[300],dark:cr[700]}:{main:cr[700],light:cr[500],dark:cr[900]}}function jR(e="light"){return e==="dark"?{main:ur[400],light:ur[300],dark:ur[700]}:{main:ur[800],light:ur[500],dark:ur[900]}}function $R(e="light"){return e==="dark"?{main:Hr[400],light:Hr[300],dark:Hr[700]}:{main:"#ed6c02",light:Hr[500],dark:Hr[900]}}function Yl(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,...i}=e,o=e.primary||DR(t),s=e.secondary||LR(t),a=e.error||FR(t),l=e.info||BR(t),c=e.success||jR(t),u=e.warning||$R(t);function d(m){const x=lf(m,df.text.primary)>=n?df.text.primary:PR.text.primary;if(process.env.NODE_ENV!=="production"){const y=lf(m,x);y<3&&console.error([`MUI: The contrast ratio of ${y}:1 for ${x} on ${m}`,"falls below the WCAG recommended absolute minimum contrast ratio of 3:1.","https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join(`
131
+ `))}return x}const f=({color:m,name:x,mainShade:y=500,lightShade:E=300,darkShade:v=700})=>{if(m={...m},!m.main&&m[y]&&(m.main=m[y]),!m.hasOwnProperty("main"))throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${x?` (${x})`:""} provided to augmentColor(color) is invalid.
132
132
  The color object needs to have a \`main\` property or a \`${y}\` property.`:On(11,x?` (${x})`:"",y));if(typeof m.main!="string")throw new Error(process.env.NODE_ENV!=="production"?`MUI: The color${x?` (${x})`:""} provided to augmentColor(color) is invalid.
133
133
  \`color.main\` should be a string, but \`${JSON.stringify(m.main)}\` was provided instead.
134
134
 
@@ -142,21 +142,21 @@ const theme1 = createTheme({ palette: {
142
142
 
143
143
  const theme2 = createTheme({ palette: {
144
144
  primary: { main: green[500] },
145
- } });`:On(12,x?` (${x})`:"",JSON.stringify(m.main)));return ff(m,"light",k,r),ff(m,"dark",v,r),m.contrastText||(m.contrastText=d(m.main)),m};let p;return t==="light"?p=Xm():t==="dark"&&(p=Qm()),process.env.NODE_ENV!=="production"&&(p||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),Kt({common:{...fi},mode:t,primary:f({color:o,name:"primary"}),secondary:f({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:a,name:"error"}),warning:f({color:u,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:c,name:"success"}),grey:PR,contrastThreshold:n,getContrastText:d,augmentColor:f,tonalOffset:r,...p},i)}function zR(e){const t={};return Object.entries(e).forEach(r=>{const[i,o]=r;typeof o=="object"&&(t[i]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),t}function UR(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function HR(e){return Math.round(e*1e5)/1e5}const hf={textTransform:"uppercase"},pf='"Roboto", "Helvetica", "Arial", sans-serif';function WR(e,t){const{fontFamily:n=pf,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:o=400,fontWeightMedium:s=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 f=r/14,p=u||(x=>`${x/l*f}rem`),g=(x,y,k,v,_)=>({fontFamily:n,fontWeight:x,fontSize:p(y),lineHeight:k,...n===pf?{letterSpacing:`${HR(v/y)}em`}:{},..._,...c}),m={h1:g(i,96,1.167,-1.5),h2:g(i,60,1.2,-.5),h3:g(o,48,1.167,0),h4:g(o,34,1.235,.25),h5:g(o,24,1.334,0),h6:g(s,20,1.6,.15),subtitle1:g(o,16,1.75,.15),subtitle2:g(s,14,1.57,.1),body1:g(o,16,1.5,.15),body2:g(o,14,1.43,.15),button:g(s,14,1.75,.4,hf),caption:g(o,12,1.66,.4),overline:g(o,12,2.66,1,hf),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Kt({htmlFontSize:l,pxToRem:p,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:o,fontWeightMedium:s,fontWeightBold:a,...m},d,{clone:!1})}const GR=.2,KR=.14,qR=.12;function ot(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${GR})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${KR})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${qR})`].join(",")}const YR=["none",ot(0,2,1,-1,0,1,1,0,0,1,3,0),ot(0,3,1,-2,0,2,2,0,0,1,5,0),ot(0,3,3,-2,0,3,4,0,0,1,8,0),ot(0,2,4,-1,0,4,5,0,0,1,10,0),ot(0,3,5,-1,0,5,8,0,0,1,14,0),ot(0,3,5,-1,0,6,10,0,0,1,18,0),ot(0,4,5,-2,0,7,10,1,0,2,16,1),ot(0,5,5,-3,0,8,10,1,0,3,14,2),ot(0,5,6,-3,0,9,12,1,0,3,16,2),ot(0,6,6,-3,0,10,14,1,0,4,18,3),ot(0,6,7,-4,0,11,15,1,0,4,20,3),ot(0,7,8,-4,0,12,17,2,0,5,22,4),ot(0,7,8,-4,0,13,19,2,0,5,24,4),ot(0,7,9,-4,0,14,21,2,0,5,26,4),ot(0,8,9,-5,0,15,22,2,0,6,28,5),ot(0,8,10,-5,0,16,24,2,0,6,30,5),ot(0,8,11,-5,0,17,26,2,0,6,32,5),ot(0,9,11,-5,0,18,28,2,0,7,34,6),ot(0,9,12,-6,0,19,29,2,0,7,36,6),ot(0,10,13,-6,0,20,31,3,0,8,38,7),ot(0,10,13,-6,0,21,33,3,0,8,40,7),ot(0,10,14,-6,0,22,35,3,0,8,42,7),ot(0,11,14,-7,0,23,36,3,0,9,44,8),ot(0,11,15,-7,0,24,38,3,0,9,46,8)],ZR={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)"},XR={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function mf(e){return`${Math.round(e)}ms`}function QR(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function JR(e){const t={...ZR,...e.easing},n={...XR,...e.duration};return{getAutoHeightDuration:QR,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=t.easeInOut,delay:l=0,...c}=o;if(process.env.NODE_ENV!=="production"){const u=f=>typeof f=="string",d=f=>!Number.isNaN(parseFloat(f));!u(i)&&!Array.isArray(i)&&console.error('MUI: Argument "props" must be a string or Array.'),!d(s)&&!u(s)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${s}.`),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 o!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
146
- `)),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 s=="string"?s:mf(s)} ${a} ${typeof l=="string"?l:mf(l)}`).join(",")},...e,easing:t,duration:n}}const eM={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function tM(e){return yn(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Jm(e={}){const t={...e};function n(r){const i=Object.entries(r);for(let o=0;o<i.length;o++){const[s,a]=i[o];!tM(a)||s.startsWith("unstable_")?delete r[s]:yn(a)&&(r[s]={...a},n(r[s]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
145
+ } });`:On(12,x?` (${x})`:"",JSON.stringify(m.main)));return ff(m,"light",E,r),ff(m,"dark",v,r),m.contrastText||(m.contrastText=d(m.main)),m};let p;return t==="light"?p=Zm():t==="dark"&&(p=Xm()),process.env.NODE_ENV!=="production"&&(p||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),Wt({common:{...fi},mode:t,primary:f({color:o,name:"primary"}),secondary:f({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:a,name:"error"}),warning:f({color:u,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:c,name:"success"}),grey:OR,contrastThreshold:n,getContrastText:d,augmentColor:f,tonalOffset:r,...p},i)}function VR(e){const t={};return Object.entries(e).forEach(r=>{const[i,o]=r;typeof o=="object"&&(t[i]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),t}function zR(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function UR(e){return Math.round(e*1e5)/1e5}const hf={textTransform:"uppercase"},pf='"Roboto", "Helvetica", "Arial", sans-serif';function HR(e,t){const{fontFamily:n=pf,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:o=400,fontWeightMedium:s=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 f=r/14,p=u||(x=>`${x/l*f}rem`),g=(x,y,E,v,_)=>({fontFamily:n,fontWeight:x,fontSize:p(y),lineHeight:E,...n===pf?{letterSpacing:`${UR(v/y)}em`}:{},..._,...c}),m={h1:g(i,96,1.167,-1.5),h2:g(i,60,1.2,-.5),h3:g(o,48,1.167,0),h4:g(o,34,1.235,.25),h5:g(o,24,1.334,0),h6:g(s,20,1.6,.15),subtitle1:g(o,16,1.75,.15),subtitle2:g(s,14,1.57,.1),body1:g(o,16,1.5,.15),body2:g(o,14,1.43,.15),button:g(s,14,1.75,.4,hf),caption:g(o,12,1.66,.4),overline:g(o,12,2.66,1,hf),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Wt({htmlFontSize:l,pxToRem:p,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:o,fontWeightMedium:s,fontWeightBold:a,...m},d,{clone:!1})}const WR=.2,GR=.14,KR=.12;function st(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${WR})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${GR})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${KR})`].join(",")}const qR=["none",st(0,2,1,-1,0,1,1,0,0,1,3,0),st(0,3,1,-2,0,2,2,0,0,1,5,0),st(0,3,3,-2,0,3,4,0,0,1,8,0),st(0,2,4,-1,0,4,5,0,0,1,10,0),st(0,3,5,-1,0,5,8,0,0,1,14,0),st(0,3,5,-1,0,6,10,0,0,1,18,0),st(0,4,5,-2,0,7,10,1,0,2,16,1),st(0,5,5,-3,0,8,10,1,0,3,14,2),st(0,5,6,-3,0,9,12,1,0,3,16,2),st(0,6,6,-3,0,10,14,1,0,4,18,3),st(0,6,7,-4,0,11,15,1,0,4,20,3),st(0,7,8,-4,0,12,17,2,0,5,22,4),st(0,7,8,-4,0,13,19,2,0,5,24,4),st(0,7,9,-4,0,14,21,2,0,5,26,4),st(0,8,9,-5,0,15,22,2,0,6,28,5),st(0,8,10,-5,0,16,24,2,0,6,30,5),st(0,8,11,-5,0,17,26,2,0,6,32,5),st(0,9,11,-5,0,18,28,2,0,7,34,6),st(0,9,12,-6,0,19,29,2,0,7,36,6),st(0,10,13,-6,0,20,31,3,0,8,38,7),st(0,10,13,-6,0,21,33,3,0,8,40,7),st(0,10,14,-6,0,22,35,3,0,8,42,7),st(0,11,14,-7,0,23,36,3,0,9,44,8),st(0,11,15,-7,0,24,38,3,0,9,46,8)],YR={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)"},ZR={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function mf(e){return`${Math.round(e)}ms`}function XR(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function QR(e){const t={...YR,...e.easing},n={...ZR,...e.duration};return{getAutoHeightDuration:XR,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=t.easeInOut,delay:l=0,...c}=o;if(process.env.NODE_ENV!=="production"){const u=f=>typeof f=="string",d=f=>!Number.isNaN(parseFloat(f));!u(i)&&!Array.isArray(i)&&console.error('MUI: Argument "props" must be a string or Array.'),!d(s)&&!u(s)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${s}.`),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 o!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
146
+ `)),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 s=="string"?s:mf(s)} ${a} ${typeof l=="string"?l:mf(l)}`).join(",")},...e,easing:t,duration:n}}const JR={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function eM(e){return bn(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Qm(e={}){const t={...e};function n(r){const i=Object.entries(r);for(let o=0;o<i.length;o++){const[s,a]=i[o];!eM(a)||s.startsWith("unstable_")?delete r[s]:bn(a)&&(r[s]={...a},n(r[s]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
147
147
 
148
148
  const theme = ${JSON.stringify(t,null,2)};
149
149
 
150
150
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
151
151
  theme.transitions = createTransitions(theme.transitions || {});
152
152
 
153
- export default theme;`}function Da(e={},...t){const{breakpoints:n,mixins:r={},spacing:i,palette:o={},transitions:s={},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.":On(20));const u=Yl(o),d=Wm(e);let f=Kt(d,{mixins:UR(d.breakpoints,r),palette:u,shadows:YR.slice(),typography:WR(u,a),transitions:JR(s),zIndex:{...eM}});if(f=Kt(f,c),f=t.reduce((p,g)=>Kt(p,g),f),process.env.NODE_ENV!=="production"){const p=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],g=(m,x)=>{let y;for(y in m){const k=m[y];if(p.includes(y)&&Object.keys(k).length>0){if(process.env.NODE_ENV!=="production"){const v=Wl("",y);console.error([`MUI: The \`${x}\` component increases the CSS specificity of the \`${y}\` internal state.`,"You can not override it like this: ",JSON.stringify(m,null,2),"",`Instead, you need to use the '&.${v}' syntax:`,JSON.stringify({root:{[`&.${v}`]:k}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
154
- `))}m[y]={}}}};Object.keys(f.components).forEach(m=>{const x=f.components[m].styleOverrides;x&&m.startsWith("Mui")&&g(x,m)})}return f.unstable_sxConfig={...Wo,...c==null?void 0:c.unstable_sxConfig},f.unstable_sx=function(g){return Tr({sx:g,theme:this})},f.toRuntimeSource=Jm,f}function nM(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 rM=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=nM(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function eg(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function tg(e){return e==="dark"?rM:[]}function iM(e){const{palette:t={mode:"light"},opacity:n,overlays:r,...i}=e,o=Yl(t);return{palette:o,opacity:{...eg(o.mode),...n},overlays:r||tg(o.mode),...i}}function oM(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 sM=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],aM=e=>(t,n)=>{const r=e.rootSelector||":root",i=e.colorSchemeSelector;let o=i;if(i==="class"&&(o=".%s"),i==="data"&&(o="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const s={};return sM(e.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:o?{[o.replace("%s",t)]:s,[`${r}, ${o.replace("%s",t)}`]:n}:{[r]:{...n,...s}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(o)return o.replace("%s",String(t))}return r};function lM(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function V(e,t,n){!e[t]&&n&&(e[t]=n)}function Kr(e){return typeof e!="string"||!e.startsWith("hsl")?e:Zm(e)}function bn(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Gr(Kr(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().
155
- 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 cM(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const an=e=>{try{return e()}catch{}},uM=(e="mui")=>AR(e);function Gs(e,t,n,r){if(!t)return;t=t===!0?{}:t;const i=r==="dark"?"dark":"light";if(!n){e[r]=iM({...t,palette:{mode:i,...t==null?void 0:t.palette}});return}const{palette:o,...s}=Da({...n,palette:{mode:i,...t==null?void 0:t.palette}});return e[r]={...t,palette:o,opacity:{...eg(i),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||tg(i)},s}function dM(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:s=oM,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),f=uM(o),{[d]:p,light:g,dark:m,...x}=n,y={...x};let k=p;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.`:On(21,d));const v=Gs(y,k,c,d);g&&!y.light&&Gs(y,g,void 0,"light"),m&&!y.dark&&Gs(y,m,void 0,"dark");let _={defaultColorScheme:d,...v,cssVarPrefix:o,colorSchemeSelector:a,rootSelector:l,getCssVar:f,colorSchemes:y,font:{...zR(v.typography),...v.font},spacing:cM(c.spacing)};Object.keys(_.colorSchemes).forEach(I=>{const b=_.colorSchemes[I].palette,R=O=>{const D=O.split("-"),$=D[1],U=D[2];return f(O,b[$][U])};if(b.mode==="light"&&(V(b.common,"background","#fff"),V(b.common,"onBackground","#000")),b.mode==="dark"&&(V(b.common,"background","#000"),V(b.common,"onBackground","#fff")),lM(b,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),b.mode==="light"){V(b.Alert,"errorColor",Xe(b.error.light,.6)),V(b.Alert,"infoColor",Xe(b.info.light,.6)),V(b.Alert,"successColor",Xe(b.success.light,.6)),V(b.Alert,"warningColor",Xe(b.warning.light,.6)),V(b.Alert,"errorFilledBg",R("palette-error-main")),V(b.Alert,"infoFilledBg",R("palette-info-main")),V(b.Alert,"successFilledBg",R("palette-success-main")),V(b.Alert,"warningFilledBg",R("palette-warning-main")),V(b.Alert,"errorFilledColor",an(()=>b.getContrastText(b.error.main))),V(b.Alert,"infoFilledColor",an(()=>b.getContrastText(b.info.main))),V(b.Alert,"successFilledColor",an(()=>b.getContrastText(b.success.main))),V(b.Alert,"warningFilledColor",an(()=>b.getContrastText(b.warning.main))),V(b.Alert,"errorStandardBg",Qe(b.error.light,.9)),V(b.Alert,"infoStandardBg",Qe(b.info.light,.9)),V(b.Alert,"successStandardBg",Qe(b.success.light,.9)),V(b.Alert,"warningStandardBg",Qe(b.warning.light,.9)),V(b.Alert,"errorIconColor",R("palette-error-main")),V(b.Alert,"infoIconColor",R("palette-info-main")),V(b.Alert,"successIconColor",R("palette-success-main")),V(b.Alert,"warningIconColor",R("palette-warning-main")),V(b.AppBar,"defaultBg",R("palette-grey-100")),V(b.Avatar,"defaultBg",R("palette-grey-400")),V(b.Button,"inheritContainedBg",R("palette-grey-300")),V(b.Button,"inheritContainedHoverBg",R("palette-grey-A100")),V(b.Chip,"defaultBorder",R("palette-grey-400")),V(b.Chip,"defaultAvatarColor",R("palette-grey-700")),V(b.Chip,"defaultIconColor",R("palette-grey-700")),V(b.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),V(b.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),V(b.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),V(b.LinearProgress,"primaryBg",Qe(b.primary.main,.62)),V(b.LinearProgress,"secondaryBg",Qe(b.secondary.main,.62)),V(b.LinearProgress,"errorBg",Qe(b.error.main,.62)),V(b.LinearProgress,"infoBg",Qe(b.info.main,.62)),V(b.LinearProgress,"successBg",Qe(b.success.main,.62)),V(b.LinearProgress,"warningBg",Qe(b.warning.main,.62)),V(b.Skeleton,"bg",`rgba(${R("palette-text-primaryChannel")} / 0.11)`),V(b.Slider,"primaryTrack",Qe(b.primary.main,.62)),V(b.Slider,"secondaryTrack",Qe(b.secondary.main,.62)),V(b.Slider,"errorTrack",Qe(b.error.main,.62)),V(b.Slider,"infoTrack",Qe(b.info.main,.62)),V(b.Slider,"successTrack",Qe(b.success.main,.62)),V(b.Slider,"warningTrack",Qe(b.warning.main,.62));const O=Yi(b.background.default,.8);V(b.SnackbarContent,"bg",O),V(b.SnackbarContent,"color",an(()=>b.getContrastText(O))),V(b.SpeedDialAction,"fabHoverBg",Yi(b.background.paper,.15)),V(b.StepConnector,"border",R("palette-grey-400")),V(b.StepContent,"border",R("palette-grey-400")),V(b.Switch,"defaultColor",R("palette-common-white")),V(b.Switch,"defaultDisabledColor",R("palette-grey-100")),V(b.Switch,"primaryDisabledColor",Qe(b.primary.main,.62)),V(b.Switch,"secondaryDisabledColor",Qe(b.secondary.main,.62)),V(b.Switch,"errorDisabledColor",Qe(b.error.main,.62)),V(b.Switch,"infoDisabledColor",Qe(b.info.main,.62)),V(b.Switch,"successDisabledColor",Qe(b.success.main,.62)),V(b.Switch,"warningDisabledColor",Qe(b.warning.main,.62)),V(b.TableCell,"border",Qe(qi(b.divider,1),.88)),V(b.Tooltip,"bg",qi(b.grey[700],.92))}if(b.mode==="dark"){V(b.Alert,"errorColor",Qe(b.error.light,.6)),V(b.Alert,"infoColor",Qe(b.info.light,.6)),V(b.Alert,"successColor",Qe(b.success.light,.6)),V(b.Alert,"warningColor",Qe(b.warning.light,.6)),V(b.Alert,"errorFilledBg",R("palette-error-dark")),V(b.Alert,"infoFilledBg",R("palette-info-dark")),V(b.Alert,"successFilledBg",R("palette-success-dark")),V(b.Alert,"warningFilledBg",R("palette-warning-dark")),V(b.Alert,"errorFilledColor",an(()=>b.getContrastText(b.error.dark))),V(b.Alert,"infoFilledColor",an(()=>b.getContrastText(b.info.dark))),V(b.Alert,"successFilledColor",an(()=>b.getContrastText(b.success.dark))),V(b.Alert,"warningFilledColor",an(()=>b.getContrastText(b.warning.dark))),V(b.Alert,"errorStandardBg",Xe(b.error.light,.9)),V(b.Alert,"infoStandardBg",Xe(b.info.light,.9)),V(b.Alert,"successStandardBg",Xe(b.success.light,.9)),V(b.Alert,"warningStandardBg",Xe(b.warning.light,.9)),V(b.Alert,"errorIconColor",R("palette-error-main")),V(b.Alert,"infoIconColor",R("palette-info-main")),V(b.Alert,"successIconColor",R("palette-success-main")),V(b.Alert,"warningIconColor",R("palette-warning-main")),V(b.AppBar,"defaultBg",R("palette-grey-900")),V(b.AppBar,"darkBg",R("palette-background-paper")),V(b.AppBar,"darkColor",R("palette-text-primary")),V(b.Avatar,"defaultBg",R("palette-grey-600")),V(b.Button,"inheritContainedBg",R("palette-grey-800")),V(b.Button,"inheritContainedHoverBg",R("palette-grey-700")),V(b.Chip,"defaultBorder",R("palette-grey-700")),V(b.Chip,"defaultAvatarColor",R("palette-grey-300")),V(b.Chip,"defaultIconColor",R("palette-grey-300")),V(b.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),V(b.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),V(b.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),V(b.LinearProgress,"primaryBg",Xe(b.primary.main,.5)),V(b.LinearProgress,"secondaryBg",Xe(b.secondary.main,.5)),V(b.LinearProgress,"errorBg",Xe(b.error.main,.5)),V(b.LinearProgress,"infoBg",Xe(b.info.main,.5)),V(b.LinearProgress,"successBg",Xe(b.success.main,.5)),V(b.LinearProgress,"warningBg",Xe(b.warning.main,.5)),V(b.Skeleton,"bg",`rgba(${R("palette-text-primaryChannel")} / 0.13)`),V(b.Slider,"primaryTrack",Xe(b.primary.main,.5)),V(b.Slider,"secondaryTrack",Xe(b.secondary.main,.5)),V(b.Slider,"errorTrack",Xe(b.error.main,.5)),V(b.Slider,"infoTrack",Xe(b.info.main,.5)),V(b.Slider,"successTrack",Xe(b.success.main,.5)),V(b.Slider,"warningTrack",Xe(b.warning.main,.5));const O=Yi(b.background.default,.98);V(b.SnackbarContent,"bg",O),V(b.SnackbarContent,"color",an(()=>b.getContrastText(O))),V(b.SpeedDialAction,"fabHoverBg",Yi(b.background.paper,.15)),V(b.StepConnector,"border",R("palette-grey-600")),V(b.StepContent,"border",R("palette-grey-600")),V(b.Switch,"defaultColor",R("palette-grey-300")),V(b.Switch,"defaultDisabledColor",R("palette-grey-600")),V(b.Switch,"primaryDisabledColor",Xe(b.primary.main,.55)),V(b.Switch,"secondaryDisabledColor",Xe(b.secondary.main,.55)),V(b.Switch,"errorDisabledColor",Xe(b.error.main,.55)),V(b.Switch,"infoDisabledColor",Xe(b.info.main,.55)),V(b.Switch,"successDisabledColor",Xe(b.success.main,.55)),V(b.Switch,"warningDisabledColor",Xe(b.warning.main,.55)),V(b.TableCell,"border",Xe(qi(b.divider,1),.68)),V(b.Tooltip,"bg",qi(b.grey[700],.92))}bn(b.background,"default"),bn(b.background,"paper"),bn(b.common,"background"),bn(b.common,"onBackground"),bn(b,"divider"),Object.keys(b).forEach(O=>{const D=b[O];O!=="tonalOffset"&&D&&typeof D=="object"&&(D.main&&V(b[O],"mainChannel",Gr(Kr(D.main))),D.light&&V(b[O],"lightChannel",Gr(Kr(D.light))),D.dark&&V(b[O],"darkChannel",Gr(Kr(D.dark))),D.contrastText&&V(b[O],"contrastTextChannel",Gr(Kr(D.contrastText))),O==="text"&&(bn(b[O],"primary"),bn(b[O],"secondary")),O==="action"&&(D.active&&bn(b[O],"active"),D.selected&&bn(b[O],"selected")))})}),_=t.reduce((I,b)=>Kt(I,b),_);const S={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:aM(_)},{vars:C,generateThemeVars:M,generateStyleSheets:N}=IR(_,S);return _.vars=C,Object.entries(_.colorSchemes[_.defaultColorScheme]).forEach(([I,b])=>{_[I]=b}),_.generateThemeVars=M,_.generateStyleSheets=N,_.generateSpacing=function(){return Hm(c.spacing,Ul(this))},_.getColorSchemeSelector=OR(a),_.spacing=_.generateSpacing(),_.shouldSkipGeneratingVar=s,_.unstable_sxConfig={...Wo,...c==null?void 0:c.unstable_sxConfig},_.unstable_sx=function(b){return Tr({sx:b,theme:this})},_.toRuntimeSource=Jm,_}function gf(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Yl({...n===!0?{}:n.palette,mode:t})})}function fM(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...s}=e,a=o||"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 Da(e,...t);let u=n;"palette"in e||c[a]&&(c[a]!==!0?u=c[a].palette:a==="dark"&&(u={mode:"dark"}));const d=Da({...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},gf(d,"dark",c.dark)),d.palette.mode==="dark"&&(d.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:d.palette},gf(d,"light",c.light)),d}return!n&&!("light"in c)&&a==="light"&&(c.light=!0),dM({...s,colorSchemes:c,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}const hM=fM(),pM="$$material";function mM(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const gM=e=>mM(e)&&e!=="classes",bM=mR({themeId:pM,defaultTheme:hM,rootShouldForwardProp:gM}),yM=NR;process.env.NODE_ENV!=="production"&&(Ve.node,Ve.object.isRequired);function xM(e){return TR(e)}function wM(e){return Wl("MuiSvgIcon",e)}uR("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const vM=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${Xn(t)}`,`fontSize${Xn(n)}`]};return tA(i,wM,r)},EM=bM("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Xn(n.color)}`],t[`fontSize${Xn(n.fontSize)}`]]}})(yM(({theme:e})=>{var t,n,r,i,o,s,a,l,c,u,d,f,p,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:m=>!m.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(o=e.typography)==null?void 0:o.pxToRem)==null?void 0:s.call(o,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(([,m])=>m&&m.main).map(([m])=>{var x,y;return{props:{color:m},style:{color:(y=(x=(e.vars??e).palette)==null?void 0:x[m])==null?void 0:y.main}}}),{props:{color:"action"},style:{color:(f=(d=(e.vars??e).palette)==null?void 0:d.action)==null?void 0:f.active}},{props:{color:"disabled"},style:{color:(g=(p=(e.vars??e).palette)==null?void 0:p.action)==null?void 0:g.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),ko=P.forwardRef(function(t,n){const r=xM({props:t,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:d,viewBox:f="0 0 24 24",...p}=r,g=P.isValidElement(i)&&i.type==="svg",m={...r,color:s,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:f,hasSvgAsChild:g},x={};u||(x.viewBox=f);const y=vM(m);return h.jsxs(EM,{as:a,className:Ba(y.root,o),focusable:"false",color:c,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n,...x,...p,...g&&i.props,ownerState:m,children:[g?i.props.children:i,d?h.jsx("title",{children:d}):null]})});process.env.NODE_ENV!=="production"&&(ko.propTypes={children:Ve.node,classes:Ve.object,className:Ve.string,color:Ve.oneOfType([Ve.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),Ve.string]),component:Ve.elementType,fontSize:Ve.oneOfType([Ve.oneOf(["inherit","large","medium","small"]),Ve.string]),htmlColor:Ve.string,inheritViewBox:Ve.bool,shapeRendering:Ve.string,sx:Ve.oneOfType([Ve.arrayOf(Ve.oneOfType([Ve.func,Ve.object,Ve.bool])),Ve.func,Ve.object]),titleAccess:Ve.string,viewBox:Ve.string});ko.muiName="SvgIcon";function Zl(e,t){function n(r,i){return h.jsx(ko,{"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=ko.muiName,P.memo(P.forwardRef(n))}const ng=Zl(h.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"),rg=Zl(h.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"),ig=Zl(h.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 Zi({onClick:e,disabled:t,theme:n}){const r=Ct(n);return h.jsx("button",{className:r.micButton,onClick:e,disabled:t,"aria-label":"Start Voice Session",type:"button",children:h.jsx(rg,{})})}function Ks({onClick:e,disabled:t,theme:n}){const r=Ct(n);return h.jsx("button",{className:r.chatButton,onClick:e,disabled:t,"aria-label":"Start Chat Session",type:"button",children:h.jsx(ng,{})})}function qs({onClick:e,disabled:t,theme:n}){const r=Ct(n);return h.jsx("button",{className:r.videoButton,onClick:e,disabled:t,"aria-label":"Start Video Session",type:"button",children:h.jsx(ig,{})})}function kM({prompts:e,theme:t}){const n=Ct(t),[r,i]=A.useState(0);return A.useEffect(()=>{const o=setInterval(()=>{i(s=>(s+1)%e.length)},3e3);return()=>clearInterval(o)},[e.length]),h.jsx("div",{className:"w-96 min-h-[3rem] h-12 relative overflow-hidden flex items-center justify-center",children:e.map((o,s)=>h.jsx("div",{className:`
153
+ export default theme;`}function Da(e={},...t){const{breakpoints:n,mixins:r={},spacing:i,palette:o={},transitions:s={},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.":On(20));const u=Yl(o),d=Hm(e);let f=Wt(d,{mixins:zR(d.breakpoints,r),palette:u,shadows:qR.slice(),typography:HR(u,a),transitions:QR(s),zIndex:{...JR}});if(f=Wt(f,c),f=t.reduce((p,g)=>Wt(p,g),f),process.env.NODE_ENV!=="production"){const p=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],g=(m,x)=>{let y;for(y in m){const E=m[y];if(p.includes(y)&&Object.keys(E).length>0){if(process.env.NODE_ENV!=="production"){const v=Wl("",y);console.error([`MUI: The \`${x}\` component increases the CSS specificity of the \`${y}\` internal state.`,"You can not override it like this: ",JSON.stringify(m,null,2),"",`Instead, you need to use the '&.${v}' syntax:`,JSON.stringify({root:{[`&.${v}`]:E}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
154
+ `))}m[y]={}}}};Object.keys(f.components).forEach(m=>{const x=f.components[m].styleOverrides;x&&m.startsWith("Mui")&&g(x,m)})}return f.unstable_sxConfig={...Wo,...c==null?void 0:c.unstable_sxConfig},f.unstable_sx=function(g){return Tr({sx:g,theme:this})},f.toRuntimeSource=Qm,f}function tM(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 nM=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=tM(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Jm(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function eg(e){return e==="dark"?nM:[]}function rM(e){const{palette:t={mode:"light"},opacity:n,overlays:r,...i}=e,o=Yl(t);return{palette:o,opacity:{...Jm(o.mode),...n},overlays:r||eg(o.mode),...i}}function iM(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 oM=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],sM=e=>(t,n)=>{const r=e.rootSelector||":root",i=e.colorSchemeSelector;let o=i;if(i==="class"&&(o=".%s"),i==="data"&&(o="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const s={};return oM(e.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:o?{[o.replace("%s",t)]:s,[`${r}, ${o.replace("%s",t)}`]:n}:{[r]:{...n,...s}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(o)return o.replace("%s",String(t))}return r};function aM(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function z(e,t,n){!e[t]&&n&&(e[t]=n)}function Kr(e){return typeof e!="string"||!e.startsWith("hsl")?e:Ym(e)}function gn(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Gr(Kr(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().
155
+ 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 lM(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const sn=e=>{try{return e()}catch{}},cM=(e="mui")=>NR(e);function Gs(e,t,n,r){if(!t)return;t=t===!0?{}:t;const i=r==="dark"?"dark":"light";if(!n){e[r]=rM({...t,palette:{mode:i,...t==null?void 0:t.palette}});return}const{palette:o,...s}=Da({...n,palette:{mode:i,...t==null?void 0:t.palette}});return e[r]={...t,palette:o,opacity:{...Jm(i),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||eg(i)},s}function uM(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:s=iM,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),f=cM(o),{[d]:p,light:g,dark:m,...x}=n,y={...x};let E=p;if((d==="dark"&&!("dark"in n)||d==="light"&&!("light"in n))&&(E=!0),!E)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${d}\` option is either missing or invalid.`:On(21,d));const v=Gs(y,E,c,d);g&&!y.light&&Gs(y,g,void 0,"light"),m&&!y.dark&&Gs(y,m,void 0,"dark");let _={defaultColorScheme:d,...v,cssVarPrefix:o,colorSchemeSelector:a,rootSelector:l,getCssVar:f,colorSchemes:y,font:{...VR(v.typography),...v.font},spacing:lM(c.spacing)};Object.keys(_.colorSchemes).forEach(I=>{const b=_.colorSchemes[I].palette,R=O=>{const L=O.split("-"),j=L[1],H=L[2];return f(O,b[j][H])};if(b.mode==="light"&&(z(b.common,"background","#fff"),z(b.common,"onBackground","#000")),b.mode==="dark"&&(z(b.common,"background","#000"),z(b.common,"onBackground","#fff")),aM(b,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),b.mode==="light"){z(b.Alert,"errorColor",Qe(b.error.light,.6)),z(b.Alert,"infoColor",Qe(b.info.light,.6)),z(b.Alert,"successColor",Qe(b.success.light,.6)),z(b.Alert,"warningColor",Qe(b.warning.light,.6)),z(b.Alert,"errorFilledBg",R("palette-error-main")),z(b.Alert,"infoFilledBg",R("palette-info-main")),z(b.Alert,"successFilledBg",R("palette-success-main")),z(b.Alert,"warningFilledBg",R("palette-warning-main")),z(b.Alert,"errorFilledColor",sn(()=>b.getContrastText(b.error.main))),z(b.Alert,"infoFilledColor",sn(()=>b.getContrastText(b.info.main))),z(b.Alert,"successFilledColor",sn(()=>b.getContrastText(b.success.main))),z(b.Alert,"warningFilledColor",sn(()=>b.getContrastText(b.warning.main))),z(b.Alert,"errorStandardBg",Je(b.error.light,.9)),z(b.Alert,"infoStandardBg",Je(b.info.light,.9)),z(b.Alert,"successStandardBg",Je(b.success.light,.9)),z(b.Alert,"warningStandardBg",Je(b.warning.light,.9)),z(b.Alert,"errorIconColor",R("palette-error-main")),z(b.Alert,"infoIconColor",R("palette-info-main")),z(b.Alert,"successIconColor",R("palette-success-main")),z(b.Alert,"warningIconColor",R("palette-warning-main")),z(b.AppBar,"defaultBg",R("palette-grey-100")),z(b.Avatar,"defaultBg",R("palette-grey-400")),z(b.Button,"inheritContainedBg",R("palette-grey-300")),z(b.Button,"inheritContainedHoverBg",R("palette-grey-A100")),z(b.Chip,"defaultBorder",R("palette-grey-400")),z(b.Chip,"defaultAvatarColor",R("palette-grey-700")),z(b.Chip,"defaultIconColor",R("palette-grey-700")),z(b.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),z(b.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),z(b.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),z(b.LinearProgress,"primaryBg",Je(b.primary.main,.62)),z(b.LinearProgress,"secondaryBg",Je(b.secondary.main,.62)),z(b.LinearProgress,"errorBg",Je(b.error.main,.62)),z(b.LinearProgress,"infoBg",Je(b.info.main,.62)),z(b.LinearProgress,"successBg",Je(b.success.main,.62)),z(b.LinearProgress,"warningBg",Je(b.warning.main,.62)),z(b.Skeleton,"bg",`rgba(${R("palette-text-primaryChannel")} / 0.11)`),z(b.Slider,"primaryTrack",Je(b.primary.main,.62)),z(b.Slider,"secondaryTrack",Je(b.secondary.main,.62)),z(b.Slider,"errorTrack",Je(b.error.main,.62)),z(b.Slider,"infoTrack",Je(b.info.main,.62)),z(b.Slider,"successTrack",Je(b.success.main,.62)),z(b.Slider,"warningTrack",Je(b.warning.main,.62));const O=Yi(b.background.default,.8);z(b.SnackbarContent,"bg",O),z(b.SnackbarContent,"color",sn(()=>b.getContrastText(O))),z(b.SpeedDialAction,"fabHoverBg",Yi(b.background.paper,.15)),z(b.StepConnector,"border",R("palette-grey-400")),z(b.StepContent,"border",R("palette-grey-400")),z(b.Switch,"defaultColor",R("palette-common-white")),z(b.Switch,"defaultDisabledColor",R("palette-grey-100")),z(b.Switch,"primaryDisabledColor",Je(b.primary.main,.62)),z(b.Switch,"secondaryDisabledColor",Je(b.secondary.main,.62)),z(b.Switch,"errorDisabledColor",Je(b.error.main,.62)),z(b.Switch,"infoDisabledColor",Je(b.info.main,.62)),z(b.Switch,"successDisabledColor",Je(b.success.main,.62)),z(b.Switch,"warningDisabledColor",Je(b.warning.main,.62)),z(b.TableCell,"border",Je(qi(b.divider,1),.88)),z(b.Tooltip,"bg",qi(b.grey[700],.92))}if(b.mode==="dark"){z(b.Alert,"errorColor",Je(b.error.light,.6)),z(b.Alert,"infoColor",Je(b.info.light,.6)),z(b.Alert,"successColor",Je(b.success.light,.6)),z(b.Alert,"warningColor",Je(b.warning.light,.6)),z(b.Alert,"errorFilledBg",R("palette-error-dark")),z(b.Alert,"infoFilledBg",R("palette-info-dark")),z(b.Alert,"successFilledBg",R("palette-success-dark")),z(b.Alert,"warningFilledBg",R("palette-warning-dark")),z(b.Alert,"errorFilledColor",sn(()=>b.getContrastText(b.error.dark))),z(b.Alert,"infoFilledColor",sn(()=>b.getContrastText(b.info.dark))),z(b.Alert,"successFilledColor",sn(()=>b.getContrastText(b.success.dark))),z(b.Alert,"warningFilledColor",sn(()=>b.getContrastText(b.warning.dark))),z(b.Alert,"errorStandardBg",Qe(b.error.light,.9)),z(b.Alert,"infoStandardBg",Qe(b.info.light,.9)),z(b.Alert,"successStandardBg",Qe(b.success.light,.9)),z(b.Alert,"warningStandardBg",Qe(b.warning.light,.9)),z(b.Alert,"errorIconColor",R("palette-error-main")),z(b.Alert,"infoIconColor",R("palette-info-main")),z(b.Alert,"successIconColor",R("palette-success-main")),z(b.Alert,"warningIconColor",R("palette-warning-main")),z(b.AppBar,"defaultBg",R("palette-grey-900")),z(b.AppBar,"darkBg",R("palette-background-paper")),z(b.AppBar,"darkColor",R("palette-text-primary")),z(b.Avatar,"defaultBg",R("palette-grey-600")),z(b.Button,"inheritContainedBg",R("palette-grey-800")),z(b.Button,"inheritContainedHoverBg",R("palette-grey-700")),z(b.Chip,"defaultBorder",R("palette-grey-700")),z(b.Chip,"defaultAvatarColor",R("palette-grey-300")),z(b.Chip,"defaultIconColor",R("palette-grey-300")),z(b.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),z(b.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),z(b.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),z(b.LinearProgress,"primaryBg",Qe(b.primary.main,.5)),z(b.LinearProgress,"secondaryBg",Qe(b.secondary.main,.5)),z(b.LinearProgress,"errorBg",Qe(b.error.main,.5)),z(b.LinearProgress,"infoBg",Qe(b.info.main,.5)),z(b.LinearProgress,"successBg",Qe(b.success.main,.5)),z(b.LinearProgress,"warningBg",Qe(b.warning.main,.5)),z(b.Skeleton,"bg",`rgba(${R("palette-text-primaryChannel")} / 0.13)`),z(b.Slider,"primaryTrack",Qe(b.primary.main,.5)),z(b.Slider,"secondaryTrack",Qe(b.secondary.main,.5)),z(b.Slider,"errorTrack",Qe(b.error.main,.5)),z(b.Slider,"infoTrack",Qe(b.info.main,.5)),z(b.Slider,"successTrack",Qe(b.success.main,.5)),z(b.Slider,"warningTrack",Qe(b.warning.main,.5));const O=Yi(b.background.default,.98);z(b.SnackbarContent,"bg",O),z(b.SnackbarContent,"color",sn(()=>b.getContrastText(O))),z(b.SpeedDialAction,"fabHoverBg",Yi(b.background.paper,.15)),z(b.StepConnector,"border",R("palette-grey-600")),z(b.StepContent,"border",R("palette-grey-600")),z(b.Switch,"defaultColor",R("palette-grey-300")),z(b.Switch,"defaultDisabledColor",R("palette-grey-600")),z(b.Switch,"primaryDisabledColor",Qe(b.primary.main,.55)),z(b.Switch,"secondaryDisabledColor",Qe(b.secondary.main,.55)),z(b.Switch,"errorDisabledColor",Qe(b.error.main,.55)),z(b.Switch,"infoDisabledColor",Qe(b.info.main,.55)),z(b.Switch,"successDisabledColor",Qe(b.success.main,.55)),z(b.Switch,"warningDisabledColor",Qe(b.warning.main,.55)),z(b.TableCell,"border",Qe(qi(b.divider,1),.68)),z(b.Tooltip,"bg",qi(b.grey[700],.92))}gn(b.background,"default"),gn(b.background,"paper"),gn(b.common,"background"),gn(b.common,"onBackground"),gn(b,"divider"),Object.keys(b).forEach(O=>{const L=b[O];O!=="tonalOffset"&&L&&typeof L=="object"&&(L.main&&z(b[O],"mainChannel",Gr(Kr(L.main))),L.light&&z(b[O],"lightChannel",Gr(Kr(L.light))),L.dark&&z(b[O],"darkChannel",Gr(Kr(L.dark))),L.contrastText&&z(b[O],"contrastTextChannel",Gr(Kr(L.contrastText))),O==="text"&&(gn(b[O],"primary"),gn(b[O],"secondary")),O==="action"&&(L.active&&gn(b[O],"active"),L.selected&&gn(b[O],"selected")))})}),_=t.reduce((I,b)=>Wt(I,b),_);const k={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:sM(_)},{vars:C,generateThemeVars:M,generateStyleSheets:N}=MR(_,k);return _.vars=C,Object.entries(_.colorSchemes[_.defaultColorScheme]).forEach(([I,b])=>{_[I]=b}),_.generateThemeVars=M,_.generateStyleSheets=N,_.generateSpacing=function(){return Um(c.spacing,Ul(this))},_.getColorSchemeSelector=IR(a),_.spacing=_.generateSpacing(),_.shouldSkipGeneratingVar=s,_.unstable_sxConfig={...Wo,...c==null?void 0:c.unstable_sxConfig},_.unstable_sx=function(b){return Tr({sx:b,theme:this})},_.toRuntimeSource=Qm,_}function gf(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Yl({...n===!0?{}:n.palette,mode:t})})}function dM(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...s}=e,a=o||"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 Da(e,...t);let u=n;"palette"in e||c[a]&&(c[a]!==!0?u=c[a].palette:a==="dark"&&(u={mode:"dark"}));const d=Da({...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},gf(d,"dark",c.dark)),d.palette.mode==="dark"&&(d.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:d.palette},gf(d,"light",c.light)),d}return!n&&!("light"in c)&&a==="light"&&(c.light=!0),uM({...s,colorSchemes:c,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}const fM=dM(),hM="$$material";function pM(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const mM=e=>pM(e)&&e!=="classes",gM=pR({themeId:hM,defaultTheme:fM,rootShouldForwardProp:mM}),bM=TR;process.env.NODE_ENV!=="production"&&(je.node,je.object.isRequired);function yM(e){return _R(e)}function xM(e){return Wl("MuiSvgIcon",e)}cR("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const wM=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${Xn(t)}`,`fontSize${Xn(n)}`]};return eA(i,xM,r)},vM=gM("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Xn(n.color)}`],t[`fontSize${Xn(n.fontSize)}`]]}})(bM(({theme:e})=>{var t,n,r,i,o,s,a,l,c,u,d,f,p,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:m=>!m.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(o=e.typography)==null?void 0:o.pxToRem)==null?void 0:s.call(o,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(([,m])=>m&&m.main).map(([m])=>{var x,y;return{props:{color:m},style:{color:(y=(x=(e.vars??e).palette)==null?void 0:x[m])==null?void 0:y.main}}}),{props:{color:"action"},style:{color:(f=(d=(e.vars??e).palette)==null?void 0:d.action)==null?void 0:f.active}},{props:{color:"disabled"},style:{color:(g=(p=(e.vars??e).palette)==null?void 0:p.action)==null?void 0:g.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),ko=D.forwardRef(function(t,n){const r=yM({props:t,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:d,viewBox:f="0 0 24 24",...p}=r,g=D.isValidElement(i)&&i.type==="svg",m={...r,color:s,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:f,hasSvgAsChild:g},x={};u||(x.viewBox=f);const y=wM(m);return h.jsxs(vM,{as:a,className:Ba(y.root,o),focusable:"false",color:c,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n,...x,...p,...g&&i.props,ownerState:m,children:[g?i.props.children:i,d?h.jsx("title",{children:d}):null]})});process.env.NODE_ENV!=="production"&&(ko.propTypes={children:je.node,classes:je.object,className:je.string,color:je.oneOfType([je.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),je.string]),component:je.elementType,fontSize:je.oneOfType([je.oneOf(["inherit","large","medium","small"]),je.string]),htmlColor:je.string,inheritViewBox:je.bool,shapeRendering:je.string,sx:je.oneOfType([je.arrayOf(je.oneOfType([je.func,je.object,je.bool])),je.func,je.object]),titleAccess:je.string,viewBox:je.string});ko.muiName="SvgIcon";function Zl(e,t){function n(r,i){return h.jsx(ko,{"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=ko.muiName,D.memo(D.forwardRef(n))}const tg=Zl(h.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"),ng=Zl(h.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"),rg=Zl(h.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 Zi({onClick:e,disabled:t,theme:n}){const r=Ct(n);return h.jsx("button",{className:r.micButton,onClick:e,disabled:t,"aria-label":"Start Voice Session",type:"button",children:h.jsx(ng,{})})}function Ks({onClick:e,disabled:t,theme:n}){const r=Ct(n);return h.jsx("button",{className:r.chatButton,onClick:e,disabled:t,"aria-label":"Start Chat Session",type:"button",children:h.jsx(tg,{})})}function qs({onClick:e,disabled:t,theme:n}){const r=Ct(n);return h.jsx("button",{className:r.videoButton,onClick:e,disabled:t,"aria-label":"Start Video Session",type:"button",children:h.jsx(rg,{})})}function EM({prompts:e,theme:t}){const n=Ct(t),[r,i]=A.useState(0);return A.useEffect(()=>{const o=setInterval(()=>{i(s=>(s+1)%e.length)},3e3);return()=>clearInterval(o)},[e.length]),h.jsx("div",{className:"w-96 min-h-[3rem] h-12 relative overflow-hidden flex items-center justify-center",children:e.map((o,s)=>h.jsx("div",{className:`
156
156
  ${n.promptSlider}
157
157
  ${s===r?"opacity-100":"opacity-0"}
158
158
  whitespace-pre-line break-words
159
- `,style:{minHeight:"2.5rem",display:s===r?"block":"none"},children:o},s))})}function SM({statusMessage:e,theme:t}){const n=Ct(t);return h.jsxs("div",{className:"z-10 flex items-center space-x-2 mt-2 pb-2",children:[h.jsx("div",{className:n.statusIndicator}),h.jsx("span",{className:`text-xs ${n.text.muted}`,children:e})]})}const og=A.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:o="Agent is ready",title:s="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=Ct(l),f=c.includes("voice"),p=c.includes("chat"),g=c.includes("video"),m=[f,p,g].filter(Boolean).length;return h.jsxs("div",{className:"flex p-8 flex-col items-center h-full justify-center w-full relative","aria-disabled":e,style:{background:"transparent"},children:[h.jsxs("div",{className:"mt-1 relative flex items-center justify-center mb-8 w-full",style:{minHeight:"120px"},children:[h.jsxs("div",{className:"absolute inset-0 flex items-center justify-center",children:[h.jsx("div",{className:d.pulseRings.ring1}),h.jsx("div",{className:d.pulseRings.ring2,style:{animationDelay:"0.5s"}}),h.jsx("div",{className:d.pulseRings.ring3,style:{animationDelay:"1s"}})]}),h.jsx("div",{className:"relative z-10 flex items-center justify-center",children:f&&p&&g?h.jsxs("div",{className:"flex gap-4 items-center justify-center",children:[h.jsx(Zi,{onClick:t,disabled:e,theme:l}),h.jsx(Ks,{onClick:n,disabled:e,theme:l}),h.jsx(qs,{onClick:r||t,disabled:e,theme:l})]}):m>1?h.jsxs("div",{className:"flex gap-6 items-center justify-center",children:[f&&h.jsx(Zi,{onClick:t,disabled:e,theme:l}),p&&h.jsx(Ks,{onClick:n,disabled:e,theme:l}),g&&r&&h.jsx(qs,{onClick:r,disabled:e,theme:l})]}):h.jsx("div",{className:"flex items-center justify-center",children:f?h.jsx(Zi,{onClick:t,disabled:e,theme:l}):p?h.jsx(Ks,{onClick:n,disabled:e,theme:l}):g&&r?h.jsx(qs,{onClick:r,disabled:e,theme:l}):h.jsx(Zi,{onClick:t,disabled:e,theme:l})})})]}),h.jsxs("div",{className:"text-center flex flex-col items-center gap-y-2 mb-6 w-full",children:[h.jsx("h3",{className:`text-xl font-semibold mb-2 ${d.text.accent}`,children:s}),h.jsx("p",{className:`text-sm leading-relaxed px-4 ${d.text.secondary}`,children:a}),m>1&&h.jsxs("div",{className:"flex gap-6 mt-4 text-xs justify-center",children:[f&&h.jsxs("div",{className:"flex flex-col items-center gap-1",children:[h.jsx(rg,{className:"w-4 h-4"}),h.jsx("span",{className:d.text.muted,children:"Voice"})]}),p&&h.jsxs("div",{className:"flex flex-col items-center gap-1",children:[h.jsx(ng,{className:"w-4 h-4"}),h.jsx("span",{className:d.text.muted,children:"Chat"})]}),g&&h.jsxs("div",{className:"flex flex-col items-center gap-1",children:[h.jsx(ig,{className:"w-4 h-4"}),h.jsx("span",{className:d.text.muted,children:"Video"})]})]})]}),h.jsx(kM,{prompts:i,theme:l}),h.jsx(SM,{statusMessage:o,theme:l})]})});og.displayName="Welcome";class Xl extends P.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("VoxketWidget Error:",t,n)}render(){if(this.state.hasError){if(this.props.fallback){const t=this.props.fallback;return P.createElement(t,{error:this.state.error})}return P.createElement("div",{style:{padding:"20px",border:"1px solid #ff4444",borderRadius:"8px",background:"#fff5f5",color:"#cc0000"}},"VoxketWidget encountered an error. Please check the console for details.")}return this.props.children}}function sg({room:e,onSessionEnd:t,onSessionStart:n,enableConsoleLogging:r=!0,enableLocalStorage:i=!0,voxketSessionId:o}={}){const[s,a]=P.useState(null),[l,c]=P.useState([]),[u,d]=P.useState(null),[f,p]=P.useState([]),g=P.useCallback((k,v)=>{const _={timestamp:new Date,event:k,data:v,sessionId:s==null?void 0:s.sessionId,participantId:u==null?void 0:u.identity};if(c(S=>[...S,_]),i){const S=JSON.parse(localStorage.getItem("voxket-session-logs")||"[]");S.push(_),localStorage.setItem("voxket-session-logs",JSON.stringify(S))}return _},[s==null?void 0:s.sessionId,u==null?void 0:u.identity,r,i]);P.useEffect(()=>{if(!e)return;const k=()=>{const b=o||`session-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,R=new Date,O={sessionId:b,startTime:R,totalMessages:0,connectionIssues:0,participantCount:f.length,events:[]};a(O),g("SESSION_STARTED",{sessionId:b,startTime:R}),n==null||n(b)},v=()=>{if(s){const b=new Date,R=b.getTime()-s.startTime.getTime(),O={...s,endTime:b,duration:R,events:l};g("SESSION_ENDED",{sessionId:s.sessionId,duration:`${Math.round(R/1e3)}s`,totalMessages:s.totalMessages,connectionIssues:s.connectionIssues}),t==null||t(O),a(null),c([])}},_=b=>{g("CONNECTION_STATE_CHANGED",{state:b}),b===ce.ConnectionState.Reconnecting&&s&&(a(R=>R?{...R,connectionIssues:R.connectionIssues+1}:null),g("CONNECTION_ISSUE",{type:"reconnecting"}))},S=b=>{g("TRACK_PUBLISHED",{trackKind:b.kind,trackSource:b.source})},C=b=>{g("TRACK_UNPUBLISHED",{trackKind:b.kind,trackSource:b.source})},M=(b,R)=>{s&&a(O=>O?{...O,totalMessages:O.totalMessages+1}:null),g("DATA_RECEIVED",{participantId:R==null?void 0:R.identity,dataSize:b.length})},N=b=>{g("PARTICIPANT_CONNECTED",{participantId:b.identity,participantName:b.name}),p(R=>[...R,b]),s&&a(R=>R?{...R,participantCount:R.participantCount+1}:null)},I=b=>{g("PARTICIPANT_DISCONNECTED",{participantId:b.identity,participantName:b.name}),p(R=>R.filter(O=>O.identity!==b.identity))};return e.localParticipant&&d(e.localParticipant),e.on(ce.RoomEvent.Connected,k),e.on(ce.RoomEvent.Disconnected,v),e.on(ce.RoomEvent.ConnectionStateChanged,_),e.on(ce.RoomEvent.TrackPublished,S),e.on(ce.RoomEvent.TrackUnpublished,C),e.on(ce.RoomEvent.DataReceived,M),e.on(ce.RoomEvent.ParticipantConnected,N),e.on(ce.RoomEvent.ParticipantDisconnected,I),()=>{e.off(ce.RoomEvent.Connected,k),e.off(ce.RoomEvent.Disconnected,v),e.off(ce.RoomEvent.ConnectionStateChanged,_),e.off(ce.RoomEvent.TrackPublished,S),e.off(ce.RoomEvent.TrackUnpublished,C),e.off(ce.RoomEvent.DataReceived,M),e.off(ce.RoomEvent.ParticipantConnected,N),e.off(ce.RoomEvent.ParticipantDisconnected,I)}},[e,s,l,f.length,g,t,n]);const m=P.useCallback(()=>i?JSON.parse(localStorage.getItem("voxket-session-logs")||"[]"):l,[l,i]),x=P.useCallback(()=>{i&&localStorage.removeItem("voxket-session-logs"),c([])},[i]),y=P.useCallback(()=>{const k=m(),v=JSON.stringify(k,null,2),_="data:application/json;charset=utf-8,"+encodeURIComponent(v),S=`voxket-session-logs-${new Date().toISOString().split("T")[0]}.json`,C=document.createElement("a");C.setAttribute("href",_),C.setAttribute("download",S),C.click()},[m]);return{sessionMetrics:s,sessionLogs:l,logEvent:g,getSessionLogs:m,clearSessionLogs:x,exportSessionLogs:y}}class Ql{constructor(){at(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 o of i)try{o(...n)}catch(s){console.error(`Error in event listener for ${String(t)}:`,s)}}listenerCount(t){var n;return((n=this.listeners[t])==null?void 0:n.length)??0}eventNames(){return Object.keys(this.listeners)}}class ag{constructor(t){at(this,"plugins",new Map);at(this,"installedPlugins",new Set);at(this,"context");this.context={client:t,emit:t.emit.bind(t),on:t.on.bind(t),config:{}}}register(t){if(this.plugins.has(t.name))throw new Error(`Plugin '${t.name}' is already registered`);if(t.dependencies){for(const n of t.dependencies)if(!this.plugins.has(n))throw new Error(`Plugin '${t.name}' depends on '${n}' which is not registered`)}this.plugins.set(t.name,t)}async install(t,n){const r=this.plugins.get(t);if(!r)throw new Error(`Plugin '${t}' is not registered`);if(this.installedPlugins.has(t))throw new Error(`Plugin '${t}' is already installed`);if(r.dependencies)for(const o of r.dependencies)this.installedPlugins.has(o)||await this.install(o);const 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,o]of this.plugins)if(this.installedPlugins.has(i)&&((r=o.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 CM(e){return e}function Jl(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 _M={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)})}},TM={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))}},NM={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})})}},lg=A.createContext(null);function io({config:e,children:t,autoConnect:n=!1,client:r}){const[i,o]=A.useState(null),[s,a]=A.useState(!1),[l,c]=A.useState(!1),[u,d]=A.useState(null),[f,p]=A.useState(null),[g,m]=A.useState("idle"),[x,y]=A.useState(null),[k,v]=A.useState([]),[_,S]=A.useState([]),[C,M]=A.useState([]);A.useEffect(()=>{const W=r||new ki(e);o(W);const w=N(W);return n&&!r&&I(W),()=>{w(),r||W.disconnect().catch(console.error)}},[e,n,r]);const N=W=>{const w=()=>{c(!0),d(null)},F=()=>{a(!0),c(!1),d(null)},Y=()=>{a(!1),c(!1),p(null),m("idle"),v([]),S([]),M([])},E=Se=>{d(Se),c(!1)},B=Se=>{p(Se),m(Se.state)},z=Se=>{m(Se),f&&p({...f,state:Se})},K=(Se,Z)=>{p(null),m("idle"),y(Z),v([]),S([]),M([])},q=Se=>{v(Z=>[...Z,Se])},me=Se=>{v(Z=>Z.filter(te=>te.id!==Se.id))},Q=Se=>{S(Z=>[...Z,Se])},le=Se=>{S(Z=>[...Z,Se])},he=Se=>{console.log("📝 VoxketProvider: Received transcription:",Se),M(Z=>Z.find(ye=>ye.id===Se.id)?(console.log("📝 VoxketProvider: Duplicate transcription detected, skipping:",Se.id),Z):(console.log("📝 VoxketProvider: Adding new transcription:",Se.id),[...Z,Se]))},G=()=>{console.log("🧹 VoxketProvider: Clearing chat messages and transcriptions"),S([]),M([])};return W.on("connection.connecting",w),W.on("connection.connected",F),W.on("connection.disconnected",Y),W.on("connection.error",E),W.on("session.created",B),W.on("session.state.changed",z),W.on("session.ended",K),W.on("participant.joined",q),W.on("participant.left",me),W.on("chat.message.received",Q),W.on("chat.message.sent",le),W.on("transcription.received",he),W.on("chat.history.cleared",G),()=>{console.log("📝 VoxketProvider: Cleaning up event listeners"),W.off("connection.connecting",w),W.off("connection.connected",F),W.off("connection.disconnected",Y),W.off("connection.error",E),W.off("session.created",B),W.off("session.state.changed",z),W.off("session.ended",K),W.off("participant.joined",q),W.off("participant.left",me),W.off("chat.message.received",Q),W.off("chat.message.sent",le),W.off("chat.history.cleared",G),W.off("transcription.received",he)}},I=async W=>{const w=W||i;if(w)try{await w.connect()}catch(F){console.error("Failed to connect:",F)}},j={client:i,isConnected:s,isConnecting:l,connectionError:u,currentSession:f,sessionState:g,sessionMetrics:x,participants:k,chatMessages:_,transcriptions:C,connect:()=>I(),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 F={agentId:W,participantName:w.participantName||"User",metadata:w.metadata,modalities:w.modalities||["voice"]};return await i.createSession(F)},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 h.jsx(lg.Provider,{value:j,children:t})}function hn(){const e=A.useContext(lg);if(!e)throw new Error("useVoxket must be used within a VoxketProvider");return e}class AM extends Ql{constructor(n){super();at(this,"room",null);at(this,"registeredMethods",new Map);at(this,"activeInteractions",new Map);at(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 o={methodName:n,component:r,presentationMode:i};this.registeredMethods.set(n,o);try{this.room.registerRpcMethod(n,async s=>{console.log(`RpcManager: RPC method '${n}' called by ${s.callerIdentity}`),console.log("RpcManager: Payload:",s.payload),this.emit("rpc.method.called",{methodName:n,data:s});let a;console.log(`RpcManager: Current registration for '${n}':`,o);let l=s.responseTimeout||30;try{a=JSON.parse(s.payload)}catch{a=s.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(s){throw console.error(`RpcManager: Failed to register RPC method '${n}':`,s),s}}async awaitUserInteraction(n,r,i,o,s){return new Promise((a,l)=>{const c=`${n}_${Date.now()}`;console.log(`RpcManager: Starting user interaction for method: ${n}, timeout: ${s} seconds`);const u={didSuccess:(f,p)=>{console.log(`RpcManager: User interaction successful for method: ${n}`,f),this.clearInteraction(c),this.currentInteraction=null;const g={success:!0,message:"User interaction completed successfully",data:f,timestamp:new Date,...p?{successView:p}:{}};this.emit("rpc.interaction.completed",{methodName:n,response:g}),a(g)},didFail:f=>{console.log(`RpcManager: User interaction failed for method: ${n}`,f),this.clearInteraction(c);const p={success:!1,message:"User interaction failed",error:f,timestamp:new Date};this.emit("rpc.interaction.completed",{methodName:n,response:p}),a(p)},dismissView:()=>{var p;console.log(`RpcManager: User dismissed interaction for method: ${n}`),console.log("RpcManager: Current interaction before dismiss:",(p=this.currentInteraction)==null?void 0:p.methodName),this.clearInteraction(c),this.currentInteraction=null,console.log("RpcManager: Current interaction after dismiss:",this.currentInteraction);const f={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:f}),this.emit("rpc.interaction.completed",{methodName:n,response:f}),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(f)},didTimeout:f=>{console.log(`RpcManager: User interaction timeout for method: ${n}`),this.clearInteraction(c),this.currentInteraction=null;const p={success:!0,message:`User interaction timed out after ${s} seconds, it should be considered as declined, agent don't need to retry`,timestamp:new Date,...f?{timeoutView:f}:{}};this.emit("rpc.interaction.timeout",{methodName:n,response:p}),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(p)}},d=setTimeout(()=>{u.didTimeout&&u.didTimeout()},s);this.activeInteractions.set(c,{resolve:f=>a(JSON.parse(f)),reject:l,timeoutId:d}),this.currentInteraction={isVisible:!0,methodName:n,component:r,presentationMode:i,timeout:s,data:o,handler:u},this.emit("rpc.interaction.started",{methodName:n,presentationMode:i}),setTimeout(async()=>{var f;if((f=this.currentInteraction)!=null&&f.handler)try{console.log(`RpcManager: Component created for method: ${n} with data:`,o)}catch(p){console.error("RpcManager: Error loading data into component:",p),u.didFail({error:"Failed to load data into component"})}},100)})}clearInteraction(n){const r=this.activeInteractions.get(n);r&&(console.log(`RpcManager: Clearing interaction: ${n}`),clearTimeout(r.timeoutId),this.activeInteractions.delete(n))}getCurrentInteraction(){return this.currentInteraction}dismissCurrentInteraction(){var n;this.currentInteraction&&(console.log(`RpcManager: Dismissing current interaction: ${this.currentInteraction.methodName}`),(n=this.currentInteraction.handler)==null||n.dismissView(),setTimeout(()=>{this.currentInteraction&&(console.log("RpcManager: Force clearing lingering interaction"),this.currentInteraction=null)},0))}getRegisteredMethods(){return Array.from(this.registeredMethods.keys())}unregisterMethod(n){this.registeredMethods.delete(n),console.log(`RpcManager: Unregistered RPC method: ${n}`)}clear(){for(const[n,r]of this.activeInteractions)clearTimeout(r.timeoutId);this.activeInteractions.clear(),this.registeredMethods.clear(),this.currentInteraction=null,console.log("RpcManager: Cleared all registrations and interactions")}}class Ye extends Error{constructor(t,n,r){super(t),this.code=n,this.details=r,this.name="VoxketError"}}const Nn=new WeakSet,Ys=new WeakSet;class ki extends Ql{constructor(n){super();at(this,"config");at(this,"room",null);at(this,"pluginManager");at(this,"rpcManager");at(this,"isConnected",!1);at(this,"currentSession",null);at(this,"connectionState",ce.ConnectionState.Disconnected);at(this,"renderedComponents",new Map);at(this,"textStreamHandlersRegistered",!1);at(this,"currentAgentInfo",null);at(this,"chatMessages",[]);at(this,"activeTranscriptions",new Map);at(this,"isAgentConnected",!1);at(this,"agentState","idle");this.config=n,this.pluginManager=new ag(this),this.rpcManager=new AM,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,o;(o=(i=this.config).onSessionEnd)==null||o.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 ce.Room,this.setupRoomEventListeners()}setupRoomEventListeners(){this.room&&(this.room.on(ce.RoomEvent.Connected,()=>{var n,r;this.connectionState=ce.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(o){console.warn("VoxketClient: Failed to enable microphone after room connection:",o)}},1e3),this.textStreamHandlersRegistered||this.setupTextStreamHandlers()}),this.room.on(ce.RoomEvent.Disconnected,n=>{var r;console.log("🔴 VoxketClient: Room disconnected, reason:",n),this.connectionState=ce.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(ce.RoomEvent.ConnectionStateChanged,n=>{this.connectionState=n,n===ce.ConnectionState.Connecting&&this.emit("connection.connecting")}),this.room.on(ce.RoomEvent.ParticipantConnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.joined",r)}),this.room.on(ce.RoomEvent.ParticipantDisconnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.left",r)}),this.room.on(ce.RoomEvent.LocalTrackPublished,n=>{console.log("🎬 VoxketClient: Local track published:",n.source),n.source===ce.Track.Source.ScreenShare&&this.emit("track.unmuted",{source:"screenShare",enabled:!0})}),this.room.on(ce.RoomEvent.LocalTrackUnpublished,n=>{console.log("🎬 VoxketClient: Local track unpublished:",n.source),n.source===ce.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 o=await r.readAll(),s={id:`msg_${Date.now()}_${i.identity||"user"}_${Math.random().toString(36).substr(2,9)}`,content:o,timestamp:new Date,sender:{id:i.identity||"user",name:i.identity||"User",type:"participant"},metadata:{topic:"lk.chat"}};this.emit("chat.message.received",s)}catch(o){console.error("VoxketClient: Failed to process lk.chat message:",o)}})}catch(r){console.warn("VoxketClient: lk.chat handler already registered, skipping:",r)}try{console.log("📝 VoxketClient: Registering lk.transcription handler..."),this.room.registerTextStreamHandler("lk.transcription",async(r,i)=>{var o,s,a,l,c,u;console.log("📝 VoxketClient: Received transcription stream from:",i.identity);try{console.log("📝 VoxketClient: Processing transcription stream...");const d=i.identity===((s=(o=this.room)==null?void 0:o.localParticipant)==null?void 0:s.identity),f=Date.now(),p=i.identity,g=this.activeTranscriptions.get(p);let m,x=!0;g&&f-g.timestamp<1e3?(m=g.messageId,x=!1,console.log("📝 VoxketClient: Reusing existing transcription message ID:",m)):(m=`msg_${d?"user":"agent"}_${i.identity}_${f}`,this.activeTranscriptions.set(p,{messageId:m,timestamp:f}),console.log("📝 VoxketClient: Created new transcription message ID:",m));let y="";console.log("📝 VoxketClient: Current agent info:",this.currentAgentInfo);const k=((a=this.currentAgentInfo)==null?void 0:a.name)||i.identity||"AI Assistant";console.log("📝 VoxketClient: Using agent name:",k);const v=d?"participant":"agent",_=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:v,senderName:_});const S={id:m,content:"",timestamp:new Date,sender:{id:i.identity||"unknown",name:_,type:v},metadata:{topic:"lk.transcription",streaming:!0}};x&&this.emit("chat.message.received",S),console.log("📝 VoxketClient: Starting to read transcription stream...");for await(const I of r){console.log("📝 VoxketClient: Received chunk:",I.length,"chars"),y+=I;const b=this.convertMarkdownToText(y),R={...S,content:b,metadata:{...S.metadata,streaming:!0}};this.emit("chat.message.updated",R)}const C=this.convertMarkdownToText(y),M={...S,content:C,metadata:{...S.metadata,streaming:!1}};this.emit("chat.message.updated",M);const N={id:m,text:C,isFinal:!0,startTime:S.timestamp.getTime(),participantId:i.identity||"agent"};this.emit("transcription.received",N),console.log("📝 VoxketClient: Emitted transcription event:",N)}catch(d){console.error("VoxketClient: Failed to process lk.transcription message:",d);try{const f=await r.readAll(),p=((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:f,timestamp:new Date,sender:{id:i.identity||"agent",name:p,type:"agent"},metadata:{topic:"lk.transcription"}};this.emit("chat.message.received",g);const m={id:g.id,text:g.content,isFinal:!0,startTime:g.timestamp.getTime(),participantId:i.identity||"agent"};this.emit("transcription.received",m),console.log("📝 VoxketClient: Emitted fallback transcription event:",m)}catch(f){console.error("VoxketClient: Fallback failed for lk.transcription:",f)}}})}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 o=[];try{o=["tes","hello how are you","algebra make me learn that ","what is the meaning of life"]}catch(s){console.warn("VoxketClient: Failed to parse suggested_response:",s,i)}this.emit("suggested.response",o)})}catch(r){console.warn("VoxketClient: suggested_response handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("agent_state_changed",async(r,i)=>{const o=await r.readAll();console.log("🤖 VoxketClient: agent_state_changed stream received:",o);let s={};try{s=typeof o=="string"?JSON.parse(o.replace(/'/g,'"')):o}catch(a){console.warn("VoxketClient: Failed to parse agent_state_changed:",a,o)}this.isAgentConnected||(this.isAgentConnected=!0,console.log("🤖 VoxketClient: Agent marked as connected (first state change received)"),this.emit("agent.connected",s)),s.new_state==="speaking"?(this.setAgentState("speaking"),this.emit("agent.speaking",s)):s.new_state==="thinking"?(this.setAgentState("thinking"),this.emit("agent.thinking",s)):(s.new_state==="idle"||s.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 o=await r.readAll()}catch(o){console.error("VoxketClient: Error processing images stream:",o)}})}catch(r){console.warn("VoxketClient: images handler already registered, skipping:",r)}try{this.room.registerByteStreamHandler("images",async(r,i)=>{var o,s;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===((s=(o=this.room)==null?void 0:o.localParticipant)==null?void 0:s.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=p=>{const g={...l,metadata:{...l.metadata,downloadProgress:p||0}};this.emit("chat.message.updated",g)});const c=[];for await(const p of r)c.push(p);const u=new Blob(c,{type:a.mimeType||"application/octet-stream"}),d=URL.createObjectURL(u),f={...l,metadata:{...l.metadata,downloading:!1,downloadProgress:1,downloadUrl:d,blob:u}};this.emit("chat.message.updated",f)}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,o)=>{try{const s=await i.readAll();if(console.log(`📝 VoxketClient: Received '${r}' stream:`,s),r==="error"){let a={};try{a=typeof s=="string"?JSON.parse(s):s}catch{a={message:s}}console.warn("� VoxketClient: Agent error:",a),this.emit("agent.error",a)}else this.emit("text.stream.received",{topic:r,data:s,participantInfo:o})}catch(s){console.error(`VoxketClient: Failed to process '${r}' stream:`,s)}})}catch(i){console.warn(`VoxketClient: Handler for '${r}' already registered, skipping:`,i)}});try{this.room.registerTextStreamHandler("*",async(r,i)=>{var o;try{const s=await r.readAll(),a=((o=r.info)==null?void 0:o.topic)||"unknown";console.log(`📝 VoxketClient: Received unhandled text stream for topic '${a}':`,s),this.emit("text.stream.unhandled",{topic:a,data:s,participantInfo:i})}catch(s){console.error("VoxketClient: Failed to process unhandled text stream:",s)}})}catch(r){console.warn("VoxketClient: Generic text stream handler already registered, skipping:",r)}this.textStreamHandlersRegistered=!0}async fetchConnectionDetails(n,r,i){const o=n||this.config.agentId||"default-agent",s=r||this.config.participantName||"User",a=i||this.config.modalities||["voice"];try{const l={agent_id:o,participant_name:s,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 f=`HTTP ${c.status}: Failed to fetch connection details`;try{const p=await c.json();p&&(p.error?f=`API Error: ${p.error}`:p.detail?f=`API Error: ${p.detail}`:p.message&&(f=`API Error: ${p.message}`))}catch{try{const g=await c.text();g&&(f=`API Error: ${g}`)}catch{}}throw new Error(f)}const u=await c.json();let d;return u.agent_info&&(d={id:u.agent_info.agent_info.id,name:u.agent_info.agent_info.name,capabilities:u.agent_info.capabilities,modality_supported:u.agent_info.modality_supported,session_settings:u.agent_info.session_settings||{}},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 Ye(`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 o;try{this.emit("connection.connecting");const s=await this.fetchConnectionDetails(n,r,i);return await((o=this.room)==null?void 0:o.connect(s.serverUrl,s.participantToken)),this.isConnected=!0,s}catch(s){console.error("VoxketClient: Connection failed:",s);const a=new Ye(`Failed to connect to Voxket services: ${s instanceof Error?s.message:"Unknown error"}`,"CONNECTION_FAILED",s);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 ce.Room,this.setupRoomEventListeners(),console.log("✅ VoxketClient: Disconnect completed successfully"),this.emit("connection.disconnected")}catch(r){console.error("❌ VoxketClient: Disconnect failed:",r);const i=new Ye("Failed to disconnect properly","NETWORK_ERROR",r);throw this.emit("connection.error",i),i}}async createSession(n){var r,i,o,s;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((o=n.modalities)!=null&&o.includes("video"))try{await new Promise(c=>setTimeout(c,200)),(s=this.room)!=null&&s.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 Ye?a:a instanceof TypeError&&a.message.includes("fetch")?new Ye("Network connection failed","CONNECTION_FAILED",a):a instanceof Error&&a.message.includes("Failed to fetch connection details")?new Ye(`API connection failed: ${a.message}`,"CONNECTION_FAILED",a):new Ye(`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 Ye("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(ce.Track.Source.Microphone);if(i!=null&&i.track)return{source:ce.Track.Source.Microphone,participant:r,publication:i}}return null}getAgentVideoTrack(){const n=this.getRemoteParticipants();for(const r of n){const i=r.getTrackPublication(ce.Track.Source.Camera);if(i!=null&&i.track)return{source:ce.Track.Source.Camera,participant:r,publication:i}}return null}getVideoTrackRefs(){const n=[],r=this.getLocalParticipant();if(r){const o=r.getTrackPublication(ce.Track.Source.Camera);o!=null&&o.track&&n.push({source:ce.Track.Source.Camera,participant:r,publication:o});const s=r.getTrackPublication(ce.Track.Source.ScreenShare);s!=null&&s.track&&n.push({source:ce.Track.Source.ScreenShare,participant:r,publication:s})}const i=this.getRemoteParticipants();for(const o of i){const s=o.getTrackPublication(ce.Track.Source.Camera);s!=null&&s.track&&n.push({source:ce.Track.Source.Camera,participant:o,publication:s});const a=o.getTrackPublication(ce.Track.Source.ScreenShare);a!=null&&a.track&&n.push({source:ce.Track.Source.ScreenShare,participant:o,publication:a})}return n}getCameraTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===ce.Track.Source.Camera)}getScreenShareTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===ce.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 s,a,l,c,u,d,f,p,g;const r=this.resolveTarget(n.target||"body"),i=this.getTargetKey(r);if(Ys.has(r)){console.warn("⚠️ VoxketClient: Target is already being processed, skipping renderUI");return}if(Nn.has(r)){console.log("✋ VoxketClient: Target already has a React root in registry, updating existing props...");const m=this.renderedComponents.get(i);if(m&&m.root){const x={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:((s=n.modality)==null?void 0:s.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{m.root.render(A.createElement(io,{config:this.config,autoConnect:n.autoStart||!1,client:this,children:A.createElement(oo,x)})),console.log("✅ VoxketClient: Successfully updated existing widget with new props");return}catch(y){throw console.error("Error re-rendering existing widget:",y),new Error(`Failed to update existing widget: ${y instanceof Error?y.message:"Unknown error"}`)}}else console.warn("⚠️ Registry inconsistency detected, cleaning up"),Nn.delete(r)}let o=this.renderedComponents.get(i);if(o&&o.target===r&&Nn.has(r)){console.log("🔄 VoxketClient: Reusing existing React root for target:",i);const m=o.root,x={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{m.render(A.createElement(io,{config:this.config,autoConnect:n.autoStart||!1,client:this,children:A.createElement(oo,x)}))}catch(y){throw console.error("Error rendering Voxket widget:",y),new Error(`Failed to render Voxket widget: ${y instanceof Error?y.message:"Unknown error"}`)}return}Ys.add(r);try{if(o){console.log("🧹 VoxketClient: Cleaning up existing component for different target");try{o.root.unmount(),this.renderedComponents.delete(i),Nn.delete(o.target),r.innerHTML=""}catch(y){console.warn("Failed to cleanup existing root:",y)}}if(Nn.has(r)){console.warn("⚠️ VoxketClient: Target already in registry, skipping root creation");return}console.log("🆕 VoxketClient: Creating new React root for target:",i);const m=Wg.createRoot(r);this.renderedComponents.set(i,{root:m,target:r}),Nn.add(r);const x={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:((f=n.modality)==null?void 0:f.includes("chat"))!==!1,suportsVideoInput:((p=n.modality)==null?void 0:p.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(!m||typeof m.render!="function")throw new Error("Invalid React root. Make sure React 18+ is properly installed and configured.");try{m.render(A.createElement(io,{config:this.config,autoConnect:n.autoStart||!1,client:this,children:A.createElement(oo,x)}))}catch(y){throw console.error("Error rendering Voxket widget:",y),new Error(`Failed to render Voxket widget: ${y instanceof Error?y.message:"Unknown error"}`)}}finally{Ys.delete(r)}}removeUI(n){var i;const r=n?this.resolveTarget(n):null;if(r){const o=this.getTargetKey(r),s=this.renderedComponents.get(o);if(s){console.log("🗑️ VoxketClient: Removing UI for target:",o),this.renderedComponents.delete(o),Nn.delete(r);try{const l=s.target;l&&l.isConnected?(typeof((i=s.root)==null?void 0:i.unmount)=="function"&&(s.root.unmount(),console.log("✅ VoxketClient: UI unmounted for target:",o)),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:",o),Nn.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 Ye("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new Ye("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new Ye("No local participant","CONNECTION_FAILED");this.dismissCurrentInteraction();try{const o={id:`msg_${Date.now()}`,content:n,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:r||{}},s=await((i=this.room)==null?void 0:i.localParticipant.sendText(n,{topic:"lk.chat",destinationIdentities:[]}));this.emit("chat.message.sent",o)}catch(o){throw console.error("VoxketClient: Failed to send chat message:",o),new Ye("Failed to send message","NETWORK_ERROR",o)}}async sendChatMessage(n,r){return this.sendMessage(n,r)}async sendAttachments(n,r){if(!this.currentSession)throw console.error("VoxketClient: No active session found"),new Ye("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new Ye("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new Ye("No local participant","CONNECTION_FAILED");if(!n||n.length===0)throw new Ye("No files provided","INVALID_PARAMETER");this.dismissCurrentInteraction();const i=n.filter(o=>o.type.startsWith("image/"));if(i.length===0)throw new Ye("Only image files are allowed","INVALID_PARAMETER");i.length!==n.length&&console.warn("VoxketClient: Some non-image files were filtered out");try{const o=i.map(async(s,a)=>{const c={id:`att_${Date.now()}_${a}`,content:`📎 ${s.name}`,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:{...r,type:"attachment",fileName:s.name,fileSize:s.size,mimeType:s.type,uploading:!0}};this.emit("chat.message.sent",c);const u=await this.room.localParticipant.sendFile(s,{mimeType:s.type,topic:"images",onProgress:f=>{const p={...c,metadata:{...c.metadata,uploadProgress:f}};this.emit("chat.message.updated",p)}});try{const f=new FileReader,p=new Promise((x,y)=>{f.onload=()=>{typeof f.result=="string"?x(f.result):y(new Error("Failed to convert to base64"))},f.onerror=y});f.readAsDataURL(s);const m={type:"image",data:await p,filename:s.name,mimeType:s.type,size:s.size};await this.room.localParticipant.sendText(JSON.stringify(m),{topic:"images",destinationIdentities:[]})}catch(f){console.warn("VoxketClient: Failed to send image data to agent:",f);try{const p=`I've shared an image: ${s.name}`;await this.room.localParticipant.sendText(p,{topic:"lk.chat",destinationIdentities:[]})}catch(p){console.warn("VoxketClient: Failed to send image notification to agent:",p)}}const d={...c,metadata:{...c.metadata,uploading:!1,uploadProgress:1,streamId:u.id}};return this.emit("chat.message.updated",d),u});await Promise.all(o)}catch(o){throw console.error("VoxketClient: Failed to send attachments:",o),new Ye("Failed to send attachments","NETWORK_ERROR",o)}}async sendAttachment(n,r){return this.sendAttachments([n],r)}toggleMicrophone(n){return this.setMicrophoneEnabled(n!==!1)}async setMicrophoneEnabled(n){var r,i;try{const o=(r=this.room)==null?void 0:r.localParticipant.isMicrophoneEnabled,s=n??!o;await((i=this.room)==null?void 0:i.localParticipant.setMicrophoneEnabled(s)),s?this.emit("track.unmuted",{source:"microphone",enabled:!0}):this.emit("track.muted",{source:"microphone",enabled:!1})}catch(o){throw console.error("VoxketClient: Failed to toggle microphone:",o),new Ye("Failed to toggle microphone","PERMISSION_DENIED",o)}}toggleCamera(n){return this.setCameraEnabled(n!==!1)}async setCameraEnabled(n){var r,i;try{const o=(r=this.room)==null?void 0:r.localParticipant.isCameraEnabled,s=n??!o;await((i=this.room)==null?void 0:i.localParticipant.setCameraEnabled(s)),s?this.emit("track.unmuted",{source:"camera",enabled:!0}):this.emit("track.muted",{source:"camera",enabled:!1})}catch(o){throw console.error("VoxketClient: Failed to toggle camera:",o),new Ye("Failed to toggle camera","PERMISSION_DENIED",o)}}async enableCamera(){return this.setCameraEnabled(!0)}async disableCamera(){return this.setCameraEnabled(!1)}async startScreenShare(){var n;try{await((n=this.room)==null?void 0:n.localParticipant.setScreenShareEnabled(!0)),this.emit("track.unmuted",{source:"screenShare",enabled:!0})}catch(r){throw new Ye("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 Ye("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 Ye("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 Ye("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 Ye("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 Ye("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=o=>!!r.canPublish&&(r.canPublishSources.length===0||r.canPublishSources.includes(o));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===ce.ConnectionState.Connected}getMicrophoneTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===ce.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===ce.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===ce.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 Ye("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 Ye("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 o=await i.readAll();r(o)}catch(o){console.error(`Error processing event for topic '${n}':`,o)}})}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 RM=Ie.create(Bm),MM=Ie.create(Vl),IM=Ie.create(HN),OM=Ie.create(og);function PM({theme:e,mode:t,loadingText:n}){const r=Ct(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 h.jsxs("div",{className:"flex flex-col items-center justify-center h-full w-full p-8",children:[h.jsxs("div",{className:"text-center",children:[h.jsx("h3",{className:`text-lg font-semibold mb-2 ${r.text.accent}`,children:i()}),h.jsx("p",{className:`text-sm ${r.text.muted}`,children:"Please wait a moment..."})]}),h.jsxs("div",{className:"flex space-x-1 mt-4",children:[h.jsx("div",{className:"w-2 h-2 rounded-full animate-bounce bg-blue-500",style:{animationDelay:"0ms"}}),h.jsx("div",{className:"w-2 h-2 rounded-full animate-bounce bg-blue-500",style:{animationDelay:"150ms"}}),h.jsx("div",{className:"w-2 h-2 rounded-full animate-bounce bg-blue-500",style:{animationDelay:"300ms"}})]})]})}const DM=Ie.create(PM);function LM({onClick:e,text:t="Open Chat",position:n="bottom-right",theme:r}){const i={"top-left":{top:16,left:16},"top-right":{top:16,right:16},"bottom-left":{bottom:16,left:16},"bottom-right":{bottom:16,right:16}},o=Ct(r);return h.jsx(Ie.button,{onClick:e,className:`voxket-popup-trigger fixed z-[2147483647] px-4 py-2 rounded-full shadow-lg ${o.popupTrigger} transition-all duration-200 hover:scale-105`,style:{position:"fixed",...i[n]},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 bf({children:e,theme:t,displayType:n="widget",onClose:r,popupPosition:i="bottom-right",onExpand:o}){const s=Ct(t),a={"top-left":{top:16,left:16},"top-right":{top:16,right:16},"bottom-left":{bottom:16,left:16},"bottom-right":{bottom:16,right:16}};if(n==="fullscreen")return h.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:l=>{l.target===l.currentTarget&&r&&r()},children:h.jsxs("div",{className:"w-full h-full max-w-7xl max-h-[95vh] rounded-2xl relative bg-transparent flex flex-col",onClick:l=>{l.stopPropagation()},children:[r&&h.jsx("button",{onClick:l=>{l.preventDefault(),l.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:h.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:h.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"})})}),h.jsxs("div",{id:"voice-card",className:`voxket-widget-root theme-${t} ${s.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:[h.jsx("div",{className:s.cardTopGradient}),h.jsx("div",{className:s.cardPurpleBlur}),h.jsx("div",{className:s.cardPinkBlur}),h.jsx("div",{className:"relative z-10 flex flex-col h-full",children:e}),h.jsx("div",{className:s.cardPulse1}),h.jsx("div",{className:s.cardPulse2,style:{animationDelay:"1s"}})]})]})});if(n==="popup"){const l=h.jsx("div",{className:"voxket-popup-wrapper fixed inset-0 z-[2147483600] pointer-events-none",style:{width:"100vw",height:"100vh"},children:h.jsxs("div",{className:"fixed rounded-2xl pointer-events-auto",style:{...a[i],position:"fixed"},children:[r&&h.jsx("button",{onClick:r,className:"absolute -top-2 -right-2 z-[2147483646] w-8 h-8 rounded-full text-white flex items-center justify-center text-sm shadow-lg border border-gray-700",style:{background:"rgba(31,41,55,0.85)",backdropFilter:"blur(4px)",cursor:"pointer"},children:"×"}),h.jsxs("div",{id:"voice-card",className:`voxket-widget-root theme-${t} ${s.card} rounded-2xl flex flex-col relative overflow-hidden shadow-xl`,"data-theme":t,style:{width:"350px",height:"500px",contain:"layout style paint",overscrollBehavior:"contain",background:"var(--voxket-card-bg, linear-gradient(155deg,#1e2533,#0b0e13))"},children:[h.jsx("div",{className:s.cardTopGradient}),h.jsx("div",{className:s.cardPurpleBlur}),h.jsx("div",{className:s.cardPinkBlur}),h.jsx("div",{className:"relative z-10 flex flex-col h-full w-full",children:e}),h.jsx("div",{className:s.cardPulse1}),h.jsx("div",{className:s.cardPulse2,style:{animationDelay:"1s"}})]})]})});return yf.createPortal(l,typeof document<"u"?document.body:{})}return h.jsxs("div",{id:"voice-card",className:`voxket-widget-root theme-${t} ${s.card} relative overflow-hidden w-full h-full`,"data-theme":t,style:{height:"100%",maxHeight:"100%",contain:"layout style paint",overscrollBehavior:"contain",background:"var(--voxket-card-bg, linear-gradient(160deg,#1b2130,#0c0f15))"},children:[h.jsx("div",{className:s.cardTopGradient}),h.jsx("div",{className:s.cardPurpleBlur}),h.jsx("div",{className:s.cardPinkBlur}),h.jsx("div",{className:"relative z-10 flex flex-col h-full w-full",children:e}),h.jsx("div",{className:s.cardPulse1}),h.jsx("div",{className:s.cardPulse2,style:{animationDelay:"1s"}})]})}function FM(e){if(typeof window>"u")return null;const{agentId:t,participantName:n,baseUrl:r,appSecret:i,appId:o,prompts:s,statusMessage:a,welcomeTitle:l,welcomeSubTitle:c,className:u,width:d,height:f,loadingText:p,suportsChatInput:g=!0,suportsVideoInput:m=!0,suportsScreenShare:x=!0,theme:y="vox",onSessionStart:k,onSessionEnd:v,enableSessionLogging:_=!0,onSessionLogsUpdate:S,onSessionMetricsUpdate:C,modalities:M=["voice"],displayType:N="widget",popupPosition:I="bottom-right",popupTriggerText:b="Open Chat",onPopupToggle:R,voxketClient:O,onDisplayTypeChange:D}=e,[$,U]=P.useState(N),re=D?N:$,[ne,j]=P.useState(!1),[W,w]=P.useState(null),[F,Y]=P.useState(()=>{try{if(O)return!!O.getCurrentSession()}catch(oe){console.error("Error checking existing session:",oe)}return!1}),[E,B]=P.useState(!1),[z,K]=P.useState(t||""),[q,me]=P.useState(n||"User"),[Q,le]=P.useState(()=>{try{if(O)return O.getCurrentSession()}catch(oe){console.error("Error getting current session:",oe)}return null}),[he,G]=P.useState(()=>{var oe,tt,Fe;try{if(O){const Ge=O.getCurrentSession();if((oe=Ge==null?void 0:Ge.activeModalities)!=null&&oe.includes("chat"))return"chat";if((tt=Ge==null?void 0:Ge.activeModalities)!=null&&tt.includes("voice"))return"voice";if((Fe=Ge==null?void 0:Ge.activeModalities)!=null&&Fe.includes("video"))return"video"}}catch(Ge){console.error("Error determining current mode:",Ge)}return"welcome"}),[Se,Z]=P.useState(!1);P.useEffect(()=>{N==="fullscreen"&&console.log("🎯 Widget: Switched to fullscreen mode")},[N]),P.useEffect(()=>{F&&!E?console.log("📊 Session started:",{currentMode:he,sessionId:Q==null?void 0:Q.id}):!F&&!E&&he==="welcome"&&console.log("📊 Returned to welcome screen")},[F,he,E]);const te=P.useMemo(()=>{try{if(O)return console.log("🔄 Using existing VoxketClient to preserve session state"),O;if(!o||!i||!r){const tt=`Missing required props: ${o?"":"appId "}${i?"":"appSecret "}${r?"":"baseUrl"}`;return console.error("❌ VoxketClient creation failed:",tt),w(new Error(tt)),j(!0),null}const oe={appId:o,appSecret:i,baseUrl:r,agentId:z,participantName:q||"User",modalities:M};return console.log("🔧 Creating new VoxketClient with config:",{appId:o.substring(0,8)+"...",baseUrl:r,agentId:z,participantName:q||"User",modalities:M}),new ki(oe)}catch(oe){return console.error("❌ Failed to create VoxketClient:",oe),w(oe),j(!0),null}},[O,o,i,r,z,q,M]),ye=M,ae=P.useMemo(()=>{try{if(!te)return console.warn("⚠️ No VoxketClient available, creating fallback room"),new ce.Room;const oe=te.getRoom();return console.log("🏠 Widget: Room reference updated:",{roomExists:!!oe,roomState:oe==null?void 0:oe.state,sessionStarted:F,currentMode:he}),oe||new ce.Room}catch(oe){return console.error("❌ Error getting room from client:",oe),new ce.Room}},[te,F,he]);P.useEffect(()=>{if(ae){const oe=()=>{console.log("🏠 Widget: Room state changed:",{state:ae.state,numParticipants:ae.numParticipants,isConnected:ae.state==="connected",sessionId:Q==null?void 0:Q.id})},tt=(Fe,Ge,At)=>{console.log("🎵 Widget: Track subscribed:",{trackKind:Fe.kind,trackSource:Fe.source,participantSid:At.sid,participantIdentity:At.identity,sessionId:Q==null?void 0:Q.id})};return ae.on(ce.RoomEvent.Connected,oe),ae.on(ce.RoomEvent.Disconnected,oe),ae.on(ce.RoomEvent.TrackSubscribed,tt),()=>{ae.off(ce.RoomEvent.Connected,oe),ae.off(ce.RoomEvent.Disconnected,oe),ae.off(ce.RoomEvent.TrackSubscribed,tt)}}},[ae,Q==null?void 0:Q.id]),P.useEffect(()=>{!E&&he==="welcome"?console.log("🎬 Widget: Welcome screen ready"):F&&he!=="welcome"&&console.log("🎬 Widget: Session mode active:",he)},[he,E,F]),P.useEffect(()=>{(he==="voice"||he==="video"||he==="chat")&&!Q&&!F&&!E&&te&&!te.connected&&(console.log("🔄 Auto-correcting: Found orphaned mode without session, returning to welcome"),G("welcome"),B(!1))},[he,Q,F,E,te]);const{sessionMetrics:ve,sessionLogs:Ne,logEvent:_e}=sg({room:ae,onSessionStart:k,onSessionEnd:v,enableConsoleLogging:_,enableLocalStorage:_,voxketSessionId:Q==null?void 0:Q.id});P.useEffect(()=>{S&&S(Ne)},[Ne,S]),P.useEffect(()=>{C&&ve&&C(ve)},[ve,C]),P.useEffect(()=>{if(!te)return;const oe=()=>{const tt=te.connected,Fe=te.getCurrentSession();console.log("🔗 Connection state changed:",{isConnected:tt,currentSessionId:Fe==null?void 0:Fe.id,currentMode:he,loading:E,sessionStarted:F}),!tt&&F&&!E&&(console.log("🔴 Connection lost during active session - returning to welcome"),B(!1),Y(!1),le(null),G("welcome")),tt&&Fe&&E&&(console.log("🟢 Connected with active session - removing loader"),B(!1),Y(!0),le(Fe))};return te.on("connectionStateChanged",oe),te.on("sessionEnded",()=>{console.log("📞 Session ended - returning to welcome"),B(!1),Y(!1),le(null),G("welcome")}),()=>{te.off("connectionStateChanged",oe),te.off("sessionEnded",()=>{})}},[te,he,E,F]),P.useEffect(()=>{const oe=Fe=>{console.log("🔴 Widget: Room disconnected:",Fe),console.log("🔍 Widget: Current state on disconnect:",{currentMode:he,sessionStarted:F,currentSessionId:Q==null?void 0:Q.id,loading:E}),B(!1),Y(!1),le(null),G("welcome"),console.log("🏠 Widget: Automatically returning to welcome screen after disconnect")},tt=Fe=>{console.log("📹 Media devices error:",Fe)};return ae.on(ce.RoomEvent.MediaDevicesError,tt),ae.on(ce.RoomEvent.Disconnected,oe),()=>{ae.off(ce.RoomEvent.Disconnected,oe),ae.off(ce.RoomEvent.MediaDevicesError,tt)}},[ae,he,F,Q==null?void 0:Q.id,E]);const Ce=async()=>{try{if(!te){console.error("❌ VoxketClient not available"),w(new Error("VoxketClient not initialized")),j(!0);return}B(!0),G("voice"),console.log("🎤 Starting voice session...",{agentId:z,participantName:q}),console.log("🎤 Pre-start state:",{currentMode:"voice",sessionStarted:!1,loading:!0}),_e("USER_STARTED_VOICE_SESSION",{agentId:z,participantName:q});const oe=await te.startSession(z,{participantName:q||"User",modalities:["voice",...m?["video"]:[]]});console.log("✅ Voice session started successfully:",oe.id),le(oe),Y(!0),B(!1),k&&k(oe.id)}catch(oe){console.error("❌ Failed to start voice session:",oe),B(!1),Y(!1),G("welcome")}},bt=async()=>{try{if(!te){console.error("❌ VoxketClient not available"),w(new Error("VoxketClient not initialized")),j(!0);return}B(!0),G("chat"),console.log("💬 Starting chat session...",{agentId:z,participantName:q}),_e("USER_STARTED_CHAT_SESSION",{agentId:z,participantName:q});const oe=await te.startSession(z,{participantName:q||"User",modalities:["chat"]});console.log("✅ Chat session started successfully:",oe.id),le(oe),Y(!0),B(!1),k&&k(oe.id)}catch(oe){console.error("❌ Failed to start chat session:",oe),B(!1),Y(!1),G("welcome")}},vt=async()=>{try{if(!te){console.error("❌ VoxketClient not available"),w(new Error("VoxketClient not initialized")),j(!0);return}B(!0),G("video"),console.log("📺 Starting video session...",{agentId:z,participantName:q}),console.log("📺 Pre-start state:",{currentMode:"video",sessionStarted:!1,loading:!0}),_e("USER_STARTED_VIDEO_SESSION",{agentId:z,participantName:q});const oe=await te.startSession(z,{participantName:q||"User",modalities:["video","voice"]});console.log("✅ Video session started successfully:",oe.id),le(oe),Y(!0),B(!1),k&&k(oe.id)}catch(oe){console.error("❌ Failed to start video session:",oe),B(!1),Y(!1),G("welcome")}},je=()=>{console.log("🔄 Widget: handleBackToWelcome called",{currentMode:he,sessionStarted:F,currentSessionId:Q==null?void 0:Q.id,displayType:N,loading:E}),G("welcome"),B(!1),D&&D(e.displayType||"widget"),Q&&F?(console.log("🧹 Widget: Cleaning up active session"),Y(!1),le(null),te&&(console.log("🔌 Widget: Disconnecting client and cleaning up room"),te.disconnect().catch(oe=>{console.error("❌ Widget: Error during disconnect:",oe)}))):(console.log("📝 Widget: No active session to clean up"),te&&te.connected&&(console.log("🔌 Widget: Force disconnecting client for fresh state"),te.disconnect().catch(oe=>{console.error("❌ Widget: Error during force disconnect:",oe)}))),N==="popup"&&!Se&&Z(!0),console.log("✅ Widget: handleBackToWelcome completed",{newCurrentMode:"welcome",newLoading:!1,newSessionStarted:!1})},ut=()=>{const oe=!Se;Z(oe),R&&R(oe),!oe&&!(Q&&F)&&(G("welcome"),Y(!1),le(null))},L=()=>{console.log("🔄 Closing fullscreen, switching to widget display type"),e.onDisplayTypeChange?e.onDisplayTypeChange("widget"):U("widget")},J=()=>{console.log("🔄 Expand to fullscreen requested"),e.onDisplayTypeChange?e.onDisplayTypeChange("fullscreen"):U("fullscreen")};P.useEffect(()=>{var oe,tt,Fe;if(O&&te){const Ge=te.getCurrentSession();te.connected,Ge&&(console.log("✅ Restoring session state:",Ge.id),le(Ge),Y(!0),B(!1),(oe=Ge.activeModalities)!=null&&oe.includes("chat")?G("chat"):(tt=Ge.activeModalities)!=null&&tt.includes("voice")?G("voice"):(Fe=Ge.activeModalities)!=null&&Fe.includes("video")&&G("video"))}},[O,te]),P.useEffect(()=>()=>{!O&&te&&te.disconnect()},[te,O]);let we=he==="video"?"w-[32rem]":"w-96",Re=he==="video"?"h-[30rem]":"h-[25rem]",$e={};if(d&&(d.startsWith("w-")?we=d:($e.width=d,we="")),f&&(f.startsWith("h-")?Re=f:($e.height=f,Re="")),re==="popup"&&!Se){console.log("🟡 Showing popup trigger button");const oe=h.jsx(LM,{onClick:ut,text:b,position:I,theme:y});return yf.createPortal(oe,typeof document<"u"?document.body:{})}if(ne||!te){const oe=(W==null?void 0:W.message)||"VoxketWidget encountered an error. Please check your configuration.";return h.jsx("div",{className:`voxket-widget-root theme-${y} flex items-center justify-center p-8 ${u||""}`,style:{width:d||"400px",height:f||"500px",border:"1px solid #ff4444",borderRadius:"8px",background:"#fff5f5",color:"#cc0000"},children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"text-4xl mb-4",children:"⚠️"}),h.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Widget Error"}),h.jsx("p",{className:"text-sm mb-4",children:oe}),h.jsx("button",{onClick:()=>{j(!1),w(null),window.location.reload()},className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors",children:"Retry"})]})})}let _t=`voxket-widget-root theme-${y}`,Ft={scrollMargin:0,scrollPadding:0,contain:"layout style paint"};re==="widget"?(_t+=` flex min-h-fit ${we} ${Re} ${u}`,Ft={...Ft,...$e}):(_t=`${u||""}`,Ft={});const Bt=h.jsx("div",{className:"h-full w-full flex flex-col overflow-hidden relative z-10",children:h.jsxs(Sr,{mode:"wait",children:[he==="welcome"&&!E&&h.jsx(OM,{agentId:z,participantName:q||"",onAgentIdChange:K,onParticipantNameChange:me,onStartCall:Ce,onStartChat:bt,onStartVideo:vt,disabled:F||E,prompts:s,statusMessage:a,title:l,subTitle:c,theme:y,modalities:ye,initial:{opacity:0,y:0},animate:{opacity:1,y:0},exit:{opacity:0,y:40},transition:{duration:.3,ease:"easeInOut"}},"welcome"),E&&(he==="voice"||he==="chat"||he==="video")&&h.jsx(DM,{theme:y,mode:he,loadingText:p,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.3,ease:"easeInOut"}},`loading-${he}`),he==="voice"&&!E&&F&&te&&h.jsxs($t.RoomContext.Provider,{value:ae,children:[h.jsx($t.RoomAudioRenderer,{},`audio-${(Q==null?void 0:Q.id)||"no-session"}`),h.jsx($t.StartAudio,{label:"Start Audio"},`start-audio-${(Q==null?void 0:Q.id)||"no-session"}`),h.jsx(RM,{loadingText:p,participantName:q||"User",sessionStarted:F,disabled:!1,theme:y,client:te,displayType:N,onBack:N==="popup"?ut:je,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"voice-session")]}),he==="chat"&&!E&&F&&te&&h.jsx(MM,{client:te,theme:y,displayType:N,onBack:N==="popup"?ut:je,onEndChat:je,disabled:!1,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"chat-view"),he==="video"&&!E&&F&&te&&h.jsxs($t.RoomContext.Provider,{value:ae,children:[h.jsx($t.RoomAudioRenderer,{},`audio-video-${(Q==null?void 0:Q.id)||"no-session"}`),h.jsx($t.StartAudio,{label:"Start Audio"},`start-audio-video-${(Q==null?void 0:Q.id)||"no-session"}`),h.jsx(IM,{client:te,theme:y,displayType:N,onBack:N==="popup"?ut:je,onEndCall:je,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 re==="fullscreen"||re==="popup"?h.jsx(bf,{theme:y,displayType:re,popupPosition:I,onClose:re==="fullscreen"?L:ut,children:Bt}):h.jsx("div",{className:_t,style:Ft,children:h.jsx(bf,{theme:y,displayType:re,popupPosition:I,onExpand:J,children:Bt})})}function oo(e){return h.jsx(Xl,{children:h.jsx(FM,{...e})})}function BM({logs:e,onClear:t,onExport:n}){const[r,i]=A.useState(!1),[o,s]=A.useState(""),a=e.filter(l=>!o||l.event.toLowerCase().includes(o.toLowerCase()));return r?h.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:h.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-4xl w-full max-h-[80vh] flex flex-col m-4",children:[h.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[h.jsxs("h2",{className:"text-lg font-semibold",children:["Session Logs (",e.length,")"]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"text",placeholder:"Filter events...",value:o,onChange:l=>s(l.target.value),className:"px-3 py-1 border rounded text-sm"}),h.jsx("button",{onClick:t,className:"px-3 py-1 bg-red-600 text-white rounded text-sm hover:bg-red-700",children:"Clear"}),h.jsx("button",{onClick:n,className:"px-3 py-1 bg-green-600 text-white rounded text-sm hover:bg-green-700",children:"Export"}),h.jsx("button",{onClick:()=>i(!1),className:"px-3 py-1 bg-gray-600 text-white rounded text-sm hover:bg-gray-700",children:"Close"})]})]}),h.jsx("div",{className:"flex-1 overflow-auto p-4",children:a.length===0?h.jsx("p",{className:"text-gray-500 text-center py-8",children:"No logs found"}):h.jsx("div",{className:"space-y-2",children:a.map((l,c)=>h.jsxs("div",{className:"border rounded p-3 text-sm",children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("span",{className:"font-semibold text-blue-600",children:l.event}),h.jsx("span",{className:"text-gray-500 text-xs",children:new Date(l.timestamp).toLocaleTimeString()})]}),l.sessionId&&h.jsxs("div",{className:"text-xs text-gray-600 mb-1",children:["Session: ",l.sessionId]}),l.data&&h.jsx("div",{className:"bg-gray-50 p-2 rounded text-xs",children:h.jsx("pre",{className:"whitespace-pre-wrap overflow-auto",children:JSON.stringify(l.data,null,2)})})]},c))})})]})}):h.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 jM({metrics:e}){return e?h.jsxs("div",{className:"bg-gray-100 p-4 rounded-lg",children:[h.jsx("h3",{className:"font-semibold mb-2",children:"Current Session"}),h.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-600",children:"Session ID:"}),h.jsx("div",{className:"font-mono text-xs",children:e.sessionId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-600",children:"Start Time:"}),h.jsx("div",{children:new Date(e.startTime).toLocaleString()})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-600",children:"Messages:"}),h.jsx("div",{children:e.totalMessages})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-600",children:"Participants:"}),h.jsx("div",{children:e.participantCount})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-600",children:"Connection Issues:"}),h.jsx("div",{children:e.connectionIssues})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-600",children:"Duration:"}),h.jsxs("div",{children:[Math.round((Date.now()-new Date(e.startTime).getTime())/1e3),"s"]})]})]})]}):null}function er(){const{currentSession:e,sessionState:t,sessionMetrics:n,createSession:r,endSession:i}=hn(),o=A.useCallback(async(a,l)=>await r(a,l),[r]),s=A.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:o,stop:s}}function cg(){const{sessionMetrics:e,currentSession:t}=hn();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 ug(){const{setMicrophoneEnabled:e,client:t}=hn(),[n,r]=A.useState(!1),[i,o]=A.useState(!1),s=A.useCallback(async()=>{if(!i){o(!0);try{const c=!n;await e(c),r(c)}catch(c){console.error("Failed to toggle microphone:",c)}finally{o(!1)}}},[n,i,e]),a=A.useCallback(async()=>{if(!(n||i)){o(!0);try{await e(!0),r(!0)}catch(c){console.error("Failed to enable microphone:",c)}finally{o(!1)}}},[n,i,e]),l=A.useCallback(async()=>{if(!(!n||i)){o(!0);try{await e(!1),r(!1)}catch(c){console.error("Failed to disable microphone:",c)}finally{o(!1)}}},[n,i,e]);return{isEnabled:n,isLoading:i,toggle:s,enable:a,disable:l}}function dg(){const{setCameraEnabled:e}=hn(),[t,n]=A.useState(!1),[r,i]=A.useState(!1),o=A.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]),s=A.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=A.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:o,enable:s,disable:a}}function fg(){const{startScreenShare:e,stopScreenShare:t}=hn(),[n,r]=A.useState(!1),[i,o]=A.useState(!1),s=A.useCallback(async()=>{if(!(n||i)){o(!0);try{await e(),r(!0)}catch(c){console.error("Failed to start screen share:",c)}finally{o(!1)}}},[n,i,e]),a=A.useCallback(async()=>{if(!(!n||i)){o(!0);try{await t(),r(!1)}catch(c){console.error("Failed to stop screen share:",c)}finally{o(!1)}}},[n,i,t]),l=A.useCallback(async()=>{n?await a():await s()},[n,s,a]);return{isSharing:n,isLoading:i,start:s,stop:a,toggle:l}}function $M(){const{client:e}=hn(),[t,n]=A.useState({tracks:[],layout:{type:"grid",showLocalVideo:!0,aspectRatio:"16:9"},isRecording:!1}),r=A.useMemo(()=>t.tracks.find(m=>m.isLocal),[t.tracks]),i=A.useMemo(()=>t.tracks.filter(m=>!m.isLocal),[t.tracks]),o=A.useCallback(async()=>{try{r!=null&&r.isEnabled?await(e==null?void 0:e.disableCamera()):await(e==null?void 0:e.enableCamera())}catch(m){throw console.error("Failed to toggle camera:",m),m}},[e,r]),s=A.useCallback(async()=>{try{t.tracks.find(x=>x.isScreenShare)?await(e==null?void 0:e.stopScreenShare()):await(e==null?void 0:e.startScreenShare())}catch(m){throw console.error("Failed to toggle screen share:",m),m}},[e,t.tracks]),a=A.useCallback(m=>{n(x=>({...x,layout:m}))},[]),l=A.useCallback(m=>{n(x=>({...x,pinnedTrack:m}))},[]),c=A.useCallback(()=>{n(m=>({...m,pinnedTrack:void 0}))},[]),u=A.useCallback(async()=>{try{await(e==null?void 0:e.startRecording()),n(m=>({...m,isRecording:!0}))}catch(m){throw console.error("Failed to start recording:",m),m}},[e]),d=A.useCallback(async()=>{try{await(e==null?void 0:e.stopRecording()),n(m=>({...m,isRecording:!1}))}catch(m){throw console.error("Failed to stop recording:",m),m}},[e]),f=A.useCallback(m=>t.tracks.find(x=>x.id===m),[t.tracks]),p=A.useCallback(m=>t.tracks.filter(x=>x.participantId===m),[t.tracks]),g=A.useCallback(m=>m.isEnabled&&t.tracks.includes(m),[t.tracks]);return A.useEffect(()=>{if(!e)return;const m=k=>{n(v=>({...v,tracks:[...v.tracks.filter(_=>_.id!==k.id),k]}))},x=k=>{n(v=>{var _;return{...v,tracks:v.tracks.filter(S=>S.id!==k),pinnedTrack:((_=v.pinnedTrack)==null?void 0:_.id)===k?void 0:v.pinnedTrack}})},y=k=>{n(v=>({...v,tracks:v.tracks.map(_=>_.id===k.id?k:_)}))};return e.on("videoTrackAdded",m),e.on("videoTrackRemoved",x),e.on("videoTrackUpdated",y),()=>{e.off("videoTrackAdded",m),e.off("videoTrackRemoved",x),e.off("videoTrackUpdated",y)}},[e]),{tracks:t.tracks,localTrack:r,remoteTraracks:i,pinnedTrack:t.pinnedTrack,layout:t.layout,isRecording:t.isRecording,toggleCamera:o,toggleScreenShare:s,setLayout:a,pinTrack:l,unpinTrack:c,startRecording:u,stopRecording:d,getTrackById:f,getTracksByParticipant:p,isTrackActive:g}}function Ko(){const{chatMessages:e,sendChatMessage:t,currentSession:n}=hn(),[r,i]=A.useState(!1),o=A.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:s,agentMessages:a,allMessages:l}=A.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:s,agentMessages:a,messageCount:l.length,isSending:r,canSend:!!n&&!r,send:o}}function VM(){const{send:e,isSending:t,canSend:n}=Ko(),[r,i]=A.useState(""),o=A.useCallback(async()=>{if(!(!r.trim()||!n))try{await e(r),i("")}catch(a){throw a}},[r,e,n]),s=A.useCallback(a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),o())},[o]);return{value:r,setValue:i,send:o,handleKeyPress:s,isSending:t,canSend:n&&r.trim().length>0}}function ec(){const{isConnected:e,isConnecting:t,connectionError:n,connect:r,disconnect:i}=hn(),o=A.useCallback(async()=>{if(!(e||t))try{await r()}catch(a){throw console.error("Failed to connect:",a),a}},[r,e,t]),s=A.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:o,disconnect:s}}function hg(){const{participants:e}=hn();return{participants:e,count:e.length,localParticipant:e.find(t=>t.isLocal),remoteParticipants:e.filter(t=>!t.isLocal)}}const pg=A.createContext({}),Si=()=>A.useContext(pg);function mg({children:e,...t}){return h.jsx(pg.Provider,{value:t,children:e})}function so({name:e,children:t,fallback:n,className:r}){return h.jsx("div",{className:`voxket-slot voxket-slot--${e} ${r||""}`,children:t||n})}function gg(e,t={}){return Object.assign(e,t)}function bg({showMicrophoneControl:e=!0,showCameraControl:t=!0,showScreenShareControl:n=!0,showSessionActions:r=!0,customControls:i,className:o=""}){const s=er(),a=ug(),l=dg(),c=fg(),u=Si(),d=["voxket-session-controls",`voxket-session-controls--${u.variant||"default"}`,`voxket-session-controls--${u.size||"md"}`,s.isActive?"voxket-session-controls--active":"voxket-session-controls--inactive",o].filter(Boolean).join(" ");return!s.isActive&&!r?h.jsx("div",{className:d,children:h.jsx("div",{className:"voxket-controls-inactive",children:h.jsx("p",{children:"Controls available during active session"})})}):h.jsxs("div",{className:d,children:[r&&h.jsx("div",{className:"voxket-session-actions",children:s.isActive?h.jsx("button",{onClick:s.stop,className:"voxket-button voxket-button--danger",children:"End Session"}):h.jsx(zM,{})}),s.isActive&&h.jsxs("div",{className:"voxket-media-controls",children:[e&&h.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:[h.jsx("span",{className:"voxket-icon",children:"🎤"}),a.isLoading?"Loading...":a.isEnabled?"Mute":"Unmute"]}),t&&h.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:[h.jsx("span",{className:"voxket-icon",children:"📹"}),l.isLoading?"Loading...":l.isEnabled?"Stop Video":"Start Video"]}),n&&h.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:[h.jsx("span",{className:"voxket-icon",children:"🖥️"}),c.isLoading?"Loading...":c.isSharing?"Stop Share":"Share Screen"]})]}),i&&h.jsx("div",{className:"voxket-custom-controls",children:i})]})}function zM(){er();const[e,t]=A.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 h.jsx("button",{onClick:n,disabled:e,className:"voxket-button voxket-button--primary",children:e?"Starting...":"Start Session"})}function tc({showConnectionStatus:e=!0,showSessionInfo:t=!0,showAgentInfo:n=!0,className:r=""}){const i=er(),o=ec(),s=Si(),a=["voxket-session-header",`voxket-session-header--${s.variant||"default"}`,`voxket-session-header--${s.size||"md"}`,r].filter(Boolean).join(" ");return h.jsxs("div",{className:a,children:[e&&h.jsxs("div",{className:"voxket-connection-status",children:[h.jsx("div",{className:`voxket-status-indicator ${o.isConnected?"connected":"disconnected"}`}),h.jsx("span",{className:"voxket-status-text",children:o.isConnecting?"Connecting...":o.isConnected?"Connected":"Disconnected"})]}),t&&i.session&&h.jsxs("div",{className:"voxket-session-info",children:[h.jsxs("div",{className:"voxket-session-id",children:["Session: ",i.session.id.slice(-8)]}),h.jsxs("div",{className:"voxket-session-state",children:["State: ",i.state]})]}),n&&i.session&&h.jsxs("div",{className:"voxket-agent-info",children:[h.jsxs("div",{className:"voxket-agent-id",children:["Agent: ",i.session.agentId]}),h.jsxs("div",{className:"voxket-modalities",children:["Modalities: ",i.session.activeModalities.join(", ")]})]}),o.error&&h.jsxs("div",{className:"voxket-error-message",children:["Error: ",o.error.message]})]})}function nc({showChat:e=!0,showTranscriptions:t=!1,customContent:n,className:r=""}){const i=er(),o=Ko(),s=Si(),a=["voxket-session-content",`voxket-session-content--${s.variant||"default"}`,`voxket-session-content--${s.size||"md"}`,r].filter(Boolean).join(" ");return i.isActive?h.jsx("div",{className:a,children:n||h.jsxs(h.Fragment,{children:[e&&h.jsxs("div",{className:"voxket-chat-container",children:[h.jsxs("div",{className:"voxket-chat-messages",children:[o.messages.map(l=>h.jsxs("div",{className:`voxket-message voxket-message--${l.sender.type}`,children:[h.jsxs("div",{className:"voxket-message-header",children:[h.jsx("span",{className:"voxket-message-sender",children:l.sender.name}),h.jsx("span",{className:"voxket-message-time",children:l.timestamp.toLocaleTimeString()})]}),h.jsx("div",{className:"voxket-message-content",children:l.content})]},l.id)),o.messages.length===0&&h.jsx("div",{className:"voxket-empty-messages",children:h.jsx("p",{children:"No messages yet. Start the conversation!"})})]}),h.jsx(UM,{})]}),t&&h.jsx("div",{className:"voxket-transcriptions",children:h.jsx("div",{className:"voxket-transcription-placeholder",children:h.jsx("p",{children:"Voice transcriptions will appear here"})})})]})}):h.jsx("div",{className:a,children:h.jsx("div",{className:"voxket-inactive-state",children:h.jsxs("div",{className:"voxket-inactive-message",children:[h.jsx("h3",{children:"Start a conversation"}),h.jsx("p",{children:"Begin a session to start chatting with the AI agent"})]})})})}function UM(){const e=Ko(),[t,n]=A.useState(""),r=async()=>{if(!(!t.trim()||!e.canSend))try{await e.send(t),n("")}catch(o){console.error("Failed to send message:",o)}},i=o=>{o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),r())};return h.jsxs("div",{className:"voxket-chat-input",children:[h.jsx("input",{type:"text",value:t,onChange:o=>n(o.target.value),onKeyPress:i,placeholder:"Type your message...",disabled:!e.canSend,className:"voxket-input"}),h.jsx("button",{onClick:r,disabled:!e.canSend||!t.trim(),className:"voxket-send-button",children:e.isSending?"Sending...":"Send"})]})}function rc({showMetrics:e=!0,showParticipants:t=!0,showStatus:n=!0,customFooter:r,className:i=""}){const o=er(),s=cg(),a=hg(),l=Si(),c=["voxket-session-footer",`voxket-session-footer--${l.variant||"default"}`,`voxket-session-footer--${l.size||"md"}`,i].filter(Boolean).join(" ");return o.isActive?h.jsx("div",{className:c,children:r||h.jsxs(h.Fragment,{children:[n&&h.jsxs("div",{className:"voxket-session-status",children:[h.jsx("div",{className:"voxket-status-indicator voxket-status-indicator--active"}),h.jsx("span",{className:"voxket-status-text",children:"Session Active"})]}),e&&s.metrics&&h.jsxs("div",{className:"voxket-session-metrics",children:[h.jsxs("div",{className:"voxket-metric",children:[h.jsx("span",{className:"voxket-metric-label",children:"Duration:"}),h.jsx("span",{className:"voxket-metric-value",children:HM(s.duration||0)})]}),h.jsxs("div",{className:"voxket-metric",children:[h.jsx("span",{className:"voxket-metric-label",children:"Messages:"}),h.jsx("span",{className:"voxket-metric-value",children:s.metrics.messageCount})]})]}),t&&h.jsxs("div",{className:"voxket-participants-info",children:[h.jsxs("span",{className:"voxket-participants-count",children:[a.count," participant",a.count!==1?"s":""]}),a.remoteParticipants.length>0&&h.jsx("div",{className:"voxket-participant-list",children:a.remoteParticipants.map(u=>h.jsx("span",{className:"voxket-participant-name",children:u.name},u.id))})]})]})}):h.jsx("div",{className:c,children:h.jsx("div",{className:"voxket-footer-inactive",children:h.jsx("span",{className:"voxket-status-text",children:"Ready to start session"})})})}function HM(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 WM({agentId:e,sessionConfig:t,autoStart:n=!1,onSessionStart:r,onSessionEnd:i,variant:o="default",size:s="md",theme:a,className:l="",children:c}){var p;const u=er(),d=ec();A.useEffect(()=>{n&&e&&d.isConnected&&!u.isActive&&u.start(e,t).catch(console.error)},[n,e,d.isConnected,u.isActive]),A.useEffect(()=>{var g;(g=u.session)!=null&&g.id&&r&&r(u.session.id)},[(p=u.session)==null?void 0:p.id,r]),A.useEffect(()=>()=>{u.isActive&&i&&u.stop().then(i).catch(console.error)},[]);const f=["voxket-session",`voxket-session--${o}`,`voxket-session--${s}`,u.isActive?"voxket-session--active":"voxket-session--inactive",l].filter(Boolean).join(" ");return h.jsx(mg,{variant:o,size:s,theme:a,className:l,children:h.jsx("div",{className:f,children:c||h.jsxs(h.Fragment,{children:[h.jsx(so,{name:"header",fallback:h.jsx(tc,{})}),h.jsx(so,{name:"content",fallback:h.jsx(nc,{})}),h.jsx(so,{name:"footer",fallback:h.jsx(rc,{})})]})})})}const yg=gg(WM,{Header:tc,Content:nc,Footer:rc,Controls:bg}),Yn={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)"}},La={...Yn,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)"}},Fa={...Yn,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"}},xg=A.createContext(null),wg=()=>{const e=A.useContext(xg);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e};function GM({theme:e="default",themes:t={},children:n,cssVariables:r=!0,className:i=""}){const[o,s]=A.useState(()=>{const f={default:Yn,dark:La,enterprise:Fa,...t};return typeof e=="string"?f[e]||Yn:e}),[a,l]=A.useState(()=>({default:Yn,dark:La,enterprise:Fa,...t})),c=f=>{if(typeof f=="string"){const p=a[f];p&&s(p)}else s(f)},u=f=>{l(p=>({...p,[f.name]:f}))};A.useEffect(()=>{if(r&&typeof document<"u"){const f=document.documentElement;Object.entries(vg(o)).forEach(([p,g])=>{f.style.setProperty(`--voxket-${p}`,g)})}},[o,r]);const d={theme:o,setTheme:c,themes:a,registerTheme:u};return h.jsx(xg.Provider,{value:d,children:h.jsx("div",{className:`voxket-theme voxket-theme--${o.name} ${i}`,children:n})})}function vg(e){const t={},n=(r,i="")=>{for(const[o,s]of Object.entries(r)){const a=i?`${i}-${o}`:o;typeof s=="object"&&s!==null&&!Array.isArray(s)?n(s,a):t[a]=String(s)}};return n(e),t}function KM(e=Yn,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 qM(e){var n;const{theme:t}=wg();return((n=t.components)==null?void 0:n[e])||{}}const YM=Jl("voice-modality","voice",{onActivate:async e=>{const t=e.config;t.enableTranscription&&ZM(e),t.enableVoiceActivation&&XM(e,t),console.log("Voice modality activated",t)},onDeactivate:async e=>{console.log("Voice modality deactivated")},onMessage:async(e,t)=>{t.type==="audio"&&QM(e,t)}});function ZM(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 XM(e,t){const n=t.silenceThreshold||-50;console.log("Voice activation setup with threshold:",n)}function QM(e,t){console.log("Playing audio response:",t.content)}const JM=Jl("chat-modality","chat",{onActivate:async e=>{const t=e.config;t.enableRichText&&eI(),t.enableFileUpload&&tI(e),t.enableCustomComponents&&nI(),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"?rI(e,t):t.type==="text"&&n.enableRichText&&iI(e,t)}});function eI(e){console.log("Rich text support enabled")}function tI(e){console.log("File upload enabled"),e.on("chat.file.uploaded",t=>{console.log("File uploaded:",t.name)})}function nI(e){console.log("Custom components enabled");const t=new Map;t.set("quick-actions",oI),t.set("form",sI),t.set("card",aI),t.set("chart",lI)}function rI(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 iI(e,t){console.log("Processing rich text message:",t.content)}function oI(e){return{type:"quick-actions",actions:e.actions||[],layout:e.layout||"horizontal"}}function sI(e){return{type:"form",fields:e.fields||[],submitAction:e.submitAction,validation:e.validation}}function aI(e){return{type:"card",title:e.title,content:e.content,actions:e.actions,variant:e.variant||"default"}}function lI(e){return{type:"chart",chartType:e.chartType||"line",data:e.data,options:e.options}}function ao({track:e,participantName:t,showControls:n=!0,showName:r=!0,showMuteIndicator:i=!0,isPinned:o=!1,className:s="",onClick:a,onPin:l,onUnpin:c}){const u=A.useRef(null),[d,f]=A.useState(!1);A.useEffect(()=>{if(!u.current||!e.isEnabled)return;const x=u.current;return x.srcObject=null,()=>{x.srcObject&&(x.srcObject=null)}},[e]);const p=()=>{a==null||a(e)},g=x=>{x.stopPropagation(),o?c==null||c(e):l==null||l(e)},m=["voxket-video-tile",e.isLocal?"voxket-video-tile--local":"voxket-video-tile--remote",e.isScreenShare?"voxket-video-tile--screen-share":"voxket-video-tile--camera",o?"voxket-video-tile--pinned":"",e.isEnabled?"":"voxket-video-tile--disabled",d?"voxket-video-tile--hovered":"",s].filter(Boolean).join(" ");return h.jsxs("div",{className:m,onClick:p,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),style:{aspectRatio:e.dimensions?`${e.dimensions.width} / ${e.dimensions.height}`:"16 / 9"},children:[h.jsx("video",{ref:u,className:"voxket-video-element",autoPlay:!0,playsInline:!0,muted:e.isLocal}),!e.isEnabled&&h.jsxs("div",{className:"voxket-video-placeholder",children:[h.jsx("div",{className:"voxket-video-placeholder-icon",children:e.isScreenShare?"🖥️":"📹"}),h.jsx("p",{className:"voxket-video-placeholder-text",children:e.isScreenShare?"Screen sharing paused":"Camera off"})]}),h.jsxs("div",{className:"voxket-video-overlay",children:[r&&t&&h.jsxs("div",{className:"voxket-video-name",children:[t,e.isLocal&&" (You)"]}),i&&!e.isEnabled&&h.jsx("div",{className:"voxket-video-mute-indicator",children:"🔇"}),n&&(d||o)&&h.jsxs("div",{className:"voxket-video-controls",children:[h.jsx("button",{className:`voxket-video-control-btn ${o?"voxket-video-control-btn--active":""}`,onClick:g,title:o?"Unpin video":"Pin video",children:"📌"}),e.isScreenShare&&h.jsx("div",{className:"voxket-video-indicator",children:"🖥️"}),e.source&&h.jsx("div",{className:"voxket-video-source",children:e.source})]})]}),!e.isEnabled&&h.jsx("div",{className:"voxket-video-loading",children:h.jsx("div",{className:"voxket-spinner"})})]})}function cI({tracks:e,layout:t,className:n="",onLayoutChange:r,onTrackClick:i,maxVisibleTracks:o=9,showPagination:s=!0}){const[a,l]=A.useState(0),[c,u]=A.useState(null),d=A.useMemo(()=>{let k=[...e];t.type==="speaker"&&c&&(k=[c,...e.filter(S=>S.id!==c.id)]);const v=a*o,_=v+o;return k.slice(v,_)},[e,t,c,a,o]),f=Math.ceil(e.length/o),p=A.useMemo(()=>{const k=d.length;switch(t.type){case"grid":const v=Math.ceil(Math.sqrt(k)),_=Math.ceil(k/v);return{display:"grid",gridTemplateColumns:`repeat(${v}, 1fr)`,gridTemplateRows:`repeat(${_}, 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)},m=()=>{u(null)},x=k=>{r==null||r({...t,type:k})},y=["voxket-video-grid",`voxket-video-grid--${t.type}`,`voxket-video-grid--${d.length}-tracks`,n].filter(Boolean).join(" ");return e.length===0?h.jsx("div",{className:"voxket-video-grid-empty",children:h.jsxs("div",{className:"voxket-video-grid-empty-content",children:[h.jsx("div",{className:"voxket-video-grid-empty-icon",children:"📹"}),h.jsx("p",{children:"No video tracks available"})]})}):h.jsxs("div",{className:y,children:[h.jsxs("div",{className:"voxket-video-grid-controls",children:[h.jsx("div",{className:"voxket-video-layout-controls",children:["grid","speaker","sidebar","gallery"].map(k=>h.jsx("button",{className:`voxket-layout-btn ${t.type===k?"voxket-layout-btn--active":""}`,onClick:()=>x(k),title:`Switch to ${k} layout`,children:uI(k)},k))}),h.jsxs("div",{className:"voxket-video-count",children:[e.length," participant",e.length!==1?"s":""]})]}),h.jsx("div",{className:"voxket-video-grid-content",style:p,children:t.type==="speaker"&&c?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"voxket-video-speaker-main",children:h.jsx(ao,{track:c,participantName:`Participant ${c.participantId}`,isPinned:!0,onClick:i,onUnpin:m})}),h.jsx("div",{className:"voxket-video-speaker-sidebar",children:d.filter(k=>k.id!==c.id).map(k=>h.jsx(ao,{track:k,participantName:`Participant ${k.participantId}`,showControls:!1,onClick:i,onPin:g},k.id))})]}):d.map(k=>h.jsx(ao,{track:k,participantName:`Participant ${k.participantId}`,isPinned:(c==null?void 0:c.id)===k.id,onClick:i,onPin:g,onUnpin:m},k.id))}),s&&f>1&&h.jsxs("div",{className:"voxket-video-pagination",children:[h.jsx("button",{className:"voxket-pagination-btn",onClick:()=>l(Math.max(0,a-1)),disabled:a===0,children:"←"}),h.jsxs("span",{className:"voxket-pagination-info",children:["Page ",a+1," of ",f]}),h.jsx("button",{className:"voxket-pagination-btn",onClick:()=>l(Math.min(f-1,a+1)),disabled:a===f-1,children:"→"})]})]})}function uI(e){switch(e){case"grid":return"⊞";case"speaker":return"🎤";case"sidebar":return"⫸";case"gallery":return"⊡";case"picture-in-picture":return"⧉";default:return"⊞"}}function dI({localTrack:e,onToggleCamera:t,onToggleScreenShare:n,onLayoutChange:r,showLayoutControls:i=!0,showCameraControls:o=!0,showScreenShareControls:s=!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 h.jsxs("div",{className:l,children:[o&&h.jsxs("div",{className:"voxket-video-controls-section",children:[h.jsx("h4",{className:"voxket-video-controls-title",children:"Camera"}),h.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:[h.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isEnabled?"📹":"📷"}),h.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isEnabled?"Camera On":"Camera Off"})]}),(e==null?void 0:e.dimensions)&&h.jsxs("div",{className:"voxket-video-info",children:[e.dimensions.width," × ",e.dimensions.height]})]}),s&&h.jsxs("div",{className:"voxket-video-controls-section",children:[h.jsx("h4",{className:"voxket-video-controls-title",children:"Screen Share"}),h.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:[h.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isScreenShare?"🛑":"🖥️"}),h.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isScreenShare?"Stop Sharing":"Share Screen"})]})]}),i&&h.jsxs("div",{className:"voxket-video-controls-section",children:[h.jsx("h4",{className:"voxket-video-controls-title",children:"Layout"}),h.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:f})=>h.jsxs("button",{className:"voxket-layout-control-btn",onClick:()=>c(u),title:`Switch to ${f} layout`,children:[h.jsx("span",{className:"voxket-control-icon",children:d}),h.jsx("span",{className:"voxket-control-label",children:f})]},u))})]}),h.jsxs("div",{className:"voxket-video-controls-section",children:[h.jsx("h4",{className:"voxket-video-controls-title",children:"Video Settings"}),h.jsxs("div",{className:"voxket-video-settings",children:[h.jsxs("div",{className:"voxket-setting-group",children:[h.jsx("label",{className:"voxket-setting-label",children:"Quality"}),h.jsxs("select",{className:"voxket-setting-select",children:[h.jsx("option",{value:"high",children:"High (720p)"}),h.jsx("option",{value:"medium",children:"Medium (480p)"}),h.jsx("option",{value:"low",children:"Low (240p)"})]})]}),h.jsxs("div",{className:"voxket-setting-group",children:[h.jsx("label",{className:"voxket-setting-label",children:"Frame Rate"}),h.jsxs("select",{className:"voxket-setting-select",children:[h.jsx("option",{value:"30",children:"30 fps"}),h.jsx("option",{value:"15",children:"15 fps"}),h.jsx("option",{value:"10",children:"10 fps"})]})]}),h.jsxs("div",{className:"voxket-setting-group",children:[h.jsx("label",{className:"voxket-setting-label",children:"Bandwidth"}),h.jsxs("select",{className:"voxket-setting-select",children:[h.jsx("option",{value:"unlimited",children:"Unlimited"}),h.jsx("option",{value:"1000",children:"1 Mbps"}),h.jsx("option",{value:"500",children:"500 Kbps"}),h.jsx("option",{value:"250",children:"250 Kbps"})]})]})]})]}),h.jsxs("div",{className:"voxket-video-controls-section",children:[h.jsx("h4",{className:"voxket-video-controls-title",children:"Statistics"}),h.jsxs("div",{className:"voxket-video-stats",children:[h.jsxs("div",{className:"voxket-stat-item",children:[h.jsx("span",{className:"voxket-stat-label",children:"Resolution:"}),h.jsx("span",{className:"voxket-stat-value",children:e!=null&&e.dimensions?`${e.dimensions.width}×${e.dimensions.height}`:"N/A"})]}),h.jsxs("div",{className:"voxket-stat-item",children:[h.jsx("span",{className:"voxket-stat-label",children:"Source:"}),h.jsx("span",{className:"voxket-stat-value",children:(e==null?void 0:e.source)||"None"})]}),h.jsxs("div",{className:"voxket-stat-item",children:[h.jsx("span",{className:"voxket-stat-label",children:"Status:"}),h.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 Eg=({handler:e,loadData:t,data:n,client:r,addLocalMessage:i})=>{const[o,s]=P.useState(null),[a,l]=P.useState(!0),[c,u]=P.useState(!1),[d]=P.useState(Date.now());P.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 x={title:n.title||"Untitled Assignment",description:n.description||"No description provided",estimated_time_of_completion:n.estimated_time_of_completion||"Unknown"};s(x),console.log("📋 AssignmentView: Assignment loaded from RPC data:",x)}}catch(x){console.error("📋 AssignmentView: Error loading assignment:",x),s({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 f=({message:m,assignment:x})=>{const y=m.toLowerCase().includes("declined"),k=y?"bg-red-50 border-red-200":"bg-green-50 border-green-200",v=y?"text-red-700":"text-green-700",_=y?"❌":"🎉";return h.jsxs("div",{className:`max-w-sm mx-auto ${k} border rounded-lg shadow p-3 flex flex-col items-center`,children:[h.jsx("div",{className:"text-2xl mb-2",children:_}),h.jsx("div",{className:`${v} font-semibold text-sm mb-1`,children:m}),h.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:x.title}),h.jsx("div",{className:"text-xs text-gray-500",children:"Thank you for your response!"})]})},p=async()=>{if(!(!o||!e)){u(!0);try{const m={message:"accepted"};console.log("📋 AssignmentView: Assignment accepted:",m),e.didSuccess(m,h.jsx(f,{message:"Assignment accepted!",assignment:o}))}catch(m){console.error("📋 AssignmentView: Error accepting assignment:",m),e.didFail({error:"Failed to accept assignment"})}finally{u(!1)}}},g=async()=>{if(!(!o||!e)){u(!0);try{const m={message:"declined"};console.log("📋 AssignmentView: Assignment declined:",m),e.didSuccess(m,h.jsx(f,{message:"Assignment declined",assignment:o}))}catch(m){console.error("📋 AssignmentView: Error declining assignment:",m),e.didFail({error:"Failed to decline assignment"})}finally{u(!1)}}};return a?h.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:h.jsxs("div",{className:"flex items-center justify-center py-4",children:[h.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),h.jsx("span",{className:"ml-2 text-xs text-gray-600",children:"Loading assignment..."})]})}):o?h.jsxs("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg overflow-hidden",children:[h.jsx("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 text-white p-3",children:h.jsx("div",{className:"flex items-center justify-between",children:h.jsx("h3",{className:"text-xs font-semibold text-white truncate",children:o.title})})}),h.jsxs("div",{className:"p-3 text-black",children:[h.jsx("div",{className:"bg-gray-50 rounded p-2 mb-3",children:h.jsx("p",{className:"text-xs text-black leading-snug",children:o.description})}),h.jsx("div",{className:"mb-3 text-black",children:h.jsxs("div",{className:"flex items-center text-xs text-gray-600",children:[h.jsx("span",{className:"text-xs mr-1",children:"📅"}),h.jsxs("span",{children:["Est: ",o.estimated_time_of_completion]})]})}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{onClick:p,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?h.jsxs("span",{className:"flex items-center justify-center",children:[h.jsx("div",{className:"animate-spin rounded-full h-2 w-2 border-b-2 border-white mr-1"}),h.jsx("span",{className:"text-xs",children:"Processing..."})]}):"Accept"}),h.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"})]})]})]}):h.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:h.jsxs("div",{className:"text-center py-4",children:[h.jsx("div",{className:"text-red-600 text-sm font-semibold mb-2",children:"⚠️ Assignment Error"}),h.jsx("p",{className:"text-xs text-gray-600 mb-3",children:"Failed to load assignment details."})]})})};function fI(){const[e,t]=P.useState(null),[n,r]=P.useState([]);P.useEffect(()=>{const a=new ki({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",Eg,"embedded");const a=e.getRegisteredRpcMethods();r(a),console.log("✅ Assignment RPC registered successfully")}catch(a){console.error("❌ Failed to register assignment RPC:",a)}},o=async()=>{if(!e)return;const a=({handler:l,timeout:c})=>{const[u,d]=P.useState(""),f=[{id:"pro",name:"Pro Plan",price:"$29/month"},{id:"enterprise",name:"Enterprise Plan",price:"$99/month"},{id:"basic",name:"Basic Plan",price:"$9/month"}],p=m=>{d(m)},g=()=>{const m=f.find(x=>x.id===u);l==null||l.didSuccess({selectedProduct:u,productName:m==null?void 0:m.name,price:m==null?void 0:m.price,timestamp:new Date().toISOString()})};return h.jsxs("div",{className:"p-6 bg-white rounded-lg",children:[h.jsx("h3",{className:"text-xl font-bold mb-4",children:"Choose Your Plan"}),h.jsx("p",{className:"text-gray-600 mb-4",children:"Select the plan that best fits your needs:"}),h.jsx("div",{className:"space-y-3 mb-6",children:f.map(m=>h.jsx("div",{onClick:()=>p(m.id),className:`p-4 border rounded-lg cursor-pointer transition-all ${u===m.id?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-gray-300"}`,children:h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsxs("div",{children:[h.jsx("h4",{className:"font-medium",children:m.name}),h.jsx("p",{className:"text-gray-600 text-sm",children:m.price})]}),h.jsx("div",{className:`w-4 h-4 rounded-full ${u===m.id?"bg-blue-500":"border-2 border-gray-300"}`})]})},m.id))}),h.jsxs("div",{className:"flex justify-end space-x-3",children:[h.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"}),h.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&&h.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)}},s=async()=>{if(!e)return;const a=({handler:l})=>{const[c,u]=P.useState(0),[d,f]=P.useState(""),p=()=>{l==null||l.didSuccess({rating:c,comment:d,timestamp:new Date().toISOString()})};return h.jsxs("div",{className:"p-4 bg-white rounded-lg",children:[h.jsx("h3",{className:"text-lg font-semibold mb-3",children:"How was your experience?"}),h.jsxs("div",{className:"mb-4",children:[h.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Rate your experience:"}),h.jsx("div",{className:"flex space-x-1",children:[1,2,3,4,5].map(g=>h.jsx("button",{onClick:()=>u(g),className:`text-2xl ${g<=c?"text-yellow-400":"text-gray-300"}`,children:"⭐"},g))})]}),h.jsxs("div",{className:"mb-4",children:[h.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Additional comments:"}),h.jsx("textarea",{value:d,onChange:g=>f(g.target.value),className:"w-full p-2 border border-gray-300 rounded text-sm",rows:3,placeholder:"Tell us more about your experience..."})]}),h.jsxs("div",{className:"flex justify-end space-x-2",children:[h.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"}),h.jsx("button",{onClick:p,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 h.jsxs("div",{className:"p-6",children:[h.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Frontend RPC Examples"}),h.jsxs("div",{className:"space-y-4 mb-6",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Register RPC Methods"}),h.jsxs("div",{className:"space-x-2",children:[h.jsx("button",{onClick:i,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Register Assignment RPC"}),h.jsx("button",{onClick:o,className:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600",children:"Register Product Recommendation RPC"}),h.jsx("button",{onClick:s,className:"px-4 py-2 bg-purple-500 text-white rounded hover:bg-purple-600",children:"Register Feedback RPC"})]})]}),h.jsxs("div",{children:[h.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Registered Methods"}),n.length>0?h.jsx("ul",{className:"list-disc list-inside space-y-1",children:n.map(a=>h.jsx("li",{className:"text-gray-700",children:h.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:a})},a))}):h.jsx("p",{className:"text-gray-500",children:"No methods registered yet"})]})]}),h.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[h.jsx("h3",{className:"text-lg font-semibold mb-2",children:"How it works"}),h.jsxs("ol",{className:"list-decimal list-inside space-y-2 text-sm text-gray-700",children:[h.jsxs("li",{children:["Register RPC methods with React components using ",h.jsx("code",{children:"client.registerFrontendRPC()"})]}),h.jsx("li",{children:"When the agent calls an RPC method, the corresponding component will be displayed"}),h.jsx("li",{children:"Users interact with the component, and the response is sent back to the agent"}),h.jsx("li",{children:"Components can be displayed in different modes: embedded, modal, or fullscreen"}),h.jsx("li",{children:"Each component has a timeout and can handle success/failure scenarios"})]})]}),h.jsxs("div",{className:"mt-6 bg-blue-50 p-4 rounded-lg",children:[h.jsx("h3",{className:"text-lg font-semibold mb-2 text-blue-800",children:"Agent Side"}),h.jsx("p",{className:"text-sm text-blue-700 mb-2",children:"On the agent side, you can call these RPC methods like this:"}),h.jsx("pre",{className:"bg-white p-3 rounded text-xs text-gray-800 overflow-x-auto",children:`// Agent calls RPC method
159
+ `,style:{minHeight:"2.5rem",display:s===r?"block":"none"},children:o},s))})}function kM({statusMessage:e,theme:t}){const n=Ct(t);return h.jsxs("div",{className:"z-10 flex items-center space-x-2 mt-2 pb-2",children:[h.jsx("div",{className:n.statusIndicator}),h.jsx("span",{className:`text-xs ${n.text.muted}`,children:e})]})}const ig=A.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:o="Agent is ready",title:s="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=Ct(l),f=c.includes("voice"),p=c.includes("chat"),g=c.includes("video"),m=[f,p,g].filter(Boolean).length;return h.jsxs("div",{className:"flex p-8 flex-col items-center h-full justify-center w-full relative","aria-disabled":e,style:{background:"transparent"},children:[h.jsxs("div",{className:"mt-1 relative flex items-center justify-center mb-8 w-full",style:{minHeight:"120px"},children:[h.jsxs("div",{className:"absolute inset-0 flex items-center justify-center",children:[h.jsx("div",{className:d.pulseRings.ring1}),h.jsx("div",{className:d.pulseRings.ring2,style:{animationDelay:"0.5s"}}),h.jsx("div",{className:d.pulseRings.ring3,style:{animationDelay:"1s"}})]}),h.jsx("div",{className:"relative z-10 flex items-center justify-center",children:f&&p&&g?h.jsxs("div",{className:"flex gap-4 items-center justify-center",children:[h.jsx(Zi,{onClick:t,disabled:e,theme:l}),h.jsx(Ks,{onClick:n,disabled:e,theme:l}),h.jsx(qs,{onClick:r||t,disabled:e,theme:l})]}):m>1?h.jsxs("div",{className:"flex gap-6 items-center justify-center",children:[f&&h.jsx(Zi,{onClick:t,disabled:e,theme:l}),p&&h.jsx(Ks,{onClick:n,disabled:e,theme:l}),g&&r&&h.jsx(qs,{onClick:r,disabled:e,theme:l})]}):h.jsx("div",{className:"flex items-center justify-center",children:f?h.jsx(Zi,{onClick:t,disabled:e,theme:l}):p?h.jsx(Ks,{onClick:n,disabled:e,theme:l}):g&&r?h.jsx(qs,{onClick:r,disabled:e,theme:l}):h.jsx(Zi,{onClick:t,disabled:e,theme:l})})})]}),h.jsxs("div",{className:"text-center flex flex-col items-center gap-y-2 mb-6 w-full",children:[h.jsx("h3",{className:`text-xl font-semibold mb-2 ${d.text.accent}`,children:s}),h.jsx("p",{className:`text-sm leading-relaxed px-4 ${d.text.secondary}`,children:a}),m>1&&h.jsxs("div",{className:"flex gap-6 mt-4 text-xs justify-center",children:[f&&h.jsxs("div",{className:"flex flex-col items-center gap-1",children:[h.jsx(ng,{className:"w-4 h-4"}),h.jsx("span",{className:d.text.muted,children:"Voice"})]}),p&&h.jsxs("div",{className:"flex flex-col items-center gap-1",children:[h.jsx(tg,{className:"w-4 h-4"}),h.jsx("span",{className:d.text.muted,children:"Chat"})]}),g&&h.jsxs("div",{className:"flex flex-col items-center gap-1",children:[h.jsx(rg,{className:"w-4 h-4"}),h.jsx("span",{className:d.text.muted,children:"Video"})]})]})]}),h.jsx(EM,{prompts:i,theme:l}),h.jsx(kM,{statusMessage:o,theme:l})]})});ig.displayName="Welcome";class Xl extends D.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 D.createElement(t,{error:this.state.error})}return D.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 og({room:e,onSessionEnd:t,onSessionStart:n,enableConsoleLogging:r=!0,enableLocalStorage:i=!0,voxketSessionId:o}={}){const[s,a]=D.useState(null),[l,c]=D.useState([]),[u,d]=D.useState(null),[f,p]=D.useState([]),g=D.useCallback((E,v)=>{const _={timestamp:new Date,event:E,data:v,sessionId:s==null?void 0:s.sessionId,participantId:u==null?void 0:u.identity};if(c(k=>[...k,_]),i){const k=JSON.parse(localStorage.getItem("voxket-session-logs")||"[]");k.push(_),localStorage.setItem("voxket-session-logs",JSON.stringify(k))}return _},[s==null?void 0:s.sessionId,u==null?void 0:u.identity,r,i]);D.useEffect(()=>{if(!e)return;const E=()=>{const b=o||`session-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,R=new Date,O={sessionId:b,startTime:R,totalMessages:0,connectionIssues:0,participantCount:f.length,events:[]};a(O),g("SESSION_STARTED",{sessionId:b,startTime:R}),n==null||n(b)},v=()=>{if(s){const b=new Date,R=b.getTime()-s.startTime.getTime(),O={...s,endTime:b,duration:R,events:l};g("SESSION_ENDED",{sessionId:s.sessionId,duration:`${Math.round(R/1e3)}s`,totalMessages:s.totalMessages,connectionIssues:s.connectionIssues}),t==null||t(O),a(null),c([])}},_=b=>{g("CONNECTION_STATE_CHANGED",{state:b}),b===se.ConnectionState.Reconnecting&&s&&(a(R=>R?{...R,connectionIssues:R.connectionIssues+1}:null),g("CONNECTION_ISSUE",{type:"reconnecting"}))},k=b=>{g("TRACK_PUBLISHED",{trackKind:b.kind,trackSource:b.source})},C=b=>{g("TRACK_UNPUBLISHED",{trackKind:b.kind,trackSource:b.source})},M=(b,R)=>{s&&a(O=>O?{...O,totalMessages:O.totalMessages+1}:null),g("DATA_RECEIVED",{participantId:R==null?void 0:R.identity,dataSize:b.length})},N=b=>{g("PARTICIPANT_CONNECTED",{participantId:b.identity,participantName:b.name}),p(R=>[...R,b]),s&&a(R=>R?{...R,participantCount:R.participantCount+1}:null)},I=b=>{g("PARTICIPANT_DISCONNECTED",{participantId:b.identity,participantName:b.name}),p(R=>R.filter(O=>O.identity!==b.identity))};return e.localParticipant&&d(e.localParticipant),e.on(se.RoomEvent.Connected,E),e.on(se.RoomEvent.Disconnected,v),e.on(se.RoomEvent.ConnectionStateChanged,_),e.on(se.RoomEvent.TrackPublished,k),e.on(se.RoomEvent.TrackUnpublished,C),e.on(se.RoomEvent.DataReceived,M),e.on(se.RoomEvent.ParticipantConnected,N),e.on(se.RoomEvent.ParticipantDisconnected,I),()=>{e.off(se.RoomEvent.Connected,E),e.off(se.RoomEvent.Disconnected,v),e.off(se.RoomEvent.ConnectionStateChanged,_),e.off(se.RoomEvent.TrackPublished,k),e.off(se.RoomEvent.TrackUnpublished,C),e.off(se.RoomEvent.DataReceived,M),e.off(se.RoomEvent.ParticipantConnected,N),e.off(se.RoomEvent.ParticipantDisconnected,I)}},[e,s,l,f.length,g,t,n]);const m=D.useCallback(()=>i?JSON.parse(localStorage.getItem("voxket-session-logs")||"[]"):l,[l,i]),x=D.useCallback(()=>{i&&localStorage.removeItem("voxket-session-logs"),c([])},[i]),y=D.useCallback(()=>{const E=m(),v=JSON.stringify(E,null,2),_="data:application/json;charset=utf-8,"+encodeURIComponent(v),k=`voxket-session-logs-${new Date().toISOString().split("T")[0]}.json`,C=document.createElement("a");C.setAttribute("href",_),C.setAttribute("download",k),C.click()},[m]);return{sessionMetrics:s,sessionLogs:l,logEvent:g,getSessionLogs:m,clearSessionLogs:x,exportSessionLogs:y}}class Ql{constructor(){lt(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 o of i)try{o(...n)}catch(s){console.error(`Error in event listener for ${String(t)}:`,s)}}listenerCount(t){var n;return((n=this.listeners[t])==null?void 0:n.length)??0}eventNames(){return Object.keys(this.listeners)}}class sg{constructor(t){lt(this,"plugins",new Map);lt(this,"installedPlugins",new Set);lt(this,"context");this.context={client:t,emit:t.emit.bind(t),on:t.on.bind(t),config:{}}}register(t){if(this.plugins.has(t.name))throw new Error(`Plugin '${t.name}' is already registered`);if(t.dependencies){for(const n of t.dependencies)if(!this.plugins.has(n))throw new Error(`Plugin '${t.name}' depends on '${n}' which is not registered`)}this.plugins.set(t.name,t)}async install(t,n){const r=this.plugins.get(t);if(!r)throw new Error(`Plugin '${t}' is not registered`);if(this.installedPlugins.has(t))throw new Error(`Plugin '${t}' is already installed`);if(r.dependencies)for(const o of r.dependencies)this.installedPlugins.has(o)||await this.install(o);const 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,o]of this.plugins)if(this.installedPlugins.has(i)&&((r=o.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 SM(e){return e}function Jl(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 CM={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)})}},_M={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))}},TM={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})})}},ag=A.createContext(null);function io({config:e,children:t,autoConnect:n=!1,client:r}){const[i,o]=A.useState(null),[s,a]=A.useState(!1),[l,c]=A.useState(!1),[u,d]=A.useState(null),[f,p]=A.useState(null),[g,m]=A.useState("idle"),[x,y]=A.useState(null),[E,v]=A.useState([]),[_,k]=A.useState([]),[C,M]=A.useState([]);A.useEffect(()=>{const W=r||new ki(e);o(W);const w=N(W);return n&&!r&&I(W),()=>{w(),r||W.disconnect().catch(console.error)}},[e,n,r]);const N=W=>{const w=()=>{c(!0),d(null)},V=()=>{a(!0),c(!1),d(null)},Y=()=>{a(!1),c(!1),p(null),m("idle"),v([]),k([]),M([])},S=Ce=>{d(Ce),c(!1)},$=Ce=>{p(Ce),m(Ce.state)},q=Ce=>{m(Ce),f&&p({...f,state:Ce})},B=(Ce,K)=>{p(null),m("idle"),y(K),v([]),k([]),M([])},Q=Ce=>{v(K=>[...K,Ce])},te=Ce=>{v(K=>K.filter(ye=>ye.id!==Ce.id))},ae=Ce=>{k(K=>[...K,Ce])},de=Ce=>{k(K=>[...K,Ce])},De=Ce=>{console.log("📝 VoxketProvider: Received transcription:",Ce),M(K=>K.find(me=>me.id===Ce.id)?(console.log("📝 VoxketProvider: Duplicate transcription detected, skipping:",Ce.id),K):(console.log("📝 VoxketProvider: Adding new transcription:",Ce.id),[...K,Ce]))},U=()=>{console.log("🧹 VoxketProvider: Clearing chat messages and transcriptions"),k([]),M([])};return W.on("connection.connecting",w),W.on("connection.connected",V),W.on("connection.disconnected",Y),W.on("connection.error",S),W.on("session.created",$),W.on("session.state.changed",q),W.on("session.ended",B),W.on("participant.joined",Q),W.on("participant.left",te),W.on("chat.message.received",ae),W.on("chat.message.sent",de),W.on("transcription.received",De),W.on("chat.history.cleared",U),()=>{console.log("📝 VoxketProvider: Cleaning up event listeners"),W.off("connection.connecting",w),W.off("connection.connected",V),W.off("connection.disconnected",Y),W.off("connection.error",S),W.off("session.created",$),W.off("session.state.changed",q),W.off("session.ended",B),W.off("participant.joined",Q),W.off("participant.left",te),W.off("chat.message.received",ae),W.off("chat.message.sent",de),W.off("chat.history.cleared",U),W.off("transcription.received",De)}},I=async W=>{const w=W||i;if(w)try{await w.connect()}catch(V){console.error("Failed to connect:",V)}},P={client:i,isConnected:s,isConnecting:l,connectionError:u,currentSession:f,sessionState:g,sessionMetrics:x,participants:E,chatMessages:_,transcriptions:C,connect:()=>I(),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 V={agentId:W,participantName:w.participantName||"User",metadata:w.metadata,modalities:w.modalities||["voice"]};return await i.createSession(V)},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 h.jsx(ag.Provider,{value:P,children:t})}function fn(){const e=A.useContext(ag);if(!e)throw new Error("useVoxket must be used within a VoxketProvider");return e}class NM extends Ql{constructor(n){super();lt(this,"room",null);lt(this,"registeredMethods",new Map);lt(this,"activeInteractions",new Map);lt(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 o={methodName:n,component:r,presentationMode:i};this.registeredMethods.set(n,o);try{this.room.registerRpcMethod(n,async s=>{console.log(`RpcManager: RPC method '${n}' called by ${s.callerIdentity}`),console.log("RpcManager: Payload:",s.payload),this.emit("rpc.method.called",{methodName:n,data:s});let a;console.log(`RpcManager: Current registration for '${n}':`,o);let l=s.responseTimeout||30;try{a=JSON.parse(s.payload)}catch{a=s.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(s){throw console.error(`RpcManager: Failed to register RPC method '${n}':`,s),s}}async awaitUserInteraction(n,r,i,o,s){return new Promise((a,l)=>{const c=`${n}_${Date.now()}`;console.log(`RpcManager: Starting user interaction for method: ${n}, timeout: ${s} seconds`);const u={didSuccess:(f,p)=>{console.log(`RpcManager: User interaction successful for method: ${n}`,f),this.clearInteraction(c),this.currentInteraction=null;const g={success:!0,message:"User interaction completed successfully",data:f,timestamp:new Date,...p?{successView:p}:{}};this.emit("rpc.interaction.completed",{methodName:n,response:g}),a(g)},didFail:f=>{console.log(`RpcManager: User interaction failed for method: ${n}`,f),this.clearInteraction(c);const p={success:!1,message:"User interaction failed",error:f,timestamp:new Date};this.emit("rpc.interaction.completed",{methodName:n,response:p}),a(p)},dismissView:()=>{var p;console.log(`RpcManager: User dismissed interaction for method: ${n}`),console.log("RpcManager: Current interaction before dismiss:",(p=this.currentInteraction)==null?void 0:p.methodName),this.clearInteraction(c),this.currentInteraction=null,console.log("RpcManager: Current interaction after dismiss:",this.currentInteraction);const f={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:f}),this.emit("rpc.interaction.completed",{methodName:n,response:f}),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(f)},didTimeout:f=>{console.log(`RpcManager: User interaction timeout for method: ${n}`),this.clearInteraction(c),this.currentInteraction=null;const p={success:!0,message:`User interaction timed out after ${s} seconds, it should be considered as declined, agent don't need to retry`,timestamp:new Date,...f?{timeoutView:f}:{}};this.emit("rpc.interaction.timeout",{methodName:n,response:p}),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(p)}},d=setTimeout(()=>{u.didTimeout&&u.didTimeout()},s);this.activeInteractions.set(c,{resolve:f=>a(JSON.parse(f)),reject:l,timeoutId:d}),this.currentInteraction={isVisible:!0,methodName:n,component:r,presentationMode:i,timeout:s,data:o,handler:u},this.emit("rpc.interaction.started",{methodName:n,presentationMode:i}),setTimeout(async()=>{var f;if((f=this.currentInteraction)!=null&&f.handler)try{console.log(`RpcManager: Component created for method: ${n} with data:`,o)}catch(p){console.error("RpcManager: Error loading data into component:",p),u.didFail({error:"Failed to load data into component"})}},100)})}clearInteraction(n){const r=this.activeInteractions.get(n);r&&(console.log(`RpcManager: Clearing interaction: ${n}`),clearTimeout(r.timeoutId),this.activeInteractions.delete(n))}getCurrentInteraction(){return this.currentInteraction}dismissCurrentInteraction(){var n;this.currentInteraction&&(console.log(`RpcManager: Dismissing current interaction: ${this.currentInteraction.methodName}`),(n=this.currentInteraction.handler)==null||n.dismissView(),setTimeout(()=>{this.currentInteraction&&(console.log("RpcManager: Force clearing lingering interaction"),this.currentInteraction=null)},0))}getRegisteredMethods(){return Array.from(this.registeredMethods.keys())}unregisterMethod(n){this.registeredMethods.delete(n),console.log(`RpcManager: Unregistered RPC method: ${n}`)}clear(){for(const[n,r]of this.activeInteractions)clearTimeout(r.timeoutId);this.activeInteractions.clear(),this.registeredMethods.clear(),this.currentInteraction=null,console.log("RpcManager: Cleared all registrations and interactions")}}class Ze extends Error{constructor(t,n,r){super(t),this.code=n,this.details=r,this.name="VoxketError"}}const Nn=new WeakSet,Ys=new WeakSet;class ki extends Ql{constructor(n){super();lt(this,"config");lt(this,"room",null);lt(this,"pluginManager");lt(this,"rpcManager");lt(this,"isConnected",!1);lt(this,"currentSession",null);lt(this,"connectionState",se.ConnectionState.Disconnected);lt(this,"renderedComponents",new Map);lt(this,"textStreamHandlersRegistered",!1);lt(this,"currentAgentInfo",null);lt(this,"chatMessages",[]);lt(this,"activeTranscriptions",new Map);lt(this,"isAgentConnected",!1);lt(this,"agentState","idle");this.config=n,this.pluginManager=new sg(this),this.rpcManager=new NM,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,o;(o=(i=this.config).onSessionEnd)==null||o.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 se.Room,this.setupRoomEventListeners()}setupRoomEventListeners(){this.room&&(this.room.on(se.RoomEvent.Connected,()=>{var n,r;this.connectionState=se.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(o){console.warn("VoxketClient: Failed to enable microphone after room connection:",o)}},1e3),this.textStreamHandlersRegistered||this.setupTextStreamHandlers()}),this.room.on(se.RoomEvent.Disconnected,n=>{var r;console.log("🔴 VoxketClient: Room disconnected, reason:",n),this.connectionState=se.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(se.RoomEvent.ConnectionStateChanged,n=>{this.connectionState=n,n===se.ConnectionState.Connecting&&this.emit("connection.connecting")}),this.room.on(se.RoomEvent.ParticipantConnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.joined",r)}),this.room.on(se.RoomEvent.ParticipantDisconnected,n=>{const r={id:n.identity,name:n.name||n.identity,isLocal:!1};this.emit("participant.left",r)}),this.room.on(se.RoomEvent.LocalTrackPublished,n=>{console.log("🎬 VoxketClient: Local track published:",n.source),n.source===se.Track.Source.ScreenShare&&this.emit("track.unmuted",{source:"screenShare",enabled:!0})}),this.room.on(se.RoomEvent.LocalTrackUnpublished,n=>{console.log("🎬 VoxketClient: Local track unpublished:",n.source),n.source===se.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 o=await r.readAll(),s={id:`msg_${Date.now()}_${i.identity||"user"}_${Math.random().toString(36).substr(2,9)}`,content:o,timestamp:new Date,sender:{id:i.identity||"user",name:i.identity||"User",type:"participant"},metadata:{topic:"lk.chat"}};this.emit("chat.message.received",s)}catch(o){console.error("VoxketClient: Failed to process lk.chat message:",o)}})}catch(r){console.warn("VoxketClient: lk.chat handler already registered, skipping:",r)}try{console.log("📝 VoxketClient: Registering lk.transcription handler..."),this.room.registerTextStreamHandler("lk.transcription",async(r,i)=>{var o,s,a,l,c,u;console.log("📝 VoxketClient: Received transcription stream from:",i.identity);try{console.log("📝 VoxketClient: Processing transcription stream...");const d=i.identity===((s=(o=this.room)==null?void 0:o.localParticipant)==null?void 0:s.identity),f=Date.now(),p=i.identity,g=this.activeTranscriptions.get(p);let m,x=!0;g&&f-g.timestamp<1e3?(m=g.messageId,x=!1,console.log("📝 VoxketClient: Reusing existing transcription message ID:",m)):(m=`msg_${d?"user":"agent"}_${i.identity}_${f}`,this.activeTranscriptions.set(p,{messageId:m,timestamp:f}),console.log("📝 VoxketClient: Created new transcription message ID:",m));let y="";console.log("📝 VoxketClient: Current agent info:",this.currentAgentInfo);const E=((a=this.currentAgentInfo)==null?void 0:a.name)||i.identity||"AI Assistant";console.log("📝 VoxketClient: Using agent name:",E);const v=d?"participant":"agent",_=d?this.config.participantName||"User":E;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:v,senderName:_});const k={id:m,content:"",timestamp:new Date,sender:{id:i.identity||"unknown",name:_,type:v},metadata:{topic:"lk.transcription",streaming:!0}};x&&this.emit("chat.message.received",k),console.log("📝 VoxketClient: Starting to read transcription stream...");for await(const I of r){console.log("📝 VoxketClient: Received chunk:",I.length,"chars"),y+=I;const b=this.convertMarkdownToText(y),R={...k,content:b,metadata:{...k.metadata,streaming:!0}};this.emit("chat.message.updated",R)}const C=this.convertMarkdownToText(y),M={...k,content:C,metadata:{...k.metadata,streaming:!1}};this.emit("chat.message.updated",M);const N={id:m,text:C,isFinal:!0,startTime:k.timestamp.getTime(),participantId:i.identity||"agent"};this.emit("transcription.received",N),console.log("📝 VoxketClient: Emitted transcription event:",N)}catch(d){console.error("VoxketClient: Failed to process lk.transcription message:",d);try{const f=await r.readAll(),p=((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:f,timestamp:new Date,sender:{id:i.identity||"agent",name:p,type:"agent"},metadata:{topic:"lk.transcription"}};this.emit("chat.message.received",g);const m={id:g.id,text:g.content,isFinal:!0,startTime:g.timestamp.getTime(),participantId:i.identity||"agent"};this.emit("transcription.received",m),console.log("📝 VoxketClient: Emitted fallback transcription event:",m)}catch(f){console.error("VoxketClient: Fallback failed for lk.transcription:",f)}}})}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 o=[];try{o=["tes","hello how are you","algebra make me learn that ","what is the meaning of life"]}catch(s){console.warn("VoxketClient: Failed to parse suggested_response:",s,i)}this.emit("suggested.response",o)})}catch(r){console.warn("VoxketClient: suggested_response handler already registered, skipping:",r)}try{this.room.registerTextStreamHandler("agent_state_changed",async(r,i)=>{const o=await r.readAll();console.log("🤖 VoxketClient: agent_state_changed stream received:",o);let s={};try{s=typeof o=="string"?JSON.parse(o.replace(/'/g,'"')):o}catch(a){console.warn("VoxketClient: Failed to parse agent_state_changed:",a,o)}this.isAgentConnected||(this.isAgentConnected=!0,console.log("🤖 VoxketClient: Agent marked as connected (first state change received)"),this.emit("agent.connected",s)),s.new_state==="speaking"?(this.setAgentState("speaking"),this.emit("agent.speaking",s)):s.new_state==="thinking"?(this.setAgentState("thinking"),this.emit("agent.thinking",s)):(s.new_state==="idle"||s.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 o=await r.readAll()}catch(o){console.error("VoxketClient: Error processing images stream:",o)}})}catch(r){console.warn("VoxketClient: images handler already registered, skipping:",r)}try{this.room.registerByteStreamHandler("images",async(r,i)=>{var o,s;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===((s=(o=this.room)==null?void 0:o.localParticipant)==null?void 0:s.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=p=>{const g={...l,metadata:{...l.metadata,downloadProgress:p||0}};this.emit("chat.message.updated",g)});const c=[];for await(const p of r)c.push(p);const u=new Blob(c,{type:a.mimeType||"application/octet-stream"}),d=URL.createObjectURL(u),f={...l,metadata:{...l.metadata,downloading:!1,downloadProgress:1,downloadUrl:d,blob:u}};this.emit("chat.message.updated",f)}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,o)=>{try{const s=await i.readAll();if(console.log(`📝 VoxketClient: Received '${r}' stream:`,s),r==="error"){let a={};try{a=typeof s=="string"?JSON.parse(s):s}catch{a={message:s}}console.warn("� VoxketClient: Agent error:",a),this.emit("agent.error",a)}else this.emit("text.stream.received",{topic:r,data:s,participantInfo:o})}catch(s){console.error(`VoxketClient: Failed to process '${r}' stream:`,s)}})}catch(i){console.warn(`VoxketClient: Handler for '${r}' already registered, skipping:`,i)}});try{this.room.registerTextStreamHandler("*",async(r,i)=>{var o;try{const s=await r.readAll(),a=((o=r.info)==null?void 0:o.topic)||"unknown";console.log(`📝 VoxketClient: Received unhandled text stream for topic '${a}':`,s),this.emit("text.stream.unhandled",{topic:a,data:s,participantInfo:i})}catch(s){console.error("VoxketClient: Failed to process unhandled text stream:",s)}})}catch(r){console.warn("VoxketClient: Generic text stream handler already registered, skipping:",r)}this.textStreamHandlersRegistered=!0}async fetchConnectionDetails(n,r,i){const o=n||this.config.agentId||"default-agent",s=r||this.config.participantName||"User",a=i||this.config.modalities||["voice"];try{const l={agent_id:o,participant_name:s,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 f=`HTTP ${c.status}: Failed to fetch connection details`;try{const p=await c.json();p&&(p.error?f=`API Error: ${p.error}`:p.detail?f=`API Error: ${p.detail}`:p.message&&(f=`API Error: ${p.message}`))}catch{try{const g=await c.text();g&&(f=`API Error: ${g}`)}catch{}}throw new Error(f)}const u=await c.json();let d;return u.agent_info&&(d={id:u.agent_info.agent_info.id,name:u.agent_info.agent_info.name,capabilities:u.agent_info.capabilities,modality_supported:u.agent_info.modality_supported,session_settings:u.agent_info.session_settings||{}},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 Ze(`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 o;try{this.emit("connection.connecting");const s=await this.fetchConnectionDetails(n,r,i);return await((o=this.room)==null?void 0:o.connect(s.serverUrl,s.participantToken)),this.isConnected=!0,s}catch(s){console.error("VoxketClient: Connection failed:",s);const a=new Ze(`Failed to connect to Voxket services: ${s instanceof Error?s.message:"Unknown error"}`,"CONNECTION_FAILED",s);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 se.Room,this.setupRoomEventListeners(),console.log("✅ VoxketClient: Disconnect completed successfully"),this.emit("connection.disconnected")}catch(r){console.error("❌ VoxketClient: Disconnect failed:",r);const i=new Ze("Failed to disconnect properly","NETWORK_ERROR",r);throw this.emit("connection.error",i),i}}async createSession(n){var r,i,o,s;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((o=n.modalities)!=null&&o.includes("video"))try{await new Promise(c=>setTimeout(c,200)),(s=this.room)!=null&&s.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 Ze?a:a instanceof TypeError&&a.message.includes("fetch")?new Ze("Network connection failed","CONNECTION_FAILED",a):a instanceof Error&&a.message.includes("Failed to fetch connection details")?new Ze(`API connection failed: ${a.message}`,"CONNECTION_FAILED",a):new Ze(`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 Ze("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(se.Track.Source.Microphone);if(i!=null&&i.track)return{source:se.Track.Source.Microphone,participant:r,publication:i}}return null}getAgentVideoTrack(){const n=this.getRemoteParticipants();for(const r of n){const i=r.getTrackPublication(se.Track.Source.Camera);if(i!=null&&i.track)return{source:se.Track.Source.Camera,participant:r,publication:i}}return null}getVideoTrackRefs(){const n=[],r=this.getLocalParticipant();if(r){const o=r.getTrackPublication(se.Track.Source.Camera);o!=null&&o.track&&n.push({source:se.Track.Source.Camera,participant:r,publication:o});const s=r.getTrackPublication(se.Track.Source.ScreenShare);s!=null&&s.track&&n.push({source:se.Track.Source.ScreenShare,participant:r,publication:s})}const i=this.getRemoteParticipants();for(const o of i){const s=o.getTrackPublication(se.Track.Source.Camera);s!=null&&s.track&&n.push({source:se.Track.Source.Camera,participant:o,publication:s});const a=o.getTrackPublication(se.Track.Source.ScreenShare);a!=null&&a.track&&n.push({source:se.Track.Source.ScreenShare,participant:o,publication:a})}return n}getCameraTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===se.Track.Source.Camera)}getScreenShareTrackRefs(){return this.getVideoTrackRefs().filter(n=>n.source===se.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 s,a,l,c,u,d,f,p,g;const r=this.resolveTarget(n.target||"body"),i=this.getTargetKey(r);if(Ys.has(r)){console.warn("⚠️ VoxketClient: Target is already being processed, skipping renderUI");return}if(Nn.has(r)){console.log("✋ VoxketClient: Target already has a React root in registry, updating existing props...");const m=this.renderedComponents.get(i);if(m&&m.root){const x={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:((s=n.modality)==null?void 0:s.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{m.root.render(A.createElement(io,{config:this.config,autoConnect:n.autoStart||!1,client:this,children:A.createElement(oo,x)})),console.log("✅ VoxketClient: Successfully updated existing widget with new props");return}catch(y){throw console.error("Error re-rendering existing widget:",y),new Error(`Failed to update existing widget: ${y instanceof Error?y.message:"Unknown error"}`)}}else console.warn("⚠️ Registry inconsistency detected, cleaning up"),Nn.delete(r)}let o=this.renderedComponents.get(i);if(o&&o.target===r&&Nn.has(r)){console.log("🔄 VoxketClient: Reusing existing React root for target:",i);const m=o.root,x={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{m.render(A.createElement(io,{config:this.config,autoConnect:n.autoStart||!1,client:this,children:A.createElement(oo,x)}))}catch(y){throw console.error("Error rendering Voxket widget:",y),new Error(`Failed to render Voxket widget: ${y instanceof Error?y.message:"Unknown error"}`)}return}Ys.add(r);try{if(o){console.log("🧹 VoxketClient: Cleaning up existing component for different target");try{o.root.unmount(),this.renderedComponents.delete(i),Nn.delete(o.target),r.innerHTML=""}catch(y){console.warn("Failed to cleanup existing root:",y)}}if(Nn.has(r)){console.warn("⚠️ VoxketClient: Target already in registry, skipping root creation");return}console.log("🆕 VoxketClient: Creating new React root for target:",i);const m=Hg.createRoot(r);this.renderedComponents.set(i,{root:m,target:r}),Nn.add(r);const x={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:((f=n.modality)==null?void 0:f.includes("chat"))!==!1,suportsVideoInput:((p=n.modality)==null?void 0:p.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(!m||typeof m.render!="function")throw new Error("Invalid React root. Make sure React 18+ is properly installed and configured.");try{m.render(A.createElement(io,{config:this.config,autoConnect:n.autoStart||!1,client:this,children:A.createElement(oo,x)}))}catch(y){throw console.error("Error rendering Voxket widget:",y),new Error(`Failed to render Voxket widget: ${y instanceof Error?y.message:"Unknown error"}`)}}finally{Ys.delete(r)}}removeUI(n){var i;const r=n?this.resolveTarget(n):null;if(r){const o=this.getTargetKey(r),s=this.renderedComponents.get(o);if(s){console.log("🗑️ VoxketClient: Removing UI for target:",o),this.renderedComponents.delete(o),Nn.delete(r);try{const l=s.target;l&&l.isConnected?(typeof((i=s.root)==null?void 0:i.unmount)=="function"&&(s.root.unmount(),console.log("✅ VoxketClient: UI unmounted for target:",o)),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:",o),Nn.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 Ze("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new Ze("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new Ze("No local participant","CONNECTION_FAILED");this.dismissCurrentInteraction();try{const o={id:`msg_${Date.now()}`,content:n,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:r||{}},s=await((i=this.room)==null?void 0:i.localParticipant.sendText(n,{topic:"lk.chat",destinationIdentities:[]}));this.emit("chat.message.sent",o)}catch(o){throw console.error("VoxketClient: Failed to send chat message:",o),new Ze("Failed to send message","NETWORK_ERROR",o)}}async sendChatMessage(n,r){return this.sendMessage(n,r)}async sendAttachments(n,r){if(!this.currentSession)throw console.error("VoxketClient: No active session found"),new Ze("No active session","SESSION_NOT_FOUND");if(!this.room)throw console.error("VoxketClient: No room instance found"),new Ze("No room connection","CONNECTION_FAILED");if(!this.room.localParticipant)throw console.error("VoxketClient: No local participant found"),new Ze("No local participant","CONNECTION_FAILED");if(!n||n.length===0)throw new Ze("No files provided","INVALID_PARAMETER");this.dismissCurrentInteraction();const i=n.filter(o=>o.type.startsWith("image/"));if(i.length===0)throw new Ze("Only image files are allowed","INVALID_PARAMETER");i.length!==n.length&&console.warn("VoxketClient: Some non-image files were filtered out");try{const o=i.map(async(s,a)=>{const c={id:`att_${Date.now()}_${a}`,content:`📎 ${s.name}`,sender:{id:"user",name:this.config.participantName||"User",type:"participant"},timestamp:new Date,metadata:{...r,type:"attachment",fileName:s.name,fileSize:s.size,mimeType:s.type,uploading:!0}};this.emit("chat.message.sent",c);const u=await this.room.localParticipant.sendFile(s,{mimeType:s.type,topic:"images",onProgress:f=>{const p={...c,metadata:{...c.metadata,uploadProgress:f}};this.emit("chat.message.updated",p)}});try{const f=new FileReader,p=new Promise((x,y)=>{f.onload=()=>{typeof f.result=="string"?x(f.result):y(new Error("Failed to convert to base64"))},f.onerror=y});f.readAsDataURL(s);const m={type:"image",data:await p,filename:s.name,mimeType:s.type,size:s.size};await this.room.localParticipant.sendText(JSON.stringify(m),{topic:"images",destinationIdentities:[]})}catch(f){console.warn("VoxketClient: Failed to send image data to agent:",f);try{const p=`I've shared an image: ${s.name}`;await this.room.localParticipant.sendText(p,{topic:"lk.chat",destinationIdentities:[]})}catch(p){console.warn("VoxketClient: Failed to send image notification to agent:",p)}}const d={...c,metadata:{...c.metadata,uploading:!1,uploadProgress:1,streamId:u.id}};return this.emit("chat.message.updated",d),u});await Promise.all(o)}catch(o){throw console.error("VoxketClient: Failed to send attachments:",o),new Ze("Failed to send attachments","NETWORK_ERROR",o)}}async sendAttachment(n,r){return this.sendAttachments([n],r)}toggleMicrophone(n){return this.setMicrophoneEnabled(n!==!1)}async setMicrophoneEnabled(n){var r,i;try{const o=(r=this.room)==null?void 0:r.localParticipant.isMicrophoneEnabled,s=n??!o;await((i=this.room)==null?void 0:i.localParticipant.setMicrophoneEnabled(s)),s?this.emit("track.unmuted",{source:"microphone",enabled:!0}):this.emit("track.muted",{source:"microphone",enabled:!1})}catch(o){throw console.error("VoxketClient: Failed to toggle microphone:",o),new Ze("Failed to toggle microphone","PERMISSION_DENIED",o)}}toggleCamera(n){return this.setCameraEnabled(n!==!1)}async setCameraEnabled(n){var r,i;try{const o=(r=this.room)==null?void 0:r.localParticipant.isCameraEnabled,s=n??!o;await((i=this.room)==null?void 0:i.localParticipant.setCameraEnabled(s)),s?this.emit("track.unmuted",{source:"camera",enabled:!0}):this.emit("track.muted",{source:"camera",enabled:!1})}catch(o){throw console.error("VoxketClient: Failed to toggle camera:",o),new Ze("Failed to toggle camera","PERMISSION_DENIED",o)}}async enableCamera(){return this.setCameraEnabled(!0)}async disableCamera(){return this.setCameraEnabled(!1)}async startScreenShare(){var n;try{await((n=this.room)==null?void 0:n.localParticipant.setScreenShareEnabled(!0)),this.emit("track.unmuted",{source:"screenShare",enabled:!0})}catch(r){throw new Ze("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 Ze("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 Ze("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 Ze("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 Ze("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 Ze("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=o=>!!r.canPublish&&(r.canPublishSources.length===0||r.canPublishSources.includes(o));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===se.ConnectionState.Connected}getMicrophoneTrack(){const n=this.getLocalParticipant();if(!n)return null;for(const[,r]of n.trackPublications)if(r.source===se.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===se.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===se.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 Ze("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 Ze("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 o=await i.readAll();r(o)}catch(o){console.error(`Error processing event for topic '${n}':`,o)}})}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 AM=Me.create(Fm),RM=Me.create(Vl),MM=Me.create(UN),IM=Me.create(ig);function OM({theme:e,mode:t,loadingText:n}){const r=Ct(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 h.jsxs("div",{className:"flex flex-col items-center justify-center h-full w-full p-8",children:[h.jsxs("div",{className:"text-center",children:[h.jsx("h3",{className:`text-lg font-semibold mb-2 ${r.text.accent}`,children:i()}),h.jsx("p",{className:`text-sm ${r.text.muted}`,children:"Please wait a moment..."})]}),h.jsxs("div",{className:"flex space-x-1 mt-4",children:[h.jsx("div",{className:"w-2 h-2 rounded-full animate-bounce bg-blue-500",style:{animationDelay:"0ms"}}),h.jsx("div",{className:"w-2 h-2 rounded-full animate-bounce bg-blue-500",style:{animationDelay:"150ms"}}),h.jsx("div",{className:"w-2 h-2 rounded-full animate-bounce bg-blue-500",style:{animationDelay:"300ms"}})]})]})}const PM=Me.create(OM);function DM({onClick:e,text:t="Open Chat",position:n="bottom-right",theme:r}){const i={"top-left":{top:16,left:16},"top-right":{top:16,right:16},"bottom-left":{bottom:16,left:16},"bottom-right":{bottom:16,right:16}},o=Ct(r);return h.jsx(Me.button,{onClick:e,className:`voxket-popup-trigger fixed z-[2147483647] px-4 py-2 rounded-full shadow-lg ${o.popupTrigger} transition-all duration-200 hover:scale-105`,style:{position:"fixed",...i[n]},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 bf({children:e,theme:t,displayType:n="widget",onClose:r,popupPosition:i="bottom-right",onExpand:o}){const s=Ct(t),a={"top-left":{top:16,left:16},"top-right":{top:16,right:16},"bottom-left":{bottom:16,left:16},"bottom-right":{bottom:16,right:16}};return n==="fullscreen"?h.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:l=>{l.target===l.currentTarget&&r&&r()},children:h.jsxs("div",{className:"w-full h-full max-w-7xl max-h-[95vh] rounded-2xl relative bg-transparent flex flex-col",onClick:l=>{l.stopPropagation()},children:[r&&h.jsx("button",{onClick:l=>{l.preventDefault(),l.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:h.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:h.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"})})}),h.jsxs("div",{id:"voice-card",className:`voxket-widget-root theme-${t} ${s.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:[h.jsx("div",{className:s.cardTopGradient}),h.jsx("div",{className:s.cardPurpleBlur}),h.jsx("div",{className:s.cardPinkBlur}),h.jsx("div",{className:"relative z-10 flex flex-col h-full",children:e}),h.jsx("div",{className:s.cardPulse1}),h.jsx("div",{className:s.cardPulse2,style:{animationDelay:"1s"}})]})]})}):n==="popup"?h.jsx("div",{className:"voxket-popup-wrapper fixed inset-0 z-[2147483600] pointer-events-none",style:{width:"100vw",height:"100vh"},children:h.jsxs("div",{className:"fixed rounded-2xl pointer-events-auto",style:{...a[i],position:"fixed"},children:[r&&h.jsx("button",{onClick:r,className:"absolute -top-2 -right-2 z-[2147483646] w-8 h-8 rounded-full text-white flex items-center justify-center text-sm shadow-lg border border-gray-700",style:{background:"rgba(31,41,55,0.85)",backdropFilter:"blur(4px)",cursor:"pointer"},children:"×"}),h.jsxs("div",{id:"voice-card",className:`voxket-widget-root theme-${t} ${s.card} rounded-2xl flex flex-col relative overflow-hidden shadow-xl`,"data-theme":t,style:{width:"350px",height:"500px",contain:"layout style paint",overscrollBehavior:"contain",background:"var(--voxket-card-bg, linear-gradient(155deg,#1e2533,#0b0e13))"},children:[h.jsx("div",{className:s.cardTopGradient}),h.jsx("div",{className:s.cardPurpleBlur}),h.jsx("div",{className:s.cardPinkBlur}),h.jsx("div",{className:"relative z-10 flex flex-col h-full w-full",children:e}),h.jsx("div",{className:s.cardPulse1}),h.jsx("div",{className:s.cardPulse2,style:{animationDelay:"1s"}})]})]})}):h.jsxs("div",{id:"voice-card",className:`voxket-widget-root theme-${t} ${s.card} relative overflow-hidden w-full h-full`,"data-theme":t,style:{height:"100%",maxHeight:"100%",contain:"layout style paint",overscrollBehavior:"contain"},children:[h.jsx("div",{className:s.cardTopGradient}),h.jsx("div",{className:s.cardPurpleBlur}),h.jsx("div",{className:s.cardPinkBlur}),h.jsx("div",{className:"relative z-10 flex flex-col h-full w-full",children:e}),h.jsx("div",{className:s.cardPulse1}),h.jsx("div",{className:s.cardPulse2,style:{animationDelay:"1s"}})]})}function LM(e){if(typeof window>"u")return null;const{agentId:t,participantName:n,baseUrl:r,appSecret:i,appId:o,prompts:s,statusMessage:a,welcomeTitle:l,welcomeSubTitle:c,className:u,width:d,height:f,loadingText:p,suportsChatInput:g=!0,suportsVideoInput:m=!0,suportsScreenShare:x=!0,theme:y="vox",onSessionStart:E,onSessionEnd:v,enableSessionLogging:_=!0,onSessionLogsUpdate:k,onSessionMetricsUpdate:C,modalities:M=["voice"],displayType:N="widget",popupPosition:I="bottom-right",popupTriggerText:b="Open Chat",onPopupToggle:R,voxketClient:O,onDisplayTypeChange:L}=e,[j,H]=D.useState(!1),[ie,ee]=D.useState(null),[P,W]=D.useState(()=>{try{if(O)return!!O.getCurrentSession()}catch(ne){console.error("Error checking existing session:",ne)}return!1}),[w,V]=D.useState(!1),[Y,S]=D.useState(t||""),[$,q]=D.useState(n||"User"),[B,Q]=D.useState(()=>{try{if(O)return O.getCurrentSession()}catch(ne){console.error("Error getting current session:",ne)}return null}),[te,ae]=D.useState(()=>{var ne,$e,Ve;try{if(O){const Ke=O.getCurrentSession();if((ne=Ke==null?void 0:Ke.activeModalities)!=null&&ne.includes("chat"))return"chat";if(($e=Ke==null?void 0:Ke.activeModalities)!=null&&$e.includes("voice"))return"voice";if((Ve=Ke==null?void 0:Ke.activeModalities)!=null&&Ve.includes("video"))return"video"}}catch(Ke){console.error("Error determining current mode:",Ke)}return"welcome"}),[de,De]=D.useState(!1);D.useEffect(()=>{N==="fullscreen"&&console.log("🎯 Widget: Switched to fullscreen mode")},[N]),D.useEffect(()=>{P&&!w?console.log("📊 Session started:",{currentMode:te,sessionId:B==null?void 0:B.id}):!P&&!w&&te==="welcome"&&console.log("📊 Returned to welcome screen")},[P,te,w]);const U=D.useMemo(()=>{try{if(O)return console.log("🔄 Using existing VoxketClient to preserve session state"),O;if(!o||!i||!r){const $e=`Missing required props: ${o?"":"appId "}${i?"":"appSecret "}${r?"":"baseUrl"}`;return console.error("❌ VoxketClient creation failed:",$e),ee(new Error($e)),H(!0),null}const ne={appId:o,appSecret:i,baseUrl:r,agentId:Y,participantName:$||"User",modalities:M};return console.log("🔧 Creating new VoxketClient with config:",{appId:o.substring(0,8)+"...",baseUrl:r,agentId:Y,participantName:$||"User",modalities:M}),new ki(ne)}catch(ne){return console.error("❌ Failed to create VoxketClient:",ne),ee(ne),H(!0),null}},[O,o,i,r,Y,$,M]),Ce=M,K=D.useMemo(()=>{try{if(!U)return console.warn("⚠️ No VoxketClient available, creating fallback room"),new se.Room;const ne=U.getRoom();return console.log("🏠 Widget: Room reference updated:",{roomExists:!!ne,roomState:ne==null?void 0:ne.state,sessionStarted:P,currentMode:te}),ne||new se.Room}catch(ne){return console.error("❌ Error getting room from client:",ne),new se.Room}},[U,P,te]);D.useEffect(()=>{if(K){const ne=()=>{console.log("🏠 Widget: Room state changed:",{state:K.state,numParticipants:K.numParticipants,isConnected:K.state==="connected",sessionId:B==null?void 0:B.id})},$e=(Ve,Ke,nn)=>{console.log("🎵 Widget: Track subscribed:",{trackKind:Ve.kind,trackSource:Ve.source,participantSid:nn.sid,participantIdentity:nn.identity,sessionId:B==null?void 0:B.id})};return K.on(se.RoomEvent.Connected,ne),K.on(se.RoomEvent.Disconnected,ne),K.on(se.RoomEvent.TrackSubscribed,$e),()=>{K.off(se.RoomEvent.Connected,ne),K.off(se.RoomEvent.Disconnected,ne),K.off(se.RoomEvent.TrackSubscribed,$e)}}},[K,B==null?void 0:B.id]),D.useEffect(()=>{!w&&te==="welcome"?console.log("🎬 Widget: Welcome screen ready"):P&&te!=="welcome"&&console.log("🎬 Widget: Session mode active:",te)},[te,w,P]),D.useEffect(()=>{(te==="voice"||te==="video"||te==="chat")&&!B&&!P&&!w&&U&&!U.connected&&(console.log("🔄 Auto-correcting: Found orphaned mode without session, returning to welcome"),ae("welcome"),V(!1))},[te,B,P,w,U]);const{sessionMetrics:ye,sessionLogs:me,logEvent:ge}=og({room:K,onSessionStart:E,onSessionEnd:v,enableConsoleLogging:_,enableLocalStorage:_,voxketSessionId:B==null?void 0:B.id});D.useEffect(()=>{k&&k(me)},[me,k]),D.useEffect(()=>{C&&ye&&C(ye)},[ye,C]),D.useEffect(()=>{if(!U)return;const ne=()=>{const $e=U.connected,Ve=U.getCurrentSession();console.log("🔗 Connection state changed:",{isConnected:$e,currentSessionId:Ve==null?void 0:Ve.id,currentMode:te,loading:w,sessionStarted:P}),!$e&&P&&!w&&(console.log("🔴 Connection lost during active session - returning to welcome"),V(!1),W(!1),Q(null),ae("welcome")),$e&&Ve&&w&&(console.log("🟢 Connected with active session - removing loader"),V(!1),W(!0),Q(Ve))};return U.on("connectionStateChanged",ne),U.on("sessionEnded",()=>{console.log("📞 Session ended - returning to welcome"),V(!1),W(!1),Q(null),ae("welcome")}),()=>{U.off("connectionStateChanged",ne),U.off("sessionEnded",()=>{})}},[U,te,w,P]),D.useEffect(()=>{const ne=Ve=>{console.log("🔴 Widget: Room disconnected:",Ve),console.log("🔍 Widget: Current state on disconnect:",{currentMode:te,sessionStarted:P,currentSessionId:B==null?void 0:B.id,loading:w}),V(!1),W(!1),Q(null),ae("welcome"),console.log("🏠 Widget: Automatically returning to welcome screen after disconnect")},$e=Ve=>{console.log("📹 Media devices error:",Ve)};return K.on(se.RoomEvent.MediaDevicesError,$e),K.on(se.RoomEvent.Disconnected,ne),()=>{K.off(se.RoomEvent.Disconnected,ne),K.off(se.RoomEvent.MediaDevicesError,$e)}},[K,te,P,B==null?void 0:B.id,w]);const Ee=async()=>{try{if(!U){console.error("❌ VoxketClient not available"),ee(new Error("VoxketClient not initialized")),H(!0);return}V(!0),ae("voice"),console.log("🎤 Starting voice session...",{agentId:Y,participantName:$}),console.log("🎤 Pre-start state:",{currentMode:"voice",sessionStarted:!1,loading:!0}),ge("USER_STARTED_VOICE_SESSION",{agentId:Y,participantName:$});const ne=await U.startSession(Y,{participantName:$||"User",modalities:["voice",...m?["video"]:[]]});console.log("✅ Voice session started successfully:",ne.id),Q(ne),W(!0),V(!1),E&&E(ne.id)}catch(ne){console.error("❌ Failed to start voice session:",ne),V(!1),W(!1),ae("welcome")}},Te=async()=>{try{if(!U){console.error("❌ VoxketClient not available"),ee(new Error("VoxketClient not initialized")),H(!0);return}V(!0),ae("chat"),console.log("💬 Starting chat session...",{agentId:Y,participantName:$}),ge("USER_STARTED_CHAT_SESSION",{agentId:Y,participantName:$});const ne=await U.startSession(Y,{participantName:$||"User",modalities:["chat"]});console.log("✅ Chat session started successfully:",ne.id),Q(ne),W(!0),V(!1),E&&E(ne.id)}catch(ne){console.error("❌ Failed to start chat session:",ne),V(!1),W(!1),ae("welcome")}},Ne=async()=>{try{if(!U){console.error("❌ VoxketClient not available"),ee(new Error("VoxketClient not initialized")),H(!0);return}V(!0),ae("video"),console.log("📺 Starting video session...",{agentId:Y,participantName:$}),console.log("📺 Pre-start state:",{currentMode:"video",sessionStarted:!1,loading:!0}),ge("USER_STARTED_VIDEO_SESSION",{agentId:Y,participantName:$});const ne=await U.startSession(Y,{participantName:$||"User",modalities:["video","voice"]});console.log("✅ Video session started successfully:",ne.id),Q(ne),W(!0),V(!1),E&&E(ne.id)}catch(ne){console.error("❌ Failed to start video session:",ne),V(!1),W(!1),ae("welcome")}},we=()=>{console.log("🔄 Widget: handleBackToWelcome called",{currentMode:te,sessionStarted:P,currentSessionId:B==null?void 0:B.id,displayType:N,loading:w}),ae("welcome"),V(!1),L&&L(e.displayType||"widget"),B&&P?(console.log("🧹 Widget: Cleaning up active session"),W(!1),Q(null),U&&(console.log("🔌 Widget: Disconnecting client and cleaning up room"),U.disconnect().catch(ne=>{console.error("❌ Widget: Error during disconnect:",ne)}))):(console.log("📝 Widget: No active session to clean up"),U&&U.connected&&(console.log("🔌 Widget: Force disconnecting client for fresh state"),U.disconnect().catch(ne=>{console.error("❌ Widget: Error during force disconnect:",ne)}))),N==="popup"&&!de&&De(!0),console.log("✅ Widget: handleBackToWelcome completed",{newCurrentMode:"welcome",newLoading:!1,newSessionStarted:!1})},ot=()=>{const ne=!de;De(ne),R&&R(ne),!ne&&!(B&&P)&&(ae("welcome"),W(!1),Q(null))},vt=()=>{console.log("🔄 Closing fullscreen, switching to widget display type"),e.onDisplayTypeChange?e.onDisplayTypeChange("widget"):console.warn("⚠️ No onDisplayTypeChange callback provided")},He=()=>{if(console.log("🔄 Expand to fullscreen requested"),e.onDisplayTypeChange)e.onDisplayTypeChange("fullscreen");else{console.warn("⚠️ No onDisplayTypeChange callback provided for expand functionality");const ne=document.getElementById("voice-card")||document.querySelector(".voxket-widget-container");ne&&ne.requestFullscreen&&ne.requestFullscreen().catch($e=>{console.warn("⚠️ Fullscreen API not supported or failed:",$e)})}};D.useEffect(()=>{var ne,$e,Ve;if(O&&U){const Ke=U.getCurrentSession();U.connected,Ke&&(console.log("✅ Restoring session state:",Ke.id),Q(Ke),W(!0),V(!1),(ne=Ke.activeModalities)!=null&&ne.includes("chat")?ae("chat"):($e=Ke.activeModalities)!=null&&$e.includes("voice")?ae("voice"):(Ve=Ke.activeModalities)!=null&&Ve.includes("video")&&ae("video"))}},[O,U]),D.useEffect(()=>()=>{!O&&U&&U.disconnect()},[U,O]);let bt=te==="video"?"w-[32rem]":"w-96",F=te==="video"?"h-[30rem]":"h-[25rem]",Z={};if(d&&(d.startsWith("w-")?bt=d:(Z.width=d,bt="")),f&&(f.startsWith("h-")?F=f:(Z.height=f,F="")),N==="popup"&&!de)return console.log("🟡 Showing popup trigger button"),h.jsx(DM,{onClick:ot,text:b,position:I,theme:y});if(j||!U){const ne=(ie==null?void 0:ie.message)||"VoxketWidget encountered an error. Please check your configuration.";return h.jsx("div",{className:`voxket-widget-root theme-${y} flex items-center justify-center p-8 ${u||""}`,style:{width:d||"400px",height:f||"500px",border:"1px solid #ff4444",borderRadius:"8px",background:"#fff5f5",color:"#cc0000"},children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"text-4xl mb-4",children:"⚠️"}),h.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Widget Error"}),h.jsx("p",{className:"text-sm mb-4",children:ne}),h.jsx("button",{onClick:()=>{H(!1),ee(null),window.location.reload()},className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors",children:"Retry"})]})})}let xe=`voxket-widget-root theme-${y}`,Ae={scrollMargin:0,scrollPadding:0,contain:"layout style paint"};N==="widget"?(xe+=` flex min-h-fit ${bt} ${F} ${u}`,Ae={...Ae,...Z}):(xe=`${u||""}`,Ae={});const Be=h.jsx("div",{className:"h-full w-full flex flex-col overflow-hidden relative z-10",children:h.jsxs(Sr,{mode:"wait",children:[te==="welcome"&&!w&&h.jsx(IM,{agentId:Y,participantName:$||"",onAgentIdChange:S,onParticipantNameChange:q,onStartCall:Ee,onStartChat:Te,onStartVideo:Ne,disabled:P||w,prompts:s,statusMessage:a,title:l,subTitle:c,theme:y,modalities:Ce,initial:{opacity:0,y:0},animate:{opacity:1,y:0},exit:{opacity:0,y:40},transition:{duration:.3,ease:"easeInOut"}},"welcome"),w&&(te==="voice"||te==="chat"||te==="video")&&h.jsx(PM,{theme:y,mode:te,loadingText:p,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.3,ease:"easeInOut"}},`loading-${te}`),te==="voice"&&!w&&P&&U&&h.jsxs(Ft.RoomContext.Provider,{value:K,children:[h.jsx(Ft.RoomAudioRenderer,{},`audio-${(B==null?void 0:B.id)||"no-session"}`),h.jsx(Ft.StartAudio,{label:"Start Audio"},`start-audio-${(B==null?void 0:B.id)||"no-session"}`),h.jsx(AM,{loadingText:p,participantName:$||"User",sessionStarted:P,disabled:!1,theme:y,client:U,displayType:N,onBack:N==="popup"?ot:we,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"voice-session")]}),te==="chat"&&!w&&P&&U&&h.jsx(RM,{client:U,theme:y,displayType:N,onBack:N==="popup"?ot:we,onEndChat:we,disabled:!1,initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:-40},transition:{duration:.3,ease:"easeInOut"}},"chat-view"),te==="video"&&!w&&P&&U&&h.jsxs(Ft.RoomContext.Provider,{value:K,children:[h.jsx(Ft.RoomAudioRenderer,{},`audio-video-${(B==null?void 0:B.id)||"no-session"}`),h.jsx(Ft.StartAudio,{label:"Start Audio"},`start-audio-video-${(B==null?void 0:B.id)||"no-session"}`),h.jsx(MM,{client:U,theme:y,displayType:N,onBack:N==="popup"?ot:we,onEndCall:we,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 N==="fullscreen"||N==="popup"?h.jsx(bf,{theme:y,displayType:N,popupPosition:I,onClose:N==="fullscreen"?vt:ot,children:Be}):h.jsx("div",{className:xe,style:Ae,children:h.jsx(bf,{theme:y,displayType:N,popupPosition:I,onExpand:He,children:Be})})}function oo(e){return h.jsx(Xl,{children:h.jsx(LM,{...e})})}function FM({logs:e,onClear:t,onExport:n}){const[r,i]=A.useState(!1),[o,s]=A.useState(""),a=e.filter(l=>!o||l.event.toLowerCase().includes(o.toLowerCase()));return r?h.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:h.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-4xl w-full max-h-[80vh] flex flex-col m-4",children:[h.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[h.jsxs("h2",{className:"text-lg font-semibold",children:["Session Logs (",e.length,")"]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"text",placeholder:"Filter events...",value:o,onChange:l=>s(l.target.value),className:"px-3 py-1 border rounded text-sm"}),h.jsx("button",{onClick:t,className:"px-3 py-1 bg-red-600 text-white rounded text-sm hover:bg-red-700",children:"Clear"}),h.jsx("button",{onClick:n,className:"px-3 py-1 bg-green-600 text-white rounded text-sm hover:bg-green-700",children:"Export"}),h.jsx("button",{onClick:()=>i(!1),className:"px-3 py-1 bg-gray-600 text-white rounded text-sm hover:bg-gray-700",children:"Close"})]})]}),h.jsx("div",{className:"flex-1 overflow-auto p-4",children:a.length===0?h.jsx("p",{className:"text-gray-500 text-center py-8",children:"No logs found"}):h.jsx("div",{className:"space-y-2",children:a.map((l,c)=>h.jsxs("div",{className:"border rounded p-3 text-sm",children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("span",{className:"font-semibold text-blue-600",children:l.event}),h.jsx("span",{className:"text-gray-500 text-xs",children:new Date(l.timestamp).toLocaleTimeString()})]}),l.sessionId&&h.jsxs("div",{className:"text-xs text-gray-600 mb-1",children:["Session: ",l.sessionId]}),l.data&&h.jsx("div",{className:"bg-gray-50 p-2 rounded text-xs",children:h.jsx("pre",{className:"whitespace-pre-wrap overflow-auto",children:JSON.stringify(l.data,null,2)})})]},c))})})]})}):h.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 BM({metrics:e}){return e?h.jsxs("div",{className:"bg-gray-100 p-4 rounded-lg",children:[h.jsx("h3",{className:"font-semibold mb-2",children:"Current Session"}),h.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-600",children:"Session ID:"}),h.jsx("div",{className:"font-mono text-xs",children:e.sessionId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-600",children:"Start Time:"}),h.jsx("div",{children:new Date(e.startTime).toLocaleString()})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-600",children:"Messages:"}),h.jsx("div",{children:e.totalMessages})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-600",children:"Participants:"}),h.jsx("div",{children:e.participantCount})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-600",children:"Connection Issues:"}),h.jsx("div",{children:e.connectionIssues})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-600",children:"Duration:"}),h.jsxs("div",{children:[Math.round((Date.now()-new Date(e.startTime).getTime())/1e3),"s"]})]})]})]}):null}function er(){const{currentSession:e,sessionState:t,sessionMetrics:n,createSession:r,endSession:i}=fn(),o=A.useCallback(async(a,l)=>await r(a,l),[r]),s=A.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:o,stop:s}}function lg(){const{sessionMetrics:e,currentSession:t}=fn();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 cg(){const{setMicrophoneEnabled:e,client:t}=fn(),[n,r]=A.useState(!1),[i,o]=A.useState(!1),s=A.useCallback(async()=>{if(!i){o(!0);try{const c=!n;await e(c),r(c)}catch(c){console.error("Failed to toggle microphone:",c)}finally{o(!1)}}},[n,i,e]),a=A.useCallback(async()=>{if(!(n||i)){o(!0);try{await e(!0),r(!0)}catch(c){console.error("Failed to enable microphone:",c)}finally{o(!1)}}},[n,i,e]),l=A.useCallback(async()=>{if(!(!n||i)){o(!0);try{await e(!1),r(!1)}catch(c){console.error("Failed to disable microphone:",c)}finally{o(!1)}}},[n,i,e]);return{isEnabled:n,isLoading:i,toggle:s,enable:a,disable:l}}function ug(){const{setCameraEnabled:e}=fn(),[t,n]=A.useState(!1),[r,i]=A.useState(!1),o=A.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]),s=A.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=A.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:o,enable:s,disable:a}}function dg(){const{startScreenShare:e,stopScreenShare:t}=fn(),[n,r]=A.useState(!1),[i,o]=A.useState(!1),s=A.useCallback(async()=>{if(!(n||i)){o(!0);try{await e(),r(!0)}catch(c){console.error("Failed to start screen share:",c)}finally{o(!1)}}},[n,i,e]),a=A.useCallback(async()=>{if(!(!n||i)){o(!0);try{await t(),r(!1)}catch(c){console.error("Failed to stop screen share:",c)}finally{o(!1)}}},[n,i,t]),l=A.useCallback(async()=>{n?await a():await s()},[n,s,a]);return{isSharing:n,isLoading:i,start:s,stop:a,toggle:l}}function jM(){const{client:e}=fn(),[t,n]=A.useState({tracks:[],layout:{type:"grid",showLocalVideo:!0,aspectRatio:"16:9"},isRecording:!1}),r=A.useMemo(()=>t.tracks.find(m=>m.isLocal),[t.tracks]),i=A.useMemo(()=>t.tracks.filter(m=>!m.isLocal),[t.tracks]),o=A.useCallback(async()=>{try{r!=null&&r.isEnabled?await(e==null?void 0:e.disableCamera()):await(e==null?void 0:e.enableCamera())}catch(m){throw console.error("Failed to toggle camera:",m),m}},[e,r]),s=A.useCallback(async()=>{try{t.tracks.find(x=>x.isScreenShare)?await(e==null?void 0:e.stopScreenShare()):await(e==null?void 0:e.startScreenShare())}catch(m){throw console.error("Failed to toggle screen share:",m),m}},[e,t.tracks]),a=A.useCallback(m=>{n(x=>({...x,layout:m}))},[]),l=A.useCallback(m=>{n(x=>({...x,pinnedTrack:m}))},[]),c=A.useCallback(()=>{n(m=>({...m,pinnedTrack:void 0}))},[]),u=A.useCallback(async()=>{try{await(e==null?void 0:e.startRecording()),n(m=>({...m,isRecording:!0}))}catch(m){throw console.error("Failed to start recording:",m),m}},[e]),d=A.useCallback(async()=>{try{await(e==null?void 0:e.stopRecording()),n(m=>({...m,isRecording:!1}))}catch(m){throw console.error("Failed to stop recording:",m),m}},[e]),f=A.useCallback(m=>t.tracks.find(x=>x.id===m),[t.tracks]),p=A.useCallback(m=>t.tracks.filter(x=>x.participantId===m),[t.tracks]),g=A.useCallback(m=>m.isEnabled&&t.tracks.includes(m),[t.tracks]);return A.useEffect(()=>{if(!e)return;const m=E=>{n(v=>({...v,tracks:[...v.tracks.filter(_=>_.id!==E.id),E]}))},x=E=>{n(v=>{var _;return{...v,tracks:v.tracks.filter(k=>k.id!==E),pinnedTrack:((_=v.pinnedTrack)==null?void 0:_.id)===E?void 0:v.pinnedTrack}})},y=E=>{n(v=>({...v,tracks:v.tracks.map(_=>_.id===E.id?E:_)}))};return e.on("videoTrackAdded",m),e.on("videoTrackRemoved",x),e.on("videoTrackUpdated",y),()=>{e.off("videoTrackAdded",m),e.off("videoTrackRemoved",x),e.off("videoTrackUpdated",y)}},[e]),{tracks:t.tracks,localTrack:r,remoteTraracks:i,pinnedTrack:t.pinnedTrack,layout:t.layout,isRecording:t.isRecording,toggleCamera:o,toggleScreenShare:s,setLayout:a,pinTrack:l,unpinTrack:c,startRecording:u,stopRecording:d,getTrackById:f,getTracksByParticipant:p,isTrackActive:g}}function Ko(){const{chatMessages:e,sendChatMessage:t,currentSession:n}=fn(),[r,i]=A.useState(!1),o=A.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:s,agentMessages:a,allMessages:l}=A.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:s,agentMessages:a,messageCount:l.length,isSending:r,canSend:!!n&&!r,send:o}}function $M(){const{send:e,isSending:t,canSend:n}=Ko(),[r,i]=A.useState(""),o=A.useCallback(async()=>{if(!(!r.trim()||!n))try{await e(r),i("")}catch(a){throw a}},[r,e,n]),s=A.useCallback(a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),o())},[o]);return{value:r,setValue:i,send:o,handleKeyPress:s,isSending:t,canSend:n&&r.trim().length>0}}function ec(){const{isConnected:e,isConnecting:t,connectionError:n,connect:r,disconnect:i}=fn(),o=A.useCallback(async()=>{if(!(e||t))try{await r()}catch(a){throw console.error("Failed to connect:",a),a}},[r,e,t]),s=A.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:o,disconnect:s}}function fg(){const{participants:e}=fn();return{participants:e,count:e.length,localParticipant:e.find(t=>t.isLocal),remoteParticipants:e.filter(t=>!t.isLocal)}}const hg=A.createContext({}),Si=()=>A.useContext(hg);function pg({children:e,...t}){return h.jsx(hg.Provider,{value:t,children:e})}function so({name:e,children:t,fallback:n,className:r}){return h.jsx("div",{className:`voxket-slot voxket-slot--${e} ${r||""}`,children:t||n})}function mg(e,t={}){return Object.assign(e,t)}function gg({showMicrophoneControl:e=!0,showCameraControl:t=!0,showScreenShareControl:n=!0,showSessionActions:r=!0,customControls:i,className:o=""}){const s=er(),a=cg(),l=ug(),c=dg(),u=Si(),d=["voxket-session-controls",`voxket-session-controls--${u.variant||"default"}`,`voxket-session-controls--${u.size||"md"}`,s.isActive?"voxket-session-controls--active":"voxket-session-controls--inactive",o].filter(Boolean).join(" ");return!s.isActive&&!r?h.jsx("div",{className:d,children:h.jsx("div",{className:"voxket-controls-inactive",children:h.jsx("p",{children:"Controls available during active session"})})}):h.jsxs("div",{className:d,children:[r&&h.jsx("div",{className:"voxket-session-actions",children:s.isActive?h.jsx("button",{onClick:s.stop,className:"voxket-button voxket-button--danger",children:"End Session"}):h.jsx(VM,{})}),s.isActive&&h.jsxs("div",{className:"voxket-media-controls",children:[e&&h.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:[h.jsx("span",{className:"voxket-icon",children:"🎤"}),a.isLoading?"Loading...":a.isEnabled?"Mute":"Unmute"]}),t&&h.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:[h.jsx("span",{className:"voxket-icon",children:"📹"}),l.isLoading?"Loading...":l.isEnabled?"Stop Video":"Start Video"]}),n&&h.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:[h.jsx("span",{className:"voxket-icon",children:"🖥️"}),c.isLoading?"Loading...":c.isSharing?"Stop Share":"Share Screen"]})]}),i&&h.jsx("div",{className:"voxket-custom-controls",children:i})]})}function VM(){er();const[e,t]=A.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 h.jsx("button",{onClick:n,disabled:e,className:"voxket-button voxket-button--primary",children:e?"Starting...":"Start Session"})}function tc({showConnectionStatus:e=!0,showSessionInfo:t=!0,showAgentInfo:n=!0,className:r=""}){const i=er(),o=ec(),s=Si(),a=["voxket-session-header",`voxket-session-header--${s.variant||"default"}`,`voxket-session-header--${s.size||"md"}`,r].filter(Boolean).join(" ");return h.jsxs("div",{className:a,children:[e&&h.jsxs("div",{className:"voxket-connection-status",children:[h.jsx("div",{className:`voxket-status-indicator ${o.isConnected?"connected":"disconnected"}`}),h.jsx("span",{className:"voxket-status-text",children:o.isConnecting?"Connecting...":o.isConnected?"Connected":"Disconnected"})]}),t&&i.session&&h.jsxs("div",{className:"voxket-session-info",children:[h.jsxs("div",{className:"voxket-session-id",children:["Session: ",i.session.id.slice(-8)]}),h.jsxs("div",{className:"voxket-session-state",children:["State: ",i.state]})]}),n&&i.session&&h.jsxs("div",{className:"voxket-agent-info",children:[h.jsxs("div",{className:"voxket-agent-id",children:["Agent: ",i.session.agentId]}),h.jsxs("div",{className:"voxket-modalities",children:["Modalities: ",i.session.activeModalities.join(", ")]})]}),o.error&&h.jsxs("div",{className:"voxket-error-message",children:["Error: ",o.error.message]})]})}function nc({showChat:e=!0,showTranscriptions:t=!1,customContent:n,className:r=""}){const i=er(),o=Ko(),s=Si(),a=["voxket-session-content",`voxket-session-content--${s.variant||"default"}`,`voxket-session-content--${s.size||"md"}`,r].filter(Boolean).join(" ");return i.isActive?h.jsx("div",{className:a,children:n||h.jsxs(h.Fragment,{children:[e&&h.jsxs("div",{className:"voxket-chat-container",children:[h.jsxs("div",{className:"voxket-chat-messages",children:[o.messages.map(l=>h.jsxs("div",{className:`voxket-message voxket-message--${l.sender.type}`,children:[h.jsxs("div",{className:"voxket-message-header",children:[h.jsx("span",{className:"voxket-message-sender",children:l.sender.name}),h.jsx("span",{className:"voxket-message-time",children:l.timestamp.toLocaleTimeString()})]}),h.jsx("div",{className:"voxket-message-content",children:l.content})]},l.id)),o.messages.length===0&&h.jsx("div",{className:"voxket-empty-messages",children:h.jsx("p",{children:"No messages yet. Start the conversation!"})})]}),h.jsx(zM,{})]}),t&&h.jsx("div",{className:"voxket-transcriptions",children:h.jsx("div",{className:"voxket-transcription-placeholder",children:h.jsx("p",{children:"Voice transcriptions will appear here"})})})]})}):h.jsx("div",{className:a,children:h.jsx("div",{className:"voxket-inactive-state",children:h.jsxs("div",{className:"voxket-inactive-message",children:[h.jsx("h3",{children:"Start a conversation"}),h.jsx("p",{children:"Begin a session to start chatting with the AI agent"})]})})})}function zM(){const e=Ko(),[t,n]=A.useState(""),r=async()=>{if(!(!t.trim()||!e.canSend))try{await e.send(t),n("")}catch(o){console.error("Failed to send message:",o)}},i=o=>{o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),r())};return h.jsxs("div",{className:"voxket-chat-input",children:[h.jsx("input",{type:"text",value:t,onChange:o=>n(o.target.value),onKeyPress:i,placeholder:"Type your message...",disabled:!e.canSend,className:"voxket-input"}),h.jsx("button",{onClick:r,disabled:!e.canSend||!t.trim(),className:"voxket-send-button",children:e.isSending?"Sending...":"Send"})]})}function rc({showMetrics:e=!0,showParticipants:t=!0,showStatus:n=!0,customFooter:r,className:i=""}){const o=er(),s=lg(),a=fg(),l=Si(),c=["voxket-session-footer",`voxket-session-footer--${l.variant||"default"}`,`voxket-session-footer--${l.size||"md"}`,i].filter(Boolean).join(" ");return o.isActive?h.jsx("div",{className:c,children:r||h.jsxs(h.Fragment,{children:[n&&h.jsxs("div",{className:"voxket-session-status",children:[h.jsx("div",{className:"voxket-status-indicator voxket-status-indicator--active"}),h.jsx("span",{className:"voxket-status-text",children:"Session Active"})]}),e&&s.metrics&&h.jsxs("div",{className:"voxket-session-metrics",children:[h.jsxs("div",{className:"voxket-metric",children:[h.jsx("span",{className:"voxket-metric-label",children:"Duration:"}),h.jsx("span",{className:"voxket-metric-value",children:UM(s.duration||0)})]}),h.jsxs("div",{className:"voxket-metric",children:[h.jsx("span",{className:"voxket-metric-label",children:"Messages:"}),h.jsx("span",{className:"voxket-metric-value",children:s.metrics.messageCount})]})]}),t&&h.jsxs("div",{className:"voxket-participants-info",children:[h.jsxs("span",{className:"voxket-participants-count",children:[a.count," participant",a.count!==1?"s":""]}),a.remoteParticipants.length>0&&h.jsx("div",{className:"voxket-participant-list",children:a.remoteParticipants.map(u=>h.jsx("span",{className:"voxket-participant-name",children:u.name},u.id))})]})]})}):h.jsx("div",{className:c,children:h.jsx("div",{className:"voxket-footer-inactive",children:h.jsx("span",{className:"voxket-status-text",children:"Ready to start session"})})})}function UM(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 HM({agentId:e,sessionConfig:t,autoStart:n=!1,onSessionStart:r,onSessionEnd:i,variant:o="default",size:s="md",theme:a,className:l="",children:c}){var p;const u=er(),d=ec();A.useEffect(()=>{n&&e&&d.isConnected&&!u.isActive&&u.start(e,t).catch(console.error)},[n,e,d.isConnected,u.isActive]),A.useEffect(()=>{var g;(g=u.session)!=null&&g.id&&r&&r(u.session.id)},[(p=u.session)==null?void 0:p.id,r]),A.useEffect(()=>()=>{u.isActive&&i&&u.stop().then(i).catch(console.error)},[]);const f=["voxket-session",`voxket-session--${o}`,`voxket-session--${s}`,u.isActive?"voxket-session--active":"voxket-session--inactive",l].filter(Boolean).join(" ");return h.jsx(pg,{variant:o,size:s,theme:a,className:l,children:h.jsx("div",{className:f,children:c||h.jsxs(h.Fragment,{children:[h.jsx(so,{name:"header",fallback:h.jsx(tc,{})}),h.jsx(so,{name:"content",fallback:h.jsx(nc,{})}),h.jsx(so,{name:"footer",fallback:h.jsx(rc,{})})]})})})}const bg=mg(HM,{Header:tc,Content:nc,Footer:rc,Controls:gg}),Yn={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)"}},La={...Yn,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)"}},Fa={...Yn,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"}},yg=A.createContext(null),xg=()=>{const e=A.useContext(yg);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e};function WM({theme:e="default",themes:t={},children:n,cssVariables:r=!0,className:i=""}){const[o,s]=A.useState(()=>{const f={default:Yn,dark:La,enterprise:Fa,...t};return typeof e=="string"?f[e]||Yn:e}),[a,l]=A.useState(()=>({default:Yn,dark:La,enterprise:Fa,...t})),c=f=>{if(typeof f=="string"){const p=a[f];p&&s(p)}else s(f)},u=f=>{l(p=>({...p,[f.name]:f}))};A.useEffect(()=>{if(r&&typeof document<"u"){const f=document.documentElement;Object.entries(wg(o)).forEach(([p,g])=>{f.style.setProperty(`--voxket-${p}`,g)})}},[o,r]);const d={theme:o,setTheme:c,themes:a,registerTheme:u};return h.jsx(yg.Provider,{value:d,children:h.jsx("div",{className:`voxket-theme voxket-theme--${o.name} ${i}`,children:n})})}function wg(e){const t={},n=(r,i="")=>{for(const[o,s]of Object.entries(r)){const a=i?`${i}-${o}`:o;typeof s=="object"&&s!==null&&!Array.isArray(s)?n(s,a):t[a]=String(s)}};return n(e),t}function GM(e=Yn,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 KM(e){var n;const{theme:t}=xg();return((n=t.components)==null?void 0:n[e])||{}}const qM=Jl("voice-modality","voice",{onActivate:async e=>{const t=e.config;t.enableTranscription&&YM(e),t.enableVoiceActivation&&ZM(e,t),console.log("Voice modality activated",t)},onDeactivate:async e=>{console.log("Voice modality deactivated")},onMessage:async(e,t)=>{t.type==="audio"&&XM(e,t)}});function YM(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 ZM(e,t){const n=t.silenceThreshold||-50;console.log("Voice activation setup with threshold:",n)}function XM(e,t){console.log("Playing audio response:",t.content)}const QM=Jl("chat-modality","chat",{onActivate:async e=>{const t=e.config;t.enableRichText&&JM(),t.enableFileUpload&&eI(e),t.enableCustomComponents&&tI(),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"?nI(e,t):t.type==="text"&&n.enableRichText&&rI(e,t)}});function JM(e){console.log("Rich text support enabled")}function eI(e){console.log("File upload enabled"),e.on("chat.file.uploaded",t=>{console.log("File uploaded:",t.name)})}function tI(e){console.log("Custom components enabled");const t=new Map;t.set("quick-actions",iI),t.set("form",oI),t.set("card",sI),t.set("chart",aI)}function nI(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 rI(e,t){console.log("Processing rich text message:",t.content)}function iI(e){return{type:"quick-actions",actions:e.actions||[],layout:e.layout||"horizontal"}}function oI(e){return{type:"form",fields:e.fields||[],submitAction:e.submitAction,validation:e.validation}}function sI(e){return{type:"card",title:e.title,content:e.content,actions:e.actions,variant:e.variant||"default"}}function aI(e){return{type:"chart",chartType:e.chartType||"line",data:e.data,options:e.options}}function ao({track:e,participantName:t,showControls:n=!0,showName:r=!0,showMuteIndicator:i=!0,isPinned:o=!1,className:s="",onClick:a,onPin:l,onUnpin:c}){const u=A.useRef(null),[d,f]=A.useState(!1);A.useEffect(()=>{if(!u.current||!e.isEnabled)return;const x=u.current;return x.srcObject=null,()=>{x.srcObject&&(x.srcObject=null)}},[e]);const p=()=>{a==null||a(e)},g=x=>{x.stopPropagation(),o?c==null||c(e):l==null||l(e)},m=["voxket-video-tile",e.isLocal?"voxket-video-tile--local":"voxket-video-tile--remote",e.isScreenShare?"voxket-video-tile--screen-share":"voxket-video-tile--camera",o?"voxket-video-tile--pinned":"",e.isEnabled?"":"voxket-video-tile--disabled",d?"voxket-video-tile--hovered":"",s].filter(Boolean).join(" ");return h.jsxs("div",{className:m,onClick:p,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),style:{aspectRatio:e.dimensions?`${e.dimensions.width} / ${e.dimensions.height}`:"16 / 9"},children:[h.jsx("video",{ref:u,className:"voxket-video-element",autoPlay:!0,playsInline:!0,muted:e.isLocal}),!e.isEnabled&&h.jsxs("div",{className:"voxket-video-placeholder",children:[h.jsx("div",{className:"voxket-video-placeholder-icon",children:e.isScreenShare?"🖥️":"📹"}),h.jsx("p",{className:"voxket-video-placeholder-text",children:e.isScreenShare?"Screen sharing paused":"Camera off"})]}),h.jsxs("div",{className:"voxket-video-overlay",children:[r&&t&&h.jsxs("div",{className:"voxket-video-name",children:[t,e.isLocal&&" (You)"]}),i&&!e.isEnabled&&h.jsx("div",{className:"voxket-video-mute-indicator",children:"🔇"}),n&&(d||o)&&h.jsxs("div",{className:"voxket-video-controls",children:[h.jsx("button",{className:`voxket-video-control-btn ${o?"voxket-video-control-btn--active":""}`,onClick:g,title:o?"Unpin video":"Pin video",children:"📌"}),e.isScreenShare&&h.jsx("div",{className:"voxket-video-indicator",children:"🖥️"}),e.source&&h.jsx("div",{className:"voxket-video-source",children:e.source})]})]}),!e.isEnabled&&h.jsx("div",{className:"voxket-video-loading",children:h.jsx("div",{className:"voxket-spinner"})})]})}function lI({tracks:e,layout:t,className:n="",onLayoutChange:r,onTrackClick:i,maxVisibleTracks:o=9,showPagination:s=!0}){const[a,l]=A.useState(0),[c,u]=A.useState(null),d=A.useMemo(()=>{let E=[...e];t.type==="speaker"&&c&&(E=[c,...e.filter(k=>k.id!==c.id)]);const v=a*o,_=v+o;return E.slice(v,_)},[e,t,c,a,o]),f=Math.ceil(e.length/o),p=A.useMemo(()=>{const E=d.length;switch(t.type){case"grid":const v=Math.ceil(Math.sqrt(E)),_=Math.ceil(E/v);return{display:"grid",gridTemplateColumns:`repeat(${v}, 1fr)`,gridTemplateRows:`repeat(${_}, 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=E=>{u(E)},m=()=>{u(null)},x=E=>{r==null||r({...t,type:E})},y=["voxket-video-grid",`voxket-video-grid--${t.type}`,`voxket-video-grid--${d.length}-tracks`,n].filter(Boolean).join(" ");return e.length===0?h.jsx("div",{className:"voxket-video-grid-empty",children:h.jsxs("div",{className:"voxket-video-grid-empty-content",children:[h.jsx("div",{className:"voxket-video-grid-empty-icon",children:"📹"}),h.jsx("p",{children:"No video tracks available"})]})}):h.jsxs("div",{className:y,children:[h.jsxs("div",{className:"voxket-video-grid-controls",children:[h.jsx("div",{className:"voxket-video-layout-controls",children:["grid","speaker","sidebar","gallery"].map(E=>h.jsx("button",{className:`voxket-layout-btn ${t.type===E?"voxket-layout-btn--active":""}`,onClick:()=>x(E),title:`Switch to ${E} layout`,children:cI(E)},E))}),h.jsxs("div",{className:"voxket-video-count",children:[e.length," participant",e.length!==1?"s":""]})]}),h.jsx("div",{className:"voxket-video-grid-content",style:p,children:t.type==="speaker"&&c?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"voxket-video-speaker-main",children:h.jsx(ao,{track:c,participantName:`Participant ${c.participantId}`,isPinned:!0,onClick:i,onUnpin:m})}),h.jsx("div",{className:"voxket-video-speaker-sidebar",children:d.filter(E=>E.id!==c.id).map(E=>h.jsx(ao,{track:E,participantName:`Participant ${E.participantId}`,showControls:!1,onClick:i,onPin:g},E.id))})]}):d.map(E=>h.jsx(ao,{track:E,participantName:`Participant ${E.participantId}`,isPinned:(c==null?void 0:c.id)===E.id,onClick:i,onPin:g,onUnpin:m},E.id))}),s&&f>1&&h.jsxs("div",{className:"voxket-video-pagination",children:[h.jsx("button",{className:"voxket-pagination-btn",onClick:()=>l(Math.max(0,a-1)),disabled:a===0,children:"←"}),h.jsxs("span",{className:"voxket-pagination-info",children:["Page ",a+1," of ",f]}),h.jsx("button",{className:"voxket-pagination-btn",onClick:()=>l(Math.min(f-1,a+1)),disabled:a===f-1,children:"→"})]})]})}function cI(e){switch(e){case"grid":return"⊞";case"speaker":return"🎤";case"sidebar":return"⫸";case"gallery":return"⊡";case"picture-in-picture":return"⧉";default:return"⊞"}}function uI({localTrack:e,onToggleCamera:t,onToggleScreenShare:n,onLayoutChange:r,showLayoutControls:i=!0,showCameraControls:o=!0,showScreenShareControls:s=!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 h.jsxs("div",{className:l,children:[o&&h.jsxs("div",{className:"voxket-video-controls-section",children:[h.jsx("h4",{className:"voxket-video-controls-title",children:"Camera"}),h.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:[h.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isEnabled?"📹":"📷"}),h.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isEnabled?"Camera On":"Camera Off"})]}),(e==null?void 0:e.dimensions)&&h.jsxs("div",{className:"voxket-video-info",children:[e.dimensions.width," × ",e.dimensions.height]})]}),s&&h.jsxs("div",{className:"voxket-video-controls-section",children:[h.jsx("h4",{className:"voxket-video-controls-title",children:"Screen Share"}),h.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:[h.jsx("span",{className:"voxket-control-icon",children:e!=null&&e.isScreenShare?"🛑":"🖥️"}),h.jsx("span",{className:"voxket-control-label",children:e!=null&&e.isScreenShare?"Stop Sharing":"Share Screen"})]})]}),i&&h.jsxs("div",{className:"voxket-video-controls-section",children:[h.jsx("h4",{className:"voxket-video-controls-title",children:"Layout"}),h.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:f})=>h.jsxs("button",{className:"voxket-layout-control-btn",onClick:()=>c(u),title:`Switch to ${f} layout`,children:[h.jsx("span",{className:"voxket-control-icon",children:d}),h.jsx("span",{className:"voxket-control-label",children:f})]},u))})]}),h.jsxs("div",{className:"voxket-video-controls-section",children:[h.jsx("h4",{className:"voxket-video-controls-title",children:"Video Settings"}),h.jsxs("div",{className:"voxket-video-settings",children:[h.jsxs("div",{className:"voxket-setting-group",children:[h.jsx("label",{className:"voxket-setting-label",children:"Quality"}),h.jsxs("select",{className:"voxket-setting-select",children:[h.jsx("option",{value:"high",children:"High (720p)"}),h.jsx("option",{value:"medium",children:"Medium (480p)"}),h.jsx("option",{value:"low",children:"Low (240p)"})]})]}),h.jsxs("div",{className:"voxket-setting-group",children:[h.jsx("label",{className:"voxket-setting-label",children:"Frame Rate"}),h.jsxs("select",{className:"voxket-setting-select",children:[h.jsx("option",{value:"30",children:"30 fps"}),h.jsx("option",{value:"15",children:"15 fps"}),h.jsx("option",{value:"10",children:"10 fps"})]})]}),h.jsxs("div",{className:"voxket-setting-group",children:[h.jsx("label",{className:"voxket-setting-label",children:"Bandwidth"}),h.jsxs("select",{className:"voxket-setting-select",children:[h.jsx("option",{value:"unlimited",children:"Unlimited"}),h.jsx("option",{value:"1000",children:"1 Mbps"}),h.jsx("option",{value:"500",children:"500 Kbps"}),h.jsx("option",{value:"250",children:"250 Kbps"})]})]})]})]}),h.jsxs("div",{className:"voxket-video-controls-section",children:[h.jsx("h4",{className:"voxket-video-controls-title",children:"Statistics"}),h.jsxs("div",{className:"voxket-video-stats",children:[h.jsxs("div",{className:"voxket-stat-item",children:[h.jsx("span",{className:"voxket-stat-label",children:"Resolution:"}),h.jsx("span",{className:"voxket-stat-value",children:e!=null&&e.dimensions?`${e.dimensions.width}×${e.dimensions.height}`:"N/A"})]}),h.jsxs("div",{className:"voxket-stat-item",children:[h.jsx("span",{className:"voxket-stat-label",children:"Source:"}),h.jsx("span",{className:"voxket-stat-value",children:(e==null?void 0:e.source)||"None"})]}),h.jsxs("div",{className:"voxket-stat-item",children:[h.jsx("span",{className:"voxket-stat-label",children:"Status:"}),h.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 vg=({handler:e,loadData:t,data:n,client:r,addLocalMessage:i})=>{const[o,s]=D.useState(null),[a,l]=D.useState(!0),[c,u]=D.useState(!1),[d]=D.useState(Date.now());D.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 x={title:n.title||"Untitled Assignment",description:n.description||"No description provided",estimated_time_of_completion:n.estimated_time_of_completion||"Unknown"};s(x),console.log("📋 AssignmentView: Assignment loaded from RPC data:",x)}}catch(x){console.error("📋 AssignmentView: Error loading assignment:",x),s({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 f=({message:m,assignment:x})=>{const y=m.toLowerCase().includes("declined"),E=y?"bg-red-50 border-red-200":"bg-green-50 border-green-200",v=y?"text-red-700":"text-green-700",_=y?"❌":"🎉";return h.jsxs("div",{className:`max-w-sm mx-auto ${E} border rounded-lg shadow p-3 flex flex-col items-center`,children:[h.jsx("div",{className:"text-2xl mb-2",children:_}),h.jsx("div",{className:`${v} font-semibold text-sm mb-1`,children:m}),h.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:x.title}),h.jsx("div",{className:"text-xs text-gray-500",children:"Thank you for your response!"})]})},p=async()=>{if(!(!o||!e)){u(!0);try{const m={message:"accepted"};console.log("📋 AssignmentView: Assignment accepted:",m),e.didSuccess(m,h.jsx(f,{message:"Assignment accepted!",assignment:o}))}catch(m){console.error("📋 AssignmentView: Error accepting assignment:",m),e.didFail({error:"Failed to accept assignment"})}finally{u(!1)}}},g=async()=>{if(!(!o||!e)){u(!0);try{const m={message:"declined"};console.log("📋 AssignmentView: Assignment declined:",m),e.didSuccess(m,h.jsx(f,{message:"Assignment declined",assignment:o}))}catch(m){console.error("📋 AssignmentView: Error declining assignment:",m),e.didFail({error:"Failed to decline assignment"})}finally{u(!1)}}};return a?h.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:h.jsxs("div",{className:"flex items-center justify-center py-4",children:[h.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),h.jsx("span",{className:"ml-2 text-xs text-gray-600",children:"Loading assignment..."})]})}):o?h.jsxs("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg overflow-hidden",children:[h.jsx("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 text-white p-3",children:h.jsx("div",{className:"flex items-center justify-between",children:h.jsx("h3",{className:"text-xs font-semibold text-white truncate",children:o.title})})}),h.jsxs("div",{className:"p-3 text-black",children:[h.jsx("div",{className:"bg-gray-50 rounded p-2 mb-3",children:h.jsx("p",{className:"text-xs text-black leading-snug",children:o.description})}),h.jsx("div",{className:"mb-3 text-black",children:h.jsxs("div",{className:"flex items-center text-xs text-gray-600",children:[h.jsx("span",{className:"text-xs mr-1",children:"📅"}),h.jsxs("span",{children:["Est: ",o.estimated_time_of_completion]})]})}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{onClick:p,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?h.jsxs("span",{className:"flex items-center justify-center",children:[h.jsx("div",{className:"animate-spin rounded-full h-2 w-2 border-b-2 border-white mr-1"}),h.jsx("span",{className:"text-xs",children:"Processing..."})]}):"Accept"}),h.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"})]})]})]}):h.jsx("div",{className:"max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3",children:h.jsxs("div",{className:"text-center py-4",children:[h.jsx("div",{className:"text-red-600 text-sm font-semibold mb-2",children:"⚠️ Assignment Error"}),h.jsx("p",{className:"text-xs text-gray-600 mb-3",children:"Failed to load assignment details."})]})})};function dI(){const[e,t]=D.useState(null),[n,r]=D.useState([]);D.useEffect(()=>{const a=new ki({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",vg,"embedded");const a=e.getRegisteredRpcMethods();r(a),console.log("✅ Assignment RPC registered successfully")}catch(a){console.error("❌ Failed to register assignment RPC:",a)}},o=async()=>{if(!e)return;const a=({handler:l,timeout:c})=>{const[u,d]=D.useState(""),f=[{id:"pro",name:"Pro Plan",price:"$29/month"},{id:"enterprise",name:"Enterprise Plan",price:"$99/month"},{id:"basic",name:"Basic Plan",price:"$9/month"}],p=m=>{d(m)},g=()=>{const m=f.find(x=>x.id===u);l==null||l.didSuccess({selectedProduct:u,productName:m==null?void 0:m.name,price:m==null?void 0:m.price,timestamp:new Date().toISOString()})};return h.jsxs("div",{className:"p-6 bg-white rounded-lg",children:[h.jsx("h3",{className:"text-xl font-bold mb-4",children:"Choose Your Plan"}),h.jsx("p",{className:"text-gray-600 mb-4",children:"Select the plan that best fits your needs:"}),h.jsx("div",{className:"space-y-3 mb-6",children:f.map(m=>h.jsx("div",{onClick:()=>p(m.id),className:`p-4 border rounded-lg cursor-pointer transition-all ${u===m.id?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-gray-300"}`,children:h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsxs("div",{children:[h.jsx("h4",{className:"font-medium",children:m.name}),h.jsx("p",{className:"text-gray-600 text-sm",children:m.price})]}),h.jsx("div",{className:`w-4 h-4 rounded-full ${u===m.id?"bg-blue-500":"border-2 border-gray-300"}`})]})},m.id))}),h.jsxs("div",{className:"flex justify-end space-x-3",children:[h.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"}),h.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&&h.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)}},s=async()=>{if(!e)return;const a=({handler:l})=>{const[c,u]=D.useState(0),[d,f]=D.useState(""),p=()=>{l==null||l.didSuccess({rating:c,comment:d,timestamp:new Date().toISOString()})};return h.jsxs("div",{className:"p-4 bg-white rounded-lg",children:[h.jsx("h3",{className:"text-lg font-semibold mb-3",children:"How was your experience?"}),h.jsxs("div",{className:"mb-4",children:[h.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Rate your experience:"}),h.jsx("div",{className:"flex space-x-1",children:[1,2,3,4,5].map(g=>h.jsx("button",{onClick:()=>u(g),className:`text-2xl ${g<=c?"text-yellow-400":"text-gray-300"}`,children:"⭐"},g))})]}),h.jsxs("div",{className:"mb-4",children:[h.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Additional comments:"}),h.jsx("textarea",{value:d,onChange:g=>f(g.target.value),className:"w-full p-2 border border-gray-300 rounded text-sm",rows:3,placeholder:"Tell us more about your experience..."})]}),h.jsxs("div",{className:"flex justify-end space-x-2",children:[h.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"}),h.jsx("button",{onClick:p,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 h.jsxs("div",{className:"p-6",children:[h.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Frontend RPC Examples"}),h.jsxs("div",{className:"space-y-4 mb-6",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Register RPC Methods"}),h.jsxs("div",{className:"space-x-2",children:[h.jsx("button",{onClick:i,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Register Assignment RPC"}),h.jsx("button",{onClick:o,className:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600",children:"Register Product Recommendation RPC"}),h.jsx("button",{onClick:s,className:"px-4 py-2 bg-purple-500 text-white rounded hover:bg-purple-600",children:"Register Feedback RPC"})]})]}),h.jsxs("div",{children:[h.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Registered Methods"}),n.length>0?h.jsx("ul",{className:"list-disc list-inside space-y-1",children:n.map(a=>h.jsx("li",{className:"text-gray-700",children:h.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:a})},a))}):h.jsx("p",{className:"text-gray-500",children:"No methods registered yet"})]})]}),h.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[h.jsx("h3",{className:"text-lg font-semibold mb-2",children:"How it works"}),h.jsxs("ol",{className:"list-decimal list-inside space-y-2 text-sm text-gray-700",children:[h.jsxs("li",{children:["Register RPC methods with React components using ",h.jsx("code",{children:"client.registerFrontendRPC()"})]}),h.jsx("li",{children:"When the agent calls an RPC method, the corresponding component will be displayed"}),h.jsx("li",{children:"Users interact with the component, and the response is sent back to the agent"}),h.jsx("li",{children:"Components can be displayed in different modes: embedded, modal, or fullscreen"}),h.jsx("li",{children:"Each component has a timeout and can handle success/failure scenarios"})]})]}),h.jsxs("div",{className:"mt-6 bg-blue-50 p-4 rounded-lg",children:[h.jsx("h3",{className:"text-lg font-semibold mb-2 text-blue-800",children:"Agent Side"}),h.jsx("p",{className:"text-sm text-blue-700 mb-2",children:"On the agent side, you can call these RPC methods like this:"}),h.jsx("pre",{className:"bg-white p-3 rounded text-xs text-gray-800 overflow-x-auto",children:`// Agent calls RPC method
160
160
  const response = await participant.performRpc({
161
161
  method: 'give_assignment',
162
162
  data: JSON.stringify({
@@ -167,4 +167,4 @@ const response = await participant.performRpc({
167
167
  })
168
168
  });
169
169
 
170
- console.log('User response:', response);`})]})]})}const hI={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"}}}},pI=e=>typeof window>"u"?null:P.createElement(Xl,{children:P.createElement(oo,e)});exports.AssignmentView=Eg;exports.CompoundProvider=mg;exports.InteractiveComponent=li;exports.PluginManager=ag;exports.RpcExamples=fI;exports.SessionContainer=yg;exports.SessionContent=nc;exports.SessionControls=bg;exports.SessionFooter=rc;exports.SessionHeader=tc;exports.SessionLogViewer=BM;exports.SessionMetricsComponent=jM;exports.SessionTimer=ci;exports.Slot=so;exports.ThemeProvider=GM;exports.VideoControls=dI;exports.VideoGrid=cI;exports.VideoTile=ao;exports.VoxketClient=ki;exports.VoxketErrorBoundary=Xl;exports.VoxketEventEmitter=Ql;exports.VoxketProvider=io;exports.VoxketSDK=ki;exports.VoxketSessionComponent=yg;exports.agentRpcExample=hI;exports.analyticsPlugin=_M;exports.chatModalityPlugin=JM;exports.createCustomTheme=KM;exports.createModalityPlugin=Jl;exports.createPlugin=CM;exports.createSessionFixture=No;exports.darkTheme=La;exports.debugPlugin=TM;exports.default=pI;exports.defaultTheme=Yn;exports.enterpriseTheme=Fa;exports.flattenTheme=vg;exports.formatSessionTimer=up;exports.getChatCapabilities=lp;exports.getSessionTimer=Ao;exports.getVideoCapabilities=ap;exports.getVoiceCapabilities=cp;exports.isCapabilityEnabled=lv;exports.metricsPlugin=NM;exports.useComponentTheme=qM;exports.useCompoundContext=Si;exports.useSessionLogging=sg;exports.useTheme=wg;exports.useVoxket=hn;exports.useVoxketCamera=dg;exports.useVoxketChat=Ko;exports.useVoxketChatInput=VM;exports.useVoxketConnection=ec;exports.useVoxketMetrics=cg;exports.useVoxketMicrophone=ug;exports.useVoxketParticipants=hg;exports.useVoxketScreenShare=fg;exports.useVoxketSession=er;exports.useVoxketVideo=$M;exports.voiceModalityPlugin=YM;exports.withCompoundComponent=gg;
170
+ console.log('User response:', response);`})]})]})}const fI={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"}}}},hI=e=>typeof window>"u"?null:D.createElement(Xl,{children:D.createElement(oo,e)});exports.AssignmentView=vg;exports.CompoundProvider=pg;exports.InteractiveComponent=li;exports.PluginManager=sg;exports.RpcExamples=dI;exports.SessionContainer=bg;exports.SessionContent=nc;exports.SessionControls=gg;exports.SessionFooter=rc;exports.SessionHeader=tc;exports.SessionLogViewer=FM;exports.SessionMetricsComponent=BM;exports.SessionTimer=ci;exports.Slot=so;exports.ThemeProvider=WM;exports.VideoControls=uI;exports.VideoGrid=lI;exports.VideoTile=ao;exports.VoxketClient=ki;exports.VoxketErrorBoundary=Xl;exports.VoxketEventEmitter=Ql;exports.VoxketProvider=io;exports.VoxketSDK=ki;exports.VoxketSessionComponent=bg;exports.agentRpcExample=fI;exports.analyticsPlugin=CM;exports.chatModalityPlugin=QM;exports.createCustomTheme=GM;exports.createModalityPlugin=Jl;exports.createPlugin=SM;exports.createSessionFixture=No;exports.darkTheme=La;exports.debugPlugin=_M;exports.default=hI;exports.defaultTheme=Yn;exports.enterpriseTheme=Fa;exports.flattenTheme=wg;exports.formatSessionTimer=cp;exports.getChatCapabilities=ap;exports.getSessionTimer=Ao;exports.getVideoCapabilities=sp;exports.getVoiceCapabilities=lp;exports.isCapabilityEnabled=av;exports.metricsPlugin=TM;exports.useComponentTheme=KM;exports.useCompoundContext=Si;exports.useSessionLogging=og;exports.useTheme=xg;exports.useVoxket=fn;exports.useVoxketCamera=ug;exports.useVoxketChat=Ko;exports.useVoxketChatInput=$M;exports.useVoxketConnection=ec;exports.useVoxketMetrics=lg;exports.useVoxketMicrophone=cg;exports.useVoxketParticipants=fg;exports.useVoxketScreenShare=dg;exports.useVoxketSession=er;exports.useVoxketVideo=jM;exports.voiceModalityPlugin=qM;exports.withCompoundComponent=mg;